#!/usr/bin/perl
use strict;
use warnings;
use MIDI::Simple::Drummer;
my $d = MIDI::Simple::Drummer->new(
    -bpm     => shift || 100,
    -volume  => shift || 125,
    -phrases => shift || 4,#8,
    -beats   => shift || 4,#3,
);
$d->count_in;
for my $p (1 .. $d->phrases * $d->beats) {
    $d->note($d->EIGHTH, $d->rotate_backbeat(-beat => $p % 4 ? $p : 1, -fill => 1));
    $d->note($d->EIGHTH, $d->tick);
#    $d->note($d->EIGHTH, $d->rotate_backbeat(-beat => $p + 1));
#    $d->note($d->EIGHTH, $d->tick);
}
#$d->note($d->EIGHTH, $d->kicktick);
$d->write("$0.mid");
