#!/usr/bin/env perl
use
strict;
use
warnings;
use
MIDI::Drummer::Tiny ();
my
$bpm
=
shift
|| 80;
my
$lengths
= midi_dump(
'Length'
);
my
$d
= MIDI::Drummer::Tiny->new(
file
=>
"$0.mid"
,
bpm
=>
$bpm
,
bars
=> 4,
);
$d
->count_in(1);
for
my
$i
(1 .. 4) {
$d
->set_bpm(
$bpm
);
$d
->metronome4(
$d
->bars,
$d
->ride2,
$d
->quarter, 67);
$d
->set_bpm(
$bpm
*
$lengths
->{thn});
$d
->metronome4(
$d
->bars,
$d
->ride2,
$d
->quarter, 67);
}
$d
->
write
;