From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #68 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, October 11 1999 Volume 01 : Number 068 ---------------------------------------------------------------------- Date: Wed, 6 Oct 1999 11:18:53 -0600 From: James McCartney <---@---.---> Subject: Re: Pseries At 10:02 AM -0600 10/6/99, David Cottle wrote: >Yes. And I think I get it now. If I had two Pfuncs that described completely >different sets of notes I would use to Pbinds, but if I had a Pseries that >had built into the code multiple possibilities such as > >Pseries({ midinote = 60 + 12.rand; etc. Umm 2 errors above. Pseries does not take a function as an argument. Pseries is simply an arithmetic series. Look at the class definition. You cannot refer directly to midinote within a function like Pfunc's. You would bind it to \midinote. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 06 Oct 1999 10:30:25 -0600 From: "David Cottle" <---@---.---> Subject: Kinderstuck II Hi, I've reworked the Kinderstuck, incorporated changes suggested by James. I've also expanded it to include retrograde (of the entire work), crab, and inverted crab versions. They are available at: http://www.byu.edu/music/personnel/cottled/cottledHome.html ------------------------------ Date: Wed, 6 Oct 1999 14:02:07 -0600 From: James McCartney <---@---.---> Subject: Re: Kinderstuck II At 10:30 AM -0600 10/6/99, David Cottle wrote: >Hi, > >I've reworked the Kinderstuck, incorporated changes suggested by James. > >I've also expanded it to include retrograde (of the entire work), crab, and >inverted crab versions. They are available at: Your envelope duration calculations are in error. Duration is expressed in two ways: beats and seconds. \sustain is the product of \legato and \dur and is in beats. A Synth's envelope release time, i.e. its sustain duration, is expressed in beats. A Synth's envelope segment times are expressed in seconds. Env.perc creates an envelope with segments instead of by using a release node. Therefore you should convert the duration to seconds before you plug it in. The reason that sustain is in beats and segments are in seconds is that instrument properties generally do not change with increase in tempo, but articulation does. Converting between beats and seconds is easy because tempo is in beats per second. Thus you just multiply by tempo to convert seconds to beats and divide by tempo to convert beats to seconds. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 06 Oct 1999 17:40:48 -0600 From: "David Cottle" <---@---.---> Subject: Re: Pseries Hi, > Pseries does not take a function as an argument. > Pseries is simply an arithmetic series. Look at the class definition. Sorry, I meant Prout. > You cannot refer directly to midinote within a function like > Pfunc's. You would bind it to \midinote. Right. I was using midinote as an example of a variable I might have declared. I should have said nextMidi = Prout({ myNextMidi = 60 + 12.rand; if(myNextMidi . . . etc. p = Pbind({ \midinote, nextMidi, etc Ppar([p, p]).play ------------------------------ Date: Wed, 6 Oct 1999 23:26:36 -0600 From: James McCartney <---@---.---> Subject: Re: Pseries At 5:40 PM -0600 10/6/99, David Cottle wrote: >Hi, > >> Pseries does not take a function as an argument. >> Pseries is simply an arithmetic series. Look at the class definition. > >Sorry, I meant Prout. Yes I figured these were just typos, but it is better for me to err on the side of anal hair splitting than leave things ambiguous and misunderstood.. ok --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 06 Oct 1999 22:57:48 -0600 From: "David Cottle" <---@---.---> Subject: Re: Pseries Hi, >>Sorry, I meant Prout. > > Yes I figured these were just typos, but it is better for me to err > on the side of anal hair splitting than leave things ambiguous > and misunderstood.. I agree. BTW, the computer composition class is going very well. It's the shortest learning curve I've ever had with new students. I've decided to do lectures from scratch. I realize your busy but any feedback would be welcome. www.byu.edu/music/labs/cac/cac410text.pdf ------------------------------ Date: Thu, 07 Oct 1999 12:04:59 -0600 From: "David Cottle" <---@---.---> Subject: Hi, This is a trivial note, and it may involve too much to change all references, but I can never remember which Stream document is which. I've renamed them on my hard drive: 1-Streams 2-Patterns 3-ListPatterns 4-Environment 5-protoEvent 6-Parallel Paterns I know this screws up cross references, but they are much easier for me to remember which is which this way. ------------------------------ Date: Thu, 7 Oct 1999 15:14:15 -0400 From: Mark Ballora <---@---.---> Subject: displaying a chaotic value I put together this little patch which iterates the Verhulst equation, x[t+1] = r*x[t]*(1.0-x[t]), mapping successive values to pitches. It's similar to an example posted here some time back, but done in Spawn so that I can post some specs as it iterates. It works fine until I try to display the current output from the equation. Then it gives me an error. The line in question is commented out. ( var r, currentVal, lastVal; var w; var startIt, stopIt, rateSlider, rateView, iterNum, rSlider, rView, valDisp; var totalCount, tempCount; w = GUIWindow.new("panel", Rect.newBy(128, 64, 378, 387)); StringView.new( w, Rect.newBy(19, 4, 213, 19), "Iterates the Verhulst equation:"); StringView.new( w, Rect.newBy(19, 26, 347, 10), "x[t+1] = R * x[t] * (1.0 - x[t])."); StringView.new( w, Rect.newBy(19, 39, 351, 13), "Values are mapped to pitch."); StringView.new( w, Rect.newBy(91, 114, 128, 20), "Number of Iterations"); valDisp=NumericalView.new( w, Rect.newBy(22, 144, 64, 20), "NumericalView", 0, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy(91, 144, 128, 20), "Current Value"); startIt=RadioButtonView.new( w, Rect.newBy(24, 56, 123, 23), "Start iteration", 0, 0, 1, 0, 'linear'); stopIt=RadioButtonView.new( w, Rect.newBy(24, 81, 123, 23), "Stop iteration", 0, 0, 1, 0, 'linear'); StringView.new( w, Rect.newBy(19, 190, 128, 20), "Iteration Rate"); rateSlider=SliderView.new( w, Rect.newBy(20, 213, 170, 18), "SliderView", 0.05, 0, 1, 0.001, 'linear'); rateView=NumericalView.new( w, Rect.newBy(197, 212, 64, 20), "NumericalView", 0.05, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy(19, 242, 128, 20), "Value of R"); rSlider=SliderView.new( w, Rect.newBy(20, 265, 170, 18), "SliderView", 3.687, 0, 4, 0, 'linear'); rView=NumericalView.new( w, Rect.newBy(197, 264, 64, 20), "NumericalView", 3.687, -1e+10, 1e+10, 0, 'linear'); iterNum=NumericalView.new( w, Rect.newBy(22, 114, 64, 20), "NumericalView", 0, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy(21, 288, 239, 20), "To set values of R:"); StringView.new( w, Rect.newBy(20, 306, 235, 20), " stop iteration,"); StringView.new( w, Rect.newBy(20, 325, 235, 20), " move the slider or type a value"); StringView.new( w, Rect.newBy(20, 344, 331, 20), " into the number box and hit ENTER."); rateSlider.action = { rateView.value = rateSlider.value }; rateView.action = { rateSlider.value = rateView.value }; rSlider.action = { rView.value = rSlider.value }; rView.action = { rSlider.value = rView.value }; stopIt.action = { totalCount.source = tempCount.source; }; Synth.play({ arg synth; tempCount = Plug.kr(0); totalCount=Plug.kr(0); lastVal=Plug.kr(0.5); r = Plug.kr(3.687); currentVal = Plug.kr(0.5); synth.repeat(0, 0.05, { if ((startIt.value == 0), { iterNum.value = 0 }) }); Pause.ar({ Spawn.ar({ arg spawn, i, synth; var dur, newIter; dur = rateSlider.poll; spawn.nextTime = dur; r = rSlider.poll; iterNum.value = (i+1)-totalCount.source; tempCount.source = i+1; newIter = r * lastVal * (1.0 - lastVal); // IF THIS LINE IS UNCOMMENTED, I GET AN ERROR: //valDisp.value = newIter; currentVal.source = newIter; lastVal.source = currentVal; PSinGrain.ar(220*(2**currentVal), dur, 0.5) }, 1, nil) }, startIt.kr); }); w.close ) ------------------------------ Date: Thu, 07 Oct 1999 13:23:13 -0600 From: "David Cottle" <---@---.---> Subject: Re: Kinderstuck II Hi, >>I've also expanded it to include retrograde (of the entire work), crab, and >>inverted crab versions. They are available at: > > Your envelope duration calculations are in error. > Duration is expressed in two ways: beats and seconds. I've read this several times and looked through the dur model document in the Streams documentation (5) and still just kind of understand. By beats do you mean beats per minute? Is the following correct? blipInst = { arg freq, amp, dur, tempo; var env1; env1 = Env.perc(0.001.rand, max(0.5, dur/tempo)); Blip.ar(freq, 3.rand + 2, mul: EnvGen.kr(env1) * amp); }; ------------------------------ Date: Thu, 7 Oct 1999 16:20:13 -0600 From: James McCartney <---@---.---> Subject: Re: Kinderstuck II At 1:23 PM -0600 10/7/99, David Cottle wrote: >Hi, > >>>I've also expanded it to include retrograde (of the entire work), crab, and >>>inverted crab versions. They are available at: >> >> Your envelope duration calculations are in error. >> Duration is expressed in two ways: beats and seconds. > >I've read this several times and looked through the dur model document in >the Streams documentation (5) and still just kind of understand. >By beats do >you mean beats per minute? No I mean beats. A beat is a beat. The number of beats per second is determined by the tempo, i.e. tempo is expressed in the units beats per second. SC never uses beats per minute. Envelope segment times are in seconds. Synth release times are in beats (that is, the time that a Synth releases its envelopes). >Is the following correct? > >blipInst = { arg freq, amp, dur, tempo; > var env1; > env1 = Env.perc(0.001.rand, max(0.5, dur/tempo)); > Blip.ar(freq, 3.rand + 2, mul: EnvGen.kr(env1) * amp); >}; That will work, but sustain/tempo is more accurate. dur is the time between notes in a melody, and sustain is how long they last. sustain is controlled by legato, so if you use sustain then you can use legato to control articulation. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Thu, 07 Oct 1999 15:42:29 -0600 From: "David Cottle" <---@---.---> Subject: Re: Kinderstuck II Hi, > That will work, but sustain/tempo is more accurate. ok ------------------------------ Date: Thu, 7 Oct 1999 16:50:53 -0600 From: James McCartney <---@---.---> Subject: Re: displaying a chaotic value At 1:14 PM -0600 10/7/99, Mark Ballora wrote: >I put together this little patch which iterates the Verhulst equation, >x[t+1] = r*x[t]*(1.0-x[t]), mapping successive values to pitches. > >It's similar to an example posted here some time back, but done in Spawn so >that I can post some specs as it iterates. > >It works fine until I try to display the current output from the equation. >Then it gives me an error. OK Today's lesson is: "How to read the error dump and solve your own errors." Here is the dump that your error generates: - --------------------- ERROR: Message 'clip' not understood. RECEIVER: Instance of BinaryOpUGen '*'{ (02C7F388, gc=00, fmt=00, flg=00, set=05) instance variables [5] synth : instance of Synth (02C793D8, size=0, set=06) inputs : instance of Array (02C7C408, size=2, set=01) rate : Symbol 'audio' state : Integer 0 operator : Symbol '*' } ARGS: Instance of Array { (02C7B5E8, gc=00, fmt=01, flg=00, set=01) indexed slots [2] 0 : Float -1e+10 C202A05F 20000000 1 : Float 1e+10 4202A05F 20000000 } CALL STACK: Object::doesNotUnderstand arg this = < arg selector = 'clip' arg args = [*2] ControlView::value_ arg this = < arg argValue = < ....etc.... - ----------------------- First SC tells you what the error is. The message 'clip' was sent to an object that did not understand it. Second it tells you what the receiver of the message was. The reciever of the clip message was an instance of BinaryOpUGen. Third it tells you the arguments of the message. The arguments are always in an array. Fourth it dumps the call stack. This tells you where you are in the code where the error occured. They are listed in reverse order so that the first one listed is the method in which execution halted and the next one is the one that called it, and the next is the one that called that one and so on. The first method listed is Object::doesNotUnderstand. This is just the error handler method for this error and is not usually interesting. The next one is ControlView::value_. You will notice that the arguments to ControlView::value_ are the NumericalView which is the receiver, and the argument for the value which is a BinaryOpUGen. NumericalViews display numbers. a BinaryOpUGen is not a number. Thus you cannot assign a unit generator as the value of a NumericalView. There's your problem, but don't go away yet. Why did the method fail? Let's have a look at it: value_ { arg argValue; argValue = argValue.clip(this.minval, this.maxval).round(this.step); this.setViewAttr(1, argValue.asFloat); } This method clips and rounds the value passed in before calling the setViewAttr method. Since neither BinaryOpUGen nor any of its superclasses define any method named 'clip', it barfs at this point. So now the question is how to get a number from a BinaryOpUGen.... --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Thu, 7 Oct 1999 17:02:52 -0600 From: James McCartney <---@---.---> Subject: Re: displaying a chaotic value >So now the question is how to get a number from a BinaryOpUGen.... Actually a better question is why is newIter a ugen. It shouldn't be. You made everything into Plugs. They shouldn't be. Just use variables. Plugs are only used where you want to generate signals. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Thu, 7 Oct 1999 18:30:09 -0400 From: Mark Ballora <---@---.---> Subject: Re: displaying a chaotic value >>So now the question is how to get a number from a BinaryOpUGen.... > >Actually a better question is why is newIter a ugen. It shouldn't be. >You made everything into Plugs. They shouldn't be. >Just use variables. >Plugs are only used where you want to generate signals. > > ...and the problem has to do with multiplying Plugs. Valuable lesson in how to fish today. Many thanks. Mark ------------------------------ Date: Fri, 8 Oct 1999 14:30:54 -0700 (PDT) From: Chris Brown <---@---.---> Subject: Re: loop wrap On Wed, 6 Oct 1999, James McCartney wrote: > > No. Samples are linear not cyclic. When you play a sample > it runs from the start offset to the loopend and then returns > to the loopstart. If the loopstart is greater than the loopend > then they are swapped. > Is loopstart computed in relation to start offset ? I was trying to make PlayBuf start playing at loopstart by setting start offset to the same sample, but got confusing results. Also found that a looping sample would be audibly disturbed by changing start offset while the sample looped. Why? Chris Brown ------------------------------ Date: Fri, 8 Oct 1999 16:54:48 -0600 From: James McCartney <---@---.---> Subject: Re: loop wrap At 3:30 PM -0600 10/8/99, Chris Brown wrote: >On Wed, 6 Oct 1999, James McCartney wrote: >> >> No. Samples are linear not cyclic. When you play a sample >> it runs from the start offset to the loopend and then returns >> to the loopstart. If the loopstart is greater than the loopend >> then they are swapped. >> > >Is loopstart computed in relation to start offset ? I was trying to make >PlayBuf start playing at loopstart by setting start offset to the same >sample, but got confusing results. Also found that a looping sample would >be audibly disturbed by changing start offset while the sample looped. >Why? It is not just a start offset, it is a modulateable offset. If you leave it alone then you can think of it as a starting offset. However it is actually continuously variable. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 8 Oct 1999 16:49:33 -0700 (PDT) From: Chris Brown <---@---.---> Subject: Re: loop wrap so..., is it possible to use start offset to begin playback at the same point as loopstart? essentially i would like to make them be modulated by the same plug. cb On Fri, 8 Oct 1999, James McCartney wrote: > At 3:30 PM -0600 10/8/99, Chris Brown wrote: > >On Wed, 6 Oct 1999, James McCartney wrote: > >> > >> No. Samples are linear not cyclic. When you play a sample > >> it runs from the start offset to the loopend and then returns > >> to the loopstart. If the loopstart is greater than the loopend > >> then they are swapped. > >> > > > >Is loopstart computed in relation to start offset ? I was trying to make > >PlayBuf start playing at loopstart by setting start offset to the same > >sample, but got confusing results. Also found that a looping sample would > >be audibly disturbed by changing start offset while the sample looped. > >Why? > > It is not just a start offset, it is a modulateable offset. > If you leave it alone then you can think of it as a starting offset. > However it is actually continuously variable. > > > --- james mccartney james@audiosynth.com http://www.audiosynth.com > If you have a PowerMac check out SuperCollider2, a real time synth program: > > > > > > **************************************************** Chris Brown Composer, Pianist, Electronic Musician Assoc. Prof. of Music and Co-Director, Center for Contemporary Music (CCM) Mills College, Oakland, CA 94613 email: cbmus@mills.edu, phone: 510-430-2330; fax 510-430-3314 **************************************************** ------------------------------ Date: Fri, 8 Oct 1999 19:37:31 -0600 From: James McCartney <---@---.---> Subject: Re: loop wrap At 5:49 PM -0600 10/8/99, Chris Brown wrote: >so..., is it possible to use start offset to begin playback at the same >point as loopstart? essentially i would like to make them be modulated by >the same plug. Well if you use offset as a start point then it makes no sense to modulate it, because you only start a sample once. My second question is, even though you can, why modulate a loop point? You will get clicks, unless you only use precise locations of zero crossings. With SC you can easily spawn new PlayBufs for each iteration of the loop and cross fade them. I find that much preferrable. You then have complete control of the loop end points and cross fade times guaranteed without clicks. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sat, 9 Oct 1999 13:32:47 +0100 From: finer@easynet.co.uk Subject: elementary (mug or bug) question I cannot understand why I can't say this : p = 2 ** 3; l = List.fill(p,0) This gives me : [0] while p.post gives 8 Whereas p = 2 * 3; l = List.fill(p,0) behaves giving [0,0,0,0,0,0,0,0]. Sorry but I'm stumped ! Thanks Jem ------------------------------ Date: Sat, 9 Oct 1999 08:57:39 -0600 From: James McCartney <---@---.---> Subject: Re: elementary (mug or bug) question At 6:32 AM -0600 10/9/99, finer@easynet.co.uk wrote: >I cannot understand why I can't say this : > >p = 2 ** 3; >l = List.fill(p,0) > >This gives me : > >[0] > >while p.post gives 8 The problem is that 2 ** 3 returns a Float value 8, not an Integer. Collection::*fill is defined as: *fill { arg size, function; var obj; obj = this.new(size); size.do({ arg i; obj.add(function.value(i)); }); ^obj } When it does size.do it only happens once because 'do' doesn't iterate over Floats like it does for Integers. Float inherits the 'do' method of Object which just calls the function once for itself. It is a bit confusing I agree. Perhaps Floats should iterate to a rounded integer version of themselves.. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Sat, 9 Oct 1999 12:08:37 -0700 (PDT) From: Chris Brown <---@---.---> Subject: Re: loop wrap On Fri, 8 Oct 1999, James McCartney wrote: > > My second question is, even though you can, why modulate a loop point? > You will get clicks, unless you only use precise locations of zero crossings. > With SC you can easily spawn new PlayBufs for each iteration of > the loop and cross fade them. I find that much preferrable. > You then have complete control of the loop end points and cross fade > times guaranteed without clicks. > Sounds like a good idea, but I'm not sure how to apply it with my app. I'm modeling a sampler, like a prepared piano where each key plays a different sample. Once a sample is started (and I'd like to start it from adjustably different places in the file) I want to adjust loop points as it plays. Here's the base-code I'm using, could you suggest how I could fix it to implement spawns ? I've so far been living with the clicks but would like not to have to ! ( var filelist, soundlist, filename, sound, signal,sampleInstr; filelist = [ // LONG LIST OF SHORT SAMPLE FILES ":Sounds:floating_1" ]; soundlist = List[]; filelist.do({ arg item, i; filename = item; soundlist.add(SoundFile.new); if (soundlist.at(i).read(filename), { // (filename ++ " loaded.\n").post; },{ (filename ++ " not found.\n").post }); }); sampleInstr = { arg thisNote = 1.0, thisVel=1.0; var thisBend=1.0, loopStart=0, loopEnd=1024; signal = sound.data.at(0); // MIDI control fields = ( chan, min, max, warp, smoothinglag ) thisBend = MIDIPitchBend.kr(1, 0.5, 2.0, 'linear', 0.1); loopStart = MIDIController.kr(1,16, 0, signal.size-2, 'linear',0.1); loopEnd = MIDIController.kr(1,17, 1024, signal.size-2, 'linear',0.1); //PlayBuf.at(signal, sigSampleRate, playbackRate, //offset, loopstart, loopend) PlayBuf.ar(signal, sound.sampleRate, thisNote*thisBend, 0, loopStart, loopEnd, thisVel ,0); }; e = Env.new([0, 0.1, 0.1, 0], [0.05, 0.1, 0.05], 'linear', 2); Synth.play({ v = Voicer.ar({ arg voicer, i, synth, deltaTime, channel, note, velocity; var soundSel = 0; soundSel = { ((note - 48) * 0.083).asInteger.clip(0,3) }; sound = soundlist.at(soundSel.value); EnvGen.ar(e, sampleInstr.value(((note % 12) * 0.16), (velocity * 0.0078))); }, 1, // one audio output channel 1, // listen to MIDI channel 1 8 // max voices. If too many voices are triggered, then voice stealing occurs. ); Pan2.ar(v, FSinOsc.kr(MIDIController.kr(1,10, 0.01, 40.0, 'exponential',0.1))); }) ) > > --- james mccartney james@audiosynth.com http://www.audiosynth.com > If you have a PowerMac check out SuperCollider2, a real time synth program: > > > > > > **************************************************** Chris Brown Composer, Pianist, Electronic Musician Assoc. Prof. of Music and Co-Director, Center for Contemporary Music (CCM) Mills College, Oakland, CA 94613 email: cbmus@mills.edu, phone: 510-430-2330; fax 510-430-3314 **************************************************** ------------------------------ Date: Sat, 09 Oct 1999 13:20:40 -0700 From: Mark Polishook <---@---.---> Subject: Re: loop wrap > With SC you can easily spawn new PlayBufs for each iteration of > the loop and cross fade them. I find that much preferrable. ... could you post a short example. thanks :) - -mp ------------------------------ Date: Sat, 9 Oct 1999 23:58:56 -0600 From: James McCartney <---@---.---> Subject: Re: loop wrap At 2:20 PM -0600 10/9/99, Mark Polishook wrote: >... could you post a short example. Chris, you should be able to replace your sampleInstr function with something like this too. ( // granular sample looping // uses grains to make crossfaded sample loops on the fly. var filename, sound, signal; filename = ":Sounds:floating_1"; sound = SoundFile.new; if (sound.read(filename), { signal = sound.data.at(0); Synth.scope({ var looplen, xfadelen = 0.02, mx, my; // mouse x controls offset into sample of loop mx = MouseX.new; // mouse y controls loop length my = MouseY.new(0.01, 0.8, \exponential); // spawn a grain for each iteration of the loop Spawn.ar({ arg spawn; var offset, env; offset = mx.value * signal.size; // calculate start offset looplen = my.value; // get loop length spawn.nextTime = looplen; // schedule next grain // create an envelope for this grain env = Env.linen(xfadelen, looplen, xfadelen, 0.5, \welch); // a PlayBuf with an envelope PlayBuf.ar(signal, sound.sampleRate, 1, offset, 0, signal.size-2, EnvGen.ar(env)) }, 1, 1); }, 0.4); },{ (filename ++ " not found.\n").post }); ) While doing this I discovered a bug in PlayBuf that can produce clicks. It is now fixed. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Sun, 10 Oct 1999 13:10:24 -0600 From: James McCartney <---@---.---> Subject: version 2.2.2 available === Version 2.2.2 is now available via ftp: BinHex : ftp://www.audiosynth.com/pub/updates/SC2.2.2.sea.hqx MacBinary (smaller) : ftp://www.audiosynth.com/pub/updates/SC2.2.2.sea.bin SCPlay is now distributed in a separate file : BinHex : ftp://www.audiosynth.com/pub/updates/SCPlay2.2.2.sea.hqx MacBinary (smaller) : ftp://www.audiosynth.com/pub/updates/SCPlay2.2.2.sea.bin === Changes in Version 2.2.2 The Pitch ugen was added. It is an autocorrelation pitch estimator which does a pretty good job. (see "pitch follow me" example file. fun?) Tasks were added. A Task is a thread that is scheduled by a Synth. While in a Task you can call the 'wait' method to pause execution for some number of beats. See Task.help. You can now perform some OS level operations like reading and writing files while playing by using Tasks. Spectral rate unit generators were added. This allows FFT, IFFT and other operations to operate without incurring a build up of latency due to streaming the spectra between UGens. Instead the spectra are passed along as large blocks. Unary and binary operator ugens all now have spectral rate versions as well. A2S and S2A ugens for converting between audio rate and spectral rate were added. A spectral rate BinShift ugen was added for shifting and stretching spectra. The Median filter UGen now has a length argument allowing lengths up to 31 samples instead of just 3. This is an incompatible change, current users of Median will need to update their code. A PinkerNoise ugen was added that gives 16 octaves of noise instead of the 8 octaves that PinkNoise gives, and has an improved top octave response. The binary operator 'thresh' was added which returns zero if a value is below a threshold, otherwise it returns the value. Float::do and Float::reverseDo are now implemented to be similar to Integer::do and reverseDo. MultiTap and PlayBuf had a bug that caused a click. PanB had a bug in the X output. Some of the filters were sped up slightly. A bug with oscillator phase offsets was fixed. TSpawn::triggerSynth had a bug that occured in unusual circumstances. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sun, 10 Oct 1999 13:38:16 -0600 From: James McCartney <---@---.---> Subject: Re: version 2.2.2 available If you use virtual memory (which you shouldn't really) you may want to hold off on this release. It seems to crash with VM on. I'll fix it as soon as I find it. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sun, 10 Oct 1999 15:19:07 -0400 From: Mark Ballora <---@---.---> Subject: Re: version 2.2.2 available Is SCPlay2.2.2 any different than 2.2.1? >=== > >Version 2.2.2 is now available via ftp: > >BinHex : >ftp://www.audiosynth.com/pub/updates/SC2.2.2.sea.hqx > >MacBinary (smaller) : >ftp://www.audiosynth.com/pub/updates/SC2.2.2.sea.bin > > >SCPlay is now distributed in a separate file : > >BinHex : >ftp://www.audiosynth.com/pub/updates/SCPlay2.2.2.sea.hqx > >MacBinary (smaller) : >ftp://www.audiosynth.com/pub/updates/SCPlay2.2.2.sea.bin > > ------------------------------ Date: Sun, 10 Oct 1999 15:42:30 -0600 From: James McCartney <---@---.---> Subject: Re: version 2.2.2 available At 1:19 PM -0600 10/10/99, Mark Ballora wrote: >Is SCPlay2.2.2 any different than 2.2.1? > Yes. SCPlay2.2.2 incorporates all the same changes. If for example you use the Pitch ugen, SCPlay2.2.1 cannot play it. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sun, 10 Oct 1999 17:12:27 -0600 From: James McCartney <---@---.---> Subject: [BOUNCE] Impulse1/poll-Pfx > >Date: Sun, 10 Oct 1999 19:06:28 +0200 >From: julian rohrhuber <<---@---.---> > >>It needs an envelope. >>Why are you spawning impulses ? > > >thanks for the Impulse1-hint, I think StepClock/HPZ1 does most of what I >wanted, apart from limiting the number of impulses created (which is not >so hard to solve of course :). > >trying out Pfx I seem to have misunderstood some basics resulting in an >error 11 system crash: > > > >( >var filter, pat; > >filter = { arg in, freq = 200; > //something seems to be wrong with polling > LPF.ar( > Sequencer.ar({ in.poll }, Impulse.ar(freq)), > freq, 0.8); > }; in is an Array of two channels. You can't poll an array. > > >pat = Pbind( > \dur, 0.8, > \legato, Prand(#[0.05, 0.1, 0.4], inf), > \freq, Pfunc({ MouseX.kr(100,10000,'exponential')}) > ); > >Pbindf(\pan, Prand(#[-0.3, 0, 0.3],inf), > > Pfx(pat, filter) //how to adress the second argument of the filter? > ).play; > >) The argument to the effect can be got from the environment. You need to set a value for it in an enclosing pattern. Since it is really the Sequencer frequency you probably don't want to call it the same thing as \freq which is the note's frequency. I changed it to filterRate in the example below. Because of a bug in TSpawn.triggerSynth you'll need to use version 2.2.2. ( var filter, pat; filter = { arg in, filterRate = 200; LPF.ar( // use multichannel expansion to handle input. // create an array of Functions, each which polls a // separate input Sequencer.ar( in.collect({ arg input; { input.poll } }), Impulse.ar(filterRate) ), filterRate, 0.8); }; pat = Pbind( \dur, 0.8, \legato, Prand(#[0.05, 0.1, 0.4], inf), \freq, Pfunc({ MouseX.kr(100,10000,'exponential')}) ); Pbindf( \pan, Prand(#[-0.3, 0, 0.3],inf), \filterRate, 200, Pfx(pat, filter) ).play; ) ------------------------------ Date: Mon, 11 Oct 1999 10:20:25 +1000 From: Graeme Gerrard <---@---.---> Subject: G4 Altivec and SC Can SC take advantage of Altivec in the new G4s? Is this being planned for a future release? - -- Graeme Gerrard Resonant Multimedia ------------------------------ Date: Sun, 10 Oct 1999 20:23:19 -0600 From: James McCartney <---@---.---> Subject: Re: G4 Altivec and SC At 6:20 PM -0600 10/10/99, Graeme Gerrard wrote: >Can SC take advantage of Altivec in the new G4s? Not yet, though I've already written some Altivec code for it. Not all algorithms can benefit. Single IIR filters cannot be sped up, however banks of them as in Klank can be. All mul and add inputs will benefit, as will many of the binary and unary operators. Oscillators may be able to be sped up some, but Altivec cannot do parallel table lookups. Of course the language virtual machine will not benefit at all. So it remains to be seen what the overall speed up will be. >Is this being planned for a future release? Yes. My G4 arrives next week. But I will soon go to ICMC and may not get an Altivec version out before I go. Altivec support will increase over time as I convert more ugens. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 11 Oct 1999 14:50:54 +0200 From: andreas pieper <---@---.---> Subject: task example hi, the second Task example gives me an error (in the file read loop, writing the file does work). Any thoughts? best, a ( Synth.play({ Task({ var f, g; // write a File f = File("test", "w"); f.write("This is a test..."); f.close; 1.wait; loop({ // read from a File g = File("test", "r"); g.readAllString.postln; g.close; 1.wait; }); }); PinkNoise.ar(0.2); }); ) ERROR: Message 'acquire' not understood. RECEIVER: nil ARGS: Instance of Array { (0BD336A8, gc=80, fmt=01, flg=81, set=00) } CALL STACK: Object::doesNotUnderstand arg this = nil arg selector = 'acquire' arg args = [*0] Process::toolboxAcquire arg this = File::prFileRequestSync arg this = arg selector = 'length' arg optionalData = nil var result = nil File::length arg this = File::readAllString arg this = < FunctionDef in Method Interpreter::functionCompileContext > var f = var g = Task::prStart arg this = arg inval = nil € ERROR: return from Function at top of call stack. andreas pieper mego@url.de pgp fingerprint A7B1 721D 65E6 1A2D BA28 4112 28B2 C3B8 ------------------------------ Date: Mon, 11 Oct 1999 09:13:49 -0600 From: James McCartney <---@---.---> Subject: Re: task example At 6:50 AM -0600 10/11/99, andreas pieper wrote: >hi, > >the second Task example gives me an error (in the file read loop, writing >the file does work). Any thoughts? >ERROR: >Message 'acquire' not understood. > >RECEIVER: > nil >ARGS: >Instance of Array { (0BD336A8, gc=80, fmt=01, flg=81, set=00) >} >CALL STACK: > Object::doesNotUnderstand > arg this = nil > arg selector = 'acquire' > arg args = [*0] > Process::toolboxAcquire > arg this = < It looks like your toolboxSem semaphore is nil. This is an instance variable in Process. Have you replaced the default Main class with your own? Main::startUp must now call super.startUp in order for the tookbox semaphore to get allocated. The default method in Main should look like this: startUp { super.startUp; false.trace; currentEnvironment = Environment.new; this.initLib; ParamSpec.default; } And in Process should look like this: startUp { // This method is called automatically right after compiling. // Override in class 'Main' to do initialization stuff, // but make sure to call this superclass method. toolboxSem = Semaphore.new(0); } --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Mon, 11 Oct 1999 16:20:14 +0100 From: finer@easynet.co.uk Subject: authorisation fracas Hello, Who's been a silly boy then ? uuhh, well me I'm afraid. During a trip forward in time to october of 2000 (by way of adjusting the menu bar clock while enjoying the wonders of "Date") I found on returning to the present that SuperCollider had decided to shut me out. Despite all manner of attempts to trash authorisation prefs, resetting the clock, trying my current authorisation code . . . . and so on . . . I am left with the only remaining thing I can think of . . . ask James how to get out of this sticky situation. I am now sticking to 1999, my old code seems not to work - what's the best way to proceed ? Thank you, Jem ------------------------------ Date: Mon, 11 Oct 1999 10:44:05 +0000 From: Colby Leider <---@---.---> Subject: FFT in new release The new release looks great! Thanks for all the new features. With that having been said, the magnitude thresholding FFT example doesn't seem to work. I have a bunch of code that does binary operations like this on spectra, and it works when I don't use spectral rate operations, only if I keep everything at the audio rate. Am I missing something? Thanks, Colby ------------------------------ Date: Mon, 11 Oct 1999 10:40:57 -0600 From: James McCartney <---@---.---> Subject: Re: authorisation fracas At 9:20 AM -0600 10/11/99, finer@easynet.co.uk wrote: >Hello, > >Who's been a silly boy then ? > >uuhh, well me I'm afraid. > >During a trip forward in time to october of 2000 (by way of adjusting the >menu bar clock while enjoying the wonders of "Date") I found on returning >to the present that SuperCollider had decided to shut me out. > >Despite all manner of attempts to trash authorisation prefs, resetting the >clock, trying my current authorisation code . . . . and so on . . . I am >left with the only remaining thing I can think of . . . >ask James how to get out of this sticky situation. > >I am now sticking to 1999, my old code seems not to work - what's the best >way to proceed ? > If you go to the future you will time out your serial number. I will send you a new one. --- 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 #68 *****************************