From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #32 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 Tuesday, March 23 1999 Volume 01 : Number 032 ---------------------------------------------------------------------- Date: Wed, 17 Mar 1999 10:41:34 -0600 From: James McCartney <---@---.---> Subject: Re: Signal colour + other ?s At 9:56 AM -0600 3/17/99, finer@easynet.co.uk wrote: >Is there a way to colour the wave form in a Signalview ? no > >DiscIn from a Zip drive is a bit glitchy - has anyone tried from a jaz - - >and if so is this smoother ? >On the zip the cpu surges to over 1000 % every . . . well I guess every >time it fills a buffer or something like that. The audio "stutters". You need to use a fast drive for recording. Do not record straight to a zip. It just is too slow. This is not an SC problem. I've heard jaz are fast enough but have no experience myself. >clip (as opposed to clip2) is somehting that I can't get to work on a signal - > >eg ({SinOsc.ar(100).clip(-0.8,0.5)}).scope > >is it me or is it sc ? clip is not a unit generator operator. It is only defined to work on numbers and signal buffers. The only operators defined for UGens are binary and unary math operators which are listed in the UGen_Ref_Sheet. cmd-Y gives: Float : this.clip(lo, hi) Integer : this.clip(lo, hi) Magnitude : this.clip(lo, hi) Signal : this.clip(lo, hi) You can do clip by the following: SinOsc.ar(100).max(-0.8).min(0.5) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Wed, 17 Mar 1999 12:10:23 -0500 From: rkuivila@mail.wesleyan.edu Subject: DiskOut and Pause Hi James, 1. Pause in DiskOut In the following example, I do not get any audio recorded. The significant line has asterisks. ( var file; Synth.play({ arg synth; var ugenGraph; ugenGraph = CombL.ar(PinkNoise.ar([0.1,0.1]), 0.01, SinOsc.kr(0.3,0,0.0017,0.002), 0.02); // create a sound file file = SoundFile.new; file.numChannels = ugenGraph.size; // set the number of channels file.headerFormat = 'AIFF'; // set the desired header format file.sampleFormat = '16 big endian signed'; // set the sample format if (file.writeHeader("diskOutTest"), { // write the header // prepare to record. This opens the file for writing by DiskOut. file.prepareRecord; DiskOut.ar(file, 32768, Pause.ar(ugenGraph,LFPulse.kr(1,0.5))); // ********* },{file = nil;}); }, 4.0); // endRecord updates the file header and closes the file if (file.notNil, { file.endRecord }); ) 2. DiskOut in Pause It seems that DiskOut runs independently of the normal scheduling mechanisms. In particular, Pause has no effect on it. Could Pause be made to turn DiskOut on and off? In the following example a pulsing noise is heard during playback, but the recording is of noise running continuously for the duration of synthesis. (I was hoping for a continuous recording of the unpaused portion of synthesis.) ( var file; Synth.play({ arg synth; var ugenGraph; ugenGraph = CombL.ar(PinkNoise.ar([0.1,0.1]), 0.01, SinOsc.kr(0.3,0,0.0017,0.002), 0.02); // create a sound file file = SoundFile.new; file.numChannels = ugenGraph.size; // set the number of channels file.headerFormat = 'AIFF'; // set the desired header format file.sampleFormat = '16 big endian signed'; // set the sample format if (file.writeHeader("diskOutTest"), { // write the header // prepare to record. This opens the file for writing by DiskOut. file.prepareRecord; Pause.ar(DiskOut.ar(file, 32768, ugenGraph),LFPulse.kr(1,0.5)); // ************** },{file = nil;}); }, 4.0); // endRecord updates the file header and closes the file if (file.notNil, { file.endRecord }); ) If you "DiskOut" Pause no audio gets recorded at all. RJK ------------------------------ Date: Wed, 17 Mar 1999 12:24:41 -0500 From: rkuivila@mail.wesleyan.edu Subject: Re: Some Synth questions Hi James, Thanks for the quick reply. >>The ability to stop synthesis from within >>code would also help GUIUtils. (You can crash GUIUtils if you try to save >>to disk while synthesis is running. The easiest fix would be to just stop >>synthesis and do the save.) > >Save what to disk? The different presets of a ParameterWindow in GUIUtils. By the way, it is possible to rearrange GUIUtils a bit to start and stop synthesis independent of opening and closing palettes and windows. Then, by redefining command-R to just start and stop synthesis, you can get to a reasonable interim situation for fiddling directly with executing code. RJK ------------------------------ Date: Wed, 17 Mar 1999 11:24:14 -0600 From: James McCartney <---@---.---> Subject: Re: DiskOut and Pause At 11:10 AM -0600 3/17/99, rkuivila@mail.wesleyan.edu wrote: >Hi James, > >1. Pause in DiskOut >2. DiskOut in Pause The argument to Pause must be a Function. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 17 Mar 1999 12:47:56 -0500 From: rkuivila@mail.wesleyan.edu Subject: A clarification of the DiskOut question Hi James, I thought I should explain in slightly more detail why I want Pause to control DiskOut, maybe there is another way to do it: I was hoping to modify the SoundManager class in GUIUtils as follows: 1. add: classvar <>recordEnable; //flag to enable/disable recording classvar recordFile; //contains file audio will be recorded to 2. add the necessary initialization and file handling (i.e. recordFile should be an open file) 3. Insert the following line into synthfunc, the runtime guts of SoundManager: Pause.ar(DiskOut.ar(recordFile,32768,outsignal),ControlIn.kr(recordEnable)); ('outsignal' is variable that contains the TSpawn that runs audio in SoundManager) Then any GUI could start recording with SoundManager.recordEnable = 1 and stop it with SoundManager.recordEnable = 0 Here, for reference, is the synthfunc definition with my fantasy addition: *synthfunc { arg guifunc; // This function sets up the system for triggering all subsequent sounds by spawner.trigger: ^{ arg synth; // broadcast top synth to all classes having a settable topsynth class var. this.broadcastTopSynthToClasses(synth); // function for generating the initial gui. OBLIGATORY. guifunc.value; // create the top spawner for triggering all subsequent events outsignal = TSpawn.ar( { arg spawn, i, synth; sound.value(spawn, i, synth) }, numchans, nil, 0); // store the spawner for access so it can be triggered spawner = outsignal.source; //FANTASY ADDITION: Pause.ar(DiskOut.ar(recordFile,32768,outsignal),ControlIn.kr(recordEnable)); // output the signal generated by any children processes triggered by the spawner; outsignal } } ------------------------------ Date: Wed, 17 Mar 1999 12:13:18 -0600 From: James McCartney <---@---.---> Subject: Re: A clarification of the DiskOut question At 11:47 AM -0600 3/17/99, rkuivila@mail.wesleyan.edu wrote: >Hi James, > >I thought I should explain in slightly more detail why I want Pause to >control DiskOut, First you have to call it with the correct argument type. The argument must be a Function. Put the DiskOut into a Function. Pause.ar({ DiskOut.ar(recordFile,32768,outsignal) },ControlIn.kr(recordEnable)); Pause creates a new Synth. Look at the Pause init method. In order to create a new Synth it requires a function. In order for something to be Paused it must be running in a separate synth which can be stopped and started independantly of the synth that Pause itself is running in. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 17 Mar 1999 13:46:19 -0500 From: "crucial" <---@---.---> Subject: Re: Some Synth questions >>5. Would it be possible to have a command-key dispatcher in Main (so keys >>other than command-R can trigger actions)? What about function keys? Yes more key commands control would be useful. I'm not fond of mice. For any who want it... Its not exactly elegant, but I modified View, inserting my own keydown functions. If you have a GUI open, and you are selected on any view except a button, the keys will work. command- are all reserved, your mileage may vary etc. 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: Wed, 17 Mar 1999 14:35:48 -0500 From: rkuivila@mail.wesleyan.edu Subject: GUIUtils, DiskOut and Pause, mission accomplished! Hi James and Iannis, Once James cleared up my confusion about Pause, it became a pretty simple matter to add a first approximation of a record on demand function to GUIUtils. I think it is a pretty good advertisement for the advantages of SoundManager. This code adds a button at the top of SoundPalette's to start and pause recording. James, would it be possible to add a rewind function or have playback from the file while recording? Below are the code changes required. They alter SoundManager.sc and SoundPalette.sc in GUIUtils. The file handling definitely needs improvement, right now it just writes to a file named SCAudioOut. RJK //Changes to SoundManager.sc // new code: classvar <>recordEnable = 0, recordFile = nil; *setupForRecording {arg numchannels; recordFile = SoundFile.new; recordFile.numChannels = numchannels; // set the number of channels recordFile.headerFormat = 'SD2'; // set the desired header format, // it's SD2 so I can use Deck II recordFile.sampleFormat = '16 big endian signed'; // set the sample format } *startRecording {arg ugenGraph; if (recordFile.writeHeader("SCAudioOut"), { // write the header // prepare to record. This opens the file for writing by DiskOut. recordFile.prepareRecord; Pause.ar({ DiskOut.ar(recordFile, 32768, ugenGraph); },ControlIn.kr({recordEnable});); // }); } *cleanupFromRecording { if (recordFile.notNil, { recordFile.endRecord; }); } // altered code, new lines marked with ***CHANGE *synthfunc { arg guifunc; // This function sets up the system for triggering all subsequent sounds by spawner.trigger: ^{ arg synth; // broadcast top synth to all classes having a settable topsynth class var. this.broadcastTopSynthToClasses(synth); // function for generating the initial gui. OBLIGATORY. guifunc.value; // create the top spawner for triggering all subsequent events outsignal = TSpawn.ar( { arg spawn, i, synth; sound.value(spawn, i, synth) }, numchans, nil, 0); // store the spawner for access so it can be triggered spawner = outsignal.source; this.startRecording(outsignal); //***CHANGE // output the signal generated by any children processes triggered by the spawner; outsignal } } // set up vars for number of channels and envelope for stopping sounds *setupforstart { arg numchannels = 2; numchans = numchannels; this.setupForRecording(numchannels); //***CHANGE // setting fadeout to 0.001 to avoid clicks fader = Env.new(#[0, 1, 0], #[0.000005, 0.001], 'linear', 1); } // wrap up after execution: set topsynth to nil, // to prevent start of sounds from checkboxes after stop // close windows no longer performed // because we need to keep windows after execution to perform any data saves! *cleanupafterend { arg closewindows = false; this.cleanupFromRecording; //***CHANGE topsynth = nil; // this should be broadcast to all topsynth class vars like at startup // Assume that the windows must remain open, to save any sound pars, // unless closewindows is set to true if ( closewindows and: (GUIWindow.allWindows.notNil), { GUIWindow.closeAll }); } //Changes to SoundPalette.sc initSoundPalette { arg specs, x = 20, y = 80, color; this.addcheckbox( " Record to SCAudioOut" //***CHANGE ,{SoundManager.recordEnable = abs(SoundManager.recordEnable-1); } , 200); specs = (specs ? #[]).asArray; specs.do({ arg s, c; this.parseSpec(s, c) } ); this.resize(x, y); this.backColor_( if ( color.isNil, { Color.new(128 + 128.rand, 128 + 128.rand, 128 + 128.rand) }, { color })); } ------------------------------ Date: Wed, 17 Mar 1999 21:20:50 +0100 From: "Iannis Zannos" <---@---.---> Subject: Re: GUIUtils, DiskOut and Pause, mission accomplished! Ron, thanks for all the corrections and new features to GUIUtils. Suggest making the next intermediate version c/o your work, which means, let me check it first and then post it to James for uploading with the "Contributions" of the next SC version. Best, Iannis Zannos SIM Tiergartenstr. 1, D-10785 Berlin, Germany Fax: +49 30 25481172 - ---------- >From: rkuivila@mail.wesleyan.edu >To: sc-users@lists.io.com >Subject: GUIUtils, DiskOut and Pause, mission accomplished! >Date: Wed, 17 Mar 1999 8:35 PM > >Hi James and Iannis, > >Once James cleared up my confusion about Pause, it became a pretty >simple matter to add a first approximation of a record on demand function >to GUIUtils. I think it is a pretty good advertisement for the >advantages of SoundManager. > >This code adds a button at the top of SoundPalette's to start and pause >recording. >James, would it be possible to add a rewind function or have playback from >the file >while recording? > >Below are the code changes required. >They alter SoundManager.sc and SoundPalette.sc in GUIUtils. >The file handling definitely needs improvement, right now it just writes >to a file named SCAudioOut. > >RJK > >//Changes to SoundManager.sc > >// new code: >classvar <>recordEnable = 0, recordFile = nil; > >*setupForRecording {arg numchannels; > recordFile = SoundFile.new; > recordFile.numChannels = numchannels; // set the number of channels > recordFile.headerFormat = 'SD2'; // set the desired header >format, > // it's SD2 so I can use Deck II > recordFile.sampleFormat = '16 big endian signed'; // set the >sample format >} >*startRecording {arg ugenGraph; > if (recordFile.writeHeader("SCAudioOut"), { // write >the header > // prepare to record. This opens the file for writing by >DiskOut. > recordFile.prepareRecord; > Pause.ar({ DiskOut.ar(recordFile, 32768, ugenGraph); >},ControlIn.kr({recordEnable});); // > }); >} >*cleanupFromRecording { > if (recordFile.notNil, { recordFile.endRecord; }); >} > >// altered code, new lines marked with ***CHANGE > *synthfunc { arg guifunc; > // This function sets up the system for triggering all >subsequent sounds by spawner.trigger: > ^{ arg synth; > > // broadcast top synth to all classes having a settable >topsynth class var. > this.broadcastTopSynthToClasses(synth); > > // function for generating the initial gui. OBLIGATORY. > guifunc.value; > > // create the top spawner for triggering all subsequent events > outsignal = TSpawn.ar( > { arg spawn, i, synth; sound.value(spawn, i, synth) >}, numchans, nil, 0); > > // store the spawner for access so it can be triggered > spawner = outsignal.source; > > this.startRecording(outsignal); >//***CHANGE > > // output the signal generated by any children processes >triggered by the spawner; > outsignal > } > } > > // set up vars for number of channels and envelope for stopping sounds > *setupforstart { arg numchannels = 2; > numchans = numchannels; > this.setupForRecording(numchannels); >//***CHANGE > // setting fadeout to 0.001 to avoid clicks > fader = Env.new(#[0, 1, 0], #[0.000005, 0.001], 'linear', 1); > } > > // wrap up after execution: set topsynth to nil, > // to prevent start of sounds from checkboxes after stop > // close windows no longer performed > // because we need to keep windows after execution to perform any >data saves! > *cleanupafterend { arg closewindows = false; > this.cleanupFromRecording; >//***CHANGE > topsynth = nil; // this should be broadcast to all topsynth >class vars like at startup > // Assume that the windows must remain open, to save any >sound pars, > // unless closewindows is set to true > if ( closewindows and: (GUIWindow.allWindows.notNil), > { GUIWindow.closeAll }); > } > >//Changes to SoundPalette.sc > > initSoundPalette { arg specs, x = 20, y = 80, color; > > this.addcheckbox( " Record to SCAudioOut" >//***CHANGE > ,{SoundManager.recordEnable = abs(SoundManager.recordEnable-1); > } > , 200); > > specs = (specs ? #[]).asArray; > specs.do({ arg s, c; > this.parseSpec(s, c) } ); > this.resize(x, y); > this.backColor_( if ( color.isNil, > { Color.new(128 + 128.rand, 128 + 128.rand, 128 + >128.rand) }, > { color })); > } > > > ------------------------------ Date: Wed, 17 Mar 1999 22:04:59 -0700 From: "David Cottle" <---@---.---> Subject: Feedback Hi, I thought maybe I could do this with GUI, but I don't think so. I would like a way to display in real time feedback about what is going on (beyond the scope which shows the wave). I teach a class where it is important for them to know what the values are behind the sounds they hear. I set up demonstration patches with MouseX and Y controlling some parameter, but it would be nice if they could also see the exact value in a window (for, say, control frequency, or amplitude of a AM patch). Any way of doing this? - -- ><><><><><><><><><><><> David Cottle composition, notation, contra lime@uiuc.edu ------------------------------ Date: Thu, 18 Mar 1999 08:10:55 +0100 From: "Iannis Zannos" <---@---.---> Subject: Re: Feedback >I thought maybe I could do this with GUI, but I don't think so. I would >like a way to display in real time feedback about what is going on (beyond >the scope which shows the wave). I teach a class where it is important for >them to know what the values are behind the sounds they hear. I set up >demonstration patches with MouseX and Y controlling some parameter, but it >would be nice if they could also see the exact value in a window (for, say, >control frequency, or amplitude of a AM patch). Any way of doing this? You can show control signals in a normal scope window by converting them with K2A:. { K2A.ar(MouseY.kr) }.scope; or - to update the scope every 2 seconds only: { K2A.ar(MouseY.kr) }.scope(2); There are other examples in the help files - I think. Iannis Zannos SIM Tiergartenstr. 1, D-10785 Berlin, Germany Fax: +49 30 25481172 - ---------- >From: "David Cottle" <---@---.---> >To: SC >Subject: Feedback >Date: Thu, 18 Mar 1999 6:04 AM > >Hi, > >I thought maybe I could do this with GUI, but I don't think so. I would >like a way to display in real time feedback about what is going on (beyond >the scope which shows the wave). I teach a class where it is important for >them to know what the values are behind the sounds they hear. I set up >demonstration patches with MouseX and Y controlling some parameter, but it >would be nice if they could also see the exact value in a window (for, say, >control frequency, or amplitude of a AM patch). Any way of doing this? > >-- >><><><><><><><><><><><> >David Cottle >composition, notation, contra >lime@uiuc.edu > ------------------------------ Date: Thu, 18 Mar 1999 09:17:44 -0500 From: Mark Ballora <---@---.---> Subject: Re: Feedback >Hi, > >I thought maybe I could do this with GUI, but I don't think so. I would >like a way to display in real time feedback about what is going on (beyond >the scope which shows the wave). I teach a class where it is important for >them to know what the values are behind the sounds they hear. I set up >demonstration patches with MouseX and Y controlling some parameter, but it >would be nice if they could also see the exact value in a window (for, say, >control frequency, or amplitude of a AM patch). Any way of doing this? > >-- >><><><><><><><><><><><> >David Cottle >composition, notation, contra >lime@uiuc.edu When I want to display values, I make a GUI so I can see what I'm doing. Here are two little examples. To verify that certain formants could simulate certain vowels, I used the following. ( var w, freq, freqdisp, cf1, cf1disp, bw1, bw1disp, cf2, cf2disp, bw2, bw2disp, cf3, cf3disp, bw3, bw3disp, nharm, nharmdisp; w = GUIWindow.new("Blip + Resonz", Rect.newBy( 8, 44, 628, 215 )); freq=SliderView.new( w, Rect.newBy( 27, 31, 16, 134 ), "SliderView", 50, 20, 500, 0, 'linear'); freqdisp=NumericalView.new( w, Rect.newBy( 8, 170, 64, 20 ), "NumericalView", 50, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 17, 7, 34, 21 ), "freq"); cf1=SliderView.new( w, Rect.newBy( 125, 30, 16, 134 ), "SliderView", 100, 20, 10000, 0, 'linear'); cf1disp=NumericalView.new( w, Rect.newBy( 106, 169, 64, 20 ), "NumericalView", 100, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 118, 7, 28, 20 ), "cf1"); bw1=SliderView.new( w, Rect.newBy( 193, 30, 16, 134 ), "SliderView", 0.2, 0.001, 1, 0, 'linear'); bw1disp=NumericalView.new( w, Rect.newBy( 174, 169, 64, 20 ), "NumericalView", 0.2, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 186, 8, 28, 19 ), "bw1"); cf2=SliderView.new( w, Rect.newBy( 288, 30, 16, 134 ), "SliderView", 500, 20, 10000, 0, 'linear'); cf2disp=NumericalView.new( w, Rect.newBy( 269, 169, 64, 20 ), "NumericalView", 500, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 281, 7, 29, 20 ), "cf2"); bw2=SliderView.new( w, Rect.newBy( 357, 30, 16, 134 ), "SliderView", 0.2, 0.001, 1, 0, 'linear'); bw2disp=NumericalView.new( w, Rect.newBy( 338, 169, 64, 20 ), "NumericalView", 0.2, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 350, 6, 28, 21 ), "bw2"); cf3=SliderView.new( w, Rect.newBy( 449, 30, 16, 134 ), "SliderView", 1000, 20, 10000, 0, 'linear'); cf3disp=NumericalView.new( w, Rect.newBy( 430, 169, 64, 20 ), "NumericalView", 1000, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 442, 6, 30, 21 ), "cf3"); bw3=SliderView.new( w, Rect.newBy( 517, 30, 16, 134 ), "SliderView", 0.2, 0.001, 1, 0, 'linear'); bw3disp=NumericalView.new( w, Rect.newBy( 498, 169, 64, 20 ), "NumericalView", 0.2, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 509, 7, 29, 18 ), "bw3"); nharm=SliderView.new( w, Rect.newBy( 585, 30, 16, 134 ), "SliderView", 50, 20, 400, 0, 'linear'); nharmdisp=NumericalView.new( w, Rect.newBy( 573, 169, 39, 20 ), "NumericalView", 50, -1e+10, 1e+10, 0, 'linear'); StringView.new( w, Rect.newBy( 577, 7, 29, 18 ), "#harm"); freq.action = { freqdisp.value = freq.value }; freqdisp.action = { freq.value = freqdisp.value }; cf1.action = { cf1disp.value = cf1.value }; cf1disp.action = { cf1.value = cf1disp.value }; bw1.action = { bw1disp.value = bw1.value }; bw1disp.action = { bw1disp.value = bw1.value }; cf2.action = { cf2disp.value = cf2.value }; cf2disp.action = { cf2.value = cf2disp.value }; bw2.action = { bw2disp.value = bw2.value }; bw2disp.action = { bw2disp.value = bw2.value }; cf3.action = { cf3disp.value = cf3.value }; cf3disp.action = { cf3.value = cf3disp.value }; bw3.action = { bw3disp.value = bw3.value }; bw3disp.action = { bw3disp.value = bw3.value }; nharm.action = { nharmdisp.value = nharm.value }; nharmdisp.action = { nharm.value = nharmdisp.value }; Synth.play({ n=100; m=3; f=Blip.ar(freq.kr, nharm.kr); Mix.ar(Resonz.ar(f, [cf1.kr, cf2.kr, cf3.kr], [bw1.kr, bw2.kr, bw3.kr], 0.5)); }); w.close; ) You could easily display any value you want, from any ControlIn source. If you don't want to display the exact value from the controller, but a multiple of it, create a variable which is a function consisting of your controller and the number you're multiplying it by. ( { var w, slider, number, text, multiple, divisor; w = GUIWindow.new("panel", Rect.newBy( 183, 93, 323, 90 )); number = NumericalView.new( w, Rect.newBy( 84, 23, 64, 20 ), "NumericalView", 0, 0, 100, 0.001, 'linear'); slider=SliderView.new( w, Rect.newBy( 156, 24, 128, 20 ), "SliderView", 0, 1, 10, 0.001, 'linear'); multiple = { slider.value * 0.016 }; divisor = { number.value * 62.5 }; number.action = { slider.value = divisor.value }; slider.action = { number.value = multiple.value }; }.value; ) I hope that helps. Mark Ballora ------------------------------ Date: Thu, 18 Mar 1999 08:20:31 -0600 From: James McCartney <---@---.---> Subject: Re: Feedback At 11:04 PM -0600 3/17/99, David Cottle wrote: >Hi, > >I thought maybe I could do this with GUI, but I don't think so. I would >like a way to display in real time feedback about what is going on (beyond >the scope which shows the wave). I teach a class where it is important for >them to know what the values are behind the sounds they hear. I set up >demonstration patches with MouseX and Y controlling some parameter, but it >would be nice if they could also see the exact value in a window (for, say, >control frequency, or amplitude of a AM patch). Any way of doing this? > ( var w; w = GUIWindow.new("panel", Rect.newBy( 128, 64, 260, 90 )); NumericalView.new( w, Rect.newBy( 10, 16, 64, 20 ), "NumericalView", 563.032, -1e+10, 1e+10, 0.001, 'linear'); NumericalView.new( w, Rect.newBy( 10, 40, 64, 20 ), "NumericalView", 0.4, -1e+10, 1e+10, 0.001, 'linear'); SliderView.new( w, Rect.newBy( 78, 16, 57, 20 ), "SliderView", 80, 80, 4000, 0, 'exponential'); SliderView.new( w, Rect.newBy( 78, 40, 57, 20 ), "SliderView", 0, 0, 0.4, 0, 'linear'); StringView.new( w, Rect.newBy( 142, 16, 128, 20 ), "Frequency"); StringView.new( w, Rect.newBy( 142, 40, 128, 20 ), "Amplitude"); Synth.play({ arg synth; var freq, amp; freq = MouseX.kr(80, 4000, 'exponential'); amp = SinOsc.ar(MouseY.kr(0.1, 10, 'exponential'), 0, 0.2, 0.2); synth.trepeat(0, 0.04, { w.at(0).value = freq.poll; w.at(2).value = freq.poll; w.at(1).value = amp.poll; w.at(3).value = amp.poll; }); SinOsc.ar(freq, 0, amp); }); w.close; ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Thu, 18 Mar 1999 20:39:57 -0500 From: rkuivila@mail.wesleyan.edu Subject: DiskIn.ar Hi James, I am trying to do the same trick with DiskIn as with DiskOut and it is not working. The basic idea is to open the file when SoundManager launches (i.e., just before things start executing at interrupt level). However, when I try to invoke DiskIn.ar with the soundFile created by SoundManager, I get an error. The error message indicates that the soundFile is neither unit generator, float or integer. Since the argument is supposed to be a soundfile, I assume it has something to do with running at interrupt level. I tried creating the DiskIn unit generator in SoundManager, but that does not work either - I'm told it does not belong to the synth within which I am trying to run it. Any way around this? RJK ------------------------------ Date: Thu, 18 Mar 1999 20:52:05 -0600 From: James McCartney <---@---.---> Subject: Re: DiskIn.ar At 7:39 PM -0600 3/18/99, rkuivila@mail.wesleyan.edu wrote: >Hi James, > > I am trying to do the same trick with DiskIn as with DiskOut and it is >not working. The basic idea is to open the file when SoundManager launches >(i.e., just before things start executing at interrupt level). However, >when >I try to invoke DiskIn.ar with the soundFile created by SoundManager, I get >an error. The error message indicates that the soundFile is neither unit >generator, float or integer. Since the argument is supposed to be a >soundfile, I assume it has something to do with running at interrupt level. > > I tried creating the DiskIn unit generator in SoundManager, but that does >not work either - I'm told it does not belong to the synth within which I >am trying to run it. > > Any way around this? I'd have to see your code. The following works OK : ( // MouseX right of middle of screen un-pauses sound file playback. var file; file = SoundFile.new; if ( file.readHeader(":Sounds:floating_1") // read the file's header and: { file.preloadData; }, // preload the data { // read was successful file.sustainLoopStart = 0; file.sustainLoopEnd = file.numFrames; Synth.scope({ Pause.ar({ DiskIn.ar(file, true) }, MouseX.kr > 0.5) * 0.4 }, 0.5); }); ) --- 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 Mar 1999 22:11:15 -0600 From: James McCartney <---@---.---> Subject: [FWD] Re: Tutorial >From: Alberto de Campo <---@---.---> >Subject: Re: Tutorial >Current version of tutorial 0.8.5 is still under construction; that will also >go to the publisher for a book proposal. I am still interested in >giving out copies to beta-tester who will actually write back. >(Hint, hint.) >Sorry I can't participate in the list for some more time, I will as soon as >time (and my infrastructure here in Austria) allows. > >Best regards, >Alberto ------------------------------ Date: Sun, 21 Mar 1999 18:35:00 -0500 From: rkuivila@mail.wesleyan.edu Subject: Re: DiskIn.ar Hi James, It turned out that things broke when the unitgenerator graph was mono. Putting such graphs in a list before passing them to DiskIn fixed the problem. Since the whole issue is buried inside of SoundManager, I just shipped the code off to Iannis. Another problem arose - if a file already exists the combination of SoundFile.writeHeader, SoundFile.doRecording and SoundFile.endRecord do not alter the file header, so the file gets stuck as either mono or stereo. Right now, I just append the number of channels to the end of the filename to differentiate. RJK ------------------------------ Date: Sun, 21 Mar 1999 18:22:42 -0600 From: James McCartney <---@---.---> Subject: Re: insects under midi control >From: Graeme Gerrard <---@---.---> >To: "Supercollider" >Mime-Version: 1.0 >Content-Type: text/plain; charset="US-ASCII" > >Could someone point out what I am doing wrong here. >The no of ugens just keeps building up and up >until it, somewhat ungracefully, blows the machine. > >TIA. > >( >// insects under midi control > > >var n, env, x1, x2,x3,x4, m1,m2,m3,m4, f1, tapDurs, tapAmps, mix, z1, c1, >c2, input ; >n = 5; // number of simultaneous events >tapDurs = [0.0043, 0.0215, 0.0268, 0.0298, 0.0485, 0.0572, 0.0595, >0.0708, 0.0741, 0.0797]; >tapAmps = [0.841, 0.504, 0.379, 0.346, 0.272, 0.192, 0.217, 0.181, 0.142, >0.134]; >mix = 0.5; > >env = Env.linen(2, 3, 2, 0.02); > >play({ > f1 = MIDIController.kr(5,7,100,4000,'linear'); > m1 = MIDIController.kr(1,7,0,1.0,'linear'); > mix = MIDIController.kr(6,7,0.0,1.0,'linear'); > > > Spawn.ar({ > // gen basic sig, chan 5 controls freq range > x1 = FSinOsc.ar(f1+8000.0.rand, > EnvGen.kr(env,1.0, 0, 1.0, 0, timeScale: >0.8+6.0.linrand)).amclip(SinOsc.ar(8+80.0.linrand)); > > // x fade between sig and lf pulsed version, chan 1 controls mix > x1 = ((1.0-m1) * x1) + ( m1 * x1.amclip(SinOsc.ar(0.01+8.0.linrand))); > > // chan 6 controls mix of delayed and dry sig > z1 = MultiTap.ar(`tapDurs,`tapAmps, x1 * 0.1); > c1 = CombA.ar( z1, 0.05, 0.05, 0.46); > //c2 = CombA.ar( z1, 0.068, 0.068, 0.52); > [z1 + (x1 * mix), c1 + (x1 * mix)]; > > }, 2, 9); > >})) > > > >--------------- >Graeme Gerrard >Resonant Multimedia >"Somebody's been putting something in my food to make me paranoid." - PKD In order for a voice to be deallocated it must have a finite duration. In order to have a finite duration it must be multiplied by something with a finite duration such as an EnvGen. You do have an EnvGen, but you are putting that signal through a Comb which has an infinite impulse response, hence an infinite duration, so the finite duration of the EnvGen is lost. Therefore you need to multiply another EnvGen with the output. This could be an envelope that remains 1 until some time at which point it cuts off. // sustain 9 seconds, then cut off in 10 msec cutoff = Env.new([1,1,0],[9,0.01]); .... [z1 + (x1 * mix), c1 + (x1 * mix)] * EnvGen.kr(cutoff)); Other notes: CombA is not really necessary here, I think. CombA is more for doing very short tuned combs. For echo and reverb CombN will usually suffice. (x1 * mix) could be calculated separately in a variable rather than done twice. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sun, 21 Mar 1999 22:28:37 -0600 From: James McCartney <---@---.---> Subject: Re: insects under midi control I should also point out that you probably should restructure your code by moving the delays out of the Spawn. You are running everything through the same effects chain, so there is really no reason to keep spawning that effects chain. ( // insects under midi control var n, env, x1, x2,x3,x4, m1,m2,m3,m4, f1, tapDurs, tapAmps, mix, z1, c1, c2, input, ss; n = 5; // number of simultaneous events tapDurs = [0.0043, 0.0215, 0.0268, 0.0298, 0.0485, 0.0572, 0.0595, 0.0708, 0.0741, 0.0797]; tapAmps = [0.841, 0.504, 0.379, 0.346, 0.272, 0.192, 0.217, 0.181, 0.142, 0.134]; mix = 0.5; env = Env.linen(2, 3, 2, 0.1); play({ f1 = MIDIController.kr(5,7,100,4000,'linear'); // I changed the code below to use LinXFade2, so // this controller needs to go from -1.0 to +1.0 m1 = MIDIController.kr(1,7,-1.0,1.0,'linear'); mix = MIDIController.kr(6,7, 0.0,1.0,'linear'); ss = Spawn.ar({ // gen basic sig, chan 5 controls freq range x1 = FSinOsc.ar(f1+8000.0.rand, EnvGen.kr(env,1.0, 0, 1.0, 0, timeScale: 0.8+6.0.linrand)).amclip(SinOsc.ar(8+80.0.linrand)); // x fade between sig and lf pulsed version, chan 1 controls mix LinXFade2.ar(x1, x1.amclip(SinOsc.ar(0.01+8.0.linrand)), m1); }, 1, 4); // chan 6 controls mix of delayed and dry sig z1 = MultiTap.ar(`tapDurs,`tapAmps, ss * 0.1); c1 = CombA.ar( z1, 0.05, 0.05, 0.46); [z1, c1] + (ss * mix); }) ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Mon, 22 Mar 1999 09:58:18 +0000 From: "Iannis Zannos" <---@---.---> Subject: Re: DiskIn.ar Hi, although I mentioned being short of time at the moment, I promise to look into this specific problem ASAP, within the next days after receiving the related code from James (in conjunction to Ron's mails.) The rest will have to wait for April. OK? All the best, Iannis Zannos SIM Tiergartenstr. 1, D-10785 Berlin, Germany Fax: +49 30 25481172 - ---------- >From: rkuivila@mail.wesleyan.edu >To: sc-users@lists.io.com >Subject: Re: DiskIn.ar >Date: Sun, 21 Mar 1999 11:35 PM > >Hi James, > > It turned out that things broke when the unitgenerator graph was mono. >Putting such graphs in a list before passing them to DiskIn fixed the >problem. Since the whole issue is buried inside of SoundManager, I just >shipped the code off to Iannis. > > Another problem arose - if a file already exists the combination of >SoundFile.writeHeader, SoundFile.doRecording and SoundFile.endRecord do not >alter the file header, so the file gets stuck as either mono or stereo. > Right now, I just append the number of channels to the end of the >filename to differentiate. > >RJK > > > > > ------------------------------ Date: Tue, 23 Mar 1999 04:20:43 -0600 From: antiorp@tezcat.com (=cw4t7abs) Subject: ||||||||||||||| |||||||||||| |||||||||||||||||| |||||||||||||||||| |||||||||||||||! | m 9n dxm ak c . m 3 d! a . su g 3r . | ||||||||||||://|||||||||||||||||||||||||||||||||||||||||||||||||||.||||| ||| 5. ||||||||| ||||||||||||: * |||||||||||||||||||||||| |||||||||||||||||| |||||||||||||||||||||||| * |||||||||||||||||| ||||||| mak!ntosh - http://www.m9ndfukc.org/kode/mmf0+99.sit.bin !mak!ntosh - http://www.m9ndfukc.org/korporat/kode censuur pr!ma_method!ek - - - - - - 0+99. 0+1zt ut!l!zat!on ov !nternet data mattr !n p!ano konzert 4 4 handz + !nternet dokument + 1 m9nd kpnta!nr nr.0+2 aLpha ztate + zekuent!al zmakc rput!n human.m9ndkonta!nr.onerror=null; hm | | m | | | | | b | | | | | | | | | | | sd | | | | | | | | metr!k d!agram ov tcha!kovzk!z s!mph nr 2 2nd mov m | | | | | b | | | | | | | | | | | sd | | | | | | | | | | | | | | | | | | | | | metr!k d!agram ov bartokx dansz !n bulgar!an r!thm nr 6 |||||||||||||||||||||? | | + ||||||||| |||||||||||| |||||||||||| |||||| |||||||||||| |||||| ||||||||| |||||||||||||||||| |||||| |||||||||||||||? | | ||||||||||||||| |||||||||||||||||||||||||||||| ||||||||| ||||||||| ||||||||||||||| |||||||||||| |||||||||||||||||| |||||||||||||||||| |||||||||||||||! | m 9n dxm ak c . m 3 d! a . su g 3r . | ||||||||||||://|||||||||||||||||||||||||||||||||||||||||||||||||||.||||||||| 5. ||||||||| ||||||||||||: * |||||||||||||||||||||||| |||||||||||||||||| |||||||||||||||||||||||| * |||||||||||||||||| |||||||||||||||||| ||||||||||||||| * ||||||||||||||||||||||||||| |||||||||||||||||| |||||||||||| ||||||||||||||||||||| abr!dged metr!k d!agram ov =cw4t7abs p!ano konzert 4 4 handz + 1 m9nd kpnta!nr nr.0+2 aLpha ztate + zekuent!al zmakc rput!n \\- 0+1 arzenl ov human !ntell!gensz : 0+1 kompend!u\m ov human !llnesz faktor ma!. not ut!l!ze w!thout pr!or oral konzent. \\ f3.m2zk!n3nkunzt. \ humanzsukc++ + - f3.mazk!n3nkunzt.m9ndfukc macht fre!. + . d u b ! z t e s . d u b ! z t e s . ------------------------------ End of sc-users-digest V1 #32 *****************************