Changing Rotary Value Over Time and Back Again

CountBlackula

2010-02-12 02:53:29

Hi everyone, i am one of those 'noobs', so forgive my ignorance - I only got my hands on MTPro yesterday!.

Sussed incoming to keystroke which is all good... but what I am wanting to do is have an incoming message translated into an outgoing that can control a rotary / fader from say midi value 0-127 and then back again.

Basically I want to use buttons or keystrokes to trigger various rotary and fader automation.

Also, if there is any documentation on all the different parameters and how to implement them can i be pointed in the right direction?

.. i probably should look at the manual :P

Attigo

2010-02-13 22:31:31

Hi CountBlackula,

This shouldn't be a problem with MT! Can you be more specific with what you want to do? What do you want buttons or keystrokes to output? I'm sure I can help...

The manual is also a good place to learn the basics of MT, you can download it by clicking here....
http://www.bome.com/bome/downloads/manu ... manual.pdf

Scott

CountBlackula

2010-02-15 04:23:44

Hey! Thanks for the reply!

Yeah, I have given the manual a good read now, but I can't seem to figure this out...

for example:

i wish to press a button on my apc which triggers a knob/fader in live to move to a certain value and then back again over a certain period of time.

perhaps something like a button which triggers a filter sweep up and then back down again over a 2 second period.

does that make sense?

tryng to get hold of a few templates at the moment to pull them apart and see how they all work... i cant make a great deal of sense from it all aside from the midi incoming to the keystroke outgoing sort of thing!

any guidance would be appreciated!

Attigo

2010-02-15 19:11:14

Ok, this is a little tricky, but definitely possible...

You want to be using 'Timers' to control this stuff. What you would do is start an ongoing timer when you press the (sweep) button, which will trigger a translator that has rules that will increment the velocity/value (From 0 to whatever you want) with the help of global variables to keep track. Once you have reached the velocity/value you want the fader/knob to go to, you should kill the timer, then start another timer that will trigger another translator with opposite rules to the first one, so the velocity/value will count down the way. Once this value reaches 0, you want to kill the second timer. You would just want your outgoing CC message to be something like B0 01 ga (or whatever global variable you choose). You will just need to figure out how often the triggers will repeat to get your sweep time right.

Does this make sense? If you need, I can go into more detail...

Scott

CountBlackula

2010-02-16 05:14:54

Thanks mate thats awesome,

bit more detail would be good! i follow what you are saying 100%, but im not sure im up to speed with the 'nuts and bolts' of it to make it happen from that info :)

to be honest im a little confused with the pp gg ga etc. etc. at the end of all the command chains.... im assuming they have something to do with velocity as i can setup a button to move a knob to a certain value... i just cant figure out how to do it over a time period..

i guess some more info on rules / timers would be handy.

anything you can offer would be excellent!

Attigo

2010-02-17 22:04:09

Hi Buddy,

I could have gone into super detail and we still might of not got anywhere, so I've went and done it, and it works a treat for me. Here is a sample video I made on the Stanton SCS.3d demonstrating the sweep, but with LED feedback instead.

http://www.attigo.co.uk/video/LED%20Swe ... iPhone.m4v

Here is the Translators you will need to use:

Translator 1:

Code: Select all

Translator 0: Start Sweep
Options: stop=false
Incoming: MIDI 90 01 7f 
Rules: 
  if ga>0 then exit rules, skip Outgoing Action
Outgoing: Periodic timer "Sweep Up": 20 ms (initial delay: 0 ms)
This will start the 'Sweep Up' periodic timer (20ms between triggers) when you press the button, just make 90 01 7f whatever your button input is. The rules stop the button from triggering the sweep if it is already in action.

Translator 2:

Code: Select all

Translator 1: Sweep Up
Options: stop=false
Incoming: On timer "Sweep Up"
Rules: 
  ga=ga+1
  oo=ga
Outgoing: MIDI B0 01 oo
This receives the timer input every 20ms and adds 1 to the current velocity value (counts up), then it outputs a CC message of the value, you can also make B0 01 oo whatever you want (whatever Ableton is listening for).

Translator 3:

Code: Select all

Translator 2: Sweep Up Limit
Options: stop=false
Incoming: On timer "Sweep Up"
Rules: 
  if ga<=126 then exit rules, skip Outgoing Action
Outgoing: Kill timer "Sweep Up"
This will stop the timer when it reaches the limit you want it to, I made it go up to 127 (full sweep) just for this example and will then stop the 'Sweep Up' counter.

Translator 4:

Code: Select all

Translator 3: Sweep Change Direction
Options: stop=false
Incoming: On timer "Sweep Up"
Rules: 
  if ga<=126 then exit rules, skip Outgoing Action
Outgoing: Periodic timer "Sweep Down": 20 ms (initial delay: 0 ms)
This works the same as the above Translator, but rather than 'killing' the Up timer, it starts the 'Sweep Down' timer.

Translator 5:

Code: Select all

Translator 4: Sweep Down
Options: stop=false
Incoming: On timer "Sweep Down"
Rules: 
  ga=ga-1
  oo=ga
Outgoing: MIDI B0 01 oo 
This works the same as the second Translator, but counts back down the way...

Translator 6:

Code: Select all

Translator 5: Sweep Stop
Options: stop=false
Incoming: On timer "Sweep Down"
Rules: 
  if ga>0 then exit rules, skip Outgoing Action
Outgoing: Kill timer "Sweep Down"
This will kill the 'Sweep Down' timer when it reaches 0 again.

You can change the values accordingly, if you want to make the sweep quicker, you could change the timer value from 20 to something smaller, or making the number larger will make it last for longer. You could also have the sweep up and sweep down times different which could be pretty cool. One more cool thing you could do is change the rules on the first Translator from 'if ga>0 then exit rules, skip Outgoing Action' to 'ga=0', and this will relaunch the sweep every time you press the button.

I hope this makes sense and you can get it rolling...

Scott

CountBlackula

2010-02-18 06:33:22

Thankyou SO MUCH!!!!

hahaha i didnt expect that! you jsut made my day man! thankyou!

This is going to be great as a learning tool more than anything.. I can't wait to chuck it all in and have a pay and see how it all works..

I think understanding this is probably going to help me greatly in the start of my Bome adventure :)

Hopefully soon enough I can repay some other forum user with knowledge :P

CountBlackula

2010-02-18 06:40:16

also - jsut checked out your site - you have some great ideas there with your product design!

Attigo

2010-02-18 16:26:39

No worries buddy! Glad I could help!

Thanks for your comments about my work, much appreciated...

I forgot to answer your questions before about oo, pp, ga etc... These are variables.

oo, pp, xx and ww are all what are known as 'Local Variables', which can be anything between oo and zz. They hold their value in a Translator for as long as the Translator is operating. They can just run a changing number of a MIDI message through a Translator. You could use this for a CC message that you need the value/velocity for, whether to change the range or pass a message through. For example, you might want to turn the message B0 01 oo into B1 01 oo, so the velocity is still kept when the MIDI message is translated to a different channel. You can use these variables in the rules to do things like 'halfing' a MIDI range (changing it from 0-127 to 0-64), you would just have oo=oo/2.

You can also use 'Global Variables' which work on the same principal, but the value is stored and you can recall it at any time in any Translator. Handy for when you are switching presets or if you need the ptreset to 'remember' a certain value of a control... Global Variables can be anything from ga-gz and g1-g9, also any letter from g-n, so you could use anything like hf, i5, ja (Just a few examples). So global variables range from ga-n9.

Timers are really simple but open up a whole bunch of doors for cool stuff. A lot of the time I don't really uses Timers for timing stuff, I use them like internal triggers. You can make a button launch a timer which can be received by 2, 3, 10, 100 translators, whatever you want!

Hope this makes sense...

Scott

CountBlackula

2010-02-19 02:45:19

Hi Scott,

Thanks for that aswell - that was actually going to be my next question... I am seeing how this all fits together now, this is super helpful.

HOWEVER, haha, I have done the following and it doesn't seem to work - no knob movement at any stage (i tested after each stage to progressively see and understand the change being made). I should mention I am on OSX 10.6.2 so I am on version 1.6 (it keeps crashing aswell everytime i go in to edit a translator.. everytime without fail.)..

so here is my translators - they match up basically identical, i assume the nuances are because of OSX/Windows differences.


Translator 0 :START SWEEP
Options: swallow,1 rules
Incoming: MIDI 90 35 7F
Rules:
if ga>0 then exit rules, skip Outgoing Action
Outgoing: Periodic timer "SWEEP UP": 20 ms (initial delay: 0 ms)

Translator 1 :SWEEP UP
Options: 2 rules
Incoming: On timer "SWEEP UP"
Rules:
ga=ga+1
oo=ga
Outgoing: MIDI B0 30 oo

Translator 2 :SWEEP UP LIMIT
Options: 1 rules
Incoming: On timer "SWEEP UP"
Rules:
if ga<126 then exit rules, skip Outgoing Action
Outgoing: Kill timer "SWEEP UP"

Translator 3 :SWEEP CHANGE DIRECTION
Options: 1 rules
Incoming: On timer "SWEEP UP"
Rules:
if ga<=126 then exit rules, skip Outgoing Action
Outgoing: Periodic timer "SWEEP DOWN": 20 ms (initial delay: 0 ms)

Translator 4 :SWEEP DOWN
Options: 2 rules
Incoming: On timer "SWEEP DOWN"
Rules:
ga=ga-1
oo=ga
Outgoing: MIDI B0 30 oo

Translator 5 :SWEEP STOP
Options: 1 rules
Incoming: On timer "SWEEP DOWN"
Rules:
if ga>0 then exit rules, skip Outgoing Action
Outgoing: Kill timer "SWEEP DOWN"

Attigo

2010-02-19 03:04:32

Hey,

I can't see any problem there, not sure what is going on. Do you look at the 'Log Window' when you are testing? If not, you should, it is real handy for debugging your presets. If it is working you will see everything adding up and counting back down, and the output as well. (View > Log Window)

Maybe it's a problem on the software side? How did you map it in?

Scott

CountBlackula

2010-02-19 03:33:55

ahh wasnt aware of that ill check it out!

the APC is pre mapped i THINK... basically it works out of the box with live... however when you click the midi learn overlay screen, nothing is assigned to CC values..

I have tried both ways however, assigning a CC to a knob manually and also, just 'out of the box'... no luck!

ill check out this log, i also thought a software problem.. but im pretty sure i have all the ins and outs setup correctly... bomes receiving in from the apc, and live receiving in from bomes....

Attigo

2010-02-19 23:30:35

Ok, cool.

Are you sure you are sending the correct MIDI message? i really don't understand why nothing is happening. Did you get anything good from the Log Window?

If I get a chance over the weekend, I will get my APC running and try it myself...

Scott

RobG

2010-03-06 12:01:36

Hi Scott,

Thanks for providing such a detailed response. These steps have really helped me understand how MTPro works!

I'm trying to use a modified version of the Translators to run a Modulation CC sweep on Ch10 by pressing the Q key on laptop, but having worked once, the log window shows the following...

000001 IN 0.0: Keystroke: Q
000002 condition satisfied: if ga>0 then exit rules, skip Outgoing Action



Project: RPG_QWERTY Drum Channel CC
Project MIDI OUT ports: Keystroke MIDI OUT, Bome's Midi Translator 1 Virtual Out
_____________________________________________________________
Preset 0: QWERTY Drum Channel CCs

Code: Select all

Translator 0.0: Start Sweep Ch10 CC001
Options: stop=false
Incoming: Keystroke: Q
Rules: 
  if ga>0 then exit rules, skip Outgoing Action
Outgoing: Timer 16 times "Increase CC every 100ms": 100 ms (initial delay: 0 ms)

Code: Select all

Translator 0.1: Sweep Up
Options: stop=false
Incoming: On timer "Increase CC every 100ms"
Rules: 
  ga=ga+1
  oo=ga
Outgoing: Ch10 CC001

Code: Select all

Translator 0.2: Sweep Up Limit
Options: stop=false
Incoming: On timer "Increase CC every 100ms"
Rules: 
  if ga<=126 then exit rules, skip Outgoing Action
Outgoing: Kill timer "Increase CC every 100ms"

Code: Select all

Translator 0.3: Sweep Change Direction
Options: stop=false
Incoming: On timer "Increase CC every 100ms"
Rules: 
  if ga<=126 then exit rules, skip Outgoing Action
Outgoing: Timer 16 times "Decrease CC every 100ms": 100 ms (initial delay: 0 ms)

Code: Select all

Translator 0.4: Sweep Down
Options: stop=false
Incoming: On timer "Decrease CC every 100ms"
Rules: 
  ga=ga-1
  oo=ga
Outgoing: MIDI B9 01 pp 

Code: Select all

Translator 0.5: Sweep Stop
Options: stop=false
Incoming: On timer "Decrease CC every 100ms"
Rules: 
  if ga>0 then exit rules, skip Outgoing Action
Outgoing: Kill timer "Decrease CC every 100ms"
I'm unsure why my translators are showing as 0.1, 0.2, etc. I tried editing to match your steps, but it seems that Save As Text File is only to help find bugs, rather than fix them (right?)

Thanks in advance for any help you can give!

Cheers!

Rob

Attigo

2010-03-06 22:21:43

Hi Rob G,

I'm glad this was useful to you!

How come you are triggering the timer only 16 times? I use it infinitely (well at least until it reaches 127!).

The reason it is not triggering again is because the variable 'ga' for some reason or another is not at 0. I just added this to stop it being relaunched when it was still in action, but if you remove that first rule, you shouldn't have a problem, but it will start counting from where ga is. You can see the value of this any time in the Log Window, just press 'Dump Variables'.

If you run the timer infinitely, the variable will go the full cycle and return to 0 which should also solve your problem...

Hope this helps!

Scott

RobG

2010-03-07 01:31:51

Hi Scott,

I got it working as well as I needed.

Solution was to replace...
  • -- '+1' with '+8' to give the 0-127 range
    -- 'oo' with 'pp' to provide the correct variable
For some reason my Live macro knobs go to 120 but the Ableton Knobs in M4L only go to 94. Something to keep me quite for a while, whilst I work it out, eh! :)

Cheers!

Rob

CountBlackula

2010-03-09 07:30:36

hey hey!

sorry for no replies in so long.. i have been so friggen busy!

okay so, i finally got this working but sweep seems to stop when it reaches its peak, and when i press the midi button, it will wind back down....

i did have to change some stuff to 'perform outgoing action' to get any result whatsoever..

im installing version 1.7beta tonight.. so ill see how that goes in comparison.

Attigo

2010-03-09 22:21:45

Hey Count,

Can you upload your preset for me to have a look at?

I wrote a 'through' preset that allows the 'handshake' (SYSEX) between Live and APC to happen and enable full connected functionality (including the red box in Live), so it works as normal but running through MT. I can show you this if you want, or are you happy just re-mapping back into Live?

Scott

CountBlackula

2010-03-17 11:27:39

hey mate heres my preset..

im going to be happy as larry once this is working how i need it to believe me!

next on the list is return all knobs to default. but once i learn the above, that should be a walk in the park!

not sure what you meant with the 'through' comment to be honest!
Attachments
DEZO BOMES.bmtp
(897 Bytes) Downloaded 216 times

Attigo

2010-03-18 06:11:48

Hi countblackula,

I checked out your preset, what is stopping the sweep at the peak is that your rules on Translator #2 'SWEEP UP LIMIT' are...

if ga<126 then exit rules, skip Outgoing Action

but you just need to change it to..

if ga<=126 then exit rules, skip Outgoing Action (note the '=')

This will fix it.

As for the 'through' preset I was talking about, it's just a preset that allows all MIDI data between Live and the APC flow through, as if MT was not involved at all. This is to give full functionality of the APC like it has when it is connected directly to LIve, and so you do not have to re-map everything...

Scott

CountBlackula

2010-03-20 08:54:00

ill be out of your hair soon i swear.

okay... i got it working in the log, but it doesnt seem to work in live.

have checked mtp is talking to live which it is.

i have attached some screen caps of what im trying to acheive hopefully this helps.

im trying to get the top right hand button (in the grid of squares) on the apc to trigger device control knob 5 (b0 14 oo i think from memory) on the apc40 to sweep the highpass filter (bottom right of the screen in live) to sweep up and then back down again.

i have tried assigning it via the midi map function aswell to no avail.

see attached pics.
Attachments
Screen shot 2010-03-20 at 3.44.42 PM.png
Screen shot 2010-03-20 at 3.44.42 PM.png (45.15 KiB) Viewed 8711 times
Screen shot 2010-03-20 at 3.45.52 PM.png
Screen shot 2010-03-20 at 3.45.52 PM.png (169.46 KiB) Viewed 8711 times

Attigo

2010-03-20 18:31:44

Your input in Live should not be from the APC, it should be from Bome's MIDI Ports. MT receives the input from your APC then you send that to Live.

In Live, select APC40 as the Control Surface and the Input and Output ports as Bome's Virtual Ports. Do not let Live receive any MIDI directly from the APC.

This way you are still remapping the APC's controls. Do you still not understand what I mean by this 'through' preset? I think you need this to do it properly.

Scott

CountBlackula

2010-03-24 07:58:14

i think i understand..

MTP 'floats' between the apc and live.

It receives midi information from the APC and can then send it to live but the APC's direct relationship with live is not effected?

Attigo

2010-03-25 20:58:13

Yes, my Preset allows the direct relationship with Live and the APC40