00andi Posted September 21, 2011 Report Posted September 21, 2011 Hello build my midibox thanks tk now i have a problem with setting up a shift button in the programm i have three buttons which sending 3 different midi notes on channel 16 and a button (pin 24) which should be used as a shift button if i press the shift button the three buttons should send on channel 3 tried it with if / else - see the code snippet - but only the channel 16 works can someone help me regards // the shift button if(pin == 24) { // the three buttons with channel 3 if(pin == 8) { MIOS_MIDI_BeginStream();MIOS_MIDI_TxBufferPut(0x92);MIOS_MIDI_TxBufferPut(0x24);MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f);MIOS_MIDI_EndStream(); MIOS_DOUT_PinSet(1,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(3,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(108,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(110,pin_value ? 0x00 : 0x7f); MIOS_LCD_Clear();MIOS_LCD_PrintCString("matrix ");MIOS_LCD_PrintBCD4(pin); return; } if(pin == 9) { MIOS_MIDI_BeginStream();MIOS_MIDI_TxBufferPut(0x92);MIOS_MIDI_TxBufferPut(0x25);MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f);MIOS_MIDI_EndStream(); MIOS_DOUT_PinSet(1,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(3,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(108,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(110,pin_value ? 0x00 : 0x7f); MIOS_LCD_Clear();MIOS_LCD_PrintCString("matrix ");MIOS_LCD_PrintBCD4(pin); return; } if(pin == 10) { MIOS_MIDI_BeginStream();MIOS_MIDI_TxBufferPut(0x92);MIOS_MIDI_TxBufferPut(0x26);MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f);MIOS_MIDI_EndStream(); MIOS_DOUT_PinSet(1,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(3,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(108,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(110,pin_value ? 0x00 : 0x7f); MIOS_LCD_Clear();MIOS_LCD_PrintCString("matrix ");MIOS_LCD_PrintBCD4(pin); return; } } else // three buttons with channel 16 if(pin == 8) { MIOS_MIDI_BeginStream();MIOS_MIDI_TxBufferPut(0x9f);MIOS_MIDI_TxBufferPut(0x24);MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f);MIOS_MIDI_EndStream(); MIOS_DOUT_PinSet(1,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(3,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(108,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(110,pin_value ? 0x00 : 0x7f); MIOS_LCD_Clear();MIOS_LCD_PrintCString("matrix ");MIOS_LCD_PrintBCD4(pin); return; } if(pin == 9) { MIOS_MIDI_BeginStream();MIOS_MIDI_TxBufferPut(0x9f);MIOS_MIDI_TxBufferPut(0x25);MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f);MIOS_MIDI_EndStream(); MIOS_DOUT_PinSet(1,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(3,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(108,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(110,pin_value ? 0x00 : 0x7f); MIOS_LCD_Clear();MIOS_LCD_PrintCString("matrix ");MIOS_LCD_PrintBCD4(pin); return; } if(pin == 10) { MIOS_MIDI_BeginStream();MIOS_MIDI_TxBufferPut(0x9f);MIOS_MIDI_TxBufferPut(0x26);MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f);MIOS_MIDI_EndStream(); MIOS_DOUT_PinSet(1,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(3,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(108,pin_value ? 0x00 : 0x7f);MIOS_DOUT_PinSet(110,pin_value ? 0x00 : 0x7f); MIOS_LCD_Clear();MIOS_LCD_PrintCString("matrix ");MIOS_LCD_PrintBCD4(pin); return; } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.