Display Class for BaseMachine

Revision:
5:6264a3682865
Parent:
4:e51a5f0891a0
Child:
6:ec1d00fa9835
--- a/ST7565_SequencerDisplay.h	Fri Aug 26 05:11:10 2016 +0000
+++ b/ST7565_SequencerDisplay.h	Fri Aug 26 07:23:27 2016 +0000
@@ -45,10 +45,16 @@
         }
         
         for (i = 0; i < 16; i++) {
-            if (this->getOctave() == sequences[i].getOctave()) {
-                int pitchRev = 12 - sequences[i].getPitch();    // Pitchの位置をGridの下から上に変換
+            int noteOctave = (sequences[i].getPitch() / 12) - (Sequence::getBaseNoteNumber() / 12);
+            int pitchInOctave = sequences[i].getPitch() % 12;   // 表示中のOctave内のPitch
+            // Octave内の12音階とOctave+1のPitch=0を表示
+            if (this->getOctave() == noteOctave) {
+                int pitchRev = 12 - pitchInOctave;  // Pitchの位置をGridの下から上に変換
                 gLCD->fillrect(i * 7, pitchRev * 4 + 5, 7, 4, 1);
             }
+            if ((this->getOctave() + 1 == noteOctave) && (pitchInOctave == 0)) {
+                gLCD->fillrect(i * 7, 5, 7, 4, 1);
+            }
         } 
 
         // NoteOn & Tie Grid