App-MusicTools
view release on metacpan or search on metacpan
bin/scalemogrifier view on Meta::CPAN
Options affecting input:
--direction Positive, scale goes up, negative, down. Magnitudes
greater than one multiply the interval.
--intervals List of intervals or notes of the scale.
--length How many notes to generate in output.
--mode Specify named interval series instead of --intervals.
--minor Use minor mode instead of --intervals (default: major).
--reverse Reverses order of intervals.
Options affecting output:
--flats Use flats in output, instead of default sharps.
--ois Custom scale or interval set output will be mapped into.
--ors What will be printed between output elements.
Defaults to the space character.
--raw Emit pitch numbers instead of note names.
--relative Generate relative lilypond output (default: absolute).
--transpose Number to transpose the output by.
Available modes for --modes option:
$modes
END_HELP
exit 64;
}
END {
# Report problems when writing to stdout (perldoc perlopentut)
unless ( close(STDOUT) ) {
warn "error: problem closing STDOUT: $!\n";
exit 74;
}
}
__END__
=head1 NAME
scalemogrifier - generate notes of named or arbitrary scales
=head1 SYNOPSIS
$ scalemogrifier
c d e f g a b c'
The list of accepted lilypond note names and other elements include:
c cis des d dis ees e f fis ges g gis aes a ais bes b nl
Available named modes include:
aeolian amdorian dorian hminor hunminor ionian locrian lydian
major minor mixolydian mminor phrygian
=head1 DESCRIPTION
Generates notes of arbitrary scales (subsets of the Western 12-tone
chromatic system) from a specified starting note in a specified
direction and so forth from other options.
The output is in lilypond absolute format. The default scale is The
Major Scale, but that's easy to adjust to say C Minor:
$ scalemogrifier --minor --flats
By default, scales loop back to the starting note. If this is not the
case, suffix C<nl> to a custom interval series:
$ scalemogrifier --intervals=c,cis,dis,e,g,nl --length=15
c cis dis e g gis ais b d' dis' f' fis' a' ais' c''
The output is based on the assumption that C<c> equals 0. The output
can be transposed via:
$ scalemogrifier --mode=mixolydian --transpose=-5
Integer interval numbers can be used instead of note names or the
--mode option, for example the Major Scale:
$ scalemogrifier --intervals='2 2 1 2 2 2 1' --raw
Or to form a -P4,+P5 sequence:
$ scalemogrifier --intervals=-5,7 --len=24
Or just plain made up:
$ scalemogrifier --intervals=1,2,3,5,7 --dir=53 --relative --len=24
Scales can also be rendered backwards:
$ scalemogrifier --dir=-1
Or with the interval order reversed:
$ scalemogrifier --rev
The scale generated can be fed back into a different output scale (the
direction and reverse options only apply to the --intervals option
scale, not the --ois scale):
$ scalemogrifier --intervals=c,cis,dis,e,g,nl --ois=aes,bes,ces,ees,fes \
--len=48 --flats --rel
Practical application of the results to music theory or composition left
as an exercise to the user. The output can be fed to C<ly-fu> for
playback and display, for example:
$ ly-fu --abs -l --open $(scalemogrifier ...)
$ ly-fu -l --open $(scalemogrifier --relative ...)
=head1 OPTIONS
This program currently supports the following command line switches:
=over 4
=item B<--direction>=I<integer>
Positive, the scale goes up, negative, down. Magnitudes greater than 1
multiply the interval.
( run in 2.338 seconds using v1.01-cache-2.11-cpan-302cb4679cc )