public class ABCUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static ABCUtil |
Singleton
Singleton instance of the class
|
Modifier | Constructor and Description |
---|---|
private |
ABCUtil()
private constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFileContents(java.lang.String filename)
Returns the contents of a text file, e.g.
|
ABCInstrument[] |
getInstruments()
Get an array of all the available instruments as ABCInstruments
where the instrument's value is the MIDI instrument number
|
double |
parseFraction(java.lang.String frac)
Return the evaluation of a string "a/b".
|
double |
parseTempo(java.lang.String tempo,
double defaultNotesPerQuarterNote)
Return the tempo given by the input string.
|
public static final ABCUtil Singleton
public double parseFraction(java.lang.String frac)
frac
- - a string containing a fractionpublic double parseTempo(java.lang.String tempo, double defaultNotesPerQuarterNote)
tempo
- - tempo represented as a stringdefaultNotesPerQuarterNote
- - default notes per quarter notepublic java.lang.String getFileContents(java.lang.String filename)
filename
- the name of the file with respect to the default package, where "/" refers to the default package, e.g. a file in the "data" package would "/data/myfile.abc"public ABCInstrument[] getInstruments()