VSTPlugin v0.1.0 released!

Here some more examples I’d like to share, Patterns, LFO control and combined with the combo organ and a light reverb, related to examples given here:

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


1.) VST Instrument LFO control


// Download ComboV organ, move to VST directory

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



(
SynthDef(\vst_pb, { |out = 0, pitchBend = 0.5, pan|
	var sig = VSTPlugin.ar(
		nil,
		1,
		// do pitchbend for all pitches
		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) };




(
// define your path
~path = "/Library/Audio/Plug-Ins/VST/ComboV";

// for some reason two must not be done at once

~ctrls[0].open(~path, action: { ~ctrls[1].open(~path) });

~buses = { Bus.control(s, 1) } ! 2;
).


(
p = Pbind(
    \type, \midi,
	\midiout, ~ctrls[0].midi,
	\legato, 1.5,
	\dur, 3,
	\midinote, Pxrand((48..70), inf)
);

q = Pbind(\midinote, Pxrand((71..90), inf), \midiout, ~ctrls[1].midi) <> p;
)


(
// set panning LR
~synths[0].set(\pan, -1);
~synths[1].set(\pan, 1);

// map pitchBend to buses
~synths[0].map(\pitchBend, ~buses[0]);
~synths[1].map(\pitchBend, ~buses[1]);
)

// start Patterns
x = Ptpar([0, p, 1.5, q]).play


// phase-shifted vibrato via LFOs that play to buses
(
~pitchBends = [
	{ Out.kr(~buses[0], SinOsc.kr(SinOsc.kr(0.05, -pi/2).curverange(0.1, 20, 5), -pi/2).range(0, 1)) }.play,
	{ Out.kr(~buses[1], SinOsc.kr(SinOsc.kr(0.05, pi/2).curverange(0.1, 20, 5), -pi/2).range(0, 1)) }.play
];
)



// cleanup

~pitchBends.do(_.free);

x.stop;

~synths.do(_.free);



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

2.) VST FXs


light reverb, download and install (Windows and OSX)

http://www.anwida.com/download.asp



(
// reverb fx:
SynthDef.new(\reverb, { arg out, in;
    Out.ar(out, VSTPlugin.ar(In.ar(in, 2), 2));
}).add;
)

(
// open 2 DX Reverbs with guis > need two fx buses
~fxBus1 = Bus.audio(s, 2);
~fxBus2 = Bus.audio(s, 2);
~fx1 = VSTPluginController(~vstFx1 = Synth(\reverb, [in: ~fxBus1]));
~fx2 = VSTPluginController(~vstFx2 = Synth(\reverb, [in: ~fxBus2]));
~fx1.gui;
~fx2.gui;
)



(
// SynthDef for sequence 1
SynthDef(\sawPerc_2ch, { |out, freq = 400, att = 0.005, rel = 0.05,
	amp = 0.5, pan = 0|
	var sig = Pan2.ar(Saw.ar(freq, amp), pan);
	OffsetOut.ar(
		out,
		sig * EnvGen.ar(Env.perc(att, rel), doneAction: 2)
	)
}).add
)



(
p = Pbind(
	\instrument, \sawPerc_2ch,
	\amp, 0.5,
	\out, ~fxBus1,
	\pan, Pwhite(-1.0, 1),
	\dur, Pstutter(Pwhite(1, 4), Prand([0.2, 0.1, 0.1], inf)),
	\att, Pwhite(0.005, 0.01),
	\rel, Pwhite(0.01, 0.05),
	\midinote, Pstutter(Pwhite(1, 4), Pwhite(45, 65))
);
)

x = p.play(quant: 0.1)

// VST for sequence 2

(
// 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 und controller
// play to bus

~vstSrc = Synth(\vst, [out: ~fxBus2]);

~ctrl = VSTPluginController.new(~vstSrc);

// load organ instrument from your path and open gui

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

~ctrl.gui


// MIDI Pattern

(
// for syncing (MIDI vs OSC latency!)
~lag = 0.09;

q = Pbind(
    \type, \midi,
    \midiout, ~ctrl.midi,
	\dur, Pstutter(Pwhite(1, 4), Prand([0.2, 0.1, 0.1], inf)),
	\out, ~fxBus2,
	\legato, 0.3,
	\lag, Pfunc { ~lag },
	// high values -> rests
	\midinote, Pstutter(Pwhite(1, 4), Pwhite(70, 100))
);
)

y = q.play(quant: 0.1)


// change organ timbre and reverbs with guis


// cleanup

(
y.stop;
x.stop;
)

(
~vstSrc.free
~vstFx1.free;
~vstFx2.free;
)
1 Like