Hardware and ActionMatchers

Post Reply New Topic
RELATED
PRODUCTS

Post

Working on building some action matchers for the xtouch mini but i'm not sure how to go about doing it.

Code: Select all

 hardware_button = hardware_surface.createHardwareButton("XTOUCH1_BTN");
 HardwareActionMatcher          pressedButtonAction = midi_in.createNoteOnActionMatcher(0, 87);
 HardwareActionMatcher          releasedButtonAction = midi_in.createNoteOffActionMatcher(0, 87);
The problem i'm trying to solve is that the midi events are BOTH Note ON. Note On at 127 velocity for press... and Note On 0 for release. So I'm not sure how to create a different noteOffAction Matcher.

I dug through the API help but could not find much there, thought maybe this... but have no idea what to supply as an expression...

Code: Select all

HardwareActionMatcher createActionMatcher (String expression)	
And then I look at velocity options with note on but it is not a Hardware Action Matcher, seems like you would use this to attach note velocity to a knob or something like this.

Code: Select all

AbsoluteHardwareValueMatcher createNoteOnVelocityValueMatcher	(int channel, int note )


ugh... got lost on this one. Any help would be appreciated! Thanks
----------------------------------------------------------------------
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest

Post

Looks like actually my debug code was busted and the notes are properly detected anyways. I just had the same debug spew coming from both pressed and released functions. Classy! :D

However I did learn how to use the String expression in the process for ActionMatchers. I think this is pretty useful since its not described in the API help.

HardwareActionMatcher releasedButtonAction = midi_in.createActionMatcher("status == " + Midi.NOTE_ON + " && data1 == " + 87 + " && data2 > 64");
----------------------------------------------------------------------
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest

Post Reply

Return to “Controller Scripting”