NAME

Music::PitchNum::German - note name and pitch number roles for BACH

SYNOPSIS

package MyCleverMozart;
use Moo;
with('Music::PitchNum::German');
...

Then elsewhere:

use MyCleverMozart;
my $x = MyCleverMozart->new;

$x->pitchname(70);      # b'
$x->pitchname(69);      # a'
$x->pitchname(72);      # c''
$x->pitchname(71);      # h'

$x->pitchnum(q{aes'});  # 68
$x->pitchnum(q{g'});    # 67
$x->pitchnum(q{b'});    # 70
$x->pitchnum(q{a'});    # 69

$x->pitchname(72, ignore_octave => 1); # c

DESCRIPTION

A Music::PitchNum implementation specifically for BACH, whereby H represents what other systems term B natural and B represents B flat. Otherwise, the implementation is Helmholtz-based, or the one typically seen in lilypond, with accidentals in the Dutch or German style (es, is), and octave indications using , and '.

This module is expected to be used as a Role from some other module; Moo::Role may be informative.

METHODS

pitchname pitchnumber

Returns the pitch name for the given integer, though will throw an exception if passed something that is not a number.

This method accepts an optional ignore_octave parameter that if true will strip the octave information from the pitch name.

pitchnum pitchname

Returns the pitch number for the given note name, or undef if the note could not be parsed. Note that the parser is quite permissive, see "Known Issues".

BUGS

Reporting Bugs

Please report any bugs or feature requests to bug-music-pitchnum at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Music-PitchNum.

Patches might best be applied towards:

https://github.com/thrig/Music-PitchNum

Known Issues

The parser is too lax, in that it will parse invalid input such as cses''' as pitch number 48 on account of the leading c.

SEE ALSO

Music::PitchNum, ly-fu of App::MusicTools

REFERENCES

AUTHOR

thrig - Jeremy Mates (cpan:JMATES) <jmates at cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2014-2016 by Jeremy Mates

This module is free software; you can redistribute it and/or modify it under the Artistic License (2.0).