Rules question

Is it possible to have in the rules a way to produce a number at random? I want to use this for the leds on my controller. i feel that if I could set a rule to choose any number that could unlock a different aspect for me. Please let me know. Thanks!

Hi Preston,

MT Pro does not have a “random” function, so your choices would be either to:

  1. Have an external source generate the random value and send it as a MIDI message to MT Pro for processing (as a global variable).
  2. If on a Mac, use AppleScript to set a global variable to a random value (if ApplcsScript has such a function).
  3. Use a series of incoming events along with rules, manipulate a global variable to simulate generation of a random value (although depending on the math you use, it might not be entirely random).

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

P.S. I found the below link fairly quickly when searching the forum on \"random\". Florian demonstrates how to do this with a timer (which didn\'t come to mind to me at first).

https://www.bome.com/forums/viewtopic.php?t=2494

 

Thanks will check this out!

In the following example (from the posted link) is there a way to modify translator 3 so that it pushes a button a random number of times, rather than play a random note? Thanks.

Translator 1: Start random number timer
Options: stop=false
Incoming: Project Opened
Outgoing: Periodic timer “Update Random Number”: 5 ms (initial delay: 100 ms)

Translator 2: Make new Random number gr
Options: stop=false
Incoming: On timer “Update Random Number”
Rules:
gr=gr+17
if gr>=50 then gr=gr-50
Outgoing: Periodic timer “Update Random Number”: 5 ms (initial delay: 100 ms)

Translator 3: On Note On, play random note
Options: stop=false
Incoming: MIDI 90 pp qq
Rules:
if qq==0 then exit rules, skip Outgoing Action
pp=ga
if pp!=0 then exit rules, execute Outgoing Action
pp=gr+30
ga=pp
Outgoing: MIDI 90 pp qq

Translator 4: On Note Off 1, stop the previously started note
Options: stop=false
Incoming: MIDI 90 pp 00
Rules:
if ga==0 then exit rules, skip Outgoing Action
pp=ga
ga=0
Outgoing: MIDI 90 pp 00

Translator 5: On Note Off 2, stop the previously started note
Options: stop=false
Incoming: MIDI 80 pp qq
Rules:
if ga==0 then exit rules, skip Outgoing Action
pp=ga
ga=0
Outgoing: MIDI 80 pp qq