From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #27 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, February 18 1999 Volume 01 : Number 027 ---------------------------------------------------------------------- Date: Thu, 11 Feb 1999 14:15:37 -0500 From: "crucial" <---@---.---> Subject: Re: Using TSpawn as a mixer >The ugen graph must be created inside the tspawn event function >so that it is created in the context of a Synth. Thank you, that works great. I had less luck converting this to a class. I tried : Effect { var Subject: Re: patterns repost >I got a bit stuck on streams and patterns : >pattern = Pseq.new([ Pseq.new( #[ 1, 0, 0, 0 ], 3), > Prand.new([Pseq.new( #[ 0,1,1,1 ], 1), > Pseq.new(#[ 0,1,0,1 ], 1) > ],1) > ]) > >Despite looking at the pattern example and the library I'm a bit stuck as >to how to turn this into an input in ImpulseSequencer.ar. I haven't ever worked with Pseq s at all, but I have noticed that ImpulseSequencer once it is started, can't really be handed a new array, and the array cannot be altered. OrcScore is more flexible in that regard, and the array can be put to : array.put(index,data) and this will be "live" data for OrcScore. Delta Time too, which makes for fun time slinkys. ImpulseSequencer will, however, evaluate whatever it is given in the place of the array, so instead of a pattern, you could give it a function { // you could simply keep a counter //or counters for bars, etc. counter=counter+1; //and return the appropriate //value for that step if(counter/16==4.{pattern2.at(counter/16)},{pattern1.at(counter/16)} //or use wrapAt(counter) } something more sophisticated than the if statement would be better, it depends on what kind of pattern switching you want to do. like keep a list of patterns [[0,3],[1,1]] // 0th patt 3 times, 1st patt 1 time I am very interested myself to figure out how to use streams and filter patterns. But I can't suss it from the classes. __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Thu, 11 Feb 1999 15:11:21 -0600 From: James McCartney <---@---.---> Subject: Re: SC2/PB1400 At 1:15 PM -0600 2/11/99, crucial wrote: >Sorry, just to reclarify the above quoted figures : > >my pb 1400cs117mHz compiles in 23.50 >my friend's identical pb 1400cs117mHz compiles > in 146 seconds ! Are the system versions the same on these two machines ? What are they ? --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 12 Feb 1999 02:14:14 +0100 (CET) From: Arie van Schutterhoef <---@---.---> Subject: Re: SC2/PB1400 >Are the system versions the same on these two machines ? >What are they ? - - PowerBook 1400 cs/117 Mhz 603e PPC/60 meg RAM with OS 8.1 I think the problem has something the do with buffer sizes, because at the start up it mentions: input and output buffers not the same size?? 512 4096 And when I ran a FFT-patch from the examples, it refused to do so and at the bottom said: wr 64 52 3840 4096 I've tried different types of Sound Managers: 3,0/3,2,1/3,3, but this didn't change anything. So I don't know what's wrong. Arie van Schutterhoef Schreck Ensemble Holland <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Arie van Schutterhoef artistic director Schreck Ensemble # -laboratory for live electro-acoustic music- # The Netherlands e-mail:arsche@stad.dsl.nl http://www.xs4all.nl/~schreck/ Tel: 00-31-71-5612287 Fax: 00-31-70-3859268 <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ------------------------------ Date: Fri, 12 Feb 1999 11:27:33 +0000 From: finer@easynet.co.uk Subject: RAM and Samples/soundfiles On a Powerbook 3400c (system 7.5) I find that with 22Mb RAM allocated, a 4 Mb sample blows the memory - 'out of memory : DANGER' it says (or words to that effect). This seems a very small amount of sound to NOT be able to load into RAM. I seem to remember that this came up a while ago and James said it might be a garbage collection problem ? Is there anyway of improving the amount of samples that can be loaded ? Jem ------------------------------ Date: Fri, 12 Feb 1999 07:35:47 -0600 From: James McCartney <---@---.---> Subject: Re: RAM and Samples/soundfiles At 5:27 AM -0600 2/12/99, finer@easynet.co.uk wrote: >On a Powerbook 3400c (system 7.5) I find that with 22Mb RAM allocated, a 4 >Mb sample blows the memory - 'out of memory : DANGER' it says (or words to >that effect). > >This seems a very small amount of sound to NOT be able to load into RAM. > >I seem to remember that this came up a while ago and James said it might be >a garbage collection problem ? Most sounds double in size when loaded into memory. SC stores sounds as floats and most files store them as shorts. Plus there is overhead because SC garbage collected objects can only be powers of two in size. So your 16bit 4Mb sound, if it is actually slightly larger than 4Mb and gets doubled to a 32bit >8Mb which is rounded up to the next power of two = 16Mb. That rounding of large objects is a big problem that I hope to fix, but it requires a lot of conditional code in the virtual machine so I haven't gotten it done yet. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 12 Feb 1999 07:37:29 -0600 From: James McCartney <---@---.---> Subject: Re: RAM and Samples/soundfiles At 5:27 AM -0600 2/12/99, finer@easynet.co.uk wrote: >Is there anyway of improving the amount of samples that can be loaded ? Make your samples slightly smaller than powers of two. Buy more memory. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 12 Feb 1999 13:01:48 -0400 From: rkuivila@mail.wesleyan.edu Subject: TSpawn as a mixer in GUIUtils Hi James, Iannis, and crucial, SoundManager in GUIUtils sets up a situation where code running in any context can spawn inside the SoundManager context. But it does not (yet) provide a mechanism to allow code anywhere to spawn inside the context of any running synth. Below is some code that gets part way there, based on the earlier mailing list discussion. routa is the 'mixer' routb is a routine to trigger a sound running inside of the mixer. It was necessary for routb to schedule a task inside the Synth running the TSpawn generated by routa. (Hence this, somewhat involved, code (where 'out' holds the tspawn's OutputProxy): out.source.synth.sched(0, { arg synth,c,task; out.source.trigger({FSinOsc.ar(800.rand,0.3);});});) However, SoundManager requires a new soundfunction to return a valid UG graph, so it was necessary to have routb return something. Furthermore, the something it returned has to have non-zero amplitude. The relevant method inside SoundManager is *ara, which you will see further below. One possible fix to this problem would be to evaluate soundfunc before actually spawning and only spawn when the soundfunc returns a value. Perhaps it would be preferable to arrange things so that a UnitGenerator with a nil parameter returns nil rather than trying to instantiate itself. Is that possible? Another problem is synchronization. You cannot use "out.source.synth.sched" below until the synth has actually been created. But it would be more convenient to be able to define a 'mixer' and then trigger some sounds within it without having to worry if synth has been created yet. ( var routa; var routb; var out; routa = { arg sp, c, synth; out=TSpawn.ar( { arg tsp,evCount,synth, addMe; addMe.value(tsp,evCount,synth); // evaluate the function which creates the ugen graph },2,nil,1); // 2 channels, forever, immediately triggered }; routb = { arg sp, c, synth; out.source.synth.sched(0, { arg synth,c,task; out.source.trigger({FSinOsc.ar(800.rand,0.3);});}); SinOsc.ar(400,0,0.01); // SoundManager requires the soundfunc to return a valid UG graph }; SoundPalette.play([ ['addsound', "Effects Unit",nil,routa;], ['addsound',"Dust Unit",nil,routb;] ]); ) // Since "Effects Unit" initializes out, you MUST start // "Effects Unit" before "Dust Unit" or it will crash ( This is the routine SoundManager uses to trigger new soundfunc's: *ara { arg soundfunc, spawnref; if ( topsynth.notNil, { sound = { arg sp, c, synth; Spawn.ar( { arg sp, c, synth; spawnref.value_({ sp.stop; sp.releaseAll }); EnvGen.ar(fader, soundfunc.value(sp, c, synth)) }, numchans, nil, 1) }; spawner.trigger; }); } ) RJK ------------------------------ Date: Fri, 12 Feb 1999 13:01:48 -0400 From: rkuivila@mail.wesleyan.edu Subject: TSpawn as a mixer in GUIUtils Hi James, Iannis, and crucial, SoundManager in GUIUtils sets up a situation where code running in any context can spawn inside the SoundManager context. But it does not (yet) provide a mechanism to allow code anywhere to spawn inside the context of any running synth. Below is some code that gets part way there, based on the earlier mailing list discussion. routa is the 'mixer' routb is a routine to trigger a sound running inside of the mixer. It was necessary for routb to schedule a task inside the Synth running the TSpawn generated by routa. (Hence this, somewhat involved, code (where 'out' holds the tspawn's OutputProxy): out.source.synth.sched(0, { arg synth,c,task; out.source.trigger({FSinOsc.ar(800.rand,0.3);});});) However, SoundManager requires a new soundfunction to return a valid UG graph, so it was necessary to have routb return something. Furthermore, the something it returned has to have non-zero amplitude. The relevant method inside SoundManager is *ara, which you will see further below. One possible fix to this problem would be to evaluate soundfunc before actually spawning and only spawn when the soundfunc returns a value. Perhaps it would be preferable to arrange things so that a UnitGenerator with a nil parameter returns nil rather than trying to instantiate itself. Is that possible? Another problem is synchronization. You cannot use "out.source.synth.sched" below until the synth has actually been created. But it would be more convenient to be able to define a 'mixer' and then trigger some sounds within it without having to worry if synth has been created yet. ( var routa; var routb; var out; routa = { arg sp, c, synth; out=TSpawn.ar( { arg tsp,evCount,synth, addMe; addMe.value(tsp,evCount,synth); // evaluate the function which creates the ugen graph },2,nil,1); // 2 channels, forever, immediately triggered }; routb = { arg sp, c, synth; out.source.synth.sched(0, { arg synth,c,task; out.source.trigger({FSinOsc.ar(800.rand,0.3);});}); SinOsc.ar(400,0,0.01); // SoundManager requires the soundfunc to return a valid UG graph }; SoundPalette.play([ ['addsound', "Effects Unit",nil,routa;], ['addsound',"Dust Unit",nil,routb;] ]); ) // Since "Effects Unit" initializes out, you MUST start // "Effects Unit" before "Dust Unit" or it will crash ( This is the routine SoundManager uses to trigger new soundfunc's: *ara { arg soundfunc, spawnref; if ( topsynth.notNil, { sound = { arg sp, c, synth; Spawn.ar( { arg sp, c, synth; spawnref.value_({ sp.stop; sp.releaseAll }); EnvGen.ar(fader, soundfunc.value(sp, c, synth)) }, numchans, nil, 1) }; spawner.trigger; }); } ) RJK ------------------------------ Date: Fri, 12 Feb 1999 14:00:59 -0500 From: "crucial" <---@---.---> Subject: Re: SC2/PB1400 >>my pb 1400cs117mHz compiles in 23.50 >>my friend's identical pb 1400cs117mHz compiles >> in 146 seconds ! > >Are the system versions the same on these two machines ? >What are they ? > I have 7.5.3 Sound Manager 3.2.1 (and it works) my friend is running... (sc2d29 demo version) "so the sound manager is version 3.3 from OS 8.5 and the sound control panel is version 8.0.5 from OS 8.5" Still has the unequal buffers, not working. __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Fri, 12 Feb 1999 14:20:38 -0500 From: "crucial" <---@---.---> Subject: Re: RAM and Samples/soundfiles >At 5:27 AM -0600 2/12/99, finer@easynet.co.uk wrote: > >>Is there anyway of improving the amount of samples that can be loaded ? > >Make your samples slightly smaller than powers of two. >Buy more memory. > > > --- james mccartney I am experimenting with something whereby if the headers are all read into memory, the samples themselves can be loaded and unloaded during the course of the piece. Not sure if it is possible yet. __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Fri, 12 Feb 1999 14:38:21 -0600 From: James McCartney <---@---.---> Subject: Re: RAM and Samples/soundfiles At 1:20 PM -0600 2/12/99, crucial wrote: >I am experimenting with something whereby if the headers are all read >into memory, the samples themselves can be loaded and unloaded during >the course of the piece. Not sure if it is possible yet. No, you can't do that at the moment. That would be something I'd have to add as an asynchronous operation. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sat, 13 Feb 1999 18:16:44 -0600 From: James McCartney <---@---.---> Subject: Re: patterns repost At 4:19 AM -0600 2/10/99, finer@easynet.co.uk wrote: >I got a bit stuck on streams and patterns : > >I'm trying to do a simple thing in the context of ImpulseSequencer.ar > >What I want to do is give it a score in the form of a stream so that it'll >repeat a pattern 3 times and then on the fourth time round choose another >pattern from a number of possibilities. > >So I've got a pattern like this : > >pattern = Pseq.new([ Pseq.new( #[ 1, 0, 0, 0 ], 3), > Prand.new([Pseq.new( #[ 0,1,1,1 ], 1), > Pseq.new(#[ 0,1,0,1 ], 1) > ],1) > ]) > >Despite looking at the pattern example and the library I'm a bit stuck as >to how to turn this into an input in ImpulseSequencer.ar. > > You need to make the outer pattern have indefinite extent, i.e. repeat forever, by passing it a nil value for repeat count. There is an example in the Examples 3 file on using a pattern in an Impulse Sequencer. Here is your pattern used : ( play({ arg synth; var t, x, pat; pat = Pseq.new([ Pseq.new( #[ 1, 0, 0, 0 ], 3), Prand.new([ Pseq.new(#[ 0,1,1,1 ], 1), Pseq.new(#[ 0,1,0,1 ], 1) ], 1) ], nil); t = LFPulse.ar(8); // use a pulse wave as a trigger x = Decay2.ar( // clave rhythm ImpulseSequencer.ar(pat.newValueStream, t), 0.001, 0.3, FSinOsc.ar(1700, 0.1)) + Decay2.ar( // bass drum ImpulseSequencer.ar(`[1,0,0.2,0,0.2,0,0.2,0], t), 0.001, 0.5, FSinOsc.ar(100, 0.2)); }) ) >The other thing is looking at the example I see - Pname.new('note' > >Looking for this in the library I could find only a list of things, ~freq, >~dur etc under the *newTop method in Environment.sc, which i thought might >relate to "note'. >I was wondering where 'note' came in/from and whether the recognition of >'note' opened the door (as it were) to .dur, .legato etc. This needs to be doc'ed. It is too much to go into here, though I may later on.. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Sat, 13 Feb 1999 18:22:10 -0600 From: James McCartney <---@---.---> Subject: Re: patterns repost At 1:15 PM -0600 2/11/99, crucial wrote: >I haven't ever worked with Pseq s at all, but I have noticed that >ImpulseSequencer >once it is started, can't really be handed a new array, and the array cannot >be altered. Not true! :-) This patch alters the sequence every 10 seconds : ( play({ arg synth; var t, z; z = `[1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0]; // the following synth task gets called every 10 seconds. synth.repeat( 10, // begin task in 10 seconds 10, // call every 10 seconds // z is a Ref so get and set the value // with the 'value' message { z.value = z.value.scramble; } ); t = LFPulse.ar(8); // use a pulse wave as a trigger Decay2.ar( // clave rhythm ImpulseSequencer.ar(z, t), 0.001, 0.3, FSinOsc.ar(1700, 0.1)) + Decay2.ar( // bass drum ImpulseSequencer.ar(`[1,0,0.2,0,0.2,0,0.2,0], t), 0.001, 0.5, FSinOsc.ar(100, 0.2)); })) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Sun, 14 Feb 1999 21:32:20 -0500 (EST) From: Mark Ballora <---@---.---> Subject: formant UG Curiosity as to the nature of the Formant UG: The patch below is a variant on the GUI Examples patch, with sliders added to investigate all parameters, and an added FSinOsc for reference. Formant.help: "Generates a set of harmonics around a formant frequency at a given fundamental frequency." I can see that it's not simply a complex series of harmonics with spectral shaping. I could get that with a Blip and a series of Resonz. I get tremolo-like results with extremely low "add" values (< 20 or so). Also, there's still a pulsing, even when the "freq" value is turned down to 0. Is something akin to amplitude modulation going on between the fundamental frequency and the formant frequency? Generating sidebands around the formant frequency? =========================== ( var w, freqslid, mulslid, addslid, freqdisp, muldisp, adddisp, formslid, formdisp, sinfreq, sindisp, sinvol, sinvold, bw, bwd; w = GUIWindow.new("panel", Rect.newBy( 29, 56, 576, 199 )); freqslid=SliderView.new( w, Rect.newBy( 33, 32, 16, 116 ), "SliderView", 4, 1, 10, 0, 'linear'); freqdisp=NumericalView.new( w, Rect.newBy( 13, 153, 64, 20 ), "NumericalView", 4, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 11, 7, 70, 21 ), "freq"); mulslid=SliderView.new( w, Rect.newBy( 107, 32, 16, 116 ), "SliderView", 2, 0, 10, 0, 'linear'); muldisp=NumericalView.new( w, Rect.newBy( 87, 153, 64, 20 ), "NumericalView", 2, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 85, 7, 70, 21 ), "mul"); addslid=SliderView.new( w, Rect.newBy( 181, 32, 16, 116 ), "SliderView", 200, -10, 1000, 0, 'linear'); adddisp=NumericalView.new( w, Rect.newBy( 161, 153, 64, 20 ), "NumericalView", 200, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 159, 7, 70, 21 ), "add"); formslid=SliderView.new( w, Rect.newBy( 255, 32, 16, 116 ), "SliderView", 400, 200, 1000, 0, 'linear'); formdisp=NumericalView.new( w, Rect.newBy( 235, 153, 64, 20 ), "NumericalView", 400, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 233, 7, 70, 21 ), "formant"); bw=SliderView.new( w, Rect.newBy( 338, 32, 16, 116 ), "SliderView", 1, 1, 10, 0.1, 'linear'); bwd=NumericalView.new( w, Rect.newBy( 318, 153, 64, 20 ), "NumericalView", 1, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 316, 7, 70, 21 ), "bw"); sinfreq=SliderView.new( w, Rect.newBy( 442, 32, 16, 116 ), "SliderView", 200, 0, 1000, 0, 'linear'); sindisp=NumericalView.new( w, Rect.newBy( 422, 153, 64, 20 ), "NumericalView", 200, 0, 1000, 0, 'linear'); StringView.new( w, Rect.newBy( 420, 7, 70, 21 ), "Sine freq"); sinvol=SliderView.new( w, Rect.newBy( 523, 32, 16, 116 ), "SliderView", 0.1, 0, 1, 0, 'linear'); sinvold=NumericalView.new( w, Rect.newBy( 503, 153, 64, 20 ), "NumericalView", 0.1, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 501, 7, 70, 21 ), "Sine vol"); freqslid.action = { freqdisp.value = freqslid.value }; freqdisp.action = { freqslid.value = freqdisp.value }; mulslid.action = { muldisp.value = mulslid.value }; muldisp.action = { mulslid.value = muldisp.value }; addslid.action = { adddisp.value = addslid.value }; adddisp.action = { addslid.value = adddisp.value }; formslid.action = { formdisp.value = formslid.value }; formdisp.action = { formslid.value = formdisp.value }; sinfreq.action = { sindisp.value = sinfreq.value }; sindisp.action = { sinfreq.value = sindisp.value }; sinvol.action = { sinvold.value = sinvol.value }; sinvold.action = { sinvol.value = sinvold.value }; bw.action = { bwd.value = bw.value }; bwd.action = { bw.value = bwd.value }; Synth.play({ f=SinOsc.kr(freqslid.kr,0, mulslid.kr, addslid.kr); [Formant.ar(f, formslid.kr, f*bw.kr, 0.1), FSinOsc.ar(sinfreq.kr, sinvol.kr)]; }); w.close; ) ------------------------------ Date: Sun, 14 Feb 1999 21:07:35 -0600 From: James McCartney <---@---.---> Subject: Re: formant UG At 8:32 PM -0600 2/14/99, Mark Ballora wrote: >Curiosity as to the nature of the Formant UG: > >The patch below is a variant on the GUI Examples patch, with sliders added >to investigate all parameters, and an added FSinOsc for reference. > >Formant.help: >"Generates a set of harmonics around a formant frequency at a given >fundamental frequency." > >I can see that it's not simply a complex series of harmonics with spectral >shaping. I could get that with a Blip and a series of Resonz. > >I get tremolo-like results with extremely low "add" values (<< 20 or so). >Also, there's still a pulsing, even when the "freq" value is turned down >to 0. Is something akin to amplitude modulation going on between the >fundamental frequency and the formant frequency? Generating sidebands >around the formant frequency? It might be a little clearer if you renamed your sliders as follows. This reflects what is going on a little better: 'freq' -> 'vibrato rate' 'mul' -> 'vibrato depth' 'add' -> 'fundamental freq' The formant generator works by outputting a windowed sine pulse at the start of each period of the fundamental frequency. The frequency of the sine in the pulse is at the formant frequency. The duration of the pulse depends on the bandwidth. So it is like amplitude modulation, but the formant pulse's sine wave is hard synched to the fundamental period. Putting a scope on the formant output can help to show this. Also, even though FSinOsc lets you vary its frequency, it is better to use SinOsc when you are going to be changing the freq. FSinOsc's filter can blow up when modulated. [ Scope.window(nil,4000,nil,Formant.ar(f, formslid.kr, f*bw.kr, 0.1)), SinOsc.ar(sinfreq.kr, 0, sinvol.kr) ]; --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Sun, 14 Feb 1999 22:33:16 -0800 (PST) From: "Alex L. Potts" <---@---.---> Subject: internal chance operations I'm using DiskIn (without preloading files) as an audio source for a filter/panning instrument in an OrcScore. While scheduling different times for this instrument in the score (sometimes overlapping the same sound file and sometimes not), I've found that it will sometimes 'miss' a scheduled time event and sometimes not, depending on, apparently, it's own internal chance operations. In case I'm not being clear: while using sound files in an OrcScore instrument, the score is not dependable because it sometimes plays the scheduled event, and sometimes not on different runs of the same code. Is there any way to insure a more regular behavior for performance purposes? thanks, alex ------------------------------ Date: Mon, 15 Feb 1999 00:48:19 -0600 From: James McCartney <---@---.---> Subject: Re: internal chance operations At 12:33 AM -0600 2/15/99, Alex L. Potts wrote: > I'm using DiskIn (without preloading files) as an audio source for a >filter/panning instrument in an OrcScore. While scheduling different times >for this instrument in the score (sometimes overlapping the same sound >file and sometimes not), I've found that it will sometimes 'miss' a >scheduled time event and sometimes not, depending on, apparently, it's own >internal chance operations. In case I'm not being clear: while using sound >files in an OrcScore instrument, the score is not dependable because it >sometimes plays the scheduled event, and sometimes not on different runs >of the same code. > Is there any way to insure a more regular behavior for performance >purposes? > Can you show me your code? If you do not preload the sound, then it's latency is indeterminate. If you are putting an envelope over that sound, then it may complete before the sound is loaded. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 15 Feb 1999 10:25:45 +0100 From: "Iannis Zannos" <---@---.---> Subject: Decay2 decay cannot be a ControlIn instance When a ControlIn is used as input for the decayTime argument of Decay2, then it seems like the mul input is ( // Not using controller for decay SoundModel.scope({ arg amp = 0.3, spluckattack = #[0.01, 0.0, 1.0, 0.001], // spluckdecay = #[0.1, 0.001, 2.0, 0.001], spulse = #[2.0, 0.01, 10], freq_filter = #[4000, 20, 20000]; Decay2.ar(Impulse.ar(spulse, 1), spluckattack, 0.1, LPF.ar(WhiteNoise.ar(amp), freq_filter)) }, dur: 0.5); ) // controlling the pluckdecay by slider obliterates the noise. ( SoundModel.scope({ arg amp = #[0.3, 0, 1.0], spluckattack = #[0.01, 0.001, 1.0, 0.001], // cannot be used because it obliterates then noise!? spluckdecay = #[0.1, 0.001, 2.0, 0.001], spulse = #[2.0, 0.01, 10]; Decay2.ar(Impulse.ar(spulse, amp), spluckattack, spluckdecay, LPF.ar(WhiteNoise.ar(0.3), 4000)) }, dur: 0.5); ) Is this behavior foreseen in the implementation of Decay2? Iannis Zannos SIM Tiergartenstr. 1, D-10785 Berlin, Germany Fax: +49 30 25481172 ------------------------------ Date: Mon, 15 Feb 1999 12:35:21 +0100 From: "Iannis Zannos" <---@---.---> Subject: Re: Decay2 decay cannot be a ControlIn instance Sorry for incomplete message, here is the completion: When a ControlIn is used as input for the decayTime argument of Decay2, then it seems like the mul input is obliterated. ^^^^^^^^^^^^^^ Which means that the noise component below will not be audible when using a slider to control decayTime. Is this expected behavior for Decay2? Iannis Zannos SIM Tiergartenstr. 1, D-10785 Berlin, Germany Fax: +49 30 25481172 - ---------- >From: "Iannis Zannos" <---@---.---> >To: SC Mailing List >Subject: Decay2 decay cannot be a ControlIn instance >Date: Mon, 15 Feb 1999 10:25 AM > > > >When a ControlIn is used as input for the decayTime >argument of Decay2, then it seems like the mul input >is > >( // Not using controller for decay >SoundModel.scope({ arg amp = 0.3, > spluckattack = #[0.01, 0.0, 1.0, 0.001], > // spluckdecay = #[0.1, 0.001, 2.0, 0.001], > spulse = #[2.0, 0.01, 10], > freq_filter = #[4000, 20, 20000]; > Decay2.ar(Impulse.ar(spulse, 1), spluckattack, 0.1, > LPF.ar(WhiteNoise.ar(amp), freq_filter)) > }, dur: 0.5); >) > >// controlling the pluckdecay by slider obliterates the noise. >( >SoundModel.scope({ arg amp = #[0.3, 0, 1.0], > spluckattack = #[0.01, 0.001, 1.0, 0.001], > // cannot be used because it obliterates then noise!? > spluckdecay = #[0.1, 0.001, 2.0, 0.001], > spulse = #[2.0, 0.01, 10]; > > Decay2.ar(Impulse.ar(spulse, amp), spluckattack, spluckdecay, > LPF.ar(WhiteNoise.ar(0.3), 4000)) > }, dur: 0.5); >) > >Is this behavior foreseen in the implementation of >Decay2? > >Iannis Zannos >SIM >Tiergartenstr. 1, >D-10785 Berlin, Germany >Fax: +49 30 25481172 > ------------------------------ Date: Mon, 15 Feb 1999 10:13:32 -0600 From: James McCartney <---@---.---> Subject: Re: Decay2 decay cannot be a ControlIn instance At 5:35 AM -0600 2/15/99, Iannis Zannos wrote: >Sorry for incomplete message, here is the completion: > >When a ControlIn is used as input for the decayTime >argument of Decay2, then it seems like the mul input >is obliterated. >^^^^^^^^^^^^^^ Can you demonstrate this without using GUIUtils ? I don't see a problem with the following: ( { Scope.window(nil, 4410, nil, Decay2.ar(Impulse.ar(4, 0.3), MouseX.kr(0.001, 1), MouseY.kr(0.001, 2), LPF.ar(WhiteNoise.ar(0.3), 4000))); }.play; ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Mon, 15 Feb 1999 18:53:54 +0100 From: "Iannis Zannos" <---@---.---> Subject: Re: Decay2 decay cannot be a ControlIn instance There is something wrong with the way GUIUtils handles these arguments, which I could not locate. Anyway, the example works now as expected, both with your code and with GUIUtils as listed below. Thanks. Iannis Zannos SIM Tiergartenstr. 1, D-10785 Berlin, Germany Fax: +49 30 25481172 Working example: ( SoundModel.scope({ arg amp = 0.3, spluckattack = #[0.01, 0.0, 1.0, 0.001], spluckdecay = #[0.1, 0.001, 2.0, 0.001], spulse = #[2.0, 0.01, 10], freq_filter = #[4000, 20, 20000]; Decay2.ar(Impulse.ar(spulse, amp), spluckattack, spluckdecay, LPF.ar(WhiteNoise.ar(amp), freq_filter)) }, dur: 0.5); ) - ---------- >From: James McCartney <---@---.---> >To: sc-users@lists.io.com >Subject: Re: Decay2 decay cannot be a ControlIn instance >Date: Mon, 15 Feb 1999 5:13 PM > >At 5:35 AM -0600 2/15/99, Iannis Zannos wrote: >>Sorry for incomplete message, here is the completion: >> >>When a ControlIn is used as input for the decayTime >>argument of Decay2, then it seems like the mul input >>is obliterated. >>^^^^^^^^^^^^^^ > > >Can you demonstrate this without using GUIUtils ? >I don't see a problem with the following: > >( >{ >Scope.window(nil, 4410, nil, > Decay2.ar(Impulse.ar(4, 0.3), > MouseX.kr(0.001, 1), > MouseY.kr(0.001, 2), > LPF.ar(WhiteNoise.ar(0.3), 4000))); >}.play; >) > > > --- james mccartney james@audiosynth.com http://www.audiosynth.com >If you have a PowerMac check out SuperCollider2, a real time synth program: > > > > > ------------------------------ Date: Mon, 15 Feb 1999 12:16:31 -0800 (PST) From: "Alex L. Potts" <---@---.---> Subject: Re: internal chance operations james, here's the code with much of the orchestration removed, although even the second scored event sometimes is played and sometimes not. ( var file1, file2, file3, file4, file5, file6, file7; file1 = SoundFile.new; file2 = SoundFile.new; file3 = SoundFile.new; file4 = SoundFile.new; file5 = SoundFile.new; file6 = SoundFile.new; file7 = SoundFile.new; file1.readHeader(":Sounds:MONO:1f8.34"); file2.readHeader(":Sounds:MONO:2f12.5"); file3.readHeader(":Sounds:MONO:2f12.8"); file4.readHeader(":Sounds:MONO:2f15.3"); file5.readHeader(":Sounds:MONO:2f18.8"); file6.readHeader(":Sounds:MONO:2f25.057"); file7.readHeader(":Sounds:MONO:4f17.156"); { OrcScore.ar( IdentityDictionary[ 'arc' -> { arg spawn, i, synth, deltaTime, instrumentNum, sf, x1, y1, x2, y2, p, pratio, amp, tscale; var sfile, filelist, time, globenv, htime, freq, rq, mulA, mulB, pointA, pointB; sfile = {arg spit, synth, i, spawn; DiskIn.ar( spit, 0) }; filelist = [file1, file2, file3, file4, file5, file6, file7].at(sf); time = [8.34, 12.5, 12.8, 15.3, 18.8, 25.057,17.156].at(sf) ; globenv = Env.new([1, 1, 0], [time, 0.1], 'linear'); htime = time*0.5; freq = EnvGen.kr( Env.new( [[100, 15000, 100], [100, 40,100]].at(p), [htime, htime], 'exponential'), 1, 0, 1, 0, tscale); rq = EnvGen.kr(Env.new([0.5, 0.95, 0.5], [htime, htime], 'linear'), 1, 0, 1, 0, tscale); // mulA = EnvGen.ar( Env.new([1, 0], [time], -3), 1, 0, amp, 0, tscale); mulB = EnvGen.ar( Env.new([0, 1], [time], 3), 1, 0, amp, 0, tscale); pointA = BPF.ar(sfile.value( filelist ), freq, rq, mulA); pointB = BPF.ar( sfile.value( filelist ), freq, rq, mulB); EnvGen.ar(globenv, (Pan4.ar( PitchShift.ar(pointA, 1, pratio, 0, 0.1) , x1, y1) + Pan4.ar( PitchShift.ar(pointB, 1, pratio, 0, 0.1),x2, y2))); } ], #[ // file lengths(8.34, 12.5, 12.8, 15.3,18.8, 25.06, 17.156) //dur, instr, sf#, x1,y1, x2, y2 over/under pratio amp,tscale [35, 'arc', 5, 1, -1, -1, -1, 0, 1, 7, 0.75], [6, 'arc', 1, 1, -0.9, -1, -0.9, 0, 0.75, 7, 1], [14, 'arc', 1, 1, -0.8, -1, -0.8, 0, 1, 7, 1], [6, 'arc', 2, -1, -0.7, 1, -0.7, 0, 1, 7, 1] ], 4) }.scope ) thanks, alex ------------------------------ Date: Mon, 15 Feb 1999 19:43:37 -0500 (EST) From: "Colby N. Leider" <---@---.---> Subject: multichannel output How does one write multichannel output to separate files? In the Synth class definition it looks like the record and write methods are only capable of writing to one file. I'd like the output of the Pan4 ugen to go to four mono files, for example. thanks, colby ------------------------------ Date: Tue, 16 Feb 1999 14:12:29 -0500 From: "crucial" <---@---.---> Subject: Re: patterns repost / Ref.value >At 1:15 PM -0600 2/11/99, crucial wrote: >>ImpulseSequencer >>once it is started, can't really be handed a new array, and the array cannot >>be altered. > >Not true! :-) This patch alters the sequence every 10 seconds : > > --- james mccartney Ah! So why doesn't this seem to work with Klanks ?: ( var settings; settings = `[Array.rand(12, 80.0, 400.0),nil,Array.rand(12,6,3)]; Synth.play({ arg synth; synth.repeat(5,5,{"doing it".postln; settings.value = [Array.rand(12, 80.0, 400.0),nil,Array.rand(12,6,3)] }); Klank.ar(settings, Decay.ar(Impulse.ar(4), 0.3, ClipNoise.ar(8))); }) ) >( >play({ arg synth; > var t, z; > > z = `[1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0]; > > // the following synth task gets called every 10 seconds. > synth.repeat( > 10, // begin task in 10 seconds > 10, // call every 10 seconds > // z is a Ref so get and set the value > // with the 'value' message > { z.value = z.value.scramble; } > ); > > t = LFPulse.ar(8); // use a pulse wave as a trigger > Decay2.ar( // clave rhythm > ImpulseSequencer.ar(z, t), > 0.001, 0.3, FSinOsc.ar(1700, 0.1)) > + > Decay2.ar( // bass drum > ImpulseSequencer.ar(`[1,0,0.2,0,0.2,0,0.2,0], t), > 0.001, 0.5, FSinOsc.ar(100, 0.2)); >})) > > > __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Tue, 16 Feb 1999 14:37:43 -0600 From: James McCartney <---@---.---> Subject: Re: patterns repost / Ref.value At 1:12 PM -0600 2/16/99, crucial wrote: >>At 1:15 PM -0600 2/11/99, crucial wrote: >>>ImpulseSequencer >>>once it is started, can't really be handed a new array, and the array cannot >>>be altered. >> >>Not true! :-) This patch alters the sequence every 10 seconds : >> > --- james mccartney > >Ah! So why doesn't this seem to work with Klanks ?: Because Klanks calculate all their values at the beginning. The reason a Klank is fast is because it cannot be modulated. If you want to modulate it, you need to use Resonz's instead. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Thu, 18 Feb 1999 11:25:09 -0600 From: James McCartney <---@---.---> Subject: Re: multichannel output At 6:43 PM -0600 2/15/99, Colby N. Leider wrote: >How does one write multichannel output to separate files? In the Synth >class definition it looks like the record and write methods are only >capable of writing to one file. I'd like the output of the Pan4 ugen to >go to four mono files, for example. > >thanks, >colby Synth.write only writes a multichannel file. If you add the following method to Synth.sc then you can record mono files. Each file gets a dot '.' and the channel number appended to the supplied path name. *recordMonoFiles { arg ugenGraphFunc, duration, pathName, headerFormat = 'AIFF', sampleFormat = '16 big endian signed'; var files, z, newsynth; files = List.new; newsynth = this.new({ arg synth; var ugenGraph; ugenGraph = ugenGraphFunc.value(synth).asArray; // ugenGraph is an array of UGens. // size of array is number of outputs ugenGraph.do({ arg channel, i; var file; file = SoundFile.new; file.headerFormat = headerFormat; file.sampleFormat = sampleFormat; file.numChannels = 1; if (file.writeHeader(pathName ++ "." ++ (i+1).asString), { file.prepareRecord; files.add(file); DiskOut.ar(file, 32768, [channel]) }); channel }); }); if (newsynth.notNil, { newsynth.play(duration); files.do({ arg file; file.endRecord; }); }); ^files } - ------ test: ( // record three channels of sound to disk Synth.recordMonoFiles( { SinOsc.ar([700,800,900], 0, 0.1) }, // ugen graph function 2, // make a 2 second file "sine", // path name 'AIFF', // header format '16 big endian signed' // sample format ) ) --- 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 #27 *****************************