Note On msg to output CC msg that increases +1 on each press

rishi

2007-11-01 11:42:55

Hi Florian,

How do I get a Note On message to output a CC Controller message that increases by 1 each time I press it ?

I guess I need to store a value and then +1 each time the incoming Note on message is hit, but I cant get it to work?

I want one button to send +1 and one button to send -1.

Also, is it possible to use a timer to send multiple +1 or -1's if I hold the button down?

This is similar to my keypress thing but this time the output is a CC Controller message instead of a keystroke.

Thanks

florian

2007-11-05 13:45:03

Hi Rishi,

yes, that's no problem with MT Pro. This is very similar as converting an "endless knob" to a continuous controller (there are several threads about this in the forum). Here is a working solution for you, with repeat feature:

Code: Select all

Translator 1: Note On 1: increment controller 07
Options: stop=false
Incoming: MIDI 90 45 pp 
Rules: 
  Label "Ignore if Note Off"
  if pp==0 then exit rules, skip Outgoing Action
  Label "Cannot increase anymore if already 127"
  if gc>=127 then exit rules, skip Outgoing Action
  gc=gc+1
Outgoing: MIDI B0 07 gc 

Translator 2: Note On 1: start timer
Options: stop=false
Incoming: MIDI 90 45 pp 
Rules: 
  Label "Ignore if Note Off"
  if pp==0 then exit rules, skip Outgoing Action
Outgoing: Periodic timer "Note On 1": 100 ms (initial delay: 500 ms)

Translator 3: On Note 1 timer: increase gc and output controller
Options: stop=false
Incoming: On timer "Note On 1"
Rules: 
  Label "Cannot increase anymore if already 127"
  if gc>=127 then exit rules, skip Outgoing Action
  gc=gc+1
Outgoing: MIDI B0 07 gc 

Translator 4: Note On 1: stop timer
Options: stop=false
Incoming: MIDI 90 45 00 
Outgoing: Kill timer "Note On 1"

Translator 5: Note On 2: decrement controller 07
Options: stop=false
Incoming: MIDI 90 43 pp 
Rules: 
  Label "Ignore if Note Off"
  if pp==0 then exit rules, skip Outgoing Action
  Label "Cannot decrease anymore if already 0"
  if gc<=0 then exit rules, skip Outgoing Action
  gc=gc-1
Outgoing: MIDI B0 07 gc 

Translator 6: Note On 2: start timer
Options: stop=false
Incoming: MIDI 90 43 pp 
Rules: 
  Label "Ignore if Note Off"
  if pp==0 then exit rules, skip Outgoing Action
Outgoing: Periodic timer "Note On 2": 100 ms (initial delay: 500 ms)

Translator 7: On Note 2 timer: decrement controller 07
Options: stop=false
Incoming: On timer "Note On 2"
Rules: 
  Label "Cannot decrease anymore if already 0"
  if gc<=0 then exit rules, skip Outgoing Action
  gc=gc-1
Outgoing: MIDI B0 07 gc 

Translator 8: Note On 2: stop timer
Options: stop=false
Incoming: MIDI 90 43 00 
Outgoing: Kill timer "Note On 2"
Regards,
Florian

rishi

2007-11-07 00:08:53

Thanks so much!!

I saw elements of what I was trying to do in the endless knob threads but couldnt get it to work. Will try this out now!!