Newbie looking at Rules....

PaulF707

2012-08-27 08:46:17

Hi all

Sorry for a very long winded first post... :)

I've been experimenting with the 'classic' version, and just downloaded a trial of the pro version to try out 'rules'...

My requirements are quite complex. I want to use incoming midi messages (in my case prog change from a foot pedal) as a kind of 'tap sequencer'. Each tap of the same pedal will carry out a different output (based on a pre-programmed list of actions - probably 4 or 5 maximum).

I managed to start doing this using 'classic' by changing preset after each output (so that the next pedal press carries out a new action).

Looking at the manual, I thought the rules, variables and global variables in the Pro version could make this easier. However, I'm seeing a few limitations and I just wanted to confirm I haven't missed anything...

My idea was to use a global variable as a 'step value'. I'd set this to 1 on startup, then increment this on each step. I could then use if/then statements to check the step value and output a different action.

I was expecting to be able to set a variable for the full midi output within the rule, and then apply this in the output section. But it seems that each variable can only hold one byte of data (not a string of midi data) - is that correct?
My problem is for each key press I am outputting up to 40 midi CC commands. Only one bit in each one is changing (the value), so in theoy I could create an output string with all the CC commands, and variables for each value. BUT there aren't enough variables availabel to use!
Are we limited to the list of variables displayed in the drop down list?
Is there any way to define your own (i.e. more) variables?

Maybe using preset changes is the best way to achieve this??

I'd be grateful for any thoughts / ideas / suggestions on this.

Thanks in advance

Paul

DvlsAdvct

2012-08-28 02:44:53

Hi PaulF707

What you want to do is totally possible. There are a bunch of different ways you can do it as well, but I'll show you my preferred way. Now, my preference would be to have a different translator for each of the 40 MIDI commands and have the outputs tied to individual global variables. Since there are only at most 5 different variable states we'll tie those to one variable state. What this will do is allow us to count up the necessary different states and then reset back to the initial value.

Now, we're going to use a timer for every time the incoming message triggers. What this allows us to do is organize the our preset so the global variable is not being calculated in the same translator as the signal, and it allows us to make sure our math is correct with a slight delay. So this will look like

Code: Select all

Translator 1: Foot Switch
Incoming Message: C0 pp
Rules: ga=ga+1
if ga>=5 then ga=0
Outgoing Message: Timer - MIDI Signal 1ms delay

Translator 2: MIDI Message 1
Incoming Message: MIDI Signal Timer
Rules: 
if ga==0 then pp=7
if ga==1 then pp=10
if ga==2 then pp=15
if ga==3 then pp=20
if ga==4 then pp=60
Outgoing Message: 90 00 pp 
And what you can do with this is exclude individual commands. As an example, say you don't want the 37th MIDI message to trigger when ga=3. You can have a line that says "When ga==3 then exit rules, skip outgoing action"

And it's all organized. You'll have 41 translators, but this allows you to change and fine tune your process later a LOT easier. And it's really just copying, pasting and changing amounts. Make sense?

PaulF707

2012-08-28 08:41:32

Thanks!
If I'm understanding you correctly, we can use timer jobs as 'sub-routines' or 'stored procedures' that can be called from a preset (activated when a signal received).
Presumbaly I could call multiple timer jobs from one input? (I remember reading something about using timer jobs on 0ms delay to create 'parallel processing' in one of the online manuals?)
This seems much more logical.....

In may application, I'm looking to control a number of DMX lights (I have a midi to dmx converter).
So I could create timer jobs for each light (and each colour), and then based on the global step variable, call different jobs. i.e.

Receive midi trigger
If stepvariable = 1 call
front lights red
back lights blue
etc
If stepvariable = 2 call
front lights yellow
back lights green
etc
etc
Incremement step variable

This seems much more logical (I do a bit of programming, so this makes much more sense to structure it in this way).

I'll have a play with these ideas over the next few days, and let you know if I have any problems.

Thanks again.

Paul

DvlsAdvct

2012-08-28 14:55:09

Not a problem at all Paul.

Let me know if you have more questions. :)
Jared

PaulF707

2012-08-31 21:40:40

So I've been working on this tonight, and here is where I've got to:

Code: Select all

[Project]
Version=2
Author=
AuthorContact=
Comments=
DefaultInPorts=MIDA0000
DefaultOutPorts=MIDA0000

[Preset.0]
Name=Startup
Active=1
PresetSwitchIgnore=0
Name0=Startup
Incoming0=EnDi02
Outgoing0=Pres040004Warm
Options0=Actv01Stop00OutO00StMa00000001gs=1
Name1=Startup
Incoming1=EnDi02
Outgoing1=Pres060007Startup
Options1=Actv01Stop00OutO00StMa00000001gs=1

[Preset.1]
Name=Warm
Active=0
PresetSwitchIgnore=0
Name0=Prog0
Incoming0=MID1CF00
Outgoing0=MID1BF0B00BF0C00BF0D00BF1500BF1600BF1700BF1F7FBF207FBF2100BF2900BF2A00BF2B00BF3300BF3400BF3500BF3D00BF3E00BF3F00BF4700BF4800BF4900BF5100BF5200BF5300BF6F00BF7000BF7100BF7900BF7A00BF7B00BF0400BF0500BF0600BF5A00BF5B00BF5C00BF5D00
Options0=Actv01Stop00OutO00
Name1=Prog1
Incoming1=MID1CF01
Outgoing1=Tim0TimS0008Trigger11:0:1000
Options1=Actv01Stop00OutO00StMa00000002gs=gs+1if(gs==5)gs=1-0
Name2=Light1 (Off)
Incoming2=Tim0TimT0008Trigger1
Outgoing2=MID1BF0BrrBF0CssBF0Dtt
Options2=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name3=Light2 (Off)
Incoming3=Tim0TimT0008Trigger1
Outgoing3=MID1BF15rrBF16ssBF17tt
Options3=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name4=Light3 (HiLight)
Incoming4=Tim0TimT0008Trigger1
Outgoing4=MID1BF1FrrBF20ssBF21tt
Options4=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=64if(gs==1)tt=64if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=96if(gs==3)rr=127if(gs==3)ss=64if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=64
Name5=Light4 (Off)
Incoming5=Tim0TimT0008Trigger1
Outgoing5=MID1BF29rrBF2AssBF2Btt
Options5=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name6=Light5 (Off)
Incoming6=Tim0TimT0008Trigger1
Outgoing6=MID1BF33rrBF34ssBF35tt
Options6=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name7=Light6 (Off)
Incoming7=Tim0TimT0008Trigger1
Outgoing7=MID1BF3DrrBF3EssBF3Ftt
Options7=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name8=Light7 (Off)
Incoming8=Tim0TimT0008Trigger1
Outgoing8=MID1BF47rrBF48ssBF49tt
Options8=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name9=Light8 (Off)
Incoming9=Tim0TimT0008Trigger1
Outgoing9=MID1BF51rrBF52ssBF53tt
Options9=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name10=Prog2
Incoming10=MID1CF02
Outgoing10=Tim0TimS0008Trigger21:0:1000
Options10=Actv01Stop00OutO00StMa00000002gs=gs+1if(gs==5)gs=1-0
Name11=Light1 (Off)
Incoming11=Tim0TimT0008Trigger2
Outgoing11=MID1BF0BrrBF0CssBF0Dtt
Options11=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name12=Light2 (HiLight)
Incoming12=Tim0TimT0008Trigger2
Outgoing12=MID1BF15rrBF16ssBF17tt
Options12=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=64if(gs==1)tt=64if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=96if(gs==3)rr=127if(gs==3)ss=64if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=64
Name13=Light3 (Off)
Incoming13=Tim0TimT0008Trigger2
Outgoing13=MID1BF1FrrBF20ssBF21tt
Options13=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name14=Light4 (Off)
Incoming14=Tim0TimT0008Trigger2
Outgoing14=MID1BF29rrBF2AssBF2Btt
Options14=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name15=Light5 (Off)
Incoming15=Tim0TimT0008Trigger2
Outgoing15=MID1BF33rrBF34ssBF35tt
Options15=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name16=Light6 (Off)
Incoming16=Tim0TimT0008Trigger2
Outgoing16=MID1BF3DrrBF3EssBF3Ftt
Options16=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name17=Light7 (Off)
Incoming17=Tim0TimT0008Trigger2
Outgoing17=MID1BF47rrBF48ssBF49tt
Options17=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name18=Light8 (Off)
Incoming18=Tim0TimT0008Trigger2
Outgoing18=MID1BF51rrBF52ssBF53tt
Options18=Actv01Stop00OutO00StMa00000003rr=0ss=0tt=0
Name19=Prog3
Incoming19=MID1CF03
Outgoing19=Tim0TimS0008Trigger31:0:1000
Options19=Actv01Stop00OutO00StMa00000002gs=gs+1if(gs==5)gs=1-0
Name20=Light1
Incoming20=Tim0TimT0008Trigger3
Outgoing20=MID1BF0BrrBF0CssBF0Dtt
Options20=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=0if(gs==1)tt=0if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=64if(gs==3)rr=127if(gs==3)ss=0if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=0
Name21=Light2
Incoming21=Tim0TimT0008Trigger3
Outgoing21=MID1BF15rrBF16ssBF17tt
Options21=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=0if(gs==1)tt=0if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=64if(gs==3)rr=127if(gs==3)ss=0if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=0
Name22=Light3
Incoming22=Tim0TimT0008Trigger3
Outgoing22=MID1BF1FrrBF20ssBF21tt
Options22=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=0if(gs==1)tt=0if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=64if(gs==3)rr=127if(gs==3)ss=0if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=0
Name23=Light4
Incoming23=Tim0TimT0008Trigger3
Outgoing23=MID1BF29rrBF2AssBF2Btt
Options23=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=0if(gs==1)tt=0if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=64if(gs==3)rr=127if(gs==3)ss=0if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=0
Name24=Light5
Incoming24=Tim0TimT0008Trigger3
Outgoing24=MID1BF33rrBF34ssBF35tt
Options24=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=0if(gs==1)tt=0if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=64if(gs==3)rr=127if(gs==3)ss=0if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=0
Name25=Light6
Incoming25=Tim0TimT0008Trigger3
Outgoing25=MID1BF3DrrBF3EssBF3Ftt
Options25=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=0if(gs==1)tt=0if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=64if(gs==3)rr=127if(gs==3)ss=0if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=0
Name26=Light7
Incoming26=Tim0TimT0008Trigger3
Outgoing26=MID1BF47rrBF48ssBF49tt
Options26=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=0if(gs==1)tt=0if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=64if(gs==3)rr=127if(gs==3)ss=0if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=0
Name27=Light8
Incoming27=Tim0TimT0008Trigger3
Outgoing27=MID1BF51rrBF52ssBF53tt
Options27=Actv01Stop00OutO00StMa0000000Cif(gs==1)rr=127if(gs==1)ss=0if(gs==1)tt=0if(gs==2)rr=127if(gs==2)ss=127if(gs==2)tt=64if(gs==3)rr=127if(gs==3)ss=0if(gs==3)tt=127if(gs==4)rr=127if(gs==4)ss=127if(gs==4)tt=0

I've not tested this yet, but this should be 4 footswitches programmed up.
PC0 just sends one long Midi CC string (to blackout all lights)
PC1 should rotate around 4 colours for Light 3 (3 x CC messages), plus send all 0s to the other 7 lights (21 x CC messages)
PC2 should rotate around 4 colours for Light 2 (3 x CC messages), plus send all 0s to the other 7 lights (21 x CC messages)
PC3 should rotate around 4 colours for 8 lights (24 x CC messages)

I've got another 4 sets of translations to set up (for PC4 to PC7), then that should complete this preset.

I've configured it with a startup preset (to set the global variable, and then activate the 'Warm' preset). My plan is to then have additional presets (for other colour schemes) so that the same 8 footswitches will then produce different colour options.
(Not sure how I'll swap presets yet - probably via Midi Program Change from another source i.e. my sequencer)

Does this sound logical?
It looks (to a newbie) like quite a lot of translators already, and they are going to double when I add in the other 4 PCs. Do you think this is reasonable, or should I look to try and do this more efficiently?
From reading the manual I guess that switching the presets for the other colour schemes is the best way to do this (as the de-activated presets shouldn't impact on laptop performance) - Is that correct?

Any thoughts / comments / advice / suggestions gratefully received.

Cheers, Paul

DvlsAdvct

2012-09-01 19:13:24

I would do this with preset switches, personally. So you'd just have each preset for each color scheme, and use triggering those presets to set the appropriate colors. You can have each preset have a command for the foot controller with an outgoing message of "Activate Next Preset" and on each preset activation it can say "Deactivate Previous Preset". Just make sure the incoming message is just the downpress, and not pp so when the next preset activates it doesn't then activate the NEXT preset, if that makes sense.

And then just have "On Activation of this Preset" and what all of the outgoing messages should be to the controller for LED feedback.

Making sense?

J

PaulF707

2012-09-03 19:00:31

Thanks for that...

I spent a lot of time over the weekend trying to simplify this; and to be honest I'm now going back towards using just presets (which means I can go back to using the 'Classic' edition - which will save me a few quid!)

I'm still experimenting, so things could change, and I'll shout back here with any further questions / problems etc.

Thanks for the help and advice - much appreciated.

(And what a great product!)

Cheers
Paul

DvlsAdvct

2012-09-03 19:13:22

Just keep us in the loop :)