The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

#!/usr/bin/env perl
#
# Show files with 12 pitches and whose ultimate ratio is the octave.
use strict;
use feature qw/say/;
use Music::Scala ();
my $s = Music::Scala->new;
for my $file ( glob('*.scl') ) {
eval {
my @ratios = $s->read_scala($file)->get_ratios;
if ( $ratios[-1] == 2 and @ratios == 12 ) { say $file }
};
warn "could not parse '$file': $@\n" if $@;
}