💾 Archived View for thrig.me › blog › 2023 › 09 › 23 › rinterval.pl captured on 2023-09-28 at 15:58:07.

View Raw

More Information

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

#!/usr/bin/perl
use 5.36.0;
use MIDI::Simple;
use Math::Random::Discrete;

my $int = Math::Random::Discrete->new(
    [ qw(20 30 10 40 15 30 25) ],
    [ qw(-3 -2 -1  0  1  2  3) ],
);
my $start = 60;
for ( 1 .. 16 ) {
    print $start, " ";
    n qn => $start;
    $start += $int->rand;
}
print "\n";
write_score 'rinterval.midi';