Hello @mattia.paterna,
VSTPlugins with Tidal/SuperDirt would be a nice thing!
To help you with this, here are a few things you should consider. SynthDefs are in my understanding a static (kind of?) object and normally only UGens are virtually "patched" inside. This has to do with the server side representation of Synths. And controlling a Synth in another SynthDef or triggering events are dynamic actions. I believe you want to trigger a non dirt event with a dirt event. Look to the similarity between
(vst: ~instrument, type: \vst_set, params: [param], param: value).play;
and
(type: \dirt, dirt: ~dirt, \s: "808").play;
I guess you should start a non dirt event outside a Snythdef. If you want to use it inside s
, than you should implement it as an function. Maybe it could be useful as well to use the VSTPlugin has an effect, so you can specify the fx chain inside SuperDirt (here you find a summary about the meaning of SynthDefs, functions and effects in the SuperDirt context: Custom Synthdef not working on Windows - #2 by mrreason)
I think you could do something like this (not tested):
~dirt.soundLibrary.addSynth(\vst, (play: {
~instrument.set("param", ~myparam);
//Alternative
//(vst: ~instrument, type: \vst_set, param: ~myparam).play;
}));
And use it in TidalCycles like
d1 $ s "vst" # myparam "<2 3 4>"
Notice, that you can use every global SuperCollider variable with TidalCycles if you defined the pattern function for it.