Sound Synthesis

Sound Synthesis

I think some simple Instruments can be generated by using the following formula:

waveform(timescale(t)) * amplitude(t)

where:

  waveform is one of sine, square, sawtooth or customfunction and

  timescale and amplitude some simple function of t.

Here is a simple example of a percussive instrument (by the looks of it) I have just put together using a math tool:

waveform = sine

timescale(t) =(10-t)^3 // start with high frequency and decrease

amplitude(t) = (1+t^3 * 0.1)^-1 // fast decay

BTW does anybody know a simple lightweight lib to write .wav?