Incorporating acceleration into huge .btmp

Good evening and merry christmas eve !

Midi controller: X-Touch Mini (XTM)
DAW: Reaper
OS: MacOS Ventura

I use my XTM to edit in Reaper, running actions to move items, grow their edges, change their pitch, etc., using shift, cmd, ctrl, and option modifiers in conjunction with the XTM’s 8 encoders.

After a lot of programming I now realize that I’d love to be able to use the acceleration feature of my XTM encoders, but I’ve programmed it not to. Is there anything I can do to take what I have and incorporate the acceleration?

I am capable of editing my .bmtp code with SublimeText, if it helps…

Bonus: Also curious if there are any actions I can take to streamline my bmtp; it’s certainly possible that it’s more bloated than it needs to be.

Thank you!

xtm no csi 12.11.22-kbd buttons.bmtp (205.1 KB)

Hi and welcome to the Bome community!

It looks pretty well organized. Good job!

By acceleration I assume you mean encoders only. Right now the translators send only notes with velocity of 127? Do you want other values depending on the current input velocity? Would different velocities for the notes be what you want?

In the below example I modified translation 1.30 with rules as follows. Velocities will range with a mid point on 64 (0x40). Right turn will give 0x40 0x42 0x43 etc and left turn 0x3f 0x3e 0x3c etc.

The rules are fairly simple:

if pp>0x40 then qq=0x80-pp
if pp<0x40 then qq=pp+0x40
Log "Log qq=%qq%"

As far as streamlining, there may be opportunity but I don’t see anything off hand since you have so many combinations of modifiers for each. You could probably reduce the number of translators by adding rules so that a single translator can handle various modifier combinations. This might reduce readability, however but if you make changes, there would be less translators to change.

You could also bit map the modifiers into a single global variable and use the lowest bits of the variables to determine which modifiers are in use. For instance if bit 0 is shift, bit 1 is option, bit 2 is command and bit 3 is alt. Lets put into g0

if g0==0 then goto "none"
if g0==1 then goto "shift"
if g0==2 then goto "option"
if g0==3 then goto "shift+option"
if g0==4 then goto "command"
if g0==5 then goto "shift+command'
// and so forth

And then use labels to handle the outgoing note number

Label "none"
// set outgoing note in tt
tt=24
goto done
Label "shift"
tt=25
goto "done"
// and so forth
Label "done"
if pp>0x40 then qq=0x80-pp
if pp<0x40 then qq=pp+0x40
Log "Log qq=%qq%"

Then on output, send the desired note (tt) at the current velocity (qq)

Or instead of labels, since it is a simple one rule assignment you could

if g0 == 0 then tt=24
if g0 ==1 then tt=25
// and so forth

Then use tt for your outgoing note

For bit mapping you would do something like this for shift

For shift down

pp=1<<0
g0=g0|pp

For shift up

For shift up
pp=1<<0
// Ones compliment
pp=pp^-1
g0=g0&pp

For Option down

pp=1<<1
g0=g0|pp

For Option up

pp=1<<1
pp=pp^-1
g0=g0&pp

etc

xtm no csi 12.11.22-kbd buttons-sjc.bmtp (205.2 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thanks for all of this!!

The velocity change won’t accomplish what I’m trying to do; I need the accelerated turns to run the Outgoing MIDI Message multiple times (there are 7 “speeds”: 01 (slow turn) - 07 (fast) for right turns and 41 - 47 for left. So, I’d like to run the outgoing message up to 7 times, depending on the variable.

The reason I need to run the MIDI message multiple times is because the MIDI message is telling Reaper to run actions. For instance:
B0 15 41 - move edit cursor left
B0 15 42 - move edit cursor left 2x
B0 15 43 - move edit cursor left 3x
…etc. up to 7x

I was able to accomplish this with timers on Preset [2] here, and it’s doing exactly what I want it to:
xtm no csi 12.11.22-kbd buttons with timers.bmtp (209.3 KB)

The only thing I might prefer would be to have the flexibility to easily adjust the speed curve.

I can see how your explanation for streamlining my .btmp could make the incorporation of 7 timers per encoder rule easier :laughing: …maybe with some very careful find/replace text editing I can make this painless.

OK, the attached example should be something like you want.

I use the global variable ga as the outgoing note number, 24 for negative and 25 for positive.

You can set the repeat speed with local variable uu
You can adjust the acceleration by applying a multiplier to tt

Accelerator-Timer-Demo.bmtp (1.5 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

This has really sent me off in the right direction, than you so much! I’ve decided to scrap my old btmp and start fresh.

I’ve tried to combine your advice for modifiers and acceleration, but I’ve hit another wall:

I’ve modified a portion of your programming:

if qq>64 then ga=24-tt
if qq<64 then ga=25+tt
if qq>64 then qq=qq-64

so that the modifiers cooperate with the timer. (Is this what you would do?)
This results in encoder 1 occupying CH1 CC9 - CC40 (with all different modifier combinations for both encoder directions).
I’d like to be economical with my XTouch Mini and have encoder 2 occupy CC41 - CC72, encoder 3 = CC73 - CC104, etc.

That way, my XTouch Mini will only occupy 2 or 3 midi channels, and I can still use other midi devices if I’d like. Does this all make sense?

I understand some of the math operations that you incorporated in your programming to get me where I’m at, but I’d greatly appreciate a little more help to reach this next step :slight_smile:

xtm edit controller 2023.bmtp (321.2 KB)

Here, I have 2.1 and 2.2 functioning as I’d like for my first encoder, but I’m lost as to how to get my 2nd encoder to do the same.

:pray: thanks for your time!

Hi, something like this should work.

  1. First we look at the incoming encoder CC and set it to a local variable (pp) . So the single translator can handle all encoders in scope.
  2. Then we set a base outgoing note value based on the encoder incoming CC
  3. Now we calculate the outgoing note based on the new base that you set.
// Only process CC's withing scope
if pp<16 then exit rules, skip outgoing action
if pp>23 then exit rules, skip outgoing action


// set base outgoing note
if pp==16 then rr=24
if pp==17 then rr=50
if pp==18 then rr=88
//... and so on
--- further down
if qq>64 then ga=rr-tt
if qq<64 then ga=rr+tt
// Adjust base for right turn
if qq<64 then ga=ga+1
if qq>64 then qq=qq-64


xtm edit controller 2023–sjc.bmtp (322.2 KB)

Edit: I also added a global variable (zz) to enable the log messages to only show when zz=1. If you don’t like the logging messages just turn zz=0 in the Init rules.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

I’m off to the races thank you so much