/[svn]/doc/docbase/instrument_scripts/nksp/reference/functions/nksp_ignore_event_function.html
ViewVC logotype

Diff of /doc/docbase/instrument_scripts/nksp/reference/functions/nksp_ignore_event_function.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2881 by schoenebeck, Tue Apr 19 16:09:52 2016 UTC revision 3211 by schoenebeck, Thu May 25 13:02:03 2017 UTC
# Line 16  Line 16 
16      <p>      <p>
17        Dropping events with this function only succeeds if the event just        Dropping events with this function only succeeds if the event just
18        "recently" occurred. That effectively means you should drop the event in        "recently" occurred. That effectively means you should drop the event in
19        the respective event handler before any <code>wait() calls, and before        the respective event handler before any <code lang="nksp">wait()</code> calls, and before
20        entering any loops that may execute your script for a very long time.        entering any loops that may execute your script for a very long time.
21        Because in both cases the sampler may suspend your script for a certain        Because in both cases the sampler may suspend your script for a certain
22        amount of time and once your script got resumed, the respective event may        amount of time and once your script got resumed, the respective event may
# Line 24  Line 24 
24        thus can no longer be dropped.        thus can no longer be dropped.
25      </p>      </p>
26      <p>      <p>
27        There is also an <code lang="nksp">ignore_controller()</code> function,        There is also an <code>ignore_controller()</code> function,
28        intended for explicitly dropping control change events. With NKSP you        intended for explicitly dropping control change events. With NKSP you
29        you can also use <code>ignore_event()</code> though to        you can also use <code>ignore_event()</code> though to
30        drop control change events. So <code>ignore_controller()</code>        drop control change events. So <code>ignore_controller()</code>
# Line 45  ignore_event(??event-id??) Line 45  ignore_event(??event-id??)
45        <tr>        <tr>
46          <td><code>??event-id??</code></td>          <td><code>??event-id??</code></td>
47          <td>Event ID Number or Event ID Array</td>          <td>Event ID Number or Event ID Array</td>
48          <td>MIDI event(s) to be dropped.<br>          <td>Event ID(s) of the MIDI event(s) to be dropped.<br>
49              [required]</td>              [required]</td>
50        </tr>        </tr>
51      </table>      </table>
# Line 54  ignore_event(??event-id??) Line 54  ignore_event(??event-id??)
54      <p>None.</p>      <p>None.</p>
55            
56      <h3>Examples</h3>      <h3>Examples</h3>
57      <p>None yet.<p>      <p>
58          The following example implements a simple split point behavior for your sound.
59          It only plays notes starting at C5, all note-on events below C5 will be dropped.
60        </p>
61        <code>
62    on init
63      { MIDI note number for "C5" }
64      declare const $splitPoint := 60
65    end on
66    
67    on note
68      if ($EVENT_NOTE &lt; $splitPoint)
69        { $EVENT_ID is a built-in variable which always reflects
70          the ID of the event which caused the execution of this
71          specific event handler instance, i.e. here it reflects
72          the respective MIDI note-on event }
73        ignore_event($EVENT_ID)
74      end if
75    end on
76        </code>
77        <p>
78          Since you are almost always passing <code>$EVENT_ID</code> to <code>ignore_event()</code>,
79          you can also omit that optional argument with NKSP. So the following
80          would behave identical with the example above.
81        </p>
82        <code>
83    on init
84      { MIDI note number for "C5" }
85      declare const $splitPoint := 60
86    end on
87    
88    on note
89      if ($EVENT_NOTE &lt; $splitPoint)
90        ignore_event()
91      end if
92    end on
93        </code>
94    
95      <note>      <note>
96        Passing an array of event IDs is only supported by NKSP. If you want        Passing an array of event IDs is only supported by NKSP. If you want

Legend:
Removed from v.2881  
changed lines
  Added in v.3211

  ViewVC Help
Powered by ViewVC