NAME
MIDI::Pitch - Converts MIDI pitches and note names into each other
SYNOPSIS
use MIDI::Pitch;
# see below
DESCRIPTION
This module converts MIDI pitches between 0 and 127 (called 'note numbers' in the MIDI standard) and note names into each other. The octave numbers are based on the table found in the MIDI standard (see http://www.harmony-central.com/MIDI/Doc/table2.html):
The MIDI specification only defines note number 60 as "Middle C", and
all other notes are relative. The absolute octave number designations
shown here are based on Middle C = C4, which is an arbitrary
assignment.
The note names are C
, C#
/Db
, D
, ..., followed by an octave number from -1 to 9. Thus, the valid notes ranges between C-1
and G9
.
FUNCTIONS
name2pitch($name)
Converts a note name into a pitch.
pitch2name($pitch)
Converts a pitch between 0 and 127 into a note name. pitch2name returns the lowercase version with a sharp, if necessary (e.g. it will return 'g#', not 'Ab').
HISTORY
SEE ALSO
http://www.harmony-central.com/MIDI/Doc/table2.html
AUTHOR
Christian Renz, <crenz@web42.com>
COPYRIGHT AND LICENSE
Copyright 2004 by Christian Renz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.