# Incorporating acceleration into huge .btmp

**URL:** <https://forum.bome.com/t/incorporating-acceleration-into-huge-btmp/4756>\
**Category:** Bome Products\
**Tags:** midi-translator, daw\
**Created:** [December 24, 2022, 7:49pm UTC](https://forum.bome.com/t/incorporating-acceleration-into-huge-btmp/4756 "2022-12-24T19:49:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam.pressley](https://forum.bome.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@adam.pressley](https://forum.bome.com/u/adam.pressley)\
**Post date:** [December 24, 2022, 7:49pm UTC](https://forum.bome.com/t/incorporating-acceleration-into-huge-btmp/4756/1 "2022-12-24T19:49:49Z")

</div>

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](https://forum.bome.com/uploads/short-url/jBrJrL1T5YzY4HrqWaha27MiGU9.bmtp) (205.1 KB)

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [December 24, 2022, 9:22pm UTC](https://forum.bome.com/t/incorporating-acceleration-into-huge-btmp/4756/2 "2022-12-24T21:22:02Z")

</div>

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:

```auto
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

```auto
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

```auto
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

```auto
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

```auto
pp=1<<0
g0=g0|pp

```

For shift up

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

```

For Option down

```auto
pp=1<<1
g0=g0|pp

```

For Option up

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

```

etc

[xtm no csi 12.11.22-kbd buttons-sjc.bmtp](https://forum.bome.com/uploads/short-url/9ySRO4sVOzkt6Ku7S05XTkkEeSD.bmtp) (205.2 KB)

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![adam.pressley](https://forum.bome.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@adam.pressley](https://forum.bome.com/u/adam.pressley)\
**Post date:** [December 24, 2022, 10:18pm UTC](https://forum.bome.com/t/incorporating-acceleration-into-huge-btmp/4756/3 "2022-12-24T22:18:37Z")

</div>

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](https://forum.bome.com/uploads/short-url/zXhEzWELHAlIqq8DW4bV4xWafDf.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 😆 …maybe with some very careful find/replace text editing I can make this painless.

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [December 24, 2022, 11:25pm UTC](https://forum.bome.com/t/incorporating-acceleration-into-huge-btmp/4756/4 "2022-12-24T23:25:41Z")

</div>

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](https://forum.bome.com/uploads/short-url/4iGwILMWZgpwZQA6JXsGlHCHtxx.bmtp) (1.5 KB)

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![adam.pressley](https://forum.bome.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@adam.pressley](https://forum.bome.com/u/adam.pressley)\
**Post date:** [December 26, 2022, 5:11pm UTC](https://forum.bome.com/t/incorporating-acceleration-into-huge-btmp/4756/5 "2022-12-26T17:11:41Z")

</div>

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:

```auto
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 🙂

[xtm edit controller 2023.bmtp](https://forum.bome.com/uploads/short-url/aFNGZzEWOdrPAz1lVRWFCvtZGa5.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.

🙏 thanks for your time!

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [December 26, 2022, 7:24pm UTC](https://forum.bome.com/t/incorporating-acceleration-into-huge-btmp/4756/6 "2022-12-26T19:24:48Z")

</div>

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.

```auto
// 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](https://forum.bome.com/uploads/short-url/aDQHebtEigg74BGzVvcviEyhueb.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_

---

<div class="post-metadata">

**Author:** ![adam.pressley](https://forum.bome.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@adam.pressley](https://forum.bome.com/u/adam.pressley)\
**Post date:** [December 29, 2022, 3:01pm UTC](https://forum.bome.com/t/incorporating-acceleration-into-huge-btmp/4756/7 "2022-12-29T15:01:28Z")

</div>

I’m off to the races thank you so much
