VstPlugin pre-release (outdated)

Thanks a lot, this is really great!!!

I am on Windows 10, SC 3.10.1 and could not manage to add LADSPA plugins…

searching in C:\Program Files\VSTPlugins ...
probing 'alias_1407' ... failed!
probing 'allpass_1895' ... failed!
probing 'amp_1181' ... failed!
probing 'am_pitchshift_1433' ... failed!
probing 'bandpass_a_iir_1893' ... failed!
probing 'bandpass_iir_1892' ... failed!
probing 'bode_shifter_1431' ... failed!
probing 'bode_shifter_cv_1432' ... failed!
probing 'butterworth_1902' ... failed!
probing 'chebstortion_1430' ... failed!
probing 'comb_1190' ... failed!
probing 'comb_1887' ... failed!
probing 'comb_splitter_1411' ... failed!

And goes on… Also checked the verbose. Any idea how to solve it?

as the name suggests, VstPlugin can only load VST plugins :wink: thanks for testing!

1 Like

When I added some of this mercuriall free VST I got the following when evaluating VstPlugin.search(s) :

CURRENT SIZEOF(struct fann_layer) = 16   ann->last_layer - ann->first_layer = 3  
CURRENT SIZEOF(struct fann_layer) = 16   ann->last_layer - ann->first_layer = 3  
CURRENT SIZEOF(struct fann_layer) = 16   ann->last_layer - ann->first_layer = 3  
CURRENT SIZEOF(struct fann_layer) = 16   ann->last_layer - ann->first_layer = 3  
CURRENT SIZEOF(struct fann_layer) = 16   ann->last_layer - ann->first_layer = 3  
CURRENT SIZEOF(struct fann_layer) = 16   ann->last_layer - ann->first_layer = 3  
CURRENT SIZEOF(struct fann_layer) = 16   ann->last_layer - ann->first_layer = 3  

Many times until the IDE crashes.

Other times when evaluating the same line the server cashed posting this:

-> VstPlugin
searching in C:\Program Files\VSTPlugins ...
Server 'localhost' exited with exit code -1073740777.
server 'localhost' disconnected shared memory interface

This was not happening with the TubeScreamer, Mesa Boogie and Chorus VST. It was mainly happening with the amp emulation.

always use VstPlugin.search(verbose: true) to find out which plugin crashes.
only buggy plugins should crash the Server in the search because I’m doing nothing but opening them, getting some info and closing them. this works with every decent plugin I’ve tested… but I’m working to make the search safe in a way that it never crashes the Server.

for the mercurial VST it seems like it’s printing repeatedly to stdout which floods the console.

Many times until the IDE crashes.

how many? I might need to deactivate stdout during the search… anyway, thanks for reporting!

Thank you for this fantastic work. VST in SC is one of my dreams!

Currently, I am on macOS 10.14.3. I have copied the folder “VstPlugin” into “~/⁨Library⁩/⁨Application Support/⁨SuperCollider⁩/⁨Extensions⁩”.

After booting the server via launched SC in SC-IDE, I evaluated the following code:

VstPlugin.search(Server.default)

, but the result was same as @droptableuser.
I then evaluated the following:

VstPlugin.search(verbose: true)

The result is as follows:

-> VstPlugin
searching in /Users/prko/Library/Audio/Plug-Ins/VST ...
found 0 plugins.
searching in /Library/Audio/Plug-Ins/VST ...
probing 'ARIA Player VST' ... ok!
probing 'Relay' ... ok!
probing 'Kontakt 5 16out' ... ok!
probing 'RX 7 Spectral De-noise' ... ok!
Server 'localhost' exited with exit code 0.
server 'localhost' disconnected shared memory interface

This is the result of the third time.
At first time and the second time, it ended with

'Relay' ... ok!

, and the server status bar was changed to yellow. I killed the server and rebooted Server or relaunched sclang, then re-evaluated the two codes above.

I have the following VST3 and VST2 plugins:

Please let me know if I should create an issue on https://git.iem.at/pd/vstplugin/issues?fbclid=IwAR3W3t04QtFbzBQ2j671D5tt3TQiK8vFTlr6l9N4TBikv5hV65Sw9Ar8j1w.

Daniel(or anyone), can you post an example of controlling parameters with patterns? On my machine (macOS 10.14.3) vsts aren’t showing up as MIDIClient destinations and I can’t figure out what to name the midi port.

Much thanks,

Robert

@robertf just pass ~fx.midi as the MIDI target

(~fx.midi returns a proxy class which just mimicks MIDIOut)

see the documentation for VstPluginController’s ‘midi’ method or see “VST Instruments” in the examples

Hello,

Now, the code

VSTPlugin.search(verbose: true)

returns the followings (Strangely, it does not detect ‘Waves Mercury’.):

searching in '/Users/prko/Library/Audio/Plug-Ins/VST':
found 0 plugins.
searching in '/Library/Audio/Plug-Ins/VST':
/Library/Audio/Plug-Ins/VST/ARIA Player VST Multi.vst
/Library/Audio/Plug-Ins/VST/ARIA Player VST.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM BandPass Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM BandPass.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Comb Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Comb.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Contrast Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Contrast.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Delays Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Delays.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Doppler Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Doppler.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Equalize Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Equalize.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Evolution.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Freeze Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Freeze.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM FreqShift Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM FreqShift.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM FreqWarp Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM FreqWarp.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Fusion.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Grinder.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM PitchAccum Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM PitchAccum.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Reson Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Reson.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Shuffling Stereo.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Shuffling.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM SpaceFilter.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM SpaceGrain.vst
/Library/Audio/Plug-Ins/VST/GRM/GRM Spaces.vst
/Library/Audio/Plug-Ins/VST/Insight 2.vst
/Library/Audio/Plug-Ins/VST/Kontakt 5 16out.vst
/Library/Audio/Plug-Ins/VST/Kontakt 5 8out.vst
/Library/Audio/Plug-Ins/VST/Kontakt 5.vst
probing '/Library/Audio/Plug-Ins/VST/Melodyne.vst' ... failed!
/Library/Audio/Plug-Ins/VST/Neutron 2 Compressor.vst
/Library/Audio/Plug-Ins/VST/Neutron 2 Equalizer.vst
/Library/Audio/Plug-Ins/VST/Neutron 2 Exciter.vst
/Library/Audio/Plug-Ins/VST/Neutron 2 Gate.vst
/Library/Audio/Plug-Ins/VST/Neutron 2 Mix Tap.vst
/Library/Audio/Plug-Ins/VST/Neutron 2 Transient Shaper.vst
/Library/Audio/Plug-Ins/VST/Neutron 2 Visual Mixer.vst
/Library/Audio/Plug-Ins/VST/Neutron 2.vst
probing '/Library/Audio/Plug-Ins/VST/NotePerformer.vst' ... failed!
/Library/Audio/Plug-Ins/VST/Ozone Imager.vst
/Library/Audio/Plug-Ins/VST/Relay.vst
/Library/Audio/Plug-Ins/VST/RX 7 Breath Control.vst
/Library/Audio/Plug-Ins/VST/RX 7 Connect.vst
/Library/Audio/Plug-Ins/VST/RX 7 De-click.vst
/Library/Audio/Plug-Ins/VST/RX 7 De-clip.vst
/Library/Audio/Plug-Ins/VST/RX 7 De-crackle.vst
/Library/Audio/Plug-Ins/VST/RX 7 De-ess.vst
/Library/Audio/Plug-Ins/VST/RX 7 De-hum.vst
/Library/Audio/Plug-Ins/VST/RX 7 De-plosive.vst
/Library/Audio/Plug-Ins/VST/RX 7 De-reverb.vst
/Library/Audio/Plug-Ins/VST/RX 7 Monitor.vst
/Library/Audio/Plug-Ins/VST/RX 7 Mouth De-click.vst
/Library/Audio/Plug-Ins/VST/RX 7 Spectral De-noise.vst
/Library/Audio/Plug-Ins/VST/RX 7 Voice De-noise.vst
/Library/Audio/Plug-Ins/VST/Tonal Balance Control.vst
/Library/Audio/Plug-Ins/VST/UVIWorkstationVST.vst
found 61 plugins.

It seems great. I will try VST-instrument and effect as soon as possible!
Thank you for your great work!

@prko cool! dunno about Waves mercury. as long it is a VST2 plugin and a bundle with .vst extension, it should be recognized…

‘Waves Mercury’ provides VST2 and VST3 as well as AU under macOS.

Usually, plug-ins provide individual VST files in the VST2 folder. However, Waves plug-ins provide only one file: “WaveShell1-VST” in VST2 folder (“WaveShell1-VST3” in VST3 folder and “WaveShell1-VST” in AU folder).

This WaveShell1 then links all plugins in the Waves plug-in folder. This is very unique. Could they be detectable in SC?

@prko I see, it’s a shell plugin. I’ve only read about those. is there a chance you can send me the plugin bundle? I don’t need the license, I just want to see the bundle structure and investigate the binaries to figure out how to deal with them.

What I have is a legacy product:
https://www.waves.com/downloads/v9

Here some test examples with a vst organ instrument, I adapted to Christof’s release of v0.1.0 (VSTPlugin v0.1.0 released!)

// VSTPlugin examples with patterns, using VSTPlugin vs 0.1.0 


/////////////////////////////////////////////

1.) Download and install ComboV organ from

http://www.vst4free.com/free_vst.php?id=1004


2.) Boot SC with VSTPlugins

/////////////////////////////////////////////

Ex.1a straight usage, single synth instrument

(
// vsti with pan option
SynthDef(\vst, { |out = 0, pan = 0|
    var sig = VSTPlugin.ar(nil, 1);
	Out.ar(out, Pan2.ar(sig, pan));
}).add;
)

// start synth and controller

~synth = Synth(\vst);

~ctrl = VSTPluginController.new(~synth);


// insert your path

~ctrl.open("/Library/Audio/Plug-Ins/VST/ComboV");



// define patterns

(
p = Pbind(
    \type, \midi,
    \midiout, ~ctrl.midi,
	\dur, Pwrand([0.3, Rest(0.3)], [0.8, 0.2], inf),
	\legato, 1,
	\midinote, Pxrand((80..95), inf)
);

q = Pbind(
	\dur, Prand([2, 3, 5, Rest(3)] * 0.3, inf),
	\midinote, Pxrand((48..60), inf)
) <> p;

r = Pbind(
	\dur, Prand([1/2, 1/2, 1, Rest(1)] * 0.3, inf),
	\legato, 0.5,
	\midinote, Pxrand((62..78), inf)
) <> p;
)

// play voice by voice

x = p.trace.play(quant: 0.3)

y = q.trace.play(quant: 0.3)

z = r.trace.play(quant: 0.3)


z.stop

x.stop

y.stop


/////////////////////////////////////////////


Ex.1b panning with 4 running vst instruments

// 4 positions in space
~synths = [-0.75, -0.3, 0.3, 0.75].collect { |x| Synth(\vst, [\pan, x]) };

~vsts = ~synths.collect { |x| VSTPluginController(x) };

// insert your path

~vsts.do { |x| x.open("/Library/Audio/Plug-Ins/VST/ComboV") };



(
p = Pbind(
    \type, \midi,
	\midiout, ~vsts[1].midi,
    \dur, 0.2,
	\legato, Prand([0.3, 0.7], inf),
	\midinote, Pxrand((62..78), inf)
);

q = Pbind(
	\dur, Prand([2, 3, 5, Rest(3)] * 0.2, inf),
	\midiout, ~vsts[2].midi,
	\midinote, Pxrand((48..60), inf)
) <> p;

r = Pbind(
	\dur, Prand([1/2, 1/2, 1, Rest(1)] * 0.2, inf),
	// LL RR scheme
	\midiout, Pseq([0, 0, 3, 3], inf).collect { |x| ~vsts[x].midi },
	\midinote, Pxrand((80..93), inf) + [0, 5]
) <> p;
)

// play voice by voice

x = p.trace.play(quant: 0.2)

y = q.trace.play(quant: 0.2)

z = r.trace.play(quant: 0.2)



x.stop

y.stop

z.stop

/////////////////////////////////////////////

Ex.2 setting vst instruments with event type set

// SynthDef, does pitchbend on all pitch classes (index inof see below)


(
SynthDef(\vst_pb, { |out = 0, pitchBend = 0.5, pan|
	var sig = VSTPlugin.ar(
		nil,
		1,
		params: ([(11..22), pitchBend ! 12]).flop.flat
	);
	Out.ar(out, Pan2.ar(sig, pan));
}).add;
)


// start 2 synths

~synths = { Synth(\vst_pb) } ! 2;

~ctrls = ~synths.collect { |x| VSTPluginController(x) };



// insert your path

~ctrls.do { |x| x.open("/Library/Audio/Plug-Ins/VST/ComboV") };


// info:
// ~ctrls[0].info.parameterNames.postcs


(
// 2 patterns set params of the 2 synths

p = Pbind(
    \type, \set,
	\id, ~synths[0].nodeID,
	\args, [\pan, \pitchBend],
    \dur, 0.2,
	\pitchBend, Pxrand([0.25, 0.5, 0.75], inf),
	\pan, Pxrand([-1, -0.5, 0, 0.5, 1], inf)
);

q = Pbind(\id, ~synths[1].nodeID) <> p;

// 2 patterns set notes via midi

r = Pbind(
    \type, \midi,
	\midiout, ~ctrls[0].midi,
	\legato, 2,
	\dur, Pwrand([2, 3], [0.8, 0.2], inf),
	\midinote, Pxrand((48..90), inf)
);

t = Pbind(\midiout, ~ctrls[1].midi) <> r;
)


// run all, do a bit of midi delay compensation

x = Ptpar([0.02, p, 0.02, q, 0, r, 0, t]).play


// cleanup


// wait for release

x.stop


// when silent stop synths

~synths.do(_.free)
1 Like

we should really collect examples like these for a VSTPlugin Guide/Tutorial!

Thanks for the clarification, Christof, and for VSTPlugin itself – you’ve done us all a great service!

Thank you as well, Daniel, for your thorough response. I look forward to trying it out when I get home this evening. I was able to send midi note messages last night after Christof clarified the syntax for me, but was still unable to send cc messages. Looking over your examples, I think I had just left out the params args in the SynthDef and should be able to get it to work by following your pitchbend example.

VSTPluginMIDIProxy internally calls VSTPluginController-sendMidi, which in turn sends the raw MIDI message to the VSTPlugin UGen. the params argument is not related as it’s used for automating parameters via UGens.

regarding CC: PBind(\type, \midi, ...) sends MIDI noteOn messages by default but you can change the message type with the \midicmd argument.
http://doc.sccode.org/Tutorials/A-Practical-Guide/PG_Cookbook04_Sending_MIDI.html
In your case try: PBind(\type, \midi, \midicmd, \control

EDIT: are you sure you need CC messages? if you just want to set plugin parameters via patterns, you can indeed use params + a PBind of type\set. Or make your own Event type which calls VSTPluginController-set. I think @Geoffroy had an example, maybe he can update it to the new version?

EDIT: and maybe continue here VSTPlugin v0.1.0 released!

Thanks again, Christof.

I’m familiar with \midicmd, \control, and use it regularly with standalone apps, but something isn’t working for me here. Here’s the code I’m running – does anything appear to be amiss? I’m able to manipulate parameters via the interface and with UGens, but not the Pbindef. I’m also able to send note messages to a vsti, but it crashes after a minute (gui disappears and synth goes silent). I’m also seeing a horizontal white bar that blips onto my screen for maybe a couple milliseconds.

~conbus = Bus.audio(s, 2);

SynthDef(\contrast, {Out.ar(0, VSTPlugin.ar(In.ar(~conbus, 2), 2))}).add;

~consynth = Synth(\contrast);

~contrast = VSTPluginController(~consynth);

~contrast.open("/Library/Audio/Plug-Ins/VST/GRM/GRM Contrast Stereo.vst/", info: true);

~contrast.gui;

Pbindef(\weak, \type, \midi, \midicmd, \control, \midiout, ~contrast.midi, \chan, 0, \ctlNum, 4, \control, Pn(Pseries(0, 1, 99)), \dur, 0.25).play;

Just saw the white bar while not running VSTPlugin, so that’s unrelated.

@robertf generally, ~fx.midi.control itself is working. can you open an issue on the issue tracker describing the problem? https://git.iem.at/pd/vstplugin/issues
it’s hard for me to track complex issues when they are interleaved with other posts. I need as much info as possible, describing exactly what you try to do (e.g. which plugin(s), where to get it, which CC messages, what’s the intended result, etc.) thanks!

Some new examples also with vst fx and including LFO control: