auditory.described
Class MidiCalculator

java.lang.Object
  extended by auditory.described.MidiCalculator

public class MidiCalculator
extends java.lang.Object

A utility class for working with MIDI numbers Note: "Midi" is not "MIDI" to be consistent with the naming convention of exitsing Java classes

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Constructor Summary
MidiCalculator()
           
 
Method Summary
static int numberFor(char pitch, boolean sharp, int octave)
          Calculate the MIDI number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiCalculator

public MidiCalculator()
Method Detail

numberFor

public static int numberFor(char pitch,
                            boolean sharp,
                            int octave)
Calculate the MIDI number

Parameters:
pitch - The pitch ('A','B','C','D','E','F', 'G' or 'R')
sharp - true for a sharp and false for a natural
octave - The octave (relative to middle C)
Returns:
The MIDI number


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers