--- doc/docbase/instrument_scripts/nksp/reference/01_nksp_reference.html 2016/07/13 16:52:58 2944 +++ doc/docbase/instrument_scripts/nksp/reference/01_nksp_reference.html 2017/01/05 18:20:09 3079 @@ -28,6 +28,18 @@ Function Description + dec() + Decrements the passed integer variable by one. + + + inc() + Increments the passed integer variable by one. + + + in_range() + Checks whether a value is between two other values. + + message() Prints text to the sampler's terminal. @@ -40,6 +52,10 @@ Pauses execution for a certain amount of time. + stop_wait() + Resumes execution of a suspended script callback. + + abs() Calculates the absolute value of a given value. @@ -48,9 +64,25 @@ Random number generator. + min() + Calculates the minimum value of two given values. + + + max() + Calculates the maximum value of two given values. + + num_elements() Returns the size of the requested array variable. + + sh_left() + Calculates a left bit shifted value. + + + sh_right() + Calculates a right bit shifted value. +

Common Sampler Functions

@@ -87,6 +119,18 @@ Changes filter resonance of voices. + change_attack() + Modifies the attack time of voices. + + + change_decay() + Modifies the decay time of voices. + + + change_release() + Modifies the release time of voices. + + event_status() Checks and returns whether a particular note is still alive. @@ -224,6 +268,45 @@ + + $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. +

Common Sampler Variables

@@ -236,6 +319,22 @@ Variable Description + %ALL_EVENTS + + Note IDs of all currently active notes of the current sampler part (a.k.a. sampler channel). + This may be passed to many built-in functions like 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()). + + In contrast to KSP this variable is an integer array type, whereas KSP's + pendent of this built-in variable is an integer constant (scalar) called + $ALL_EVENTS. Using the latter with NKSP will cause a + parser warning, the behavior will be the same though. + + + + $CC_NUM MIDI controller number that caused the controller handler to be executed (only useful in the context of a