NAME
MIDI::Simple::Drummer - Glorified metronome
ABSTRACT
Is there a drummer in the house?
SYNOPSIS
use MIDI::Simple::Drummer;
my $d = MIDI::Simple::Drummer->new(-bpm => 111);
$d->count_in();
for(0 .. $d->phrases - 1) {
$d->beat_2(-fill => $_);
$d->beat_3();
$d->fill();
}
$d->write;
DESCRIPTION
This module is embroyonic but may yet grow into a giant reptilian monster that smashes Tokyo.
Until then, this is just meant to be a robotic drummer and hide the MIDI::Simple parameters.
METHODS
* new()
my $d = MIDI::Simple::Drummer->new(%arguments);
Far away in a distant galaxy... But nevermind that, Luke. Use The Source.
* phrases()
Return or set the number of phrases to play.
* n2p(), p2n()
Return %MIDI::notenum2percussion
or %MIDI::percussion2notenum
, a la "GOODIES" in MIDI.
* kit()
Return note values for percussion names with %MIDI::notenum2percussion
.
* metronome()
Beats x Phases with the Pedal Hi-Hat
or whatever patch you supply.
* count_in()
And a-one and a-two and a-one, two, three!</Lawrence Welk> ..11</FZ>
* alternate()
Return the alternating back-beat of the rhythm. By default, this is the kick and snare.
* option_patch()
Return a selection from a list of patches, if one is not given.
* foo_beat()
This is a fictional, anecdotal "beat" that is added to the event stream. You can indicate that we filled in the previous bar, and do something exciting like crash on the first beat, by supplying the -fill
argument.
* fill()
Append a drum-fill to the event stream and return the id for the selected fill. We try to play a different fill each time, so if the fill is the same as the -last
, or if there is no given fill to play, another is chosen.
* write()
This is just an alias for "write_score" in MIDI::Simple but with unimaginably intelligent bits.
TO DO
* The source TODO comments. > grep TODO `perldoc -l MIDI::Simple::Drummer`
* Make the beats and fills user definable lists of coderefs.
* Allow smoother modification of the drum kit.
* It don't mean a thing if it ain't got that swing.
* Intelligently modulate dynamics (A.K.A. "add nuance").
SEE ALSO
The eg/* file(s), that come(s) with this distribution.
MIDI::Simple itself.
http://maps.google.com/maps?q=mike+avery+joplin - my drum teacher.
"from_drum_tab" in MIDI::Tab - possibly handy
Music::Tempo - possibly handy
AUTHOR AND COPYRIGHT
Gene Boggs <gene@cpan.org>
Copyright 2009, Gene Boggs, All Rights Reserved.
LICENSE
This program is free software; you can redistribute or modify it under the same terms as Perl itself.