The simple, "naive" solution is to just output a keystroke for every message that comes in.
Assumptions:
- the encoder sends on CC 01
- we want to press key "up" for clockwise rotation, and "down" for counterclockwise rotation
Code: Select all
Translator 0: clockwise
Options: stop=false
Incoming: MIDI B0 01 pp
Rules:
if pp<65 then exit rules, skip Outgoing Action
Outgoing: Keystroke: Down
Translator 1: counter-clockwise
Options: stop=false
Incoming: MIDI B0 01 pp
Rules:
if pp>15 then exit rules, skip Outgoing Action
Outgoing: Keystroke: Up
Both translators will trigger on the encoder controller. But the first translator will not do anything if the controller value pp is lower than 65 (which is hexadecimal 0x41). The second translator will not be executed if its value pp is more than 15, i.e. 0x0F.
This will work in many cases, but the acceleration feature of the encoder will be completely ignored. Turning it fast will result in slow keypresses.
That's where the next post comes in.
Florian