💾 Archived View for thrig.me › blog › 2023 › 09 › 23 › markov.pl captured on 2024-07-09 at 01:37:47.

View Raw

More Information

⬅️ Previous capture (2023-09-28)

-=-=-=-=-=-=-

#!/usr/bin/perl
use 5.36.0;
use MIDI::Simple;
use Music::VoiceGen;

my $voice = Music::VoiceGen->new(
    pitches   => [qw/60 62 64 65 67 69/],
    intervals => [qw/1 2 3 4 5 7 -1 -2 -3 -4 -5/],
);
for ( 1 .. 16 ) {
    my $n = $voice->rand;
    print $n, " ";
    n qn => $n;
}
print "\n";
write_score 'markov.midi';