Converting endless knob to absolute controller

florian

2007-08-24 09:37:19

Hi,

many people are facing the problem that their control surface uses endless knobs (i.e. they don't have a start and end position), but MIDI software expects controllers with absolute values from 0 to 127.

It's easy in Bome's Midi Translator Pro (MT) to convert this (Midi Translator Classic does not have the Rules capability).

How to do it:

1) Set up MIDI
You need to set up MT Pro as a MIDI filter:
- in MT, select the control surface as MIDI IN and a virtual port as MIDI OUT
- in the target software, select the virtual port as MIDI IN and deselect the control surface.

2) Set up Translator Entries in MT
The principle is to take the MIDI message for "endless knob turn right", increase a global variable ga and send a MIDI message with the ga variable as parameter instead of the original one. Also, you need to make sure to not exceed MIDI controller's maximum value of 127:

Code: Select all

NAME: endless knob turn right to absolute MIDI Controller
INCOMING: MIDI <turn knob right>
RULES:
  ga=ga+1
  IF ga>127 THEN ga=127
OUTGOING: B0 10 ga
Use MIDI Capture to fill in the MIDI message for turning right. Of course you should modify the OUTGOING message to match the controller you want to send. Note that this is hexadecimal notation, and controller number is the second number. Press help and the MIDI page will give you a hexadecimal to decimal converter.

The second translator entry needed is straight forward for turning the knob left:

Code: Select all

NAME: endless knob turn left to absolute MIDI Controller
INCOMING: MIDI <turn knob left>
RULES:
  ga=ga-1
  IF ga<0 THEN ga=0
OUTGOING: B0 10 ga
3. Test!
You should always test a translator entry after creation to make sure it works.

4. Create pairs of translator entries for other knobs
You can create as many translator entries as you want. Though make sure that for every knob you use a different global variable. You can use ga...gz and g0...g9.

Hope that helps!
Florian

stevenjames

2007-08-24 13:28:06

i am off to work now but when i get back i will give it a try. Appreciate this and im sure many thousands will too!.

will report back with feedback when ive tested it.

stevenjames

2007-08-25 15:23:20

hey florian,

this works and im managing to use these translations fine for now.

The only problem with this is the endless encoders seem to be velocity varied, as when you turn one right it starts at 127 and depending on how fast you rotate it it may jump to 125 or 124 which with your fix it means i have to turn the encoder really slowly and finely to get it to work properly.

im guessing theres no way around this.

oh and i cant get the damn jog wheel to work as it operates the same way as the endless encoders with velocity. grrrrrr

thanks anyways Florian!!! your a champ.

florian

2007-09-01 23:34:00

Hi Steven,

sorry for the late reply. This can be easily fixed:

for the incoming MIDI message, use a variable for the velocity. Then, change the ga variable accordingly. This is a complete example for the rotary encoder of the AlphaTrack:

Code: Select all

Translator 1: 1st rotary encoder
Options: stop=true
Incoming: MIDI B0 10 pp 
Rules: 
  if pp<=64 then ga=ga+pp
  pp=pp-64
  if pp>0 then ga=ga-pp
  if ga>127 then ga=127
  if ga<0 then ga=0
Outgoing: MIDI B0 01 ga 
As you see, you only need one translator entry for both directions now.
However, since your endless knob seems to have a different logic, you will need to adapt the first three rules accordingly.

Regards,
Florian

djvak

2007-10-25 20:09:00

BCD2000 jog wheels and TORQ

Hi there guys, greetings from Chile.

I've been reading this post, and many other at the native instruments site, trying to figure out how toget the jog wheels work for seek and scratch with the BCD2000 and TORQ.

So far, I've learned that the BCD wheels sends a 65 when they are turned to right (slow) and several 65's when they are turned faster to the right. The same thing but with a 64 value when they are turned to the left. (B0 13 41 & B0 13 40) respectively.

Torq user guide says the following:

"DJ oriented MIDI controllers with turntable platters
will vary in how they handle scratching and nudging.
Certain products will allow you to control only
nudging, while others (such as the M-Audio Xponent)
will allow you to control both nudging and scratching.
Refer to the product’s user guide to learn if each
turntable platter is capable of sending out both MIDI
note and CC information. If so, assign each turntable’s
MIDI note and CC commands to the corresponding
Main Waveform Display in Torq (this is done using
the “MIDI Learn” feature described in the MIDI
Preferences section of this guide).
If your turntable can only send out MIDI CC
information but not MIDI note data (i.e., the turntable
is not touch sensitive), then you will only be able to
control nudging. Assign the turntable’s MIDI CC
output to control the corresponding Main Waveform
Display in Torq"

According to this, it looks like this wheels will only work for nudging, and not for scratching, but making a little research, I've found that the difference between this controller and the TORQ Xponent wheels (natively supported for torq) is that Xponent send the CC signal while a note is pressed. Am I right?

I've also found that the manual of Xponent describes midi mapping for the wheels like this:

Wheel1:
Scratch Wheel--touch NOTE ON/OFF MIDICHANNEL-1 MIDINOTE-22
Scratch Wheel--rotate CC-RELATIVE MIDICHANNEL-1 CC-22

Wheel2:
Scratch Wheel--touch NOTE ON/OFF MIDICHANNEL-2 MIDINOTE-22
Scratch Wheel--rotate CC-RELATIVE MIDICHANNEL-2 CC-22

I'm wondering if there's any way to make this wotk with the BCD2000 & MidiTranslator?
Do I have to use any shift-key combination to switch between seek/scratch? Well, actually I just need to seek the songs for setting the cue points, not really scratching, but doing both things will be cool.

Many thanks in advance, and please sorry for my english.

DjVak.

florian

2007-10-28 21:39:12

Hi DjVak,

if the BCD2000 does not send anything when touching, then I'm not sure a useful way can be found.

Anyway, you can create a mapping with Midi Translator so that every scratching will be preceded by the correct Note On and tailed by a Note Off message. As simplest solution, do this:

Instead of Outgoing MIDI B0 01 ga, use as outgoing
MIDI 90 16 7F B0 16 ga 90 16 00
(note: 16 is hexadecimal for 22)

So then every time you move the wheel, the "touch" note messages are sent, too, as if you're touching and untouching for every little move.

If that doesn't work well, you can use MT Pro's timers to only untouch after, say, half a second of not using the wheel.

Florian

djvak

2007-10-29 13:32:42

Hi Florian,

Thank you very much for your quick answer. I'm gonna try it and tell you about the results.

btw, great job you're doing with your software and even better with your support. thanks again.

Djvak.

theDIY

2008-07-20 15:18:30

I mistakenly created a new topic for this question, and then realized that there was already a thread that was pertinent... deleted my other thread, and popped in here to put my question in the right place :oops: :

So, I've got a couple Faderfox controllers that I want to use with M-Audio Torq, but Torq doesn't support the relative encoders on the Faderfoxes.

Is there a way to translate the encoders (4 of them) info into pitchbend controllers on separate midi channels out of Midi Translator? The relative info that the encoders send is of the "2nd compliment" type, with acceleration that behaves thus: clockwise: 01...> faster > to 06; counter clockwise: 7F > faster > 7A.

I have been using Plogue Bidule to cobble together something to do this translation, but I seem to lose any meaningful acceleration (meaning that when the encoders are translated, my control is too fine. I'm trying to get a single click +/- value of .01% of the range of a control, and something closer to 3% with the greatest acceleration applied +/-.

Any help is greatly appreciated!!

ruediger

2008-07-21 13:21:23

Hi,

I don´t understand your problem exactly, but you can try this.
With the timers and Rules ( Midi Translator Classic does not have the Rules capability ) you can send more than one Midi Messages.

Code: Select all

Translator 1: Direct Midi Out Faderfox Controller 1
Options: stop=false
Incoming: MIDI 93 2C 01 
Outgoing: MIDI E0 01 01 

Translator 2: Faster Midi Out Faderfox Controller 1 Via Timer
Options: stop=false
Incoming: MIDI 93 2C pp 
Rules: 
  if pp<=1 then exit rules, skip Outgoing Action
  if pp>1 then exit rules, execute Outgoing Action
Outgoing: Timer 2 times "send2PitchBends": 1000 ms (initial delay: 1000 ms)

Translator 3: Faster Midi Out Faderfox Controller 1 Via Timer
Options: stop=false
Incoming: On timer "send2PitchBends"
Outgoing: MIDI E0 01 01 
Best regards,
Rüdi

theDIY

2008-07-21 16:11:10

Thanks for the help! Unfortunately, I don't need to send data out from one encoder to multiple midi channels.

To clarify, my controller (Faderfox midi controller designed for DJing) uses 4 endless rotary encoders to control the pitch/speed of playback in Traktor. Traktor is able to understand the relative midi CC data that these encoders send out, and uses them to control the pitch/speed of audio playback at a very high resolution (.01% of slider range per click of the encoder) on slow turns, and very low resolution (2-5% of slider range) on very rapid turns.

The Problem:

Another DJ software which I wish to use, M-Audio Torq, does NOT natively support relative CC encoder data, so fine pitch/speed control is impossible with the Faderfox controllers I own.

So, what I wish to do is convert the relative 7 bit midi data sent out by the Faderfox's encoders into absolute pitchbend signals. As I understand it, there can be only one pitchbend controller per midi channel, so the four encoders on the Faderfox will have to be translated to send pitchbend on 4 different outgoing midi channels into Torq. But, assigning the outgoing data from 4 separate controllers to 4 different midi channels isn't what I expect to have difficulty with.

What I'm not sure about is how to translate the relative 7 bit data (with acceleration) from the encoders. As before, the acceleration of the encoders behaves thus: turning an encoder clockwise very slowly sends a CC value of 01; faster turns send values topping out at 06; rotating an encoder counter clockwise slowly sends 7F; faster turns yield values all the way down to 7A. This data would need to be translated to absolute 14 bit midi pitchbend data. I am unclear on how to do this and retain a usable resolution for slow turns (.01% per click when mapped to a +/-50% pitch/speed fader control in Torq) and still use the accelerated data so that I can make large changes in pitch/speed if needed.

Does that make more sense?

ruediger

2008-07-23 09:48:05

OK, I have worked it out.

Here is the result:

Code: Select all

--------------- Preset Rel Encoder to Pitch

Translator 1: Relative Encoder to Pitch Bend
Options: stop=false
Incoming: MIDI B0 18 pp 
Rules: 
  Label "qq is the scale"
  qq=50
  if pp<=64 then Goto "Calc new pitch value"
  Label "Turn Left"
  qq=0-qq
  pp=pp-64
  Label "Calc new pitch value"
  oo=pp*qq
  gp=gp+oo
  if gp>8191 then gp=8191
  if gp<-8192 then gp=-8192
  Label "Calc 7-bit pitch bend values"
  pp=gp+8192
  rr=pp/128
  ss=rr*128
  ss=pp-ss
Outgoing: MIDI E0 ss rr 
With this preset it should work. The only thing you have to change is the incoming Midi Message (this is the one of my controller) and scale if you want to make it slower or faster.

Regards,
Rüdi

theDIY

2008-07-23 10:57:09

Excellent! That's exactly what I was looking for. The translation to MSB and LSB of pitchbend were doing my poor head in. Thanks so much :D:D:D

theDIY

2008-07-24 07:53:04

After trying out that code (both in Florian's post about accelerated relative encoders, and yours, Rüdi), I made a few tweaks, because the behavior I was getting out of my encoders was a little wonky...I guess the logic used for the acceleration output from my gear is a bit different from yours.

Here's my updated code for "2nd Compliment" type relative CCs to Absolute 7 bit CC (here, CC32):

Code: Select all

Incoming: MIDI BF 20 pp
Options: Stop=true
Rules:
if pp<64 then gd=gd+pp
if pp>64 then pp=pp-128
gd=gd+pp
if gd<0 then gd=0
if gd>127 then gd=127
Outgoing: MIDI BF 20 gd
And here is my updated code for a 2nd Compliment relative CC (CC27) to pitch bend (Ch.1) with admittedly very crude acceleration scaling:

Code: Select all

Options: Stop=false
Incoming: MIDI B0 1B pp
Rules:
if pp<64 then goto "Calc new pitch value"
Label "Turn Left"
pp=pp-128
Label "Calc new pitch value"
Label "Value Scaling"
if pp==1 then pp=1 
if pp==-1 then pp=-1
if pp==2 then pp=2
if pp==-2 then pp=-2
if pp==3 then pp=3
if pp==-3 then pp=-3
if pp==4 then pp=5
if pp==-4 then pp=-5
if pp==5 then pp=8
if pp==-5 then pp=-8
if pp==6 then pp=64
if pp==-6 then pp=-64
Label "End Value Scaling"
gp=gp+pp
if gp>16383 then gp=16383
if gp<0 then gp=0
Label "Calc 7-bit pitch bend values"
rr=gp/128
ss=rr*128
ss=gp-ss
Outgoing: MIDI E0 ss rr
<<edit for a mistake in the first set of code>>

ruediger

2008-07-24 09:43:38

Thanks for the update. Now it works fine?

I don´t understand your first translator. The variable gl is not used anywhere.

Regards,
Rüdi

theDIY

2008-07-25 07:01:37

Doh! I'll edit that (and update my preset files). I guess I was copying and pasting so much that I made a lil' boo-boo. :oops:

Thanks Rüdi!!

jackbeadle

2009-04-29 04:13:15

hi guys,

I own a BCD3000 and use the Torq DJ software. I am very much a noob when it comes to midi programming, though i nearly understand it. I have read other posts and think its possible to convert my jogwheel messages into "knob" messages, so that Torq thinks my Jogwheels are knobs. If this is possible, could someone please explain it to me...in a way that someone who doesnt know MT would understand!!


Sorry for being the n00b

Thanks

ruediger

2009-05-07 14:28:45

Hi,

1. create a new translator
2. go to incoming and start capture MIDI
3. now toggle your jogwheel and use the midi message as your incoming trigger. If the messages differs and you want to simulate only one knob, replace the 2 numbers which differs with a local variable pp.
4. go to outgoing and enter the midi message you want to send to Torq

Hope that helps
Rüdi

Sepehr

2010-02-15 19:07:18

Hi, I was looking for a solution to use BCD3000 jogwheels to control Torq and tried every thing in this thread, But didn't worked for me!

So i know that, When we spin the jogwheel slowly to right it send B0 13 41, B0 13 41, B0 13 41 and when spin it faster will send B0 13 42, B0 13 42, B0 13 42 and faster B0 13 43 and so on...
When spin in to left B0 13 3F, Spin faster B0 13 3E, and faster B0 13 3D and so on...
Also i know that if we can translate jogwheel messages to something like this: (But jogwheel must send a stable pattern when speed is changing)
B0 00 01
B0 00 02
B0 00 03
B0 00 04
We can control Torq, But the problem is that i don't know how to crate this translator in Midi Translator Pro!

ruediger

2010-02-16 10:59:29

Hi,

that should work. I have created a translator for you.

Code: Select all

[x] Translator 1: New Translator
Incoming: MIDI B0 13 pp
Rules:
  if pp<41 then exit rules, skip Outgoing Action
  pp=pp-40
Outgoing: MIDI B0 00 pp
This translator reacts on your jogwheel when you turn to right.

Hope that helps.
Rüdi

Sepehr

2010-02-16 12:17:27

ruediger wrote:Hi,

that should work. I have created a translator for you.

Code: Select all

[x] Translator 1: New Translator
Incoming: MIDI B0 13 pp
Rules:
  if pp<41 then exit rules, skip Outgoing Action
  pp=pp-40
Outgoing: MIDI B0 00 pp
This translator reacts on your jogwheel when you turn to right.

Hope that helps.
Rüdi
Thank you, But it didn't work! I need a translator that convert 40 and major than 40 (that repeats when i turn the jogwheel with a fixed speed, And change to a major number and repeat, when turning faster) to a increasing number (just like a standard fader or knob)
It means when i turn the jogwheel to the right with a fixed speed it send B0 13 41, B0 13 41, B0 13 41, ... and when i increase the speed, it changes to B0 13 42, B0 13 42, B0 13 42, ... and more speed will change the number to 43,44,45 and...
But what i need is a jogwheel that send something like this when i turn it to right: B0 13 01, B0 13 02, B0 13 03, B0 13 04...
and something like this when turning to left: B0 13 7F, B0 13 7E, B0 13 7D, B0 13 7C

ruediger

2010-02-16 14:02:38

Hi,
then you need a global variable to keep the state.

Code: Select all

[x] Translator 3: New Translator
Incoming: MIDI B0 13 pp
Rules:
  if pp<41 then Goto "Label decrease"
  ga=ga+1
  if ga>127 then ga=127
  exit rules, execute Outgoing Action
  Label "decrease"
  ga=ga-1
  if ga<0 then ga=0
Outgoing: MIDI b0 00 ga
Hope that helps!
Rüdi

Sepehr

2010-02-16 19:43:06

ruediger wrote:Hi,
then you need a global variable to keep the state.

Code: Select all

[x] Translator 3: New Translator
Incoming: MIDI B0 13 pp
Rules:
  if pp<41 then Goto "Label decrease"
  ga=ga+1
  if ga>127 then ga=127
  exit rules, execute Outgoing Action
  Label "decrease"
  ga=ga-1
  if ga<0 then ga=0
Outgoing: MIDI b0 00 ga
Hope that helps!
Rüdi
Thank you for your helps, unfortunately this translator didn't work because when "ga" is 127 transportation will be stop at that point, and the rule "if pp<41 then Goto "Label decrease"" is not usable to decrease the value, but i used your helps and created something speed sensitive, that will work if we can substitute "ga" with a unlimited variable that can increase more than 127 (I don't know its possible or not!)

Code: Select all

Translator 0.0: Left jogwheel to Right 1x
Options: stop=false
Incoming: MIDI B0 13 41 
Rules: 
  ga=ga+1
Outgoing: MIDI B0 13 ga 

Translator 0.1: Left jogwheel to Right 2x
Options: stop=false
Incoming: MIDI B0 13 42 
Rules: 
  ga=ga+2
Outgoing: MIDI B0 13 ga 

Translator 0.2: Left jogwheel to Right 3x
Options: stop=false
Incoming: MIDI B0 13 43 
Rules: 
  ga=ga+4
Outgoing: MIDI B0 13 ga 

Translator 0.3: Left jogwheel to Right 4x
Options: stop=false
Incoming: MIDI B0 13 44 
Rules: 
  ga=ga+8
Outgoing: MIDI B0 13 ga 

Translator 0.4: Left jogwheel to Right 5x
Options: stop=false
Incoming: MIDI B0 13 45 
Rules: 
  ga=ga+16
Outgoing: MIDI B0 13 ga 

Translator 0.5: Left jogwheel to Right 6x
Options: stop=false
Incoming: MIDI B0 13 46 
Rules: 
  ga=ga+32
Outgoing: MIDI B0 13 ga 

Translator 0.6: Left jogwheel to Left 1x
Options: stop=false
Incoming: MIDI B0 13 3F 
Rules: 
  ga=ga-1
Outgoing: MIDI B0 13 ga 

Translator 0.7: Left jogwheel to Left 2x
Options: stop=false
Incoming: MIDI B0 13 3E 
Rules: 
  ga=ga-2
Outgoing: MIDI B0 13 ga 

Translator 0.8: Left jogwheel to Left 3x
Options: stop=false
Incoming: MIDI B0 13 3D 
Rules: 
  ga=ga-4
Outgoing: MIDI B0 13 ga 

Translator 0.9: Left jogwheel to Left 4x
Options: stop=false
Incoming: MIDI B0 13 3C 
Rules: 
  ga=ga-8
Outgoing: MIDI B0 13 ga 

Translator 0.10: Left jogwheel to Left 5x
Options: stop=false
Incoming: MIDI B0 13 3B 
Rules: 
  ga=ga-16
Outgoing: MIDI B0 13 ga 

Translator 0.11: Left jogwheel to Left 6x
Options: stop=false
Incoming: MIDI B0 13 3A 
Rules: 
  ga=ga-32
Outgoing: MIDI B0 13 ga 
 

ruediger

2010-02-16 20:44:17

Hi,

sorry, I didn't try the code. But your solution seems to work :)

The global variables can be more than 127, but I think MIDI doesn't support more than 0x7f (127). Just try it out...

Best,
Rüdiger

Sepehr

2010-02-16 21:21:28

ruediger wrote:Hi,

sorry, I didn't try the code. But your solution seems to work :)

The global variables can be more than 127, but I think MIDI doesn't support more than 0x7f (127). Just try it out...

Best,
Rüdiger
No, I mean after that global variable set to 127 the increasing pattern will change to zero.
This is what MIDI Translator sends from the time that global variable is 120:

Code: Select all

B0    13    7A
B0    13    7B
B0    13    7C
B0    13    7D
B0    13    7E
B0    13    7F
B0    13    00
80    00    00
B0    13    00
81    00    00
B0    13    00
82    00    00
B0    13    00
81    00    00

Sepehr

2010-02-17 01:26:57

ok, I found that i was looking for something Irrelevant, what we need is a Data Increment/Decrement controller Message, it must be a relative output...

ariajazz

2014-10-12 17:32:00

How can we do the opposite thing conert absolute into relative?

DvlsAdvct

2014-10-12 20:41:22

Hi ariajazz. I just responded to your original post.