The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

#!/usr/bin/env perl
use strict;
my $d = MIDI::Drummer::Tiny->new(
file => "$0.mid",
bpm => 100,
volume => 98,
bars => 4,
);
$d->count_in(1);
my ($min, $max) = (50, 120);
for my $n (1 .. $d->bars) {
$d->note($d->quarter, $d->closed_hh, $d->kick);
$d->note($d->quarter, $d->closed_hh, $d->snare);
$d->note($d->eighth, $d->closed_hh, $d->kick);
$d->note($d->eighth, $d->kick);
$d->note($d->quarter, $d->closed_hh, $d->snare);
for (my $i = $min; $i < $max; $i += 10) {
$d->accent_note($i, $d->eighth, $d->snare, $d->hi_floor_tom);
}
$d->crescendo_roll([$min, $max, 1], $d->eighth, $d->thirtysecond);
}
$d->write;