NAME
MIDI::Drummer::Tiny - Glorified metronome
VERSION
version 0.0802
SYNOPSIS
use MIDI::Drummer::Tiny;
my $d = MIDI::Drummer::Tiny->new(
file => 'drums.mid',
bpm => 100,
signature => '3/4',
bars => 32,
kick => 'n36', # Override default patch
snare => 'n40', # "
);
$d->count_in(1); # Closed hi-hat for 1 bar
$d->note( $d->quarter, $d->open_hh, $_ % 2 ? $d->kick : $d->snare )
for 1 .. $d->beats * $d->bars; # Alternate kick and snare
$d->metronome();
$d->write();
DESCRIPTION
This module provides a MIDI drummer with the essentials to add notes to produce a MIDI score.
ATTRIBUTES
file
Default: MIDI-Drummer.mid
score
Default: MIDI::Simple->new_score
channel
Default: 9
volume
Default: 100
bpm
Default: 120
reverb
Default: 0
chorus
Default: 0
pan
Default: 0
bars
Default: 4
beats
Computed given the signature.
divisions
Computed given the signature.
signature
Default: 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
METHODS
new()
$d = MIDI::Drummer::Tiny->new(%arguments);
Return a new MIDI::Drummer::Tiny
object.
BUILD()
Initialize the score.
note()
$d->note( $d->quarter, $d->closed_hh, $d->kick );
$d->note( 'qn', 'n42', 'n35' ); # Same thing
Add a note to the score.
This method takes the same arguments as with "Parameters for n/r/noop" in MIDI::Simple.
rest()
$d->rest( $d->quarter );
Add a rest to the score.
This method takes the same arguments as with "Parameters for n/r/noop" in MIDI::Simple.
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 times the number of beats is used.
metronome()
$d->metronome;
$d->metronome($bars);
Add a steady beat to the score.
write()
Output the score to the *.mid file given in the constuctor.
SEE ALSO
https://en.wikipedia.org/wiki/General_MIDI#Percussion
AUTHOR
Gene Boggs <gene@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2019 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.