Incremental key strokes.

Patch

2008-12-09 22:27:14

Hi,
I'd like to be able to have Bomes send an incremental key stroke every time I press a button on my midi controller.

Press Once - Output=Keystroke NUM1
Press Again - Output=Keystroke NUM2
Press Again - Output=Keystroke NUM3
Press Again - Output=Keystroke NUM4

Once you've pressed the button 4 times, it goes back to the beginning (starts at NUM1 again...). I'm sure this can be done - in fact I think I've had it working in the past - but I can't for the life of me find any info on it here in the forum...

Cheers.

S4racen

2008-12-10 09:11:22

Hi Pat,

pm orge on the abletonlivedj forum, ask him about his cycle buttons on his 1d template, i've got it at home but i'm not there till tonight, i have a button set to cycle between selecting the wav and effects of a channel in subsequent pushes....

I'll send you the code when i get in if you haven't heard back....

Very cool....

Cheers
D

Patch

2008-12-10 18:11:06

Hey - good to see you over here! I've asked about something different to what you are suggesting. Toggling between clip view and effect view in Session View is a no brainer... (It's just a combination key press that toggles between clip/effect view). I need the incoming midi event to produce a DIFFERENT outgoing message on each press...

S4racen

2008-12-11 09:40:01

Sorry,

Maybe the example i used was unclear, with each push of the button it cycles through a set of Midi messages, each one different, in my set up i've chosen simply to have two steps in my cycle but orge had set it up originally to have four steps per button as per your request....

Cheers
D

fanboi

2008-12-12 18:38:31

well. you could make several presets and have them first output the keystroke, then activate the next preset, deactivating all the others. which is a drag if you want to use more things then that (trust me, i used to have preset switching only, quite hard to get a grasp of your setup with somewhat 20-30 presets all over the place).

another idea could be to setup a rule translator that takes the incoming keystroke and outputs a given cc value, and each time you press your keystroke that value increases by one, then make translators that takes the input value of the outputted cc value by your rule to trigger keystrokes. this way its easy to expand the setup aswell. theres a couple of threads for using rules to increase values.

thats how i would do it, although im pretty sketchy at MT and theres a chance that it could be done in a smarter way.

florian

2009-01-04 19:53:58

As fanboi proposes, using Rules is probably the most straight forward way:

the scheme would work like this:
1) define a global variable (say "ga") as a counter that always increments when you press a MIDI button.
2) the counter wraps, i.e. when it reaches 4, it is reset back to 0
3) 4 individual translator entries check the counter. Each translator entry outputs a different keystroke, and they only trigger if the counter equals the keystroke

how to do it in MT:

Code: Select all

Translator 1: Output NUM1 if ga=0
INCOMING: MIDI <midi message for the MIDI button>
RULES:
 if ga!=0 then exit rules, do not execute action
OUTGOING: KEYSTROKE NUM1

Translator 2: Output NUM2 if ga=1
INCOMING: MIDI <midi message for the MIDI button>
RULES:
 if ga!=1 then exit rules, do not execute action
OUTGOING: KEYSTROKE NUM2

[...]

Translator 5: Increment Counter
INCOMING: MIDI <midi message for the MIDI button>
RULES:
 ga=ga+1
 if ga>=4 then ga=0
OUTGOING: <none>
Hope that helps!
Florian

mocker

2009-01-05 23:07:50

Great rule, I used it for something else, works perfect…
BTW Happy New Year to everyone.

beatskk

2009-10-18 01:54:13

florian wrote:As fanboi proposes, using Rules is probably the most straight forward way:

the scheme would work like this:
1) define a global variable (say "ga") as a counter that always increments when you press a MIDI button.
2) the counter wraps, i.e. when it reaches 4, it is reset back to 0
3) 4 individual translator entries check the counter. Each translator entry outputs a different keystroke, and they only trigger if the counter equals the keystroke

how to do it in MT:

Code: Select all

Translator 1: Output NUM1 if ga=0
INCOMING: MIDI <midi message for the MIDI button>
RULES:
 if ga!=0 then exit rules, do not execute action
OUTGOING: KEYSTROKE NUM1

Translator 2: Output NUM2 if ga=1
INCOMING: MIDI <midi message for the MIDI button>
RULES:
 if ga!=1 then exit rules, do not execute action
OUTGOING: KEYSTROKE NUM2

[...]

Translator 5: Increment Counter
INCOMING: MIDI <midi message for the MIDI button>
RULES:
 ga=ga+1
 if ga>=4 then ga=0
OUTGOING: <none>
Hope that helps!
Florian

just stumbled over this one, and it's great! just what i needed to flip through my fx bank.

now, i tried to make a preset to have another button cycle the opposite way:

Code: Select all

Translator 0 :New Translator
Options: 1 rules
Incoming: MIDI 90 3C 7F
Rules: 
	if ga!=0 then exit rules, skip Outgoing Action
Outgoing: MIDI Bf 17 00

Translator 1 :New Translator
Options: 1 rules
Incoming: MIDI 90 3C 7F
Rules: 
	if ga!=1 then exit rules, skip Outgoing Action
Outgoing: MIDI Bf 17 06

Translator 2 :New Translator
Options: 1 rules
Incoming: MIDI 90 3C 7F
Rules: 
	if ga!=2 then exit rules, skip Outgoing Action
Outgoing: MIDI bf 17 0e

.......

Translator 15 :New Translator
Options: 1 rules
Incoming: MIDI 90 3C 7F
Rules: 
	if ga!=15 then exit rules, skip Outgoing Action
Outgoing: MIDI Bf 17 80

Translator 16 :New Translator
Options: 2 rules
Incoming: MIDI 90 3C 7F
Rules: 
	ga=ga-1
	if ga!=0 then ga=15
Outgoing: (none)

(please don't mind the messy midi messages :roll: ).

it works fine, but if use both presets together, i get strange behavior from mt.

if i cycle forward and then backward i get a forward jump on the first press of the backward key, and vice versa. for example:

forward 1,2,3,4,5 backward 6,5,4,3 forward 2,3,4,5

any clues on what's going on?

florian

2009-11-22 14:57:55

Hi, have you solved this by now? Otherwise, maybe it's a good idea to use a different global variable in your second preset, e.g. "gb" instead of ga. Otherwise, your two presets will affect each other. Global variables (such as ga, gb, gc...) are the same for all presets.

Thanks,
Florian