Jump to content

Modifying the DIN-Program


CatOrg
 Share

Recommended Posts

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

Link to comment
Share on other sites

/////////////////////////////////////////////////////////////////////////////

// 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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...