Hi. I'm trying to plan out my controller in my head and figure out the code as I go along. Below are my two questions, skip to the end of the post if you need more info about my project.
Question 1)
I need to send a program change message, value 12. Which of the following is correct?
MIOS_MIDI_BeginStream();
MIOS_MIDI_TxBufferPut(0xC0); // Program Change, Channel #1
MIOS_MIDI_TxBufferPut(0x12); // Program Number 12
MIOS_MIDI_EndStream();
OR
MIOS_MIDI_BeginStream();
MIOS_MIDI_TxBufferPut(0xC0); // Program Change, Channel #1
MIOS_MIDI_TxBufferPut(0x0C); // Program Number 12
MIOS_MIDI_EndStream();
I'm pretty sure its the second, but I thought I'd check.
Question 2)
I have 6 buttons, I want 4 of them to send program changes, and the other two are more complex so lets tackle the first four first. How do I set these up in the ain64_din128_dout128_v2c example? Can I create an array like the following. Please forgive my syntax, I only know a little objective-c, so I realise the syntax is probably massively wrong:
static unsigned char switches[4] = {
0x00, 0x06, 0x0C, 0x12
};
And use MIOS_DIN_PinGet to say - "Pin 2 was pressed, select location 2 from the array". Then is it possible to store this hex result as a variable which i can use in a MIDI stream request?
More information about my project
It's a simple MIDI box. 1x core, with PIC18F452, 1x DINx1, 1x DOUTx1. 6x buttons, 6x LEDs. The first 4 buttons send different program change messages, the last two buttons send CC#. On first press they send value 127, on second press they are toggled to value 00.
I'm quickly realising I'm in way over my head, but everyone has to start somewhere right?