--- doc/docbase/instrument_scripts/nksp/reference/01_nksp_reference.html 2015/04/29 00:22:59 2742 +++ doc/docbase/instrument_scripts/nksp/reference/01_nksp_reference.html 2017/05/25 15:08:50 3215 @@ -28,6 +28,18 @@
dec()
inc()
in_range()
message()
stop_wait()
abs()
min()
max()
num_elements()
sh_left()
sh_right()
change_note()
change_pan()
change_tune()
change_tune_time()
change_vol()
change_vol_time()
change_cutoff()
change_reso()
change_attack()
change_decay()
change_release()
change_amp_lfo_depth()
change_amp_lfo_freq()
change_pitch_lfo_depth()
change_pitch_lfo_freq()
change_velo()
event_status()
fade_in()
fade_out()
get_event_par()
set_event_par()
set_controller()
+ Most fundamental NKSP built-in variables, independent from any purpose of + being used in a sampler. +
+Variable | Description | +
---|---|
$KSP_TIMER |
+ Preserved for compatiblity reasons with KSP, returns the same value
+ as $NKSP_REAL_TIMER (refer to the latter for details).
+ Note that KSP's reset_ksp_timer() function is not available with
+ NKSP. However when calculating time differences between two time
+ stamps taken with $NKSP_REAL_TIMER , calling such a reset
+ function is not required, because the underlying clock does not stop
+ when it reached its value limit (which happens every 71 minutes), instead the clock
+ will automatically restart from zero and the calculated time difference
+ even between such transitions will reflect correct durations. |
+
$NKSP_PERF_TIMER |
+ Returns the current performance time stamp (in microseconds) of the
+ script running. You may read this variable from time to time to take
+ time stamps which can be used to calculate the time difference
+ (in microseconds) which elapsed between them. A performance time
+ stamp is based on the script's actual CPU execution time. So the
+ internal clock which is used for generating such time stamps is only
+ running forward if the respective script is actually executed by the
+ CPU. Whenever your script is not really executed by the CPU (i.e. because
+ your script got suspended by a wait() call or got forcely suspended due to
+ real-time constraints, or when the entire sampler application got suspended
+ by the OS for other applications or OS tasks) then the underlying internal
+ clock is paused as well.
+ $ENGINE_UPTIME instead, which is
+ also safe for offline bounces.
+ $NKSP_REAL_TIMER and
+ $NKSP_PERF_TIMER will actually return the same value. So the
+ difference between them is not implemented for all systems at the moment.
+ |
+
$NKSP_REAL_TIMER |
+ Returns the current time stamp in reality (in microseconds). You may
+ read this variable from time to time to take
+ time stamps which can be used to calculate the time difference
+ (in microseconds) which elapsed between them. A "real" time
+ stamp is based on an internal clock which constantly proceeds, so this
+ internal clock also continues counting while your script is either suspended
+ (i.e. because your script got suspended by a wait() call or got forcely
+ suspended due to real-time constraints) and it also continues counting
+ even if the entire sampler application got suspended by the OS (i.e. to
+ execute other applications for multi-tasking or to perform OS tasks).
+ $ENGINE_UPTIME instead, which is
+ also safe for offline bounces.
+ $NKSP_REAL_TIMER and
+ $NKSP_PERF_TIMER will actually return the same value. So the
+ difference between them is not implemented for all systems at the moment.
+ |
+
$NI_CALLBACK_ID |
+ Reflects the current event handler instance's unique callback ID. + For the same event type there may be more than + one event handler instances running. Each one of them has + its own callback ID. You can get the current event handler + instance's callback ID by reading this built-in variable. | +
$NI_CALLBACK_TYPE |
+ Reflects the event type of the current event handler. This variable
+ may reflect one of the following built-in constants:
+ $NI_CB_TYPE_INIT , $NI_CB_TYPE_NOTE ,
+ $NI_CB_TYPE_RELEASE , $NI_CB_TYPE_CONTROLLER . |
+
$NI_CB_TYPE_INIT |
+ Built-in constant reflecting an init event handler type. |
+
$NI_CB_TYPE_NOTE |
+ Built-in constant reflecting a note event handler type. |
+
$NI_CB_TYPE_RELEASE |
+ Built-in constant reflecting a release event handler type. |
+
$NI_CB_TYPE_CONTROLLER |
+ Built-in constant reflecting a controller event handler type. |
+
$NKSP_IGNORE_WAIT |
+ If this boolean built-in variable is 1 then all calls of your
+ event handler instance to function wait() will be ignored.
+ This may for example be the case if another event handler instance
+ resumed your paused script by calling stop_wait() and
+ passing 1 to the 2nd argument of that function. |
+
Basic sampler related built-in variables and constants, independent from a @@ -127,6 +367,22 @@
%ALL_EVENTS
note_off()
.
+ This array variable only contains IDs of notes which were launched due
+ to MIDI note-on events. This variable does not contain IDs of child notes
+ (i.e. notes which were launched programmatically by calling play_note()
).
+ $ALL_EVENTS
. Using the latter with NKSP will cause a
+ parser warning, the behavior will be the same though.
+ $CC_NUM
controller
handler to be executed (only useful in the context of a
@@ -160,10 +416,53 @@
note
or release
handler).$EVENT_STATUS_INACTIVE
event_status()
in case the requested
+ note is not "alive".$EVENT_STATUS_NOTE_QUEUE
event_status()
in case the requested
+ note is still "alive".$EVENT_PAR_NOTE
get_event_par()
and set_event_par()
+ for details.$EVENT_PAR_TUNE
get_event_par()
and set_event_par()
+ for details.$EVENT_PAR_VELOCITY
get_event_par()
and set_event_par()
+ for details.$EVENT_PAR_VOLUME
get_event_par()
and set_event_par()
+ for details.$EVENT_PAR_0
to $EVENT_PAR_3
get_event_par()
+ and set_event_par()
for details.%KEY_DOWN[]
event_status()
).
$VCC_MONO_AT
%CC[$VCC_PITCH_BEND]
to obtain the current aftertouch value
+ %CC[$VCC_PITCH_BEND]
to obtain the current pitch bend wheel value
in the context of a controller
event handler.
set_event_mark()
for details.$ENGINE_UPTIME