public class Convert
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SEPARATOR |
static java.lang.String |
LEFT_BRACKET |
static java.lang.String |
RIGHT_BRACKET |
Modifier and Type | Method and Description |
---|---|
static float |
getFrequencyByMidiPitch(int midiPitch)
Get the frequency of a given MIDI pitch
|
static int |
getMidiPitchByFrequency(float frequency)
Get the midi pitch of a given frequency.
|
static java.lang.String |
getNameOfMidiPitch(int pitch)
Get the midi note name for a given pitch value.
|
static java.lang.String |
noteToXMLString(Note note) |
static java.lang.String |
partToXMLString(Part part) |
static java.lang.String |
phraseToPitchAndRhythmString(Phrase phrase)
Converts a Phrase, to a list of comma separated values alternately
describing the pitch and rhyhtm value of each Note in the phrase.
|
static java.lang.String |
phraseToPitchRhythmAndDynamicString(Phrase phrase)
Converts a Phrase, to a list of comma separated values alternately
describing the pitch, rhyhtm value and dynamic of each Note in the
phrase.
|
static java.lang.String |
phraseToXMLString(Phrase phrase) |
static Phrase |
pitchAndRhythmStringToPhrase(java.lang.String string)
Converts a list of pitch and rhythm-value pairs, each value separated by
a non-digit, to the Phrase that those values represent.
|
static Phrase |
pitchRhythmAndDynamicStringToPhrase(java.lang.String string)
Converts a list of pitch, rhythm-value and dynamic sets, each value
separated by a non-digit, to the Phrase that those values represent.
|
static java.lang.String |
scoreToXMLString(Score score) |
static Note |
xmlStringToNote(java.lang.String string) |
static Part |
xmlStringToPart(java.lang.String string) |
static Phrase |
xmlStringToPhrase(java.lang.String string) |
static Score |
xmlStringToScore(java.lang.String string) |
public static final java.lang.String DEFAULT_SEPARATOR
public static final java.lang.String LEFT_BRACKET
public static final java.lang.String RIGHT_BRACKET
public static Phrase pitchAndRhythmStringToPhrase(java.lang.String string)
string
- String of value separated by commaspublic static java.lang.String phraseToPitchAndRhythmString(Phrase phrase)
phrase
- Phrase to be convertedpublic static Phrase pitchRhythmAndDynamicStringToPhrase(java.lang.String string)
string
- String of value separated by commaspublic static java.lang.String phraseToPitchRhythmAndDynamicString(Phrase phrase)
phrase
- Phrase to be convertedpublic static java.lang.String scoreToXMLString(Score score)
public static java.lang.String partToXMLString(Part part)
public static java.lang.String phraseToXMLString(Phrase phrase)
public static java.lang.String noteToXMLString(Note note)
public static Score xmlStringToScore(java.lang.String string) throws ConversionException
ConversionException
public static Part xmlStringToPart(java.lang.String string) throws ConversionException
ConversionException
public static Phrase xmlStringToPhrase(java.lang.String string) throws ConversionException
ConversionException
public static Note xmlStringToNote(java.lang.String string) throws ConversionException
ConversionException
public static final float getFrequencyByMidiPitch(int midiPitch)
midiPitch
- pitch value from 0 - 127description of {@link Pitches}.
,
description of {@link Frequencies}.
public static final int getMidiPitchByFrequency(float frequency)
frequency
- frequency value in Hzdescription of {@link Pitches}.
,
description of {@link Frequencies}.
public static final java.lang.String getNameOfMidiPitch(int pitch)
pitch
- a value from 0..127Pitches
description of {@link Pitches}.
,
description of {@link Frequencies}.