Is there a way to get millisecond duration of a jfugue duration like w, given a specific BPM rate?
Something like:
int millisDuration = durationManager.getMillis("w", 120);
Is there a way to get millisecond duration of a jfugue duration like w, given a specific BPM rate?
Something like:
int millisDuration = durationManager.getMillis("w", 120);
At the moment, the closest thing is a method in
NoteSubparser
calledgetDurationForString("UPPERCASE STRING")
, which will return a double that represents the portion of a whole note that the string is. For example, passing"H"
for a half-note will return 0.5. The string can be arbitrarily complex, such as"WWWH."
(three whole notes and a dotted half), which will return 3.75. Since the value returned is relative to beats, and you have a BPM in mind, you should be able to calculate the milliseconds from that.Use
NoteSubparser.getInstance()
to get an instance of NoteSubparser, then callgetDurationForString("W")
(Edit: It's necessary to use capital letters when calling parser code directly like this).