NAME

MIDI::Drummer::Tiny - Glorified metronome

VERSION

version 0.0600

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 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

patch

Default: 0

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

These patches may be overridden as with any other attribute.

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

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 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) 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.