Synthbox

Synthbox exist out of three audio experiments.

Custom Audio Stream
Writing a custom audio data stream via the SoundStream and SoundHandle classes, part of S&box's audio framework. The code is present within the project might you want to have a peak at it.


Custom Nodes
Adding nodes to create custom synthesizers within S&box's Action Graph environment, which of I will bother you with the most three most note worthy ones.
Generate Sine Wave
This node generates a constant sine wave based on a specified frequency. Currently it is able to be multiplied, added and sent to an ADSR, allowing user's to create a with variety combinations and thus a lot of custom sounds. The result of these combinations we (currently) refer to as 'waveform'. However in reality they're arrays of float data, which I will explain further two nodes ahead.

(ADSR) Attack Decay Sustain Release
The ADSR will apply automation over the gain of any incoming waveform. Which allows the user to shape envelope of the waveform. It can be triggered by a boolean input. The result of it can be used to steer other nodes capable of taking in float arrays or to be send directly to the Audio Output.

Audio Output
Audio Output is the endpoint of your audio spiderweb. It takes all the waveform/float array data puts it in a buffer and pushes it through an audio stream. In the end it's just vibrated air reaching your ears.

In-game experiment
Using so said nodes to create dynamic audio generation based on in-game parameters. Represented as a FM-synth...box. (https://en.wikipedia.org/wiki/Frequency_modulation_synthesis)



How to use?
  • Use E to hold a parameter and move your mouse up to increase the value or down to decrease it.
  • Tap E on 'TRIGGER' to trigger the ADSR envelope
  • Tap E on 'BYPASS ADSR' to gain a constant audio signal, allowing you to hear the modulation of the parameters more easily.



KNOWN BUGS:
I struggled a lot with getting the audio delay as short as possible without compromising too much on audio quality. For now I chose somewhere in between fidelity and responsiveness. Hopefully with more understanding of s&box's audio engine this can be fixed in the future.