2

is it possible to make custom note and rest duration using JFugue? I have been trying to achieve this by using the / symbol in MusicString for the note duration but with no success. The code used is:

 Player player = new Player();

player.play("V0 I[Flute] A/3");

This makes the A note to be played for 6 seconds. In this case i can just divide by 2 and get the wanted result, but i am not sure if this is the correct approach. The second problem is when using the symbol @milliseconds which indicates the time (in milliseconds) when the following tokens should be played. For some reason i can't make the next note to be played after the milliseconds i have declared. In the following example the B note is played at after 34sec instead of 2sec.
player.play("V0 I[Flute] A @2000 B");

Any help would be appreciated.

Neos
  • 53
  • 5

1 Answers1

0

It seems that you're asking for a custom note duration measured in seconds. The duration you provide for notes in JFugue is measured in beats. To figure out how a long a note will last in seconds, you need to multiply the beats by the tempo, which is measured in beats per minute, or bpm (then do some unit conversions on minutes to seconds). The default tempo is 120 bpm. You can change the duration with the T directive in JFugue, like "T120" or "T60" - "T60" will have the same effect as dividing the duration in half.

I recommend using JFugue 5 if you're not already doing so; the management of timing in JFugue 5 is much improved over JFugue 4. In particular, JFugue 5 measures the value given to @ in beats, not milliseconds. (Disclosure: I'm the author of JFugue)

David Koelle
  • 20,726
  • 23
  • 93
  • 130