ROTARY ENCODER CONVERTING VALUES

wynnanon

2013-01-21 21:57:29

Hi
I am using a rotary encoder dial (from A Steinberg "CMC-QC Controller").
I have set up a translator to convert its CC (control change) message to a PC (program change)

INCOMING MIDI:
B0 00 pp

(NO RULES)

OUTGOING MIDI:
C0 pp

This works fine. But because the rotary encoder dial on the "CMC-QC Controller" skips (as default) in incremental values of 5 (i.e. 0-5, 5-10, 10-15 etc...)
It makes this unusable to select sounds from a VST instrument (for example: FM8 synth plugin in Ableton LIVE) Because it skips from the first sound to the 5th sound to the 10th sound etc...

Is there a way to fine tune the OUTGOING MIDI to convert the values to 1,2,3,4,5 etc... ? instead of jumping as the physical encoder is set to do
RULES code?
Different OUTGOING MIDI code?
thanx for any help
-Wynn

DvlsAdvct

2013-01-21 22:39:13

Hi wynnanon

What you want to do is definitely possible. You just need to set rules. First, I have to ask if the rotary goes on in increments forever, or if it is just to 127. And, when you hit zero and continue turning the knob, does it continue sending a signal infinitely (so it would be 0 over and over and over again).

wynnanon

2013-01-21 23:22:28

No it does NOT continue sending a signal infinitely
it stops with a left turn at:
MIDI C0 00

it stops with a right turn at:
MIDI C0 7F

(But the physical DIAL itself does continue infinitely- just to be clear)

FYI
the Controller:
http://www.steinberg.net/index.php?id=5594&L=1

Has a SHIFT button on it that when pressed will allow the DIAL to make finer adjustment (i.e. 0-127 with out the 5pt jumps)

But I cannot do this on stage for various reasons so hence the Question.

THANX
-wynn

DvlsAdvct

2013-01-21 23:59:01

Well, I can't make any promises, unfortunately. If there's no way to set the knob to work with "fine" control (see: correct control) then we can try and hack it together, but it is completely reliant on the controller itself sending the messages we need to change them.

Code: Select all

Translator 1: Knob Turn
Incoming Action: B0 00 pp
Rules: ga=g0-pp
g0=pp
Outgoing Action: Knob move Timer 1ms delay

Translator 2: Knob Turn Up
Incoming Action: Knob Move Timer
Rules: if ga<=0 then exit rules, skip outgoing action
gb=gb+1
if gb>=127 then gb=127
Outgoing Action: C0 gb

Translator 3: Knob Turn Down
Incoming Action: Knob Move Timer
Rules: if ga>=0 then exit rules, skip outgoing action
gb=gb-1
if gb<=0 then gb=0
Outgoing Action: C0 gb
So the first translator takes in the message and sets a variable which dictates whether you have moved the translator up or down. Then it triggers a timer which is what tells MT to move the value up or down, which is recorded as a global variable. The problem with this is you only have ~25 steps if everything is moving at a 5 bit value, and if it stops sending at 127 then there's nothing we can do. Is there an editor or something where you can change the interaction?

wynnanon

2013-01-22 00:46:38

Hey thanx a million.
I will try this and i do understand the limitation.
I am new to MT so i am not sure where and how to paste this code. So i will get back to you once i figure that out and see what happens.
THANX so much


FYI
There is an editor. ftp://ftp.steinberg.de/Download/Hardwar ... _v10a1.pdf
Which came with the cmc-qc but it only gives access to the 8 rotary dials and their CC number, midi channel, min value, max value.
Which if i set min to o, and max to 47 it will once it has gone thru MT with the same setting I posted earlier:
INCOMING MIDI:
B0 00 pp

(NO RULES)

OUTGOING MIDI:
C0 pp

It will choose the sound 1 thru 48 on my VST instrument sequentially without skips but stop at 48.
Why? I don't know. I should stop at 26 right?
thanx

wynnanon

2013-01-22 08:01:09

OK
I figured out how to do the code.
Thanx!
It gave 26 sequential moves up and down as expected but kept changing the start and end point on my VST instrument as time went by. (1 thru 26, then 4 thru 28, 9 thru 34, etc...
Sporadic and unpredictable.

I get 49 sequential moves ( 1 thru 49 ) and it is stable if I set it the way i mentioned in the "FYI" section of my last post.

But either way i get crashes in Ableton live.(maybe due to the fact that FM8 and absynth were not built to handle changing sounds so fast) ??

So I wanted to ask if the code I told you I used to convert CC to PC is the best way to do this:
INCOMING MIDI:
B0 00 pp

(NO RULES)

OUTGOING MIDI:
C0 pp

Or is there a better way?

And also since a Dial may be too fast and taxing on my particular VST's.
I may want to use the BUTTONS on this controller instead ( one Button selecting down the sounds one Button selecting up) (0-127)
Maybe there is already a post on this subject and you could point me in that direction. Or if you know the code for such a procedure you could share that info if you would't mind.

Thanx again for your help
-Wynn

DvlsAdvct

2013-01-23 08:39:58

If you use two buttons it's much easier to code than using a knob in this current situation. What we'd do is mask a standard rotary, though this can be complicated depending on how the FM8 reads the MIDI messages. For example, it would be easier if it reads it as a standard rotary with no end or beginning, as opposed to an absolute knob, but that will require some experimentation.

If the FM8 will only respond to program changes (C0 pp) and that requires an absolute command then we can figure it out.

Code: Select all

Translator 1: Up Button
Incoming Message: 90 00 7F
Rules: None
OUtgoing Signal: B0 00 41

Translator 2: Down Button
Incoming Message: 90 01 7F
Rules: None
Outgoing Signal: B0 00 3F
What this does is replicate moving a standard endless encoder back and forth. Both buttons send the same MIDI CC at different values to pretend it's one knob. If it has to be a program change, however, then I would use the two buttons and simply replace the outgoing signal and add in simple rules to have it go back and forth.

Code: Select all

Translator 1: Up Button
Incoming Message: 90 00 7F
Rules: g0=g0+1
Outgoing Message: C0 g0

Translator 2: Down Button
Incoming message: 90 01 7F
Rules: g0=g0-1
Outgoing Message: C0 g0
My hope is that there doesn't need to be an end to the variable of g0, except maybe a point for 0. If that is the case then simply add a

Code: Select all

if g0<=0 then Exit Rules, Skip Outgoing Action
to the end of the rules in Translator 2. This will allow the FM8 to scroll as high as needed but always stops at the bottom. Let me know if that helps.

wynnanon

2013-01-23 19:36:15

Hi and Thanx again

Yes the second code worked like a charm! (with NI FM8, Absynth, and Kontakt) - the only ones i tried -
Although when reaching each end of the Bank of Sounds (1 or 128) The button will stay on that sound and stop transmitting midi signal in LIVE.
But if the button is pushed one(or more) times past the end(128) or beginning(1) the button will need to pushed the same amount of times to appear back and selecting sounds up or down. (Hope this is clear)
I think this has something to do with "end to the variable" you mentioned last post.

I tried the 3rd code that you posted but this did not change the outcome. It did stop at selection 2 in the bank of sounds when pushing the down button. But the button if pushed one(or more) times past selection 2 as before would need to pushed the same amount of times to appear back and selecting sounds up. Once it comes back it will start at selection 1 then continue on sequentially.

I am trying different code experiments.
Something to do with an absolute beginning and end. But no luck so far.

thanx again for any suggestions.

DvlsAdvct

2013-01-29 18:26:46

Could you add in a

Code: Select all

if g0>=127 then g0=127
in the Up Button translator?

wynnanon

2013-02-03 18:09:08

Hi
Was out with the flu.
So sorry for the late response.

I tried the code you suggested and it worked great on the the up button.
So I assumed the opposite code would work with the down button and it did.
THANX A BILLION
This really saved the day.

(down button)

if g0<=0 then g0=0

DvlsAdvct

2013-02-03 22:59:35

Glad you're feeling better. Let us know if you need any other help :)

Jared