Constructor
new AbletonPrefs(path) → {Promise.<AbletonPrefs>}
Parameters:
| Name | Type | Description |
|---|---|---|
path |
string | Absolute path to the Ableton Live preferences file. |
- Source:
Throws:
-
When the file does not exist or cannot be read.
- Type
- Error
Returns:
A fully initialised AbletonPrefs instance.
- Type
- Promise.<AbletonPrefs>
Example
const prefs = await new AbletonPrefs('/path/to/Ableton/Live 12.0.0/Preferences.cfg')
console.log(prefs.PluginConfig)
Classes
Members
PluginConfig :PluginConfig
Aggregated plug-in configuration parsed from the preferences file. Triggers parsing of VST3, VST2, and AU sections on first access.
Type:
- Source:
bytes :Uint8Array
The raw bytes of the preferences file as a Uint8Array.
Type:
- Uint8Array
- Source:
Methods
bytesToStringArr(bytes, optionsopt) → {Array.<string>}
Converts a Uint8Array (or any byte-like array) to an array of strings where
printable ASCII characters (32–126) are represented as themselves and all other
bytes are represented as hex escape sequences (e.g. \x0f).
Parameters:
| Name | Type | Attributes | Default | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bytes |
Uint8Array | The bytes to convert. |
|||||||||||||||||
options |
Object |
<optional> |
{} | Formatting options. Properties
|
- Source:
Returns:
Array of character or hex-escape strings, one element per byte.
- Type
- Array.<string>
extractVst2CustomPath(bytes) → {string|undefined}
Extracts a VST2 custom search path from a byte slice of the preferences file.
Note: This method currently fails on Windows.
Parameters:
| Name | Type | Description |
|---|---|---|
bytes |
Uint8Array | A byte slice starting at the second |
- Source:
Returns:
The extracted path string, or undefined when no custom path is found.
- Type
- string | undefined
extractVst3CustomPath(bytes) → {string|false}
Extracts a VST3 custom search path from a byte slice of the preferences file. Works for both macOS and Windows preferences files.
Windows example: Vst3Preferences\x02\x01\x01)C:/Users/aniso/OneDrive/Desktop/hack/vst3\x15
macOS example: Vst3Preferences\x02\x01\x01#/Users/jeff/Desktop/tmp/vst3-custom\x15
Parameters:
| Name | Type | Description |
|---|---|---|
bytes |
Uint8Array | A byte slice starting at the |
- Source:
Returns:
The extracted path string, or false when no custom path is set.
- Type
- string | false
findAllOccurrences(needle, bytes) → {Array.<number>}
Finds all byte-offsets at which the UTF-8 encoding of needle appears in bytes.
Overlapping matches are skipped (each match advances past the full pattern length).
Parameters:
| Name | Type | Description |
|---|---|---|
needle |
string | The string pattern to search for. |
bytes |
Uint8Array | The buffer to search within. |
- Source:
Returns:
Array of starting byte offsets where needle was found.
- Type
- Array.<number>
getAuConfiguration() → {AuPluginConfig}
Parses and returns the Audio Unit configuration from the preferences file.
- Source:
Returns:
- Type
- AuPluginConfig
getVst2Configuration() → {VstPluginConfig}
Parses and returns the VST2 plug-in configuration from the preferences file.
Note: This method currently fails on Windows. Edge cases not yet handled:
- VST2 system path disabled but custom directory enabled
- VST2 system path enabled but custom directory disabled
- Source:
Returns:
- Type
- VstPluginConfig
getVst3Configuration() → {VstPluginConfig}
Parses and returns the VST3 plug-in configuration from the preferences file.
- Source:
Throws:
-
When the byte at index 15 of the VST3 segment has an unexpected value.
- Type
- Error
Returns:
- Type
- VstPluginConfig