From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #35 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 Sunday, April 11 1999 Volume 01 : Number 035 ---------------------------------------------------------------------- Date: Mon, 05 Apr 1999 15:31:51 +0200 From: Staffan Liljegren <---@---.---> Subject: Patterns example in Sc2.1.1 I tried to run the parallel patterns example in the Examples/Patterns file and it gave me : • ERROR: input 1 to Mix is not a UGen or double. • ERROR: internal error: Synth ended already. (sometimes it plays the first 3 -4 events before returning the same error message) - -Staffan ------------------------------ Date: Mon, 5 Apr 1999 10:03:19 -0500 From: rkuivila@mail.wesleyan.edu Subject: Re:version 2.1.1 question >Hello James, > > > >Version 2.1.1 is very good also with the support >for the different cards. > >But when I run the "granulate-input" patch, sometimes >I get this: > > Integer 0 >ERROR: >Primitive 'none' failed. > >Wrong type. >RECEIVER: > nil A similar error happens when you try to run demos from the Lib menu. RJK ------------------------------ Date: Mon, 5 Apr 1999 17:22:29 -0600 From: James McCartney <---@---.---> Subject: Re:version 2.1.1 question At 6:49 PM -0600 4/4/99, Arie van Schutterhoef wrote: >Hello James, > > > >Version 2.1.1 is very good also with the support >for the different cards. > >But when I run the "granulate-input" patch, sometimes >I get this: > > Integer 0 >ERROR: This example assumes that a window stored into interpreter variable 'w' is its window. This problem only happens if you run another example that stores a different window into variable 'w' first. The example can be sort of fixed by the following. This still will mess up if you store a different window named "Granulate" into interpreter variable 'w'. if ( not( w.isKindOf(GUIWindow) ) or: { w.name.postln != "Granulate" }, { w = GUIWindow.new("Granulate", Rect.new( 128, 64, 528, 264 )); --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Mon, 5 Apr 1999 17:26:05 -0600 From: James McCartney <---@---.---> Subject: Re: Patterns example in Sc2.1.1 At 7:31 AM -0600 4/5/99, Staffan Liljegren wrote: >I tried to run the parallel patterns example in the Examples/Patterns file and it >gave me : > >• ERROR: input 1 to Mix is not a UGen or double. >• ERROR: internal error: Synth ended already. > >(sometimes it plays the first 3 -4 events before returning the same error message) > >-Staffan This can be fixed by removing the 'asStream' method in class Ref. I mucked with it and should have left it alone. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 5 Apr 1999 17:28:39 -0600 From: James McCartney <---@---.---> Subject: Re:version 2.1.1 question At 9:03 AM -0600 4/5/99, rkuivila@mail.wesleyan.edu wrote: > >A similar error happens when you try to run demos from the Lib menu. They are completely different problems. The lib menu problem is a bug in my bugfix: "A bug where mousing a slider at the moment when synthesis ended caused a crash, was fixed." I will release a version 2.1.2 to fix this. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Tue, 6 Apr 1999 00:55:39 +0100 From: Arie van Schutterhoef <---@---.---> Subject: Re:version 2.1.1 question >This example assumes that a window stored into interpreter variable >'w' is its window. This problem only happens if you run another example >that stores a different window into variable 'w' first. The example >can be sort of fixed by the following. This still will mess up if >you store a different window named "Granulate" into interpreter variable >'w'. > > >if ( not( w.isKindOf(GUIWindow) ) or: { w.name.postln != "Granulate" }, { > w = GUIWindow.new("Granulate", Rect.new( 128, 64, 528, 264 )); Dear James, Thanks for your response Does this mean that if I name it as another variable, for instance variable v, than I won't have this problem. A kind of mistaken identity, so to say? Arie van Schutterhoef <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 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: Mon, 5 Apr 1999 19:07:34 -0600 From: James McCartney <---@---.---> Subject: Re:version 2.1.1 question At 5:55 PM -0600 4/5/99, Arie van Schutterhoef wrote: >>This example assumes that a window stored into interpreter variable >>'w' is its window. This problem only happens if you run another example >>that stores a different window into variable 'w' first. The example >>can be sort of fixed by the following. This still will mess up if >>you store a different window named "Granulate" into interpreter variable >>'w'. >> >> >>if ( not( w.isKindOf(GUIWindow) ) or: { w.name.postln != "Granulate" }, { >> w = GUIWindow.new("Granulate", Rect.new( 128, 64, 528, 264 )); > >Dear James, > >Thanks for your response > >Does this mean that if I name it as another variable, for instance >variable v, than I won't have this problem. A kind of mistaken >identity, so to say? I used an interpreter variable because they persist between executions and I wanted not to create a new window each time so that the settings would persist. There are a number of better solutions, but for the sake of a simple demo what I proposed above will suffice. The variable v would have the same problem if someone stored a window into it. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 5 Apr 1999 22:48:05 -0400 (EDT) From: Tecumseh Fitch <---@---.---> Subject: Finite Difference Eqns What is the best way to implement simple finite difference equations in SC 2.1, eg: x(t+1) = ax(t) (1-x(t)) One could do it with Tap and a delay line but this seems like overkill. Can we create oscillators from scratch that write a whole buffer of samples now? * Wm. Tecumseh Fitch, Ph.D. ************************************************** * Post-doctoral Fellow, Harvard/MIT Speech & Hearing Sciences Program * Rm 982 Wm. James Hall, 33 Kirkland St. Cambridge MA 02138 * (617) 496-6575 (ofc), (617) 496-8355 (fax), tec@wjh.harvard.edu ************ ------------------------------ Date: Mon, 05 Apr 1999 20:16:32 -0700 From: "David Cottle" <---@---.---> Subject: Biased random choices Hi, Is there a way to make a random choice with a bias? This is something I used to do in C. I think I could work out a way to do it with min and max, but I thought I'd ask to see if there is an existing function. For example, 100.rand1, might be used for a choice between 0 and 99 with a linear bias toward 1, or 100.rand2 for a triangle bias toward 50. This would be very useful. (For a low bias you pick two numbers and use the lowest, etc.) - -- ><><><><><><><><><><><> David Cottle composition, notation, contra lime@uiuc.edu ------------------------------ Date: Mon, 5 Apr 1999 22:44:19 -0600 From: James McCartney <---@---.---> Subject: Re: Biased random choices At 9:16 PM -0600 4/5/99, David Cottle wrote: >Hi, > >Is there a way to make a random choice with a bias? This is something I >used to do in C. I think I could work out a way to do it with min and max, >but I thought I'd ask to see if there is an existing function. > >For example, 100.rand1, might be used for a choice between 0 and 99 with a >linear bias toward 1, or 100.rand2 for a triangle bias toward 50. This >would be very useful. > >(For a low bias you pick two numbers and use the lowest, etc.) linrand - linearly distributed random number, implemented just as you describe. There are several distributions available. From SimpleNumber.help : linrand Linearly distributed random number from zero to this. bilinrand Bilateral linearly distributed random number from -this to +this. sum3rand A random number from -this to +this that is the result of summing three uniform random generators to yield a bell-like distribution. This was suggested by Larry Polansky as a poor man's gaussian. rrand(aNumber) Returns a random number in the interval [a, b). If both a and b are Integer then the result will be an Integer. exprand(aNumber) Returns an exponentially distributed random number in the interval [a, b). Always returns a Float. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Mon, 5 Apr 1999 22:53:33 -0600 From: James McCartney <---@---.---> Subject: Re: Finite Difference Eqns At 8:48 PM -0600 4/5/99, Tecumseh Fitch wrote: >What is the best way to implement simple finite difference equations in SC >2.1, eg: > >x(t+1) = ax(t) (1-x(t)) > >One could do it with Tap and a delay line but this seems like overkill. >Can we create oscillators from scratch that write a whole buffer of >samples now? 3 examples : // x(t+1) = ax(t) (1-x(t)) ( // filling a Signal sample by sample var x, a; x = 1.0.rand; a = 3.687; Signal.newClear(20000).waveFill({ x = a * x * (1.0 - x); }).plot; ) ( // as a control { arg synth; var x, a, f; x = 1.0.rand; a = 3.687; f = ControlIn.kr(800, 0); synth.repeat(0, 0.05, { x = a * x * (1.0 - x); f.source = x; }); SinOsc.ar(f * 1200, 0, 0.2); }.play; ) ( // using Sequencer to generate a waveform { arg synth; var x, a; x = 1.0.rand; a = 3.687; Sequencer.ar( { x = a * x * (1.0 - x); }, Impulse.ar(MouseX.kr(1000,20000,'exponential')) ); }.scope; ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Mon, 5 Apr 1999 23:05:15 -0600 From: James McCartney <---@---.---> Subject: Re: Finite Difference Eqns >( >// using Sequencer to generate a waveform >{ arg synth; > var x, a; > x = 1.0.rand; > a = 3.687; > Sequencer.ar( > { x = a * x * (1.0 - x); }, > Impulse.ar(MouseX.kr(1000,20000,'exponential')) > ); >}.scope; >) Hmm, this seems to reveal a bug in Sequencer when triggered at high rates. It shouldn't be dropping out like that. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 5 Apr 1999 23:18:45 -0600 From: James McCartney <---@---.---> Subject: Re: Finite Difference Eqns At 11:05 PM -0600 4/5/99, James McCartney wrote: >>( >>// using Sequencer to generate a waveform >>{ arg synth; >> var x, a; >> x = 1.0.rand; >> a = 3.687; >> Sequencer.ar( >> { x = a * x * (1.0 - x); }, >> Impulse.ar(MouseX.kr(1000,20000,'exponential')) >> ); >>}.scope; >>) > >Hmm, this seems to reveal a bug in Sequencer when triggered at high >rates. It shouldn't be dropping out like that. OK I fixed the bug, but also it is not possible to trigger Sequencer at over sampleRate/4 because in order to trigger you need at least one sample <= 0 and one > 0 to make a trigger. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Tue, 6 Apr 1999 15:54:32 +0900 From: Tim Kreger <---@---.---> Subject: Parsing the Alpha Numeric Keyboard Hi all, I'm having trouble finding a way to parse the alpha numeric keyboard for ascii values. It seems like a simple enough task but I can't seem to find the appropriate ugen or keyword foro that data. Any pointers would be appreciated. Tim Tim Kreger EMail: Tim.Kreger@anu.edu.au Lecturer in Computer Music Ph: 61-6-249-5642 Australian Centre for the Fax: 61-6-247-0229 Arts and Technology SNail: GPO Box 804, Canberra, ACT 2601 Australia ------------------------------ Date: Tue, 6 Apr 1999 16:11:06 +1000 From: Garth Paine <---@---.---> Subject: OMS Hi James, Thanks for the OMS stuff in SC 2.1. Will there also be additional arguments offered for all the MIDI functions to allow the defining of an OMS node (port). ie MIDIMostRecentNote.kr(1, PORT 2, 100, 6000, 'exponential'); Cheers, Garth See information about my new immersive interactive sound installations http://creativeaccess.com.au/~garth/ ,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,. . Composer, Sound Designer .. Interactives Designer ... Interactive Installation Artist .... Exhibition Consultant .,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,., ------------------------------ Date: Tue, 6 Apr 1999 01:15:47 -0600 From: James McCartney <---@---.---> Subject: Re: Mandelbrot.sc At 8:25 PM -0600 3/5/99, crucial wrote: >Here for anyone that wants it is a Mandelbrot generator, >useful constant procurer, all mod cons. I somehow missed this post and found it looking back through the list. This is essentially a Stream in its behaviour, so the 'init' and 'iterate' methods should be renamed to 'reset' and 'next' so that it can be interchanged with any other Stream. You should inherit from Stream so you can benefit from the other behaviours implemented there. Anything that obeys the Stream protocol can be used as a Stream. A Stream can be anything that responds to 'next' by returning a value and to 'reset' by starting over. The class Object defines 'reset' and 'next' for all objects, so that everything can be used as a Stream. The default 'reset' does nothing and the default 'next' returns the object itself. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Tue, 6 Apr 1999 01:47:42 -0600 From: James McCartney <---@---.---> Subject: Re: Parsing the Alpha Numeric Keyboard At 12:54 AM -0600 4/6/99, Tim Kreger wrote: >Hi all, > I'm having trouble finding a way to parse the alpha numeric >keyboard for ascii values. It seems like a simple enough task but I can't >seem to find the appropriate ugen or keyword foro that data. When a View is clicked in in a GUIWindow, the keys pressed will cause that View's keyDown method to be called. Someone recently posted a class for assigning key commands but I don't recall what the Subject line was.. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Tue, 06 Apr 1999 10:27:19 -0700 From: "David Cottle" <---@---.---> Subject: Re: Biased random choices Hi, >>Is there a way to make a random choice with a bias? This is something I [...] > linrand - linearly distributed random number, implemented just as you I thought as much. But I was in the lab this morning and couldn't find documentation for even rand or rand2. Is this new for SC2.1? ------------------------------ Date: Tue, 6 Apr 1999 13:33:59 -0600 From: James McCartney <---@---.---> Subject: Re: Biased random choices At 11:27 AM -0600 4/6/99, David Cottle wrote: >Hi, > >>>Is there a way to make a random choice with a bias? This is something I >[...] >> linrand - linearly distributed random number, implemented just as you > >I thought as much. But I was in the lab this morning and couldn't find >documentation for even rand or rand2. Is this new for SC2.1? No its been there for a long time. rand and rand2 are also documented in the SimpleNumber class. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Tue, 6 Apr 1999 20:24:09 -0500 From: Kenneth N Babb <---@---.---> Subject: Object Oriented Programing reference Could anyone on the list recommend a basic guide to object oriented programing, a useful general reference. I noticed a number of comprehensive, and rather expensive, titles on the shelf at a local Barnes and Noble. Would like to hear some opinions or suggestions that members of this list might share. Thanks, Kenneth Babb ------------------------------ Date: Tue, 6 Apr 1999 18:57:19 -0600 From: antiorp@tezcat.com Subject: Re: Object Oriented Programing reference >Could anyone on the list recommend a basic guide to object oriented >programing, a useful general reference. >I noticed a number of comprehensive, and rather expensive, titles on the >shelf at a local Barnes and Noble. >Would like to hear some opinions or suggestions that members of this list >might share. !f du = posez 01 v!ndou konzult dze scene v!z!bl !f du = posez $$ konzult dze Barnes and Noble scene \\ object oriented programing - a ke!verd useful !n 1 s!k zoz!et! chek out m!m!m!m!m! neu !merz!v object oriented !ntr+akt!v ultra palmol!v zkueekc korporat zponzord no!sz !nztalat!on at ptth://ma!.!.=.hav.zom.watr.plz/!merz!v/calpurn!a/ax!om ------------------------------ Date: Tue, 6 Apr 1999 21:54:27 -0600 From: James McCartney <---@---.---> Subject: version 2.1.2 available Version 2.1.2 is now available via ftp: BinHex 2,805K : ftp://www.audiosynth.com/pub/updates/SC2.1.2.sea.hqx MacBinary 2,104K : ftp://www.audiosynth.com/pub/updates/SC2.1.2.sea.bin Changes in Version 2.1.2 bug fixes: The interpreter was not properly initialized when choosing from the Lib menu. Ref asStream was removed. It was added in error in 2.1.1 Sequencer.ar would drop out when triggered faster than control rate. ImpulseSequencer.ar would print out debug info when passed a Function. new stuff: 'keyDownAction' instance variable was added to View. See gui examples file. ButtonView now accepts key down events. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Wed, 07 Apr 1999 12:12:14 +0100 From: Martin Robinson <---@---.---> Subject: Voicer Problem I'm working on a rather large project in SC. The idea is to have four GUI windows which can be assigned different synthesis functions according to which MIDI notes are played. Each window 'listens' to a different channel (the sliders are controlled by a fader box I've built to inferface with an iCube, they're all on channel 1). I've written a number of synthesis functions, a simple FM instrument, file granulators, loop players, sound file convolvers (a modification of the patch I posted here a while back). I'm testing with only two of these, the FM instrument and the convolver. Using four Voicers (one for each GUI window) MIDI note 48 triggers the convolver and note 49 the FM synth (velocities are ignored). The Voicers' maxVoices are set to -1 so triggering a new function should steal the voice generated by the previous function assigned to that channel and the Voicer should be in toggle mode. The FM synth works fine (it's not very pleasant but I'm only really using it as a simple test), voices trigger and toggle as expected. However, the convolver doesn't. Sometimes it starts, sometimes it doesn't. When there's no synthesis going on the CPU (a 400MHz G3 upgrade) runs at about 3%. Using one convolver (that IS working) kicks it up to 17-18%. Attempting to trigger the convolver when it fails causes the CPU usage to jump to 10-12% for about a second then drop back to 3%. I've programmed the labels and names in the GUI window to change according which synthesis function is installed, and that works each time, so the code IS partially executing. (Sometimes the CPU usage reads as high as it would when it is playing the function but there is no sound output, then freezes when the note is re-triggered to switch the function off.) I find that if I play loud staccato notes on the keyboard then it does usually work, long notes and low velocities frequently (almost always) fail. Perhaps I'm interpreting too much code while playing? Some bits of this might seem reduntant (eg. the buffers which are used to pass audio between functions), but I've really stripped it down here: ( var w, e, ex, objects; var numffts=1, fftsize=2048, fftoffsets, window, cosineTable; var buffers, bufferSize=0.05, writeToBuffer; var filenames, sounds, signals, outputs, conv, fm; ex = 1.exp-1; // filename for objects that use sound files // if an object wishes to use a sound file it refers to it by // index from this array filenames = [ ":Sounds:floating_1" ]; // envelope for spawned synth functions to take e = Env.new([0, 1.0, 1.0, 0], [0.05, 1, 0.05], 'linear', 2); w = [0, 1, 2, 3].collect({ arg item, i; GUIWindow.new("Control Panel "++(i+1).asString,Rect.newBy(60+(i*20), 80+(i*20), 350, 208)) }); buffers = w.collect({ arg item, i; Signal.new(Synth.sampleRate * bufferSize) }); w.collect({ arg item, panelNo; // add sliders to GUI 7.do({ arg i; SliderView.new( item, Rect.newBy( 140, 20+(i*24), 128, 20 ), "SliderView", 0, 0, 1, 0, 'linear') .mapToController(1, (panelNo*6)+i+1) }); 5.do({ arg i; StringView.new( item, Rect.newBy( 10, 20+(i*24), 128, 20 ), "Slider "++(i+1).asString) }); StringView.new( item, Rect.newBy( 10, 20+(5*24), 128, 20 ), "Volume"); StringView.new( item, Rect.newBy( 10, 20+(6*24), 128, 20 ), "Monitor"); }); // make offsets for staggering overlapped FFTs fftoffsets = Array.series(numffts, 0, fftsize/numffts); // make a signal analysis/synthesis window window = Signal.welchWindow(fftsize); // make cosine table required for FFT cosineTable = Signal.fftCosTable(fftsize); writeToBuffer = { arg panelNo, ugenGraph; DelayWr.ar(buffers.at(panelNo), ugenGraph); ugenGraph }; // define instrument functions // first argument is the panel to install the function on to // a simple FM instrument fm = { arg panelNo, args; // args format // [car min, car max, mod min, mod max] var car, mod, index, indexModDep, indexModRate, amp; var carMin, carMax, modMin, modMax; var carMap, modMap, indexModMap, indexCalc; var objectOut; car = w.at(panelNo).at(0); mod = w.at(panelNo).at(1); index = w.at(panelNo).at(2); indexModDep = w.at(panelNo).at(3); indexModRate = w.at(panelNo).at(4); amp = w.at(panelNo).at(5); // rename GUI items w.at(panelNo).name_("FM"++args.asString); w.at(panelNo).at(7).label_("Car Freq"); w.at(panelNo).at(8).label_("Mod Freq"); w.at(panelNo).at(9).label_("Index"); w.at(panelNo).at(10).label_("I Mod Depth"); w.at(panelNo).at(11).label_("I Mod Freq"); if(args.isEmpty, { carMin = modMin = 20; carMax = modMax = 20000 }, { # carMin, carMax, modMin, modMax = args }); carMap = LinExp.kr(car.kr, 0, 1, carMin, carMax); modMap = LinExp.kr(mod.kr, 0, 1, modMin, modMax); indexModMap = LinExp.kr(indexModRate.kr, 0, 1, 0.01, 50); indexCalc = carMap*index.kr*3*modMap; objectOut = SinOsc.ar(SinOsc.ar(modMap, 0, indexCalc, SinOsc.ar(indexModMap, 0, indexModDep.kr*indexCalc)), 0, 1); writeToBuffer.value(panelNo, objectOut) }; // convolve two sources conv = { arg panelNo, args; // args format // [source 1, source 2, fifth slider] var crossfade, pitchA, pitchB, endA, endB, speedLimit = 10; var srca, srcb, srcc, srcd, ffta, fftb, fftab; var ifftab, output, objectOut; crossfade = w.at(panelNo).at(0); pitchA = w.at(panelNo).at(1); pitchB = w.at(panelNo).at(2); endA = w.at(panelNo).at(3); endB = w.at(panelNo).at(4); // rename GUI items w.at(panelNo).name_("Conv "++filenames.at(args.at(0))++" * "++filenames.at(args.at(1))); w.at(panelNo).at(7).label_("Crossfade"); w.at(panelNo).at(8).label_("Pitch A"); w.at(panelNo).at(9).label_("Pitch B"); w.at(panelNo).at(10).label_("Loop End A"); w.at(panelNo).at(11).label_("Loop End B"); srca = HPF.ar(PlayBuf.ar(signals.at(args.at(0)), sounds.at(args.at(0)).sampleRate, LinExp.kr(pitchA.kr, 0, 1, 0.1, 10), 0, 0, LinExp.kr(endA.kr, 0, 1, 10, signals.at(args.at(0)).size-1), 1), 180); srcb = PlayBuf.ar(signals.at(args.at(1)), sounds.at(args.at(1)).sampleRate, LinExp.kr(pitchB.kr, 0, 1, 0.1, 10), 0, 0, LinExp.kr(endB.kr, 0, 1, 10, signals.at(args.at(1)).size-1), 1); ffta = FFT.ar(fftsize, fftoffsets, cosineTable, window, nil, srca, 0.0); fftb = FFT.ar(fftsize, fftoffsets, cosineTable, window, nil, srcb, 0.0); fftab = ffta * fftb; ifftab = IFFT.ar(fftsize, fftoffsets, cosineTable, nil, window, fftab.real, fftab.imag); output = Mix.ar([ // the mutant AB (Mix.ar(ifftab.real)/numffts) * (1-((crossfade.kr-0.5*2).abs.sqrt.sqrt)), // file A DelayN.ar(srca * (min((crossfade.kr-0.5*2), 0)).abs, fftsize/Synth.sampleRate, fftsize/Synth.sampleRate), // file B DelayN.ar(srcb * (max((crossfade.kr-0.5*2), 0)).abs, fftsize/Synth.sampleRate, fftsize/Synth.sampleRate) ]); objectOut = Compander.ar(output, output, 0.5, 1, 0.1, 0.01, 0.01); writeToBuffer.value(panelNo, objectOut) }; // FORMAT: // [ [ `instrumentFunction, [ params ] ] . . . [] ] objects = []; // two banks to select from (not implemented) // Bank 0 objects.add([ [`conv, [0, 0]], [`fm, []] ]); // Bank 1 (empty at present) objects.add([]); sounds = filenames.collect({ SoundFile.new }); if(filenames.every({ arg item, i; sounds.at(i).read(item) }), { signals = sounds.collect({ arg item, i; item.data.at(0) }); Synth.play({ arg synth; var voicers, voicerFunc, bankSelect=0; // set up a collection of four voicers that are linked to the four // GUI panels, each one listens to a different MIDI channel voicerFunc = { arg panelNo; // nest function so that panelNo can be passed to the voicer function { arg voicer, i, synth, deltaTime, channel, note, velocity; var vOut, theObject; theObject = note.asInteger-48; if((theObject >= 0) && (theObject < objects.at(bankSelect).size), { vOut = EnvGen.ar(e, objects.at(bankSelect).at(theObject).at(0) .get.value(panelNo, objects.at(bankSelect).at(theObject).at(1)) ); }, { vOut = nil }); vOut; } }; voicers = w.collect({ arg item, i; Voicer.ar(voicerFunc.value(i), 1, i+1, - -1)}); // output array [Main mix, monitor Mix] [5, 6].collect({ arg slider; Mix.ar(voicers.collect({ arg item, i; item * w.at(i).at(slider).kr }))/voicers.size }) }); }, { "files not found".postln }); w.do({ arg item, i; item.close }); ) >>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ <><><>__this.liveElectronics.interFaces.diffusion.value ____ <<<<<<___Extractor at Off-Centre 333 Old Street, London UK. __ <<<>>>____Sat 8 May 1999 2200-0500 ] || ------------------------------ Date: Thu, 08 Apr 1999 21:08:00 -0400 From: "crucial" <---@---.---> Subject: Re: Parsing the Alpha Numeric Keyboard >At 12:54 AM -0600 4/6/99, Tim Kreger wrote: >>Hi all, >> I'm having trouble finding a way to parse the alpha numeric >>keyboard for ascii values. It seems like a simple enough task but I can't >>seem to find the appropriate ugen or keyword foro that data. > >When a View is clicked in in a GUIWindow, the keys pressed will >cause that View's keyDown method to be called. > >Someone recently posted a class for assigning key commands but >I don't recall what the Subject line was.. > > > --- james mccartney twas me : Thanks for the Stream-conscious tips re : Mandelbrot.sc as long as I'm posting, I'll repost that : Alter View : keyDown { // default key response arg a,c,m; KeyDown.defer(a,c,m) } Create this class into default library : // KeyDown.sc KeyDown{ classvar script; *defer{arg ascii,code,modifier; script.value(ascii,code,modifier) } *arm{ arg function; script=function; } } // Then in your day to day code, you state something like : KeyDown.arm({arg a,c,m; if(c==130 && (m==16),{ // do this }); if (c==140 etc..... __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Thu, 8 Apr 1999 20:36:00 -0600 From: James McCartney <---@---.---> Subject: Re: Parsing the Alpha Numeric Keyboard At 7:08 PM -0600 4/8/99, crucial wrote: >>Someone recently posted a class for assigning key commands but >>I don't recall what the Subject line was.. >> >> >> --- james mccartney > > >twas me : >as long as I'm posting, I'll repost that : > > >Alter View : > > > keyDown { // default key response > arg a,c,m; > KeyDown.defer(a,c,m) > } You might want to redo it in light of what I added to 2.1.2. There is now a keyDownAction instance variable for each view which sent the 'value' message by the View's keyDown method. Look at the new examples in "gui examples" --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Fri, 09 Apr 1999 11:44:57 -0600 From: "David Cottle" <---@---.---> Subject: Manual (hard and pdf copies) Hi, We're just wrapping up the electronic music course and SC has been a great success. You may remember I asked once if you minded me generating a manual. I'm working on it now in hopes of using it next year. It's the same materials that are included with SC, just organized and indexed into one volume. My biggest criticism of the current layout is that things are very difficult to find. (Command-H on selected text works great, but a lot of items don't come up; like rand2--a question I had to ask about recently.) I like the documentation the way it is, particularly the fact that you can try the examples right from the documents, but it really needs a comprehensive index. Also, I often find myself searching for a specific example that was not directly related to the com-h topic (like an if statement or a do loop). An index of the help files would be extremely helpful in this regard. I plan to make it available to anyone so I'm seeking input now on the layout and font choices. I tried to pick something that would accommodate and offset code yet still be readable on the screen and printed. (For example, it is critical that the font display '1' differently from 'l', and that the difference be immediately recognizable.) An MS Word copy and a pdf copy of just the files from the documentation folder are available at the address below. The .pdf file can also be indexed and profusely linked. I hope to add all the help files and maybe even the examples files soon. http://www.byu.edu/music/labs/ems/287/ (NB: this process sort of destroys them in terms of a SC document, I have to add indexes markings and I don't think you could then save them as text files and work directly with them in SC. Maybe if I did the indexing carefully. ) - -- ><><><><><><><><><><><> David Cottle composition, notation, contra lime@uiuc.edu ------------------------------ Date: Fri, 9 Apr 1999 14:54:50 -0500 From: rkuivila@mail.wesleyan.edu Subject: Re: Manual (hard and pdf copies) A quick question to people who have been teaching SC: where do you start? (I have been using OrcScore as a starting point to clarify the nature of lists, function definitions, and function calls. This works OK, but it does mean that there are a lot of abstractions to absorb in one long gulp.) RJK ------------------------------ Date: Fri, 9 Apr 1999 17:44:03 -0400 (EDT) From: Tecumseh Fitch <---@---.---> Subject: Powerbook 5300 failure I have downloaded the newest version of SC, and it still fails to run on my Powerbook 5300. (40 Mb RAM, Sound Manager 3.3) Although I know these old Powerbooks are underpowered for SC, it would still be nice (for me) to run it on my portable just for developing code and learning the language. * Wm. Tecumseh Fitch, Ph.D. ************************************************** * Post-doctoral Fellow, Harvard/MIT Speech & Hearing Sciences Program * Rm 982 Wm. James Hall, 33 Kirkland St. Cambridge MA 02138 * (617) 496-6575 (ofc), (617) 496-8355 (fax), tec@wjh.harvard.edu ************ ------------------------------ Date: Sat, 10 Apr 1999 08:21:03 +1000 From: Graeme Gerrard <---@---.---> Subject: Re: Manual (hard and pdf copies) David, There are no page numbers in the pdf doc when it is printed.(?) Am I doing something wrong? ------------------------------ Date: Sat, 10 Apr 1999 01:18:19 -0600 From: "David Cottle" <---@---.---> Subject: Re: Manual (hard and pdf copies) Hi, > There are no page numbers in the pdf doc when it is printed.(?) > Am I doing something wrong? Oops. I'll post a new version in the next day or so. I just added the tutorial files and wanted to index them too before I post another version shortly. ------------------------------ Date: Sat, 10 Apr 1999 00:48:02 -0600 From: "David Cottle" <---@---.---> Subject: Re: Manual (hard and pdf copies) Hi, > A quick question to people who have been teaching SC: > > where do you start? I have a series of tutorials that are designed more to compliment an electronic music curriculum (following Pellmen's text). But it also assumes very little knowledge of SuperCollider. They are in the same location as the manual. ------------------------------ Date: Sun, 11 Apr 1999 13:22:29 -0500 From: rkuivila@mail.wesleyan.edu Subject: some thoughts on documentation Hi all, Here are two proposals, one simple, one complex: 1. Searches for help files should include any directory named Help in the root directory of the currently active source library. 2. Maintain an index of help pages that mirror the class structure of Supercollider and also the sub-directory structure of Common. Furthermore, the class structure could be extended with dummy classes to group classes with related functions. (Such grouping classes could include the suffix Classes in their names.) For example, the following classes are all direct descendents of Object and they all seem to involve creating sequences of events (although I am not clear on what Peep actually does). They could be grouped together as EventMakerClasses: Peep EventStream StreamPlayer SelectEvent RandomEvent Cycle DemoCycle OrcScore OverlapTexture XFadeTexture Since SC is extensible, it is inherently under perpetual development. A simple policy would be to put each such project under a single Classes heading and provide a single help page that explains the goals of the software and a warning about its molten state. (I would be very interested in such a two or three line page for Library, Pattern, and Stream in the current release.) Ideally, the help page index would be generated on the fly from whatever source library is currently compiled. Here is a possible grouping for the other immediate descendents of Object, presented more as a thought experiment than as a real proposal: Class // KernelClasses Interpreter Thread Process Frame Object Environment TestDependant Model AbstractFunction // FunctionClasses FunctionDef Collection // CollectionClasses PriorityQueue LazyList LinkedListNode Magnitude // LiteralClasses ? Ref RawPointer Boolean Nil Symbol Point // GraphicClasses Rect Color View GUIWindow DialogWindow File // FileClasses SoundFile ExternalControlSource // UGenSupportClasses Synth Cutoff Env OSCPort OSCNode ------------------------------ Date: Sun, 11 Apr 1999 15:47:20 -0700 From: Mark Polishook <---@---.---> Subject: Re: Manual (hard and pdf copies) Ron, re: your query about teaching SC: I found it helpful to translate bits and pieces of Dodge/Jerse into SC, basically using SinOsc to demonstrate fundamental synthesis concepts, ie fm, am, additive (illustrated with the simple apple graphing calculator). From there, we took a look at filtering, again using Dodge/Jerse (and also Roads) to build simple filters, moving then to delays, combs, reverb, etc. Once the class got to the point where it could design its own instruments - a process which took several weeks, I made a very simple OrcSocre example and from there, many of the students began to insert their own instruments into OrcScore. (And many of the students took this a step further and began to nest OrcScores into OrcScore). I tried to keep programming issues as far in the background as possible. I found that this approach was advantageous - because when we eventually did begin to discuss functions, objects, class definitions, etc. it was in a context that related directly to composing issues that were arising in the work of individual students. Also, for each week of the course, I wrote tutorial documents that explained common synthesis techniques and/or programming issues in a step by step way. I should also mention that we were able to bring Alberto de Campo in for a short residency (thanks again, Alberto... :) . He presented the tutorial materials he's developing - they're EXCELLENT, very-well organized and helped to clear up many questions. Hope this is interesting to the list....I'd be curious to hear more responses to Ron's question... - -mark > A quick question to people who have been teaching SC: > > where do you start? > (I have been using OrcScore as a starting point to clarify the nature > of > lists, function definitions, and function calls. This works OK, but it > does > mean that there are a lot of abstractions to absorb in one long gulp.) > > RJK - -- * * * * * * * * Mark Polishook Assistant Professor of Composition Music Department Central Washington University Ellensburg, WA 98926 tel.: 509-963-1245 fax: 509-963-1239 e-mail: polishoo@cwu.edu http://www.cwu.edu/~music/composition ------------------------------ End of sc-users-digest V1 #35 *****************************