From 1ddf6289a9e6c718605dff39628fb031df8058c6 Mon Sep 17 00:00:00 2001 From: Isak Lindgren Date: Sat, 16 Jun 2018 16:42:36 +0200 Subject: [PATCH] Added proper parsing of "C+2". --- TBbard/src/bard/MidiParser.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/TBbard/src/bard/MidiParser.java b/TBbard/src/bard/MidiParser.java index 86f7805..3e7e560 100644 --- a/TBbard/src/bard/MidiParser.java +++ b/TBbard/src/bard/MidiParser.java @@ -121,9 +121,16 @@ public void getNotes(String filePath, int instrumentIndex, int octaveTarget, boo for(int o = 0; o < 11; o++){ sheets[sm.getChannel()][o] += line; - if(octave < o) sheets[sm.getChannel()][o] += "-1"; - if(octave > o) sheets[sm.getChannel()][o] += "+1"; - + if(noteName.equals("C") && octave > o+1){ + sheets[sm.getChannel()][o] += "+2"; + } else { + if(octave < o) { + sheets[sm.getChannel()][o] += "-1"; + } + if(octave > o) { + sheets[sm.getChannel()][o] += "+1"; + } + } } } else