# How do you control custom SuperCollider Synth params from Tidal?

I'm trying to add some custom SC SynthDefs to use with Tidal, just wondering how you make custom parameters available in Tidal. e.g. I have a SynthDef here:

// http://sccode.org/1-4Tq Dirty FM Shuffle
(
SynthDef(\fmshuffle, {|out, freq, gate = 1, amp = 1, carFreq = 1000, modFreq = 100, modAmount = 2000, clipAmount = 0.1, pan |
var modEnv = EnvGen.ar(Env.adsr(0.5, 0.5, 0.7, 0.1, peakLevel: modAmount), gate);
var mod = SinOsc.ar(modFreq) * modEnv;
var car = SinOsc.ar(freq + mod);
var ampEnv = EnvGen.ar(Env.adsr(0.1, 0.3, 0.7, 0.2, peakLevel: amp), gate, doneAction: 2);
var clip = clipAmount * 500;
var sound = (car * ampEnv * clip).clip(-0.7, 0.7) * 0.1;
OffsetOut.ar(out, DirtPan.ar(sound, ~dirt.numChannels, pan))
);


and in Tidal I would like to do # modFreq "50 200 100" etc, but not sure how to bring that variable into scope in Tidal.

edit retag close merge delete

It doesn't hurt anything, but I don't think you need the peakLevel:amp part on the amplitude envelope - SuperDirt automatically uses Tidal's gain parameter when mixing all the sounds together.

( 2016-07-19 12:23:31 -0500 )edit

Sort by » oldest newest most voted

In your tidal editor with a .tidal file open, you can evaluate the following line:

let (modFreq, _) = pI "modFreq" (Just 100)


and then use the param in a pattern:

d1 \$ modFreq "220 15 340" # sound "fmshuffle"

more

Would you remind elaborating on what the syntax of the first line means? And also in terms of workflow, what is the best way to deal with a lot of these synth params in Tidal if I end up using lots of SC synths?

( 2016-07-19 12:07:05 -0500 )edit

let (param, param_p) = pF "param" (Just 0)


param_p is really only there if you use the grp function to bundle parameters together. If you don't know what that is, don't worry about it. In Lennart's example that was replaced with a _ to indicate that it's unused.

pF is for floating point parameters (i.e. decimals), pI is for integer parameters. Most of the time it's just fine to use floating point in SuperDirt.

The thing in quotes is the the name of the parameter in SuperDirt. It's usually least confusing if it's just the same as the name of the parameter in Tidal. And the Just 0 is a default value for the parameter, although in practice that default can be overridden by the SuperDirt default (as you have done), so it may not even be used.

more

you could also add a nested let with the required params for each SynthDef (to add to the comment above with a better formatted example...)

let (freq, _) = pF "freq" (Just 100)
(modFreq, _) = pF "modFreq" (Just 10)
(phase, _) = pF "phase" (Just 1.0)
(rate, _) = pI "rate" (Just 1)

more