From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #263 Reply-To: sc-users Sender: owner-sc-users-digest@lists.io.com Errors-To: owner-sc-users-digest@lists.io.com Precedence: bulk sc-users-digest Monday, March 19 2001 Volume 01 : Number 263 ---------------------------------------------------------------------- Date: Sat, 17 Mar 2001 16:46:31 -0600 From: James McCartney <---@---.---> Subject: Re: Pseq gets caught in loop on 3/16/01 3:20 PM, Julian Rohrhuber at sa6a014@rrz.uni-hamburg.de wrote: > I just don't understand why Pmul, for example, does not override its > parent anyway. I will change that in SC3. I agree that it should work as felix wrote it. However one problem is I think that a Pmul on \stretch outside a Ppar will no longer work, because it would happen after the Ppar had already done the scheduling. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Sat, 17 Mar 2001 20:41:56 -0800 (PST) From: crux xial <---@---.---> Subject: Re: GUIs and fun with envelopes wow, the colors transferred correctly into the body of the email. that would be a 'worldscript aware' feature ? i have noticed that you can drag a file from the finder onto an SC page and it will create an alias to that file. anybody notice any other useful things that can be done ? url links should work i would think. On Sat, 17 Mar 2001 15:53:16 -0600, sc-users@lists.io.com wrote: > For the list, I sent this to Lee directly originally because my > e-mail wasn't working correctly. It's okay since I sent the wrong > file. > > Lee > I'm sorry I realize now I sent the wrong file- the code in the e-mail > is correct but the file should match. Don't contemplate the file "GUI > FUN" too much - it is a mess!- MarkDavid > > here is the right code again: > > var w; > var > attackSlider,decaySlider,sustainSlider,releaseSlider,levelSlider,curveSlider,env,sColl,envView; > var amp,fb; > > w = GUIWindow.new("GUI Sliders", Rect.newBy(11, 43, 236, 236)) > .backColor_(rgb(0,0,0)); > > /*slider code*/ > attackSlider = SliderView.new( w, Rect.newBy(55, 119, 122, > 8), "A", 1, 0, 2, 0.001, 'linear') > .backColor_(rgb(129,84,209)).knobColor_(rgb(108,24,176)); > decaySlider = SliderView.new( w, Rect.newBy(55, 134, 122, 8), > "D", 0.2, 0, 2, 0.001, 'linear') > .backColor_(rgb(129,84,209)).knobColor_(rgb(108,24,176)); > sustainSlider = SliderView.new( w, Rect.newBy(55, 149, 122, > 8), "S", 0.25, 0, 2, 0.001, 'linear') > .backColor_(rgb(129,84,209)).knobColor_(rgb(108,24,176)); > releaseSlider = SliderView.new( w, Rect.newBy(55, 164, 122, > 8), "R", 1, 0, 2, 0.001, 'linear') > .backColor_(rgb(129,84,209)).knobColor_(rgb(108,24,176)); > levelSlider = SliderView.new( w, Rect.newBy(55, 179, 122, 8), > "LEVEL", 1, 0, 2, 0.001, 'linear') > .backColor_(rgb(129,84,209)).knobColor_(rgb(108,24,176)); > curveSlider = SliderView.new( w, Rect.newBy(55, 194, 122, 8), > "CURVE", -4, -10, 10, 0.001, 'linear') > .backColor_(rgb(129,84,209)).knobColor_(rgb(108,24,176)); > > /*labels*/ > StringView.new( w, Rect.newBy(5, 114, 42, 17), " > A").labelColor_(rgb(255,255,255)); > StringView.new( w, Rect.newBy(5, 129, 42, 17), " > D").labelColor_(rgb(255,255,255)); > StringView.new( w, Rect.newBy(5, 144, 42, 17), " > S").labelColor_(rgb(255,255,255)); > StringView.new( w, Rect.newBy(5, 159, 42, 17), " > R").labelColor_(rgb(255,255,255)); > StringView.new( w, Rect.newBy(5, 174, 42, 17), " > Level").labelColor_(rgb(255,255,255)); > StringView.new( w, Rect.newBy(5, 189, 42, 17), " > Curve").labelColor_(rgb(255,255,255)); > > /*This makes them update*/ > env = Env.adsr(attackSlider.value, decaySlider.value, > sustainSlider.value, > releaseSlider.value,levelSlider.value, curveSlider.value); > sColl = Synth.collect({ EnvGen.ar(env, 1, 0, 1, 0, > 0.01 / env.times.sum) }, 0.01); > envView = SignalView.new( w, Rect.newBy(54, 5, 124, > 110), sColl, 0, 1); > z = ceil(sColl.size / envView.bounds.width);envView.zoom = z; > attackSlider.action = {env = Env.adsr(attackSlider.value, > decaySlider.value, sustainSlider.value, > releaseSlider.value,levelSlider.value, curveSlider.value); > sColl = Synth.collect({ EnvGen.ar(env, 1, 0, 1, 0, > 0.01 / env.times.sum) }, 0.01); > envView = SignalView.new( w, Rect.newBy(54, 5, 124, > 110), sColl, 0, 1); > z = ceil(sColl.size / envView.bounds.width);envView.zoom = z;}; > decaySlider.action = {env = Env.adsr(attackSlider.value, > decaySlider.value, sustainSlider.value, > releaseSlider.value,levelSlider.value, curveSlider.value); > sColl = Synth.collect({ EnvGen.ar(env, 1, 0, 1, 0, > 0.01 / env.times.sum) }, 0.01); > envView = SignalView.new( w, Rect.newBy(54, 5, 124, > 110), sColl, 0, 1); > z = ceil(sColl.size / envView.bounds.width);envView.zoom = z;}; > sustainSlider.action = {env = Env.adsr(attackSlider.value, > decaySlider.value, sustainSlider.value, > releaseSlider.value,levelSlider.value, curveSlider.value); > sColl = Synth.collect({ EnvGen.ar(env, 1, 0, 1, 0, > 0.01 / env.times.sum) }, 0.01); > envView = SignalView.new( w, Rect.newBy(54, 5, 124, > 110), sColl, 0, 1); > z = ceil(sColl.size / envView.bounds.width);envView.zoom = z;}; > releaseSlider.action = {env = Env.adsr(attackSlider.value, > decaySlider.value, sustainSlider.value, > releaseSlider.value,levelSlider.value, curveSlider.value); > sColl = Synth.collect({ EnvGen.ar(env, 1, 0, 1, 0, > 0.01 / env.times.sum) }, 0.01); > envView = SignalView.new( w, Rect.newBy(54, 5, 124, > 110), sColl, 0, 1); > z = ceil(sColl.size / envView.bounds.width);envView.zoom = z;}; > levelSlider.action = {env = Env.adsr(attackSlider.value, > decaySlider.value, sustainSlider.value, > releaseSlider.value,levelSlider.value, curveSlider.value); > sColl = Synth.collect({ EnvGen.ar(env, 1, 0, 1, 0, > 0.01 / env.times.sum) }, 0.01); > envView = SignalView.new( w, Rect.newBy(54, 5, 124, > 110), sColl, 0, 1); > z = ceil(sColl.size / envView.bounds.width);envView.zoom = z;}; > curveSlider.action = {env = Env.adsr(attackSlider.value, > decaySlider.value, sustainSlider.value, > releaseSlider.value,levelSlider.value, curveSlider.value); > sColl = Synth.collect({ EnvGen.ar(env, 1, 0, 1, 0, > 0.01 / env.times.sum) }, 0.01); > envView = SignalView.new( w, Rect.newBy(54, 5, 124, > 110), sColl, 0, 1); > z = ceil(sColl.size / envView.bounds.width);envView.zoom = z;}; > > << File Attachment Removed: "application/mac-binhex40; name="envelope_sliders"" >> ::crucial-systems.com:: _______________________________________________________ Send a cool gift with your E-Card http://www.bluemountain.com/giftcenter/ ------------------------------ Date: Sat, 17 Mar 2001 22:57:24 -0600 From: James McCartney <---@---.---> Subject: FW: BOUNCE sc-users@lists.io.com: Non-member submission from [Jeremy Zuckerman ] - --------- Subject: dynamically changing the contents of an array From: Jeremy Zuckerman <---@---.---> Would someone lend a hand with something I've been struggling with for a while? I'm building an asynchronous panner. For example, if I want to pan from chan1 to chan4 it appears that with the existing pan Ugens I'm forced to pan across channels 2 and 3 first. I remedied this by building a class of two crossfading PanAz's using sequencers to input the array values and index through them: chan1 -> chan7 -> chan3 -> chan6 etc. Now I want to be able to change the arrays of channel values dynamically. I tried using Pseq and Pswitch inside of a Pbind but spawning the panner doesn't deliver the desired results. I'd really appreciate any help. Here's an example of my code: ( /* asynchronous panner */ var w; var in, chnls, width, check, rateSlider; var positionA, positionB; var gestMin, gestpace, xfade; var offset; var offsetA, offsetB; var trigA, trigB; w = GUIWindow.new("panel", Rect.newBy(215, 91, 252, 206)) .backColor_(rgb(104,118,231)); check = CheckBoxView.new( w, Rect.newBy(29, 25, 141, 31), "on/off", 0, 0, 1, 0, 'linear'); rateSlider = SliderView.new( w, Rect.newBy(29, 99, 191, 63), "rate", 0, 0, 5, 0, 'linear'); StringView.new( w, Rect.newBy(29, 75, 128, 20), "Gesture Rate"); gestMin = 0.2; offset = 2pi/1.333333; offsetA = pi; offsetB = 2pi; s = Wavetable.sineFill( 1024, [1]); t = Wavetable.sineFill( 2048, [1, 0, 1/9, 0, 1/25, 0, 1/49, 0, 1/81, 0, 1/121], [2pi, 2pi, pi, 2pi, 2pi, 2pi, pi, 2pi, 2pi, 2pi, pi] ); Synth.scope({ in = WhiteNoise.ar(0.5); chnls = 8; gestpace = gestMin+rateSlider.kr; width = 2.0; Pause.ar({ trigA = Osc.kr(s, gestpace, offsetA); trigB = Osc.kr(s, gestpace, offsetB); positionA = Sequencer.kr( `([0, 6]), trigA ); // 1st channel in array ('positionB') is heard last positionB = Sequencer.kr( `([2, 4]), trigB ); xfade = Osc.ar(t, gestpace, offset, 0.25, 0.25); /* my class which I haven't included: InputFunc2.ar(in, chnls, positionA, xfade, width, positionB ); */ PanAz.ar( chnls, in, 2.0*positionA/chnls, 0.5-xfade, width ) + PanAz.ar( chnls, in, 2.0*positionB/chnls, xfade, width ); }, check.kr); }); w.close ) Thanks all. Jeremy ------------------------------ Date: Sun, 18 Mar 2001 01:05:17 -0800 From: Jeremy Zuckerman <---@---.---> Subject: oops Sorry all. I sent this email from the wrong account (thanks for posting it anyway James) : Would someone lend a hand with something I've been struggling with for a while? I'm building an asynchronous panner. For example, if I want to pan from chan1 to chan4 it appears that with the existing pan Ugens I'm forced to pan across channels 2 and 3 first. I remedied this by building a class of two crossfading PanAz's using sequencers to input the array values and index through them: chan1 -> chan7 -> chan3 -> chan6 etc. Now I want to be able to change the arrays of channel values dynamically. I tried using Pseq and Pswitch inside of a Pbind but spawning the panner doesn't deliver the desired results. I'd really appreciate any help. Here's an example of my code: ( /* asynchronous panner */ var w; var in, chnls, width, check, rateSlider; var positionA, positionB; var gestMin, gestpace, xfade; var offset; var offsetA, offsetB; var trigA, trigB; w = GUIWindow.new("panel", Rect.newBy(215, 91, 252, 206)) .backColor_(rgb(104,118,231)); check = CheckBoxView.new( w, Rect.newBy(29, 25, 141, 31), "on/off", 0, 0, 1, 0, 'linear'); rateSlider = SliderView.new( w, Rect.newBy(29, 99, 191, 63), "rate", 0, 0, 5, 0, 'linear'); StringView.new( w, Rect.newBy(29, 75, 128, 20), "Gesture Rate"); gestMin = 0.2; offset = 2pi/1.333333; offsetA = pi; offsetB = 2pi; s = Wavetable.sineFill( 1024, [1]); t = Wavetable.sineFill( 2048, [1, 0, 1/9, 0, 1/25, 0, 1/49, 0, 1/81, 0, 1/121], [2pi, 2pi, pi, 2pi, 2pi, 2pi, pi, 2pi, 2pi, 2pi, pi] ); Synth.scope({ in = WhiteNoise.ar(0.5); chnls = 8; gestpace = gestMin+rateSlider.kr; width = 2.0; Pause.ar({ trigA = Osc.kr(s, gestpace, offsetA); trigB = Osc.kr(s, gestpace, offsetB); positionA = Sequencer.kr( `([0, 6]), trigA ); // 1st channel in array ('positionB') is heard last positionB = Sequencer.kr( `([2, 4]), trigB ); xfade = Osc.ar(t, gestpace, offset, 0.25, 0.25); /* my class which I haven't included: InputFunc2.ar(in, chnls, positionA, xfade, width, positionB ); */ PanAz.ar( chnls, in, 2.0*positionA/chnls, 0.5-xfade, width ) + PanAz.ar( chnls, in, 2.0*positionB/chnls, xfade, width ); }, check.kr); }); w.close ) Thanks all. Jeremy ------------------------------ Date: Sat, 17 Mar 2001 16:54:19 +0100 From: Julian Rohrhuber <---@---.---> Subject: Re: oops Jeremy Zuckerman wrote: > > Sorry all. I sent this email from the wrong account (thanks for posting it > anyway James) : > > Would someone lend a hand with something I've been struggling with for a > while? > > I'm building an asynchronous panner. For example, if I want to pan from > chan1 to chan4 it appears that with the existing pan Ugens I'm forced to pan > across channels 2 and 3 first. I remedied this by building a class of two > crossfading PanAz's using sequencers to input the array values and index > through them: chan1 -> chan7 -> chan3 -> chan6 etc. Now I want to be able > to change the arrays of channel values dynamically. I tried using Pseq and > Pswitch inside of a Pbind but spawning the panner doesn't deliver the > desired results. I'd really appreciate any help. Here's an example of my maybe this works the way you like it to: ( Synth.scope({ var nch, trig, p, silence; nch = 8; trig = Impulse.kr(2); //improvised trigger p = MouseX.kr(-1,1); silence = Plug.ar(0); silence = Array.fill(nch-2, { silence }); TrigXFade.ar({ var sound, out; sound = Pan2.ar(SinOsc.ar(300, 0,0.1), p); //results in 2 chsnnnels; out = sound ++ silence; out = out.scramble; }, trig, 0.5, nch) }); ) ( //random channel crossfading Synth.scope({ var nch, vols, openOld, fadetime; nch = 8; fadetime = 0.5; openOld = Array.fill(2, { nch.rand }); //init openOld vols = Array.fill(nch, { Plug.kr(0) }); thisSynth.repeat(0, 2, { var openNew; openNew = Array.fill(2, { nch.rand }); openOld.do({ arg i; vols.at(i).line(0, fadetime); }); openNew.do({ arg i; vols.at(i).line(1, fadetime); }); openOld = openNew; }); SinOsc.ar(300, 0, 0.1)*vols }); ) ------------------------------ Date: Mon, 19 Mar 2001 20:24:39 -0500 From: christian adam hresko <---@---.---> Subject: recur are there any books, like the art and science of recursion or something along those lines? i'm one of those slow people, and this binary tree project (which is also a doubly linked list... deleting a node kinda sucks) is driving me nuts. just curious if anyone's found a decent book on recursion, other than a few pages out of your typical programming book. cheers, christian ------------------------------ End of sc-users-digest V1 #263 ******************************