Drums

To synthesize drums, a drum factory class is used. It loads all drum sounds- bass drum, snare drum, 8" and 12" tom, and a crash cymbal- into waveform tables. Then, on demand from the synthesizer, it creates the appropriate WavePlayer instrument for the note specified in the XML.

Waveform Playback

Envelope Generation

Envelope generation uses the Attack/Release component developed in the steps previously.

Polyphony

The drum factory can create as many drum instruments as are necessary for playback, so polyphony is easily achieved.

Varying Pitch

Pitch is adjustable via the "pitchmod='N' " XML declaration. Every N samples will be skipped, allowing the pitch to be adjusted on a fairly granular level for each instrument and note independently.

Distinct drum sounds

The varying pitch allows quite a few more than just 20 drum sounds.