CoreModule
namespace CoreModule
The CoreModule serves as the backbone of the application, organizing and executing foundational logic.
It provides a centralized system for managing interactions, parameter transformations, and application state,
ensuring seamless operation and integration of various components.
Membersβ
DataManagerβ
Class representing a data manager for handling track data and UI placeholders.
ParameterManagerβ
DEFAULT_TRACK_IDβ
Default track ID used across the application.
Type: string
TRACK_IDβ
Currently active track ID. Initially set to null.
Type: string | null
PRIORITY_MAPβ
Defines priority levels for various controller types.
Type: object
DEFAULT_PRIORITYβ
Fallback priority value for undefined controller types.
Type: number
MIDI_SUPPORTEDβ
Indicates whether the browser supports the Web MIDI API.
Type: boolean
linearβ
Linear transformation (identity).
Suitable for parameters where linear scaling is appropriate.
Type: Transformation
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
forward | function | Returns the input value unchanged. |
inverse | function | Returns the input value unchanged. |
logarithmicβ
Logarithmic transformation.
Converts a normalized [0,1] value to a dB scale suitable for audio volume.
Handles edge cases by clamping input to avoid invalid logarithmic operations.
Type: Transformation
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
forward | function | Maps normalized [0,1] to dB scale. |
inverse | function | Maps dB scale back to normalized [0,1]. |
setupInteractionsβ
Sets up interactions for dynamic placeholder updates.
Initializes ButtonGroups and registers MIDI controllers if supported.
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
dataManager | DataManager | The shared DataManager instance. | ||
audioPlayer | AudioPlayer | The shared AudioPlayer instance. |
Throws:
Will log an error if Bootstrap is not loaded.
registerMenuItemsWithMIDIControllerβ
Registers all dropdown items in the initialized ButtonGroups with MIDIController.
Ensures that MIDI interactions are properly linked to the corresponding UI elements.
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
buttonGroups | Array<ButtonGroup> | List of initialized ButtonGroup instances. |
applyColorsFromTrackDataβ
Applies color configurations to the document based on track data.
Updates CSS variables and redraws UI components to reflect new colors.
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
trackData | object | The track data containing color information. |
updateKnobsFromTrackDataβ
Dynamically creates and updates knobs based on track data.
Configures UI components for sound engine parameters.
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
trackData | object | The track data containing sound engine parameters. |
Throws:
Will log an error if track data or sound engine information is missing.
initializeAppβ
Initializes the application.
Fetches track data, sets up the scene, and configures interactions.
Throws:
Will log an error if initialization fails.
initializeRootParamsβ
Initializes root parameters for the ParameterManager.
Dynamically maps parameters to the manager based on track data.
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
parameterManager | ParameterManager | Instance of the ParameterManager to configure. | ||
trackData | Object | Data for the current track. | ||
trackData.soundEngine | Object | Sound engine data for the track. | ||
trackData.soundEngine.soundEngineParams | Object | Parameters for the sound engine. |