Skip to content

Instantly share code, notes, and snippets.

@madskjeldgaard
Created August 15, 2020 20:23
Show Gist options
  • Select an option

  • Save madskjeldgaard/9c95c376680801b2b025a6ca7a4732e5 to your computer and use it in GitHub Desktop.

Select an option

Save madskjeldgaard/9c95c376680801b2b025a6ca7a4732e5 to your computer and use it in GitHub Desktop.
Play a source sound pattern and an fx processing pattern in parallel in SuperCollider
(
s.waitForBoot{
// Create new Ndef setter event type
Event.addEventType(\ndset, {|server|
~type = \set;
~id = Ndef(~key).group;
~args = Ndef(~key).controlKeys(except: ~exceptArgs);
currentEnvironment.play;
});
~freqshift = Bus.audio(s,2);
};
)
(
Ndef(\freqshift, {|in, freqshift=22|
FreqShift.ar(In.ar(in, 2), freqshift.poll)
})
.set(\in, ~freqshift)
.play(
group:1,
addAction: \addToTail
);
Pdef(\p,
Plambda(
Ppar([
Pbind(
\degree, Pseq([0,1],inf),
\dur, Plet(\primaryDur, Pwhite(0.1,0.25)),
\out, ~freqshift
),
Pbind(
\type, \ndset,
\key, \freqshift,
\dur, Pget(\primaryDur, default: 1, repeats: inf),
\freqshift, Pexprand(0.10,100.0)
)
])
)
).play;
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment