回答您问题的第一部分:在 F 大调中,Bb 的演奏方式与 Bb 相同,在 F 大调中演奏时与 B 本身相同。这是一个测试这个的程序:
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);
以及它的输出(注意 MIDI Note 70 是 Bb 而 MIDI Note 71 是 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
回答您问题的第二部分:我不确定现在是否有合适的答案。但是你启发了我在课堂上写了一个transpose()
方法。Pattern
谢谢!