The Perl Toolchain Summit 2025 Needs You: You can help 🙏 Learn more

#!/usr/bin/env perl
use strict;
my $d = MIDI::Drummer::Tiny->new(
file => "$0.mid",
bpm => 130,
volume => 98,
bars => 8,
signature => '12/8',
);
my ($min, $max) = (30, 127);
for my $n (1 .. $d->bars) {
$d->note($d->triplet_eighth, $d->closed_hh, $d->kick);
$d->rest($d->triplet_eighth);
$d->note($d->triplet_eighth, $d->open_hh, $d->kick);
$d->note($d->triplet_eighth, $d->pedal_hh);
$d->accent_note($min, $d->triplet_eighth, $d->snare);
$d->note($d->triplet_eighth, $d->closed_hh, $d->kick);
$d->accent_note($max, $d->triplet_eighth, $d->snare);
$d->rest($d->triplet_eighth);
$d->note($d->triplet_eighth, $d->closed_hh);
$d->note($d->triplet_eighth, $d->closed_hh);
$d->accent_note($min, $d->triplet_eighth, $d->snare);
$d->note($d->triplet_eighth, $d->closed_hh, $d->kick);
}
$d->write;