From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #8 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 17 1998 Volume 01 : Number 008 ---------------------------------------------------------------------- Date: Wed, 16 Sep 1998 11:23:03 +0200 From: "Iannis Zannos" <---@---.---> Subject: Upper value bound in NumericalView works inconsistently? Inconsistent NumericalView bound behavior? Sometimes it may be useful to have a NumericalView that will have only one value, e.g. 0. This is when for example the NumericalView is used to address items in an array - as a convenient way of scrolling though a number of settings stored in an array. Each element of the array is a setting and the window is updated with this setting as one scrolls through integer values of the Numerical Box. When the array has only one element, as is when only the default setting of the window is stored, then only value 0 should be accepted. Yet the code below shows that it is impossible to have this situation. Even though the maximum value bound is set to 0, the numerical view will be set also to value 1 when scrolling it with the mouse. { var w; w = GUIWindow.new("Test", Rect.new( 100, 100, 400, 190 )); NumericalView.new( w, Rect.new( 203, 3, 250, 20 ), 0, 0, 0, 1, 0, 'linear'); }.value Greetings, Iannis Zannos SIM ------------------------------ Date: Wed, 16 Sep 1998 11:30:23 +0200 From: "Iannis Zannos" <---@---.---> Subject: dumpInterface works? / utility methods for Class GUIWindow.dumpInterface gives following error message: GUIWindow.dumpInterface name ( ERROR: Message '>' not understood. RECEIVER: nil ARGS: Instance of Array { (05DE79E4, gc=00, fmt=01, flg=00, set=00) indexed slots [1] 0 : Integer 0 } CALL STACK: FRAME: instance of Method Object : doesNotUnderstand (05C91758) 0 arg this : nil 1 arg selector : Symbol '>' 2 arg args : instance of Array (05DE79E4, size=1, set=00) FRAME: instance of Block (05C97998, size=0, set=03) 0 arg name : nil 1 arg i : nil FRAME: instance of Method Object : do (05C8DCB8) 0 arg this : nil 1 arg func : instance of Closure (05DE79B4, size=0, set=01) FRAME: instance of Block (05C978B8, size=0, set=03) 0 arg meth : instance of Method GUIWindow : name (05DD74B8) 1 var numargs : Integer -1 FRAME: instance of Block (05D1BAF0, size=0, set=03) 0 arg i : Integer 0 ... I made sure to use the original method code. By the way, I added following two utility methods to Class, for perusing the interface and superclasses of a class: // Added by I.Z. 15.9.1998 dumpInterfaceTo { arg endclass; var thisclass; endclass = endclass ? Object; endclass = endclass.superclass; thisclass = this; while ( { thisclass != endclass }, { (thisclass.asString ++ " ========================").postln; thisclass.dumpInterface; thisclass = thisclass.superclass } ) } dumpSuperclasses { var thisclass; thisclass = this; while ({ thisclass != nil }, { thisclass.postln; thisclass = thisclass.superclass } ); } Greetings, Iannis Zannos SIM ------------------------------ Date: Wed, 16 Sep 1998 11:45:57 +0200 From: "Iannis Zannos" <---@---.---> Subject: Generating code to clipboard While waiting for DialogWindow to be documented for working with files, I am trying some workarounds for storing and loading settings, which seem generally useful also for later. For example, it is easy to generate compilable code for numerical (nested) arrays by using .asCompileString. But how to copy this code to the clipboard? I could not find a method to work with. GUIWindow::generateCode contains no further hint either: From the help files: generateCode Generates a String which when executed will recreate the window and its views. The generated code is both returned and stored in a class variable named generatedCode. This method is called by the Generate Code to Clipboard menu item. Iannis Z. ------------------------------ Date: Wed, 16 Sep 1998 13:51:02 +0200 From: "Iannis Zannos" <---@---.---> Subject: Correction: NumericalView bounds work as expected. Following setting will work correctly setting both lowest and upper bound of NumericView to 0. Sorry for the confusion of my previous message, caused by confusion in the order of arguments ... { var w; w = GUIWindow.new("Test", Rect.new( 100, 100, 400, 190 )); NumericalView.new( w, Rect.new( 203, 3, 250, 20 ), 0, 0, 0, 0, 1, 'linear'); }.value ------------------------------ Date: Wed, 16 Sep 1998 07:39:19 -0600 From: James McCartney <---@---.---> Subject: Re: dumpInterface works? / utility methods for Class At 3:30 AM -0600 9/16/98, Iannis Zannos wrote: >GUIWindow.dumpInterface gives following error message: > >GUIWindow.dumpInterface > name ( ERROR: The fix is to change Object 'do' method from : do { arg func; func.value(this) } to : do { arg func; func.value(this, 0) } save Object.sc and then cmd-K to recompile library. --- 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/SC2d24.sea.hqx ------------------------------ Date: Wed, 16 Sep 1998 07:41:03 -0600 From: James McCartney <---@---.---> Subject: Re: Generating code to clipboard At 3:45 AM -0600 9/16/98, Iannis Zannos wrote: >While waiting for DialogWindow to be documented for working with files, >I am trying some workarounds for storing and loading settings, which seem >generally >useful also for later. For example, it is easy to generate >compilable code for numerical (nested) arrays by using >.asCompileString. But how to copy this code to the clipboard? >I could not find a method to work with. GUIWindow::generateCode >contains no further hint either: > >>From the help files: > >generateCode generateCode uses a C primitive to put the code on the clipboard. I can make one for String to put any string on the clipboard. --- 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/SC2d24.sea.hqx ------------------------------ Date: Wed, 16 Sep 1998 15:32:06 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: Generating code to clipboard > >generateCode uses a C primitive to put the code on the clipboard. >I can make one for String to put any string on the clipboard. That would be fine! Please do so. If for example the method is "toClipboard" then one can do something like: ApplicationWindow : GUIWindow { var <>model; ... saveToClipboard { this.values.asCompileString.toClipboard; } ... } to put settings in the clipboard. Is there a method for compiling such a string back to obtain settings? Use: when saving such settings as a human readable file for manual editing. Note: at the moment it will be more practical to paste such settings and edit them to become data in methods of a class, rather than to save them on file, because there seem to be no facilities for choosing pathnames interactively yet. Iannis Zannos SIM ------------------------------ Date: Wed, 16 Sep 1998 09:39:50 -0600 From: James McCartney <---@---.---> Subject: Re: Generating code to clipboard At 7:32 AM -0600 9/16/98, Iannis Zannos wrote: >Is there a method for compiling such a string back to obtain >settings? Use: when saving such settings as a human readable file >for manual editing. Note: at the moment it will be more practical >to paste such settings and edit them to become data in >methods of a class, rather than to save them on file, because >there seem to be no facilities for choosing pathnames >interactively yet. The Interpreter class can do this. You can do the following: // compile the string and return a closure thisProcess.interpreter.compile(mystring); // compile the string and execute thisProcess.interpreter.interpret(mystring); // compile the string and execute printing the result thisProcess.interpreter.interpretPrint(mystring); // compile a file and return a closure thisProcess.interpreter.compileFile(pathName); // compile a file and execute thisProcess.interpreter.executeFile(pathName); 'thisProcess' always returns the instance of the class Main, which is the root object of the virtual machine. 'interpreter' is an instance variable of thisProcess which contains the instance of Interpreter. I could simplify the above and add the following methods to String: compile { thisProcess.interpreter.compile(this); } interpret { thisProcess.interpreter.interpret(this); } interpretPrint { thisProcess.interpreter. interpretPrint(this); } Then you only need to write: mystring.compile; mystring.interpret; mystring.interpretPrint; --- 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/SC2d24.sea.hqx ------------------------------ Date: Wed, 16 Sep 1998 17:01:46 +0200 From: "Iannis Zannos" <---@---.---> Subject: TSpawn vs Spawn argument order Another small point perhaps, but why the difference in the order of arguments: Spawn.ar(newEventFunc, numChannels, nextTime, maxRepeats, mul, add) ^^^^^^^^ TSpawn.ar(newEventFunc, numChannels, maxRepeats, triggerIn, mul, add) ^^^^^^^^^^ Since maxRepeats is not necessarily used less in Spawn than in TSpawn. In fact I do find it cumbersome having to write a nil for every TSpawn, when 99 % of the time I only need the triggerIn condition and I do the checking whether to really spawn or not in that condition (including for example checking whether a maximum number of voices has been allocated). TSpawn is IMO primarily for spawning by condition, while the number of times parameter is an additional - however important - feature. Iannis Zannos SIM ------------------------------ Date: Wed, 16 Sep 1998 18:19:27 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: Generating code to clipboard Thanks very much for this info, it is a valuable insight in the more difficult parts of SC. Process has been always more or less a mystery for me in Smalltalk - and similarly in SC. It is one of the things least documented in both - although I suspect it may be not so difficult to understand once the right examples are given. Looking forwards to the new version with your proposed simplified methods in. Till next, Iannis Zannos SIM - ---------- >From: James McCartney <---@---.---> >Subject: Re: Generating code to clipboard >Date: Wed, 16 Sep 1998 5:39 PM > ..... > >The Interpreter class can do this. You can do the following: > >// compile the string and return a closure >thisProcess.interpreter.compile(mystring); > >// compile the string and execute >thisProcess.interpreter.interpret(mystring); > >// compile the string and execute printing the result >thisProcess.interpreter.interpretPrint(mystring); > >// compile a file and return a closure >thisProcess.interpreter.compileFile(pathName); > >// compile a file and execute >thisProcess.interpreter.executeFile(pathName); > >'thisProcess' always returns the instance of the class Main, which >is the root object of the virtual machine. 'interpreter' is an >instance variable of thisProcess which contains the instance of Interpreter. > >I could simplify the above and add the following methods to String: > >compile { thisProcess.interpreter.compile(this); } >interpret { thisProcess.interpreter.interpret(this); } >interpretPrint { thisProcess.interpreter. interpretPrint(this); } > >Then you only need to write: > >mystring.compile; >mystring.interpret; >mystring.interpretPrint; > ------------------------------ Date: Wed, 16 Sep 1998 11:20:55 -0600 From: James McCartney <---@---.---> Subject: Re: TSpawn vs Spawn argument order At 9:01 AM -0600 9/16/98, Iannis Zannos wrote: >Another small point perhaps, but why the difference >in the order of arguments: > >Spawn.ar(newEventFunc, numChannels, nextTime, maxRepeats, mul, add) > ^^^^^^^^ >TSpawn.ar(newEventFunc, numChannels, maxRepeats, triggerIn, mul, add) > ^^^^^^^^^^ > >Since maxRepeats is not necessarily used less in Spawn than in >TSpawn. In fact I do find it cumbersome having to write a nil >for every TSpawn, when 99 % of the time I only need the >triggerIn condition and I do the checking whether to really >spawn or not in that condition (including for example checking >whether a maximum number of voices has been allocated). > >TSpawn is IMO primarily for spawning by condition, while >the number of times parameter is an additional - however >important - feature. TSpawn does not have a nextTime. triggerIn is a signal input and all signal inputs come last so that they can be collected with an ellipsis argument into an array of inputs to the ugen. It could be reordered in the ar1 method call to the init method, but I prefer to keep it a convention that signal inputs always come last. --- 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/SC2d24.sea.hqx ------------------------------ Date: Wed, 16 Sep 1998 12:12:51 -0600 From: James McCartney <---@---.---> Subject: Re: Generating code to clipboard At 10:19 AM -0600 9/16/98, Iannis Zannos wrote: >Thanks very much for this info, it is >a valuable insight in the more difficult parts >of SC. Process has been always more or less a >mystery for me in Smalltalk - and similarly >in SC. It is one of the things least documented >in both - although I suspect it may be not so >difficult to understand once the right examples are >given. Actually I should rename it to VirtualMachine or something. All it really is is the root of the GC system. From thisProcess you can trace links to all live objects in the system, because it contains the classvar array for all classes, and the interpreter and its stack. Unlike Smalltalk you can have only one process in SC. Threads were not possible because I needed to have C primitives that could call the virtual machine recursively. This was essential in order for the virtual machine to be able to migrate to running at interrupt level in Synth.play. Interpreter reentrancy from C meant that to support threads I would have to do really complicated and non-portable manipulation of the C stack and registers. Also there is no efficient noncopying real time multithreaded garbage collection algorithm known. So I had to forgo supporting threads. --- 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/SC2d24.sea.hqx ------------------------------ Date: Wed, 16 Sep 1998 19:34:27 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: TSpawn vs Spawn argument order - ---------- >From: James McCartney <---@---.---> >To: sc-users@lists.io.com > >TSpawn does not have a nextTime. > >triggerIn is a signal input and all signal inputs come last >so that they can be collected with an ellipsis argument into an >array of inputs to the ugen. It could be reordered in the ar1 method call >to the init method, but I prefer to keep it a convention that signal inputs >always come last. > Thanks James, that does make sense. Keep the convention. Iannis Zannos SIM ------------------------------ Date: Wed, 16 Sep 1998 19:39:50 +0200 From: "Iannis Zannos" <---@---.---> Subject: Following example shows that refresh does not work for CheckBoxView. When you click on and off again, the CheckBoxView will always show "click to stopt" in the end. This works both with the synth going and without. At least on my computer. Note: The source code says: refresh { // forces redraw of widget ^^^^^^^^^^^^^^^^^^^^^^^ _View_Refresh ^this.primitiveFailed } so it should work... Iannis Zannos ========================================================== { var w, startstop; w = GUIWindow.new("panel", Rect.new( 128, 64, 370, 161 )); startstop = CheckBoxView.new( w, Rect.new( 63, 32, 191, 52 ), "click to start", 0, 0, 1, 0, 'linear'); startstop.action_({ if ( startstop.value > 0, { startstop.label_("click to stop"); startstop.refresh; }, { startstop.label_("click to start"); startstop.refresh; })}); }.value; ------------------------------ Date: Wed, 16 Sep 1998 18:11:28 +0100 From: finer@easynet.co.uk Subject: bemused . . . yet interested When I see things like this : CALL STACK: FRAME: instance of Method Object : doesNotUnderstand (05C91758) 0 arg this : nil 1 arg selector : Symbol '>' 2 arg args : instance of Array (05DE79E4, size=1, set=00) FRAME: instance of Block (05C97998, size=0, set=03) 0 arg name : nil 1 arg i : nil FRAME: instance of Method Object : do (05C8DCB8) 0 arg this : nil 1 arg func : instance of Closure (05DE79B4, size=0, set=01) FRAME: instance of Block (05C978B8, size=0, set=03) 0 arg meth : instance of Method GUIWindow : name (05DD74B8) 1 var numargs : Integer -1 FRAME: instance of Block (05D1BAF0, size=0, set=03) 0 arg i : Integer 0 ... . . . . I'm not really sure what's going on BUT I'd love to. And I have this horrible feeling that I don't know something I really should for a deeper more fullfilling relationship with SC2. Like when I read Iannis's letters I certainly feel there's a whole level to this I haven't twigged yet ! Now I know this is probably a pain in the arse for James to have to consider among the buisness of getting the program all sorted and fielding questions from all quarters but if anyone would care to annotate an error print out or explain a bit the deeper workings of SC2 I'd be well pleased . . and maybe some other people would too ! thank you, Jem Jem Finer Kentish Town London NW5 finer@easynet.co.uk 44 171 267 6416 ------------------------------ Date: Wed, 16 Sep 1998 14:01:49 -0600 From: James McCartney <---@---.---> Subject: Re: refresh At 11:39 AM -0600 9/16/98, Iannis Zannos wrote: >Following example shows that refresh does not work for CheckBoxView. >When you click on and off again, the CheckBoxView will >always show "click to stopt" in the end. This works both >with the synth going and without. At least on my computer. > >Note: The source code says: > refresh { // forces redraw of widget Its a bug. Actually it should work without refresh. Anytime you change a view it gets redrawn, it just isn't being done right. Once it is fixed you will write: { var w, startstop; w = GUIWindow.new("panel", Rect.new( 128, 64, 370, 161 )); startstop = CheckBoxView.new( w, Rect.new( 63, 32, 191, 52 ), "click to start", 0, 0, 1, 0, 'linear'); startstop.action_({ if ( startstop.value > 0, { startstop.label_("click to stop"); }, { startstop.label_("click to start"); })}); }.value; --- 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/SC2d24.sea.hqx ------------------------------ Date: Thu, 17 Sep 1998 10:32:24 +1000 From: garth@creativeaccess.com.au (Garth Paine) Subject: Re: bemused . . . yet interested >. . . . I'm not really sure what's going on BUT I'd love to. ME TOO !!! I am really a novice programmer and spent some time learning SC1 but havent had a chance to do the same with SC2 - I'd love a really good tutorial etc for SC2 as Steven Pope wrote for SC1. I really need a lot a basics and projects to try my skills at, and feel a bit lost as to where to get this kind of help. I realise James puts his time inot developing the programme and he has been extremely generous and prompt in helping me with 2 installation pieces using SC2, but I obviously need to develop my own programming chops and feel starved of resources specific to SC2. The MAX manual is a good example of what I am talking about - I taught myself MAX from the tutorials in the maual and setting myself a project - it seems hard to do that with SC2. and suggestions would be greatfully recieved. Cheers, Garth See information about my new immersive interactive sound installation at http://creativeaccess.com.au/~garth/Map1/MaP1_Sound_Installation.html << >< >> . Composer, Sound Designer .. Interactives Designer ... Interactive Installation Artist .... Exhibition Consultant http://www.creativeaccess.com.au/~garth << >< >> ------------------------------ Date: Wed, 16 Sep 1998 20:00:33 -0500 (CDT) From: antiorp@tezcat.com (=cw4t7abs) Subject: Re: b em used . . . yet int e rested >ME TOO !!! ovrflou !n add!t!on >and suggestions would be greatfully recieved. 127.0.0.1 >Cheers, kataztrof+e theor+e _+ !tz appl ------------------------------ Date: Wed, 16 Sep 1998 20:54:06 -0600 From: James McCartney <---@---.---> Subject: Re: bemused . . . yet interested At 11:11 AM -0600 9/16/98, finer@easynet.co.uk wrote: >When I see things like this : > > >CALL STACK: >FRAME: instance of Method Object : doesNotUnderstand (05C91758) > 0 arg this : nil > 1 arg selector : Symbol '>' > 2 arg args : instance of Array (05DE79E4, size=1, set=00) >FRAME: instance of Block (05C97998, size=0, set=03) > 0 arg name : nil > 1 arg i : nil >FRAME: instance of Method Object : do (05C8DCB8) > 0 arg this : nil > 1 arg func : instance of Closure (05DE79B4, size=0, set=01) >FRAME: instance of Block (05C978B8, size=0, set=03) > 0 arg meth : instance of Method GUIWindow : name (05DD74B8) > 1 var numargs : Integer -1 >FRAME: instance of Block (05D1BAF0, size=0, set=03) > 0 arg i : Integer 0 >... > >. . . . I'm not really sure what's going on BUT I'd love to. That is a trace of the stack frames of functions and methods where you failed. It lists the methods or blocks which are called and their arguments. What the above says is that method Object : doesNotUnderstand was called becase the '>' message was sent to nil. Nil has no defined method for '>'. Reading on down, this occurred within a Block whose args were name: nil, i: nil, which was in turn (jeez I just typed 'intern' HA!) called by method Object : do with args this: nil, func: a closure, etc. --- 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/SC2d24.sea.hqx ------------------------------ Date: Wed, 16 Sep 1998 21:36:39 -0600 From: James McCartney <---@---.---> Subject: Re: bemused . . . yet interested At 6:32 PM -0600 9/16/98, Garth Paine wrote: >>. . . . I'm not really sure what's going on BUT I'd love to. > >ME TOO !!! I am really a novice programmer and spent some time learning >SC1 but havent had a chance to do the same with SC2 - I'd love a really >good tutorial etc for SC2 as Steven Pope wrote for SC1. I really need a >lot a basics and projects to try my skills at, and feel a bit lost as to >where to get this kind of help. I realise James puts his time inot >developing the programme and he has been extremely generous and prompt in >helping me with 2 installation pieces using SC2, but I obviously need to >develop my own programming chops and feel starved of resources specific to >SC2. The MAX manual is a good example of what I am talking about - I >taught myself MAX from the tutorials in the maual and setting myself a >project - it seems hard to do that with SC2. I'd like to know more about what areas folks find more explanation necessary. What things would you like to see demonstrated in the tutorial? I think among all the SC help and example files there are already more executable examples than come with MAX. Of course all SC2 classes are not yet documented, which IS a problem currently. And certain areas like GUI stuff have not enough examples. You might check out the following. It is a tutorial on IBM Smalltalk. SC is semantically nearly the same as Smalltalk, and many of the classes and methods have the same names. The syntax IS different though. http://www2.ncsu.edu/eos/info/ece480_info/project/spring96/proj63/www/index.html and a mirror in germany: http://swt-www.informatik.uni-hamburg.de/~strunk/smalltalk/ibm-tutorial/index.ht ml --- 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/SC2d24.sea.hqx ------------------------------ Date: Thu, 17 Sep 1998 11:08:37 +0200 From: "Iannis Zannos" <---@---.---> Subject: Tutorial and FAQ (was: Re: bemused . . . yet interested) - ---------- >From: garth@creativeaccess.com.au (Garth Paine) >To: sc-users@lists.io.com >Subject: Re: bemused . . . yet interested >Date: Thu, 17 Sep 1998 2:32 AM > > >>. . . . I'm not really sure what's going on BUT I'd love to. > >ME TOO !!! I am really a novice programmer and spent some time learning >SC1 but havent had a chance to do the same with SC2 - I'd love a really >good tutorial etc for SC2 as Steven Pope wrote for SC1. I really need a >lot a basics and projects to try my skills at, and feel a bit lost as to >where to get this kind of help. I realise James puts his time inot >developing the programme and he has been extremely generous and prompt in >helping me with 2 installation pieces using SC2, but I obviously need to >develop my own programming chops and feel starved of resources specific to >SC2. The MAX manual is a good example of what I am talking about - I >taught myself MAX from the tutorials in the maual and setting myself a >project - it seems hard to do that with SC2. > >and suggestions would be greatfully recieved. > >Cheers, > >Garth > I have written to James on this separately since the first release of SC2 in spring of this year. At that time I did a conversion of the help files in html format for my private study use. Since then I have been taking notes which *may* go into a tutorial. I do not know if and when I will personally manage to release something, all I want to say is, this is probably a much more time consuming task than you imagine... If one has some experience in Smalltalk it helps immensely. Another thing that helps is to get into the habit of looking very exactly at the code - since SC source code and docs are very neat and consistent, and you can understand the logic from it. Furthermore, its also getting the knack of Smalltalk programming style, which IMO is not just about writing classes and methods, its also about knowing where and at which stage in the program you want to do something and how everything hangs together. It is perhaps a little bewildering to get confronted with in the beginning as far as I can remember from my first contact with VisualWorks (ParcPlace Smalltalk + GUI builder). It took me a few months to understand that - it could have been faster if I went at it with the proper guidance and/or books. >SC2. The MAX manual is a good example of what I am talking about - I >taught myself MAX from the tutorials in the maual and setting myself a >project - it seems hard to do that with SC2. Allow me a comment on this: the programming power you have in SC2 is just not comparable to that of MAX. Thus getting familiar with the logic of Smalltalk-style OO programming is just not as easy - but it opens up more possibilities. Just keep at it, it may take some time, depending on choosing your self-teaching resources judiciously. It is motivating to hear that there is interest for an SC tutorial. I'd like to be able to contribute in that direction too, but can make no promises. Perhaps a FAQ can be started to support the development of tutorials. Perhaps the meeting in Ann Arbor after ICMC can serve as : - - Send in suggestions to this list in the manner of general or specific questions, or suggestions which parts a tutorial should have. - - At the SC meeting after ICMC98, announced by James, probably around 8-9 October in Ann Arbor, Michigan, we can also discuss the material received. - - In the following months, time permitting, some texts should emerge as a result of this. Stephen T. Pope is all the more to be applauded for his work on the SC1 tutorial. Cheers, Iannis Zannos SIM ------------------------------ Date: Thu, 17 Sep 1998 11:14:56 +0200 From: "Iannis Zannos" <---@---.---> Subject: Title suggestion "What you would like to know about SC but are afraid to ask" ... keep the questions coming. (James if this is too much for you I volunteer to accept questions at iani@sim.spk-berlin and file them for discussion next month). Iannis Z. ------------------------------ Date: Thu, 17 Sep 1998 12:37:13 +0200 From: "Iannis Zannos" <---@---.---> Subject: Compile order: Superclass not found. Problem compiling new subclass: Code for subclass SoundPalette will compile when it is in the same file as ApplicationWindow definition, but if it is in its own file it will produce error message: ERROR: Cannot find superclass 'ApplicationWindow' for class 'SoundPalette' in file 'D:Stumbling.Current.S:SUPERCOLLIDER (CURRENT):0MyLib:GUIZ:SoundPalette.sc' line 6 char 32 : SoundPalette : ApplicationWindow€ { Note that the respective files are in the same subdirectory GUIZ and are named after their classes: ApplicationWindow.sc and SoundPalette.sc ApplicationWindow.sc also contains code for another subclass: ParameterWindow. Is this the cause of the problem? Iannis Zannos ========================================================= ApplicationWindow : GUIWindow { classvar dwidth = 640, dheight = 400; var <>model; *new { arg inname = "Application Window", inmodel, x = 100, y = 100; ^super.new(inname, Rect.newBy(x, y, 200, 200)).model_(inmodel); } } // The problem: // SoundPalette will compile when unquoted in ApplicationWindow.sc, // but will not compile when it is in its own file, SoundPalette.sc: /* SoundPalette : ApplicationWindow { *new { var sounds, x = 100, y = 100; ^super.new("SoundPalette", SoundManager, x, y).initSoundPalette(sounds); } initSoundPalette { } } */ ------------------------------ Date: Thu, 17 Sep 1998 12:55:17 +0200 From: "Iannis Zannos" <---@---.---> Subject: Empty .sc file disturbs compilation? (Further problems and fix for my previous question about subclass compilation. Suggest to check this: ) I tried recompiling with all subclasses of ApplicationWindow in the same file, ApplicationWindow.sc. I got the message below, although GUIWindow is present in the compile file hierarchy. This message disappeared when I trashed the file SoundPalette.sc which was in the same folder as ApplicationWindow.sc but contained only commented code. Apparently .sc files with no code to compile may confuse the compiler. Iannis Z. € ERROR: Cannot find superclass 'GUIWindow' for class 'ApplicationWindow' in file 'D:Stumbling.Current.S:SUPERCOLLIDER (CURRENT):0MyLib:GUIZ:ApplicationWindow.sc' line 6 char 30 : ApplicationWindow : GUIWindow€ { classvar dwidth = 640, dheight = 400; - ----------------------------------- € ERROR: Cannot find superclass 'ApplicationWindow' for class 'SoundPalette' in file 'D:Stumbling.Current.S:SUPERCOLLIDER (CURRENT):0MyLib:GUIZ:ApplicationWindow.sc' line 15 char 32 : SoundPalette : ApplicationWindow€ { - ----------------------------------- € ERROR: Cannot find superclass 'ApplicationWindow' for class 'ParameterWindow' in file 'D:Stumbling.Current.S:SUPERCOLLIDER (CURRENT):0MyLib:GUIZ:ApplicationWindow.sc' line 53 char 35 : ParameterWindow : ApplicationWindow€ { var settings, settingsnum; - ----------------------------------- ------------------------------ Date: Thu, 17 Sep 1998 13:14:04 +0200 From: "Iannis Zannos" <---@---.---> Subject: Solution to compile subclass problem Here is the solution to the problem of compiling subclasses in different files: The compiler will fail to find the superclass of a newly declared class x if the file that contains class x definition *also* contains other classes y which are situated at a higher branch of the class hierarchy than x i.e. not subclasses of x (or of the immediate superclass of x?) In other words, keep class hierarchies neatly grouped in files: each file may contain only 1 branch of the class hierarchy, not classes belonging to different branches. James is this right? Sorry for the multiple posts, but the above compiling rule should be documented. (I only checked help file on Classes). Suggest adding a new help file ":Documentation:The Language:10 Compiling". Iannis Zannos SIM ------------------------------ Date: Thu, 17 Sep 1998 13:55:35 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: areas folks find more explanation necessary - ---------- >From: James McCartney <---@---.---> >Date: Thu, 17 Sep 1998 5:36 AM <...> >I'd like to know more about what areas folks find more explanation necessary. >What things would you like to see demonstrated in the tutorial? <...> **** Compiling discipline, for one. More detailed questions: * Are class variables global between subclasses of the same class or does each subclass have its own private copy? * Related to this: When to use class variables? For example, one may want to make a subclass of Window x or of Sound y which overrides the superclasses default parameters - and tries to do this by storing the defaults in a class variable. But can do this better with a method that is overloaded - a class variable seems to be the wrong approach for this. On the contrary, you would use a class variable for an object that is shared between instances of a class, but is modified at runtime. Examples? * How to organize the file hierarchy for compiling (for example the problem with classes from different branches of the hierarchy posted previously) **** How the synth works: How are UGen graphs installed in the synth and what is the separation in the system betwen synth tasks (Ugen graphs) and the rest of the program execution (mostly closures?). Delicate points in this are: * How to create controls for UGen parameters * or triggers for spawning * How to poll continuous UGen signals (kr or ar) in order to obtain scalar values that one uses for further "program logic". Related to this is also a request which goes into another chapter: ControlOut and recording kr signals. SC is predestined for this because of its interactive oop capabilities. Since people are moving more and more into interactive control this is bound to become a main area of interest: Realtime feature extraction and processing of both audio and control signals. Other topics are file i/o, signal display, graphics and gui perhaps others in this group would like to make their contributions here. Iannis Z. ------------------------------ Date: Thu, 17 Sep 1998 08:39:34 -0400 (EDT) From: David Crandall <---@---.---> Subject: Re: Tutorial and FAQ (was: Re: bemused . . . yet interested) Without quoting the previous posts, I'm really glad this discussion is happening. I know sooner or later I'll have to figure the language out for myself, though it'll be months before I have the time to do that. The point that sticks in my mind is that a documentation package would make it much easier to recommend the program to, e.g. music departments, which was easier with SC1 since a hardcopy manual came with, there were many useful patches on the disks already (esp those from Richard Dudas) and it was very easy to guide people to Steven Pope's book. What goes for documentation, I think also would go for examples and patches, since what I did learn of SC1 I've learned by adapting existing patches rather than building new ones from the ground up. What's ironic is that AFAIK the new syntax is actually easier to use, but there is this big steep learning curve for newcomers that maybe doesn't really need to be there... I guess I'm saying don't send us elsewhere to learn Smalltalk, I'd rather learn it here because here is probably the only place I'll use it. my .02 dc ------------------------------ Date: Thu, 17 Sep 1998 07:52:37 -0600 From: James McCartney <---@---.---> Subject: Re: Compile order: Superclass not found. At 4:37 AM -0600 9/17/98, Iannis Zannos wrote: >Problem compiling new subclass: > >Code for subclass SoundPalette will compile when >it is in the same file as ApplicationWindow definition, >but if it is in its own file it will produce error message: > >ERROR: Cannot find superclass 'ApplicationWindow' for class 'SoundPalette' > in file 'D:Stumbling.Current.S:SUPERCOLLIDER >(CURRENT):0MyLib:GUIZ:SoundPalette.sc' > line 6 char 32 : > SoundPalette : ApplicationWindow* { > > >Note that the respective files are in the same subdirectory GUIZ and are >named after their classes: ApplicationWindow.sc and SoundPalette.sc >ApplicationWindow.sc also contains code for another subclass: >ParameterWindow. Is this the cause of the problem? What is ParameterWindow's superclass? You cannot put classes into files such that there is no order to compile the files in which superclasses always are compiled before subclasses. This simplest case of this is where C<-B<-A and file1 has definitions for C & A and file2 has the definition for B, but there are other cases as well. In the example given if file1 is compiled first, there is no definiton for C's superclass B and if file2 is compiled first there is no definition for B's superclass A. >The compiler will fail to find the superclass of a newly >declared class x if the file that contains class x >definition *also* contains other classes y which are situated >at a higher branch of the class hierarchy than x >i.e. not subclasses of x (or of the immediate superclass >of x?) Yes the above is true. --- 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/SC2d24.sea.hqx ------------------------------ Date: Thu, 17 Sep 1998 14:14:29 +0100 From: finer@easynet.co.uk Subject: tutorials etc I don't have a problem with the help files and examples, though help for those classes without help would be great, more with the 'under the bonnet' aspects of SC2. I might be on the wrong track, but I like to know how things work, and though I can glean a lot from trial and error and the documentation something explicitly aimed at describing the inner workings of SC2 as it compiled and ran even a very simple patch would, i think, aid more efficient and creative programming. Cheers, jem Jem Finer Kentish Town London NW5 finer@easynet.co.uk 44 171 267 6416 ------------------------------ Date: Thu, 17 Sep 1998 15:36:35 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: Tutorial and FAQ (was: Re: bemused . . . yet interested) >Without quoting the previous posts, I'm really glad this discussion is >happening. I know sooner or later I'll have to figure the language out >for myself, though it'll be months before I have the time to do that. > >The point that sticks in my mind is that a documentation package would >make it much easier to recommend the program to, e.g. music departments, >which was easier with SC1 since a hardcopy manual came with, there were >many useful patches on the disks already (esp those from Richard Dudas) >and it was very easy to guide people to Steven Pope's book. > >What goes for documentation, I think also would go for examples and >patches, since what I did learn of SC1 I've learned by adapting existing >patches rather than building new ones from the ground up. > >What's ironic is that AFAIK the new syntax is actually easier to use, but >there is this big steep learning curve for newcomers that maybe doesn't >really need to be there... I guess I'm saying don't send us elsewhere to >learn Smalltalk, I'd rather learn it here because here is probably the >only place I'll use it. Fair enough, including the thought that you would "learn Smalltalk" on SC - a well earned compliment for SC2 and a view I share. But please do contribute to the making of the manual / tutorial. As I suggested earlier, turning source AND doc into html and other browsable and printable form is a small task and can be done easily any moment the SC release is judged ripe enough by James. Moreover, in the present form of the help files are both very handy to access and provide examples almost throughout. What is needed is more questions (on principles, how to do things, or on anything in SC) and especially suggestions on how to structure a tutorial or FAQ. Now is the time for everybody to put in their 2 % or more. Also let us see what happens at ICMC/post - processes that help make the tools for overcoming this "big steep learning curve" are valuable opportunities. Anybody else from this group attending? Iannis Zannos ------------------------------ End of sc-users-digest V1 #8 ****************************