• Couldn't match expected type ‘Pattern Double’
with actual type ‘Maybe a0’
• In the second argument of ‘pF’, namely ‘(Nothing)’
In the expression: pF "plat" (Nothing)
In a pattern binding: (plat, plat_p) = pF "plat" (Nothing)
Something like: pF s p takes s :: String and p :: Pattern Float and computes a control pattern that has the same structure as p, where each value v :: Float in p results in a ControlMap with single key s and value v.
On tuesday, I plan to introduce a bit of granular synthesis / microsound to the students, so I've added a grain envelope to superdirt. We'll hav eto think about parameter names in tidal …
SynthDef("dirt_grain_envelope" ++ numChannels, { |out, sustain = 1, tilt = 0.5, plat = 0, curve = -3 |
var signal = In.ar(out, numChannels);
var p = plat.clip(0, 1);
var c = tilt.clip(0, 1);
var riseAndFall = 1 - p;
var attack = c * riseAndFall;
var release = (1 - c) * riseAndFall;
var hold = p;
var env = EnvGen.ar(Env.linen(attack, hold, release, 1, curve), timeScale: sustain);
signal = signal * env;
ReplaceOut.ar(out, signal);
}, [\ir, \ir, \ir, \ir, \ir]).add;
(
~dirt.addModule('grenvelo',
{ |dirtEvent|
dirtEvent.sendSynth('dirt_grain_envelope' ++ ~numChannels,
[
sustain: ~sustain,
tilt: ~tilt,
plat: ~plat,
curve:~curve,
out: ~out
])
}, { ~tilt.notNil });
);
I've been looking for a granular synthdef to use with Tidal. A granular engine mixed with Tidal's control sounds like it would be really powerful.
This synthdef seems just as you describe, a single granular envelope that can transverse through the buffer. Do you think it might be possible to modify code like this so that it could create multiple grain streams at once?