// title: Simple wrapper class for VSTPlugin // author: david_morgan // description: // This is a class to streamline some of the boilerplate code for wiring up the VSTPlugin extension. It is intended to make using VSTPlugin with a NodeProxy somewhat easier. // // It's only been tested on a Mac with develop branch build of SuperCollider with PR-4499 merged. // code: /////////////////////////////// // To use: // Install VSTPlugin // available here: https://git.iem.at/pd/vstplugin/-/releases // Create a NodeProxy as a sound source for testing ( Ndef(\sine, { var sig = SinOsc.ar(440); var env = Decay2.kr(Impulse.kr(0.5)); Splay.ar(sig) * env * 0.1; }) ) // display discovered keys Vst(\delay1).keys.do({arg k; k.postln;}); // load a vst by key or path Vst(\delay1).load('/Library/Audio/Plug-Ins/VST/ValhallaDelay'); // route the test sound source to the internal node proxy Vst(\delay1).node.source = Ndef(\sine); // monitor the vst with fade in Vst(\delay1).node.play(fadeTime:4); // view the editor if enabled (see PR-4499 for mac) Vst(\delay1).editor; // view the default gui Vst(\delay1).gui; // toggle bypass: 1 or 0 Vst(\delay1).bypass(1); // stop monitoring the vst with fade out Vst(\delay1).node.stop(fadeTime:4); // since the vst is output through a node proxy // it can be further routed as a regular node proxy ( Ndef(\fx, { var in = \in.ar([0, 0]); PitchShift.ar(in, 0.2, 2, 0.01, 0.01); }); ) Ndef(\fx) <<> Vst(\delay1).node; Ndef(\fx).play; /////////////////////////////// // copy the below code to SC extensions folder // e.g. ~/Library/Application Support/SuperCollider/Extensions Vst { classvar