SC as VST3 Ableton

Hello, i just compiled this source GitHub - asb2m10/plugincollider: SuperCollider as a VST3 plugin recovered the vst3 file and loaded it in ableton its awesome

I wanted to know

My goal is to have the audio source come out the vst to benefit from midi grid and avoid virtual audio latency, its working , the other goal from all this is to modify my signal while live playing (on my couch)

is this possible? so far i could not work out the server section of the vst to wire stuff from IDE so I compiled the synth we see as a .scsyndef extension.

But its bit weird for instance argument freq if i force the modulation via the ā€˜internal plugin state’ vst menu option then it can be modulated but it does not anymore compute the grid key information, also it would be nice not to have to compile the synth def to do more dev like experimenting

at some point i got some synth showing in the server section of the vst but couldnt do anything with them and don’t even know how i got them there haha

Is this vst3 mean to work ?

I found also this other rep but wanted some acknowledgement from community before to compile this one too

Thanks to all =)

edit: the main question maybe was is there a documention for using the vst?

1 Like

I successfully used it in a Reaper project, to use JPverb for its lovely ambient-ness.

If I recall correctly, there are two modes: MIDI and fx mode. In MIDI mode, the VST layer processes MIDI messages and plays the chosen SynthDef in response to them. In fx mode, one synth is loaded at startup time and it processes audio on the hardware input buses.

It doesn’t contain the full language, so control methods are limited. You shouldn’t expect plugincollider to do everything, or even most of, what the full SC environment can do. Each plugincollider instance is meant to be a small, limited-scope processor. When I used it for JPverb, that was enough.

You can connect sclang in the IDE to a running plugincollider server by creating a Server.remote in the language.

hjh

2 Likes

yay! Another mystery solved by @jamshark70 ^^

I just did Server.remote and got

Requested notification messages from server 'nil'
/notify : already registered
nil - already registered with clientID 0.
nil - handling login request though already registered - 
This seems to be a login after a loss of network contact - 
- reconnected with the same clientID as before, so probably all is well.

Does this mainly allow me to send messages as code below?


n = NetAddr("localhost", 8898);

// Example sending symbols, integers, and a float
n.sendMsg('/s_new', \my_mini, 2000, 0, 0, \freq, 80.midicps);
n.sendMsg('/n_free',s.defaultGroup.nodeID); 

// The initial forward slash can be omitted
n.sendMsg(\n_set, 2000, \gate, 1);

to refer to your answer

In MIDI mode, the VST layer processes MIDI messages and plays the chosen SynthDef in response to them

Is it possible to send a synth from IDE or is it only synthdef loaded from compiled .scsyndef files? thanks

omg wanring eveyone when compiling for vst use the name freq is reserved value for wiring with key change on the grid

below would take grid key change

(
[
SynthDef(\third, {
    arg freq = 82.406889228217; // Base pitch (40 Hz, a low E)
    
    var maxH = 80;
    var nyquist = SampleRate.ir * 0.5;

    var sig;

    // Generate harmonics 4 to 10
    sig = Mix.fill(maxH - 3, { |i|
        var n = i + 4;  // Start from the 4th harmonic
        var f = freq * n;  // Frequency for the nth harmonic
        var amp = 1 / (n ** 0.7);  // Amplitude falloff

        // Ensure the frequency doesn't exceed Nyquist limit
        f = f.min(nyquist);

        SinOsc.ar(f, 0, amp);  // Generate sine wave for this harmonic
    });

    sig = sig * 0.1*EnvGen.kr(Env.perc(releaseTime: 0.2),doneAction: 2);  // Final scaling

    Out.ar(0, sig ! 2);  // Output stereo
})
].writeDefFile("/third", "/Users/davidmignot/Desktop");
)

below wont and freeze at same key

(
[
SynthDef(\third, {
    arg filou = 82.406889228217; // Base pitch (40 Hz, a low E)
    
    var maxH = 80;
    var nyquist = SampleRate.ir * 0.5;

    var sig;

    // Generate harmonics 4 to 10
    sig = Mix.fill(maxH - 3, { |i|
        var n = i + 4;  // Start from the 4th harmonic
        var f = filou * n;  // Frequency for the nth harmonic
        var amp = 1 / (n ** 0.7);  // Amplitude falloff

        // Ensure the frequency doesn't exceed Nyquist limit
        f = f.min(nyquist);

        SinOsc.ar(f, 0, amp);  // Generate sine wave for this harmonic
    });

    sig = sig * 0.1*EnvGen.kr(Env.perc(releaseTime: 0.2),doneAction: 2);  // Final scaling

    Out.ar(0, sig ! 2);  // Output stereo
})
].writeDefFile("/third", "/Users/davidmignot/Desktop");
)

It’s not quite clear from your comment, but I’m going to guess that this is not actually connecting to the plugin’s server – because the server’s name is nil, I’m guessing that you didn’t provide any arguments to Server.remote.

But the most important thing when connecting to a server that’s been started in some other process is: where to find it for communication – that is, Server.remote is kinda pointless without a NetAddr.

When I wrote that, I was winding down for sleep, so I briefly pointed you to the method and hoped that you would look it up in the help and see what arguments were needed.

Once you connect sclang to the remote plugin server (ā€œremoteā€ meaning that this sclang instance didn’t start the server), then you can use all the normal Synth etc methods on it.

(Btw, yes, freq and gate are long-standing conventions in SC SynthDefs. I’d also guess that plugincollider transmits velocity into amp with some scaling, but I haven’t tried it and I’m not sure.)

hjh

I briefly pointed you to the method and hoped that you would look it up in the help and see what arguments were needed.

Shame on me I thought I had a quick look, will do it more thoroughly, by the time I was checking many options, thank you

hey hey,

after succesfully working

Server.remote(\vst, NetAddr("127.0.0.1", 8899));

All my IDE synths are loading in the vst ā€˜server’ view

then so far i used this to instantiate the synth

var addr = NetAddr("127.0.0.1", 8899);
addr.sendMsg("/s_new", "\pluckyTest", s.nextNodeID, 0, 1);

and sounds comes out succesfully from vst ^^

but at contrary to a loaded .scsyndef synth, its not triggered by the ableton midi grid

I think there is something to do with the system of server/node/group section shown below but impossible to figure if that could be it or how to instanciate something in it

I tried something ultra clumsy to wire MIDI from ableton to sc and routine/trigger the .sendMsg using the ableton midi data and it comes out the vst with an offset probably caused by all the come and go in between modules =(

Please is there a way to connect the MIDI from ableton to sc vst just inside ableton and using the flow i got going until this last issue? This way synth can be very easily edited from IDE it looks like a very handy way to enjoy UI sequencing and sc synthesis.

1 Like

Dirty Gemini option haha that does the job (pure workaround)

compile a synth

(
[
SynthDef(\my_mini2, {

    arg freq = 440, amp = 0.1;
    var sound;
    sound = SinOsc.ar(freq, 0, amp);  

Out.ar(0, sound*EnvGen.kr(Env.perc(releaseTime: 0.2),doneAction: 2));  

})
].writeDefFile("my_mini2", "/Users/davidmignot/Desktop");
)

Load in vst in project view

and then modify and .add; the synth ide with the same name

SynthDef(\my_mini2, {

    arg freq = 440, amp = 0.1;
    var sound;

    sound = Saw.ar(freq, 1);  

Out.ar(0, sound*EnvGen.kr(Env.perc(releaseTime: 0.2),doneAction: 2)); 
}).add;

Indeed source updated while playing grid tick and well synch

Yes, that’s the way (not a workaround).

If you’re playing MIDI notes in plugincollider, the s_new messages are 100% generated by the VST. Sclang can’t intervene in that. But when you change the SynthDef from outside, future s_new messages have to use the new def :wink:

Normally we think of one big server that’s doing everything. Plugincollider is based on the idea of each plugin (each server) having a small, focused job: this one plays MIDI, that one processes an effect. That means letting go of the usual SC way of thinking. At first, I didn’t get it either – I thought it would need to have a full language interpreter – but after trying it, I see the point.

hjh

1 Like

Then this seals it, big thank you! ( already wiring lfo from ide to sequenced synth in vst) =)))