Drum Machine by John Richter

Score file:

The actual score file that generates the short demonstration of the DrumKit synthesizer is here.
The audio file generated from this score file is here.

Features implemented:

Score file format:


The format for the DrumKit synthesizer is as follows:

<instrument instrument="DrumKit">
     <note HH="./waves/Cymbols/hihat.wav" measure="1" beat="1"/>
     ...
     ...
     <note CR="./waves/Cymbols/crash.wav" measure="1" beat="1"/>
     ...
     ...
     <note SN="./waves/Cymbols/snare.wav" measure="1" beat="1"/>
     ...
     ...
     <note TH="./waves/Cymbols/tomhigh.wav" measure="1" beat="1"/>
     ...
     ...
     <note TM="./waves/Cymbols/tommid.wav" measure="1" beat="1"/>
     ...
     ...
     <note TL="./waves/Cymbols/tomlow.wav" measure="1" beat="1"/>
     ...
     ...
     <note BD="./waves/Cymbols/bassdrum.wav" measure="1" beat="1" startNote="C0" midNote="D#2" endNote="F2" duration="1"/>
     ...
     ...
     <note SBD="" measure="1" beat="1"/>
     ...
     ...
     <note ShortBD="" measure="1" beat="1"/>
     ...
     ...
     <note LongBD="" measure="1" beat="1"/>
     ...
     ...
     <note iLongBD="" measure="1" beat="1"/>
     ...
     ...
     <note ACC="./waves/Effects/effect.wav" measure="1" beat="1"/>
     ...
     ...
</instrument>

All information for a DrumKit instrument is contained in the instrument node with the instrument attribute equal to 'DrumKit'. The instrument node contains zero or more note nodes. The note nodes represent either a .wav audio file that is loaded to be played by the WaveInstrument synthesizer or by the DrumInstrument synthesizer to actively synthesize a drum sound. The notes corrosponding to a .wav file are loaded into a WaveInstrumentFactory via the path within the attribute corrosponding to the specific instrument (e.g. 'HH' for hihat) and played back at the 'measure' and 'beat'. If the instrument attribute value is blank it means that the instrument will be synthesized. Each .wav instrument can be pitch altered by specifiying the starting note, the middle note, and ending note. This will change the .wav to change pitch over the range specified durning its original duration. These act as frequencies to alter the rate of playback in order to achieve the specified frequency. The midNote attribute allows for skewing of the pitch changes and how long it takes to reach the midNote from the start and from the midNote to the end. This allows for many cool effects.

DrumKit instrument nodes and attributes: