I found a small tutorial and followed all the steps from:
monome norns, supercollider and lua — part 1
- connected via ssh to norns
- used visual studio code editor
- created a folder and file
- copied the SC code
- compiled the code
- restarted norns
- Opened Maiden editor
- created folder + file
- copied Lua script into the file
- ran the script
I was able to hear now some ‘haunting noises’, but in norns it said “init error” and I couldn’t toggle from no play to play. And the script I heard in Maiden running was identical with what I heard in the SC IDE when I just pasted the code in there.
Any thoughts?
SC code for SC IDE:
// Copied from https://composerprogrammer.com/teaching/supercollider/sctutorial/1.1%20Getting%20Started.html
({
var n = 11; //try changing me to 34, or 3, and then re-running...
Resonz.ar(
Mix.fill(n,{
var freq=rrand(50,560.3);
var numcps= rrand(2,20);
Pan2.ar(Gendy1.ar(6.rand,6.rand,1.0.rand,1.0.rand,freq ,freq, 1.0.rand, 1.0.rand, numcps, SinOsc.kr(exprand(0.02,0.2), 0, numcps/2, numcps/2), 0.5/(n.sqrt)), 1.0.rand2)
}),
MouseX.kr(100,2000),
MouseY.kr(0.01,1.0)
);
}.play)
Code for Norns:
Engine_GendyTutorial : CroneEngine {
var rez_x=100, rez_y=0.5, fill=50;
var <synth;
*new { arg context, doneCallback;
^super.new(context, doneCallback);
}
alloc {
SynthDef(\GendyTutorial, {|inL, inR, out, rez_x=100, rez_y=0.5|
var sound = {
Resonz.ar(
Mix.fill(fill, {
var freq=rrand(50,560.3);
var numcps= rrand(2,20);
Pan2.ar(Gendy1.ar(6.rand,6.rand,1.0.rand,1.0.rand,freq ,freq, 1.0.rand, 1.0.rand, numcps, SinOsc.kr(exprand(0.02,0.2), 0, numcps/2, numcps/2), 0.5/(fill.sqrt)), 1.0.rand2)
}),
rez_x,
rez_y
);
};
Out.ar(out, sound);
}).add;
context.server.sync;
synth = Synth.new(\GendyTutorial, [
\inL, context.in_b[0].index,
\inR, context.in_b[1].index,
\out, context.out_b.index,
\rez_x, 100,
\rez_y, 0.5],
context.xg);
this.addCommand("x", "i", {|msg|
synth.set(\rez_x, msg[1]);
});
this.addCommand("y", "f", {|msg|
synth.set(\rez_y, msg[1]);
});
}
free {
synth.free;
}
}
Lua code in Maiden editor:
engine.name = "GendyTutorial"
function init()
-- map our supercollider controls to norns parameters
params:add_control("x", controlspec.new(100,2000,"lin",0,0,""))
params:set_action("x", function(x) engine.x(x) end)
params:add_control("y", controlspec.new(0.01, 1.0,"lin",0,0,""))
params:set_action("y", function(x) engine.y(x) end)
-- set some initial values
mix.output(0.5)
engine.x(300)
engine.y(0.5)
engine.stopAll()
end
function enc(n,delta)
-- map our encoder changes to parameters
if n == 1 then
mix:delta("output", delta)
elseif n == 2 then
params:delta("x", delta)
elseif n == 3 then
params:delta("y", delta)
end
end