synthesizer.data.initialise¶
A module containing classes and functions for initializing Synthesizer.
- This module runs at first import or on-demand to:
Create the user data directory and subdirectories
Copy default resource files (unit config, ID databases)
Set environment variables for easy access
Report status with colored symbols and ASCII art
NOTE: This module only uses standard library and importlib.resources; it must not import other Synthesizer modules to avoid circular dependencies.
Functions
- synthesizer.data.initialise.base_dir_exists()[source]¶
Check if the Synthesizer base directory exists.
This function checks if the Synthesizer base directory, as defined by get_base_dir(), exists on the filesystem.
- Return type:
bool
- synthesizer.data.initialise.data_dir_exists()[source]¶
Check if the Synthesizer data directory exists.
This function checks if the Synthesizer data directory, as defined by get_data_dir(), exists on the filesystem.
- Return type:
bool
- synthesizer.data.initialise.database_dir_exists()[source]¶
Check if the Synthesizer database directory exists.
This function checks if the Synthesizer database directory, as defined by get_database_dir(), exists on the filesystem.
- Return type:
bool
- synthesizer.data.initialise.get_base_dir()[source]¶
Get the Synthesizer base directory path.
This function returns the path to the Synthesizer base directory, which is determined using platformdirs.user_data_dir.
- Return type:
Path
- synthesizer.data.initialise.get_data_dir()[source]¶
Get the Synthesizer data directory path.
This function returns the path to the Synthesizer data directory, which is determined using platformdirs.user_data_dir with an added ‘data’ subdirectory.
- Return type:
Path
- synthesizer.data.initialise.get_database_dir()[source]¶
Get the Synthesizer database directory path.
This function returns the path to the Synthesizer database directory, which is a subdirectory of the Synthesizer data directory.
- Return type:
Path
- synthesizer.data.initialise.get_grids_dir()[source]¶
Get the Synthesizer grids directory path.
This function returns the path to the Synthesizer grids directory, which is a subdirectory of the Synthesizer data directory.
- Return type:
Path
- synthesizer.data.initialise.get_instrument_dir()[source]¶
Get the Synthesizer instrument cache directory path.
This function returns the path to the Synthesizer instrument cache directory, which is a subdirectory of the Synthesizer data directory.
- Return type:
Path
- synthesizer.data.initialise.get_test_data_dir()[source]¶
Get the Synthesizer test data directory path.
This function returns the path to the Synthesizer test data directory, which is a subdirectory of the Synthesizer data directory.
- Return type:
Path
- synthesizer.data.initialise.grids_dir_exists()[source]¶
Check if the Synthesizer grids directory exists.
This function checks if the Synthesizer grids directory, as defined by get_grids_dir(), exists on the filesystem.
- Return type:
bool
- synthesizer.data.initialise.instrument_cache_exists()[source]¶
Check if the Synthesizer instrument cache directory exists.
This function checks if the Synthesizer instrument cache directory, as defined by get_instrument_dir(), exists on the filesystem.
- Return type:
bool
- synthesizer.data.initialise.synth_clear_data()[source]¶
Clear the Synthesizer data directory.
This function removes the entire Synthesizer data directory and its contents. It is useful for resetting the environment or clearing cached data.
- Return type:
None
- synthesizer.data.initialise.synth_initialise()[source]¶
Run the Synthesizer initialization process.
This function runs the initialisation process. It creates the necessary directories, copies default files, sets environment variables, and prints a report.
- Return type:
None
- synthesizer.data.initialise.testdata_dir_exists()[source]¶
Check if the Synthesizer test data directory exists.
This function checks if the Synthesizer test data directory, as defined by get_test_data_dir(), exists on the filesystem.
- Return type:
bool
Classes
- class synthesizer.data.initialise.SynthesizerInitializer[source]¶
Encapsulates the initialisation of the Synthesizer data directory.
This class handles the creation of the Synthesizer data directory and its subdirectories, and copies default resource files into the data directory.
This should not be instantiated directly (though there is no nasty side effect of doing so). It is intended to be used via the synth_initialise() function, which will create an instance and run the initialization process. This function is both an entry point that be specifically invoked and automatically called on import if the data directory does not exist.