|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.hogent.tarsos.sampled.pitch.Pitch
public final class Pitch
A class representing pitch. Can be used to convert pitch units or to base pitch interval calculations on.
Method Summary | |
---|---|
static Pitch |
getInstance(PitchUnit unit,
double value)
Return a new pitch object using value in a certain unit. |
double |
getPitch(PitchUnit unit)
Get the pitch value in a given unit. |
boolean |
isWesternMusicalPitch()
A pitch is seen as a western musical pitch if it is less than 15 cents removed from the 'correct' pitch. |
java.lang.String |
noteName()
Returns the name of the MIDI key corresponding to the given hertzValue. |
int |
octaveIndex()
Calculates which octave this pitch falls into. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public double getPitch(PitchUnit unit)
unit
- The requested unit.
public int octaveIndex()
java.lang.IllegalArgumentException
- If the pitch does not fall within the range of valid MIDI
KEYS.public java.lang.String noteName()
java.lang.IllegalArgumentException
- When the hertzValue is outside the valid MIDI key range.public java.lang.String toString()
toString
in class java.lang.Object
public boolean isWesternMusicalPitch()
public static Pitch getInstance(PitchUnit unit, double value)
unit
- The unit of the pitch value.value
- The value Itself.
java.lang.IllegalArgumentException
- If RELATIVE_CENTS is given: Cannot convert relative cent
value to absolute frequency.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |