Beginner questions.
My new midi keyboard doesn't have zones, so I looked into getting the Ax to do that for me.
I've done a lot of coding, but nothing on the Ax before.
Here's the script, modded from a simple thru found on the forum ( I've looked for a MidiThru object, seen mention of it but can't find the actual file)
if (dev == MIDI_DEVICE_USB_HOST) {
uint8_t status_type = status & 0xF0;
uint8_t midi_ch = status & 0x0F;
uint8_t split_note = 0x3F;
uint8_t left_zone_ch= 0x01;
uint8_t right_zone_ch= 0x00;
if ((status_type == MIDI_CONTROL_CHANGE) ||
(status_type == MIDI_POLY_PRESSURE) ||
(status_type == MIDI_PITCH_BEND)) {
MidiSend3(MIDI_DEVICE_DIN,0,status,data1,data2);
} else if ((status_type == MIDI_PROGRAM_CHANGE) ||
(status_type == MIDI_CHANNEL_PRESSURE)) {
MidiSend2(MIDI_DEVICE_DIN,0,status,data1);
} else if ((status_type == MIDI_NOTE_OFF) ||
(status_type == MIDI_NOTE_ON)){
uint8_t status_ch = status;
if ( data1<split_note ) {
status_ch = status_type | left_zone_ch;
} else {
status_ch = status_type | right_zone_ch;
}
MidiSend3(MIDI_DEVICE_DIN,0,status_ch,data1,data2);
}
}
So it just sends the top half of the keyboard to Ch1, bottom half to Ch2. Any commands other than Notes keep their channel.
To some extent I can just work on the script do whatever want as regards octave shifts or whatever, but I'd like to make it configurable by midi Prog Ch for performance.
I read that the script obj is deprecated, and I want to be able to write to persistent variables.
So any pointers as to how to take the next step, which is presumably to move that code over to an object?
Where can I look at the functions and variables that will be in scope for the code in the objects?