/[svn]/doc/docbase/instrument_scripts/nksp/reference/01_nksp_reference.html
ViewVC logotype

Diff of /doc/docbase/instrument_scripts/nksp/reference/01_nksp_reference.html

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

revision 3297 by schoenebeck, Wed Jun 28 10:48:30 2017 UTC revision 3692 by schoenebeck, Fri Jan 3 13:55:56 2020 UTC
# Line 5  Line 5 
5      <urlpath>Reference</urlpath>      <urlpath>Reference</urlpath>
6      <navpath>Reference Manual</navpath>      <navpath>Reference Manual</navpath>
7      <meta name="description" content="Reference documentation of the NKSP real-time instrument script language.">      <meta name="description" content="Reference documentation of the NKSP real-time instrument script language.">
8        <autolink term="standard unit" to="01_nksp_real_unit_final.html#units"/>
9        <autolink term="finalness" to="01_nksp_real_unit_final.html#finalness"/>
10    </head>    </head>
11    <body>    <body>
12      <h1>NKSP Reference</h1>      <h1>NKSP Reference</h1>
13      <p>      <p>
14        This document gives you an overview of all built-in functions and built-in        This document gives you an overview of all built-in functions and built-in
15        variables provided by the NKSP real-time instrument script language.        variables provided by the NKSP real-time instrument script language.
16          If you are new to NKSP, then you may want to read the
17          <a href="01_nksp.html">NKSP language tour</a> first.
18      </p>      </p>
19    
20      <h2>Built-In Functions</h2>      <h2>Built-In Functions</h2>
# Line 32  Line 36 
36          <td>Stops execution of a script callback.</td>          <td>Stops execution of a script callback.</td>
37        </tr>        </tr>
38        <tr>        <tr>
39            <td><code lang="nksp">acos()</code></td>
40            <td>Arc cosine function.</td>
41          </tr>
42          <tr>
43            <td><code>abs()</code></td>
44            <td>Calculates the absolute value of a given value.</td>
45          </tr>
46          <tr>
47          <td><code lang="nksp">array_equal()</code></td>          <td><code lang="nksp">array_equal()</code></td>
48          <td>Check whether two arrays are equal.</td>          <td>Check whether two arrays are equal.</td>
49        </tr>        </tr>
50        <tr>        <tr>
51          <td><code>fork()</code></td>          <td><code>asin()</code></td>
52          <td>Creates new execution instances (threads).</td>          <td>Arc sine function.</td>
53          </tr>
54          <tr>
55            <td><code>atan()</code></td>
56            <td>Arc tangens function.</td>
57        </tr>        </tr>
58        <tr>        <tr>
59          <td><code>callback_status()</code></td>          <td><code>callback_status()</code></td>
60          <td>Returns the current status of a callback (thread).</td>          <td>Returns the current status of a callback (thread).</td>
61        </tr>        </tr>
62        <tr>        <tr>
63            <td><code>ceil()</code></td>
64            <td>Rounds the given real number up.</td>
65          </tr>
66          <tr>
67            <td><code>cos()</code></td>
68            <td>Cosine function.</td>
69          </tr>
70          <tr>
71          <td><code lang="nksp">dec()</code></td>          <td><code lang="nksp">dec()</code></td>
72          <td>Decrements the passed integer variable by one.</td>          <td>Decrements the passed integer variable by one.</td>
73        </tr>        </tr>
74        <tr>        <tr>
75            <td><code>exit()</code></td>
76            <td>Stops execution of the current event handler instance.</td>
77          </tr>
78          <tr>
79            <td><code>exp()</code></td>
80            <td>Calculates e raised by given power.</td>
81          </tr>
82          <tr>
83            <td><code>floor()</code></td>
84            <td>Rounds the given real number down.</td>
85          </tr>
86          <tr>
87            <td><code>fork()</code></td>
88            <td>Creates new execution instances (threads).</td>
89          </tr>
90          <tr>
91          <td><code>inc()</code></td>          <td><code>inc()</code></td>
92          <td>Increments the passed integer variable by one.</td>          <td>Increments the passed integer variable by one.</td>
93        </tr>        </tr>
94        <tr>        <tr>
95          <td><code>in_range()</code></td>          <td><code>int()</code></td>
96          <td>Checks whether a value is between two other values.</td>          <td>Short-hand alias function for function <code>real_to_int()</code>.</td>
97        </tr>        </tr>
98        <tr>        <tr>
99          <td><code lang="nksp">message()</code></td>          <td><code>int_to_real()</code></td>
100          <td>Prints text to the sampler's terminal.</td>          <td>Type cast from integer number to real number.</td>
101        </tr>        </tr>
102        <tr>        <tr>
103          <td><code>search()</code></td>          <td><code>in_range()</code></td>
104          <td>Search for a certain value within an array.</td>          <td>Checks whether a value is between two other values.</td>
105        </tr>        </tr>
106        <tr>        <tr>
107          <td><code>sort()</code></td>          <td><code>log()</code></td>
108          <td>Sort the given array.</td>          <td>Calculates the natural logarithm of given number.</td>
109        </tr>        </tr>
110        <tr>        <tr>
111          <td><code>exit()</code></td>          <td><code>log10()</code></td>
112          <td>Stops execution of the current event handler instance.</td>          <td>Calculates the logarithm to base 10 of given number.</td>
113        </tr>        </tr>
114        <tr>        <tr>
115          <td><code>wait()</code></td>          <td><code>log2()</code></td>
116          <td>Pauses execution for a certain amount of time.</td>          <td>Calculates the logarithm to base 2 of given number.</td>
117        </tr>        </tr>
118        <tr>        <tr>
119          <td><code>stop_wait()</code></td>          <td><code>lsb()</code></td>
120          <td>Resumes execution of a suspended script callback.</td>          <td>Returns least significant byte of a 14 bit value.</td>
121        </tr>        </tr>
122        <tr>        <tr>
123          <td><code>abs()</code></td>          <td><code>max()</code></td>
124          <td>Calculates the absolute value of a given value.</td>          <td>Calculates the maximum value of two given values.</td>
125        </tr>        </tr>
126        <tr>        <tr>
127          <td><code>random()</code></td>          <td><code lang="nksp">message()</code></td>
128          <td>Random number generator.</td>          <td>Prints text to the sampler's terminal.</td>
129        </tr>        </tr>
130        <tr>        <tr>
131          <td><code>min()</code></td>          <td><code>min()</code></td>
132          <td>Calculates the minimum value of two given values.</td>          <td>Calculates the minimum value of two given values.</td>
133        </tr>        </tr>
134        <tr>        <tr>
135          <td><code>max()</code></td>          <td><code>msb()</code></td>
136          <td>Calculates the maximum value of two given values.</td>          <td>Returns most significant byte of a 14-bit value.</td>
137        </tr>        </tr>
138        <tr>        <tr>
139          <td><code>num_elements()</code></td>          <td><code>num_elements()</code></td>
140          <td>Returns the size of the requested array variable.</td>          <td>Returns the size of the requested array variable.</td>
141        </tr>        </tr>
142        <tr>        <tr>
143            <td><code>pow()</code></td>
144            <td>Calculates given base raised by given power.</td>
145          </tr>
146          <tr>
147            <td><code>random()</code></td>
148            <td>Random number generator.</td>
149          </tr>
150          <tr>
151            <td><code>real()</code></td>
152            <td>Short-hand alias function for function <code>int_to_real()</code>.</td>
153          </tr>
154          <tr>
155            <td><code>real_to_int()</code></td>
156            <td>Type cast from real number to integer number.</td>
157          </tr>
158          <tr>
159            <td><code>round()</code></td>
160            <td>Rounds the given real number.</td>
161          </tr>
162          <tr>
163            <td><code>search()</code></td>
164            <td>Search for a certain value within an array.</td>
165          </tr>
166          <tr>
167          <td><code>sh_left()</code></td>          <td><code>sh_left()</code></td>
168          <td>Calculates a left bit shifted value.</td>          <td>Calculates a left bit shifted value.</td>
169        </tr>        </tr>
# Line 107  Line 171 
171          <td><code>sh_right()</code></td>          <td><code>sh_right()</code></td>
172          <td>Calculates a right bit shifted value.</td>          <td>Calculates a right bit shifted value.</td>
173        </tr>        </tr>
174          <tr>
175            <td><code>sin()</code></td>
176            <td>Sine function.</td>
177          </tr>
178          <tr>
179            <td><code>sort()</code></td>
180            <td>Sort the given array.</td>
181          </tr>
182          <tr>
183            <td><code>sqrt()</code></td>
184            <td>Calculates the square root of given number.</td>
185          </tr>
186          <tr>
187            <td><code>stop_wait()</code></td>
188            <td>Resumes execution of a suspended script callback.</td>
189          </tr>
190          <tr>
191            <td><code>tan()</code></td>
192            <td>Tangens function.</td>
193          </tr>
194          <tr>
195            <td><code>wait()</code></td>
196            <td>Pauses execution for a certain amount of time.</td>
197          </tr>
198      </table>      </table>
199        
200      <h3>Common Sampler Functions</h3>      <h3>Common Sampler Functions</h3>
201      <p>      <p>
202        Basic sampler related functions, independent from a particular sampler        Basic sampler related functions, independent from a particular sampler
# Line 119  Line 207 
207          <th>Function</th> <th>Description</th>          <th>Function</th> <th>Description</th>
208        </tr>        </tr>
209        <tr>        <tr>
210          <td><code>play_note()</code></td>          <td><code>by_marks()</code></td>
211          <td>Triggers a new note.</td>          <td>Returns all events of an event group.</td>
212        </tr>        </tr>
213        <tr>        <tr>
214          <td><code>change_note()</code></td>          <td><code>change_amp_lfo_depth()</code></td>
215          <td>Change MIDI note number of note.</td>          <td>Modifies the amplitude LFO depth.</td>
216        </tr>        </tr>
217        <tr>        <tr>
218          <td><code>change_pan()</code></td>          <td><code>change_amp_lfo_freq()</code></td>
219          <td>Changes panning of voices (stereo balance).</td>          <td>Modifies the amplitude LFO frequency.</td>
220        </tr>        </tr>
221        <tr>        <tr>
222          <td><code>change_play_pos()</code></td>          <td><code>change_attack()</code></td>
223          <td>Change the sample playback position.</td>          <td>Modifies the amplitude attack time of voices.</td>
224        </tr>        </tr>
225        <tr>        <tr>
226          <td><code>change_tune()</code></td>          <td><code>change_cutoff()</code></td>
227          <td>Changes the tuning of voices.</td>          <td>Changes filter cutoff frequency of voices.</td>
228        </tr>        </tr>
229        <tr>        <tr>
230          <td><code>change_tune_time()</code></td>          <td><code>change_cutoff_attack()</code></td>
231          <td>Changes the duration of tuning changes.</td>          <td>Modifies the filter cutoff attack time of voices.</td>
232        </tr>        </tr>
233        <tr>        <tr>
234          <td><code>change_tune_curve()</code></td>          <td><code>change_cutoff_decay()</code></td>
235          <td>Changes the curve type of tuning changes.</td>          <td>Modifies the filter cutoff decay time of voices.</td>
236        </tr>        </tr>
237        <tr>        <tr>
238          <td><code>change_vol()</code></td>          <td><code>change_cutoff_lfo_depth()</code></td>
239          <td>Changes the volume of voices.</td>          <td>Modifies the filter cutoff LFO depth.</td>
240        </tr>        </tr>
241        <tr>        <tr>
242          <td><code>change_vol_time()</code></td>          <td><code>change_cutoff_lfo_freq()</code></td>
243          <td>Changes the duration of volume changes.</td>          <td>Modifies the filter cutoff LFO frequency.</td>
244        </tr>        </tr>
245        <tr>        <tr>
246          <td><code>change_vol_curve()</code></td>          <td><code>change_cutoff_release()</code></td>
247          <td>Changes the curve type of volume changes.</td>          <td>Modifies the filter cutoff release time of voices.</td>
248        </tr>        </tr>
249        <tr>        <tr>
250          <td><code>change_cutoff()</code></td>          <td><code>change_cutoff_sustain()</code></td>
251          <td>Changes filter cutoff frequency of voices.</td>          <td>Modifies the filter cutoff sustain level of voices.</td>
252        </tr>        </tr>
253        <tr>        <tr>
254          <td><code>change_reso()</code></td>          <td><code>change_decay()</code></td>
255          <td>Changes filter resonance of voices.</td>          <td>Modifies the amplitude decay time of voices.</td>
256        </tr>        </tr>
257        <tr>        <tr>
258          <td><code>change_attack()</code></td>          <td><code>change_note()</code></td>
259          <td>Modifies the attack time of voices.</td>          <td>Change MIDI note number of note.</td>
260        </tr>        </tr>
261        <tr>        <tr>
262          <td><code>change_decay()</code></td>          <td><code>change_pan()</code></td>
263          <td>Modifies the decay time of voices.</td>          <td>Changes panning of voices (stereo balance).</td>
264        </tr>        </tr>
265        <tr>        <tr>
266          <td><code>change_release()</code></td>          <td><code>change_pan_curve()</code></td>
267          <td>Modifies the release time of voices.</td>          <td>Changes the curve type of panning (stereo balance) changes.</td>
268        </tr>        </tr>
269        <tr>        <tr>
270          <td><code>change_amp_lfo_depth()</code></td>          <td><code>change_pan_time()</code></td>
271          <td>Modifies the amplitude LFO depth.</td>          <td>Changes the duration of panning (stereo balance) changes.</td>
       </tr>  
       <tr>  
         <td><code>change_amp_lfo_freq()</code></td>  
         <td>Modifies the amplitude LFO frequency.</td>  
272        </tr>        </tr>
273        <tr>        <tr>
274          <td><code>change_pitch_lfo_depth()</code></td>          <td><code>change_pitch_lfo_depth()</code></td>
# Line 195  Line 279 
279          <td>Modifies the pitch LFO frequency.</td>          <td>Modifies the pitch LFO frequency.</td>
280        </tr>        </tr>
281        <tr>        <tr>
282            <td><code>change_play_pos()</code></td>
283            <td>Change the sample playback position.</td>
284          </tr>
285          <tr>
286            <td><code>change_release()</code></td>
287            <td>Modifies the amplitude release time of voices.</td>
288          </tr>
289          <tr>
290            <td><code>change_reso()</code></td>
291            <td>Changes filter resonance of voices.</td>
292          </tr>
293          <tr>
294            <td><code>change_sustain()</code></td>
295            <td>Modifies the amplitude sustain level of voices.</td>
296          </tr>
297          <tr>
298            <td><code>change_tune()</code></td>
299            <td>Changes the tuning of voices.</td>
300          </tr>
301          <tr>
302            <td><code>change_tune_curve()</code></td>
303            <td>Changes the curve type of tuning changes.</td>
304          </tr>
305          <tr>
306            <td><code>change_tune_time()</code></td>
307            <td>Changes the duration of tuning changes.</td>
308          </tr>
309          <tr>
310          <td><code>change_velo()</code></td>          <td><code>change_velo()</code></td>
311          <td>Change MIDI velocity of note.</td>          <td>Change MIDI velocity of note.</td>
312        </tr>        </tr>
313        <tr>        <tr>
314            <td><code>change_vol()</code></td>
315            <td>Changes the volume of voices.</td>
316          </tr>
317          <tr>
318            <td><code>change_vol_curve()</code></td>
319            <td>Changes the curve type of volume changes.</td>
320          </tr>
321          <tr>
322            <td><code>change_vol_time()</code></td>
323            <td>Changes the duration of volume changes.</td>
324          </tr>
325          <tr>
326            <td><code>delete_event_mark()</code></td>
327            <td>Removes an event from some event group.</td>
328          </tr>
329          <tr>
330          <td><code>event_status()</code></td>          <td><code>event_status()</code></td>
331          <td>Checks and returns whether a particular note is still alive.</td>          <td>Checks and returns whether a particular note is still alive.</td>
332        </tr>        </tr>
# Line 215  Line 343 
343          <td>Get the current value of a specific note parameter.</td>          <td>Get the current value of a specific note parameter.</td>
344        </tr>        </tr>
345        <tr>        <tr>
346          <td><code>set_event_par()</code></td>          <td><code>ignore_controller()</code></td>
347          <td>Change the value of a specific note parameter.</td>          <td>Drops the given MIDI control change event.</td>
       </tr>  
       <tr>  
         <td><code>set_controller()</code></td>  
         <td>Creates a MIDI control change event.</td>  
348        </tr>        </tr>
349        <tr>        <tr>
350          <td><code>ignore_event()</code></td>          <td><code>ignore_event()</code></td>
351          <td>Drops the given event.</td>          <td>Drops the given event.</td>
352        </tr>        </tr>
353        <tr>        <tr>
         <td><code>ignore_controller()</code></td>  
         <td>Drops the given MIDI control change event.</td>  
       </tr>  
       <tr>  
354          <td><code>note_off()</code></td>          <td><code>note_off()</code></td>
355          <td>Releases the requested note.</td>          <td>Releases the requested note.</td>
356        </tr>        </tr>
357        <tr>        <tr>
358            <td><code>play_note()</code></td>
359            <td>Triggers a new note.</td>
360          </tr>
361          <tr>
362            <td><code>set_controller()</code></td>
363            <td>Creates a MIDI control change event.</td>
364          </tr>
365          <tr>
366          <td><code>set_event_mark()</code></td>          <td><code>set_event_mark()</code></td>
367          <td>Adds an event to an event group.</td>          <td>Adds an event to an event group.</td>
368        </tr>        </tr>
369        <tr>        <tr>
370          <td><code>delete_event_mark()</code></td>          <td><code>set_event_par()</code></td>
371          <td>Removes an event from some event group.</td>          <td>Change the value of a specific note parameter.</td>
372        </tr>        </tr>
373        <tr>        <tr>
374          <td><code>by_marks()</code></td>          <td><code>set_nrpn()</code></td>
375          <td>Returns all events of an event group.</td>          <td>Creates a MIDI NRPN event.</td>
376          </tr>
377          <tr>
378            <td><code>set_rpn()</code></td>
379            <td>Creates a MIDI RPN event.</td>
380        </tr>        </tr>
381      </table>      </table>
382        
383      <h3>GigaStudio Format Functions</h3>      <h3>GigaStudio Format Functions</h3>
384      <p>      <p>
385        Sampler format specific functions, dedicated to the individual features        Sampler format specific functions, dedicated to the individual features
# Line 421  Line 553 
553          <td>Built-in constant reflecting a <code>controller</code> event handler type.</td>          <td>Built-in constant reflecting a <code>controller</code> event handler type.</td>
554        </tr>        </tr>
555        <tr>        <tr>
556            <td><code>$NI_CB_TYPE_RPN</code></td>
557            <td>Built-in constant reflecting a <code>rpn</code> event handler type.</td>
558          </tr>
559          <tr>
560            <td><code>$NI_CB_TYPE_NRPN</code></td>
561            <td>Built-in constant reflecting a <code>nrpn</code> event handler type.</td>
562          </tr>
563          <tr>
564            <td><code>$NI_MATH_E</code></td>
565            <td>Base of the natural logarithm (approximately being <code>2.71828</code>)</td>
566          </tr>
567          <tr>
568            <td><code>$NI_MATH_PI</code></td>
569            <td>Natural constant reflecting the ratio of a circle's circumference to its diameter (approximately being <code>3.14159</code>).</td>
570          </tr>
571          <tr>
572          <td><code>$NKSP_IGNORE_WAIT</code></td>          <td><code>$NKSP_IGNORE_WAIT</code></td>
573          <td>If this boolean built-in variable is <code>1</code> then all calls of your          <td>If this boolean built-in variable is <code>1</code> then all calls of your
574              event handler instance to function <code>wait()</code> will be ignored.              event handler instance to function <code>wait()</code> will be ignored.
# Line 546  Line 694 
694          <td>Used to select a fade curve with linear shape.</td>          <td>Used to select a fade curve with linear shape.</td>
695        </tr>        </tr>
696        <tr>        <tr>
697            <td><code>$RPN_ADDRESS</code></td>
698            <td>Used to get the RPN / NRPN parameter number that had been changed in a
699                <code>rpn</code> or <code>nrpn</code> event handler.</td>
700          </tr>
701          <tr>
702            <td><code>$RPN_VALUE</code></td>
703            <td>Used to get the new RPN / NRPN value in a
704                <code>rpn</code> or <code>nrpn</code> event handler.</td>
705          </tr>
706          <tr>
707          <td><code>$VCC_MONO_AT</code></td>          <td><code>$VCC_MONO_AT</code></td>
708          <td>Constant identifying the MIDI monophonic aftertouch controller (also          <td>Constant identifying the MIDI monophonic aftertouch controller (also
709              called <i title="Amount of force on held-down key.">              called <i title="Amount of force on held-down key.">
# Line 727  Line 885 
885          <td>Constant that identifies the <i>general purpose 8 MIDI controller dimension</i>.</td>          <td>Constant that identifies the <i>general purpose 8 MIDI controller dimension</i>.</td>
886        </tr>        </tr>
887      </table>      </table>
888    
889            <h2>Built-In Preprocessor Conditions</h2>
890        <p>
891          These are the built-in preprocessor conditions available with the NKSP realt-time
892          instrument script language.
893        </p>
894            
895        <h3>Core Language Preprocessor Conditions</h3>
896        <p>
897          Most fundamental NKSP built-in preprocessor conditions, independent from
898          any purpose of being used in a sampler.
899        </p>
900        <table>
901          <tr>
902            <th>Condition</th> <th>Description</th>
903          </tr>
904          <tr>
905            <td><code>NKSP_NO_MESSAGE</code></td>
906            <td>
907              By default this condition is not set. By explicitly enabling this
908              condition with <code>SET_CONDITION(NKSP_NO_MESSAGE)</code> it
909              causes all subsequent <code>message()</code> calls to be ignored
910              and filtered out on preprocessor level. See function <code>message()</code>
911              for details.
912            </td>
913          </tr>
914        </table>
915    
916    </body>    </body>
917  </html>  </html>

Legend:
Removed from v.3297  
changed lines
  Added in v.3692

  ViewVC Help
Powered by ViewVC