💾 Archived View for thrig.me › blog › 2023 › 09 › 23 › wrandom.pl captured on 2024-07-09 at 01:39:51.

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';