From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #38 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 Thursday, May 6 1999 Volume 01 : Number 038 ---------------------------------------------------------------------- Date: Wed, 5 May 1999 14:16:36 +0100 From: finer@easynet.co.uk Subject: elegant solution/plug & gui This bit of code works BUT . . . . I was wondering what the elegant solution is to avoid the nested conditional statement. ( // test using Plug for dynamic patching w = GUIWindow.new("panel", Rect.newBy( 643, 390, 161, 201 )); RadioButtonView.new( w, Rect.newBy( 14, 19, 128, 20 ), "a", 0, 0, 1, 0, 'linear'); RadioButtonView.new( w, Rect.newBy( 14, 43, 128, 20 ), "b", 0, 0, 1, 0, 'linear'); RadioButtonView.new( w, Rect.newBy( 14, 67, 128, 20 ), "c", 0, 0, 1, 0, 'linear'); RadioButtonView.new( w, Rect.newBy( 14, 91, 128, 20 ), "d", 0, 0, 1, 0, 'linear'); RadioButtonView.new( w, Rect.newBy( 14, 115, 128, 20 ), "e", 0, 0, 1, 0, 'linear'); { arg synth; var a, b, c, d, e, f, plug; a = SinOsc.ar(1800, 0, 0.1); b = WhiteNoise.ar(0.1); c = LFPulse.ar(200, 0.2, 0.1); d = LFSaw.ar(500, 0.1); e = PMOsc.ar(300, 550, LFTri.kr(0.25,10,10), 0, 0.1); f = { 0.1.rand2 }; plug = Plug.ar(f, 0); // randomly repatch the Plug's source synth.repeat(4, 0.04, { plug.source = if(w.at(0).value>0,{a},{if(w.at(1).value>0,{b}, {if(w.at(2).value>0,{c}, {if(w.at(3).value>0,{d}, {if(w.at(4).value>0,{e})})})})}) }); plug }.scope(0.5); w.close ) Thanks, Jem ------------------------------ Date: Wed, 5 May 1999 19:10:38 +0100 From: Pieter Suurmond <---@---.---> Subject: -2604: 2CB7580-library not found. Dear SC-users, Maybe someone can help me,... I have a problem with my PowerBook 1400cs & SuperCollider. SC 2 runs excellent on our desktop-PPC! However, when I try to launch "SC2.1.3" on my PowerBook 1400cs (running OS7.6.1) I get this message: ............................................................ Error while loading libraries. The library named . "2CB7580" could not be found. Please install this library . or contact customer support. Result code: -2604 ............................................................ Any idea what this could mean? Some part of my OS missing or something? How can I install that mysterious "2CB7580"-library & where can I download it? Kind regards, Pieter Suurmond Schreck Ensemble # -laboratory for live electro-acoustic music- # http://www.xs4all.nl/~schreck/ ------------------------------ Date: Wed, 5 May 1999 19:09:43 +0100 From: Pieter Suurmond <---@---.---> Subject: Serial I/O functions in SC? Dear SC-users, Can somebody tell me if it is possible to use SERIAL I/O within SuperCollider? I know MIDI is very well supported by SC, but just serial I/O can that be done? Is there something like the "serial"- object in MAX? I want to use the "MackBrick I/O card" to interface several sensors, buttons & potentiometers for an installation for the Dutch CEM-studio. It communicates with the Mac via printer or modem-port @ 9600 Buad. In MAX-MSP this can be done but MSP is a bit annoying for a PERMANENT installation, for you have to "upgrade" 4 times a year or something. So it would be nice if we could transport our prototype to SC (more reliable, stable end faster, software KEEPS working after having payed). So, can serial I/O be done, and at what baudrates? Bye, Pieter Suurmond Pieter Suurmond Utrecht School of the Arts e-mail: pieter@kmt.hku.nl Music Technology department www: http://www.hku.nl/~pieter/ PO box 2471 phone: (+31) 35 6836464 1200 CL Hilversum fax: (+31) 35 6836480 Netherlands ------------------------------ Date: Wed, 5 May 1999 18:25:55 -0500 From: rkuivila@mail.wesleyan.edu Subject: Including MIDI mappings in GUI code Hi all, The following two modifications will extend the "generate code to clipboard" menu item for GUI's to include MIDI mappings: add the following to the methods of ControlView getMIDIMappingAsString { var mystring; mystring = ""; if( this.getMIDIMappingStatus !=0, { mystring = ".prSetMIDIMapping(" ++ this.getMIDIMappingStatus.asString ++ "," ++ this.getMIDIMappingChannel.asString ++ "," ++ this.getMIDIMappingIndex.asString ++ ")" } ); ^mystring; } change method 'generateViewsCode' in GUIWindow: generateViewsCode { var string; string = ""; views.do({ arg view; string = string ++ "\t" ++ view.asCompileString ++ view.getMIDIMappingAsString ++ ";\n"; }); ^string } RJK ------------------------------ Date: Wed, 5 May 1999 09:10:15 -0500 (CDT) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: elegant solution/plug & gui Use an action function for the radio buttons. w.at(0).action = { if (w.at(0).value > 0, { plug.source = a }); }; w.at(1).action = ... etc On Wed, 5 May 1999 finer@easynet.co.uk wrote: > This bit of code works BUT . . . . > > I was wondering what the elegant solution is to avoid the nested > conditional statement. > > > > > ( > // test using Plug for dynamic patching > > w = GUIWindow.new("panel", Rect.newBy( 643, 390, 161, 201 )); > RadioButtonView.new( w, Rect.newBy( 14, 19, 128, 20 ), "a", 0, 0, > 1, 0, 'linear'); > RadioButtonView.new( w, Rect.newBy( 14, 43, 128, 20 ), "b", 0, 0, > 1, 0, 'linear'); > RadioButtonView.new( w, Rect.newBy( 14, 67, 128, 20 ), "c", 0, 0, > 1, 0, 'linear'); > RadioButtonView.new( w, Rect.newBy( 14, 91, 128, 20 ), "d", 0, 0, > 1, 0, 'linear'); > RadioButtonView.new( w, Rect.newBy( 14, 115, 128, 20 ), "e", 0, 0, > 1, 0, 'linear'); > > { arg synth; > var a, b, c, d, e, f, plug; > > a = SinOsc.ar(1800, 0, 0.1); > b = WhiteNoise.ar(0.1); > c = LFPulse.ar(200, 0.2, 0.1); > d = LFSaw.ar(500, 0.1); > e = PMOsc.ar(300, 550, LFTri.kr(0.25,10,10), 0, 0.1); > f = { 0.1.rand2 }; > > plug = Plug.ar(f, 0); > > // randomly repatch the Plug's source > synth.repeat(4, 0.04, { plug.source = > if(w.at(0).value>0,{a},{if(w.at(1).value>0,{b}, > > {if(w.at(2).value>0,{c}, > > {if(w.at(3).value>0,{d}, > > {if(w.at(4).value>0,{e})})})})}) > > }); > plug > > > }.scope(0.5); > w.close > ) > > Thanks, > > Jem > > > > > > ------------------------------ Date: Don, 6 May 99 08:20:33 +0200 From: suppan <---@---.---> Subject: Re: -2604: 2CB7580-library not found. >Dear SC-users, > >Maybe someone can help me,... I have a problem with my >PowerBook 1400cs & SuperCollider. > >SC 2 runs excellent on our desktop-PPC! > >However, when I try to launch "SC2.1.3" on my PowerBook >1400cs (running OS7.6.1) I get this message: >............................................................ >Error while loading libraries. The library named . >"2CB7580" could not be found. Please install this library . >or contact customer support. >Result code: -2604 >............................................................ > >Any idea what this could mean? >Some part of my OS missing or something? This is not a problem of your OS. I have a PowerBook 1400cs too, and unfortunately SC2 doesn't run anyway on this machine. Maybe James there is a way to fix it, because SC1.1b5 runs without problems! ------------------------------ Date: Thu, 06 May 1999 12:13:30 +0200 From: julian rohrhuber <---@---.---> Subject: Re: Including MIDI mappings in GUI code Hi, RJK thanks for that extension. I use the chance to ask, can you give a short example how to use the gui for midimapping? ( as default example for midi i can only find voicer example and the explanation is too brief ) JR At 18:25 05.05.99 -0500, you wrote: >Hi all, > > The following two modifications will extend the "generate code to >clipboard" menu item for GUI's to include MIDI mappings: > >add the following to the methods of ControlView > > getMIDIMappingAsString > { var mystring; > mystring = ""; > if( this.getMIDIMappingStatus !=0, > { mystring = ".prSetMIDIMapping(" > ++ this.getMIDIMappingStatus.asString ++ "," > ++ this.getMIDIMappingChannel.asString ++ "," > ++ this.getMIDIMappingIndex.asString ++ ")" > } > ); > ^mystring; > } > >change method 'generateViewsCode' in GUIWindow: > > generateViewsCode { > var string; > string = ""; > views.do({ arg view; > string = string ++ "\t" ++ view.asCompileString > ++ view.getMIDIMappingAsString > ++ ";\n"; > }); > ^string > } > > >RJK > > > ------------------------------ Date: Thu, 6 May 1999 08:10:16 -0400 (EDT) From: David Crandall <---@---.---> Subject: multiple sound file playback Pardon a fairly naive and elementary question, but is there a way to load and play more than one soundfile at a time? Or would it be a matter of loading one to RAM and streaming the other from disk? (OR for that matter streaming several from disk)? what hung me up in this case was the IF statement in the soundfile example, trying to rewrite it for 2 or more files, and wondering if the IF is required or if it's just a handy way to let me know that I've requested a file that's not there... tia, David Crandall ------------------------------ Date: Thu, 6 May 1999 08:04:01 -0600 From: James McCartney <---@---.---> Subject: Re: Including MIDI mappings in GUI code At 4:13 AM -0600 5/6/99, julian rohrhuber wrote: >Hi, RJK > >thanks for that extension. I use the chance to ask, can you give a short >example how to use the gui for midimapping? MIDI mapping is easy. When a GUI window is in front, choose the MIDI Map Faders menu item. All the sliders and numericals will turn green. If you click on one it turns yellow indicating it is enabled to be mapped. Then move some MIDI controller. The view will turn red indicating it is mapped. Do this for all the sliders you want to map. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Thu, 6 May 1999 08:17:12 -0600 From: James McCartney <---@---.---> Subject: Re: multiple sound file playback At 6:10 AM -0600 5/6/99, David Crandall wrote: >Pardon a fairly naive and elementary question, but is there a way to load >and play more than one soundfile at a time? Or would it be a matter of >loading one to RAM and streaming the other from disk? (OR for that matter >streaming several from disk)? > >what hung me up in this case was the IF statement in the soundfile >example, trying to rewrite it for 2 or more files, and wondering if the IF >is required or if it's just a handy way to let me know that I've >requested a file that's not there... The if is there to not run the patch if the file was not found. to load multiple files you can just use a flag: ( // normal playback at same speed of recording var signal1, signal2, sound1, sound2, ok = true; sound1 = SoundFile.new; ok = ok && sound1.read(":Sounds:cymbal0"); sound2 = SoundFile.new; ok = ok && sound2.read(":Sounds:cymbal1"); if (ok, { Synth.scope({ signal1 = sound1.data.at(0); signal2 = sound2.data.at(0); PlayBuf.ar(signal1, sound1.sampleRate, 1, 0, 0, signal1.size-2) + PlayBuf.ar(signal2, sound2.sampleRate, 1, 0, 0, signal2.size-2) * 0.4 }); },{ "a file was not found.\n".post }); ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Thu, 6 May 1999 08:29:26 -0600 From: James McCartney <---@---.---> Subject: Re: BOUNCE sc-users@lists.io.com: Non-member submission from ["Alex L. Potts" ] At 8:49 AM -0600 5/5/99, owner-sc-users@lists.io.com wrote: >From: "Alex L. Potts" <---@---.---> >To: sc-users@lists.io.com >Subject: Pan8.ar > >james, > i must have missed this somewhere, but why was the Pan8 not >implemented? > >alex PanAz will pan through up to 16 channels in a circle if that is what you want. If you want an 8 corner cube you could do something like: #up, down = Pan2.ar(in, z); // the ++ concatenates the two 4 channel arrays into an 8 channel array. out = Pan4.ar(up, x, y) ++ Pan4.ar(down, x, y); --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Thu, 6 May 1999 08:47:17 -0600 From: James McCartney <---@---.---> Subject: Re: New Help Files 2.1.3 / SeqCollections At 2:01 PM -0600 5/2/99, crucial wrote: >James, > >Thanks for the Pattern Examples, that helps. I'll have to fiddle more. > >Plug ! Excellant ! > >Numerous help files in 2.1.3 and 2.1.2 distributions are aliases pointing >to other unrelated help files. >eg. True and False both point to ZeroCrossing. Does anyone else see this? It works for me (opens Boolean.help). >I'm still trying to get familiar with Streams and SequenceableCollections. > >Things I don't get............. >///////////////////// >SequenceableCollection > >Superclass: Collection > >SequenceableCollection is a class of Collections whose elements can be >indexed by an Integer. > >{ > var s; > > s=SequenceableCollection.new([16,4,3,5]); > > s.at(2).postln; >} > > Integer 2 >ERROR: >Primitive '_BasicAt' failed. > >Not an indexable object. >RECEIVER: >Instance of SequenceableCollection SequenceableCollection is an abstract class. you should not create a SequenceableCollection. You should use one of its concrete subclasses like List, Array, LinkedList, etc. 'new' for any collection takes the initial reserved size of the collection as the argument. so the argument [16,4,3,5] would not make sense anyway. > >/////////////////////// > >var s; > > >s=SequenceableCollection.series(1,2,3); > >ERROR: >'add' should have been implemented by SequenceableCollection. > >CALL STACK: > Object : subclassResponsibility > arg this = < > >///////////////////////// Again, you should not create a SequenceableCollection. s = List.series(1, 2, 3).postln; List[ 2 ] which doesn't make much sense. it is a list of only one element. you probably meant: s = List.series(3, 1, 1).postln; List[ 1, 2, 3 ] > >Sorted Lists: > >var s; > >s=SortedList.new(4); > > >s.addAll([0,1,2,3,5,4,3,2]); > >ERROR: >Message 'addLast' not understood. This is a bug in SortedList addAll. You can fix it by changing the line in that method from: aCollection.do({ arg each; this.addLast(each) }); to: aCollection.do({ arg each; super.add(each) }); --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Thu, 6 May 1999 10:48:14 -0400 From: Mark Ballora <---@---.---> Subject: Re: New Help Files 2.1.3 / SeqCollections >At 2:01 PM -0600 5/2/99, crucial wrote: >>James, >> >>Thanks for the Pattern Examples, that helps. I'll have to fiddle more. >> >>Plug ! Excellant ! >> >>Numerous help files in 2.1.3 and 2.1.2 distributions are aliases pointing >>to other unrelated help files. >>eg. True and False both point to ZeroCrossing. > >Does anyone else see this? It works for me (opens Boolean.help). > I get Boolean.help from both True and False. $0.02: tho I have had to make a change in the main help screen these past couple of versions, come to think of it. [06 Blocks] seems to have no help file, so it just brings me back to the main screen. Changing it back to [06 Functions], the way it used to be, works. Mark ------------------------------ Date: Thu, 6 May 1999 10:34:47 -0600 From: James McCartney <---@---.---> Subject: Re: TSpawn vs. Pause - --============_-1286114006==_============ Content-Type: text/enriched; charset="us-ascii" At 1:58 PM -0600 5/4/99, Mark Ballora wrote: >The code below is something I created in response to a request to create >"something Arabic." I started with S. Liljegren's Pluck1 and the "Native >Algorhythms" example and came up with the following. > >It works, but I suspect it could be more efficient. > - high Ugen/CPU > - creating sound files - synth.record produces bad files > synth.write works fine One problem is that you are not putting {} around the first argument to some of your Pauses which means that they are really executing in the next Synth up instead of the Synth controlled by the Pause. Thus the Pause is merely acting as a mute to a running process rather than starting and stopping it. So the UGens in that Pause argument are always running. I was able to reduce the CPU by putting in {}. There are more extreme ways I'd like to rewrite this patch which I will post in a few days. I've attached a first rewrite. For starters: // Markov function, weighted output based on input integers -1 to 12, // integers used as scale index markov={ arg index; #[ [0, 7, -1, -1, -1 ], // - -1 [ -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7, 7, 7, 8, 8, 9, 9 ], // 0 [ 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6 ], // 1 [ -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 8, 10, 10, 10, 11, 11 ], // 2 [ 1, 5, 5, 6, 7, 7, 7, 7, 7, 8, 8, 8, 10, 10, 10, 10, 11 ], // 3 [ -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 1, 1, 1, 2, 2, 2, 6, 7, 7, 8, 8, 8, 9, 10, 10, 10, 11, 12 ], // 4 [ -1, -1, -1, -1, -1, -1, 4, 4, 4, 3, 2, 2, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 12, 12 ], // 5 [ -1, -1, -1, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 4, 2, 8, 8, 9, 10, 11 ], // 6 [ 7, -1, -1, -1, -1, -1, -1, 2, 9, 9, 10, 10, 5, 5 ], // 7 [ 6, 10, 9, 9, 9, 9, 9, 4, 4, 4, 11, 11 ], // 8 [ 7, 7, 7, 6, 5, 2, 11, 11, 11, 11, 11, 12, 12, 12 ], // 9 [ 12, 12, 12, 12, 12, 9, 8, 8, 6, 6 ], // 10 [ 12, 12, 12, 12, 12, 7, 4 ], // 11 [ -1, -1, -1, -1, -1, -1, -1, -1, 12, 10, 9, 0, 0, 0, 7 ] // 12 ].at(index.asInteger + 1).choose; }; - --============_-1286114006==_============ Content-Type: text/plain; name="pseudo_arabie"; charset="us-ascii" Content-Disposition: attachment; filename="pseudo_arabie" //Mime-Version: 1.0 //Date: Tue, 4 May 1999 15:58:21 -0400 //To: sc-users@lists.io.com //From: Mark Ballora <---@---.---> //Subject: TSpawn vs. Pause //Sender: owner-sc-users@lists.io.com //Precedence: bulk //Reply-To: sc-users@lists.io.com //Status: RO //X-Status: //X-Keywords: //X-UID: 242 // //The code below is something I created in response to a request to create //"something Arabic." I started with S. Liljegren's Pluck1 and the "Native //Algorhythms" example and came up with the following. // //It works, but I suspect it could be more efficient. // - high Ugen/CPU // - creating sound files - synth.record produces bad files // synth.write works fine // //I took interest in yesterday's discussion about using TSpawns instead of //Pauses. I can see that TSpawns are more efficient. But since I'm using //the i argument of each Spawn as a beat marker, and therefore do not want //initialization with each Spawned event, I kept everything in Pauses. I'm //not sure this configuration is optimal -- I suspect this might be a case //for Patterns. // //It starts with a canned intro of three phrases, followed by a drone and //drumbeat, then a series of phrases chosen at random from a library, to a //melody generated by a little order 1 Markov chain, back to the phrases and //then back to the Markov. It takes about 2:00 to go through those steps, //and then it continues until stopped. // PSEUDO ARABIE ( var pat, freq, excitation, resonator, lowdrum, hidrum, length, markov, seq; var env, persec; var fundamental, scale; var pluck, accentPattern; env = Env.new(#[1, 1, 0],#[1, 0.01]); fundamental=220; // TONIC TONE persec=6; // TEMPO // Markov function, weighted output based on input integers -1 to 12, integers used as scale index markov={ arg index; #[ [0, 7, -1, -1, -1 ], // -1 [ -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7, 7, 7, 8, 8, 9, 9 ], // 0 [ 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6 ], // 1 [ -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 8, 10, 10, 10, 11, 11 ], // 2 [ 1, 5, 5, 6, 7, 7, 7, 7, 7, 8, 8, 8, 10, 10, 10, 10, 11 ], // 3 [ -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 1, 1, 1, 2, 2, 2, 6, 7, 7, 8, 8, 8, 9, 10, 10, 10, 11, 12 ], // 4 [ -1, -1, -1, -1, -1, -1, 4, 4, 4, 3, 2, 2, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 12, 12 ], // 5 [ -1, -1, -1, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 4, 2, 8, 8, 9, 10, 11 ], // 6 [ 7, -1, -1, -1, -1, -1, -1, 2, 9, 9, 10, 10, 5, 5 ], // 7 [ 6, 10, 9, 9, 9, 9, 9, 4, 4, 4, 11, 11 ], // 8 [ 7, 7, 7, 6, 5, 2, 11, 11, 11, 11, 11, 12, 12, 12 ], // 9 [ 12, 12, 12, 12, 12, 9, 8, 8, 6, 6 ], // 10 [ 12, 12, 12, 12, 12, 7, 4 ], // 11 [ -1, -1, -1, -1, -1, -1, -1, -1, 12, 10, 9, 0, 0, 0, 7 ] // 12 ].at(index.asInteger + 1).choose; }; pluck = { arg rate, num, indexlist, amplist; Spawn.ar({ arg spawn, i, synth; // STAFFAN LILJEGREN'S PLUCK1 INSTRUMENT x = Decay.ar(Impulse.ar(0, 0.1+0.1.rand), 0.1+0.2.rand, BrownNoise.ar(amplist.wrapAt(i).value)); x = CombL.ar(x, 0.05, 1/scale.at(indexlist.wrapAt(i).value), 2+1.0.rand, EnvGen.ar(env)); }, 1, 1/(persec*rate), num); }; accentPattern = Array.fill(10, { {0.3.rand} }); accentPattern.put(0, 0.9); accentPattern.put(6, 0.7); // DEFINE AN ARAB SCALE, WITH ALTERED m2, M3, M6, M7: scale=[ 1, 1.09, 1.12, 1.19, 1.22, 1.33, 1.41, 1.5, 1.54, 1.68, 1.78, 1.83, 2 ].collect({ arg item, i; item*fundamental }); // SEQUENCES FOR HIGH DRUM (a la "NATIVE ALGORHYTHMS" EXAMPLE) pat = Prand.new([ Pseq.new(#[0.0, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0, 0.7, 0.0, 0.0]), Pseq.new(#[0.0, 0.2, 0.0, 0.7, 0.0, 0.0, 0.0, 0.7, 0.0, 0.0]), Pseq.new(#[0.0, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0, 0.7, 0.0, 0.2]), Pseq.new(#[0.0, 0.0, 0.0, 0.7, 0.2, 0.2, 0.0, 0.7, 0.0, 0.0]), Pseq.new(#[0.0, 0.0, 0.0, 0.7, 0.0, 0.0, 0.2, 0.7, 0.2, 0.0]), Pseq.new(#[0.0, 0.0, 0.2, 0.7, 0.0, 0.0, 0.0, 0.7, 0.0, 0.0]) ], inf); Synth.play({ arg synth; var ldfreq, hdfreq, ldvol, hdvol, envlev; var motifspawner, drumbeat, drone, intro, chain, measure; var nextindex; measure = 10/persec; nextindex=Plug.kr(0); intro=Plug.kr(1); drone=Plug.kr(0); drumbeat=Plug.kr(0); motifspawner=Plug.kr(0); ldfreq=Plug.kr(150); hdfreq=Plug.kr(200); ldvol=Plug.kr(0); hdvol=Plug.kr(0); chain=Plug.kr(0); t = LFPulse.ar(persec); lowdrum=FSinOsc.ar(ldfreq, 0.65); hidrum=Resonz.ar(WhiteNoise.ar(14), hdfreq, 0.008, 4); synth.repeat(0, 1/persec, { var newldfreq, newhdfreq; // ALTER PITCHES OF DRUMS EACH TEMPO INCREMENT: newldfreq=125+25.rand; newhdfreq=200+100.rand; ldfreq.source=newldfreq; hdfreq.source=newhdfreq; // SYNTH.TIME CONTROLS WHICH PAUSE UNITS ARE SOUNDING if ( synth.time > 15, { intro.source=0; }); // Start with intro, turn off after 15 sec. if ( synth.time > (measure*8), // Meas 9 - start tonic drone { drone.source=1; }); if ( synth.time > (measure*10), // Meas 10 - start drums { drumbeat.source=1; }); if ( synth.time > (measure*12), // Meas 12 - start choosing from a set of motifs { motifspawner.source=1 }); if (synth.time > (measure*29), // Meas 29 - stop playing the motifs { motifspawner.source=0; }); if (synth.time > (measure*30), // Meas 30 - stop droning tonic, use Markov to generate melody { drone.source=0; chain.source=1; }); if (synth.time > (measure*50), // Meas 50 - stop Markov melody, start tonic drone { chain.source=0; drone.source=1; }); if (synth.time > (measure*52), // Meas 52 - start playing from motifs { motifspawner.source=1; }); if (synth.time > (measure*70), // Meas 70 - stop playing the motifs { motifspawner.source=0; }); if (synth.time > (measure*71), // Meas 71 - start Markov melody, (this time with the tonic drone) { chain.source=1; }); }); // ALL INSTRUMENTS ARE WITHIN PAUSE.AR() UNIT GENERATORS. // THUS THEY ARE CONTROLLED BY THE BOOLEAN VARIABLES. // THREE INTRO PHRASES (for 15 sec.) Pause.ar({ Cycle.ar([{ // Cycle Phrase 1 pluck.value(0.8, 25, #[0, 0, 0, 0, 0, 0, 2, 0, 0, 8, 9, 0, 0, 9, 0, 9, 9, 0, 9, 0, 0, 0, 0, 0, 0 ], #[0, 0, 0, 0, 0, 0, 1.0, 0, 0, 0.9, 1.0, 0, 0, 1.0, 0, 0.7, 0.6, 0, 0.9, 0, 0, 0, 0, 0, 0 ] ); }, // Cycle Phrase 2 { pluck.value(0.8, 15, #[0, 0, 9, 0, 10, 0, 9, 8, 9, 0, 0, 0, 0, 0, 0 ], #[0, 0, 1.0, 0, 0.9, 0, 1.1, 1.0, 1.0, 0, 0, 0, 0, 0, 0 ] ); }, // Cycle Phrase 3 { pluck.value(0.7, 20, #[ 2, 0, 3, 6, 0, 6, 0, 6, 6, 0, 0, 4, 0, 2, 0, 0, 0, 1, 0, 0 ], #[0.9, 0, 1.0, 0.9, 0, 0.9, 0, 1.1, 0.8, 0, 0, 0.7, 0, 1.1, 0, 0, 0, 0.9, 0, 0 ] ); }], 1, nil, 1) }, intro) + // PLUCKED INSTRUMENT DRONES THE TONIC (starting at beat 80) Pause.ar({ var amplist; pluck.value(1, nil, #[0], accentPattern); }, drone) + // LOW AND HIGH DRUMS ALTERNATE IN 10/8 METER (starting at beat 100) Pause.ar({ Decay2.ar( // noise drum ImpulseSequencer.ar(pat.asStream, t), 0.002, 0.3, hidrum) + Decay2.ar( // bass drum 1 2 3 4 5 6 7 8 9 10 ImpulseSequencer.ar(`[0.8, 0.0, 0.0, 0.0, 0.0, 0.6, 0.4, 0.0, 0.0, 0.0], t), 0.01, 0.5, lowdrum) }, drumbeat) + // MELODIC FRAGMENTS (OR SILENCE OR HARMONIC DRONES), CHOSEN RANDOMLY (starting at beat 110) Pause.ar({ RandomEvent.ar([{ pluck.value(1, 20, #[3], accentPattern); }, { pluck.value(1, 20, #[8], accentPattern); }, { pluck.value(1, 30, #[9], accentPattern); }, { pluck.value(1, 20, #[4], accentPattern); }, { pluck.value(1, 20, #[7], accentPattern); }, { Spawn.ar({ nil }, 1, 1/persec, 10); }, { Spawn.ar({ nil }, 1, 1/persec, 20); }, { Spawn.ar({ nil }, 1, 1/persec, 10); }, { Spawn.ar({ nil }, 1, 1/persec, 20); }, { pluck.value(2, 40, #[ 0, 0, 0, 0, 5, 0, 6, 0, 11, 0, 10, 11, 9, 0, 8, 0, 6, 0, 4, 0, 12, 0, 10, 11, 9, 0, 8, 0, 6, 0, 4, 0, 5, 0, 0, 0, 0, 0, 0, 0 ], #[ 0, 0, 0, 0, 0.8, 0, 0.6, 0, 0.9, 0, 0.4, 0.5, 0.7, 0, 0.8, 0, 0.8, 0, 0, 0, 0.9, 0, 0.4, 0.5, 0.7, 0, 0.8, 0, 0.9, 0, 0.7, 0, 0.9, 0, 0, 0, 0, 0, 0, 0 ]); }, { pluck.value(2, 30, #[ 0, 0, 5, 0, 3, 4, 2, 0, 4, 0, 4, 0, 0, 0, 4, 0, 4, 0, 4, 3, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0 ], #[ 0, 0, 0.7, 0, 0.5, 0.5, 0.8, 0, 0.7, 0, 0.8, 0, 0, 0, 0.7, 0, 0.6, 0, 0.8, 0.6, 0.7, 0, 0, 0, 0, 0, 0.8, 0, 0, 0 ]); }, { pluck.value(1, 10, #[ 8, 0, 0, 9, 0, 0, 0, 0, 0, 0 ], #[ 0.9, 0, 0, 1.3, 0, 0, 0, 0, 0, 0 ]); }, { pluck.value(2, 30, #[ 6, 0, 7, 0, 7, 0, 4, 5, 3, 0, 2, 0, 6, 0, 7, 0, 7, 0, 4, 5, 3, 0, 2, 0, 7, 0, 0, 0, 0, 0 ], #[ 0.8, 0, 0.7, 0, 0.8, 0, 0.5, 0.6, 0.8, 0, 0.9, 0, 0.8, 0, 0.7, 0, 0.8, 0, 0.5, 0.6, 0.8, 0, 0.9, 0, 1.0, 0, 0, 0, 0, 0 ]); }, { pluck.value(2, 20, #[ 11, 0, 10, 11, 10, 0, 7, 0, 10, 0, 0, 0, 10, 0, 10, 0, 0, 0, 0, 0], #[ 0.8, 0, 0.6, 0.5, 0.7, 0, 0.7, 0, 1.0, 0, 0, 0, 1.1, 0, 0.8, 0, 0, 0, 0, 0]); }, { pluck.value(2, 40, #[0, 0, 0, 0, 0, 0, 7, 0, 7, 0, 8, 0, 7, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, 0, 8, 0, 7, 6, 7, 0, 0, 0, 0, 0 ], #[0, 0, 0, 0, 0, 0, 0.7, 0, 0.7, 0, 0.9, 0, 0.5, 0.4, 0.8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.7, 0, 0.7, 0, 0.9, 0, 0.5, 0.4, 0.8, 0, 0, 0, 0, 0 ]); }, { pluck.value(2, 30, #[12, 0, 10, 11, 7, 8, 5, 0, 3, 0, 1, 0, 12, 0, 10, 11, 7, 8, 5, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0 ], #[0.8, 0, 0.7, 0.6, 0.7, 0.6, 0.8, 0, 0.9, 0, 0.8, 0, 0.8, 0, 0.7, 0.6, 0.7, 0.6, 0.8, 0, 0.9, 0, 0.8, 0, 0.9, 0, 0, 0, 0, 0 ]); } ], 1, nil, nil) }, motifspawner) + // 1ST ORDER MARKOV CHAIN Pause.ar({ Spawn.ar({ arg spawn, i, synth; var interim, nextval, freq, xamp; // Index value stored in variable external to the Spawn, nextindex. // The local variable interim polls nextindex, and feeds the value into // the Markov function. // Because nextindex sometimes was a float, I specify that interim // is either -1 or the ceiling of the polled value if ( isNegative(nextindex.poll), { interim = -1; }, { interim=nextindex.poll.ceil;}); // Markov function nextval=markov.value(interim); // nextval.postln; // Update global variable nextindex.source=nextval.ceil; if ( isNegative(nextval), { freq=1; xamp=0; }, { freq=scale.at(nextval); xamp = 0.3.rand + 0.4 } ); // freq.postln; x = Decay.ar(Impulse.ar(0, 0.1+0.1.rand), 0.1+0.2.rand, BrownNoise.ar(xamp)); x = CombL.ar(x, 0.05, 1/freq, 2+1.0.rand, EnvGen.ar(env)); }, 1, 1/(persec) ) }, chain); }) ) - --============_-1286114006==_============ Content-Type: text/enriched; charset="us-ascii" --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < - --============_-1286114006==_============-- ------------------------------ Date: Thu, 6 May 1999 19:31:27 +0100 From: Pieter Suurmond <---@---.---> Subject: Re: -2604: 2CB7580-library not found. >>Dear SC-users, >> >>Maybe someone can help me,... I have a problem with my >>PowerBook 1400cs & SuperCollider. >> >>SC 2 runs excellent on our desktop-PPC! >> >>However, when I try to launch "SC2.1.3" on my PowerBook >>1400cs (running OS7.6.1) I get this message: >>............................................................ >>Error while loading libraries. The library named . >>"2CB7580" could not be found. Please install this library . >>or contact customer support. >>Result code: -2604 >>............................................................ >> >>Any idea what this could mean? >>Some part of my OS missing or something? > - --------------------------------------------- "suppan@atnet.at" ANSWERED: >This is not a problem of your OS. >I have a PowerBook 1400cs too, and unfortunately SC2 >doesn't run anyway on this machine. > >Maybe James there is a way to fix it, because SC1.1b5 >runs without problems! - --------------------------------------------- Thanks, for your reaction "suppan"! It really helps,.. not feeling so alone anymore. I have the same experience: I spent days & weeks trying to run different versions of SC2,... with different versions of Mac OS,..... but it wont work on PowerBook1400. Version 1, on the other hand, runs EXCELLENT! Unfortunately James has not (yet) answered questions regarding powerbooks. But,... I can imagine it must be a lot of work to support all these different Macintoshes. I'll be patient..... Kind regards, Pieter Pieter Suurmond Utrecht School of the Arts e-mail: pieter@kmt.hku.nl Music Technology department www: http://www.hku.nl/~pieter/ PO box 2471 phone: (+31) 35 6836464 1200 CL Hilversum fax: (+31) 35 6836480 Netherlands ------------------------------ Date: Thu, 6 May 1999 17:15:24 -0500 From: rkuivila@mail.wesleyan.edu Subject: MIDI mapping Hi James, For some reason, mapping MIDI key down to a GUI element uses key# rather than velocity as its parameter. This can be useful in some cases, but I would like to use MIDI keys to set and unset checkboxes....For that, it would be nice to have mapping of MIDI key down work just like mapping of MIDI continuous controller. RJK ------------------------------ Date: Thu, 06 May 1999 18:05:26 -0400 From: "crucial" <---@---.---> Subject: Re: New Help Files 2.1.3 / SeqCollections >>Numerous help files in 2.1.3 and 2.1.2 distributions are aliases pointing >>to other unrelated help files. >>eg. True and False both point to ZeroCrossing. >JMC >Does anyone else see this? It works for me (opens Boolean.help). Strange, about 30 or 40 of them are like this in each of the distributions. Perhaps something weird happened during a crash or something, but everything else seems normal on my computer. >SequenceableCollection is an abstract class. ah! Well that's what random snooping will get me. You should put a *new{this.shouldNotImplement in there to keep us half-educated programmers out. Thanks for the other help. __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Thu, 06 May 1999 18:37:05 -0400 From: "crucial" <---@---.---> Subject: Re: New Help Files 2.1.3 / SeqCollections I just downloaded ftp://www.audiosynth.com/pub/updates/SC2.1.3.sea.bin and it was exactly the same, all the same aliases pointing to various different files. __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Thu, 6 May 1999 17:15:24 -0500 From: rkuivila@mail.wesleyan.edu Subject: MIDI mapping Hi James, For some reason, mapping MIDI key down to a GUI element uses key# rather than velocity as its parameter. This can be useful in some cases, but I would like to use MIDI keys to set and unset checkboxes....For that, it would be nice to have mapping of MIDI key down work just like mapping of MIDI continuous controller. RJK ------------------------------ Date: Thu, 06 May 1999 18:13:27 -0400 From: "crucial" <---@---.---> Subject: Smalltalk Patterns I found a fairly decent tutorial on common design patterns with implementations in Dolphin Smalltalk : http://www.object-arts.com/EducationCentre/Patterns/PatternIndex.htm the Model and Dependancy patterns are discussed, as are several good recommendations for dealing with instance variables. btw. I actually interviewed for a consulting position using Smalltalk. I had it listed among my more marketable languages, and they pulled me in for an interview. But I'm not nearly experienced enough to work on stuff at that level. It was for customer support for Brooklyn Union Gas. __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Thu, 06 May 1999 18:09:18 -0400 From: "crucial" <---@---.---> Subject: Re: -2604: 2CB7580-library not found. Actually I have gotten SC2.029d to work on my 1400cs117Mhz. It can't do much, and its best to keep away from anything involving the GUI, but it will play. I am using system 7.5.3 No-one I know has been able to get it to work on later system versions due to SoundManager changes. >>>Error while loading libraries. The library named . >>>"2CB7580" could not be found. Please install this library . >>>or contact customer support. >>>Result code: -2604 >>>............................................................ >>> >>>Any idea what this could mean? >>>Some part of my OS missing or something? >> >--------------------------------------------- >"suppan@atnet.at" ANSWERED: > >>This is not a problem of your OS. >>I have a PowerBook 1400cs too, and unfortunately SC2 >>doesn't run anyway on this machine. >> >>Maybe James there is a way to fix it, because SC1.1b5 >>runs without problems! >--------------------------------------------- > >Thanks, for your reaction "suppan"! >It really helps,.. not feeling so alone anymore. >I have the same experience: I spent days & weeks trying >to run different versions of SC2,... with different >versions of Mac OS,..... but it wont work on PowerBook1400. >Version 1, on the other hand, runs EXCELLENT! > >Unfortunately James has not (yet) answered questions >regarding powerbooks. But,... I can imagine it must be >a lot of work to support all these different Macintoshes. > >I'll be patient..... > >Kind regards, >Pieter > > > > >Pieter Suurmond >Utrecht School of the Arts e-mail: pieter@kmt.hku.nl __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Thu, 6 May 1999 18:46:40 -0600 From: James McCartney <---@---.---> Subject: Re: New Help Files 2.1.3 / SeqCollections At 4:05 PM -0600 5/6/99, crucial wrote: >>SequenceableCollection is an abstract class. > >ah! Well that's what random snooping will get me. >You should put a *new{this.shouldNotImplement >in there to keep us half-educated programmers out. If I did that then super.new in the subclasses would not work. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Thu, 6 May 1999 19:48:56 -0400 (EDT) From: David Crandall <---@---.---> Subject: Re: multiple sound file playback Thanks, James, for the reply. The code works great. The thing I don't understand is whether the sound.read statments, as in sound1 = SoundFile.new; ok = ok && sound1.read(":Sounds:cymbal0"); perform some function necessary to the playback or is just a check for a readable file? I tried making a soundfile player without the "if" statement and it wouldn't work. dc ------------------------------ Date: Thu, 6 May 1999 23:06:22 -0600 From: James McCartney <---@---.---> Subject: Re: multiple sound file playback At 5:48 PM -0600 5/6/99, David Crandall wrote: >Thanks, James, for the reply. The code works great. > >The thing I don't understand is whether the sound.read statments, as in > >sound1 = SoundFile.new; >ok = ok && sound1.read(":Sounds:cymbal0"); > >perform some function necessary to the playback or is just a check for a >readable file? I tried making a soundfile player without the "if" >statement and it wouldn't work. 'read' reads the file. If you don't read the file you have no data to play. --- 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 #38 *****************************