From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #76 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 Wednesday, December 8 1999 Volume 01 : Number 076 ---------------------------------------------------------------------- Date: Fri, 26 Nov 1999 07:34:17 -0700 From: James McCartney <---@---.---> Subject: Re: calculating the size a list needs in RAM At 2:03 AM -0700 11/26/99, Ioannis Zannos wrote: >Hmm, details: > >> >- for a #[ type list of lists full of numbers. >> > >> >The numbers are not defined as integers but could be if this will reduce >> >the size. >> >> each slot takes 8 bytes. An object header is 32 bytes. >> A slot can hold an Integer, Float, Char or Symbol all in place, >> or a pointer to an object. > >So that means that each integer stored in the list would cost: >8 bytes for the slot of the list + >32 bytes for the header of the integer object stored + >4 bytes for the integer itself. >--- >= 44 bytes total. > >Is that right? No. Integers, Floats Symbols and a few other things are stored in the slot directly. There is no object. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 26 Nov 1999 17:39:33 -0500 From: Mic Berends <---@---.---> Subject: Hilbert's 10th. request to the list: if you know of an audio environment on the SGI or Mac (probably but not preferably dataflow) that would allow me to do the following (i've quoted my previous message here) relatively simply (it's very simple!) please let me know. thanks. Yer Mate, Diophantus. - -- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>v ^ Mic Berends : in the end, : Tomorrow Maximum v ^ MINDESIGN limited : there can be : Heaven Kissing EP v ^ http://www.mindesign.com/ : only one. : available now. v ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Mic Berends wrote: > > hi Martin! > thanks very much for the assist. your example looks very much like a > manifestation of the Harmonic Math but if i have Lawrence's methodology > down, it goes something like this: > > 1. i want to add, not mul, the modifier wave to the source wave @ > (theta? what is the value of x at a specific phase of a periodic > function called?) > > e.g i have a (-1,1) sine wave. i add a (0,2) ramp of the same period to > it, the left end gets 0 added to it, the right end gets 2 added to it, > and all the values in-between get an amount added to them equal to the > value of the ramp at the same phase. the ramp has to be (0,2) to > accommodate the abs (2) number space of (-1,1) signed arithmetic. > iterate this over the waveform achieved each period with folding or > wrapping at +1 of the values achieved (there won't be any negative space > folding or wrapping obviously). i don't see how to do this with > continuous functions ugens. we do not want to add or mult the whole > source wave by a single value, it's a (possibly) non-linear distortion. > wavetables have a static storage facility which is why i was going at it > that way... > > > .... but requires 'n' to be impossibly large to complete a full cycle and > > results in (n+1)*3 UGens. > > right, when i increase n to a useful number my CPU gets pegged quickly, > which is also why i wanted to use wavetables, as well as their > flexibility in other explorations of this theory. these include the > "moire" phenomena of integer ratio harmonic structures (not limited or > approximated by the mathematical precision of whatever lib we're using > since i expect with many many iterations rounding error would rear its > ugly head) and variable quantisation extrapolations of that area. also > n dim matrix ops and convolution seem to be a fruitful area for > experimentation in combination with all this. > > thanks again. my apologies for the laboured + convoluted explanation; > i'm a visual artist and not much of a mathematician. > > Cheers, > Mic. > ------------------------------ Date: Fri, 26 Nov 1999 19:56:14 -0500 From: christian hresko <---@---.---> Subject: SCPlay sorry if this seems like a really stupid question, but i've only been using supercollider for a few weeks now. (just barely actually...) anyway, what's the difference between SCPlay and SuperCollider 2.x.x? is this similar to max/msp where you can use SCPlay (in this case) to read Super_Collider files, but not 'create' them? on a completely unrelated note, has anyone heard the project Super_Collider by christian vogel? (and company) some massive amounts of processing on this release, and i was just curious if anyone knew if mr. vogel used SC in its making. cheers, christian - -- " there is no spoon. " ------------------------------ Date: Fri, 26 Nov 1999 19:26:42 -0700 From: James McCartney <---@---.---> Subject: Re: SCPlay At 5:56 PM -0700 11/26/99, christian hresko wrote: >sorry if this seems like a really stupid question, but i've only been using >supercollider for a few weeks now. (just barely actually...) anyway, what's >the difference between SCPlay and SuperCollider 2.x.x? is this similar to >max/msp where you can use SCPlay (in this case) to read Super_Collider files, >but not 'create' them? SCPlay will load class libraries. In SC2 there is a Compress Library... menu command that will create a compressed class library file that SCPlay can load. You must write your Main class so that it does what you need in its startUp and run methods. > >on a completely unrelated note, has anyone heard the project Super_Collider by >christian vogel? (and company) some massive amounts of processing on this >release, and i was just curious if anyone knew if mr. vogel used SC in its >making. No idea. Can you read this? http://www.evolver.at/musik/scoll.html I can't... --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 26 Nov 1999 19:31:44 -0700 From: James McCartney <---@---.---> Subject: Re: End of the line At 4:45 PM -0700 11/24/99, Julian Rohrhuber wrote: >it seems that a Spawn that has stopped returns nil. Is that the reason? >What does the debug info mean? Sorry that is not an error. It is a debug statement that I forgot to remove. Your code is OK. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 26 Nov 1999 19:34:27 -0700 From: James McCartney <---@---.---> Subject: Re: How to convert precision patterns into floating sound? At 3:36 PM -0700 11/24/99, Lawrence Ball wrote: >Hi Martin,Mic,James and all > >Harmonic Mathematics has to be performed in an engine which deals in >integers or integer-equivalents. Sounds like you are going to need to write your own unit generator in C once I make that available. It is not possible at this time. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sat, 27 Nov 1999 12:57:37 +0000 From: Martin Robinson <---@---.---> Subject: Re: SCPlay > on a completely unrelated note, has anyone heard the project Super_Collider by > christian vogel? (and company) some massive amounts of processing on this > release, and i was just curious if anyone knew if mr. vogel used SC in its > making. As far as I know "Mr. Vogel" doesn't use SC that much, although I did some gigs with him recently and I used SC to spacialise what he was doing (e.g. approximating bpm then ping-pong-pang-pung). I think theres a lot of Nord modular in there. Martin. >>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ <><><>__this.liveElectronics.interFaces.diffusion ____ || ------------------------------ Date: Sun, 28 Nov 1999 03:11:26 -0700 From: James McCartney <---@---.---> Subject: Re: OMS error when SC in background At 10:55 AM -0700 11/23/99, Matthew Rogalsky wrote: >ABControl would ideally be the foreground application -- otherwise its >spatial movements can become jerky. However when I put SC in the >background I immediately get an error: >OMSWriteDataAsync Failed:5 > >Is this something easy to fix? This seems like a problem between OMS and the MacOS. I've been talking with the author of OMS about it, but there is no resolution yet. Somehow the VBL task is not picking up OMS events if OMSWriteAsync is called from within a sound card interrupt. Or at least that is how it appears so far.. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sun, 28 Nov 1999 21:47:43 +0100 From: Julian Rohrhuber <---@---.---> Subject: Re: SCPlay as far as I have understood from Task.help, you can trigger a filewriting, but a reading has to be inside a Task. Why do I get only zeros when I read from file? ( { var a; a = SinOsc.ar(100, 0, 0.01); Sequencer.kr({ var f, b; // write a File b = Array.fill(3, { rrand(1, 64) }); f = File("test", "w"); b.do({ arg item; f.write(item); }); f.close; 0.0 }, MouseX.kr(-1,1) > 0); Task({ var f, g, e; loop({ // read a File g = File("test", "r"); e = g.readAllFloat; g.close; e.do({ arg item; item.trunc(1).post; " ".post }); "\n".post; 4.wait; }) }); a }.play; ) ------------------------------ Date: Mon, 29 Nov 1999 10:45:25 -0800 From: Mark Polishook <---@---.---> Subject: Re: more tspawn asr > James, Thanks for your help...which led to this solution (within Tspawn) cb.action = { if (cb.value < 1, { synth.release }) }; - -mark > > > The following works once - I can't repeatedly turn the Tspawn on and off (only > on and off once). > > What have I missed? > > Thanks (again), Mark > > ( > > var w, cb, envelope, x; > w = GUIWindow.new("panel", Rect.newBy(128, 64, 206, 130)); > cb = CheckBoxView.new( w, Rect.newBy(24, 36, 128, 20), "CheckBoxView", 0, 0, > 1, 0, 'linear'); > > envelope = Env.asr(1, 1, 2); > > Synth.play({ > > TSpawn.ar({ arg spawn, i, synth; > > cb.action = { synth.release }; > SinOsc.ar(200, 0, 0.8) * EnvGen.kr(envelope) }, trig: cb.kr) > > }); > > w.close > > ) ------------------------------ Date: Mon, 29 Nov 1999 20:31:35 +0100 From: Ioannis Zannos <---@---.---> Subject: Re: calculating the size a list needs in RAM James McCartney wrote: > > > No. Integers, Floats Symbols and a few other things are stored in > the slot directly. There is no object. How does the Collection know what kind of object is in a slot then? A sort of shorthand object type descriptor for the slot, encoded within the 8 bytes of the slot itself? Iannis Zannos ------------------------------ Date: Wed, 01 Dec 1999 12:04:10 +0100 From: Julian Rohrhuber <---@---.---> Subject: MIDINoteGate using MIDINoteGate to trigger TSpawn I get an ever-on after a while. Is that due to oms or maybe a bug in MIDINoteGate? ------------------------------ Date: Wed, 1 Dec 1999 17:22:17 -0500 (EST) From: Landon Rose <---@---.---> Subject: OMSWriteDataAsync error workarounds James- here are two patches that allow me to switch to another application when SC is running so that I don't have to stop sound, and sending MIDI can be continued when I switch back to SC. This one I have only minor question: how do I close the slider window when this patch is stopped? ( var velocity, trig, box1; velocity = { var w, a, b, c, d, e; w = GUIWindow.new("MIDI send", Rect.new( 128, 64, 472, 176 )); box1 = CheckBoxView.new( w, Rect.new( 18, 15, 66, 35 ), "On", 0, 0, 1, 0, 'linear'); a = NumericalView.new( w, Rect.new( 84, 23, 148, 43 ), "NumericalView", 0, 0, 127, 1, 'linear'); b = SliderView.new( w, Rect.new( 156, 24, 284, 44 ), "SliderView", 0, 0, 127, 1, 'linear'); a.action = { b.value = a.value }; b.action = { a.value = b.value }; }.value; Synth.scope({ trig = Impulse.kr(6, 0.1); Sequencer.kr({ if ( box1.value > 0, { MIDIOut(0).control(1,7,velocity.value)}); 0.0}, trig); FSinOsc.ar(440,0.2) }); ) Second patch there is a bigger problem. When I turn on the button what I've written overloads the cpu in time with Impulse.kr. What's happening? ( var pat; var w, box1; var trig; var up, down; up = #[40,45,50,55,60, 65,70,75,80,85,90,95,100,105,110,115,120,127]; down = up.reverse; pat = Pseq([ Pbind(\velocity, Pseq( up,1), \dur, 0.1, \ugenFunc, { arg velocity ; MIDIOut(0).control(1,7,velocity); nil; }), Pbind(\velocity, Pseq(down,1), \dur, 0.1, \ugenFunc, { arg velocity ; MIDIOut(0).control(1,7,velocity); nil; })], 1); w = GUIWindow.new("panel", Rect.new( 128, 64, 346, 164 )); box1 = CheckBoxView.new( w, Rect.new( 18, 15, 186, 35 ), "MIDI Controller send", 0, 0, 1, 0, 'linear'); Synth.scope({ trig = Impulse.kr(1, 0.1); Sequencer.kr({ if ( box1.value > 0, { pat.asSpawn(Event.protoEvent)}); 0.0}, trig); FSinOsc.ar(440, 0.2) }); w.close ) Thanks Landon ------------------------------ Date: Wed, 1 Dec 1999 23:19:39 -0600 (EST) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: calculating the size a list needs in RAM On Mon, 29 Nov 1999, Ioannis Zannos wrote: > > > James McCartney wrote: > > > > > > No. Integers, Floats Symbols and a few other things are stored in > > the slot directly. There is no object. > > How does the Collection know what kind of object > is in a slot then? A sort of shorthand object type > descriptor for the slot, encoded within the > 8 bytes of the slot itself? Yes. There is a 4 byte tag that looks like a Not-a-Number. If the tag is not a Not-a-Number then the value is a double precision float. ------------------------------ Date: Fri, 3 Dec 1999 17:12:39 +0100 From: Martin Stepanek <---@---.---> Subject: mousebuttonDownAction ? Is there a way to make MouseX or MouseY work only if you press the mouse button? so that it would just change the frequency in the example when you press the mouse button? { SinOsc.ar(Plug.kr(MouseX.new(200, 2000,'exponential')), 0, 0.1) }.play; ciao, martin ------------------------------ Date: Fri, 3 Dec 1999 22:35:32 -0600 (EST) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: mousebuttonDownAction ? I didn't make a controller for the mouse button because it is already used to drive the interface. It seemed not often useful, however it is easy enough to add, so I'll do so for the next version. On Fri, 3 Dec 1999, Martin Stepanek wrote: > Is there a way to make MouseX or MouseY work only if you press the mouse > button? > so that it would just change the frequency in the example when you press > the mouse button? > > { SinOsc.ar(Plug.kr(MouseX.new(200, 2000,'exponential')), 0, 0.1) }.play; > > ciao, > martin > > > ------------------------------ Date: Sat, 4 Dec 1999 12:43:35 +0100 From: Martin Stepanek <---@---.---> Subject: Re: mousebuttonDownAction ? >I didn't make a controller for the mouse button because >it is already used to drive the interface. It seemed >not often useful, however it is easy enough to add, so I'll >do so for the next version. > cool, i-ll look forward to that. martin ------------------------------ Date: Sat, 04 Dec 1999 09:51:12 -0700 From: David Cottle <---@---.---> Subject: Array = array Hi, A student and I are a little confused about array assignment. He discovered that if you do this: a = [1, 2, 3]; b = [4, 5, 6]; c = [x, y, z]; b = a; c = b; d = a.add(4); The result is that all four arrays will become [1, 2, 3, 4]. Even c, which has no clear relation to a is changed to a. This threw him because he was thinking of each variable as a separate location in memory, and that b and c should stay [1, 2, 3] even if a or d are changed. But I understand that a, b, c, and d are just pointers to memory locations, so that when you say b = a you aren't copying the contents to b, but pointing b to the memory location where a is. Is this correct? Would you use b = a.copy instead? ------------------------------ Date: Sun, 05 Dec 1999 01:37:28 -0500 From: godpup@ix.netcom.com Subject: Re: Array = array sc-users@lists.io.com wrote: > Hi, A student and I are a little confused about array assignment. He discovered that if you do this: a = [1, 2, 3]; b = [4, 5, 6]; c = [x, y, z]; b = a; c = b; d = a.add(4); The result is that all four arrays will become [1, 2, 3, 4]. Even c, which has no clear relation to a is changed to a. This threw him because he was thinking of each variable as a separate location in memory, and that b and c should stay [1, 2, 3] even if a or d are changed. But I understand that a, b, c, and d are just pointers to memory locations, so that when you say b = a you aren't copying the contents to b, but pointing b to the memory location where a is. Is this correct? Would you use b = a.copy instead? hmmm... i'm fairly new to supercollider, but the array assignment makes sense. (the results at least...) if you follow the logic that b = a (therefore b DOES equal [1,2,3])and c = b (therefore c now equals [1,2,3]), and a remains [1,2,3]. i'm not sure why you're not using different variables in the assignment statements. oh, and i'm assuming the last statement simply adds 4 to the exising array of a? c is indirectly referenced to a through the variable b, therefore the exact same array assignments are generated. then again, i'm still a novice at all this, so everything i'm saying might be completely incorrect. (but at least i tried...) cheers, christian ------------------------------ Date: Sun, 05 Dec 1999 11:26:09 +0000 From: "Lawrence Ball" <---@---.---> Subject: Gentle request for DIY ugen time frame Hi James I am as it happens planning to use C and have obtained Metrowerks Code Warrior Pro. Do you have at this stage some idea of a time frame I could expect to synchronise to vis-a-vis a facility to write a unit generator. It will probably take me a couple of months at least to get ready. A pity it looks bleak for current code. Mic Berends still has one idea we feel may still work. best regards and respects Lawrence Ball - ---------- >From: James McCartney <---@---.---> >To: sc-users@lists.io.com >Subject: Re: How to convert precision patterns into floating sound? >Date: Sat, Nov 27, 1999, 2:34 am > >At 3:36 PM -0700 11/24/99, Lawrence Ball wrote: >>Hi Martin,Mic,James and all >> >>Harmonic Mathematics has to be performed in an engine which deals in >>integers or integer-equivalents. > >Sounds like you are going to need to write your own unit generator >in C once I make that available. It is not possible at this time. > > > --- james mccartney james@audiosynth.com http://www.audiosynth.com >If you have a PowerMac check out SuperCollider2, a real time synth program: > > > > > ------------------------------ Date: Tue, 7 Dec 1999 01:06:45 +0100 From: Martin Stepanek <---@---.---> Subject: understanding Plug - --============_-1267597254==_============ Content-Type: text/plain; charset="us-ascii" Anybody got an idea on how to make this code produce the wanted effect, i. e. ringmodulate the input when "ringmodulate" is hit (surely you do ;-)? bye, martin P.S.: the code comes in an attachement - --============_-1267597254==_============ Content-Type: text/plain; name="PlugRingMod_w_Osc_test"; charset="us-ascii" Content-Disposition: attachment; filename="PlugRingMod_w_Osc_test" ( var w; w = GUIWindow.new("panel", Rect.newBy(128, 64, 400, 400)); RadioButtonView.new( w, Rect.newBy(18, 13, 128, 20), "silence", 0, 0, 1, 0, 'linear'); RadioButtonView.new( w, Rect.newBy(18, 37, 128, 20), "sound1", 1, 0, 1, 0, 'linear'); RadioButtonView.new( w, Rect.newBy(18, 61, 128, 20), "sound2", 0, 0, 1, 0, 'linear'); CheckBoxView.new( w, Rect.newBy(168, 68, 128, 20), "ringmodulate", 0, 0, 1, 0, 'linear'); Synth.play({ var a, b, input, mod, modulator, fx; a = SinOsc.ar(440); b = PinkNoise.ar(600); input = Plug.ar(a); modulator = SinOsc.ar( MouseX.kr(10,4000,'exponential'), [0,0.5pi] // offset phase ofone osc by 90 degrees ); mod = Plug.ar(input); w.at(0).action = { arg v; if (v.value>0, { input.source = 0.0; }); }; w.at(1).action = { arg v; if (v.value>0, { input.source = a; }); }; w.at(2).action = { arg v; if (v.value>0, { input.source = b; }); }; w.at(3).action = { if (w.at(3).value == 0, { mod.source = input; mod.source.post; }, { mod.source = input * modulator; mod.source.post; }; ) }; mod }); ) - --============_-1267597254==_============-- ------------------------------ Date: Tue, 07 Dec 1999 15:49:58 +0900 From: "kevin parks" <---@---.---> Subject: colors ok, i know that this seems dumb, but i wonder if i can add colors to the color menu. I see there is a bunch of colors there and then "other". I find that the preset colors are too bright for me and i am constantly using other to adjust the colors. Is there anyway to take the colors that i make in the other menu and add them to the pull down? I love using colors, but the standard preset ones are really grating. anything to make programing less painful.... cheers, kevin Free, fast e-mail accessible anytime, anywhere http://www.imaginemail.com ------------------------------ Date: Tue, 7 Dec 1999 00:51:15 -0600 (EST) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: Array = array Yes all variables are references to objects so an assignment of an object to a variable points the variable to that object. On Sat, 4 Dec 1999, David Cottle wrote: > Hi, > > A student and I are a little confused about array assignment. He discovered > that if you do this: > > a = [1, 2, 3]; > b = [4, 5, 6]; > c = [x, y, z]; > b = a; > c = b; > d = a.add(4); > > The result is that all four arrays will become [1, 2, 3, 4]. Even c, which > has no clear relation to a is changed to a. This threw him because he was > thinking of each variable as a separate location in memory, and that b and c > should stay [1, 2, 3] even if a or d are changed. But I understand that a, > b, c, and d are just pointers to memory locations, so that when you say b = > a you aren't copying the contents to b, but pointing b to the memory > location where a is. Is this correct? Would you use b = a.copy instead? > ------------------------------ Date: Tue, 07 Dec 1999 19:47:35 +0900 From: "kevin parks" <---@---.---> Subject: nextTime set twice The code below is from tutorial files. Here nextTime seems to be set in two places. it is set to 2 as a arg to Spawn (towards the bottom) but it also is set from within the newEventFunc (which is the unnamed first arg to spawn, no?). That is it grabs a value from the array and plugs it in inside of newEventFunc. So if it is set from inside the newEventFunc, why is it also set at the bottom? Playing this example clearly shows the events are spawned according to the array not @ 2 sec as specified in nextTime. How? Why? Huh? Is nextTime just overridden? I must say that spawn baffles me, despite having read the tutorial (which is a smidge loose in its introduction of such an central concept). The Spawn help file helps some as there are several examples, but the commenting is a bit terse for a helpfile. I feel like i am reading UNIX man pages in some of the less verbose help pages. Perhaps instead of more wacky ugens we could get just a tad bit more help in help and a smidge more toot in the toots. I once had a teacher when i was in music school who refused to teach ear-training because he had dead-on perfect pitch, awesome relative pitch and could write any rhythm down and could do this from the time he was a child and simply could not understand that others couldn't. He felt that he wouldn't be able to help others. Maybe programming SC is like that. I used SC 1.x pretty extensively but am still finding the leap to 2.x really hard to deal with. As if SC passed so threshold of difficulty that i can't get to. Don't get me wrong, i don't miss the dsp stages and the dspremove stuff, but i tried to take an a few of the example patches that write out to the DAC and change them so that they write to disk, but i just could not do it (well once it worked). You would think that just adding a few lines would do the trick, but nope. In the old days of SC1.x i could just use the pull down menu, i don't have to have 2 different versions of an instr. one to play real-time and one to write to disk. For an example of this, that lovely little prepared piano ditty that colby & JMc put in the contributions folder (to pick a short example). How would someone take that and make it so that it wrote to disk instead of out the DACS? And even more interesting would be to take that and modify it so that it not only wrote to disk, but somehow timed itself out so that the last event wasn't just cut off when the command-. was hit, but rather hitting command-. killing the patch after the current event was finished playing with perhaps some duty factor added for the resonance and decay of the last events. I would love to see that and see how it compared to the original, that would be instructive as a tutorial. Anyway, i love what SC does. It blows my mind. But... It sure can be less than fun to program. The docs and toots are rough and the syntax is a bit hard to grasp (i never know when i need a colon and when i don't). There is so much crazy recursion and nesting... open synth, open Spawn, open newEventFunc, open Pan, openEnv, open the synthUgen,...then there are a handful of args for each and then closecloseclosecloseclose closecloseclosecloseclosecloseclosecloseclose with parens and curly braces flying all over the place. Someone please tell me that it i stick to it i will get used to it..... simultaneously excited and discouraged, kevin parks Seoul, Korea kevin@raven.dartmouth.edu - ----------------------------- ( var env, freqs, times; env = Env.perc(0.01, 2, 1, -2); freqs = [ 250, 300, 450, 375, 281 ]; times = [ 2, 1.5, 1.2, 0.95, 0.7 ]; Synth.scope({ Spawn.ar( { arg thisSpawn, eventCount; var freq, time; freq = freqs.at(eventCount); time = times.at(eventCount); thisSpawn.nextTime = time; EnvGen.ar(env, Saw.ar(freq), levelScale: 0.2 ) }, 1, 2, // nextTime = every 2 seconds. 5 ) } ) ) Free, fast e-mail accessible anytime, anywhere http://www.imaginemail.com ------------------------------ Date: Tue, 07 Dec 1999 10:39:50 -0700 From: Alberto de Campo <---@---.---> Subject: Re: nextTime set twice Dear Kevin, kevin parks wrote: > The code below is from tutorial files. Here nextTime seems to > be set in two places. it is set to 2 as a arg to Spawn (towards > the bottom) but it also is set from within the newEventFunc > (which is the unnamed first arg to spawn, no?). That is it > grabs a value from the array and plugs it in inside of > newEventFunc. So if it is set from inside the newEventFunc, why > is it also set at the bottom? My fault. the nextTime set in Spawns argumnet list (Spawn.ar({ ...}, numChannels: 1, nextTime: 2, ...) sets nextTime once, when the Spawner is first created. As the nextTime is set to a value read from the array called times, the initial value is overwritten with this new one. Ths happens when you copy code and modify it: Some things that do nothing anymore are left in, and confuse readers. Sorry. > Playing this example clearly > shows the events are spawned according to the array not @ 2 sec > as specified in nextTime. How? Why? Huh? Is nextTime just > overridden? I must say that spawn baffles me, despite having > read the tutorial (which is a smidge loose in its introduction > of such an central concept). Thanks for the criticism, I'll try to make it clearer in the update I'm working on. > The Spawn help file helps some as > there are several examples, but the commenting is a bit terse > for a helpfile. I feel like i am reading UNIX man pages in some > of the less verbose help pages. Perhaps instead of more wacky > ugens we could get just a tad bit more help in help and a smidge > more toot in the toots. I once had a teacher when i was in music > school who refused to teach ear-training because he had dead-on > perfect pitch, awesome relative pitch and could write any rhythm > down and could do this from the time he was a child and simply > could not understand that others couldn't. He felt that he > wouldn't be able to help others. Maybe programming SC is like > that. I used SC 1.x pretty extensively but am still finding the > leap to 2.x really hard to deal with. As if SC passed so > threshold of difficulty that i can't get to. Don't get me > wrong, i don't miss the dsp stages and the dspremove stuff, but > i tried to take an a few of the example patches that write out > to the DAC and change them so that they write to disk, but i > just could not do it (well once it worked). Just change something like Synth.play({ Saw.ar }) to Synth.record({ Saw.ar }, duration: 2, pathName: "MyRecTest1") > You would think > that just adding a few lines would do the trick, but nope. In > the old days of SC1.x i could just use the pull down menu, i > don't have to have 2 different versions of an instr. one to > play real-time and one to write to disk. > > For an example of this, that lovely little prepared piano ditty that > colby & JMc put in the contributions folder (to pick a short > example). How would someone take that and make it so that it > wrote to disk instead of out the DACS? And even more > interesting would be to take that and modify it so that it not > only wrote to disk, but somehow timed itself out so that the > last event wasn't just cut off when the command-. was hit, but > rather hitting command-. killing the patch after the current > event was finished playing with perhaps some duty factor added > for the resonance and decay of the last events. Recording stops after the given duration ends, or you can use Synth.stop. > > > I would love to see that and see how it compared to the > original, that would be instructive as a tutorial. > > Anyway, i love what SC does. It blows my mind. But... It sure > can be less than fun to program. The docs and toots are rough > and the syntax is a bit hard to grasp (i never know when i need > a colon and when i don't). There is so much crazy recursion and > nesting... open synth, open Spawn, open newEventFunc, open Pan, > openEnv, open the synthUgen,...then there are a handful of args > for each and then closecloseclosecloseclose > closecloseclosecloseclosecloseclosecloseclose with parens and > curly braces flying all over the place. > > Someone please tell me that it i stick to it i will get used > to it..... I am a composer with no computer science background, and I think I got the hang of it. Just have patience and do simple things first... > > > simultaneously excited and discouraged, > > kevin parks > Seoul, Korea > kevin@raven.dartmouth.edu > > ----------------------------- > > ( > var env, freqs, times; > env = Env.perc(0.01, 2, 1, -2); > > freqs = [ 250, 300, 450, 375, 281 ]; > times = [ 2, 1.5, 1.2, 0.95, 0.7 ]; > > Synth.scope({ > Spawn.ar( > { arg > thisSpawn, > eventCount; > > var freq, time; > > freq = freqs.at(eventCount); > time = times.at(eventCount); > > thisSpawn.nextTime = time; > > > EnvGen.ar(env, > Saw.ar(freq), > levelScale: 0.2 > ) > }, > numChannels: 1, // changed to keyword > // 2, // not needed inj this patch, > commented out // nextTime = every 2 seconds. > maxRepeats: 5 // this is still necessary. > ) > } > ) > ) Hope this helps, Alberto ------------------------------ Date: Tue, 07 Dec 1999 11:03:52 -0800 From: "anthony burr" <---@---.---> Subject: Re: nextTime set twice kevin hi, just offering some encouragement. we met at crca last year (i'm a friend of ted apel's--the australian). I had no serious programming background before jumping into sc2, and can attest that sticking out the initial head-scratching is worth it. It does get much easier (i've actually found it more intuitive for me than max was)--check the command J thing to keep track of all the arguments hang in there anthony ------------------------------ Date: Tue, 07 Dec 1999 15:34:16 -0500 From: Mic Berends <---@---.---> Subject: Re: Gentle request for DIY ugen time frame hello Lawrence, i don't know that i'd mention my name in any correspondence with James; it seems likely to get you spurned... i think i could find my way back into the boys' club with a few informed questions about other aspects of the language - it's the way these people's minds work i ken... the 'phone line is still buggered, so my output has been diminished and i am slipping in the rankings for my music for want of new displayed content. everything moves so fast and demands such output! perhaps i will glean a better understanding of certain concepts from the recently received code of Dave Snowdon and be able to come up with something interesting. Timpani, Mic. - -- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>v ^ Mic Berends : in the end, : Tomorrow Maximum v ^ MINDESIGN limited : there can be : Heaven Kissing EP v ^ http://www.mindesign.com/ : only one. : available now. v ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ------------------------------ Date: Tue, 07 Dec 1999 23:46:42 -0500 From: christian hresko <---@---.---> Subject: recommendations just thought i'd get some recommendations from you guys and girls. i'm currently studying sound synthesis and dsp at my college. i just started noodling with supercollider about a month ago. (haven't had time to go in-depth yet...) anyway, my main area of study is writing code for audio apps. (synthesis and processing obviously) was just wondering if anyone had some suggestions regarding books on c++, object oriented programming, and dsp 'recipes.' (we're using the art of digital audio for one of our classes... it's a good reference book, but nothing you can really read through... also using principles of digital audio by pohlmann, but i'm looking for some code to go with the explanations) on a completely unrelated note, has anyone managed to get some very 'deep' bass (drum) sounds out of supercollider? (yes, i know it's not a 'techno' program...) oh yeah, i'm also one of the newbies who's hoping that perseverance will pay off. i know a little about c and structured programming, but that's about it. (actually sold all my synths for a G3 and supercollider) thanks to anyone who takes the time to read this and cares to respond. cheers, christian : btw, is the G4 really that much of an 'upgrade' from the G3? i've got the 450MHz B&W and i'm hoping (REALLY hoping) apple doesn't make the G3 platform obsolete within the next year - -- " there is no spoon. " ------------------------------ Date: Wed, 8 Dec 1999 00:14:43 -0500 (EST) From: Landon Rose <---@---.---> Subject: reading a just written text file James, all- This patch "runs" but no sound. It does describe basically what I am curious about- can I write a file, then read it, then overwrite the same file and then read that? If I move around the parts of the patch below, it will work, but it reads File("test") only once. I think my question is- with the patch below- is there a way to return the rate value from loop such that Plug can use it? ( // Question about writing a text file, then reading it into a sequence var env, rate; var f, g; env = Env.linen(1,3,1); Synth.play({ Task({ loop({ // write a File f = File("test", "w"); f.write(["aaxaa", "aaaaa"].choose); f.close; 8.wait; // wait some amount before writing another // then read from that File into a Sequencer g = File("test", "r"); rate = Sequencer.kr( `(g.readAllInt8) , LFPulse.ar(6)); g.close; // closing the file here means Sequencer never reads it? 8.wait; // give the sequence time to play through }); }); // play that sequence in a spawn Spawn.ar({ EnvGen.ar(env,SinOsc.ar(Plug.kr( rate ))) // rate needs a multiplier here },1,6) }); ) Also, this patch doesn't really get at evaluating if SC is trying to read a file that is still being written! Writing the file into an empty array? Thanks Landon ------------------------------ Date: 08 Dec 1999 02:02:51 EST From: Jeannie.H.Lee@Dartmouth.EDU (Jeannie H. Lee) Subject: Re: recommendations These are great technical, start-up c++ books:-Problem Solving with C++: The Object of Programming, Second Edition, by Walter Savitch - -Data Structures and Algorithms, Aho, Hopcroft, and Ullman ...however, your best bet is to take challenging computer science courses to help solidfy a strong base in programming.. - -you could always sample a great bass drum, if you're not satisfied with the ones you synthesize - - it's TOTALLY unrealistic that the G3 will be obsolete within the next year, it'll be a great,useful machine for about 3-5 years- you could upgrade RAM or add more drives and your machine would serve just as well as a G4. you should contact Apple and relay your concerns for further info and feedback...again, your computer needs greatly depend on what you are looking for-you can seriously still produce high-quality work without having the best, fastest or latest technological gimmicks on the market... best, jl - --- You wrote: just thought i'd get some recommendations from you guys and girls. i'm currently studying sound synthesis and dsp at my college. i just started noodling with supercollider about a month ago. (haven't had time to go in-depth yet...) anyway, my main area of study is writing code for audio apps. (synthesis and processing obviously) was just wondering if anyone had some suggestions regarding books on c++, object oriented programming, and dsp 'recipes.' (we're using the art of digital audio for one of our classes... it's a good reference book, but nothing you can really read through... also using principles of digital audio by pohlmann, but i'm looking for some code to go with the explanations) on a completely unrelated note, has anyone managed to get some very 'deep' bass (drum) sounds out of supercollider? (yes, i know it's not a 'techno' program...) oh yeah, i'm also one of the newbies who's hoping that perseverance will pay off. i know a little about c and structured programming, but that's about it. (actually sold all my synths for a G3 and supercollider) thanks to anyone who takes the time to read this and cares to respond. cheers, christian : btw, is the G4 really that much of an 'upgrade' from the G3? i've got the 450MHz B&W and i'm hoping (REALLY hoping) apple doesn't make the G3 platform obsolete within the next year - -- " there is no spoon. " - --- end of quote --- ------------------------------ End of sc-users-digest V1 #76 *****************************