CatOrg Posted August 25, 2011 Report Share Posted August 25, 2011 Hello, I would like to avoid MIDIOX for mapping the output of the Midibox-cores, so I think of modifying the program "Sending MIDI events on button movements" (/Ucapps/Programming/MIOS 8 C Interface). I understand that modifying this way would do the trick for configuring the channel: MIOS_MIDI_TxBufferPut(0x90); // Note Event at channel #1 MIOS_MIDI_TxBufferPut(0x91); // Note Event at channel #2 MIOS_MIDI_TxBufferPut(0x92); // Note Event at channel #3 etc But I need also to set first note number to 36, and thats my question. I suppose it is from general interest, since many musician use anyway 5-octaves-keyboard. If I modify MIOS_SRIO_NumberSet(16); // for 128 pins this way, I suppose I'll get the notes 0-63 MIOS_SRIO_NumberSet(8); // for 64 pins So I understand I must set the value of 36 as first note number in the DIN_NotifyToggle part of the program, is it the right way to write: void DIN_NotifyToggle(unsigned char pin, 24) __wparam ; // 24 ist hex for 36 or must it be: void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam { MIOS_MIDI_TxBufferPut(0x90); // Note Event at channel #1 MIOS_MIDI_TxBufferPut(0x24); // begin with pin #36 MIOS_MIDI_TxBufferPut(pin); // just forward the pin number (36..96) MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // Velocity = 0x7f when // button pressed, else 0x00 } ? Or something else? Excuse me, but my notions of programation are very basical... Thanks in advance, Francois Quote Link to comment Share on other sites More sharing options...
ilmenator Posted August 25, 2011 Report Share Posted August 25, 2011 ///////////////////////////////////////////////////////////////////////////// // This function is called by MIOS when an button has been toggled // pin_value is 1 when button released, and 0 when button pressed ///////////////////////////////////////////////////////////////////////////// void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam { MIOS_MIDI_TxBufferPut(0x90); // Note Event at channel #1 MIOS_MIDI_TxBufferPut(pin+offset); // just forward the pin number (0..127) MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // Velocity = 0x7f when // button pressed, else 0x00 } in which offset is the transposition you want to apply. E.g., if you want your notes to be played one octave higher, then offset = 12. Hope that helps, ilmenator Quote Link to comment Share on other sites More sharing options...
CatOrg Posted August 25, 2011 Author Report Share Posted August 25, 2011 Hi Ilmenator, best thanks to you, This is what I was searching! :-) Quote Link to comment Share on other sites More sharing options...
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.