Gemphet8 ; 8-polyphonic synthesizer control application

Dependencies:   MIDI REnc button mbed

Revision:
11:e6a47dc75120
Parent:
10:c3b797b62ddb
diff -r c3b797b62ddb -r e6a47dc75120 MIDI_Proc/midi_proc.cpp
--- a/MIDI_Proc/midi_proc.cpp	Tue Aug 12 00:00:28 2014 +0000
+++ b/MIDI_Proc/midi_proc.cpp	Thu Nov 27 06:47:43 2014 +0000
@@ -12,12 +12,14 @@
 void midi_init(void)
 {
     midi.begin();
+
     midi.setHandleNoteOff(&midi_noteoff);
     midi.setHandleNoteOn(&midi_noteon);
     midi.setHandleControlChange(&midi_cc);
     midi.setHandleProgramChange(&midi_pc);
     midi.setHandlePitchBend(&midi_pbend);
     midi.setHandleSystemReset(&midi_sysreset);
+
 }   
 
 /// @brief  Reset all MIDI controller
@@ -58,7 +60,7 @@
     for (i = 0, msk = 0x01; i < NumOfNotes; i++, msk<<=1) {
         if (!(MidiNotesTag & msk)) {
             MidiNotesTag |= msk;
-            MidiNotes[i].Channel = i;
+            MidiNotes[i].Channel = i + 1;
             return (&MidiNotes[i]);
         }
     }
@@ -134,7 +136,7 @@
     for (ptr = &NoteStart; ptr->next; ptr = ptr->next) {
         if (note == ptr->next->Note) {
             lastptr = ptr->next;
-            midi.sendNoteOff(lastptr->Note, lastptr->Velocity, lastptr->Channel);
+            midi.sendNoteOff(lastptr->Note, velocity, lastptr->Channel);
             ptr->next = lastptr->next;
             freeN(lastptr);
             break;