Trying to have (e.g.) POT 1 send MIDI CC (say 16) when turned but a send different cc (say 77) when pressed.
After looking through previous posts, the docs and other Presets, I’ve tried events.onPotTouchChange() but it just fires all the time, (seemingly) uncontrollably.
I tried this [rough] code as a function called from the control [POT_1] in the Layout:
function knobPressed(valueObject, value)
index = 1
setNum = 1
– set CC number from array of ‘CC sets’
local ccNumber = allSets[setNum][index]
midi.sendControlChange(PORT_1, 1, ccNumber, 127)
print(string.format(“LUA SENT: Set %d | Index %d | CC %d”, setNum, index, ccNumber))
end
But this code executes when the Pot gets pressed AND turned.
I would love to see a way to use the encoder switches in addition to the dial controller type even without the need of Lua scripts as I already mentioned here.
Regarding the Mini’s practical but smaller form factor, I think it’s wasted potential to use only one of the two functions.
I tried your script, but it produced errors. I then simplified it and managed to get both CC types to be sent when the encoder is turned. However, nothing happened when the switch was pressed. Have you found a way to detect when the switch is pressed and assign a corresponding function? If so, could you send me a link to a working preset? I’m not very familiar with Lua, but Gemini has helped me a lot with some tasks. Unfortunately, not for this purpose yet.
Thanks for the reply; based on looking at a MIDI monitor (with a DIAL & PAD controls) seems safe to assume one control one function at this point.
I also looked at the Double Tap presets & thread (for the Mk2) e.g. using timer events but all of this is taking away from making music. Happy for now to have the Mini ADSR & V Fader controls.
Also … from lua extension document it looks like a possible path using midi.onSysex(midiInput) - but this is beyond what I have time to do.
FWIW here’s some code for capturing the first touch of a POT
function preset.onLoad()
events.subscribe(POTS)
end
local potState = {}
function events.onPotTouchChange(potId, controlId, touched)
if touched then
if not potState[potId] then
potState[potId] = true
print("Touched: " .. potId .. " - " .. controlId)
-- MIDI message / logic here
end
else
-- reset on release
potState[potId] = false
end
end
Thanks for providing the code. That works but of course it reacts always when the encoder is touched. Which means it cannot be assigned in addition to an existing dial assignment.
If there were a command like “…onPotButtonChange” or something similar instead of “…onPotTouchChange” …
And honestly I think it makes perfect sense to have the Mini without a touch screen, The Mini has a lot potential for live performances or being used as a versatile remote control for effect units, instruments, whatever, that are not equipped with an intuitive UI. Maybe even only for certain parameters and to avoid menu diving in a certain situation.
At least I definitely prefer to use hardware buttons and controls rather than touch screens in a live situation.
Just as an example, the Yamaha CK is a stage keyboard that has a dedicated audio input. The input features a dual insert effect section that is way more than sufficient to use it with another instrument or even a microphone. But unlike most keyboard related parameters on the instrument these effect settings require a lot of menu diving using just a few tiny buttons. But you maybe want to control the amount of reverb, have quick access to the EQ or just turn reverb on and off during your performance. Or let’s say you want to control the volume of the USB audio input when working with backing tracks… the Mini brings all the missing hardware encoders and buttons “to the front” and as mentioned, I don’t think that a touch screen is needed in these scenarios.
There are probably hundreds of more devices like this where the Mini is by far the best solution I can think of.