|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.org.toot.music.tonality.Pitch
public class Pitch
This class provides static methods to support pitches and pitch classes, which are just ints. A pitch is a note in a particular register, where note is used as shorthand for pitch class. i.e. C is a note (and pitch class), C4 is a pitch. Pitch classes are represented as the lowest octave of pitches. Hence pitch classes may usually be used in place of pitches. C-1 = 0 C0 = 12 C1 = 24 C2 = 36 C4 (middle-C) = 60 (arbitrary MMA definition)
Method Summary | |
---|---|
static int |
classCount(int[] pitches)
Count the number of distinct pitch classes in the specified pitches. |
static java.lang.String |
className(int pitch)
Return the name of the pitch class of the specified pitch. |
static java.lang.String |
classNames(int[] pitches)
Return the names of the pitch classes of the specified pitches, seperated by spaces. |
static int |
classValue(int pitch)
Return the int value of the pitch class of the specified pitch. |
static int |
classValue(java.lang.String pitch)
Returns the int value of the pitch class of the specified pitch. |
static int[] |
classValues(java.lang.String pitches)
Returns the int values of the pitch classes of the specified pitches. |
static int[] |
distinctClasses(int[] pitches)
Return the distinct pitch classes of the specified pitches. |
static boolean |
isBlack(int pitch)
Return whether a keyboard key is black for the specified pitch. |
static boolean |
isWhite(int pitch)
Return whether a keyboard key is white for the specified pitch. |
static java.lang.String |
name(int pitch)
Return the name of the specified pitch |
static int |
value(int pitchClass,
int register)
|
static int |
value(java.lang.String name,
int register)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String name(int pitch)
pitch
- the int value of the pitch
public static int value(java.lang.String name, int register)
public static int value(int pitchClass, int register)
public static boolean isWhite(int pitch)
pitch
- the int value of a pitch
public static boolean isBlack(int pitch)
pitch
- the int value of a pitch
public static java.lang.String className(int pitch)
pitch
- the int value of a pitch
public static java.lang.String classNames(int[] pitches)
pitches
- the array of int values of pitches
public static int classValue(int pitch)
pitch
- the int value of the pitch
public static int classValue(java.lang.String pitch)
pitch
- the string representation of a pitch
public static int[] classValues(java.lang.String pitches)
pitches
- the string representation of the pitches
public static int classCount(int[] pitches)
pitches
- the array of int values of the pitches
public static int[] distinctClasses(int[] pitches)
pitches
- the array of int values of the pitches
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |