SimpleSynth



SimpleSynth is an introductory module to the world of audio-synthesis in TouchDesigner. It is loosely inspired by legacy polysynths such as the Roland Jupiter6, Juno60 and Sequential Circuits Prophet 5 but with some neat added bells and whistles! SIMPLE is a forward-thinking, polyphonic synthesizer for HALion based on ease-of-use and maximum capability. The beautifully designed interface has been carefully crafted to put the most commonly used controls first.

I have been into producing dance music for a while now and have always wondered how difficult it would be to make my own simple synthesizer. Turns out it not that difficult at all. I have created a very simple synthesizer in just one afternoon.

How does a software synth work?

Very similar to a hardware synth, it works by creating and mixing waveforms before effecting them to get a desired sound.

Simplesynth

How do I create a waveform?

Well you need to write some code that will produce a wave. The most common wave to produce is a sine wave. This sounds like a constant tone with no harmonics.

Simplesynth Catalina

Simplesynth mac

Ok, so how do I make a sine wave in C#?

Simplesynth

Its actually pretty easy to make a sine wave in C#. It a matter of using the mathematical function Math.Sin() then sending in the angle (in radians). Here is an example of my Sine occilator in my program:


All of the hard work is done in the GetNext method. The calling code tells the GetNext what sample (of the current second) that it wants and GetNext will return a number between 1 and -1.

This works by working out the ‘samplesPerOccilation’ value, which is the basically “how many samples does one oscillation take at the defined frequency”

After working that out we can work out how far we would be through an oscillation by taking the remainder of the sampleNumberInSecond / samplesPerOccilation. Then making that a number between 0 – 1 by dividing that answer by samplesPerOccilation.

Now we just need to work out that the numeric value for the waveform at that point, this is as simple as using calling Math.Sin and passing in the (depthIntoOccilations * _radiansPerCircle).

So here is how you would call it:

Create a list of doubles to store the resulting wave sample values, Set the frequency to a “C” then add 2 Seconds worth ( 2 X 441000 samples) to the list.

CatalinaProducts

How can I actually hear what it sounds like?

The easiest way to hear it is to export the wave you have produced to a .wav file. It is reasonbly simple to create a .wav file just follow the specification here.

I found an implementation in the Sixport Synth project that I changed slightly for my needs. It simply writes a “test.wav” file to the bin directory of the application.

SimpleSynth

That’s pretty cool but I don’t think its going to win any awards

Well, yeah it is a really very simple synth but using that principle and mixing it with other waveforms it is possible to make some awesome sounds.

The source can be downloaded here