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.


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

// local variables are always unknown value until defined so lets set a default value
// increasing
if qq>ga then pp=1
// decreasing
if qq< ga then pp=-1
// set outgoing cc
// default cc <0 decreasing value
// increasing value
if pp>0 then tt=-24
// set for next iteration
// 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:
1 Like