Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Re-use sounds from the SoundFX Generator with the USB keyboard

    Work In Progress
    4
    14
    923
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • spikey
      spikey F last edited by spikey

      Share ID: USS73MNDN8

      I found some nice sounds, by playing around with the included SoundFX Generator demo from @Dave. And I tried to apply the values, shown on screen, in my program like this:
      The ":" can be replaced by a "." when passing the value as a parameter to the functions below.

      1. VOLUME = vol
      2. NOISE = waveType
      3. FREQENCY = freq
      4. SPEED = speed
      5. REVERB = reverb
      6. NO-FILTER = filterType
      7. CUT-OFF = filterFreq
      8. SQUARE = modWaveType
      9. MOD-FREQ = modFreq
      10. MOD-SCALE = modScale
      setReverb(0, reverb, 0.5)
      setFilter(0, filterType, filterFreq)
      setModulator(0, modWaveType, modFreq, modScale)
      playNote(0, waveType, freq, vol, speed, 0.5)
      

      I am still struggling a bit, with the maths of the parameters.
      a) modScale has no effect if the original tone is SAW and the modulation is set to SAW. I am not sure yet what modScale means exactly. I thought its the amplitude of the modulation? (Sorry, I am very new to this synth modulation stuff)
      b) sometimes, when I have a nice sounding combination of a a 311.126 Hz SAW with a modFreq 43.99 and modScale of 144, it sounds bad, if I switch one note up or down. How do you adapt the modScale to not break the harmony?

      spikey 1 Reply Last reply Reply Quote 1
      • spikey
        spikey F last edited by spikey

        c) [SOLVED] 😅 playing a sound as long the key is hold down. Because the key buffer is empty for 1 sec after the key is then repeated every 6 frames.
        a: means the key 'a' has been pressed or is still hold down and a sound is played, or will be prolonged
        \: means that it has been detected that you released the key
        +: means the note speed (length) will be extended until the key is released

        1 Reply Last reply Reply Quote 1
        • spikey
          spikey F last edited by spikey

          Hint: The auto-repeat time between a key press and its re-appearing in the key buffer, is different if you are already holding down another key.

          Started to do this with 24 keys on the keyboard. My idea was to be able to play a chord and hold 3 notes at the same time, when 3 keys are hold down.
          Then I found out that "a_____________________________a______a" is how this looks like, when "a" is hold down--> the keybuffer is empty from 2nd to 29th frame.
          But for two keys pressed right after each other: "a_____b_______________________ab______ab", the key "b" is not repeated after its 29th frame but already together with 'a'. So, if the key buffer is already in the mode of "ready to repeat", every key is immediately part of the 29th frame after the first key press.
          Gosh. So, you will not be able to hold one tone, and playing staccato with another tone at the same time.
          I think its time to simplify the target and accept some limits.

          Possible solution, if people are doing more keyboard-related projects, would be a feature to set the auto-repeat time of a key: setKeyboardAutoRepeat(time) if set to 0 the keys are not repeated if hold down. If set to 1 the key is always part of the keyboard buffer, until released. If set to 29 its working as is.

          1 Reply Last reply Reply Quote 1
          • spikey
            spikey F last edited by

            I did an attempt to record notes, from key presses. Seems to make the tool a bit interesting. This is a test when I recorded a base line and let it play. Meanwhile I press some new keys on top of it. (I just saw, that the volume mastering is awful, listen to it in twitter. I will have to compare the volumes a bit between headphones, TV and recorded video)

            Hint: If you apply a modulator it will use up more, than one channel to play a note. So, you will not be able to play up to 16 notes, without creating noise instead of tones.

            1 Reply Last reply Reply Quote 3
            • DomDom
              DomDom F last edited by

              Good hint thanks for that.

              1 Reply Last reply Reply Quote 0
              • spikey
                spikey F @spikey last edited by spikey

                @spikey I just found out that I was re-inventing the wheel here, @Nisse5 did explore this functions already heavily. Hope the Sound FX Generator related information may still be of some use.

                1 Reply Last reply Reply Quote 0
                • spikey
                  spikey F last edited by spikey


                  ID: USS73MNDN8

                  • You can save sound-settings
                  • Undocumented: "0" "." plays and records
                  • Note: theres a menu point for switching EN/GE keyboard to get the Z Y right
                    After more testing, fixes for hopefully minor issues will follow and maybe some better default sounds.
                  1 Reply Last reply Reply Quote 6
                  • spikey
                    spikey F last edited by spikey

                    After getting distracted by all the directions this project could go, I focused back on the main idea, why I built this: experimenting as efficient as possible with all synthesizer parameters to find sounds that would allow to come up with more self made music. My vision is to create a game soundtrack by myself.


                    Release notes, 6th May 2020 ;-)

                    • direct parameter input is possible (Y-button, or "P" key)
                    • added "ratio" parameter for the modulation: it dynamically sets the modulation frequency in relation to the note (carrier frequency)
                      what results in a better harmony of the modulation (I guess? Any expert or tester comment on that assumption is welcome)
                    • random note can be played, for quickly checking the effect of a paramter change (A-button)
                    • browse through the sounds with L and R-button
                    • switch octaves with ZL and ZR-button

                    As the experimenting process is now more efficient than before, I hope I manage to achieve to provide some sounding instruments. I did not store any pre-saved sounds as a file, only in code. So, if you redownload a later version, your own created sounds will not be overwritten.

                    waldron DomDom 2 Replies Last reply Reply Quote 1
                    • waldron
                      waldron F @spikey last edited by

                      @spikey forgive my noobness with this is it possible to track what you play then when you return to the editor are you able to copy and paste to use as a sound track in another program?

                      spikey 1 Reply Last reply Reply Quote 2
                      • spikey
                        spikey F @waldron last edited by

                        @waldron Currently you can record with "."-key and playback with "0" (not documented yet). For a start.
                        For the "re-use the song info"-use case I was thinking a lot. The main issue is "copy and paste" is not possible from one running-program (like writing to the clipboard) to another program open in the editor. So, either I show the code on screen and one has to type it afterwards or I save it in a file and the game has to be copied into this program and replace the "Musical USB Keyboard" code (then the file would already be here). Any better ideas are welcome.

                        waldron 1 Reply Last reply Reply Quote 0
                        • waldron
                          waldron F @spikey last edited by

                          @spikey im fine writing it down to be honest, i prefer to play and hear it as i play instead of inputting notes then hear the out come if that makes sense. i thought it might be possible to use persistent data but i have no idea how that works

                          pianofire 1 Reply Last reply Reply Quote 1
                          • pianofire
                            pianofire Fuze Team @waldron last edited by pianofire

                            @waldron Programmatic clipboard access is certainly on the feature request list but not for the next patch unfortunately

                            1 Reply Last reply Reply Quote 4
                            • DomDom
                              DomDom F @spikey last edited by

                              @spikey I want one of these. I have just come to realise that coding tunes in the editor is a bit too much trouble. Good luck with this.

                              1 Reply Last reply Reply Quote 1
                              • spikey
                                spikey F last edited by

                                Updated: loading custom sounds, correctly loads the wave type.
                                ID USS73MNDN8, check the description, if there are changes from today, it contains the fixes. Downloading the new version will not overwrite your custom sounds.

                                1 Reply Last reply Reply Quote 2
                                • First post
                                  Last post