1


I have a couple of questions concerning JFugue (5, the beta version).

  • From The complete guide to JFugue, it is mentioned that depending on the Key Signature in the pattern, JFugue interprets the note value. As an example, in the case of an F-major key, B would be automatically translated to B-flat, unless we write "Bn" instead. The question is that if we are dealing with an F major key and write "Bb" how would JFugue interpret it ? As "Bbb" or as a "Bb" note ?
  • My second question is about transposing Keys in JFugue.
    What is the fastest way of doing so ?

Thank you for your help,
Best Regards,
Hussein Hammoud.

Hussein Hammoud
  • 171
  • 1
  • 13
  • These are both excellent questions, thank you! I'll do my best to answer them, but unfortunately I can't do it today. – David Koelle Mar 17 '15 at 13:41
  • Oh And I have another question, JFugue 5 is giving me an error when I play a pattern containing a numerical value of a note (example: C5 corresponds to [60]). That is not the case in JFugue4. Any suggestions are appreciated. – Hussein Hammoud Mar 17 '15 at 13:57
  • For that last one, use 60 without the brackets. JFugue 5 does away with brackets except in cases where the stuff inside the bracket is a string to look up in a dictionary (e.g., "T[Allegro]" or "I[Piano]"). Numbers are just numbers and do not need brackets in JFugue 5. – David Koelle Mar 23 '15 at 14:45

1 Answers1

1

Answer to the first part of your question: In the key of F-Major, Bb is played like Bb, the same as B itself when played in F-Major. Here's a program that tests this:

StaccatoParser parser = new StaccatoParser();
DiagnosticParserListener dpl = new DiagnosticParserListener();
parser.addParserListener(dpl);
Pattern pattern = new Pattern("KEY:Cmaj B Bn Bb   KEY:FMaj B Bn Bb");
parser.parse(pattern);

And its output (note that MIDI Note 70 is Bb and MIDI Note 71 is B):

Before parsing starts
Key signature parsed: key = 0  scale = 1
Note parsed: value = 71  duration = 0.25  onVelocity = 64  offVelocity = 64
Note parsed: value = 71  duration = 0.25  onVelocity = 64  offVelocity = 64
Note parsed: value = 70  duration = 0.25  onVelocity = 64  offVelocity = 64
Key signature parsed: key = 5  scale = 1
Note parsed: value = 70  duration = 0.25  onVelocity = 64  offVelocity = 64
Note parsed: value = 71  duration = 0.25  onVelocity = 64  offVelocity = 64
Note parsed: value = 70  duration = 0.25  onVelocity = 64  offVelocity = 64
After parsing finished

Answer to the second part of your question: I'm not sure there's a decent answer right now. But you have inspired me to write a transpose() method on the Pattern class. Thank you!

David Koelle
  • 20,726
  • 23
  • 93
  • 130
  • Thank you for your answers ! This was really helpful. I am currently trying to write the "transpose()" method and I will send it to you if it ends up working without any bugs. I appreciate your response :D Best Regards, Hussein. – Hussein Hammoud Mar 29 '15 at 10:11