u-he-preset-randomizer
Version:
Create random u-he synth presets through randomization and merging of your existing presets.
44 lines ⢠1.86 kB
JavaScript
/**
* @file Utility script to detect installed u-he synthesizers.
* Can be run separately with `npm run detect` to show detected synths and their paths.
*/
import chalk from 'chalk';
import { getDefaultConfig } from './config.js';
import { detectPresetLibraryLocations } from './utils/detector.js';
/**
* Detects and displays installed u-he synthesizers on the current system.
*/
function detectSynths() {
console.log(chalk.cyan.bold(`\nš Detecting installed u-he synthesizers in ${process.platform}...\n`));
const config = getDefaultConfig();
const locationsTried = [];
const detected = detectPresetLibraryLocations(config, locationsTried);
if (detected.length === 0) {
console.log(chalk.yellow('ā No u-he synthesizers found on this system.\n'));
console.log(chalk.gray('Locations tried:'));
locationsTried.forEach((location) => {
console.log(chalk.gray(` - ${location.replace('__SynthName__', '*')}`));
});
console.log();
return;
}
console.log(chalk.green(`ā
Found ${detected.length} u-he synthesizer(s):\n`));
// Group by synth name to avoid duplicates
const uniqueSynths = new Map();
detected.forEach((synth) => {
if (!uniqueSynths.has(synth.synthName)) {
uniqueSynths.set(synth.synthName, synth);
}
});
uniqueSynths.forEach((synth, name) => {
console.log(chalk.bold(` š ${name}`));
console.log(chalk.gray(` Root: ${synth.root}`));
console.log(chalk.gray(` Presets: ${synth.presets}`));
console.log(chalk.gray(` User Presets: ${synth.userPresets}`));
console.log();
});
console.log(chalk.cyan(`š” Tip: Use these synth names with the --synth flag\n`));
}
detectSynths();
//# sourceMappingURL=detect-synths.js.map