#!/usr/bin/env perl
use
strict;
use
warnings;
my
$score
= setup_score();
# get 4 notes of the C pentatonic scale
my
@pitches
= get_scale_notes(
'C'
,
'pentatonic'
);
my
@notes
=
map
{
$pitches
[
int
rand
@pitches
] } 1 .. 4;
# play the 8-bar progression for each note
for
my
$note
(
@notes
) {
my
$prog
= Music::Chord::Progression->new(
scale_note
=>
$note
,
# substitute => 1,
);
my
$chords
=
$prog
->generate;
for
my
$chord
(
@$chords
) {
$score
->n(
'wn'
, midi_format(
@$chord
));
}
$note
,
': '
, ddc(
$chords
);
}
$score
->write_score(
"$0.mid"
);