[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Favourite SuperCollider Demo Patches
Here are a couple of things I have used for demos... To use the
first, sing a note, press the button and it will stretch it out (make
sure you start singing first and hold the note for a couple seconds
after you press the button)... then, you can keep doing this over and
over again adding more layers (you need my Warp1 UGen though).
The second is a "build a chord" type thing. enter intervals as an
array of semitones (1-half step, 2-whole step, 3-minor third, etc) or
decimals... and it will build a stack of pitchshifts according to the
intervals. They're kind of fun.
Josh
(
var window, button, numberbox, play = false, group = 1, buffer;
s = Server.internal;
s.boot;
SynthDef(\warp, {arg gate = 1, buffer = 0;
var env, controlenv, pointer;
env = EnvGen.kr(
Env([0, 1, 0], [1, 1], \sin, 1), gate, doneAction: 2);
RecordBuf.ar(HPF.ar(AudioIn.ar(1), 40), buffer, 0, 0.707, 1.0, 1, 0);
controlenv = Line.kr(0, 1, BufDur.kr(buffer));
pointer = LFNoise1.kr(BufDur.kr(buffer).reciprocal, 0.5, 0.5) *
controlenv;
a = Warp1.ar(
buffer, pointer, 1, 0.11, 8, 0.2) * env;
Out.ar(0, Limiter.ar([a, a], 0.5, 0.01));
}).load(s);
window = SCWindow("Warp", Rect(640, 40, 400, 220));
window.front;
button = SCButton(window, Rect(40, 50, 300, 100))
.states_([
["Start sound", Color.black, Color(0.3, 0.7, 0.3, 0.7)],
["Add to the sound", Color.black, Color(0.3, 0.3, 0.7)],
["Add to the sound", Color.black, Color(0.3, 0.3, 0.7)]])
.action_({arg me;
play.if({
s.sendMsg(\n_set, 1, \gate, 0);
});
play = true;
s.sendMsg(\s_new, \warp, s.nextNodeID, 0, 1, \buffer, buffer);
{me.value_(1)}.defer;
});
SCButton(window, Rect(40, 160, 130, 30))
.states_([[
"Stop the sound", Color.black, Color(0.7, 0.7, 0.7)]])
.action_({s.sendMsg(\n_set, 1, \gate, 0);
play = false;
AppClock.sched(1.0, {button.value_(0);
s.sendMsg(\b_alloc, buffer, 32768 * 4)})});
s.waitForBoot({
s.scope(2);
s.sendMsg(\b_alloc, buffer = s.bufferAllocator.alloc(1), 32768 * 4)});
)
(
var window, button, numberbox, play = false, group = 1;
s = Server.internal;
s.boot;
s.scope(2);
SynthDef(\harmony, {arg gate = 1, pch = 1, limit = 0.5;
var env;
env = EnvGen.kr(
Env([0, 1, 0], [1, 1], \sin, 1), gate, doneAction: 2);
a = PitchShift.ar(
HPF.ar(AudioIn.ar(1), 40), 0.11, pch, 0, 0.02) * env;
Out.ar(0, Limiter.ar([a, a], 0.5, 0.01));
}).load(s);
window = SCWindow("Harmonizer", Rect(640, 290, 400, 220));
window.front;
SCTextField(window, Rect(40, 50, 300, 100))
.action_({arg me;
var pitches;
play.if({
s.sendMsg(\n_set, 1, \gate, 0);
});
play = true;
pitches = me.value.interpret.asArray.midiratio;
group = s.nextNodeID.postln;
pitches.do{arg thispch;
s.sendMsg(\s_new, \harmony, s.nextNodeID, 0, 1, \pch, thispch,
\limit, pitches.reciprocal * 0.5)
};
});
SCButton(window, Rect(40, 160, 130, 30))
.states_([[
"Stop the sound", Color.black, Color(0.7, 0.7, 0.7)]])
.action_({s.sendMsg(\n_set, 1, \gate, 0)});
)
******************************************
Joshua Parmenter
joshp@xxxxxxxxxxxxxxxx
Post-Doctoral Research Associate - Center for Digital Arts and
Experimental Media
Raitt Hall - University of Washington
Seattle, Washington 98195
http://www.dxarts.washington.edu
http://homepage.mac.com/joshpar
On Jun 8, 2006, at 4:46 PM, scott micheli-smith wrote:
I've always like this one for some reason, by Mr. McCartney
(
var w, v, r, c;
w = SCWindow("icon", Rect(100,100,400,400));
w.view.background = Color(0.5,0.5,0.8);
r = Rect(180,180,40,40);
c = [7/16, 9/16];
8.do {|i|
v = SCStaticText(w, r);
v.background = Gradient(Color.grey(c[i>>1&1]),
Color.grey(c[i>>1+1&1]), [\h,\v][i&1]);
r = r.insetBy(-20,-20);
c = c + [-1/16, 1/16];
};
w.front;
)
_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users