Detect whether values are increasing / decreasing?

I’m trying to have MT recognize if an incoming CC is increasing or decreasing.
The outgoing action would target a different CC# based on whether the incoming values are increasing or decreasing.
Can’t seem to figure out how to achieve this.
Thanks,
Max

Hi,

You would need to track the last known value in a global variable and compare with the incoming value. Here is an example

Incoming: CC 0 on MIDI CH1 any value set to qq

Rules:
// local variables are always unknown value until defined so lets set a default value
pp=0
// increasing
if qq>ga then pp=1
// decreasing
if qq< ga then pp=-1
// set outgoing cc
// default cc <0 decreasing value
tt=23
// increasing value
if pp>0 then tt=-24
// set for next iteration
ga=qq
// if first iteration, skip output
if pp==0 then exit rules, skip outgoing action
Outgoing: CC tt on MIDI CH 1 value 127

Steve Caldwell
Bome Customer Care


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