App-MusicTools
view release on metacpan or search on metacpan
t/atonal-util.t view on Meta::CPAN
args => [qw(pitch2ly 72)],
stdout => "c''\n",
};
command {
args => [qw(prime_form 0 4 7)],
stdout => "0,3,7\n",
};
command {
args => [qw(recipe --file=t/rules 0 11 3)],
stdout => "4,8,7\n",
};
command {
args => [qw(retrograde 1 2 3)],
stdout => "3,2,1\n",
};
command {
args => [qw(rotate --rotate=3 1 2 3 4)],
stdout => "2,3,4,1\n",
};
command {
args => [qw(set2beats --scaledegrees=16 4-z15)],
stdout => "xx..x.x.........\n",
};
command {
args => [qw(set_complex 0 2 7)],
stdout => "0,2,7\n10,0,5\n5,7,0\n",
};
command {
args => [qw(subsets 3-1)],
# NOTE might false alarm if permutation module changes ordering; if
# so, sort the output?
stdout => "0,1\n0,2\n1,2\n",
};
command {
args => [qw(tcs 7-4)],
stdout => "7 5 4 4 3 3 4 3 3 4 4 5\n",
};
command {
args => [qw(tcis 7-4)],
stdout => "2 4 4 4 5 4 5 6 5 4 4 2\n",
};
command {
args => [qw(tension g b d f)],
stdout => "1.000 0.100 0.700\t0.2,0.1,0.7\n",
};
command {
args => [qw(time2notes 1234)],
stdout => "c4*123/100\n",
};
command {
args => [qw(transpose --transpose=7 0 6 11)],
stdout => "7,1,6\n",
};
command {
args => [qw(transpose_invert --transpose=3 1 2 3)],
stdout => "2,1,0\n",
};
command {
args => [qw(whatscalesfit c d e f g a b)],
stdout =>
"C Major c d e f g a b\nD Dorian d e f g a b c\nE Phrygian e f g a b c d\nF Lydian f g ...
};
# custom tests that the old Test::Cmd code had trouble with
my ( $result, $status, $stdout, $stderr ) =
command { args => [qw(fnums)], stdout => qr/^3-1\s+0,1,2\s+210000/ };
my $lines = 0;
$lines++ while $$stdout =~ m/^[3-9]-[1-9Z]/gm;
is( $lines, 208, 'forte numbers count' );
command {
args => [qw(--help)],
stderr => qr/Usage: atonal-util/,
status => 64,
};
command {
args => [qw(invariants 3-9)],
stdout => qr/^T\(0\)\s+\[ 0,2,7\s+\] ivars \[ 0,2,7\s+\] 3-9/,
stderr => qr/^\[0,2,7\] icc 010020/,
};
command {
args => [qw(variances)],
stdin => "5-1\n0 1 2 3 5\n",
stdout => "0,1,2,3\n4,5\n0,1,2,3,4,5\n"
};
command {
args => [qw(zrelation)],
stdin => "8-z15\n0,1,2,3,5,6,7,9\n",
stdout => "1\n"
};
command {
args => [qw(zrelation)],
stdin => "9-2\n0 1 2 3 4 5 6 8 9\n",
stdout => "0\n"
};
done_testing 176
( run in 2.073 seconds using v1.01-cache-2.11-cpan-98e64b0badf )