Hi all,
I’m currently hacking the Ambika firmware to provide a way to dump patch values from the Ambika to my BCR2000 (I assumed that it’s not possible as of today (?))
I have 6 templates (or ‘preset’) on the BCR, each corresponding to an Ambika part (I assigned a midi channel for each part on the Ambika).
The idea is to have the BCR updated when switching presets on the BCR (could be useful also after loading a patch on the Ambika).
This can be done using a so called ‘LEARN output’ message from the BCR, that sends a sysex (that Behringer calls a ‘Data Request’). I took a free message number (0x16) as the ‘Data request’ command, and wrote a handler in the Ambika firmware. When receiving the Data Request (with the part number as a parameter), the Ambika sends a bunch of CCs on the corresponding midi channel:
case 0x16: {
const Parameter& parameter = parameter_manager.parameter(59);
uint8_t midi_channel = parameter_manager.GetValue(parameter, location.part, 0);
if (midi_channel)
--midi_channel; //?
for (uint8_t index=0; index<kNumParameters; ++index) {
const Parameter& parameter = parameter_manager.parameter(index);
if(parameter.level==PARAMETER_LEVEL_PATCH || parameter.level==PARAMETER_LEVEL_PART) {
uint8_t value = parameter_manager.GetValue(parameter, location.part, 0);
if ( (parameter.midi_cc < 1) || (parameter.midi_cc > 120)) continue;
midi_dispatcher.Send3(0xb0 | midi_channel, parameter.midi_cc, value & 0x7f);
midi_dispatcher.Flush();
}
}
}
And… it’ working! Well at least for many parameters except parameters that have the same ID but necessitate a stride to get the actual value (e.g., enveloppes). I cannot figure out how striding works. What I want to do is to get the midi_cc corresponding to parameters that necessitates striding.
Any tips?
I hope that all of this makes sense…
Cheers,
Stéphane
PS: I do not know how to format the code in this message, any pointer on a doc on how to do this? ok, I’ve found the sticky message in the forum about formatting