public final class NoteUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getFlatNoteName(int pitch)
Returns the flat note name of the given pitch.
|
static int |
getNotePitch(String name)
Returns the note pitch of the given note (between 0 and 11).
|
static String |
getSharpNoteName(int pitch)
Returns the sharp note name of the given pitch.
|
static int |
getTransitionPitch(Chord chord,
Chord nextChord)
Returns a transition pitch between the chord and the next chord, which is based on the base pitches of the two chords.
|
static boolean |
isOnScale(int pitch)
Returns true iff the given pitch is on the C/Am scale (i.e., a white key on the piano keyboard).
|
public static String getSharpNoteName(int pitch)
pitch
- the pitchpublic static String getFlatNoteName(int pitch)
pitch
- the pitchpublic static int getNotePitch(String name)
name
- the note namepublic static boolean isOnScale(int pitch)
pitch
- the pitch to checkpublic static int getTransitionPitch(Chord chord, Chord nextChord)
chord
- the current chordnextChord
- the next chord (or null)