This forum is read-only. Please post new topics in our Q&A forum.

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

General discussion about MIDI Translator

Moderators: florian, DvlsAdvct

Post Reply
rishi
Power User
Posts: 48
Joined: Thu Feb 16, 2006 4:20 am

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

Post by rishi » Thu Nov 01, 2007 11:42 am

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

User avatar
florian
Bome Software: Founder
Posts: 2435
Joined: Thu Apr 28, 2005 10:09 pm
Location: Munich, Germany
Contact:

Post by florian » Mon Nov 05, 2007 1:45 pm

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
Power User
Posts: 48
Joined: Thu Feb 16, 2006 4:20 am

Post by rishi » Wed Nov 07, 2007 12:08 am

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!!

Post Reply