Hi Nick, I tried the TouchOSC setup and I've spent a few hours specifically trying to hack my way around that input rotation control. Unfortunately, even with all the flexibility coming from the Lua scripts I can use in Touch OSC to customize the MIDI messages, I could find no way to make that control snap to values that don't have black frames (basically, multiples of 15 or 45 degrees corners). I should mention that even if I use the knob in the UI, I cannot make it snap to certain values like 0 (it either rests on -1 or 1). Via TOuch OS, I tried multiple things, among which:
- setting up a lookup table so that I'd only send MIDI values that map to the desired corners, but no luck, as the possible values within the 127 precision of MIDI don't precisely map to such corners.
- setting up a script to send 14-bit MIDI values instead (I'll paste a version of it below), but that also does not seem to work. The "learn 14-bit" functionality in mix emergency doesn't seem to pick these up, aside from random times in which perhaps the messages are coming in with just the right timing (and even then, strangely, it picks the smaller controller to be the "fine" parameter one, instead of the other way around). Even manually setting the parameters (14-bit checkbox, Fine controller number) doesn't make it pick up the 14-bit values.
In light of this I do think it might be worth looking into some snapping functionality for this control if that's possible for an upcoming version. Or some help / fix around what kind of 14-bit messages exactly is MixEmergency looking for.
My script looks like this, but I tried other versions where MSB and LSB are swapped, or where there is a wait between messaged (10ms, 33ms, 50ms, 100ms...):
local lookup = {
0,
16,
32,
48,
62.5,
80.5,
95.5,
127
}
function onValueChanged(valueName)
if valueName == 'x' then
local value = lookup[self.values[valueName]+1]
local scaledValue = math.floor((value / 127) * 16383)
local MSB = math.floor(scaledValue / 128)
local LSB = scaledValue % 128
local controllerNumber = 10
print("Sending MIDI messages: ", MSB, LSB)
sendMIDI({ MIDIMessageType.CONTROLCHANGE, controllerNumber, MSB }))
sendMIDI({ MIDIMessageType.CONTROLCHANGE, controllerNumber + 32, LSB })
end
end