Setting up length

David Koch

2020-07-04 03:49:41

Hey there,

 

i am a newbie when it comes to MIDI programming and i was searching for the "length/duration-of-hitting-a-pad"-topic that is about to follow with no result. So hoping to get support here.

It is a about connecting two functions of a color correction software with just one pad of my AKAI MPD218 in combination with my recently bought Bome Midi Translator. Those two functions are 1. grabbing the memory picture and 2. applying it.

My idea would be to grab it with pushing and holding the pad for a longer time span (about min. 0,5 sec) and applying it with a short hit of the pad (about 0,3 sec max). Another method for grabbing would be hitting the pad twice quickly back-to-back and hitting it only once for applying.

 

Any suggestions?

 

Thx in advance,

David

Steve-Bome Forum Moderator

2020-07-04 05:49:28

Hi, for holding a pad, it would be note-on with whatever note number and MIDI channel your controller sends. If the pad is velocity sensitive (and I assume since it is a pad, it is), then the note-on should be any velocity.

When releasing the pad, it would be note-off with the same MIDI channel and same note as note-on.

 

Just be sure you hold the pad down for the duration you want to time. The outgoing action would be a timer, with a duration of 500ms (1/2 second). At the end of that time, you determine whether the note is still held down to dertermine the action.  By setting a global variable (ie ga=1) when pressing the pad and returning ga to 0 when releasing the pad, you would know if it was held down for more than 1/2 second.  At the end of the 1/2 second if ga=1 then you apply your \"grab\" action, however if ga=0 then you apply your hit action (< 1/2 second).  You didn\'t specify what actions need to be applied for each (mouse, keystroke, MIDI message). You might need to have 2 translators that fire after 1/2 second, one that fires only if ga=1 (>1/2 second) and the other that fires only if ga=0 (< 1/2 second)

 

Also if your pad send channel pressure, (aftertouch) there may be other MIDI messages in between, which you should be able to safely ignore.

 

------
Translator : Note-On
Incoming: Note-On Note X MIDI CH w any velocity
-------
Rules:
// indicate on condition

ga=1

// End of Rules
-------
Outgoing: Timer \"Evaluator\" Delay 500ms
Options: Swallow
------

 

------
Translator : Note-Off
Incoming: Note-Off Note X MIDI CH w any velocity
-------
Rules:
// indicate on condition

ga=0

// End of Rules
-------
Outgoing:  None

Options: Swallow
------

 

------
Translator : Evaluator send Message 1
Incoming: Timer Evaluator
-------
Rules:
// indicate on condition

if ga==0 then exit rules, skip outgoing action

// End of Rules
-------
Outgoing: (Outgoing action for > 500ms)
Options: Swallow
------

 

------
Translator : Evaluator send Message 2
Incoming: Timer Evaluator
Rules:
// indicate on condition

if ga==1 the exit rules, skip outgoing action

// End of Rules
-------
Outgoing: (Outgoing action for < 500ms)
Options: Swallow
------

 

I hope this helps!

 

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

 

David Koch

2020-07-07 02:33:03

Hey Steve,

thank you so much for the fast and precise answer. It worked out well :-)

Have a nice day,

David

Steve-Bome Forum Moderator

2020-07-07 04:14:43

comment

Glad to hear it!