Hi Robin,
I fear that the whole MIDIO128 application confuses too much. In fact you don’t need to write anything into a .ini file (resp. into the midio_presets.inc file) - such possibilities only exist for people who want to configure the software without touching the code.
You are writing your own software, which only requires a small subset of the preprogrammed MIDIO128 features.
Your application mainly relies on MIOS functions, and mainly exists of selfwritten code. All the MIDIO128 stuff is only unnecessary ballast which makes the whole thing more complex than it could be.
I will give you a short example in the hope that it opens your eyes - it’s written in C, and it requires the MIOS C wrapper (plus the tools which are listed under http://www.ucapps.de/mios_c.html)
Just download the C skeleton (which can be found at the MIOS download site), and ensure that your core is running with MIOS V1.8 (absolutely required!)
Open main.c, and put following code into the Init() function:
void Init(void) __wparam
{
// initialize the shift registers
MIOS_SRIO_NumberSet(16); // shiftregisters
MIOS_SRIO_UpdateFrqSet(1); // mS
}
[/code]
and following code into the DIN_NotifyToggle() function:
[code]
void DIN\_NotifyToggle(unsigned char pin, unsigned char pin\_value) \_\_wparam
{
// send Note C-1, C#1, D-1, ... with the keys assigned to DIN pins 0..60
if( pin \>= 0 && pin \<= 60 ) {
// send note on if key pressed (pin value == 0) and note off if key not pressed (pin value != 0)
MIOS\_MIDI\_TxBufferPut(pin\_value ? 0x80 : 0x90);
// note number can be calculated
MIOS\_MIDI\_TxBufferPut(40 + pin\_number); // 40 corresponds to C-1
// send velocity: 0x7f if note on, 0x00 if note off
MIOS\_MIDI\_TxBufferPut(pin\_value ? 0x00 : 0x7f);
}
}
type “make” in the DOS shell and upload the new .hex file
However I cannot figure how to generate the 2nd and 3rd (required in one case) midi event.
If you now want to send additional notes, then just replicate the three MIOS_MIDI_TxBufferPut lines, and modify the MIDI channel. For Channel #2, write 0x81 instead of 0x80, and 0x91 instead of 0x80
If the note values sent by the second core are different, then this only changes the calculations (xx + pin_number)
I’m sure that we will also find C equivalents to the other functions you’ve already programmed (e.g. the SysEx send function) - you will notice that the code will be much better readable (and especially: changable) then assembly based code - and thats the reason why I strongly recomment you to use another programming language - your project is predestinated for C
Best Regards, Thorsten.