making a 7bit knob send out smoothed 14 bit messages

twintip

2008-09-13 15:54:27

I want to use a midi knob to control the tempo in ableton, but I want bomes to convert the signal into smoothed 14 bit message, how can I do this?

florian

2008-10-21 11:10:29

I think you have solved this already, right? just making sure... if not, we'd like to help!

Florian

twintip

2008-10-21 23:09:42

no! I couldn't do it, my skillz are limited.

I would love it if you could help!

florian

2008-10-22 10:04:38

What kind of knob is it? a knob which outputs 0..127 (i.e. 00..7F in hex) as data, or an endless encoder? If the latter, what does it output? (use Capture MIDI in Edit Translator window).

Thanks,
Florian

twintip

2008-10-22 19:21:19

florian wrote:What kind of knob is it? a knob which outputs 0..127 (i.e. 00..7F in hex) as data, or an endless encoder? If the latter, what does it output? (use Capture MIDI in Edit Translator window).

Thanks,
Florian
it's one that does 0 - 127.

when I turn the knob say from 24 to 25, I want MT to send out all the in between values in 14 bits (over 0.05 second or something).

It is for controlling tempo in live. Using a 7 bit knob can make clips sound jerky. I want it to be nice and smooth

florian

2008-10-23 01:43:20

Hi Twintip,

that'll work with MT Pro. It's fun!

I'll write it down without testing (no time now!), bear with me if it doesn't work at once...
Translator 1: Controller Input (set target value gt)
Incoming: MIDI B0 01 pp
Rules:
gt = pp * 128
if pp=127 THEN gt = 16383
Outgoing: start timer SMOOTH: 0ms initial, 10ms repeat delay, indefinitely

Translator 2: calculate and send out smoothed value. gc=current value
Incoming: Timer SMOOTH
Rules:
if gc < gt THEN GOTO "increase"
Label "decrease"
gc = gc - 3
if gc < gt THEN gc = gt
GOTO "cont"
Label "increase"
gc = gc + 3
if gc > gt THEN gc = gt
Label "cont"
pp = gc & 127
qq = gc / 128
Outgoing: MIDI E0 pp qq

Translator 3: stop timer if necessary
Incoming: Timer SMOOTH
Rules:
if gc != gt THEN "exit rules, skip Outgoing Action"
Outgoing: Stop timer SMOOTH
Some explanations:
- gt is a variable that has the "want to be" 14-bit value.
- it's difficult to come up with a "smooth" transition from 7-bit range to 14-bit (i.e. calculating the target value). In this case, I just set it to the max 14-bit value (16383) if you use the max 7-bit value (127).
- then a timer is started. The repetitive delay (10ms) determines how fast the target value will be reached: the smaller ms, the faster.
- translator 2 will slowly adapt the "current value" (gc) to become, eventually, gt. In the example I go in steps of 3. You may need to adapt this. Larger values: faster.
- then, translator 2 will calculate the high byte in qq and the low byte in pp.
- as outgoing action, I send out a pitch bend message -- just as example. You can also output two controller messages as outgoing action, with pp and qq as values.
- translator 3 examines target value and current value. If they match, the timer is stopped -- mission accomplished! (until the next controller message comes in...)

Hope that works!
Florian

twintip

2008-10-23 09:44:00

:D

worked straight off!
thanks florian, will be testing this this weekend!