79 |
<td>Changes the volume of voices.</td> |
<td>Changes the volume of voices.</td> |
80 |
</tr> |
</tr> |
81 |
<tr> |
<tr> |
82 |
|
<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 |
<td><code>set_controller()</code></td> |
<td><code>set_controller()</code></td> |
95 |
<td>Creates a MIDI control change event.</td> |
<td>Creates a MIDI control change event.</td> |
96 |
</tr> |
</tr> |
140 |
These are the built-in variables and built-in constants available with the |
These are the built-in variables and built-in constants available with the |
141 |
NKSP realt-time instrument script language. |
NKSP realt-time instrument script language. |
142 |
</p> |
</p> |
143 |
|
|
144 |
|
<h3>Core Language Variables</h3> |
145 |
|
<p> |
146 |
|
Most fundamental NKSP built-in variables, independent from any purpose of |
147 |
|
being used in a sampler. |
148 |
|
</p> |
149 |
|
<table> |
150 |
|
<tr> |
151 |
|
<th>Variable</th> <th>Description</th> |
152 |
|
</tr> |
153 |
|
<tr> |
154 |
|
<td><code>$KSP_TIMER</code></td> |
155 |
|
<td>Preserved for compatiblity reasons with KSP, returns the same value |
156 |
|
as <code>$NKSP_REAL_TIMER</code> (refer to the latter for details). |
157 |
|
Note that KSP's <code>reset_ksp_timer()</code> function is not available with |
158 |
|
NKSP. However when calculating time differences between two time |
159 |
|
stamps taken with <code>$NKSP_REAL_TIMER</code>, calling such a reset |
160 |
|
function is not required, because the underlying clock does not stop |
161 |
|
when it reached its value limit (which happens every 71 minutes), instead the clock |
162 |
|
will automatically restart from zero and the calculated time difference |
163 |
|
even between such transitions will reflect correct durations.</td> |
164 |
|
</tr> |
165 |
|
<tr> |
166 |
|
<td><code>$NKSP_PERF_TIMER</code></td> |
167 |
|
<td>Returns the current performance time stamp (in microseconds) of the |
168 |
|
script running. You may read this variable from time to time to take |
169 |
|
time stamps which can be used to calculate the time difference |
170 |
|
(in microseconds) which elapsed between them. A performance time |
171 |
|
stamp is based on the script's actual CPU execution time. So the |
172 |
|
internal clock which is used for generating such time stamps is only |
173 |
|
running forward if the respective script is actually executed by the |
174 |
|
CPU. Whenever your script is not really executed by the CPU (i.e. because |
175 |
|
your script got suspended by a wait() call or got forcely suspended due to |
176 |
|
real-time constraints, or when the entire sampler application got suspended |
177 |
|
by the OS for other applications or OS tasks) then the underlying internal |
178 |
|
clock is paused as well. |
179 |
|
<note class="important"> |
180 |
|
You should only use this built-in variable for script development |
181 |
|
purposes (i.e. for bench marking the performance of your script). |
182 |
|
You should <b>not</b> use it with your final production sounds! |
183 |
|
It is not appropriate for being used in a musical context, because |
184 |
|
when an offline bounce is performed for instance, the musical timing |
185 |
|
will be completely unrelated to the CPU execution time. Plus using |
186 |
|
this variable may cause audio drop outs on some systems. In a musical |
187 |
|
context you should use <code>$ENGINE_UPTIME</code> instead, which is |
188 |
|
also safe for offline bounces. |
189 |
|
</note> |
190 |
|
<note> |
191 |
|
On some systems <code>$NKSP_REAL_TIMER</code> and |
192 |
|
<code>$NKSP_PERF_TIMER</code> will actually return the same value. So the |
193 |
|
difference between them is not implemented for all systems at the moment. |
194 |
|
</note> |
195 |
|
</td> |
196 |
|
</tr> |
197 |
|
<tr> |
198 |
|
<td><code>$NKSP_REAL_TIMER</code></td> |
199 |
|
<td>Returns the current time stamp in reality (in microseconds). You may |
200 |
|
read this variable from time to time to take |
201 |
|
time stamps which can be used to calculate the time difference |
202 |
|
(in microseconds) which elapsed between them. A "real" time |
203 |
|
stamp is based on an internal clock which constantly proceeds, so this |
204 |
|
internal clock also continues counting while your script is either suspended |
205 |
|
(i.e. because your script got suspended by a wait() call or got forcely |
206 |
|
suspended due to real-time constraints) and it also continues counting |
207 |
|
even if the entire sampler application got suspended by the OS (i.e. to |
208 |
|
execute other applications for multi-tasking or to perform OS tasks). |
209 |
|
<note class="important"> |
210 |
|
You should only use this built-in variable for script development |
211 |
|
purposes (i.e. for bench marking the performance of your script). |
212 |
|
You should <b>not</b> use it with your final production sounds! |
213 |
|
It is not appropriate for being used in a musical context, because |
214 |
|
when an offline bounce is performed for instance, the musical timing |
215 |
|
will be completely unrelated to the CPU execution time. Plus using |
216 |
|
this variable may cause audio drop outs on some systems. In a musical |
217 |
|
context you should use <code>$ENGINE_UPTIME</code> instead, which is |
218 |
|
also safe for offline bounces. |
219 |
|
</note> |
220 |
|
<note> |
221 |
|
On some systems <code>$NKSP_REAL_TIMER</code> and |
222 |
|
<code>$NKSP_PERF_TIMER</code> will actually return the same value. So the |
223 |
|
difference between them is not implemented for all systems at the moment. |
224 |
|
</note> |
225 |
|
</td> |
226 |
|
</tr> |
227 |
|
</table> |
228 |
|
|
229 |
<h3>Common Sampler Variables</h3> |
<h3>Common Sampler Variables</h3> |
230 |
<p> |
<p> |
231 |
Basic sampler related built-in variables and constants, independent from a |
Basic sampler related built-in variables and constants, independent from a |
269 |
<code>note</code> or <code>release</code> handler).</td> |
<code>note</code> or <code>release</code> handler).</td> |
270 |
</tr> |
</tr> |
271 |
<tr> |
<tr> |
272 |
|
<td><code>$EVENT_STATUS_INACTIVE</code></td> |
273 |
|
<td>Constant bit flag used as possible return value by |
274 |
|
<code>event_status()</code> in case the requested |
275 |
|
note is not "alive".</td> |
276 |
|
</tr> |
277 |
|
<tr> |
278 |
|
<td><code>$EVENT_STATUS_NOTE_QUEUE</code></td> |
279 |
|
<td>Constant bit flag used as possible return value by |
280 |
|
<code>event_status()</code> in case the requested |
281 |
|
note is still "alive".</td> |
282 |
|
</tr> |
283 |
|
<tr> |
284 |
<td><code>%KEY_DOWN[]</code></td> |
<td><code>%KEY_DOWN[]</code></td> |
285 |
<td>This can be used in any context to check whether a certain MIDI |
<td>This can be used in any context to check whether a certain MIDI |
286 |
key is currently pressed down. Use the respective MIDI note number |
key is currently pressed down. Use the respective MIDI note number |
287 |
as index to this array variable.</td> |
as index to this array variable (see also <code>event_status()</code>).</td> |
288 |
</tr> |
</tr> |
289 |
<tr> |
<tr> |
290 |
<td><code>$VCC_MONO_AT</code></td> |
<td><code>$VCC_MONO_AT</code></td> |
304 |
This is somewhat different than in the MIDI standard. With |
This is somewhat different than in the MIDI standard. With |
305 |
NKSP pitch bend is handled like an additional "regular" MIDI CC controller. |
NKSP pitch bend is handled like an additional "regular" MIDI CC controller. |
306 |
Therefore use |
Therefore use |
307 |
<code>%CC[$VCC_PITCH_BEND]</code> to obtain the current aftertouch value |
<code>%CC[$VCC_PITCH_BEND]</code> to obtain the current pitch bend wheel value |
308 |
in the context of a <code>controller</code> event handler.</td> |
in the context of a <code>controller</code> event handler.</td> |
309 |
</tr> |
</tr> |
310 |
<tr> |
<tr> |
312 |
<td>Used to select one of the available 28 event groups. |
<td>Used to select one of the available 28 event groups. |
313 |
See <code>set_event_mark()</code> for details.</td> |
See <code>set_event_mark()</code> for details.</td> |
314 |
</tr> |
</tr> |
315 |
|
<tr> |
316 |
|
<td><code>$ENGINE_UPTIME</code></td> |
317 |
|
<td>Returns the current time stamp (in milliseconds) for being |
318 |
|
used in a musical context. You may read this variable from time to time |
319 |
|
to take time stamps which can be used to calculate the time difference |
320 |
|
(in milliseconds) which elapsed between them. These timing values are |
321 |
|
based on the internal sample rate and thus it can safely be used to |
322 |
|
perform musical timing related tasks in your scripts. Especially |
323 |
|
your script will also continue to behave correctly when an offline bounce |
324 |
|
of a song is performed. |
325 |
|
</td> |
326 |
|
</tr> |
327 |
</table> |
</table> |
328 |
|
|
329 |
<h3>GigaStudio Format Variables</h3> |
<h3>GigaStudio Format Variables</h3> |