MIDI Rotary Encoder

Ask a generic question about the usage of QLC+, not related to a particular operating system
Post Reply
Xoneoo
Posts: 8
Joined: Sun Nov 19, 2023 6:58 am
Real Name:

Hi,
I trying to get a Midi Rotary Encoder working as a relative input. (Raspberry Pi Pico with "Control Surface" Library).
in Midi View I can see that the Midi Device send a Control change with a value of 1 at CCW and 65 at CW.

- I set up a Input Profil as an encoder, on using the encoder I see the Joystick Symbol
- in VC I create a knob and set up the input device

I can control the knob via the encoder, but it seems it's in absolute Mode.
If the knob value is changed in the VC direct and I turn the Midi Encoder the value jump back to the old value that was set by the Midi Encoder,
so not a relative change of the current knob value.

Is there a way to use the Midi Encoder as a relative Encoder for Knobs, Faders and also for a XY Pad.
So the goal woud be decreasing/increasing the target value by a certain amount per CW/CCW click (and limiting at 0/255).

I also thinking of using a script but have no idea how to do this in QLC+:
trigger on Encoder Input CW >
val = val +1
if val >255 {val=255}

trigger on Encoder Input CCW >
val = val -1
if val <0 {val=0}

BTW: I also try this via OSC, there I have the same problem that the a Encoder is not relative and the value always jumping back to the last Encoder Value
MichelSliepenbeek
Posts: 717
Joined: Wed Feb 08, 2023 10:24 am
Location: Nederland
Real Name: Michel Sliepenbeek

You could have a look at this post: viewtopic.php?p=70300#p70300.
It gives you an example of how you can use (Loopback) sliders in Absolute and Relative mode.

It is important to know that i initialy used this with encoders that:
- would produce a value 126 as long as you hold it CCW,
- would produce a value 128 as long as you hold it CW,
- would go back to value 127 when you release it.

Eventually i did not use that midi controller at all and changed the logic to act on Flash buttons.


I realise that your decoder works differently, but maybe this example will show you the direction in which you could go.
A QLC Workspace is like a Bob Ross painting: "it's your world, you can create whatever you want!"
MichelSliepenbeek
Posts: 717
Joined: Wed Feb 08, 2023 10:24 am
Location: Nederland
Real Name: Michel Sliepenbeek

I knew i had made a kind of "test set up".
Took a night of sleep to remember where i saved it. :) :)

You have 2 sets of buttons. One set uses a fixed time (bases on Run Once Sequences), the other set uses Flash Buttons (based on Scenes).
It is up to you, to play around with the run Times of the Sequences as well as the DMX values of the scenes to make it act like you want it to do.

Be aware that the Relative Slider is set up as LTP.
If the (Abs.) Slider does not stop when you release the Flash buttons, you should keep the Neutral Button On (add it to your Start Up Function).
Attachments
Loopback-Decoder.qxi
(550 Bytes) Downloaded 84 times
decoder.qxw
(12.38 KiB) Downloaded 73 times
A QLC Workspace is like a Bob Ross painting: "it's your world, you can create whatever you want!"
Xoneoo
Posts: 8
Joined: Sun Nov 19, 2023 6:58 am
Real Name:

Hello Michel,

thank you very much for your great help!
Now I understand how QLC handel the relative Mode.
the examples (in this thread and also the linked thread) works well in VC.
I think now I have to check and edit my MCU Code, because for now the MIDI Device send a control change on every tick and not a neutral value (127) after the tick.
I will try figure it out what need to change.
If only use midi buttons I'm sure it would already work.
MichelSliepenbeek
Posts: 717
Joined: Wed Feb 08, 2023 10:24 am
Location: Nederland
Real Name: Michel Sliepenbeek

in your first post i could only find :
in Midi View I can see that the Midi Device send a Control change with a value of 1 at CCW and 65 at CW.
If you receive ticks (pulses followed by a pause, what you expect from a endless rotary encoder), you won't need a neutral value.
In this situation you can use the sequences and fine tune the timing to match with the duration of the "tick", so that it will allways run once (not 0, not 2 times) for every tick.
If necessary you can add an extra step to the sequence that forces a pause.

If your encoder works like a joy stick, you need a neutral value.


As i have no experience with Raspberry pi at all (and to be honest: no intention to change that in the future) i just had to guess.
That's why i came up with 2 sets of buttons.
A QLC Workspace is like a Bob Ross painting: "it's your world, you can create whatever you want!"
Xoneoo
Posts: 8
Joined: Sun Nov 19, 2023 6:58 am
Real Name:

Yes, when the MCU is changed to send different "buttons" on CW and CCW per tick, it's possible to use the sequence.
Yesterday, the MCU sent the data on the same note but with a value (velocity) 1 or 65.
On this, I can not select a different value for up or down.

But now with the sequence and the different midi send option, it will work.
Post Reply