Latch & If Statements Part II

madjazz

2019-10-03 19:32:38

Hi Steve,

The solution is causing some issues.  The code currently is as follows:

if pp==112 then rr=57 qq=0 ga=ga^1 if ga==1 then qq=127

 

The issue is that sometimes when the Touchable button is pressed the first time, and lights up, the device turns off.   And sometimes, the device turns on. I've tried a number of different tests like reversing the on/off in Ableton, or mapping with the device and/or button on/off, but I can't nail it down and make it consistent.  Is there a way to make it consistent -- the first press always turns the device on, and the second press always turns the device off?

 

Thanks!

Steve-Bome Forum Moderator

2019-10-03 22:46:25

comment

Hi, I’m trying to understand where the value of pp is coming from. Is this the incoming value that you want to trigger on of a given CC or is it the CC #. I’m only seeing a partial picture here.

Also, is rr the outgoing value you want?

If you want to toggle between two other values that 0 and 127 then you have to replace with those values for output. Please show me the whole translation and describe what you are trying to do?

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

madjazz

2019-10-03 23:43:07

As I look further into this, the more I’m learning about the problem.  Let’s start from the beginning to see if we can nail down a solution.

What I am trying to accomplish is have a Touchable latch-style push button turn an Ableton Live device on and off (let’s say an EQ device): press the button the first time — it turns the EQ device on; press the button a second time — it turns the EQ device off.

If I turn all MTP Translators off, and simply allow Touchable to pass through MTP, it works as expected.  Touchable sends out the messages shown below, MTP passes them all through (because all translators are off), and the EQ device turns on and off as desired.

1: MIDI IN [touchAble]: 90 26 7F
2: MIDI OUT [Bome MIDI Translator 2 Virtual Out]: 90 26 7F
3: MIDI IN [touchAble]: 90 26 00
4: MIDI OUT [Bome MIDI Translator 2 Virtual Out]: 90 26 00

Here is the problem: if I turn on the single translator that I am using called “Note to CC”, my EQ button stops working correctly because we are swallowing the midi messages and I have no script to pass through the midi coming from the EQ button.   For the record, the Note to CC script does correctly work for all of Live’s Macro’s/rotary dials (i.e., press a Touchable button, it sends out a note, the note gets converted to a CC# and CC value, and the rotary dial mapped to that CC# changes to the CC Value specified in the script).  However, the EQ device on/off button no longer works because we are swallowing the midi.

So I guess the question really is: how can I get the MTP to pass through the midi coming from the EQ device on/off button so that it works correctly while keeping my “Note to CC” script active?

Attached is the .bmtp file with all the details (take v3 and ignore v2).

Many thanks for your input and help Steve!

 


Attachments:

RML Bome Script v2.bmtp
RML Bome Script v2.bmtp
RML Bome Script v3.bmtp

Steve-Bome Forum Moderator

2019-10-04 02:51:23

OK, now I get it.

So you want note 38 (hex 26) to pass through untouched. Just at the following rule to the beginning of your existing rules on the translator Note to CC:

 

if pp==38 then exit rules, skip outgoing action.

Then the default path for the note will occur instead of the action of Note to CC.

 

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

madjazz

2019-10-04 04:14:21

That did the trick.  Thanks!

Steve-Bome Forum Moderator

2019-10-04 04:32:40

comment

Great. Any other notes that you don’t want to convert to CC, just add additional lines there for those note numbers. I put these at the beginning because no reason to carry out all the other rules if we aren’t going to do anything with those notes anyway.
If there is a note range you want to pass through you could do something like this

if pp< 20 then exit rules, skip outgoing action if pp> 60 then exit rules, skip outgoing action

In this example, only notes 20-60 will pass to the rest of the rules and be processed. Of course this only works if the notes are within a consecutive range.

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

madjazz

2019-10-04 04:34:11

Very helpful.  Thanks Steve.