Home     News     FAQs     Docs     License     Samples     Download     Support  


Drums++

Table Of Contents
Unpacking
Compiling
Running
Creating DPP Files

Unpacking

If you downloaded the source code, to unpack it type at the Unix prompt (replacing 1.00 with the version you downloaded):

tar xvzf drumsplusplus-1.00.tar.gz

or on more old-school Unix OS's:

gzip -dc drumsplusplus-1.00.tar.gz | tar xvf -

If you downloaded the Windows binaries you'll have to use PKZip or Winzip to uncompress it.

Compiling

If you downloaded source code instead of binaries, you'll have to compile it first. This is pretty simple :). From the Unix prompt simply type:

make

If you'd like to properly install this program into /usr/local/bin type:

su
make install

These commands will build a program called 'playdpp' which you will use to play your .dpp files or transform your .dpp files into MIDI files that can be played on any MIDI player.

Running

Right now there are 3 command line options. If you type playdpp at the command prompt it will give you all it's options. Running playdpp will play your .dpp file to your MIDI sequencing device. Using the -o option, you can tell it to create a .midi file (which can be played through kmidi or Windows Media Player. The -i option will print on the screen which pattern/section is currently being outputed.

An example would be:

playdpp -o simple.mid simple.dpp

This will read in simple.dpp and create a .mid file called simple.mid based on it.

The Drums++ (.dpp) Language

The playdpp program reads files with the .dpp extension. This program will read in your Drums++ files and either play them through your MIDI sequencer (aka. into your drum machine/midi keyboard) or create .midi/.mid files which you can play through your computer. I created a songs/simple.dpp file so you can see how a complete file looks like. I also created a .midi file of this .dpp (using the newest feature of playdpp).. err at least I think they are the same. Anyway, if you want to hear it click here. It probably sounds a lot better coming out of a real drum machine tho.

The first part of a .dpp file is the song settings. You must tell playdpp the beats per minute, default volume, drift (which I will explain later), and time signature. These must be set BEFORE the pattern sections that it affects. If you'd like a pattern to have different settings, you can redefine these before those sections.

set bpm=230; // set beats per minute to 230
set defaultvolume=127; // defaultvolume is between 0 and 255
set drift=5; // drift can make drum hits randomly a little louder or softer
set timesignature=4/4; // time signature sets the time signature
set midi_channel=9; // sets the default midi channel to 9 (which is the drum kit) if you do not set this setting, it will automatically use channel 9. Channels can be between 0 and 15 where each channel represents a different set of instruments. If you use something other than the percussion instruments, you can play a full scale of notes by replacing a drumkit instrument with a number representing a frequency where 60 is middle C and everthing below or above that a 1/2 step below or above (for example 61 would then be C#, 62 D, etc).

All 'set' commands end with ';'. Note the use of C style comments. If you have // on a line, everything after that is ignored. Also, anything between /* and */ is ignored. So something like this is totally valid:

set /* i'm a little teapot */ bpm = 230 ;

The next section is optional, but recommended. This is the 'defines' section. Here you can set names for your drum samples. This will make your code easier to read. For example, on my Dr. Rhythm, the kick drum is sample 36 and the snare is sample 38. So I would add lines like this:

define kickdrum 36
define snare 38

This way in my pattern sections instead of writing:

36: 1 3;

I could write instead:

kickdrum: 1 3;

Define lines do NOT have ; at the end.

If you would like a list of drum instruments there is a good list at this site: http://jedi.ks.uiuc.edu/~johns/links/music/gm.htm

The next section is the patterns section. All pattern sections start with the word 'pattern' and then the name of the pattern. A pattern can be either a word or number, or combination of words and numbers starting with a word. For example: fill1 is valid, but 1fill is not.

All patterns are written between { and } symbols. The text inbetween the { and } are written like this: <drum pad number>: <beats the drum is struck on>. So since I defined the snare drum as 38, if I want this pattern to play the snare on beats 2 and 4, I write it like this:

snare: 2 4;

If I wanted the kickdrum to be struck on beats 1, 1.5, and 3. I would add this:

kickdrum: 1 1.5 3;

If I wanted the volume of the kickdrum to louder than the default volume on beat 3, I can add a volume modifier (a : and a number between 0 and 255) like this:

kickdrum: 1 1.5 3:200;

Also, if I wanted the volume to be randomly different every time, I could put a % infront of the 200. This tells playdpp to pick a random number between 0 and what you set as the drift. Since i set the drift as 5, it will pick a random number between 0 and 5 and either add or subtract it from 200. It looks like this:

kickdrum: 1 1.5 3:%200;

Do not forget the ; at the end of each line. This lets the playdpp parser know when you are starting a new instrument. All together a pattern will look like this:

pattern test1
{
  bassdrum: 1 1.5 3;
  snare: 2 4:%200;
  highhat: 1:200 2 3;
  openhighhat: 4;
}

The sections take the same basic structure as the patterns do. After the word "section" you give it a section name, and then section data is placed between { and }. Section data consists of the word "play", the ':', and then the names of patterns you want to play separated by commas and ending in a semicolon. A section that plays fill2 twice and then pattern 1 once would look like this:

section b
{
  play: fill2, fill2, 1;
}

Finally, the song takes the same basic structure as section. The song name is optional. You may want to include it because when Drums++ is able to write out to .midi files, it will use this info. After the word play: you can tell Drums++ to play either single patterns separated by commas or sections separated by commas, or a combination. Here's an example of a song section:

song test_song
{
  play: test, test, test, a, 1, 1, 1, b, 1, 1, fill2;
}

Another useful feature of the Drums++ language is i the song and section parts, you can tell it to play a pattern or section a multiple number of times. For example:

song test_song
{
  play: 2 test, a, b, 2a;
}

This will tell Drums++ that within' the song "test_song", the pattern (or section) test will be played twice, then play section a, then b, then play pattern (or section) a twice.

More Advanced Stuff

At the start of each pattern section you are allowed to change some of the default settings such as bmp, timesignature, and midi_channel. If you put a set at the top of the pattern, this setting will only be valid for this pattern. You can see an example of it in the channels.dpp example.

You will also notice in this example a line that looks like this:

60/2: 1 3;

This tells the drums++ parser to play a note 60 (middle C) on channel 2 (piano?) on beats 1 and 3. You can use this to make rhythm melodies with other instruments. Probably not the easiest thing to do with drums++, but it is possible and probably usefull in some ways.





Copyright 1997-2007 - Michael Kohn

Please visit my many other projects, including free J2ME Java games for Mobile phones, graphics and sound programs, chat software, and much more at http://www.mikekohn.net.

This page was designed to work with all standard HTML compatible webbrowsers including Firefox, IE, Safari, and Links.