Commits

Gordon McGregor  committed 64a143a

Basic configuration sending is working

  • Participants
  • Parent commits b01b48a

Comments (0)

Files changed (2)

File faux_vox.pde

 
 enum {OFF, INFO, DEBUG, TRACE} debug_levels;
 
-const int DEBUG_LEVEL = DEBUG;
+const int DEBUG_LEVEL = OFF;
 
 int previous_index, current_bank;
 
     } else {
       if (index == 0 || index == 5) {
        // a switch, other than bank switch was released 
-        channel = previous_index % 5;
+        channel = (previous_index % 5) - 1;
         debug("released", channel, DEBUG);
         debug("TnI ", banks.bank[current_bank].switches[channel].toggle_not_immediate, DEBUG);
         // if IMMEDIATE send on button press and release, if TOGGLE only send on button press
         }    
       } else {
        // a non-bank switch was pressed 
-        channel = index % 5;
+        channel = (index % 5) - 1;
         debug("pressed", channel, DEBUG);
         // always send on button press
         debug("toggle", channel, INFO);
 
 void send_midi_message(char* message) {
 
+
   for(int i=0; i < MIDI_MESSAGE_LENGTH; i++) {
-    if(i==0 && message[i] < 128) {
-      break; // first byte has to be a control / command byte, value 1xxx_xxxx 
-    } 
-    else {
-      send_byte(message[i]); 
-    }
-
-    if(i>0 && message[i] > 127) {
-      break; // data bytes are 127 or less 
-    } 
-    else {
-      send_byte(message[i]);
-    }
+    send_byte(message[i]);
   }
+  
+//  
+//    if(i==0 && (message[0] < 128)) {
+//      break; // first byte has to be a control / command byte, value 1xxx_xxxx 
+//    } 
+//    else {
+//      send_byte(message[i]); 
+//    }
+//
+//    if(i>0 && message[i] > 127) {
+//      break; // data bytes are 127 or less 
+//    } 
+//    else {
+//      send_byte(message[i]);
+//    }
+//  }
 }
 
 void send_byte(byte b) {

File midi_tester.py

 #!/usr/bin/env python
 import serial
 
-debug = True
- 
 class Arduino():
  
   def __init__(self, path='/dev/tty.usbserial', baud=9600):
 
   while (1):
     command = a.read(3)
-    if debug:
-      print command,
-    else:
-      print hex(ord(command[0])), hex(ord(command[1])), hex(ord(command[2]))
+    print hex(ord(command[0])), hex(ord(command[1])), hex(ord(command[2]))