Read me About Demoscene? Links Contact

Daily DSP tip :-)

So, I played a bit with software synthesizers in the past and last week I took the project up for revision. Doing so, I came up with the following easy waveform generators:

Having the basic generators, we move on to making them “easy” controlable by Hz rather than [0;1] or [0;] when it comes to sine. I use these generators in relation to sound - and most sound is generated at 44k1Hz, i.e. 44100 samples per second per channel. With this in mind, we get that each period should be transformed from/to [0;44100]. Let i be the current sample index in the stream; we’ll observe that output[i]=wave_sine((Hz*/44100.0)*x) if we set Hz=440.0 we get a nice sine A-note. In addition, a square/saw/triangle A-note can be output[i]=wave_triangle((Hz/44100.0)*x).

I hope this is useful to some one else than me :-)