Hello community,
this is my first post here so please let me know if I can make it better.
I have been exploring VSTPlugin and so far I have been able to send MIDI messages to a VSTPluginController
from within TidalCycles. The next desirable step would be to have parameter automation from within TidalCycles as well.
I learnt that I can automate plugin parameter in different ways:
- using
set
e.g.~vsti.set(1, 0.5);
- using an
Event
e.g.(vst: ~vsti, type: \vst_set, params: 1, 1: 0.5).play;
given that ~vsti
is the instance of VSTPluginController
.
What I have been experiencing is that I see the change in the vst when I execute the statements myself, but when I wrap them inside SuperDirt they have no effect at all.
I have two ideas that I have been trying:
- having parameter automation as effect in SuperDirt so I do not have to waste orbits just for the sake of automating parameter, here for documentation on how to add an effect to SuperDirt.
- having SuperDirt execute a function that triggers the parameter change, here for documentation on how to call a function from SuperDirt.
Following the first idea, this is the code I wrote:
(
var diversions = ();
~diversions = diversions;
// d1 is a DirtOrbit
~d1.defaultParentEvent[\diversion] = { diversions[~s].value };
)
(
~diversions[\autoParam] = {
~vsti.set(1, 0.5);
// alternative: (vst: ~vsti, type: \vst_set, params: [1], 1: 0.5).play;
};
)
// try it out
(type: \dirt, s: \autoParam, dirt: ~dirt).play;
This does not trigger any change in the vst parameter, plus I do not really know how to give the parameter/value pair as input.
Following the second idea, this is the code I wrote:
/* Parameter automation from within TidalCycles */
(
// add module in SuperDirt, instance is ~dirt
(
~dirt.addModule('param-mod', { |dirtEvent|
dirtEvent.sendSynth('param-mod' ++ ~dirt.numChannels,
[
param: ~param,
value: ~value,
]
)
}, { ~param.notNil and: { ~value.notNil } });
);
// create fx function
(
SynthDef("param-mod" ++ ~dirt.numChannels, {| param, value |
(vst: ~vsti, type: \vst_set, params: [param], param: value).play;
}).add;
);
)
This does not produce any change in the vst parameter, although I see the event being triggered from within TidalCycles.
I would really appreciate if anyone could point me where/what I am doing wrong, or whether there is a better way as I am not super familiar with SuperDirt, and more generally SuperCollider, concepts.
Thank you