Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Procedural snare drum

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.

like image 587
bobobobo Avatar asked Feb 22 '10 15:02

bobobobo


2 Answers

Procedural snare dum synthesis.

like image 195
plinth Avatar answered Oct 22 '22 04:10

plinth


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.

like image 23
Thomas Avatar answered Oct 22 '22 04:10

Thomas