--- doc/docbase/instrument_scripts/nksp/reference/functions/nksp_same_region_function.html 2017/05/31 23:21:42 3263 +++ doc/docbase/instrument_scripts/nksp/reference/functions/nksp_same_region_function.html 2017/06/01 00:00:24 3264 @@ -68,7 +68,24 @@

Examples

-

None yet.

+

+ Note that it is also indeed valid and useful sometimes to pass the same + note number to both arguments of this function, which allows you to check + whether one certain key is mapped to a region. +

+ +on init + declare const $NO_REGION := 5 +end on + +on note + if (same_region($EVENT_NOTE, $EVENT_NOTE) = $NO_REGION) + message("Key " & $EVENT_NOTE & " does not have any sample mapped. So you won't hear anything!") + else + message("Key " & $EVENT_NOTE & " is mapped to a region, and thus you should hear its sample now.") + end if +end on +

Availability

Since LinuxSampler 2.0.0.svn53.