--- doc/docbase/instrument_scripts/nksp/reference/functions/nksp_ignore_controller_function.html 2017/05/25 12:40:21 3210 +++ doc/docbase/instrument_scripts/nksp/reference/functions/nksp_ignore_controller_function.html 2017/05/25 13:02:03 3211 @@ -63,7 +63,7 @@
The following example implements a simple MIDI controller filter. It causes all MIDI volume control change events (MIDI CC#7) to be dropped. -
+
on init
{ MIDI controller number for MIDI "volume change" events }
@@ -80,6 +80,23 @@
end if
end on
+
+ Since you are almost always passing $EVENT_ID
to ignore_controller()
,
+ you can also omit that optional argument with NKSP. So the following
+ would behave identical with the example above.
+
+on init
+ { MIDI controller number for MIDI "volume change" events }
+ declare const $volumeCC := 7
+end on
+
+on controller
+ if ($CC_NUM = $volumeCC)
+ ignore_controller()
+ end if
+end on
+