BEATS 1.1.0 Released

April 12, 2010

BEATS Drum Machine is back with its first update. What was once a shiny, new, fresh-from-the-womb v1.0.0 app is now a shiny, new, slightly more capable v1.1.0 app. For installation/upgrade instructions, visit http://beatsdrummachine.com.

Better Performance

The biggest news: BEATS is a lot faster. Exactly how much depends on the song, but I’m generally seeing it run about twice as fast as before[1]. The graph below shows the average run time[2] in seconds of running beats example_song.txt. Results are broken out for Ruby 1.8 and 1.9. (Note that version 1.0.0 running on Ruby 1.9 is still faster than 1.1.0 running on Ruby 1.8).

Performance Improvement Between BEATS v1.0.0 and v1.1.0

This improvement is made possible by caching generated audio for patterns. The first time a pattern is played, its audio is generated and then cached. The cached data will then be used for any subsequent repeats. This might seem like a why-wasn’t-this-in-1.0.0 type optimization. However, the fact that sounds can “overflow” from one pattern into the next adds complication, and it didn’t make the cut.

The Kit

You can now define a new Kit section in a song header. Here’s an example:

Song:
  Tempo: 120
  Structure:
    - Verse:  x2
    - Chorus: x2
  Kit:
    - bass:   sounds/bass.wav
    - snare:  sounds/snare.wav
    - hihat:  sounds/hh_closed.wav

Verse:
  - bass:   X.............X.
  - snare:  ....X.......X...
  - hihat:  X.X.X.X.X.X.X.X.  

Chorus:
  - bass:   X.......X.X.....
  - snare:  ....X.......X...
  - hihat:  X.X..X.XXX..X..X
  # You can still use raw paths if you want though:
  - sounds/cymbal.wav:  X.......X.......

This lets you give a friendlier name for tracks. For example you can label a track as snare instead of my_sounds/tr808/tr808_sound7b.wav.

It also makes it easier to re-use sounds in different patterns. Let’s say you’re using the same bass drum sound in an intro, verse, chorus, and bridge. If you want to later switch it out with different sound, you now only have to make a change in one place, instead of 4.

However, the Kit section is optional. You can still use a raw file path for any track.

Better Error Handling

You’ll now be given a more helpful message for certain types of errors. For example, if you forget to include the structure in your song, you’ll now get the following error:

Song file 'bad.txt' has an error:
  Song must have a Structure section in the header.

instead of:

An error occured while generating sound for 'bad.txt':
  undefined method `each' for nil:NilClass

Happy BEATSing.

Links

  1. When using the -s option to save each track to a separate file, performance is the same as in 1.0.0.
  2. Tests run on a MacBook Pro, 2.26 GHz Core 2 Duo.