From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #345 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 Sunday, August 19 2001 Volume 01 : Number 345 ---------------------------------------------------------------------- Date: Fri, 17 Aug 2001 09:15:44 -0500 From: James McCartney <---@---.---> Subject: Re: Plug rules on 8/17/01 8:04 AM, Ronald J. Kuivila at rkuivila@mail.wesleyan.edu wrote: > You mentioned a while ago that, in order to conserve cache space, Plugs > will be needed to poll UGen's. Along related lines, is the following OK, > or does a separate plug need to be made for each Spawn'ed synth? > > Synth.play({ var onePlug; > onePlug = Plug.kr(somewidget); > TSpawn.ar({FsinOsc.ar(onePlug,0.1)},...) > }) > Yes that is OK. > (The above example is written in SC2 style, but the question applies to > SC3. Also, what are the different mode's of a plug?) What do you mean by modes? - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Fri, 17 Aug 2001 23:42:47 +0200 From: Julian Rohrhuber <---@---.---> Subject: interrefering crickets //interrefering crickets ( var amalie, k, freqs; k = #[ 1, 1, 1, 0 ]; freqs = Array.rand(10, 7000, 8600); amalie = { arg liste, n; var s, neu; n.do({ neu = liste.collect({ arg item; if(item == 0, { 1 }, { 0})}); liste = liste ++ neu }); liste }; play({ var intensity, phase, out; intensity = MouseY.kr(-0.02, -0.1); phase = MouseX.kr(0, 2*pi); out = OverlapTexture.ar({ arg spawn, i; var freq, f0, amp; freq = (60 + 7.rand).midicps; f0 = rrand(10.0, 20.0); amp = Mix.krFill(2, { arg i; var df, f1, seq; seq = amalie.value(k, rrand(1, 5)); df = Sequencer.kr(`seq, Impulse.kr(10)); f1 = df * f0 + freq; SinOsc.kr(f1, i * phase, 0.1, intensity); }).max(0); Pan2.ar( SinOsc.ar(freqs.choose * WhiteNoise.kr(0.02, 1), 0, amp/10), 1.0.rand2 ) }, 25, 8, 3, 2); 3.do({ out = AllpassL.ar(out, 0.03, [0.02 + 0.01.rand2, 0.02 + 0.01.rand2], 0.08, 1) }); out }); ) ------------------------------ Date: Fri, 17 Aug 2001 23:42:47 +0200 From: Julian Rohrhuber <---@---.---> Subject: interrefering crickets //interrefering crickets ( var amalie, k, freqs; k = #[ 1, 1, 1, 0 ]; freqs = Array.rand(10, 7000, 8600); amalie = { arg liste, n; var s, neu; n.do({ neu = liste.collect({ arg item; if(item == 0, { 1 }, { 0})}); liste = liste ++ neu }); liste }; play({ var intensity, phase, out; intensity = MouseY.kr(-0.02, -0.1); phase = MouseX.kr(0, 2*pi); out = OverlapTexture.ar({ arg spawn, i; var freq, f0, amp; freq = (60 + 7.rand).midicps; f0 = rrand(10.0, 20.0); amp = Mix.krFill(2, { arg i; var df, f1, seq; seq = amalie.value(k, rrand(1, 5)); df = Sequencer.kr(`seq, Impulse.kr(10)); f1 = df * f0 + freq; SinOsc.kr(f1, i * phase, 0.1, intensity); }).max(0); Pan2.ar( SinOsc.ar(freqs.choose * WhiteNoise.kr(0.02, 1), 0, amp/10), 1.0.rand2 ) }, 25, 8, 3, 2); 3.do({ out = AllpassL.ar(out, 0.03, [0.02 + 0.01.rand2, 0.02 + 0.01.rand2], 0.08, 1) }); out }); ) ------------------------------ Date: Fri, 17 Aug 2001 20:33:21 -0400 From: felix@crucial-systems.com Subject: Re: text selection / sc2 dynamic GUI >>I have several apps written to run in X which I would like >>to recreate in SC (so I can retire my trusty Indy). One >>is a soundfile markup system which generates an ascii >>list of starting and endtime times for marked segments >>of a soundfile. Then, having created the list double clicking >>on any such pair will play that sound segment. >> >>I don't see any equivalent of XmTextGetSelection in SC2. Is this >>something to wait for SC3 for? >> >>Has anyone done something like this? >> >>Creating the marks is another question but this is relatively easy >>using Snack/WaveSurfer. >> >>thanks >>paul lansky >jr >this should be not so hard to do in sc2 and sc3. Felix has done the >SFP classes that play soundfiles from disk, so there only needs to be >a parser for the start-end-file text and a GUI that displays the >pairs as clickable views. Or do I miss the true problem? specifically you could parse the text files into SFPCrop objects. they would each define a section of a sound file. segment = SFPCrop( SFP(pathOfSoundFile), starttime, endtime); PlayerPool I think might, and SFPPool definitely already lets you switch at will between these segments, programmatically or by gui. any number of other guis can be built to just tell an SFPCrop to play itself at any moment. segment.play; // plays it TSpawn({ segment.ar }, etc.); // could trigger it off of here I also have a new class called MonoSpawn that always plays one and only one voice using a given envelope. can be triggered from buttons, events etc. the other advantage of the SFP encapsulation is that they can all be quickly told to preload themselves so they load double buffers and can play immediately. a composite structure ( a sequence of SFPCrops ) can act as a single component. SFP can be placed inside of patterns eg: Prand( [ anSFP, anSFP2, anSFP3],inf).play once again i stress that SFP etc. can be used with no gui or with a completely different gui without any trouble at all. ( in case you don't like my flavor of convenience) also, I have new Layout classes for SC2 : HorzLayout and VertLayout that work similar tp HLayout and VLayout in sc3. dynamic resizing, add drop elements etc. If anyone is fascinated with making sc2 gui improvements, let me know i can give you the classes. it just occurred to me how to do it and next thing i knew... a scrolling view would be annoyingly hard, but a tab-view / drawer system is easy enough in sc2. _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Sat, 18 Aug 2001 11:02:17 -0400 (EDT) From: "Ronald J. Kuivila" <---@---.---> Subject: Re: Plug rules > > > (The above example is written in SC2 style, but the question applies to > > SC3. Also, what are the different mode's of a plug?) > > What do you mean by modes? > > there is a 'mode' argument in the SC3 version of plug. It is set to \gate in some examples. RJK ------------------------------ Date: Sun, 19 Aug 2001 01:19:22 +0200 From: Julian Rohrhuber <---@---.---> Subject: getting rid of any enclosed running UGens similar to EndThresh (SC3) i would like to write a UGen that gets rid of all enclosed running UGens (inclusively itself) when triggered. I tried this, but this releases all other envelopes in the same Synth, so it is useless. Moreover, the full number of UGens are running after the envelope got released. LimTrig { *ar1 { arg in, trig; var env, seq; env = EnvGen.kr(Env.asr(0, 1, 0, 1, 'linear')); seq = Sequencer.ar({ arg i; if(i != 0, { thisSynth.release }); 1.0 }, trig); ^in * env * seq } } ------------------------------ Date: Sun, 19 Aug 2001 09:35:36 +0200 From: jr@xs4all.nl (joel ryan) Subject: GC signal memory Does anyone have any recommendations re recycling sound file (signal) memory? I'm looking for the object: dictionary, array, list, which is best suited to storing sounds but whose memory is garbage collected rapidly after references are purged. I'm reluctant to use a sophisticated construction which might keep references around I don't know about. Julian's Signal Bank method seems foolproof but I would prefer to use named references (like Library3). SignalBanks use of List indexes makes keeping track of which file is where a bit awkward since numerical order of the objects shifts each time files are is deleted JRyan - -- - -=-=-=-=---=-=-=-=-===-----=-==-=-=-====---=------=-------- Joel Ryan STEIM :: Ballett Frankfurt :: Institute of Sonology Achtergracht 19, 1017WL Amsterdam +31 (20) 624-3886 +31 (20) 626-4262 fax http://www.frankfurt-ballett.de/joel.html http://www.steim.nl ------------------------------ Date: Sun, 19 Aug 2001 15:09:12 +0200 From: Julian Rohrhuber <---@---.---> Subject: Re: GC signal memory >Does anyone have any recommendations >re recycling sound file (signal) memory? >I'm looking for the object: dictionary, array, list, >which is best suited to storing sounds >but whose memory is garbage collected rapidly after >references are purged. > >I'm reluctant to use a sophisticated construction >which might keep references around I don't know about. > >Julian's Signal Bank method seems foolproof >but I would prefer to use named references (like Library3). >SignalBanks use of List indexes makes keeping track of which file is where >a bit awkward since numerical order of the objects shifts each time >files are is deleted >JRyan >-- true, I've had this problem, too. I could make a version that uses an IdentityDictionary mapping paths to indices, so that this problem is solved. ------------------------------ Date: Sun, 19 Aug 2001 16:52:21 +0200 From: Jesper El=?ISO-8859-1?B?6Q==?=n <---@---.---> Subject: Synth question Hi! I am trying to plot an envelope while playing. I can't use Synth.collect. I guess there must be some better way than this in SC2.2.11? Jesper ( Synth.play({arg syn; var w, v1, env, eg, sig, len, n, zoom, s1, s2, s3, s4, s5, trig, kr, krps; trig = Impulse.kr(1); kr = syn.blockSize / Synth.sampleRate; krps = Synth.sampleRate / syn.blockSize; sig = Signal.newClear(0); w = GUIWindow.new("Envelope", Rect.newBy( 40, 40, 528, 420 )); v1 = SignalView.new( w, Rect.newBy( 21, 23, 460, 200 ), y, -1, 1); s1 = SliderView.new( w, Rect.newBy( 21, 260, 460, 20 ), " ", 0.1, 0.0, 0.3); s2 = SliderView.new( w, Rect.newBy( 21, 290, 460, 20 ), " ", 0.3, 0.0, 0.5); s3 = SliderView.new( w, Rect.newBy( 21, 320, 460, 20 ), " ", 0.3, 0.0, 0.5); s4 = SliderView.new( w, Rect.newBy( 21, 350, 460, 20 ), " ", 1.0, 0.1, 1.0); s5 = SliderView.new( w, Rect.newBy( 21, 380, 460, 20 ), " ", 0.1, -16, 16); env = Env.linen(s1.value, s2.value, s3.value, s4.value, s5.value); eg = EnvGen.kr(env); TSpawn.ar({arg spawn, count, s; sig = Signal.newClear(0); env = Env.linen(s1.value, s2.value, s3.value, s4.value, s5.value); eg = EnvGen.kr(env); len = env.times.sum; zoom = ceil(len / v1.bounds.width); v1.zoom = zoom; n = (krps * len).floor; s.repeatN( kr, kr, n, { sig = sig.add(eg.poll); }); s.sched( kr * n, { v1.signal = sig; v1.refresh; }); Plug.kr(0) * eg; }, 1, nil, trig); Spawn.ar({ SinOsc.ar(444, 0, EnvGen.kr( Env.linen(s1.value, s2.value, s3.value, s4.value, s5.value))); }, 1, 1); }); GUIWindow.closeAll; ) ------------------------------ End of sc-users-digest V1 #345 ******************************