💾 Archived View for thrig.me › blog › 2023 › 09 › 23 › wrandom.pl captured on 2024-05-26 at 15:45:11.

View Raw

More Information

⬅️ Previous capture (2023-09-28)

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

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

my $note = Math::Random::Discrete->new(
    [ qw(40 10 15 10 20 15 5) ],
    [ qw(C  D  E  F  G  A  B) ],
);
for ( 1 .. 16 ) {
    my $n = $note->rand;
    print $n, " ";
    n qn => $n;
}
print "\n";
write_score 'wrandom.midi';