Host Bpm Sync¶
Stl.HostBPMSync
Import¶
import "_IVLS/std-library/nodes/components/host-bpm-sync.ksp"Node: Stl.HostBPMSync¶
Uses: Init
Overview¶
Stl.HostBPMSync
Host tempo synchronization utilities for FX and modulation time/rate parameters.
Provides lookup tables and helper functions that convert normalized UI parameter values (0 to 1000000) into Kontakt sync units and human-readable display strings. Covers four parameter domains: time-based FX (delay time), rate-based FX (chorus rate), modulation rate (LFO and step sequencer), and modulation time (envelope and glide). Each domain exposes three functions: a sync unit resolver, a UI parameter value mapper, and a display string formatter.
When sync is disabled the functions pass through the raw UI value and return NI_SYNC_UNIT_ABS. When sync is enabled the UI range is divided into equal slots via a precomputed SPLIT constant and the appropriate sync table entry is returned. Rate domains use a reversed index so that higher UI values map to faster rates.
Constants¶
| Constant | Value | Description |
|---|---|---|
tempo.NUM_FX_SYNC_TIMES |
19 |
integer |
tempo.SYNC_TIME_SPLIT |
1000000 / (tempo.NUM_FX_SYNC_TIMES - 1) |
integer |
tempo.NUM_MOD_SYNC_TIMES |
34 |
integer |
tempo.MOD_SYNC_TIME_SPLIT |
1000000 / (tempo.NUM_MOD_SYNC_TIMES - 1) |
integer |
ticks.QT |
960 |
integer |
API¶
Nodes¶
| Name | Description |
|---|---|
node Stl.HostBPMSync |
Host BPM sync node providing tempo-synchronized parameter utilities for FX and m... |
Const Blocks¶
| Name | Description |
|---|---|
const Grid_Snap |
Enumeration of grid snap resolutions from no snap through whole bar down to 1/64... |
const Sync |
Enumeration of tempo-sync note values from whole notes down to 128th notes, incl... |
Functions¶
| Name | Description |
|---|---|
tempo.get_base_fx_rate_unit(sync_enabled, ui_rate_parameter) -> return |
Returns the Kontakt sync unit for a rate-based FX parameter given the current sy... |
tempo.get_base_fx_time_unit(sync_enabled, ui_time_parameter) -> return |
Returns the Kontakt sync unit for a time-based FX parameter given the current sy... |
tempo.get_base_mod_rate_unit(sync_enabled, ui_time_parameter) -> return |
Returns the Kontakt sync unit for a modulation rate parameter (LFO, step sequenc... |
tempo.get_base_mod_time_unit(sync_enabled, ui_time_parameter) -> return |
Returns the Kontakt sync unit for a modulation time parameter (envelope, glide) ... |
tempo.get_ui_fx_rate_display_string(ui_rate_parameter) -> return |
Returns the display string for a rate-based FX parameter from the fx_sync_string... |
tempo.get_ui_fx_rate_parameter(sync_enabled, ui_rate_parameter) -> return |
Returns the Kontakt parameter value for a rate-based FX UI control given the cur... |
tempo.get_ui_fx_time_display_string(ui_time_parameter) -> return |
Returns the display string for a time-based FX parameter from the fx_sync_string... |
tempo.get_ui_fx_time_parameter(sync_enabled, ui_time_parameter) -> return |
Returns the Kontakt parameter value for a time-based FX UI control given the cur... |
tempo.get_ui_mod_rate_display_string(ui_rate_parameter) -> return |
Returns the display string for a modulation rate parameter from the mod_sync_str... |
tempo.get_ui_mod_rate_parameter(sync_enabled, ui_rate_parameter) -> return |
Returns the Kontakt parameter value for a modulation rate UI control given the c... |
tempo.get_ui_mod_time_display_string(ui_time_parameter) -> return |
Returns the display string for a modulation time parameter from the mod_sync_str... |
tempo.get_ui_mod_time_parameter(sync_enabled, ui_time_parameter) -> return |
Returns the Kontakt parameter value for a modulation time UI control given the c... |
Nodes¶
node Stl.HostBPMSync¶
Callbacks: Init
Host BPM sync node providing tempo-synchronized parameter utilities for FX and modulation.
Const Blocks¶
const Grid_Snap¶
Enumeration of grid snap resolutions from no snap through whole bar down to 1/64 triplet.
const Sync¶
Enumeration of tempo-sync note values from whole notes down to 128th notes, including dotted and triplet subdivisions.
Functions¶
tempo.get_base_fx_rate_unit(sync_enabled, ui_rate_parameter) -> return¶
Returns the Kontakt sync unit for a rate-based FX parameter given the current sync state and UI value.
| Parameter | Type | Description |
|---|---|---|
sync_enabled |
integer | Whether host tempo sync is active (TRUE or FALSE) |
ui_rate_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — NI_SYNC_UNIT_ABS when sync is disabled; otherwise the sync unit from the reversed fx_sync_unit table
tempo.get_base_fx_time_unit(sync_enabled, ui_time_parameter) -> return¶
Returns the Kontakt sync unit for a time-based FX parameter given the current sync state and UI value.
| Parameter | Type | Description |
|---|---|---|
sync_enabled |
integer | Whether host tempo sync is active (TRUE or FALSE) |
ui_time_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — NI_SYNC_UNIT_ABS when sync is disabled; otherwise the sync unit from the fx_sync_unit table
tempo.get_base_mod_rate_unit(sync_enabled, ui_time_parameter) -> return¶
Returns the Kontakt sync unit for a modulation rate parameter (LFO, step sequencer) given the current sync state and UI value.
| Parameter | Type | Description |
|---|---|---|
sync_enabled |
integer | Whether host tempo sync is active (TRUE or FALSE) |
ui_time_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — NI_SYNC_UNIT_ABS when sync is disabled; otherwise the sync unit from the mod_sync_unit table
tempo.get_base_mod_time_unit(sync_enabled, ui_time_parameter) -> return¶
Returns the Kontakt sync unit for a modulation time parameter (envelope, glide) given the current sync state and UI value.
| Parameter | Type | Description |
|---|---|---|
sync_enabled |
integer | Whether host tempo sync is active (TRUE or FALSE) |
ui_time_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — NI_SYNC_UNIT_ABS when sync is disabled; otherwise the sync unit from the reversed mod_sync_unit table
tempo.get_ui_fx_rate_display_string(ui_rate_parameter) -> return¶
Returns the display string for a rate-based FX parameter from the fx_sync_strings table.
| Parameter | Type | Description |
|---|---|---|
ui_rate_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — Human-readable sync rate label such as "1/4" or "1/8 T"
tempo.get_ui_fx_rate_parameter(sync_enabled, ui_rate_parameter) -> return¶
Returns the Kontakt parameter value for a rate-based FX UI control given the current sync state and UI value.
| Parameter | Type | Description |
|---|---|---|
sync_enabled |
integer | Whether host tempo sync is active (TRUE or FALSE) |
ui_rate_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — The raw UI parameter value when sync is disabled; otherwise the inverted sync fine-tune value from the fx_sync_value table
tempo.get_ui_fx_time_display_string(ui_time_parameter) -> return¶
Returns the display string for a time-based FX parameter from the fx_sync_strings table.
| Parameter | Type | Description |
|---|---|---|
ui_time_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — Human-readable sync time label such as "1/4" or "1/8 T"
tempo.get_ui_fx_time_parameter(sync_enabled, ui_time_parameter) -> return¶
Returns the Kontakt parameter value for a time-based FX UI control given the current sync state and UI value.
| Parameter | Type | Description |
|---|---|---|
sync_enabled |
integer | Whether host tempo sync is active (TRUE or FALSE) |
ui_time_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — The raw UI parameter value when sync is disabled; otherwise the sync fine-tune value from the fx_sync_value table
tempo.get_ui_mod_rate_display_string(ui_rate_parameter) -> return¶
Returns the display string for a modulation rate parameter from the mod_sync_strings table.
| Parameter | Type | Description |
|---|---|---|
ui_rate_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — Human-readable sync rate label such as "1/4" or "1/8 T"
tempo.get_ui_mod_rate_parameter(sync_enabled, ui_rate_parameter) -> return¶
Returns the Kontakt parameter value for a modulation rate UI control given the current sync state and UI value.
| Parameter | Type | Description |
|---|---|---|
sync_enabled |
integer | Whether host tempo sync is active (TRUE or FALSE) |
ui_rate_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — The raw UI parameter value when sync is disabled; otherwise the sync fine-tune value from the mod_sync_value table
tempo.get_ui_mod_time_display_string(ui_time_parameter) -> return¶
Returns the display string for a modulation time parameter from the mod_sync_strings table.
| Parameter | Type | Description |
|---|---|---|
ui_time_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — Human-readable sync time label such as "1/4" or "1/8 T"
tempo.get_ui_mod_time_parameter(sync_enabled, ui_time_parameter) -> return¶
Returns the Kontakt parameter value for a modulation time UI control given the current sync state and UI value.
| Parameter | Type | Description |
|---|---|---|
sync_enabled |
integer | Whether host tempo sync is active (TRUE or FALSE) |
ui_time_parameter |
integer | Normalized UI parameter value in range 0 to 1000000 |
Returns: return — The raw UI parameter value when sync is disabled; otherwise the inverted sync fine-tune value from the mod_sync_value table
Example¶
// TODO: Add usage example