I have a couple of questions concerning JFugue (5, the beta version).
Thank you for your help,
Best Regards,
Hussein Hammoud.
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!