The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

canonical - compute canon voices via the Music::Canon module

SYNOPSIS

  $ canonical --contrary --retrograde exact c cis d
  $ canonical --transpose=12 exact c e g
  $ canonical --raw --contrary exact 1 2 3

  $ canonical modal --input=lydian --output=locrian c e g

DESCRIPTION

Command line interface to mapping methods present in the Music::Canon module. Custom questions might be better answered by coding directly against Music::Canon, see the eg/ directory under the distribution of that Perl module for examples.

GLOBAL OPTIONS

This script currently supports the following global command line switches. These can also be specified to each of the underlying modes.

--contrary --nocontrary

Whether to compute output line in contrary motion or not.

--help

Emit some help information and exit.

--raw --noraw

Whether to emit output in raw pitch numbers or lilypond note names.

--relative=lilypond_note

Use relative mode in Music::LilyPondUtil and make the input notes relative to the specified note. Without this option, the assumption is that the lilypond input is specified in absolute form:

  g d\'                 # MIDI pitches 55 62 (absolute)
  --relative=g\' g d\'  # MIDI pitches 67 74 (relative to g' or 67)
--retrograde --noretrograde

Whether to reverse the output phrase or not.

--transpose=pitch_or_lilypond_note

Transpose to the first note of the output phrase by the specified amount in semitones (integer) or to the specified lilypond note name.

MODES

EXACT

Exact interval canon computation. No new options beyond the global ones listed above.

  $ canonical exact --transpose=e c e g

Modal interval canon computation. In addition to the global options listed above, accepts:

--input=scale_or_forte_number

Scale name (see Music::Scales) or Forte Number to use for the input. A colon delimits the ascending versus descending data; commas delimit specific scale degrees. Examples:

  --input=mm
  --input=major:minor
  --input=2,2,2,2,1:5-25

See Music::Canon for the algorithm that maps input to output mode.

--nos

Allow non-octave scales. Necessary if the scale intervals sum up to more than 12, or if scales must repeat before the usual 12-pitch octave point.

--output=scale_or_forte_number

Like --input, except for the output line.

--undef=string

String to use for notes or pitches that cannot be converted. If unset, defaults to x. For example, under contrary motion, using Major to Major scales, C to D via C sharp is impossible, as there is no space between C and B downwards in the output line for the chromatic C sharp:

  $ canonical --relative=c modal --contrary --undef=OOPS c cis d
  c OOPS b

FILES

A ZSH completion script is available in the zsh-compdef/ directory of the App::MusicTools distribution. Install this to a $fpath directory.

BUGS

Reporting Bugs

If the bug is in the latest version, send a report to the author. Patches that fix problems or add new features are welcome.

http://github.com/thrig/App-MusicTools

SEE ALSO

http://www.lilypond.org/ and in particular the Learning and Notation manuals should be consulted to understand lilypond note syntax. Or, use raw pitch numbers.

http://en.wikipedia.org/wiki/Forte_number

Music::Canon, Music::LilyPondUtil, Music::Scales

AUTHOR

Jeremy Mates

COPYRIGHT

Copyright (C) 2013 by Jeremy Mates

This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16 or, at your option, any later version of Perl 5 you may have available.