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

use MIDI::Chord::Guitar;
use MIDI::Util qw(setup_score);

my $score = setup_score(patch => 24, bpm => 120);

#my $mcg = MIDI::Chord::Guitar->new(voicing_file => 'share/midi-guitar-chord-voicings.csv');
my $mcg = MIDI::Chord::Guitar->new;

for my $n (1 .. 4) {
    for my $spec (
        ['C3', '', 0],
        ['A2', 'm', 1],
        ['E2', 'm', 2],
        ['G2', '', 2],
    ) {
        my $chord = $mcg->transform(@$spec);
        $score->n('qn', $chord->[0], $chord->[3]);
        $score->n('en', $chord->[1]);
        $score->n('en', $chord->[2]);
        $score->n('en', $chord->[0]);
        $score->n('en', $chord->[3]);
        $score->n('qn', $chord->[1]);
    }
}

my $chord = $mcg->transform('C3', '', 0);
$score->n('wn', @$chord);

$score->write_score("$0.mid");
