NAME

MIDI::Drummer::Tiny - Glorified metronome

VERSION

version 0.05

SYNOPSIS

use MIDI::Drummer::Tiny;
my $d = MIDI::Drummer::Tiny->new(
   file => 'drums.mid',
   bpm => 120,
   signature => '3/4',
   bars => 32,
   patch => 26, # TR808
);
$d->count_in();
$d->note( $d->quarter, $d->open_hh, $_ % 2 ? $d->kick : $d->snare )
   for 1 .. $d->beats * $d->bars;  # Alternate beats
$d->metronome();  # <- Similar but honoring time signature
$d->write();

DESCRIPTION

This module provides a MIDI drummer with the bare essentials to add notes to a MIDI score.

ATTRIBUTES

file: MIDI-Drummer.mid

score MIDI::Simple->new_score

channel: 9

volume: 100

patch: 0

bpm: 120

reverb: 0

chorus: 0

pan: 0

bars: 4

beats: 4

divisions: 4

signature: 4/4

"beats/divisions"

KIT

kick

snare

open_hh

closed_hh

pedal_hh

crash1

crash2

splash

china

ride1

ride2

ride_bell

hi_tom

hi_mid_tom

low_mid_tom

low_tom

hi_floor_tom

low_floor_tom

DURATIONS

whole

half

quarter, triplet_quarter

eighth, triplet_eighth

sixteenth, triplet_sixteenth

METHODS

note()

$d->note( $d->quarter, $d->closed_hh, $d->kick );
$d->note( 'qn', 'n42', 'n35' ); # Same thing

Send a note to the score.

rest()

$d->rest( $d->quarter );

Send a rest to the score.

count_in()

$d->count_in;
$d->count_in($bars);

Play the closed hihat for the number of beats times the given bars. If no bars are given, the default of 1 is used.

metronome()

Add a steady beat to the score.

write()

Output the score to the *.mid file given in the constuctor.

AUTHOR

Gene Boggs <gene@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Gene Boggs.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.