Audio effects not working with SynthDefs

Hello

I'm having a problem with the audio effects in TidalCycles.

Audio effects like room/size and crush will work on the SuperDirt samples but are having no effect on my SynthDefs from SuperCollider. I thought some of the dirt sample folders like "cpu" were missing too so I thought I might need to recompile the class library or reload the SuperDirt quarks to fix both issues. I did this and it did not help sadly.

Any Ideas? The effects work fine on the built in samples. just not custom synths.

If anyone's curious here is one of the SynthDefs in question

(
SynthDef.new(\op,{
arg freq=200, fm1mult=1,fm1amt=0,amp=0.1,fm1decay=0.5,fm1atk=0,sustain=1;
var carrier1,ampenv,fm1,fm1env,out;
fm1env=EnvGen.kr(Env.new([0,fm1amt,0],[fm1atk,sustain],-3));
fm1=SinOsc.ar(freqfm1mult)fm1env;
ampenv=EnvGen.kr(Env.new([0,amp,0],[0,sustain]), doneAction:2);
carrier1=SinOsc.ar(freq
(fm1+1))!2
(ampenv);
out=Splay.ar(carrier1,1)!2;
Out.ar(0, out);
}).add
)

First off, begin and end code blocks in triple backticks ``` to have it formatted properly, I think some symbols got messed up.

Your new synth is writing directly to the audio output bus, so it'll skip everything in the SuperDirt chain.

To write "SuperDirt compatible" SynthDefs you need to follow a few conventions:

(
SynthDef.new(\op,{
arg out, pan, freq, sustain, fm1mult=1,fm1amt=0, fm1decay=0.5,fm1atk=0;
var carrier1,ampenv,fm1,fm1env, sound;
fm1env=EnvGen.ar(Env.new([0,fm1amt,0],[fm1atk,sustain],-3));
fm1=SinOsc.ar(freq * fm1mult) * fm1env;
ampenv=EnvGen.kr(Env.new([0,1,0],[0,sustain]), doneAction:2);
carrier1=SinOsc.ar(freq * (fm1+1))!2;
sound=Splay.ar(carrier1,1)!2;
OffsetOut.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan, ampenv))
}).add
)

Main things to note:

  • I renamed out to sound to avoid confusion with SuperDirt's name for the output bus (out)
  • freq, sustain, pan and a bunch of other things are provided by SuperDirt as inputs
  • you don't have to worry about amp or gain control at all, that's handled elsewhere by SuperDirt
  • The DirtPan synth handles both panning and overall amplitude envelope
  • You've already put sustain in the envelopes, but another way to do it is for them to have duration 1 and add a timeScale:sustain argument to the EnvGen.

Thank you for taking the time to write all my missing asterisks back in, I didn't realize they had gone missing when I posted.

Thanks so much for the format tip, and for fixing the problem

Is there a list somewhere of all of the preset inputs in tidal cycles like freq and sustain? I didn't know about the sustain input for a while so I was getting clicks at the end of every synth until recently.

You can see a (maybe not complete?) list by evaluating

SuperDirt.predefinedSynthParameters

in SuperCollider. If you're willing to dig into the code a bit, you can also look at the makeDefaultParentEvent method in DirtOrbit.sc to get a sense of what parameters are getting set up there.