#!/usr/bin/env perl
use strict;
use warnings;

use MIDI::Drummer::Tiny;

my $d = MIDI::Drummer::Tiny->new(
    file   => "$0.mid",
    bpm    => 70,
    volume => 127,
    bars   => 8,
);

my ($min, $max) = (30, 127);

for my $n (1 .. $d->bars) {
    $d->note($d->triplet_eighth, $d->closed_hh, $d->kick);
    $d->accent_note([$min, $max], $d->triplet_eighth, $d->snare);
    $d->note($d->triplet_eighth, $d->closed_hh);

    $d->note($d->triplet_eighth, $d->closed_hh);
    $d->accent_note([$min, $max], $d->triplet_eighth, $d->snare);
    $d->note($d->triplet_eighth, $d->closed_hh, $d->kick);

    $d->note($d->triplet_eighth, $d->closed_hh, $d->snare);
    $d->accent_note([$min, $max], $d->triplet_eighth, $d->snare);
    $d->note($d->triplet_eighth, $d->closed_hh);

    $d->note($d->triplet_eighth, $d->closed_hh);
    $d->accent_note([$min, $max], $d->triplet_eighth, $d->snare);
    $d->note($d->triplet_eighth, $d->closed_hh, $d->kick);
}

$d->write;
