From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #55 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, August 23 1999 Volume 01 : Number 055 ---------------------------------------------------------------------- Date: Thu, 12 Aug 1999 09:37:51 -0600 From: James McCartney <---@---.---> Subject: Re: File read and write At 8:31 AM -0600 8/12/99, David Cottle wrote: >Hi, > >>>example? There are no examples in the help file. >> >> f = File("test","w"); >> f.write("Does this work?\nuh huh\n"); >> f.close; >> >> g = File("test","r"); >> g.readAllString.postln; >> g.close; > >I thought I had tried it this way but I guess not. How about putChar. I've >tried > >g.putChar("w"); > >and > >g.putChar('w'); "w" is a String 'w' is a Symbol $w is a Char f = File("test3","w"); 100.do({ f.putChar([$a, $b, $c, $d, $e, $\n].choose); }); f.close; g = File("test3","r"); g.readAllString.postln; g.close; --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Thu, 12 Aug 1999 12:42:50 -0600 From: "David Cottle" <---@---.---> Subject: Re: File read and write Hi, > "w" is a String > 'w' is a Symbol > $w is a Char Thanks. I remember now where this is in the documentation. Sorry. ------------------------------ Date: Thu, 12 Aug 1999 12:42:05 -0600 From: "David Cottle" <---@---.---> Subject: CD playback, OMS Hi, I was thinking of distributing some examples on CD to some of our technology people. I tried running SCPlay from a CD I burned and it complained. I realize it's a small easy detail to get them to copy the folder to the hard drive, but I think it would also be fun to sell it as a CD that plays different music each time you put it in. How hard would it be to set up SCPlay so that it could run off of a locked (CD) disk? I work for a group at U of I that has been developing a notation package for nearly 15 years. They've finally decided to move to OMS and they've asked me to research it. (Mostly just where to start in terms of finding developer's tools.) Since SC uses OMS I thought I might start here. If anyone (James?) can spare a little time it would probably save me a lot of looking. Any help would be appreciated. ------------------------------ Date: Thu, 12 Aug 1999 15:16:53 -0600 From: James McCartney <---@---.---> Subject: Re: CD playback, OMS At 12:42 PM -0600 8/12/99, David Cottle wrote: >I work for a group at U of I that has been developing a notation package for >nearly 15 years. They've finally decided to move to OMS and they've asked me >to research it. (Mostly just where to start in terms of finding developer's >tools.) Since SC uses OMS I thought I might start here. If anyone (James?) >can spare a little time it would probably save me a lot of looking. Any help >would be appreciated. The SDK is at Opcode's web site last time I looked. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 13 Aug 1999 16:36:07 +0200 From: Martin Stepanek <---@---.---> Subject: Re: GUI-Dialog to Load Samples & Save Audio >The calls to XXXDialog.new return immediately, *before* the dialog has > >been dismissed. >Because the dialog calls are asynchronous, any reaction to the dialog >must be in the action function. I see,...thanks alot for the info martin ------------------------------ Date: Fri, 13 Aug 1999 17:05:35 -0600 From: James McCartney <---@---.---> Subject: version 2.2 available Version 2.2 is now available via ftp: BinHex : ftp://www.audiosynth.com/pub/updates/SC2.2.sea.hqx MacBinary (smaller) : ftp://www.audiosynth.com/pub/updates/SC2.2.sea.bin SCPlay is now distributed in a separate file : BinHex : ftp://www.audiosynth.com/pub/updates/SCPlay2.2.sea.hqx MacBinary (smaller) : ftp://www.audiosynth.com/pub/updates/SCPlay2.2.sea.bin === Changes in Version 2.2 A new Pattern class, Pfx, that adds effects to sub patterns was added. Support for this was added to classes Pattern and TSpawn. A couple of examples are in the "Pattern examples" file. A triggerSynth method was added to TSpawn. Doing cmd-J on a method name of the form Class::method will open the file and scroll to that method. All places where SC prints method names now print in that form. An IOStream class was added and asString and asCompileString were changed to use it. Two new filter UGens were added: Ringz, Formlet. Synth::dualScope method was added that shows the signal and spectrum. A new instance variable, bufsync, was added to Spawn. Setting bufsync true in Spawn will turn off sample accurate scheduling and force the events' synth buffers to start aligned with the parent's buffers. This is useful if one is spawning effects so that the same audio in multiple events are time aligned. Changing the bounds of a View now works. An Integer::isPrime method with primitive was added. A primitive was added for Array::addAll. A bug in 'for' loops was fixed. IdentityDictionary had a bug for negative Integers as keys. A non-Boolean in an if statement is now an error rather than assumed true. A bug was fixed where the _ArrayAdd primitive would create an Array, even if the class of the receiver was some other ArrayedCollection. Bugs in Signal::overdub and Signal::overwrite were fixed. === Also I believe that SCPlay should now work off of CD-ROM, but it has not been tested. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 13 Aug 1999 22:33:46 -0600 From: "David Cottle" <---@---.---> Subject: Re: version 2.2 available Hi, > Also I believe that SCPlay should now work off of CD-ROM, but it has > not been tested. I'll try it! ------------------------------ Date: Sat, 14 Aug 1999 16:22:02 -0600 From: "David Cottle" <---@---.---> Subject: Re: version 2.2 available Hi, > Also I believe that SCPlay should now work off of CD-ROM, but it has > not been tested. I tried it off of a locked hard drive partition and it ran fine. I'm away from my CD burner, but I assume it will work off of a CD. ------------------------------ Date: Sun, 15 Aug 1999 23:23:33 -0600 From: "David Cottle" <---@---.---> Subject: Generate GUI Code broken Hi, I think 2.2 GUI is broken. Open a new GUI window. Edit Change size (or whatever) Choose GUI/Generate Code error: nil Instance of Array { (0DCA3C2C, gc=00, fmt=01, flg=00, set=00) indexed slots [1] 0 : "" } CALL STACK: Object::doesNotUnderstand arg this = nil arg selector = 'on' arg args = [*1] Meta_SequenceableCollection::streamContents arg this = class String arg function = var stream = nil GUIWindow::generateCode arg this = ------------------------------ Date: Mon, 16 Aug 1999 12:38:47 -0500 (CDT) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: Generate GUI Code broken On Sun, 15 Aug 1999, David Cottle wrote: > Hi, > > I think 2.2 GUI is broken. > OK. I'm out of town for a week and will fix it when I get back. (All the GUI code generation is written in SC code, so if you can't wait then it is something you can fix your self.) ------------------------------ Date: Mon, 16 Aug 1999 20:16:27 -0400 From: "crucial" <---@---.---> Subject: Re: Generate GUI Code broken > > >On Sun, 15 Aug 1999, David Cottle wrote: > >> Hi, >> >> I think 2.2 GUI is broken. >> > >OK. I'm out of town for a week and will fix it when I get back. >(All the GUI code generation is written in SC code, so if you >can't wait then it is something you can fix your self.) > > Collection : // just substitute streamContentsLimit for the time being // streaming *streamContents { arg function; ^this.streamContentsLimit(function) } /* RWStream is missing.... { arg function; var stream; //stream = RWStream.on(this.new(100)); stream = LimitedWriteStream.on(this.new(100)); stream.limitFunc_({ ^stream.contents }); function.value(stream); ^stream.contents } */ *streamContentsLimit { arg function, limit=2000; var stream; stream = LimitedWriteStream.on(this.new(100 min: limit)); stream.limit_(limit).limitFunc_({ ^stream.contents }); function.value(stream); ^stream.contents } __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Mon, 16 Aug 1999 19:56:51 -0500 (CDT) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: Generate GUI Code broken Oh, I see. RWStream was renamed to IOStream. Changing that name will fix it perhaps if nothing else is broken. LimitedWriteStream is not really what you want for generating GUI code. On Mon, 16 Aug 1999, crucial wrote: > > > > > >On Sun, 15 Aug 1999, David Cottle wrote: > > > >> Hi, > >> > >> I think 2.2 GUI is broken. > >> > > > >OK. I'm out of town for a week and will fix it when I get back. > >(All the GUI code generation is written in SC code, so if you > >can't wait then it is something you can fix your self.) > > > > > > Collection : > > // just substitute streamContentsLimit for the time being > // streaming > *streamContents { > arg function; > ^this.streamContentsLimit(function) > } > > > /* RWStream is missing.... > { arg function; > var stream; > //stream = RWStream.on(this.new(100)); > stream = LimitedWriteStream.on(this.new(100)); > stream.limitFunc_({ ^stream.contents }); > function.value(stream); > ^stream.contents > } > */ > > *streamContentsLimit { arg function, limit=2000; > var stream; > stream = LimitedWriteStream.on(this.new(100 min: limit)); > stream.limit_(limit).limitFunc_({ ^stream.contents }); > function.value(stream); > ^stream.contents > } > > > > > > > __________________________________________ :\\_______ > http://crucial-systems.com > > __________________________________________ :\\_______ > ------------------------------ Date: Tue, 17 Aug 1999 21:58:14 -0600 From: "David Cottle" <---@---.---> Subject: Random seed Hi, Sorry for all the questions. I'm preparing course materials. How do you do a random seed? I see randSeed in Thread, but I don't understand the syntax. Can it only be used with Thread? ------------------------------ Date: Wed, 18 Aug 1999 15:00:36 +0100 From: Martin Robinson <---@---.---> Subject: OSC I know OpenSound Control isn't documented yet but is it usable? I'm experimenting with a remote performance system. I 'just' need two machines runnings SuperCollider [with individual licenses :) ] to communicate via TCP/IP. I could do this through Max with the otudp object I suppose, but it would be neater to avoid Max. >>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ <><><>__this.liveElectronics.interFaces.diffusion ____ >><<>>___tractor++rorshachCollective.at(mosaics)_(26-28.aug) __ >>>><<____jakcsonsLane(danceBase)_london(N6).highGate(tube) _ || ------------------------------ Date: Sun, 22 Aug 1999 14:18:49 +0200 From: Alberto de Campo <---@---.---> Subject: Crashing bug in addAll, minor Osc problem Dear James and all, I have had more crashes than usual with 2.2, and I think I have found a crashing bug in SC2.2 [[1,2,3], [4, 5]].flat.postln; returns different things on each evaluation, but never the flat array. After 2 or 3 repeated evaluations, SC2 crashes with an address error. It seems to be the _ArrayAddAll primitive, because that is the method .flat calls. So commenting out the line with this primitive fixes it until the bug is gone. ArrayedCollection : ... addAll { arg aCollection; var array; // _ArrayAddAll // temporary fix. array = this; aCollection.do({ arg item; array = array.add(item) }) ; ^array } Generally, if you are appending an Array to an Array, using ++ is going to be faster than addAll. 2. There's a minor inconsistency in the Osc and OscN classes: ( Synth.plot( { var s = #[], t; t = Wavetable.sineFill(512, [1]); 5.do({ arg index; s = s ++ [ Osc.ar(t, 10, 0.25pi * index), K2A.ar(Osc.kr(t, 10, 0.25pi * index)) ] }); s },0.1, "ar vs. kr", Rect.newBy(50, 50, 600, 600)) ) While a full cycle of offsets is 2pi at .ar, it is only pi at .kr! (This gave me some hard to figure out unexpected behavior...) OscN does the same reading from a Signal; SinOsc is fine (it reads from a hidden table). Best, Alberto ------------------------------ Date: Sun, 22 Aug 1999 17:56:31 +0200 (CEST) From: Schreck-Ensemble <---@---.---> Subject: Audio-triggering? Dear SC'ers, We are working on combining audio-analysis with Spawning. The realized trigger 'y' must start a Tspawn (?) which activates treatment on audio that is also used for analysis. The calculated 't' gives the time the Spawn must work, and thus must be passed as an argument to the Tspawn. TriggerSynth doesn't provide for external arguments. What to do? Our Analysis code, now with a Oscillator, in future a Violin: - --------------------------------- ( { var out; z = SinOsc.ar(Line.ar(8000,50,0.01),0,0.1); //Signal y = PulseDivider.ar( Trig1.ar(z, 0.0001), //0-cross 5, 0); //counts 5 0-crosses t = 1/max(600,ZeroCrossing.ar(y)); out = [z, y, t * 500]; }.plot ) - ----------------------------------- ====================================================== Hans van Eck: schreck@xs4all.nl Schreck-Ensemble: http://www.xs4all.nl/~schreck Tel.: "+31"-(0)20-6968957 ====================================================== ------------------------------ Date: Sun, 22 Aug 1999 17:56:33 +0200 (CEST) From: Schreck-Ensemble <---@---.---> Subject: How to externally trigger Tspawn (and bug with != versus ==)? Dear Alberto de Campo & other SC'ers, Thanks for your buffer-example, Alberto. Unfortunately, we cannot adapt it to our needs. Our question is: is it possible to do external audio-rate triggering of TSpawn using the Impulse - generator. Second problem: we cannot use the != in the If-statement, we don't understand this. The code:-------------------------------- We changed Alberto de Campo's example a little: Alberto originally triggered from the GUI: play1Btn.action = { if ( play1Btn.value == 1, { play1Spawn.source.trigger }, // start { play1Spawn.source.releaseAll } // and stop ) }; We want to trigger Tspawns with an impulse-signal (eventually we want to trigger with analysed audio-results). We moved the conditional to the Synth.play for this: ( var w, recBtn, resetBtn, play1Btn, play2Btn, inputScope; var env; env = Env.new(#[0,1,0],#[0.5, 0.5],'sine'); w = GUIWindow.new("panel", Rect.newBy( 200, 100, 500, 200)); recBtn = CheckBoxView.new( w, Rect.newBy( 22, 20, 128, 20), "Record On/Off").prSetBorderStyle(3); resetBtn = CheckBoxView.new( w, Rect.newBy( 22, 44, 128,20 ), "Record Reset").prSetBorderStyle(3); play1Btn = CheckBoxView.new( w, Rect.newBy( 22, 92, 128,20 ), "Play 1") .prSetBorderStyle(3); play2Btn = CheckBoxView.new( w, Rect.newBy( 22, 116, 128,20 ), "Play 2") .prSetBorderStyle(3); // not used yet. inputScope = ScopeView.new( w, Rect.newBy( 182, 19, 272,124 ), 4410, -1, 1) .labelColor_(rgb(176,176,176)); // for visual monitor of input. Synth.play({ var inSignal, buffer, detune, detuneSpeed, trr, play1Spawn; buffer = Signal.newClear(Synth.sampleRate * 6.0); // allocate a 6 second buffer. detune = MouseX.kr(0.0, 0.1); // detune playback streams lightly. detuneSpeed = MouseY.kr(0.8, 0.1, \exponential); //******************************************************************** // This condition NEVER actually triggers our Tspawn, WHY ??????? if ( ( (Impulse.kr(1.2,1,0).value == 1)), // change ==1 to !=0.0 gives error messages '"trigger" not understood' // not normally a problem, VERY WEIRD !!!!!!!!!!! { trr.trigger },{nil} // start ); //******************************************************************** inSignal =SinOsc.ar(Line.ar(8000,50,600),0,0.1); Scope.ar( // monitor input with a scopeview. inputScope, RecordBuf.ar(buffer, in: inSignal, recLevel: 0.5, preLevel: 0.5, reset: resetBtn.kr, // reset only works while recording I think. run: recBtn.kr, // turn recording on and off. loopMode: 1 // record continuously until turned off. ) ); play1Spawn = TSpawn.ar({ // one PlayBuf stream, no granulation yet. // " play1Spawn Just got spawned...".postln; EnvGen.ar( // overall Stream envelope, plays until released env, PlayBuf.ar(buffer, // all that need be done is replace // the PlayBuf here with a grain stream: //Spawn.ar({ ... PlayBuf(...) }) //or maybe GrainTap? Synth.sampleRate, [ LFNoise1.kr(detuneSpeed, detune, 1), LFNoise1.kr(detuneSpeed, detune,1)], 0, 0, buffer.size-2 ) // end of PlayBuf... ); // end of stream envelope }, 2); // end of play1Spawn trr = play1Spawn.source; }); w.close; ) ====================================================== Hans van Eck: schreck@xs4all.nl Schreck-Ensemble: http://www.xs4all.nl/~schreck Tel.: "+31"-(0)20-6968957 ====================================================== ------------------------------ Date: Sun, 22 Aug 1999 12:36:12 -0600 From: James McCartney <---@---.---> Subject: Re: How to externally trigger Tspawn (and bug with != versus ==)? > if ( ( (Impulse.kr(1.2,1,0).value == 1)), You should not in general use a unit generator in an if statement. See the example file "misconception" for an explanation of this. Impulse.kr is a UGen object, not a number. It only generates numbers when it runs. In your ugenGraph function you are building a synthesis patch with UGen objects. You are not processing audio in this function. UGens are simply objects here. They are not the signals that they generate. The 'value' method on a UGen only returns the UGen itself. Impulse.kr(1.2,1,0).value.postln; an Impulse You should also not test a UGen for equality. A UGen is equal to another UGen if they are the same object, not if their signals are equal. A UGen's signal will not necessarily ever be exactly equal to any number, since the values are floating point. You should only test a UGen for one of the inequalities << <<= >= > . These will generate a BinOpUGen. What you must do is plug your trigger signal into the TSpawn's trigger input. The trigger and triggerSynth methods are only to be called from a Synth sched task, or a Sequencer function. There is a problem here: > trr = play1Spawn.source; >}); By putting this assignment as the last statement, you are not returning the TSpawn's OutputProxys as the result, but instead source. You should instead write: trr = play1Spawn.source; play1Spawn }); >TriggerSynth doesn't provide for external arguments. There is no need for arguments, since triggerSynth takes a Synth. You build the Synth that is passed in so you have all the control you need when you build that Synth. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Sun, 22 Aug 1999 15:17:47 -0400 From: Mic Berends <---@---.---> Subject: mystify me. 1/f noise. and as we head further and further into the OOP zone, all things become more academic, and much less clear to the unexperienced. so you must keep up! i'm lost! how will i ever find my way to understanding? i'm no mathematician, but i can read the sample code just fine and do simple sums in my head. when i try to create my own structures from scratch, though, everything iz hay-wire! the first step is to buy a couple of good smalltalk references and maybe wait for someone to write a tutorial on how to grok and employ the *very basics* of SC2 and the object/event model. maybe you are dust before this happens, though. who can say? the second is to insert your head into a press at a certain angle and dial up 1267.0414 kg/cm pressure (although it is a float you can never be sure if it's too much or not enough) to reshape your head to proper object-oriented audio programming spec. soon you will either have the lightning bolt of inspiration and achieve unity with the godhead, or you will flee back to the gui weenie environment from whence you came, and maybe even as far back as that acoustic guitar you dropped off in high school. either way this saves you from the soul-tearing hair-losing (or vice versa) that is Supercollider2! 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: Sun, 22 Aug 1999 14:44:19 -0600 From: James McCartney <---@---.---> Subject: Re: mystify me. 1/f noise. At 1:17 PM -0600 8/22/99, Mic Berends wrote: >wait for someone to write a tutorial Alberto de Campo's tutorial is in the Help folder. If you have a specific question or problem then feel free to ask it here. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sun, 22 Aug 1999 21:50:37 +0200 (CEST) From: Schreck-Ensemble <---@---.---> Subject: Re: Thanks for T Thanks for these answers James We'll be busy with for the coming week! Hans van Eck Pieter Suurmond Arie van Schutterhoef Schreck Ensemble Holland >> if ( ( (Impulse.kr(1.2,1,0).value == 1)), > >You should not in general use a unit generator in an if statement. >See the example file "misconception" for an explanation of this. > >Impulse.kr is a UGen object, not a number. >It only generates numbers when it runs. >In your ugenGraph function you are building a synthesis patch >with UGen objects. You are not processing audio in this function. >UGens are simply objects here. They are not the signals that they generate. >The 'value' method on a UGen only returns the UGen itself. > >Impulse.kr(1.2,1,0).value.postln; >an Impulse > >You should also not test a UGen for equality. >A UGen is equal to another UGen if they are the same object, >not if their signals are equal. >A UGen's signal will not necessarily ever be exactly equal to any number, >since the values are floating point. >You should only test a UGen for one of the inequalities < <= >= > . >These will generate a BinOpUGen. > >What you must do is plug your trigger signal into the TSpawn's trigger >input. The trigger and triggerSynth methods are only to be called from >a Synth sched task, or a Sequencer function. > > >There is a problem here: > >> trr = play1Spawn.source; >>}); > >By putting this assignment as the last statement, you are not >returning the TSpawn's OutputProxys as the result, but instead source. >You should instead write: > > trr = play1Spawn.source; > play1Spawn >}); > > >>TriggerSynth doesn't provide for external arguments. > >There is no need for arguments, since triggerSynth takes a Synth. >You build the Synth that is passed in so you have all the control you >need when you build that Synth. > > > > --- james mccartney james@audiosynth.com http://www.audiosynth.com >If you have a PowerMac check out SuperCollider2, a real time synth program: > ====================================================== Hans van Eck: schreck@xs4all.nl Schreck-Ensemble: http://www.xs4all.nl/~schreck Tel.: "+31"-(0)20-6968957 ====================================================== ------------------------------ Date: Sun, 22 Aug 1999 23:08:01 +0200 From: Staffan Liljegren <---@---.---> Subject: Automata example - Pals Petanque v.0.1 Too little exchenge of examples here soo here is another "learning" etude I started to write recently. Please give feedback ! - -Staffan Liljegren ( // Pals Petanque // Trying out Pfsm and Pfx in a lydian "quasi canonic" etude // Staffan Liljegren, 990812, staffan@medialab.ericsson.se var p, p2,echo, comb, reverb, wah, envwah, dust; // these effects by JMc (See "Pattern examples"), slightly modified to suit this piece echo = { arg in; CombN.ar(in, 0.5, 0.5, 3, 0.9, in.reverse); }; reverb = { arg in; 5.do({ in = AllpassN.ar(in, 0.04, [0.01.rand + 0.02, 0.01.rand + 0.02], 2); }); in }; wah = { arg in; RLPF.ar(in, LFNoise1.kr(1.5, 1200, 1400), 0.1, 10).distort * 0.15; }; dust = { arg in; Decay.kr(Dust.kr(XLine.kr(200,1,10), [0.8,0.8]).min(0.8), 0.1) * in; }; envwah = { arg in; Normalizer.ar( RLPF.ar(in, Amplitude.kr(in, mul: XLine.kr(100, 20000, 10), add: 100), 0.15 ), 0.3, 0.01 ).softclip * 0.7; }; // Two finite state machine patterns (Pfsm) in lydian panned randomly // Terminates when they reache the last state p = Pbindf( \tempo, 2.3, \scale, [0,2,4,6,7,9,11], \legato, 0.2, \pan, Pbrown(-1.0, 1.0, 0.2), Pfsm([ #[0, 5], // entry states // state 0 Pbind( \dur, Pseq([ 1/2, 1/2, 1 ]), \degree, Pseq([ 3, 0,3 ]) ), #[0, 1, 5], // s1 Pbind( \dur, Pseq([ 1, 1/4, 1/4, 1/4, 1/4 ]), \degree, Pseq([ \rest, -1,0,1,2 ]) ), #[0, 1, 2, 3], // s2 Pbind( \dur, 2, \degree, Pseq([ 0 ]) ), #[0, 1, 1, 6, 6], // s3 Pbind( \dur, Pseq([ 1/4, 1/4, 1/4, 1/4 ],2), \degree, Pseq([ 4,3,4,3 ],2) ), #[2,2, 3, 4, 4], // s4 Pbind( \dur, Pseq([ 1/3, 1/3, 1/3, 1 ]), \degree, Pseq([ -3,-2,-1,0 ]) ), #[0, 1, 5, 6, 6], // s5 Pbind( \dur, Pseq([ 1, 1/2, 1/2 ]), \degree, Pseq([ 3, 0, 2 ]) ), #[0, 0, 1, 1, 2, 5], // s6, terminal state nil, nil ]) ); p2 = Pbindf( \tempo, 2.3, \scale, [0,2,4,6,7,9,11], \legato, 0.2, \pan, Pbrown(-1.0, 1.0, 0.2), Pfsm([ #[0,2,4], // entry states // state 0 Pbind( \dur, 2, \degree, Pseq([0]) ), #[1, 2], // s1 Pbind( \dur, Pseq([ 1/3, 1/3, 1/3, 1]), \degree, Pseq([6,5,4,7 ]) ), #[0, 0,1, 2, 2,3, 3, 5, 5], // s2 Pbind( \dur, Pseq([ 1/2 ],4), \degree, Pseq([ \rest,4,7,\rest ]) ), #[0, 0,0,1,1, 2,3, 3, 3], // s3 Pbind( \dur, Pseq([ 1/4 ],8), \degree, Pseq([ 0,-1 ],4) ), #[0,0,0,3,4,4,4,6,6,6,9,9], // s4 Pbind( \dur, Pseq([ 2/3],3), \degree, Pseq([ 2,4,3]) ), #[0,0,3,3,5,5,7,7,8], // s5 Pbind( \dur, Pseq([ 1/2, 1/4, 1/4, 1/2, 1/2]), \degree, Pseq([ 7,5,4,7, \rest]) ), #[1,1,1,2,2,2,5], // s6 Pbind( \dur, Pseq([ 1/3, 1/3, 4/3]), \degree, Pseq([ -4,-5,-3]) ), #[0,2,2,4,4], // s7 Pbind( \dur, Pseq([ 1/4,1/4, 1/2, 1]), \degree, Pseq([ 7,7,7,\rest]) ), #[4, 8, 9, 9], // s8 Pbind( \dur, Pseq([ 1/2,1/3,1/3, 1/3, 1/2]), \degree, Pseq([ \rest,4,6,3, \rest]) ), #[1, 5, 7, 7], // s9 end state nil, nil ]) ); // Adding ordering and effects to subpatterns. 1st try Paddp(\mtranspose, Pseq([0,3,6]), Pfx( Pseq([ Pfx(Pset(\octave, 3,p), envwah), Ppar([ Pfx(Pset(\octave,4,p), wah), Pfx(Pmul(\stretch, 2.0,Pset(\octave,3,p)), wah), Pmul(\stretch,2.0,Pset(\octave,5,p2)), Pset(\octave,6,p2) ]), Pfx(Pmul(\stretch, 3/4,Pset(\octave,6,p2)), echo), Pfx(Pfx(Pmul(\stretch, 2/3,Pset(\octave,6,p)), echo), dust) ]), reverb) ).play ) ------------------------------ Date: Sun, 22 Aug 1999 17:04:51 -0400 From: Mic Berends <---@---.---> Subject: Re: mystify me. 1/f noise. ooh, a tutorial! James McCartney wrote: > Alberto de Campo's tutorial is in the Help folder. well, when did that get in there? (2.1.2?!?) perfect. thanks james, and thanks alberto! back on it... supercollider2.2 and finder crash with error -11 and what crashguard calls access fault exceptions. very frequently. since no one else has posted these i will assume it's something in my system and will report back once it is found. this is 8.6/160MB/powerbookG3series. james, please send me another key - i am in demo mode again. why sending time or version limited keys? maybe if it's the same for all users you could post that you'll need to be re-keyed for this release? Cheers, 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: Sun, 22 Aug 1999 23:57:21 +0200 From: Staffan Liljegren <---@---.---> Subject: 2's Drumpani, 3's a Crowd Here is a simple customisable drum example Cheers, Staffan Liljegren ( // 2's Drumpani, 3's a Crowd. Just a simple tunable drum with variable // size and partials close to the tympani // Staffan Liljegren, 990816, staffan@medialab.ericsson.se var e,drumpani,t1,t2; e = Env.new(#[1, 1, 0],#[1.5, 0.1]); // dec decides the size (eg attack decay and ring times of partials) // of the "drumpani" drumpani = { arg dec,freq,amp,pan; var o; o=Klank.ar( `[[0.85,1,1.51,1.68,1.99,2.09, 2.44,2.67,2.79,2.89,2.99, 3.08, 3.19]*freq, Array.fill(12, { arg i; 1/(i+1) }).addFirst(0.5), Array.fill(13, { dec + (10*dec).linrand })], Decay2.ar(Impulse.ar(0),0.001,dec,GrayNoise.ar(0.01*amp)) ) * EnvGen.kr(e); Pan2.ar(o, pan); }; // Testing the "drumpani" t1 = Pbind( \tempo, 2.4, \dec, 0.3, \amp, Pfunc({0.2+0.3.rand}), \octave, Prand([3,4],inf), \pan, Pbrown(-1.0, -0.1, 0.2), \degree, Prand([0,3,6, \rest], inf), \ugenFunc, drumpani, \dur, Prand([1,Pseq([1/3],3), Pseq([0.5],2)],inf) ); t2 = Pbind( \tempo, 2.4, \dec, 0.1, \amp, Pfunc({0.2+0.5.rand}), \octave, 5, \pan, Pwhite(0.1, 1.0), \degree, Prand([0,3,6, \rest, \rest], inf), \ugenFunc, drumpani, \dur, Pxrand([3,Pseq([1],3), Pseq([1.5],2), Pseq([1/6], 18)],inf) ); Ppar([t1,t1,t2]).play ) ------------------------------ Date: Mon, 23 Aug 1999 01:19:45 -0600 From: James McCartney <---@---.---> Subject: Re: Crashing bug in addAll, minor Osc problem At 6:18 AM -0600 8/22/99, Alberto de Campo wrote: >It seems to be the _ArrayAddAll primitive, >While a full cycle of offsets is 2pi at .ar, >it is only pi at .kr! OK all fixed. Thanks! --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 23 Aug 1999 12:39:15 +0200 From: Ioannis Zannos <---@---.---> Subject: Strange scheduling bug? This is a multi-part message in MIME format. - --------------CFABD195D6AE562DD0E9E82C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, Here is (I think) a bug discovered in sched and tsched. Synth.newSynth.sched(dtime, foo) ... or Synth.newSynth.tsched becomes unreliable when dtime is close to or larger than 1.0. Details and code below unindented and attached as SC file. Iannis Zannos SIM - ----------------------------------------------------- /* 23.8.99 Routine scheduling problem. 1. Context Ronald Kuivila suggested that Routine can also be used "as is" to program time structures - rather than using Patterns. This means writing the time structure of a piece as code of a function that is run by a Routine. For example: Routine({ arg self; 10.do({ \blah.postln; // ... start some sound; self.wait(2); // wait for 2 seconds before continuing execution }) }) Implementing the wait method is (seems?) easy: wait { arg dtime=1; Synth.newSynth.sched(dtime, { this.next(this) }); this.yield; } 2. The Problem When triggering sounds inside such a routine, scheduling fails when time offset is close to or more than 1. Also, there has to be a wait for an offset > 0 at the start of a routine in order for scheduling to function at the start inside a synth triggering tspawn. Example code: */ // I used the following subclass of Routine for testing: TimedRoutine : Routine { wait { arg dtime=1; Synth.newSynth.sched(dtime, { this.next(this) }); this.yield; } } ( // test example var synthFunc, tspawn, routine, input; synthFunc = { arg synth; var outs; outs = TSpawn.ar({ arg argTSpawn, i, tsynth, argInput; argInput.value(tsynth) }, 1); tspawn = outs.source; routine.next(routine); synth.sched(0, { tspawn.trigger(input) }); outs }; routine = TimedRoutine({ arg self; self.wait(0.0001); 50.do({ arg c; c.postln; input = { FSinOsc.ar(200+400.rand, Line.kr(0.1, 0, 1)) }; tspawn.trigger(input); // waiting for more than about 0.99 will erratically stop the rescheduling. self.wait(0.99); // 0.99 always stops after around the 8th/9th repeat! // self.wait(0.5); // this will not cause the unwanted stop. }); }); Synth.play(synthFunc; ) ) - --------------CFABD195D6AE562DD0E9E82C Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="53436A6D"; name="RoutineScheduling990823" Content-Transfer-Encoding: 7bit Content-Description: Unknown Document Content-Disposition: inline; filename="RoutineScheduling990823" /* 23.8.99 Routine scheduling problem. 1. Context Ronald Kuivila suggested that Routine can also be used "as is" to program time structures - rather than using Patterns. This means writing the time structure of a piece as code of a function that is run by a Routine. For example: Routine({ arg self; 10.do({ \blah.postln; // ... start some sound; self.wait(2); // wait for 2 seconds before continuing execution }) }) Implementing the wait method is (seems?) easy: wait { arg dtime=1; Synth.newSynth.sched(dtime, { this.next(this) }); this.yield; } 2. The Problem When triggering sounds inside such a routine, scheduling fails when time offset is close to or more than 1. Also, there has to be a wait for an offset > 0 at the start of a routine in order for scheduling to function at the start inside a synth triggering tspawn. Example code: */ // I used the following subclass of Routine for testing: TimedRoutine : Routine { wait { arg dtime=1; Synth.newSynth.sched(dtime, { this.next(this) }); this.yield; } } ( // Example code for testing: var synthFunc, tspawn, routine, input; synthFunc = { arg synth; var outs; outs = TSpawn.ar({ arg argTSpawn, i, tsynth, argInput; argInput.value(tsynth) }, 1); tspawn = outs.source; routine.next(routine); synth.sched(0, { tspawn.trigger(input) }); outs }; routine = TimedRoutine({ arg self; self.wait(0.0001); 50.do({ arg c; c.postln; input = { FSinOsc.ar(200+400.rand, Line.kr(0.1, 0, 1)) }; tspawn.trigger(input); // waiting for more than about 0.99 will erratically stop the rescheduling. self.wait(0.99); // 0.99 always stops after around the 8th/9th repeat! // self.wait(0.5); // this will not cause the unwanted stop. }); }); Synth.play( synthFunc; ) ) - --------------CFABD195D6AE562DD0E9E82C-- ------------------------------ Date: Mon, 23 Aug 1999 08:44:22 -0600 From: James McCartney <---@---.---> Subject: Re: Strange scheduling bug? At 4:39 AM -0600 8/23/99, Ioannis Zannos wrote: >wait { arg dtime=1; >Synth.newSynth.sched(dtime, { this.next(this) }); >this.yield; >} Synth.newSynth is only valid while the Synth is being "new"ed. Once you are no longer in the Synth.new method Synth.newSynth is undefined. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 23 Aug 1999 09:03:50 -0600 From: James McCartney <---@---.---> Subject: Re: Strange scheduling bug? Also I should note that within a Routine you can refer to the Routine itself via "thisThread". Routine({ ... synth.sched(dtime, { thisThread.next }); I liked 'wait' so I incorporated it into the Routine class. It is defined as follows: wait { arg synth, time; synth.sched(time, { this.next; }); this.yield; } Here is a fixed version. ( // test example var synthFunc, tspawn, routine, input; synthFunc = { arg synth; var outs; outs = TSpawn.ar({ arg argTSpawn, i, tsynth, argInput; argInput.value(tsynth) }, 1); tspawn = outs.source; routine.next(synth); outs }; routine = Routine({ arg synth; thisThread.wait(synth, 0.0001); 50.do({ arg c; c.postln; input = { FSinOsc.ar(200+400.rand, Line.kr(0.1, 0, 1)) }; tspawn.trigger(input); thisThread.wait(synth, 2); }); }); Synth.play(synthFunc; ) ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Mon, 23 Aug 1999 09:17:24 -0600 From: James McCartney <---@---.---> Subject: Re: Strange scheduling bug? At 8:44 AM -0600 8/23/99, James McCartney wrote: >At 4:39 AM -0600 8/23/99, Ioannis Zannos wrote: > >>wait { arg dtime=1; >>Synth.newSynth.sched(dtime, { this.next(this) }); >>this.yield; >>} > >Synth.newSynth is only valid while the Synth >is being "new"ed. Once you are no longer in the Synth.new method >Synth.newSynth is undefined. >Also I should note that within a Routine you can refer to the >Routine itself via "thisThread". Which gives me an idea. I will create a 'thisSynth' pseudo variable which is always valid, instead of Synth.newSynth which is rather clunky to write and not always valid. I should have thought of this in the first place.. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ End of sc-users-digest V1 #55 *****************************