Using a faust vst in supercollider

I see alot of topics about rewriting faust code to supercollider code. But what im asking is something different. Im trying to get in to making vsts in faust. And i want to test those vsts in supercollider because im very familiar with sc, and i just dislike daws. Im using the vstplugin quark to load the plugin.
First i compiled this faust code

import("stdfaust.lib");
ctFreq = hslider("[0]cutoffFrequency",500,50,10000,0.01) : si.smoo;
q = hslider("[1]q",5,1,30,0.1) : si.smoo;
gain = hslider("[2]gain",1,0,1,0.01) : si.smoo;
freq = hslider("[4]freq",500,10,10000,0.01) : si.smoo;
plock = os.sawN(5, freq) * en.ar(0.01, 0.5, os.lf_imptrain(1));
process = plock : fi.resonlp(ctFreq,q,gain) <: dm.zita_light;

In the online ide for faust to a windows64 vst plugin. This generated a dll file.
I got the dll file path and then i did this to test the plugin.

(
SynthDef(\test, { 
	var sig;
	//DC.ar(0) because the plugin doesnt take any inputs
	sig = VSTPlugin.ar(DC.ar(0), 2);
	Out.ar(0, sig);
}).add;
)


~synth = Synth(\test);

~fx = VSTPluginController(~synth);
//in reality i use the absolute path here but im not showing that ofcourse
~fx.open("myVST.dll", editor: true, verbose: true);
~fx.editor

The post window showed this after executing ~fx.open.

probing myVST.dll... ok!
---
name: untitled
type: VST 2.4 (synth) [bridged]
path: myVST.dll
vendor: Vendor String goes here
category: Synth
version: 1
inputs: 0ch
outputs: 2ch
parameters: 6
programs: 1
presets: 0
editor: false
MIDI input: false
MIDI output: false
---

And after executing ~fx.editor it says no editor. There is no sound, nothing.

So im new to faust. And ive read faust and windows dont go hand in hand very well. Ive tested juce vsts in supercollider this way in the past and it worked fine. Ive asked this question in the faust discord too, but i dont expect any answer soon. (btw does anyone know if there is a go-to forum like scsynth.org for faust?)
But does anyone have a clue what is wrong?

While still disliking DAWs… it would be a useful differential test to see if your plug-in loads in Reaper.

  • Reaper OK, VSTPlugin not OK: The problem is likely in VSTPlugin.
  • Reaper not OK, VSTPlugin not OK: The problem is likely in the Faust compilation.

hjh

I managed to get this working. The faust code that i compiled into a windows64 vst plugin.

import("stdfaust.lib");
a1 = hslider("ja", 0.1, 0.1, 0.9, 0.01);
process = *(a1);

And the sc code:

(
SynthDef(\test, { 
	var sig = SoundIn.ar(0);
	sig = VSTPlugin.ar(sig, 2);
	Out.ar(0, sig);
}).add;
)

When i create a synth there is sound and the gain is reduced, because the initial value of the gain is 0.1. So the audio passes through the vst. But there is still no editor. So there is no way to access the gain setting of the faust plugin. In the faust ide it shows this gui:


But in cakewalk it shows this gui:

So does that mean that the gui in faust is not actually the vst gui and that every daw just makes its own gui for the vst? I assume the vstplugin quark doesnt have this functionality. Or is there a way to access the faust gui?

For example, you can use your faust code in a JUCE project if you want a polished vst plugin GUI

1 Like

It would be nice if the faust gui just gets translated into a vst gui. Because i dont want to deal with another layer, im new to faust and im not very proficient with juce. I just want a simple way to get things working at the basic level for now. Im scared ill have to deal with alot of troubleshooting trying to get things work if i wrap it with juce. But do you think this the easiest way to get a working vst gui?

Ok i wrapped it in a juce project like smoge suggested. The juce export option creates everything thats needed. And when opening in visual studio it can builded straight away. The gui now shows in supercollider too when using the VSTplugin quark.

1 Like

Glad it was kind of easy!

That’s because the generated plugin has no GUI editor, so VSTPluginController.editor only prints a warning.

But in cakewalk it shows this gui:

That’s a generic UI.

So does that mean that the gui in faust is not actually the vst gui and that every daw just makes its own gui for the vst?

Yes!

I assume the vstplugin quark doesnt have this functionality.

It does! See the VSTPluginController.gui method. There’s absolutely no need to wrap the Faust code in JUCE!

Note that all parameters can also be set programmatically.

1 Like

Would it be possible for the .editor method to fall back to .gui if there’s no editor available?

hjh

I’ve thought the same, actually. Please make a feature request before I forget :slight_smile:

OK, logged: Should "editor" fall back to "gui" if the plugin doesn't provide an interface? (#230) · Issues · Pure Data libraries / vstplugin · GitLab

hjh

2 Likes

I did not mean that it was the only way. I said it would be a way to work on a “polished” GUI.

For comparison: I believe the LADSPA standard does not even let you work on the GUI. The host always generates it.