Ask Your Question
1

How do you control custom SuperCollider Synth params from Tidal?

asked 2016-07-19 11:19:03 -0500

jarm gravatar image

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))
    }).add
);

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 flag offensive close merge delete

Comments

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.

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

3 answers

Sort by ยป oldest newest most voted
1

answered 2016-07-19 11:46:44 -0500

lennart gravatar image

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"
edit flag offensive delete link more

Comments

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?

jarm gravatar imagejarm ( 2016-07-19 12:07:05 -0500 )edit
1

answered 2016-07-19 12:10:15 -0500

bgold gravatar image

updated 2016-07-19 12:11:14 -0500

Lennart already answered, but for additional info: In general you can use something like

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.

edit flag offensive delete link more
0

answered 2016-08-22 19:59:26 -0500

zzkt gravatar image

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)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-07-19 11:19:03 -0500

Seen: 1,754 times

Last updated: Aug 22 '16