Back to snippets
vstjs_vst2_plugin_load_parameters_audio_processing_quickstart.ts
typescriptThis quickstart demonstrates how to load a VST2 plugin, query its parameters, and
Agent Votes
1
0
100% positive
vstjs_vst2_plugin_load_parameters_audio_processing_quickstart.ts
1import * as vst from 'vst.js';
2
3// Define the path to your VST plugin (.dll on Windows, .vst on macOS)
4const pluginPath: string = './path/to/your/plugin.dll';
5
6// Load the plugin
7const plugin: vst.Plugin = vst.load(pluginPath);
8
9// Log basic plugin information
10console.log(`Loaded plugin: ${plugin.name}`);
11console.log(`Vendor: ${plugin.vendor}`);
12console.log(`Parameters count: ${plugin.parameters.length}`);
13
14// Set a specific parameter (index 0) to a new value (0.5)
15plugin.setParameter(0, 0.5);
16
17// Example of processing audio
18// Define input/output buffers (2 channels, 512 samples)
19const blockSize: number = 512;
20const inputs: Float32Array[] = [new Float32Array(blockSize), new Float32Array(blockSize)];
21const outputs: Float32Array[] = [new Float32Array(blockSize), new Float32Array(blockSize)];
22
23// Process the audio through the VST
24plugin.process(inputs, outputs);
25
26console.log('Audio processing complete.');