Hello, I make electronic music and I’m using a physical synth (Elektron Digitakt) which can take arbitrary single-cycle waveforms to create continuous sounds. For instance, as with the audio library of processing, we have the ability to “sound” a sine wave (i.e. “playing” a single-cycle sine wave in an extremely fast loop), this synth can take any arbitrary waveform and play it in the same way, allowing for complex harmonics/frequency spectrums.
Now I would like to build a sketch which allows me to graphically manipulate a custom single-cycle wave, i.e. instead of having a pure sine, to create a complex arbitrary waveform by morphing different wave shapes (sine, triangle, square) at different frequencies and phases. This part I can handle, see picture:
What would be nice is if Processing was able to actually “play” my arbitrary, graphic wave, just like it “plays” a sine with the audio library methods. So it would be possible to have a preview (or pre-hear?) of the audible harmonics of that custom waveform.
The waveform data is stored in a FloatList of 1024 samples, with max 1.0 and min -1.0. Is there a way to make this from here? I’m not necessarily thinking real-time sound synthesis, although it would be great. For example, writing a 2-second sample to disk from the arbitrary waveform and playing it on demand would be enough.
Any suggestions welcome!