Adding CUTOFF modulation on AWAKE?

Hello!

Apologies for the very beginner question… I’m trying to figure out how to add a simple AD, or ADSR envelop to the CUTOFF frequency on “awake”.

From my little understanding looking at the code the sound is played with this command:

crow.ii.jf.play_note((note_num-60)/12,5)

so i’m wondering how would i go about adding two parameters to that synth, for instance Attack and Decay for an evelope and then how to modulate the cutoff with it.

I’m very familiar with programming, a little bit familiar with supercollider, but i just got my norns and i can’t make sense of it yet.

Thanks a lot for any help / advice!

I would love to learn how to navigate my way through it and contribute somehow!

thank you

Hi!
first off I’m definitely not an expert on this but your post got me thinking.

That line you copied looks like what it’s doing is sending a command to Crow. This is only happening if awake is set to send to Crow.

My understanding is that scripts like this on Norns make use of engines built in supercollider.

Awake uses PolyPerc as the engine, at least in the out-of-the-box version. I don’t believe it has ADSR for the filter built into the Synthdef, which is what defines how the engine talks to Supercollider.

However what you could probably do is extend Polyperc to Include those parameters and then save your own version of it, then edit the awake code to use those parameters. That or use an engine that supports those parameters and edit the Awake script to allow you to modify those parameters.

You might want to also take a look at the Awake Passersby version for an example of how one might use a different engine in an existing app. Looks like you could really swap in whatever engine you want as long as you make sure to change the parameters the script refers to so that it matches legitimate parameters in the engine.

I also recommend looking into the Norns Studies - Norns: studies

This is a great intro to learning how to work in Lua to “speak Norns” so to speak.

I hope this helps!

2 Likes

you will want to edit the SynthDef defined in supercollider.

[ source] (dust/Engine_PolyPerc.sc at master · monome/dust · GitHub)

def looks like this:

  SynthDef("PolyPerc", {
			arg out, freq = 440, pw=pw, amp=amp, cutoff=cutoff, gain=gain, release=release;
			var snd = Pulse.ar(freq, pw);
			var filt = MoogFF.ar(snd,cutoff,gain);
			var env = Env.perc(level: amp, releaseTime: release).kr(2);
			Out.ar(out, (filt*env).dup);
		}).add;

the argument cutoff is passed directly to the MoogFF Ugen (a ‘unit generator’ is the building block of supercollider processing.)

you want to add a new envelope modulating the cutoff time instead. or maybe just re-use the envelope that is already defined. like so:

  SynthDef("PolyPerc", {
			arg out, freq = 440, pw=pw, amp=amp, cutoff=cutoff, gain=gain, release=release;
			var snd = Pulse.ar(freq, pw);
			var env = Env.perc(level: amp, releaseTime: release).kr(2);
			var filt = MoogFF.ar(snd, env.linexp(0, 1, 10, cutoff), gain);
			Out.ar(out, (filt*env).dup);
		}).add;

we have replaced cutoff with env.linexp(0, 1, 10, cutoff). (the linexp method on Ugens takes 4 arguments <in_min, in_max, out_min, out_max> and produces an exponential mapping from the input range to the output range. so now our cutoff parameter controls the upper bound of the modulation range.)

6 Likes