Translate Encoder CC to

timo.woellner

2018-07-09 03:06:04

Hello !

Sorry, my english ist not so good ;-P

I want to translate the pp values 1-127 in fix notes when i rotate a rotary encoder clockwise or counter clockwise. I don't can change the working-mode on the midi-device for the Encoders from CC (Value 1-127) to Increase/Decrease (1-2) ! (APC40)

This combination is working, but not a fine solution: 1) Translater Counter-Clockwise; Incoming: MIDI B0 30 pp Rules: if pp<15 then pp=1 if pp>65 then exit rules, skip Outgoing Action Outgoing: Note On on ch. 10 with note:111 (0x6F) and velocity:127 (0x7F), to port Bome MIDI Translator 1 Virtual Out

2) Translater Clockwise; Incoming: MIDI B0 30 pp Rules: if pp>65 then pp=127 if pp<15 then exit rules, skip Outgoing Action Outgoing: Note On on ch. 10 with note:112 (0x70) and velocity:127 (0x7F), to port Bome MIDI Translator 1 Virtual Out

Other Help-Sources: https://www.bomeloft.com/forums/viewtopic.php?t=3755 https://www.youtube.com/watch?v=fIkUyoxDPqU

 

Thank your for any help !

 

Steve-Bome Forum Moderator

2018-07-09 04:04:54

comment

So from what I see, it looks like when you rotate left or right, it takes a change of value of 50 before you are getting any output (note 112 or 111). Are you looking to make it more sensitive? IE maybe a value change of 1 or 2 in either direction?

Second question, what do you want to happen if you get to the end? (1 or 127). Are you looking for a way to recenter without putting out any notes?

timo.woellner

2018-07-09 09:39:57

Hello !

Yes, i want to make more sensitive. When i set the value change to <64 for CCW and >65 for CW it is not better.

At the end i want to get a rotary encoder that gives at left-movement (CCW) everytime the note 111 and at right-movement (CW) everytime the note 112. The Value 1 or 127 is only the “trigger-value” for bmt can translate the output to the note on 111 or 112 when you turn the rotary encoder.

Another Video i found to help to my solution can be;

https://www.bomeloft.com/support/kb/new-tutorial-map-absolute-control-change-to-relative-encoder-with-bome-midi-translator-pro?backlink=L3N1cHBvcnQva2IvcGFnZS8yND93aWRnZXRDYWNoZUlkPWMwYmU5ZjJmNDhmZjkzZGQ5YjhlYTdjMzVhOTE2Y2Nl

Now it’s clear what i want ?

timo.woellner

2018-07-09 12:53:49

Hello !
Now i have the 99,9% solution :D, see here;

Translator 1.0: TrackEncoder1 Movement
Options: swallow
Incoming: MIDI B0 30 pp
Rules: ‘Dec’
// Determine Count
qq=pp-ga
// Down
if qq<0 then gc=127
// Up
if qq>0 then gc=1
// Fix counter to positive
if qq<0 then qq=qq*-1

Outgoing: Timer qq times “TrackEncoder1”: 0 ms (initial delay: 0 ms)

Translator 1.1: TrackEncoder1 Output CCW
Incoming: On timer “TrackEncoder1”
Rules:
if gc==127 then exit rules, execute Outgoing Action
if gc==1 then exit rules, skip Outgoing Action
Outgoing: Note On on ch. 10 with note:111 (0x6F) and velocity:gc

Translator 1.2: TrackEncoder1 Output CW
Incoming: On timer “TrackEncoder1”
Rules:
if gc==1 then exit rules, execute Outgoing Action
if gc==127 then exit rules, skip Outgoing Action
Outgoing: Note On on ch. 10 with note:112 (0x70) and velocity:gc

My comment:
Thanks to Steve-Bome ! This solution is based on his Tutorial “Map absolute control change to relative encoder with Bome MIDI Translator Pro” https://www.bomeloft.com/support/kb/new-tutorial-map-absolute-control-change-to-relative-encoder-with-bome-midi-translator-pro?backlink=L3N1cHBvcnQva2IvcGFnZS8yND93aWRnZXRDYWNoZUlkPWMwYmU5ZjJmNDhmZjkzZGQ5YjhlYTdjMzVhOTE2Y2Nl

I modified the one CC value output to two note on values, velocity is not necessary for me/this.

One i want to know for become a perfect matching, the last 0.01%;
How can i fix it, that when i endless screw over the start (1) or end (127) position, that the count not first begins to run in the other direction, when i screw over the middle position (63/64/65) at the rotary encoder. Rather it should be immediatly to count when changes the direction on the rotary encoder. It’s not poor, but are the last for a perfect solution ? !

 

Thanks !

 

 

timo.woellner

2018-07-09 13:30:19

Sorry ! the last answer is totaly stupid and NO solution ?

I’ve not seen, that my first translator are output the values, not the “new” script…

Please for help !

Steve-Bome Forum Moderator

2018-07-09 16:04:27

Hi, please find the below project file.

I only changed the “Fader 1 Output” from the original file I posted with the tutorial. It is now called “Note Output”.

 

These rules make sure the the counter never goes beyond the end points

 

if ga>127 then ga=127
if ga<0 then ga=0

 

These rules set the note numbers for both note-on and note-off depending on direction. I’m assuming that when you want to send a note-on note 112 you also want to turn note 111 off and visa versa.

// Set note number
if gc==1 then pp=112
if gc==127 then pp=111
if gc==1 then qq=111
if gc==127 then qq=112

Finally the output message is now a MIDI raw message 99 pp xx is note on (or off) message value of the note and velocity (velocity 0 is note off)

99 pp 7f 99 qq 00

Attached is the project file. You will still need to modify it for your incoming controller and CC value.

It also has a separate controller (button) you can press to suspend note messages if you need to center your knob. While pressed and held, no note messages will be sent. You will likely need to match the incoming message to the CC of the button you want to use.

 

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

 


Attachments:

Absolute-to-Note-Movement-2018-07-09.bmtp

timo.woellner

2018-07-09 23:27:10

Thank you very much, Steve !

I have downloaded the bmtp-File and changes to my midi-controller (APC40), here the results;

  1. When you now screw the rotary encoder cw or ccw, the values(notes) changes the direction directly. It’s perfect !
  2. You say that “These rules make sure the the counter never goes beyond the end points
    if ga>127 then ga=127
    if ga<0 then ga=0”
    But it is not an endless encoder. When you at 0 or 127 position at the rotary encoder, the OUT says 127 and 0, but there is also no MIDI Out in the Log Window and so the software become no note on input.

I have try some changes, but i have no luck ;-P

Thanks for the hopefull “last” fixing your script for my request ?

best regards
Timo

Steve-Bome Forum Moderator

2018-07-09 23:32:29

comment

So to me it sounds that you are running out of room when you hit the ends. If this is true simply push the disable button and move the knob in the opposite direction until it is properly centered. Release the button and you should be good to go. If this is not the problem, please elaborate on what you still need fixed.

timo.woellner

2018-07-09 23:58:16

Yes, i want to go out of room, it should be an endless rotary encoder. The knob to centered the encoder is no way to fix it. how can we fix them ?
In first script i have solved this by, it’s an endless rotary encoder, but missing the fine-tuning for change direction;

[x] Translator 1.1: TrackEncoder1 CCW
Options: swallow
Incoming: MIDI B0 30 pp
Rules:
if pp<64 then pp=1
if pp>65 then exit rules, skip Outgoing Action
Outgoing: Note On on ch. 10 with note:111 (0x6F) and velocity:127 (0x7F), to port Bome MIDI Translator 1 Virtual Out

[x] Translator 1.2: TrackEncoder1 CW
Options: swallow
Incoming: MIDI B0 30 pp
Rules:
if pp>65 then pp=127
if pp<64 then exit rules, skip Outgoing Action
Outgoing: Note On on ch. 10 with note:112 (0x70) and velocity:127 (0x7F), to port Bome MIDI Translator 1 Virtual Out

And now ?

timo.woellner

2018-07-10 00:09:23

Hi Steve !

So it works; ?

 

 

[x] Translator 0.1: Fader 1 Movement
Options: swallow
Incoming: MIDI B0 30 pp
Rules: ‘Dec’
// Disable output so you can center encoder
if gb==1 then exit rules, skip Outgoing Action
// Determine Count
qq=pp-ga
// Down
if qq<0 then gc=127
// Up
if qq>0 then gc=1
// Fix counter to positive
if qq<0 then qq=qq*-1
if qq==0 then qq=1
Outgoing: Timer qq times “Fader 1”: 0 ms (initial delay: 0 ms)

timo.woellner

2018-07-10 00:26:53

comment

You must deactivate the Documentation Globals and initialize, because when you turn the direction some of other values first count up before change the real direction !