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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2936 - (hide annotations) (download) (as text)
Sun Jul 10 14:44:04 2016 UTC (7 years, 8 months ago) by schoenebeck
File MIME type: text/html
File size: 13252 byte(s)
* NKSP: Added built-in script function "change_cutoff()".
* NKSP: Added built-in script function "change_reso()".
* NKSP: Added built-in script function "event_status()".
* NKSP language tour: Added bitwise operators.

1 schoenebeck 2732 <html>
2     <head>
3     <meta name="author" content="Christian Schoenebeck">
4     <title>NKSP Reference</title>
5     <urlpath>Reference</urlpath>
6     <navpath>Reference Manual</navpath>
7     <meta name="description" content="Reference documentation of the NKSP real-time instrument script language.">
8     </head>
9     <body>
10     <h1>NKSP Reference</h1>
11     <p>
12     This document gives you an overview of all built-in functions and built-in
13     variables provided by the NKSP real-time instrument script language.
14     </p>
15    
16     <h2>Built-In Functions</h2>
17     <p>
18     These are the built-in functions available with the NKSP realt-time
19     instrument script language.
20     </p>
21    
22     <h3>Core Language Functions</h3>
23     <p>
24     Most fundamental NKSP functions, independent from any purpose of being used in a sampler.
25     </p>
26     <table>
27     <tr>
28     <th>Function</th> <th>Description</th>
29     </tr>
30     <tr>
31 schoenebeck 2742 <td><code lang="nksp">message()</code></td>
32 schoenebeck 2732 <td>Prints text to the sampler's terminal.</td>
33     </tr>
34     <tr>
35     <td><code>exit()</code></td>
36     <td>Stops execution of the current event handler instance.</td>
37     </tr>
38     <tr>
39     <td><code>wait()</code></td>
40     <td>Pauses execution for a certain amount of time.</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>random()</code></td>
48     <td>Random number generator.</td>
49     </tr>
50     <tr>
51     <td><code>num_elements()</code></td>
52     <td>Returns the size of the requested array variable.</td>
53     </tr>
54     </table>
55    
56     <h3>Common Sampler Functions</h3>
57     <p>
58     Basic sampler related functions, independent from a particular sampler
59     format or sampler engine.
60     </p>
61     <table>
62     <tr>
63     <th>Function</th> <th>Description</th>
64     </tr>
65     <tr>
66     <td><code>play_note()</code></td>
67     <td>Triggers a new note.</td>
68     </tr>
69     <tr>
70 schoenebeck 2932 <td><code>change_pan()</code></td>
71     <td>Changes panning of voices (stereo balance).</td>
72     </tr>
73     <tr>
74     <td><code>change_tune()</code></td>
75     <td>Changes the tuning of voices.</td>
76     </tr>
77     <tr>
78     <td><code>change_vol()</code></td>
79     <td>Changes the volume of voices.</td>
80     </tr>
81     <tr>
82 schoenebeck 2936 <td><code>change_cutoff()</code></td>
83     <td>Changes filter cutoff frequency of voices.</td>
84     </tr>
85     <tr>
86     <td><code>change_reso()</code></td>
87     <td>Changes filter resonance of voices.</td>
88     </tr>
89     <tr>
90     <td><code>event_status()</code></td>
91     <td>Checks and returns whether a particular note is still alive.</td>
92     </tr>
93     <tr>
94 schoenebeck 2732 <td><code>set_controller()</code></td>
95     <td>Creates a MIDI control change event.</td>
96     </tr>
97     <tr>
98     <td><code>ignore_event()</code></td>
99     <td>Drops the given event.</td>
100     </tr>
101     <tr>
102     <td><code>ignore_controller()</code></td>
103     <td>Drops the given MIDI control change event.</td>
104     </tr>
105     <tr>
106     <td><code>note_off()</code></td>
107     <td>Releases the requested note.</td>
108     </tr>
109     <tr>
110     <td><code>set_event_mark()</code></td>
111     <td>Adds an event to an event group.</td>
112     </tr>
113     <tr>
114     <td><code>delete_event_mark()</code></td>
115     <td>Removes an event from some event group.</td>
116     </tr>
117     <tr>
118     <td><code>by_marks()</code></td>
119     <td>Returns all events of an event group.</td>
120     </tr>
121     </table>
122    
123     <h3>GigaStudio Format Functions</h3>
124     <p>
125     Sampler format specific functions, dedicated to the individual features
126     of the GigaStudio format engine.
127     </p>
128     <table>
129     <tr>
130     <th>Function</th> <th>Description</th>
131     </tr>
132     <tr>
133     <td><code>gig_set_dim_zone()</code></td>
134     <td>Changes the currently active dimension zone.</td>
135     </tr>
136     </table>
137    
138     <h2>Built-In Variables</h2>
139     <p>
140     These are the built-in variables and built-in constants available with the
141     NKSP realt-time instrument script language.
142     </p>
143    
144     <h3>Common Sampler Variables</h3>
145     <p>
146     Basic sampler related built-in variables and constants, independent from a
147     particular sampler format or sampler engine.
148     </p>
149     <table>
150     <tr>
151     <th>Variable</th> <th>Description</th>
152     </tr>
153     <tr>
154     <td><code>$CC_NUM</code></td>
155     <td>MIDI controller number that caused the <code>controller</code>
156     handler to be executed (only useful in the context of a
157     <code>controller</code> handler).</td>
158     </tr>
159     <tr>
160     <td><code>%CC[]</code></td>
161     <td>Provides access to all current MIDI controller values. This can be
162     used in any context. Use the respective MIDI controller number as
163     index to this integer array variable. For instance <code>%CC[1]</code>
164     would give you the current value of the modulation wheel.
165     </td>
166     </tr>
167     <tr>
168     <td><code>$EVENT_ID</code></td>
169     <td>ID of the event that caused the current event handler to be executed. In
170     the context of a <code>note</code> handler this would be the event
171     ID of the note, within a <code>controller</code> handler it would
172     be the controller event ID, etc.</td>
173     </tr>
174     <tr>
175     <td><code>$EVENT_NOTE</code></td>
176     <td>MIDI note number that caused a note related
177     handler to be executed (only useful in the context of a
178     <code>note</code> or <code>release</code> handler).</td>
179     </tr>
180     <tr>
181     <td><code>$EVENT_VELOCITY</code></td>
182     <td>MIDI velocity value of the note that caused that note related
183     handler to be executed (only useful in the context of a
184     <code>note</code> or <code>release</code> handler).</td>
185     </tr>
186     <tr>
187     <td><code>%KEY_DOWN[]</code></td>
188     <td>This can be used in any context to check whether a certain MIDI
189     key is currently pressed down. Use the respective MIDI note number
190 schoenebeck 2936 as index to this array variable (see also <code>event_status()</code>).</td>
191 schoenebeck 2732 </tr>
192     <tr>
193     <td><code>$VCC_MONO_AT</code></td>
194     <td>Constant identifying the MIDI monophonic aftertouch controller (also
195     called <i title="Amount of force on held-down key.">
196     MIDI channel pressure
197     </i>). This is somewhat different than in the MIDI standard. With
198     NKSP aftertouch is handled like an additional "regular" MIDI CC controller.
199     Therefore use
200     <code>%CC[$VCC_MONO_AT]</code> to obtain the current aftertouch value
201     in the context of a <code>controller</code> event handler.
202     </td>
203     </tr>
204     <tr>
205     <td><code>$VCC_PITCH_BEND</code></td>
206     <td>Constant identifying the pitch bend wheel controller.
207     This is somewhat different than in the MIDI standard. With
208     NKSP pitch bend is handled like an additional "regular" MIDI CC controller.
209     Therefore use
210 schoenebeck 2936 <code>%CC[$VCC_PITCH_BEND]</code> to obtain the current pitch bend wheel value
211 schoenebeck 2732 in the context of a <code>controller</code> event handler.</td>
212     </tr>
213     <tr>
214     <td><code>$MARK_1</code> to <code>$MARK_28</code></td>
215     <td>Used to select one of the available 28 event groups.
216     See <code>set_event_mark()</code> for details.</td>
217     </tr>
218     </table>
219    
220     <h3>GigaStudio Format Variables</h3>
221     <p>
222     Sampler format specific built-in variables and constants, dedicated to the
223     individual features of the GigaStudio format engine.
224     </p>
225     <table>
226     <tr>
227     <th>Variable</th> <th>Description</th>
228     </tr>
229     <tr>
230     <td><code>$GIG_DIM_CHANNEL</code></td>
231     <td>Constant that identifies the <i>stereo dimension</i>.</td>
232     </tr>
233     <tr>
234     <td><code>$GIG_DIM_LAYER</code></td>
235     <td>Constant that identifies the <i>layer dimension</i>.</td>
236     </tr>
237     <tr>
238     <td><code>$GIG_DIM_VELOCITY</code></td>
239     <td>Constant that identifies the <i>velocity dimension</i>.</td>
240     </tr>
241     <tr>
242     <td><code>$GIG_DIM_AFTERTOUCH</code></td>
243     <td>Constant that identifies the <i>aftertouch dimension</i>.</td>
244     </tr>
245     <tr>
246     <td><code>$GIG_DIM_RELEASE</code></td>
247     <td>Constant that identifies the <i>release trigger dimension</i>.</td>
248     </tr>
249     <tr>
250     <td><code>$GIG_DIM_KEYBOARD</code></td>
251     <td>Constant that identifies the <i>keyboard position dimension</i>.</td>
252     </tr>
253     <tr>
254     <td><code>$GIG_DIM_ROUNDROBIN"</code></td>
255     <td>Constant that identifies the <i>round robin dimension</i>.</td>
256     </tr>
257     <tr>
258     <td><code>$GIG_DIM_RANDOM</code></td>
259     <td>Constant that identifies the <i>random dimension</i>.</td>
260     </tr>
261     <tr>
262     <td><code>$GIG_DIM_SMARTMIDI</code></td>
263     <td>Constant that identifies the <i>start MIDI dimension</i> (a.k.a iMIDI rules).</td>
264     </tr>
265     <tr>
266     <td><code>$GIG_DIM_ROUNDROBINKEY</code></td>
267     <td>Constant that identifies the <i>round robin key dimension</i>.</td>
268     </tr>
269     <tr>
270     <td><code>$GIG_DIM_MODWHEEL</code></td>
271     <td>Constant that identifies the <i>modulation wheel dimension</i>.</td>
272     </tr>
273     <tr>
274     <td><code>$GIG_DIM_SUSTAIN</code></td>
275     <td>Constant that identifies the <i>sustain pedal dimension</i> (a.k.a. hold pedal).</td>
276     </tr>
277     <tr>
278     <td><code>$GIG_DIM_PORTAMENTO</code></td>
279     <td>Constant that identifies the <i>portamento MIDI controller dimension</i>.</td>
280     </tr>
281     <tr>
282     <td><code>$GIG_DIM_SOSTENUTO</code></td>
283     <td>Constant that identifies the <i>sostenuto MIDI controller dimension</i>.</td>
284     </tr>
285     <tr>
286     <td><code>$GIG_DIM_SOFT</code></td>
287     <td>Constant that identifies the <i>soft pedal dimension</i>.</td>
288     </tr>
289     <tr>
290     <td><code>$GIG_DIM_BREATH</code></td>
291     <td>Constant that identifies the <i>breath controller dimension</i>.</td>
292     </tr>
293     <tr>
294     <td><code>$GIG_DIM_FOOT</code></td>
295     <td>Constant that identifies the <i>foot pedal dimension</i>.</td>
296     </tr>
297     <tr>
298     <td><code>$GIG_DIM_PORTAMENTOTIME</code></td>
299     <td>Constant that identifies the <i>portamento time controller dimension</i>.</td>
300     </tr>
301     <tr>
302     <td><code>$GIG_DIM_EFFECT1</code></td>
303     <td>Constant that identifies the <i>effect 1 MIDI controller dimension</i>.</td>
304     </tr>
305     <tr>
306     <td><code>$GIG_DIM_EFFECT2</code></td>
307     <td>Constant that identifies the <i>effect 2 MIDI controller dimension</i>.</td>
308     </tr>
309     <tr>
310     <td><code>$GIG_DIM_EFFECT1DEPTH</code></td>
311     <td>Constant that identifies the <i>effect 1 depth MIDI controller dimension</i>.</td>
312     </tr>
313     <tr>
314     <td><code>$GIG_DIM_EFFECT2DEPTH</code></td>
315     <td>Constant that identifies the <i>effect 2 depth MIDI controller dimension</i>.</td>
316     </tr>
317     <tr>
318     <td><code>$GIG_DIM_EFFECT3DEPTH</code></td>
319     <td>Constant that identifies the <i>effect 3 depth MIDI controller dimension</i>.</td>
320     </tr>
321     <tr>
322     <td><code>$GIG_DIM_EFFECT4DEPTH</code></td>
323     <td>Constant that identifies the <i>effect 4 depth MIDI controller dimension</i>.</td>
324     </tr>
325     <tr>
326     <td><code>$GIG_DIM_EFFECT5DEPTH</code></td>
327     <td>Constant that identifies the <i>effect 5 depth MIDI controller dimension</i>.</td>
328     </tr>
329     <tr>
330     <td><code>$GIG_DIM_GENPURPOSE1</code></td>
331     <td>Constant that identifies the <i>general purpose 1 MIDI controller dimension</i>.</td>
332     </tr>
333     <tr>
334     <td><code>$GIG_DIM_GENPURPOSE2</code></td>
335     <td>Constant that identifies the <i>general purpose 2 MIDI controller dimension</i>.</td>
336     </tr>
337     <tr>
338     <td><code>$GIG_DIM_GENPURPOSE3</code></td>
339     <td>Constant that identifies the <i>general purpose 3 MIDI controller dimension</i>.</td>
340     </tr>
341     <tr>
342     <td><code>$GIG_DIM_GENPURPOSE4</code></td>
343     <td>Constant that identifies the <i>general purpose 4 MIDI controller dimension</i>.</td>
344     </tr>
345     <tr>
346     <td><code>$GIG_DIM_GENPURPOSE5</code></td>
347     <td>Constant that identifies the <i>general purpose 5 MIDI controller dimension</i>.</td>
348     </tr>
349     <tr>
350     <td><code>$GIG_DIM_GENPURPOSE6</code></td>
351     <td>Constant that identifies the <i>general purpose 6 MIDI controller dimension</i>.</td>
352     </tr>
353     <tr>
354     <td><code>$GIG_DIM_GENPURPOSE7</code></td>
355     <td>Constant that identifies the <i>general purpose 7 MIDI controller dimension</i>.</td>
356     </tr>
357     <tr>
358     <td><code>$GIG_DIM_GENPURPOSE8</code></td>
359     <td>Constant that identifies the <i>general purpose 8 MIDI controller dimension</i>.</td>
360     </tr>
361     </table>
362    
363     </body>
364     </html>

  ViewVC Help
Powered by ViewVC