From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #6 Reply-To: sc-users Sender: owner-sc-users-digest@lists.io.com Errors-To: owner-sc-users-digest@lists.io.com Precedence: bulk sc-users-digest Thursday, September 3 1998 Volume 01 : Number 006 ---------------------------------------------------------------------- Date: Mon, 24 Aug 1998 16:05:06 +0200 (MET DST) From: Dirk Haubrich <---@---.---> Subject: writing to a global variable Hi there, with the following program I was trying to write from two different controlers into the same global variable 'data' . the questions: 1) how to do this? 2) how can I send the values of the MIDIControler to the NumericalView ? 3) how is it possible, to 'postln' into a different window than the one I am editing ? 4) how can I schedul this printing process ? /////////////////////////////////////////// ( var midislider, w, data; { w = GUIWindow.new("panel", Rect.new( 367, 104, 787, 308 )); NumericalView.new( w, Rect.new( 28, 31, 92, 51 ), "NumericalView", 0, 0, 20000, 1, 'linear'); SliderView.new( w, Rect.new( 107, 31, 235, 51 ), "SliderView", 200, 200, 1001, 1, 'linear'); StringView.new( w, Rect.new( 253, 31, 381, 51 ), "slider 1"); NumericalView.new( w, Rect.new( 28, 55, 92, 75 ), "NumericalView", 0, 0, 20000, 1, 'linear'); w.at(1).action = { w.at(0).value = w.at(1).value}; }.value; data = w.at(1).value ; { midislider = MIDIController.kr(1,1,200,1000,'exponential'); data = midislider; }.value; Synth.play(SinOsc.ar(data, 0, 0.1)) ) /////////////////////////////////////////// thank you, dirk ------------------------------ Date: Mon, 24 Aug 1998 09:30:18 -0700 From: James McCartney <---@---.---> Subject: Re: Blocks vs. Closures returned by methods, for Spawn At 2:38 AM -0700 8/24/98, Iannis Zannos wrote: >A rather subtle point, but potentially a cause of frustration: > >The syntax ^{ /* anything ... */ } inside a method will return >an instance of Block, not an instance of Closure. But you can >return a Closure from a method by assigning it to a variable and >then returning the variable: > >var closure; >closure = { /* anything ... */ }; >^closure; > >This can be confusing when creating classes that will return ugen-graph >generating closures to be used by other spawns. (To my understanding >this is a fundamental technique for constructing event structures). >The following code demonstrates an analysis of the situation and >a solution. > >Question: Is there a reason for this behavior of { } syntax inside Class >method definition code? The reason is that it is a bug! Thanks. I'll fix that. > >Suggestion: Perhaps the differences of Blocks and Closures should be >explained in the doc? A Block is a function without a context. It is just a container for the declarations and byte code of the function. A Closure has a pointer to a Block and its run time defining Frame. Eventually there will be docs on all classes. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ftp://www.audiosynth.com//pub/updates/SC2d22.sea.hqx ------------------------------ Date: Mon, 24 Aug 1998 18:50:54 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: writing to a global variable Try first binding your slider to a midi controller via mapToController(); * (Tip: select "mapToController" and type command-Y to get the arguments, look at file gui examples) The slider should be controllable by mouse and MIDI at the same time. >2) how can I send the values of the MIDIControler to the NumericalView ? Via setting the sliderviews action to write to the NumericalView. >3) how is it possible, to 'postln' into a different window than the one I >am editing ? I have tried this and I think it is not possible. We will have to wait for James >4) how can I schedul this printing process ? Use task in Synth. see example file z analog variant >Hi there, > >with the following program I was trying to write from two different >controlers into >the same global variable 'data' . >the questions: >1) how to do this? >2) how can I send the values of the MIDIControler to the NumericalView ? >3) how is it possible, to 'postln' into a different window than the one I >am editing ? >4) how can I schedul this printing process ? > >/////////////////////////////////////////// > >( >var midislider, w, data; > >{ > w = GUIWindow.new("panel", Rect.new( 367, 104, 787, 308 )); > NumericalView.new( w, Rect.new( 28, 31, 92, 51 ), "NumericalView", >0, 0, 20000, 1, 'linear'); > SliderView.new( w, Rect.new( 107, 31, 235, 51 ), "SliderView", >200, 200, 1001, 1, 'linear'); > StringView.new( w, Rect.new( 253, 31, 381, 51 ), "slider 1"); > NumericalView.new( w, Rect.new( 28, 55, 92, 75 ), "NumericalView", >0, 0, 20000, 1, 'linear'); > w.at(1).action = { w.at(0).value = w.at(1).value}; >}.value; > > >Synth.play(SinOsc.ar(data, 0, 0.1)) >) > >/////////////////////////////////////////// > >thank you, > >dirk > > > ------------------------------ Date: Mon, 24 Aug 1998 19:17:07 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: writing to a global variable >3) how is it possible, to 'postln' into a different window than the one I >am editing ? > >thank you, > >dirk > Correction: SC will post to whatever edit window was last active when Synth was started. If you start Synth from the menu instead by enter key then you may get a situation which is more satisfying to you. Although having something like a regular printout/history window to post messages to may be handy. Iannis Zannos ------------------------------ Date: Thu, 27 Aug 1998 14:35:55 -0700 From: James McCartney <---@---.---> Subject: Re: No subclasses to Array possible? The proper use of Array::add and Array::addAll are to always take the result of the operation. z = y.add(x); z may or may not be the same object as y. y may or may not be changed. You are not supposed to assume that the argument is changed by the operation or not. You are not suppose to assume that the result is the same object as the argument. They are 'destructive' in that you should not further use the receiver to the method, but that does not mean that the receiver actually has been modified. The reason for this in Arrays is that they are fixed size objects and cannot grow, but may have *some* extra space. If add can use some extra space then it will return the same object. Otherwise it returns a new object. However you should not rely on this and alway use only the result. If you want operations that always modify the object you need to use a List. In SC1 everything was a List. In SC2 Arrays are used more often because they are more efficient for most common circumstances since they require one less indirection. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ftp://www.audiosynth.com//pub/updates/SC2d22.sea.hqx ------------------------------ Date: Thu, 27 Aug 1998 22:51:18 +0100 From: finer@easynet.co.uk Subject: Various Sorry if some of these questions have been answered in the last couple of weeks but at the moment I'm in a region where it's a bit tricky to find a phoneline. 1. Is there an equivalent to GetAudioFromUser for loading soundfiles ? I've tried to load SD2 & AIFF files into a GUI signal view, from the file menu, but nothing seems to happen. I've also had no luck in displaying a soundfile already loaded - as in the soundfile examples. 2. Is it possible (or will it be) to set loop points by selecting in the signal view window ? 3. Is there an equivalent to 'now' from SC1 ? - is it time as described under Status in Synth help - I've tried to use it but had no luck, both as Synth.time and as time. 4. Is there/will there be a function to specifically granulate a soundfile (like Acpgrain in SC1 for example) or does one use Samp ? 5.This is a simple patch to record and playback : // record & play var e, e2, w, box1, box2, ping, pong, signal; w = GUIWindow.new("panel", Rect.new( 1, 61, 279, 151 )); box1 = CheckBoxView.new( w, Rect.new( 18, 15, 146, 35 ), "record", 0, 0, 1, 0, 'linear'); box2 = CheckBoxView.new( w, Rect.new( 18, 39, 146, 59 ), "play", 0, 0, 1, 0, 'linear'); e = Env.new([1,1,1],[0.15, 0.85]); e2 = Env.new([0,0,0],[0.5,0.5]); signal = Signal.newClear(44100); ping = {var input; input = AudioIn.ar([0,1]); EnvGen.ar(e2,Record.ar(signal,input)); }; pong = { arg dur = 1, amp = 0.8; EnvGen.ar(e, Samp.ar(signal, Synth.sampleRate, 1, 0, 0, signal.size-2), 0, amp, 0, dur);}; Synth.scope( Spawn.ar({ if ( box1.value > 0, { ping.value; }); // otherwise if returns nil }, 1, 1) + Spawn.ar({ if ( box2.value > 0, { pong.value; }); }, 1,1) , 1) The envelope for the record part - e2 - has all levels set to 0 so as not to hear the sound being recorded. The downside is that one then can't see the incoming signal and adjust levels. Is there a better way of writing such a program. 6. If I run : Synth.write(FSinOsc.ar(75),4,":Sounds:testSine"); I get a 390k file - opens and plays in SoundHack no problem, 4 seconds long. If I then change the name to testSine2 and run it again I get a file 260k long which lasts a bit over 2 seconds in SoundHack. What's going on here ! Thanks Jem Finer Kentish Town London NW5 finer@easynet.co.uk 44 171 267 6416 ------------------------------ Date: Thu, 27 Aug 1998 16:30:48 -0700 From: James McCartney <---@---.---> Subject: Re: Various At 2:51 PM -0700 8/27/98, finer@easynet.co.uk wrote: >Sorry if some of these questions have been answered in the last couple of >weeks but at the moment I'm in a region where it's a bit tricky to find a >phoneline. > >1. Is there an equivalent to GetAudioFromUser for loading soundfiles ? > I've tried to load SD2 & AIFF files into a GUI signal view, from the >file menu, > but nothing seems to happen. not yet. > I've also had no luck in displaying a soundfile already loaded - as in >the soundfile examples. I don't understand this part. What are you doing different from the example? > >2. Is it possible (or will it be) to set loop points by selecting in the >signal view window ? You can get/set the selection from the view via 'selectionStart' and 'selectionEnd'. you can then use these to set the loop points in the SoundFile. (Note that a SignalView holds a Signal which is not the same as a SoundFile. The SignalView doesn't know what SoundFile its Signal may be from, if any.) > >3. Is there an equivalent to 'now' from SC1 ? - is it time as described >under Status in Synth help - I've tried to use it but had no luck, both as >Synth.time and as time. No there is no 'now'. It is always now. It will be 'then' at some offset from now. OK, I'm partly kidding. What do you need to do? You control the next thing by setting 'nextTime'. Unlike in version 1 audio streams are slightly out of sync during computation due to multiple block sizes and single sample accurate start times. So there is no single globally valid time reference. >4. Is there/will there be a function to specifically granulate a soundfile >(like Acpgrain in SC1 for example) > or does one use Samp ? There will be. However it is not really necessary to do granulation. Write a patch for a single grain with Samp (soon to be renamed PlayBuf) and Spawn it. >The envelope for the record part - e2 - has all levels set to 0 so as not >to hear the sound >being recorded. The downside is that one then can't see the incoming signal >and adjust levels. >Is there a better way of writing such a program. Synth.scope is a wrapper for putting the Scope ugen at the outputs. However you can put Scope anywhere in the signal path. There will be a bit more on this in the new help files. > >6. If I run : > > Synth.write(FSinOsc.ar(75),4,":Sounds:testSine"); > > I get a 390k file - opens and plays in SoundHack no problem, 4 seconds >long. > If I then change the name to testSine2 and run it again I get a file 260k >long which lasts a bit over 2 > seconds in SoundHack. > What's going on here ! Some bugs with writing files have been fixed in the next version. Perhaps this is the problem. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ftp://www.audiosynth.com//pub/updates/SC2d22.sea.hqx ------------------------------ Date: Fri, 28 Aug 1998 09:33:02 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: Various - ---------- >From: James McCartney <---@---.---> >Date: Fri, 28 Aug 1998 1:30 AM > >At 2:51 PM -0700 8/27/98, finer@easynet.co.uk wrote: >>The envelope for the record part - e2 - has all levels set to 0 so as not >>to hear the sound >>being recorded. The downside is that one then can't see the incoming signal >>and adjust levels. >>Is there a better way of writing such a program. > >Synth.scope is a wrapper for putting the Scope ugen at the outputs. >However you can put Scope anywhere in the signal path. There will be >a bit more on this in the new help files. > The example below shows how to integrate both signal views and FFT - signal views in your code. Just a variation of Synth.scope and the FFT examples. Perhaps it helps. By the way: James I did not succeed in popping up the FFT window at a different position from the (time-domain) scope window so you have to drag them apart manually when using method scope2 below. Would it make sense to put a rect handle in Scope.window for popping up the window in the desired place? Its on my agenda, along with providing print out of the time scale at the bottom of the window. But rather low down the priority list. Best regards, Iannis ==================================================================== /* A wrapper for testing single sounds, based on Spawn and Synth. To just listen: .ar, to see signal: .scope, to see spectrum: .spect, to see both spectrum and signal: scope2. Note: have not figured out yet how to move the overlapping scope and spectrum windows to more convenient positions, so you have to drag them with the mouse... The sounds must be UGen graph generating functions such as those used in Spawn. Examples: ( var popsine; popsine = { arg sp, c; FSinOsc.ar((c % 36) + 4 * 100, Line.kr(0.2, 0, 0.2)) }; Play.scope2(popsine, 0.2); ) Or: ( Play.scope2( { arg sp, c; FSinOsc.ar((c % 50) + 4 * (50 + (c / 16).ceil), Line.kr(0.1, 0, 0.1)) }, 0.05); ) */ Play { *ar { arg ev, pulse = 1, chan = 1; Synth.play( Spawn.ar(ev, chan, pulse)) } *scope { arg ev, pulse = 1, chan = 1; Synth.scope( Spawn.ar(ev, chan, pulse)) } *spect { arg ev, pulse = 1, fftsize = 1024; var window, cosineTable, src, fft, scope; window = Signal.welchWindow(fftsize); cosineTable = Signal.fftCosTable(fftsize); src = Spawn.ar(ev, 1, pulse); fft = FFT.ar(fftsize, 0, cosineTable, window, nil, src, 0.0); scope = Scope.window("FFT", fftsize, fft.magnitudeApx); Synth.play(src Subject: Posting messages at compile time Is it possible to post messages to the active window at class-compile time? The reason is that when you have an open comment in the code by mistake ( /* ), the compiler will not tell you which file it was in. This means you have to search all files to find the mistake. (lucky if you have any multi-file searching tools) Example: compiling class library.. Open ended comment ... started on line 2 pass 1 done Method Table Size 512708 bytes Number of Method Selectors 987 Number of Classes 592 Number of Symbols 2572 Byte Code Size 27075 pass 2 done startUp Therefore suggest making the compiler print out the file where the open comment occurred in. Allowing user-definable compile-time messages in the class definition code or files is perhaps a decorative point - now. But I think it will prove quite useful once users start making modules comprising many classes. Then it will be good to keep track which modules or classes are being loaded. (Thought I would keep this moment for later, but then the example above prompted it). Best regards, Iannis Zannos SIM Berlin - DE ------------------------------ Date: Fri, 28 Aug 1998 12:32:06 +0200 From: "Iannis Zannos" <---@---.---> Subject: Subclassing List vs. Array. (Was: Re: No subclasses to Array possible?) - ---------- >From: James McCartney <---@---.---> >Date: Thu, 27 Aug 1998 11:35 PM >> >The proper use of Array::add and Array::addAll are to always take the >result of the operation. >If you want operations that always modify the object you need to use a >List. In SC1 everything was a List. In SC2 Arrays are used more often >because they are more efficient for most common circumstances since they >require one less indirection. Thanks for the information. I see now from the code that List uses a variable which contains the actual elements of the list. Remark: This means, if one subclasses List, then one can control at which level one performs the accessing or restructuring operations, provided one is sure (and clear) about the circumstances of the operations. For example f you want to perform a collect or some other repeated operation on the list, and the code is so that it will not perform a destructive operation, then you can perform it on this.array directly. Thus, subclassing List seems to me recommendable for cases requiring restructuring of the contents, and access overhead can be bypassed selectively and safely. Regards, Iannis ------------------------------ Date: Fri, 28 Aug 1998 12:43:32 +0100 From: finer@easynet.co.uk Subject: Clarification of vague question in "Various" James, Thanks for your swift reply : When I asked about displaying a soundfile in a signal view : >I've also had no luck in displaying a soundfile already loaded - as in >the soundfile examples. I'd a GUI with a signal view window and was trying to display a soundfile in it, as opposed to via Synth.scope, though I'm ashamed to say that I can't remember quite why I wanted to ! Probably to a) see if I could ! b) because I think I may have thought I could set loop points there - but you've told me how to do that now anyway. Re now, you say : >No there is no 'now'. It is always now. It will be 'then' at some >offset from now. OK, I'm partly kidding. What do you need to do? >You control the next thing by setting 'nextTime'. Unlike in version >1 audio streams are slightly out of sync during computation due to >multiple block sizes and single sample accurate start times. >So there is no single globally valid time reference. If there's no now its not a big problem ! Just curious. I've SC2.0d22 - is this still the latest version ? Thanks Jem Finer Kentish Town London NW5 finer@easynet.co.uk 44 171 267 6416 ------------------------------ Date: Fri, 28 Aug 1998 09:31:03 -0700 From: James McCartney <---@---.---> Subject: Re: Clarification of vague question in "Various" At 4:43 AM -0700 8/28/98, finer@easynet.co.uk wrote: >>No there is no 'now'. It is always now. It will be 'then' at some >>offset from now. OK, I'm partly kidding. What do you need to do? >>You control the next thing by setting 'nextTime'. Unlike in version >>1 audio streams are slightly out of sync during computation due to >>multiple block sizes and single sample accurate start times. >>So there is no single globally valid time reference. > >If there's no now its not a big problem ! Just curious. In a later version there will be a 'now' and a 'sched' but they will be per Synth. So you'll do mysynth.now or mysynth.now.sched(when, {...}); But this is not yet in there. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ftp://www.audiosynth.com//pub/updates/SC2d22.sea.hqx ------------------------------ Date: Fri, 28 Aug 1998 09:31:59 -0700 From: James McCartney <---@---.---> Subject: Re: Various At 12:33 AM -0700 8/28/98, Iannis Zannos wrote: >By the way: James I did not succeed in popping up the FFT >window at a different position from the (time-domain) scope window >so you have to drag them apart manually when using method scope2 below. >Would it make sense to put a rect handle in Scope.window for >popping up the window in the desired place? >Its on my agenda, along with providing print out of the time >scale at the bottom of the window. But rather low down the priority list. It has already been done and there is an example of how to use it in the Scope.help file. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ftp://www.audiosynth.com//pub/updates/SC2d22.sea.hqx ------------------------------ Date: Fri, 28 Aug 1998 11:17:47 -0700 From: James McCartney <---@---.---> Subject: Re: Clarification of vague question in "Various" At 9:31 AM -0700 8/28/98, James McCartney wrote: >or mysynth.now.sched(when, {...}); I meant: mysynth.sched(when, {...}); --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ftp://www.audiosynth.com//pub/updates/SC2d22.sea.hqx ------------------------------ Date: Fri, 28 Aug 1998 16:23:35 -0700 From: James McCartney <---@---.---> Subject: SC2d23 available SC2d23 is now at: ftp://www.audiosynth.com//pub/updates/SC2d23.sea.hqx Some of the changes : *** A very important change was made to Synth.new that affects the syntax of ALL examples. All examples have been updated to the new scheme. More on this below. *** DiskIn and DiskOut ugens support streaming audio to/from disk. Synth.record method uses DiskOut to play and write to disk simultaneously. Samp renamed to PlayBuf. There is also a RecordBuf for recording to Signal buffers. There are now help files for all ugens listed in the UGen Ref Sheet. TSpawn ugen - spawns events in response to triggers. *** Synth.new now takes as an argument a function that returns a ugen graph once evaluated, rather than taking a ugen graph itself. For example: Synth.new( FSinOsc.ar(800) ); // old way Synth.new({ FSinOsc.ar(800) }); // new way The reason for this was to eliminate the need to contrive a place in the ugen graph for ugens which are only needed for their side effect, such as DelayWr, Scope, DiskOut. Also the "controls" inputs for Spawn, Voicer and TSpawn are no longer necessary and were removed. A Synth used to have to find all of its ugens by searching backwards from the outputs. Now it can catch them all as they are created within the function. The need for the Subject: Re: Posting messages at compile time At 1:01 AM -0700 8/28/98, Iannis Zannos wrote: >time? The reason is that when you have an open comment in the code >by mistake ( /* ), the compiler will not tell you which file it was in. >This means you have to search all files to find the mistake. > >Example: > >compiling class library.. >Open ended comment ... started on line 2 BTW: this is fixed in SC2d23. Thanks for the bug report. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ftp://www.audiosynth.com//pub/updates/SC2d23.sea.hqx ------------------------------ Date: Sat, 29 Aug 1998 13:30:37 +0100 From: finer@easynet.co.uk Subject: SignalView/SignalWindow confusion I asked : 2. Is it possible (or will it be) to set loop points by selecting in the signal view window ? & you replied: >You can get/set the selection from the view via 'selectionStart' and >'selectionEnd'. you can then use these to set the loop points in >the SoundFile. (Note that a SignalView holds a Signal which is not >the same as a SoundFile. The SignalView doesn't know what SoundFile >its Signal may be from, if any.) So should I convert a SoundFile to a Signal and put it in a SignalView ( this is what I was trying to ask how to do when I said : > I've also had no luck in displaying a soundfile already loaded - as in > the soundfile examples. ) I tried with this patch but just got a blank SignalView : var filename,sound,sample,v,w; filename = ":Sounds:1 seg alt(L) AIFF"; sound = SoundFile.new; sound.read(":Sounds:1 seg alt(L) AIFF"); sample = (sound.data.at(0)); w = GUIWindow.new("panel", Rect.new( 128, 64, 331, 251 )); v = SignalView.new( w, Rect.new( 25, 33, 153, 133 ), sample,-1, 1); Perhaps I should rephrase the question : Is it possible (or will it be) to set loop points by selecting in a SignalView OR a SignalWindow ? Thanks Jem Finer Kentish Town London NW5 finer@easynet.co.uk 44 171 267 6416 ------------------------------ Date: Sat, 29 Aug 1998 08:18:39 -0700 From: James McCartney <---@---.---> Subject: Re: SignalView/SignalWindow confusion At 5:30 AM -0700 8/29/98, finer@easynet.co.uk wrote: >var filename,sound,sample,v,w; >filename = ":Sounds:1 seg alt(L) AIFF"; >sound = SoundFile.new; >sound.read(":Sounds:1 seg alt(L) AIFF"); >sample = (sound.data.at(0)); >w = GUIWindow.new("panel", Rect.new( 128, 64, 331, 251 )); >v = SignalView.new( w, Rect.new( 25, 33, 153, 133 ), sample,-1, 1); You aren't checking whether read actually returns true meaning it read it successfully. If it is returning false then the view will be blank. Also when created, the SignalView has a zoom of 1. You may only be seeing very beginning of the sound. You can zoom the view by selecting it and using the left and right arrow keys. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ftp://www.audiosynth.com//pub/updates/SC2d23.sea.hqx ------------------------------ Date: Sat, 29 Aug 1998 09:23:40 -0700 From: James McCartney <---@---.---> Subject: another SC2d23 release note Spawn event functions are now passed the Synth instance being created. To set the channel offset and block size you now send a message to the synth object, not the spawn object as before. Spawn.ar({ arg spawn, i, synth; synth.blockSize = 24; synth.channelOffset = 2.rand; ... }, ...) Voicer, TSpawn, OrcScore, Cycle, etc, are also similarly changed. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ftp://www.audiosynth.com//pub/updates/SC2d23.sea.hqx ------------------------------ Date: Sun, 30 Aug 1998 02:59:17 +0000 From: arsche@stad.dsl.nl Subject: Re: SC2d23:FFT failure? Dear James, The new SC2d23 doesn't seem to like the convolution- patch from the FFT examples, resulting in a refusal to do anything with the following lines at the bottom ot the patch: • ERROR: input UGen is not part of a Synth. INPUT UGEN: Instance of BinaryOpUGen '/'{ (01700734, gc=00, fmt=00, flg=70, set=05) instance variables [5] synth : nil inputs : instance of Array (017007D4, size=2, set=01) rate : Symbol 'audio' state : Integer 3 operator : Symbol '/' } • ERROR: input 1 to Scope is not a UGen, Float, or Integer. Instance of BinaryOpUGen '/'{ (01700734, gc=00, fmt=00, flg=70, set=05) instance variables [5] synth : nil inputs : instance of Array (017007D4, size=2, set=01) rate : Symbol 'audio' state : Integer 3 operator : Symbol '/' } ) Are you planning supply us with new FFT examples, or should we use for the time being SCd22? Arie van Schutterhoef Schreck Ensemble Holland http://www.xs4all.nl/~schreck/ ------------------------------ Date: Sun, 30 Aug 1998 19:42:57 +0100 From: finer@easynet.co.uk Subject: Disk Out DiskOut works great within SC2 but when I try and open files in other software eg SoundHack, SoundEdit, the files aren't recognised. I've tried AIFF and SD2. Is this just an unfortunate fact or a bug ? Hope it's a bug ! Thanks, Jem Finer Kentish Town London NW5 finer@easynet.co.uk 44 171 267 6416 ------------------------------ Date: Sun, 30 Aug 1998 18:48:53 -0400 From: kbabb@escape.com (Kenneth N Babb) Subject: Re: Disk Out Jem Finer<> wrote: >DiskOut works great within SC2 but when I try and open files in other >software eg SoundHack, SoundEdit, the files aren't recognised. I've tried >AIFF and SD2. Is this just an unfortunate fact or a bug ? > >Hope it's a bug ! > I've experienced a similar problem using the Synth.record method described in DiskOut.Help. SoundHack Open doesn't recognize the file and "Open Any" loads the file as an 8-Bit unsigned file. Playback of this Soundfile in SoundHack results in noise. Peak, SoundEdit etc. will not recognize the file. The same file will playback properly in SC2d23 using SoundFile.play. Using the first Disk recording method described in the DiskOut.Help using DiskOut.ar with with file.endRecord I have successfully recorded to disk, then loaded the resulting soundfile into SoundHack, Peak etc. I did screw it up a couple of times intially because I left out endRecord. After correcting that, it works properly on the patches I've tried so far. Regards, Kenneth Babb ------------------------------ Date: Mon, 31 Aug 1998 10:06:58 +0200 From: "Iannis Zannos" <---@---.---> Subject: Bug in collect method of Stream? Also questions on reject, select etc. Dear James, Is this a bug, or am I doing something wrong?: It seems to me that the collect method of Stream should be corrected as follows: collect { arg inCollectBlock; // modify a stream var nextBlock, resetBlock; nextBlock = { var val; val = this.next; // if ( val.notNil, { ^inCollectBlock.value(val) },{ ^nil }) // JM original code !!! // It causes error "Return out of context" if ( val.notNil, { inCollectBlock.value(val) },{ nil }) // This seems more correct }; resetBlock = { this.reset }; ^BlockStream.new(nextBlock, resetBlock); } // This is the code I tested the method with, var ls, colblk, colstrm; ls = ListStream.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); colblk = { arg val; [val, val * 10] }; colstrm = ls.collect(colblk); colstrm.next.postln; colstrm.next.postln; colstrm.next.postln; colstrm.next.postln; /* result: after modification of the code: [ 1, 10 ] [ 2, 20 ] [ 3, 30 ] [ 4, 40 ] */ ======================================================== I could also not understand the behavior of .reject method as tested by following code: var ls, reblk, colstrm; ls = ListStream.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); reblk = { arg val; (val % 3) == 0 }; colstrm = ls.reject(reblk); colstrm.next.postln; colstrm.next.postln; colstrm.next.postln; colstrm.next.postln; /* Result: 1 2 */ After the encountering 3, the evaluation "gets stuck". That means, I cannot use any of evaluate selection, compile library, run etc. To get unstuck, I type a "user interrupt" with command-. and thereafter execution continues as normal. I would expect this method to behave differently, namely to skip the rejected items, thus producing output: 1, 2, 4, 5 ... I could not find a correction to this code. Same thing applies to select. Perhaps my select and reject blocks are wrong? ===== Furthermore: testing collate, concatenation returned nil as in the following examples. (I think it also did so for interlace - - sorry I did not keep the code but its as straightforward variation of the other examples. var ls1, ls2, bs, cs; ls1 = ListStream.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); ls2 = ListStream.new([10, 20, 30, 40, 50, 60, 70, 80, 90, 100]); bs = ls1 ++ ls2; bs.next.postln; bs.next.postln; bs.next.postln; bs.next.postln; // result: nil(returnchar)nil(returnchar)nil, etc. /* 30.8.1998 9:04 PM Testing collate next returns nil. Why?*/ var ls1, ls2, bs, cs; ls1 = ListStream.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); ls2 = ListStream.new([10, 20, 30, 40, 50, 60, 70, 80, 90, 100]); bs = ls1.collate(ls2); bs.next.postln; bs.next.postln; bs.next.postln; bs.next.postln; // result: nil(returnchar)nil(returnchar)nil, etc. Cheers, Iannis ------------------------------ Date: Mon, 31 Aug 1998 11:17:32 -0500 From: james@clyde.as.utexas.edu (James McCartney) Subject: Re: SC2d23:FFT failure? I am unable to reproduce your problem. All FFT examples work fine for me. Are you sure you are selecting the outer most parentheses ? ------------------------------ Date: Mon, 31 Aug 1998 11:21:44 -0500 From: james@clyde.as.utexas.edu (James McCartney) Subject: Re: Disk Out endRecord seems to be botching the header. Thought I'd fixed it.. ------------------------------ Date: Mon, 31 Aug 1998 22:44:35 +0000 From: arsche@stad.dsl.nl Subject: Re: FFT failure?stupidity supreme OOPS!!! - stupidity supreme - I was using the SC2d22 FFT examples in SC2d23; which proves that you've have made changes and I wasn't paying attention... Sorry about that; ah well, back to work... Arie ------------------------------ Date: Tue, 1 Sep 1998 01:30:06 +0100 From: finer@easynet.co.uk Subject: Bad Computer Day Now here's an odd one . . . . . . having been listening to my computer (PowerBook 3400c) on headphones for a couple of months I was amazed, not to mention dismayed, on plugging it into my mixing desk at the amount of horrible unwanted noise emanating from aforementioned machine. Sounds like the inner workings, hard disk etc - all manner of whirring, rumbling and clicking. Strange thing is that this noise doesn't appear to be in evidence through headphones, nor through domestic stereo, nor do I remember hearing it before . I know Powerbooks have a reputation for a bit of a dirty sound but this is ridiculous, and inconsistent. The only thing I can identify that seems to make matters worse is plugging the cable to my midi interface into the modem/printer port. But why ? Then . . . . a patch that had happily run decided to crash the computer every time I hit enter - without having changed a thing. It kept throwing up the Norton CrashGuard box (unmapped memory exception) which gives the choices to try and fix, restart or quit application - this comes up from time to time while running patches and clicking quit application usually suffices to trick it into carrying on as if nothing ever happened in the first place. Not so in this case though - crashed every time. I did notice an error message at the bottom of the patch saying Synth output not a Ugen. Trying again later it runs fine again, having changed nothing. Just wondering if anyone might be able to shed some light on these gremlins. Cheers, Jem Jem Finer Kentish Town London NW5 finer@easynet.co.uk 44 171 267 6416 ------------------------------ Date: Mon, 31 Aug 1998 19:34:08 -0500 From: james@clyde.as.utexas.edu (James McCartney) Subject: Re: Bad Computer Day My 3400's sound is always bad. The 5300 wqas much quieter. ------------------------------ Date: Tue, 1 Sep 1998 08:35:47 +0100 From: finer@easynet.co.uk Subject: Re: Bad Computer Day >My 3400's sound is always bad. The 5300 wqas much quieter. Lurking at the bottom of the page, below the screen was a further question which you may have missed : a patch that had happily run decided to crash the computer every time I hit enter - without having changed a thing. It kept throwing up the Norton CrashGuard box (unmapped memory exception) which gives the choices to try and fix, restart or quit application - this comes up from time to time while running patches and clicking quit application usually suffices to trick it into carrying on as if nothing ever happened in the first place. Not so in this case though - crashed every time. I did notice an error message at the bottom of the patch saying Synth output not a Ugen. Trying again later it runs fine again, having changed nothing. Any idea what might be going on here ! Jem Jem Finer Kentish Town London NW5 finer@easynet.co.uk 44 171 267 6416 ------------------------------ Date: Tue, 1 Sep 1998 14:16:52 +0200 (MET DST) From: Hans Tutschku <---@---.---> Subject: Re: Bad Computer Day >My 3400's sound is always bad. The 5300 wqas much quieter. I can just confirm the same. Passing from 5300 to 3400 was a real bad surprise. What about the new G3-series. Any experiences? Hans ------------------------------ Date: Tue, 1 Sep 1998 11:58:07 -0500 From: james@clyde.as.utexas.edu (James McCartney) Subject: Re: Bug in collect method of Stream? The correction you made to Stream::collect was the right one. Also the while loop in Stream::select and Stream::reject should be changed from while ( condition, { loop body }); to while ({ condition }, { loop body }); Otherwise it was evaluating the condition once and then doing a while (true.. ------------------------------ Date: Thu, 03 Sep 1998 08:56:43 +0200 From: "Iannis Zannos" <---@---.---> Subject: Click in ImpulseSequencer combined with Noise/Klank (from native algorhythms) The following strange effect occurs always: Examples 1. and 2 are identical except that in 1 the impulse is generated by Impulse.ar while in 2 it is generated by ImpulseSequencer.ar(1, Impulse.ar(1)). But example 2 always produces an obtrusive click at the start of execution while 1 has no such click. ( // 1. Impulse of amplitude 1 Synth.scope({ Klank.ar( `[[ 158, 145, 391, 247, 116, 296, 140, 168, 236, 163 ], nil, Array.fill(10, 3)], Decay.ar(Impulse.ar(1), 1, PinkNoise.ar(4))) }); ) ( // 2. Impulse of amplitude 1 created by ImpulseSequencer of amplitude 1. Synth.scope({ Klank.ar( `[[ 158, 145, 391, 247, 116, 296, 140, 168, 236, 163 ], nil, Array.fill(10, 3)], Decay.ar(ImpulseSequencer.ar (1, Impulse.ar(1)), 1, PinkNoise.ar(4))) }); ) // The effect is also visible: ( Synth.plot({ Klank.ar( `[[ 158, 145, 391, 247, 116, 296, 140, 168, 236, 163 ], nil, Array.fill(10, 3)], Decay.ar(Impulse.ar(1), 1, PinkNoise.ar(4))) }); ) ( Synth.plot({ Klank.ar( `[[ 158, 145, 391, 247, 116, 296, 140, 168, 236, 163 ], nil, Array.fill(10, 3)], Decay.ar(ImpulseSequencer.ar (1, Impulse.ar(1)), 1, PinkNoise.ar(4))) }); ) // the identity of the exchanged components can be confirmed with: Synth.plot( { Impulse.ar(1) }) Synth.plot( { ImpulseSequencer.ar(1, Impulse.ar(1)) }) Note: using a stream does not solve the problem: ( // Trying with a Stream: var a; a = Pseq.new(#[1, 0.5, 0.2, 0.2, 0.9, 0.1, 0.1], nil); play({ Klank.ar( `[[ 158, 145, 391, 247, 116, 296, 140, 168, 236, 163 ], nil, Array.fill(10, 3)], Decay.ar(ImpulseSequencer.ar (a.newValueStream, Impulse.ar(5)), 1, PinkNoise.ar(4))) }); ) (Note: Its fine if one is using type 2 code in a texture enclosed in an envelope, but one may also want to use it without. ) Best regards, Iannis Zannos SIM ------------------------------ End of sc-users-digest V1 #6 ****************************