views:

65

answers:

2

So I've got something like:

    void createSinewave( short * array, int duration, int startOffset,
float freq, float amp ) ;
    void createSquarewave( short * array, int duration, int startOffset,
float freq, float amp ) ;

Other functions "slide" a wave form from some low frequency to some high frequency, and accept two frequency parameters.

Using just these functions i've been able to create a variety of sounds.. kick drum, an old school laser fire sound, and a bunch of things that sound like footsteps. I've not been able to synthesize a snare drum type sound.

Any suggestions on how to generate one? What frequencies to mix and in what amounts to mix them in? Other wave form types to use than sine and square and triangle wave?

Kind of inspired by 64 k executable contests.

A: 

Drums are often synthesized by short bursts of noise, for example white, pink or brown noise.

Of these, white noise is the easiest to generate: just fill your array with random samples, independently chosen with uniform probability. Brown noise is also pretty easy.

Thomas
+2  A: 

Procedural snare dum synthesis.

plinth
And here's some background to that: http://www.soundonsound.com/sos/mar02/articles/synthsecrets0302.asp
Matt Ball