# Zone Parameters

## Zone Parameters

These set the parameters for the user zones via KSP in the same manner and ranges as available on the mapping editor. They can be set with the set_zone_par(<zone-id>,<parameter>,<value>) function and retrieved with the get_zone_par(<zone-id>,<parameter>) function. When the zones are declared, all these parameters are set to 0 by default.

$ZONE_PAR_HIGH_KEY Sets the high key for the zone. Range: 0 to 127 $ZONE_PAR_LOW_KEY

Sets the low key of the zone. Range: 0 to 127

$ZONE_PAR_HIGH_VELO Sets the maximum velocity response of the zone. Range: 1 to 127 $ZONE_PAR_LOW_VELO

Sets the minimum velocity response of the zone. Range: 1 to 127

$ZONE_PAR_ROOT_KEY Sets the root key of the zone. Range: 0 to 127 $ZONE_PAR_FADE_LOW_KEY

Optionally use this parameter to create zone crossfades. The value is set in the form of a distance to the $ZONE_PAR_LOW_KEY. Range: $ZONE_PAR_HIGH_KEY - $ZONE_PAR_LOW_KEY + 1 $ZONE_PAR_FADE_HIGH_KEY

Optionally use this parameter to create zone crossfades. The value is set in the form of a distance to the $ZONE_PAR_HIGH_KEY. Range: $ZONE_PAR_HIGH_KEY - $ZONE_PAR_LOW_KEY + 1 $ZONE_PAR_FADE_LOW_VELO

Optionally use this parameter to create zone crossfades. The value is set in the form of a distance to the $$ZONE_PAR_LOW_VELO.

Range: $ZONE_PAR_HIGH_VELO -$ZONE_PAR_LOW_VELO + 1

$ZONE_PAR_FADE_HIGH_VELO Optionally use this parameter to create zone crossfades. The value is set in the form of a distance to the $ZONE_PAR_HIGH_VELO.

Range: $ZONE_PAR_HIGH_VELO -$ZONE_PAR_LOW_VELO + 1

$ZONE_PAR_VOLUME Sets the volume of the zone. Range: -3600 to 3600 $ZONE_PAR_PAN

Sets the panning of the zone. Range: -1000 to 1000

$ZONE_PAR_TUNE Sets the tuning of the zone. Range: -3600 to 3600 $ZONE_PAR_GROUP

Sets the group of the user zone. By default a user zone is placed in group 0.

#### Examples

set_num_user_zones(4)
set_zone_par(%NI_USER_ZONE_IDS[0], $ZONE_PAR_GROUP, 30) set_zone_par(%NI_USER_ZONE_IDS[1],$ZONE_PAR_GROUP, 31)
set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_GROUP, 72) set_zone_par(%NI_USER_ZONE_IDS[3],$ZONE_PAR_GROUP, 73)

$ZONE_PAR_SAMPLE_START Sets the sample start value of the sample attached to the zone. $ZONE_PAR_SAMPLE_END

Sets the sample end value of the sample attached to the zone.

$ZONE_PAR_SAMPLE_MOD_RANGE User zone loop parameters work in the same manner as manually setting loops via the wave editor. ## Loop Parameters $LOOP_PAR_MODE

The Loop Mode of the selected loop within the zone. Range: 0 to 4

0: Loop off

1: Loop until end, alternate off

2: Loop until end, alternate on

3: Loop until release, alternate off

4: Loop until release, alternate on

#### Examples

on ui_control($SampleLoopOn) wait_async(set_loop_par(%NI_USER_ZONE_IDS[2], 0, ...$LOOP_PAR_MODE, $SampleLoopOn)) end on $LOOP_PAR_START

The starting point in samples of the selected loop within the zone. If this parameter is not the loop will start at the beginning of the sample.

$LOOP_PAR_LENGTH The loop length in samples of the selected loop within the zone. If this parameter is not set the loop length will correspond to the entire sample. $LOOP_PAR_XFADE

The crossfade value in microseconds for the selected loop within the zone.

$LOOP_PAR_COUNT The number of times the selected loop within the zone will repeat. If this parameter is not set (or is set to 0), the loop will continue indefinitely. $LOOP_PAR_TUNING

Sets the tuning offset inside the loop area for the selected loop within the zone, applied on the first repeat of the loop, and for all successive repeats (as defined by $LOOP_PAR_COUNT). ## Sample Parameters $NI_FILE_NAME

The file name of a zone’s sample (corresponds to the zone name)

$NI_FILE_FULL_PATH The full path of a zone’s sample (same result as without the parameter) $NI_FILE_FULL_PATH_OS

The full OS path of a zone’s sample (uses backslashes on Windows)

\$NI_FILE_EXTENSION

The file extension of a zone’s sample (without the dot)