From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #341 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 Friday, August 10 2001 Volume 01 : Number 341 ---------------------------------------------------------------------- Date: Wed, 08 Aug 2001 07:45:26 -0500 From: James McCartney <---@---.---> Subject: Re: SC 101 on 8/8/01 12:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > how are you able to use the instance variables head, tail, and size within you > class methods then? (in the LinkedList Class) You don't. The class method, which is a method of the class not of the instance, has to manipulate instances via the same interface that any other external method has to. If you need to manipulate the instance variables and they are not accessable via getters and setters, then you need to call an instance method to do it. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Wed, 08 Aug 2001 07:52:10 -0500 From: James McCartney <---@---.---> Subject: Re: SC 101 on 8/8/01 12:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > var tree = 1, head = 1, tail = 1, first = 1, last = 1; You can initialize variables to a literal. The literals are stored in a prototype array for the object, which gets memcpy'ed to a new object when it is created. // UGen's instance variables: Post <<< UGen.instVarNames; [ 'synth', 'inputs', 'rate', 'state' ] // UGen's instance prototype array for initializing those variables: Post <<< UGen.iprototype; [ nil, nil, 'audio', 0 ] - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Wed, 08 Aug 2001 10:12:44 -0400 From: Mara Helmuth <---@---.---> Subject: drawing and sc I'm curious if it is possible to draw with the mouse to control some aspects of audio data. I've seen examples included with sc 2 with mouse control that do not plot graphics to a window, but can one draw onto a simple graph and manipulate it? thanks for any info, Mara Helmuth ------------------------------ Date: Wed, 8 Aug 2001 16:36:50 +0200 From: "sfogar@inwind.it"<---@---.---> Subject: Audio migrates to X - the big picture on MacWorld.co.uk Interesting ... http://www.macworld.co.uk/news/main_news.cfm?NewsID=3311 Cheers Alessandro Fogar ------------------------------ Date: Wed, 08 Aug 2001 14:04:31 -0400 From: christian adam hresko <---@---.---> Subject: Re: SC 101 James McCartney wrote: > on 8/8/01 12:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > > > how are you able to use the instance variables head, tail, and size within you > > class methods then? (in the LinkedList Class) > > You don't. The class method, which is a method of the class not of the > instance, has to manipulate instances via the same interface that any other > external method has to. If you need to manipulate the instance variables and > they are not accessable via getters and setters, then you need to call an > instance method to do it. > ahhh... that's why the *new wasn't working correctly. okay, i get it. i'll just have an initialize method. init or clearTree... something along those lines. i'm just not used to class methods and instance methods, although it seems to be a much more elegant way to encapsulate the properties of a class/object. it clicked, christian : after this little project, i think i'll implement a minimal spanning tree. fun for the kids... (music composition and/or synthesis based on geographic data would be kinda cool using a min span tree) ------------------------------ Date: Wed, 08 Aug 2001 14:04:31 -0400 From: christian adam hresko <---@---.---> Subject: Re: SC 101 James McCartney wrote: > on 8/8/01 12:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > > > how are you able to use the instance variables head, tail, and size within you > > class methods then? (in the LinkedList Class) > > You don't. The class method, which is a method of the class not of the > instance, has to manipulate instances via the same interface that any other > external method has to. If you need to manipulate the instance variables and > they are not accessable via getters and setters, then you need to call an > instance method to do it. > ahhh... that's why the *new wasn't working correctly. okay, i get it. i'll just have an initialize method. init or clearTree... something along those lines. i'm just not used to class methods and instance methods, although it seems to be a much more elegant way to encapsulate the properties of a class/object. it clicked, christian : after this little project, i think i'll implement a minimal spanning tree. fun for the kids... (music composition and/or synthesis based on geographic data would be kinda cool using a min span tree) ------------------------------ Date: Wed, 08 Aug 2001 14:13:48 -0400 From: christian adam hresko <---@---.---> Subject: Re: SC 101 James McCartney wrote: > on 8/8/01 12:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > > > var tree = 1, head = 1, tail = 1, first = 1, last = 1; > > You can initialize variables to a literal. The literals are stored in a > prototype array for the object, which gets memcpy'ed to a new object when it > is created. > > // UGen's instance variables: > Post <<< UGen.instVarNames; > [ 'synth', 'inputs', 'rate', 'state' ] > > // UGen's instance prototype array for initializing those variables: > Post <<< UGen.iprototype; > [ nil, nil, 'audio', 0 ] > hmmm.. that's a nifty little tool for digging deeper. thanks again. is there any advantage or disadvantage if you initialize the variables as literals? (i.e. a literal array (# [ ]) isn't dynamic, but only one copy needs to sit on the heap which consumes less CPU within a patch...) cheers, christian ------------------------------ Date: Wed, 08 Aug 2001 13:41:02 -0500 From: James McCartney <---@---.---> Subject: Re: SC 101 on 8/8/01 1:13 PM, christian adam hresko at godpup@ix.netcom.com wrote: > is there any advantage or disadvantage if you initialize the variables as > literals? (i.e. a literal array (# [ ]) isn't dynamic, but only one copy > needs > to sit on the heap which consumes less CPU within a patch...) Yes it is much faster. Compare: { var x; x = [1, 2, \abc, 4.0]; }.def.dumpByteCodes; BYTECODES: (22) 0 06 1A PushSpecialClass 'Array' 2 FE 04 PushPosInt 4 4 C2 00 SendSpecialMsg 'new' 6 64 PushSpecialValue 1 7 C2 08 SendSpecialMsg 'add' 9 65 PushSpecialValue 2 10 C2 08 SendSpecialMsg 'add' 12 40 PushLiteral Symbol 'abc' 13 C2 08 SendSpecialMsg 'add' 15 41 PushLiteral Float 4 16 C2 08 SendSpecialMsg 'add' 18 08 00 00 StoreTempVarX 'x' 21 F2 BlockReturn { var x; x = #[1, 2, \abc, 4.0]; }.def.dumpByteCodes; BYTECODES: (5) 0 40 PushLiteral instance of Array (0B4D1138, size=4, set=02) 1 08 00 00 StoreTempVarX 'x' 4 F2 BlockReturn - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Wed, 08 Aug 2001 14:56:24 -0400 From: christian adam hresko <---@---.---> Subject: Re: SC 101 James McCartney wrote: > on 8/8/01 1:13 PM, christian adam hresko at godpup@ix.netcom.com wrote: > > > is there any advantage or disadvantage if you initialize the variables as > > literals? (i.e. a literal array (# [ ]) isn't dynamic, but only one copy > > needs > > to sit on the heap which consumes less CPU within a patch...) > > Yes it is much faster. Compare: > > { var x; x = [1, 2, \abc, 4.0]; }.def.dumpByteCodes; > > BYTECODES: (22) > 0 06 1A PushSpecialClass 'Array' > 2 FE 04 PushPosInt 4 > 4 C2 00 SendSpecialMsg 'new' > 6 64 PushSpecialValue 1 > 7 C2 08 SendSpecialMsg 'add' > 9 65 PushSpecialValue 2 > 10 C2 08 SendSpecialMsg 'add' > 12 40 PushLiteral Symbol 'abc' > 13 C2 08 SendSpecialMsg 'add' > 15 41 PushLiteral Float 4 > 16 C2 08 SendSpecialMsg 'add' > 18 08 00 00 StoreTempVarX 'x' > 21 F2 BlockReturn > > { var x; x = #[1, 2, \abc, 4.0]; }.def.dumpByteCodes; > > BYTECODES: (5) > 0 40 PushLiteral instance of Array (0B4D1138, size=4, set=02) > 1 08 00 00 StoreTempVarX 'x' > 4 F2 BlockReturn > geez. that's wicked fast. and each time you use a non-literal (say you've got a loop or a nested loop in a patch) it has to do this all over again. i'm gonna have to get a notebook or something to jot all this stuff down. i'm starting to lose track of my printouts and referring to old emails isn't practical anymore. thanks james. cheers, christian ------------------------------ Date: Thu, 9 Aug 2001 01:15:18 +0200 From: Julian Rohrhuber <---@---.---> Subject: Re: SC 101 >on 8/8/01 12:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > >> var tree = 1, head = 1, tail = 1, first = 1, last = 1; > >You can initialize variables to a literal. The literals are stored in a >prototype array for the object, which gets memcpy'ed to a new object when it >is created. > >// UGen's instance variables: >Post <<< UGen.instVarNames; >[ 'synth', 'inputs', 'rate', 'state' ] > >// UGen's instance prototype array for initializing those variables: >Post <<< UGen.iprototype; >[ nil, nil, 'audio', 0 ] so I understand how to create an array of literals: Knoll { var lit; init { lit = #[ 1, 2, false]; } } is this equivalent to Knoll { var <>lit=1, mit=2, jit=false; } is there a way to store a literal later on lit = 0; is after doing lit = false; lit still a literal? ------------------------------ Date: Thu, 9 Aug 2001 02:05:05 +0200 From: Julian Rohrhuber <---@---.---> Subject: Stethoscope Hi James, about a year ago we talked about that a UGen browser would be nice to have. Today I've had a go, just for to see if it is possible. http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/276 Comment? ------------------------------ Date: Wed, 08 Aug 2001 19:37:55 -0500 From: James McCartney <---@---.---> Subject: Re: SC 101 on 8/8/01 6:15 PM, Julian Rohrhuber at sa6a014@rzaixsrv2.rrz.uni-hamburg.de wrote: >> on 8/8/01 12:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: >> >>> var tree = 1, head = 1, tail = 1, first = 1, last = 1; >> >> You can initialize variables to a literal. The literals are stored in a >> prototype array for the object, which gets memcpy'ed to a new object when it >> is created. >> >> // UGen's instance variables: >> Post <<< UGen.instVarNames; >> [ 'synth', 'inputs', 'rate', 'state' ] >> >> // UGen's instance prototype array for initializing those variables: >> Post <<< UGen.iprototype; >> [ nil, nil, 'audio', 0 ] > > > so I understand how to create an array of literals: > > Knoll { > var lit; > init { > lit = #[ 1, 2, false]; > } > > > } > is this equivalent to > > Knoll { > var <>lit=1, mit=2, jit=false; > > > } > > is there a way to store a literal later on Not for variable initialization. That is done at compile time. The entire class library and all objects it pointed to by it are immutable objects. > lit = 0; > > is after doing > lit = false; > lit still a literal? I think terms are being confused here. 'lit' is and always will be a variable. A literal is a syntactic representation of a value in code, such as false, 'a symbol', "a string", 123.456, #[1, 2, 3]. Variables are never literals. Variables hold values. That value may have been originally specified syntactically by a literal expression, or it may have been the result of code. myvar = 5; myothervar = 2 + 3; At the end of this both variables contain the value 5. You cannot tell if that value was made from a literal or by executing code. Methods and functions store the literals that occur in code as values in an array so it can push them on the stack when needed. But they are values at that point like any others. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Wed, 8 Aug 2001 23:37:21 -0400 From: lee@eds.org Subject: [sorta OT] Dedicated swapfile partition in OS X I just installed OS X and I now use it exclusively for everything except audio apps. I noticed the lack of a dedicated swap partition, and just today I wrote some bad PHP code that made it swap itself into a coma. I don't know why Apple decided to trash the whole UNIX requirement of a dedicated swap partition, but I found a resource online with instructions to make one. I highly recommend it, it should speed things up significantly. - ---------------------------- - -l[e^2] chmod -R 777 / chown -R nobody / Imagine true freedom ------------------------------ Date: Thu, 9 Aug 2001 00:12:04 -0400 From: lee@eds.org Subject: oops, here's the URL A dedcicated Swapfile partition in OS X: http://www.ResExcellence.com/hack_html_01/06-01-01.shtml - ---------------------------- - -l[e^2] chmod -R 777 / chown -R nobody / Imagine true freedom ------------------------------ Date: Thu, 09 Aug 2001 02:36:06 -0400 From: christian adam hresko <---@---.---> Subject: Re: Stethoscope Julian Rohrhuber wrote: > Hi James, > > about a year ago we talked about that a UGen browser would be nice to have. > Today I've had a go, just for to see if it is possible. > http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/276 > Comment? that's really cool julian. the game you wrote is very cool as well. sorta 'trippy' in a doctor who kinda way... cheers, christian ------------------------------ Date: Thu, 9 Aug 2001 12:01:46 +0200 From: Julian Rohrhuber <---@---.---> Subject: Re: Stethoscope > >sorta 'trippy' in a doctor who kinda way... we'll be having lots of fun with sc3 I think .. ------------------------------ Date: Thu, 9 Aug 2001 12:40:11 +0200 From: Julian Rohrhuber <---@---.---> Subject: Re: SC 101 > >A literal is a syntactic representation of a value in code, such as >false, 'a symbol', "a string", 123.456, #[1, 2, 3]. ah, thank you, now I got it. ------------------------------ Date: Thu, 9 Aug 2001 13:56:42 -0400 (EDT) From: Matthew Rogalsky <---@---.---> Subject: SCPlay question I put a (stereo) patch into the startUp function, in order to distribute it with SCPlay. When it plays, on startup, it plays in mono. Why would it behave differently? thanks mattr ------------------------------ Date: Thu, 09 Aug 2001 13:20:36 -0500 From: James McCartney <---@---.---> Subject: Re: SCPlay question on 8/9/01 12:56 PM, Matthew Rogalsky at mrogalsky@mail.wesleyan.edu wrote: > > I put a (stereo) patch into the startUp function, in order to distribute > it with SCPlay. > > When it plays, on startup, it plays in mono. > > Why would it behave differently? > > thanks > mattr > > startUp happens before hardwareSetup. Put it in hardwareSetup. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Fri, 10 Aug 2001 00:16:48 +0200 From: Julian Rohrhuber <---@---.---> Subject: Stethoscope there is an updated version of Stethoscope on http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/276 now it also works for OutputProxy and looks better. ------------------------------ Date: Fri, 10 Aug 2001 01:14:11 +0100 From: Arie van Schutterhoef <---@---.---> Subject: Re:[ANNOUNCEMENT] Spectroscopic Toolkit For all the people who dare to tread the twilight zone of sound and image (users of Image/ine, nato 0.55, SuperCollider 3's Image Synth and jMax' VideoDSP external) the following open source software could be of interest: ====================================================== S P E C T R O S C O P I C T O O L K I T 64 bit integer source for nano-tonal synthesis to generate sounds as alchemistic symbols http://www.hku.nl/~pieter/SOFT/ST/html/index.html Spectroscopic Toolkit provides 64 bit integer DSP for massive additive synthesis or granular synthesis. It is open-source software in ANSI C for the public domain. It renders audio files and graphic files, it was not designed for real-time synthesis, and does not offer a graphical user interface. I developed it because other rendering software (like CSound) did no longer suffice my needs. Spectroscopic Toolkit software translates quantumphysical data to AIFF file. The process is alchemistic in file ST.c01_twoWeeks.c: atomic spectra of the seven metals Au, Ag, Fe, Hg, Sn, Cu, Pb, in that order, are transposed 40 octaves downwards. Frequencies are shaped into elongated, overlapping, Gaussian grains. This sequence is followed by 6 ions: Ag+, Fe+, Hg+, Sn+, Cu+, Pb+ (Au+ is missing because the database doesn't include gold-ions). Spectroscopic Toolkit is public domain software for anybody who is interested in alchemy, electronic composition, nanotonality, and so on. The toolkit can be applied in electronic composition, for instance, to generate sounds as alchemistic symbols. Sources were developed on Silicon Graphics UNIX (IRIX6.2 to 6.5 with MIPS/MIPSpro compiler) and Apple Macintosh (OS7.6 to 9.1, Metrowerks CodeWarrior pro 4 to 6). I restrained to ANSI-C as much as possible so it should not be too hard to port to other platforms. The code is supposed to work correctly on both little endians and big endians. If you like these sounds, you may use them for your own purposes. It would then be nice if you credit me, but more important: please, never sell this music in unmodified form, nor include it in commercial software, CD-ROMs, DVDs, etc., for this quantumfysical music should remain free. Give credit to Robert L. Kurucz who gathered and made available all this data! Pieter Suurmond, july 28, 2001 Utrecht School of the Arts, faculty of Art, Media and Technology PO box 2471, 1200 CL Hilversum, Netherlands phone: (+31) 35-6836464, fax: (+31) 35-6836480 e-mail: pieter@kmt.hku.nl ====================================================== . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................................................. ^ Arie van Schutterhoef | arsche@xs4all.nl ^_北北北北北北北北北北北盻_""""""""""""""""""""""""""""""""" | ` |Schreck Ensemble http://www.xs4all.nl/~schreck/ | ` |# -laboratory for live electro-acoustic music- # | ` |Tel: 00-31-71-5612287 Fax: 00-31-70-3859268 | *========================================================++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................................................. ------------------------------ Date: Thu, 9 Aug 2001 20:53:02 -0400 (EDT) From: Paul Lansky <---@---.---> Subject: TSpawn question I'm sure the answer is simple, and I'll figure it out 5 minutes after sending this email, but anyway... I have a TSpawn triggered by a signal which will begin with a positive value, and thus not be immediately triggered, but I want it to be triggered at the outset. The signal is stored in a buffer from a previous synth, if that helps... thanks paul lansky ------------------------------ Date: Thu, 09 Aug 2001 21:22:47 -0400 From: Mara Helmuth <---@---.---> Subject: Between Is there a working example of "inclusivelyBetween" or "exclusivelyBetween" methods (Magnitude class)? I had trouble getting them to work. Mara Helmuth ------------------------------ Date: Thu, 09 Aug 2001 20:50:27 -0500 From: James McCartney <---@---.---> Subject: Re: Between on 8/9/01 8:22 PM, Mara Helmuth at mara.helmuth@uc.edu wrote: > Is there a working example of "inclusivelyBetween" or > "exclusivelyBetween" methods (Magnitude class)? I had trouble getting > them to work. > > Mara Helmuth > 4.inclusivelyBetween(3,5).postln; true 4.inclusivelyBetween(4,5).postln; true 4.exclusivelyBetween(3,5).postln; true 4.exclusivelyBetween(4,5).postln; false ?? - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Fri, 10 Aug 2001 11:52:04 +1000 From: newton armstrong <---@---.---> Subject: Re: Between Mara Helmuth wrote: > Is there a working example of "inclusivelyBetween" or > "exclusivelyBetween" methods (Magnitude class)? I had trouble getting > them to work. they return true or false depending on whether the receiver falls inclusively or exclusively between the method arguments. eg. 1.inclusivelyBetween(1, 5).postln true 5.inclusivelyBetween(1, 5).postln true the receivers 1 and 5 fall within the argument range that includes the bounding values 1 and 5. 1.exclusivelyBetween(1, 5).postln false 5.exclusivelyBetween(1, 5).postln false the receivers 1 and 5 do not fall within the argument range that excludes the bounding values 1 and 5, however all intermediate values (2,3,4) will return true. ------------------------------ Date: Thu, 09 Aug 2001 20:52:36 -0500 From: James McCartney <---@---.---> Subject: Re: TSpawn question on 8/9/01 7:53 PM, Paul Lansky at paul@silvertone.Princeton.EDU wrote: > I'm sure the answer is simple, and I'll figure it out 5 minutes > after sending this email, but anyway... > > I have a TSpawn triggered by a signal which will begin with a > positive value, and thus not be immediately triggered, but I > want it to be triggered at the outset. The signal is stored > in a buffer from a previous synth, if that helps... > thanks > paul lansky > I almost follow.. What are you using as the trigger input? PlayBuf? - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Thu, 9 Aug 2001 22:09:13 -0400 (EDT) From: Paul Lansky <---@---.---> Subject: Re: TSpawn question Using PlayBuf as the input. paul ------------------------------ Date: Thu, 09 Aug 2001 21:16:20 -0500 From: James McCartney <---@---.---> Subject: Re: TSpawn question on 8/9/01 9:09 PM, Paul Lansky at paul@silvertone.Princeton.EDU wrote: > Using PlayBuf as the input. > > paul And it is not triggering on the first sample if that sample is > 0 ? - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Thu, 9 Aug 2001 22:24:10 -0400 (EDT) From: Paul Lansky <---@---.---> Subject: Re: TSpawn question right, the first sample in the buffer is guaranteed to be > 0, so it doesn't seem to be triggering on the first sample. paul ------------------------------ Date: Thu, 09 Aug 2001 21:55:57 -0400 From: christian adam hresko <---@---.---> Subject: Re: [ANNOUNCEMENT] Spectroscopic Toolkit Arie van Schutterhoef wrote: > For all the people who dare to tread > the twilight zone of sound and image > (users of Image/ine, nato 0.55, > SuperCollider 3's Image Synth > and jMax' VideoDSP external) > the following open source software > could be of interest: > > ====================================================== > > S P E C T R O S C O P I C T O O L K I T > > 64 bit integer source for > nano-tonal synthesis > to generate > sounds as alchemistic symbols > > http://www.hku.nl/~pieter/SOFT/ST/html/index.html > very nice. open source too. lots for learning... thanks. cheers, christian ------------------------------ Date: Thu, 09 Aug 2001 22:06:46 -0500 From: James McCartney <---@---.---> Subject: Re: TSpawn question on 8/9/01 9:24 PM, Paul Lansky at paul@silvertone.Princeton.EDU wrote: > right, the first sample in the buffer is guaranteed to be > 0, so it doesn't > seem to be triggering on the first sample. > > paul > OK well I think you will have to use synth.sched(0, { tspawn.trigger... in order to get it to trigger initially. A trigger is a transition from non-positive to positive, and since that is not happening in this case, there is no trigger. Some trigger-able ugens assume that the past is zero, but I guess TSpawn is not making that assumption. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Fri, 10 Aug 2001 04:11:55 -0400 From: christian adam hresko <---@---.---> Subject: keeps getting nilled someone please enlighten me. my tree pointer keeps getting set to nil. tree should point to the root node. //Binary Search Tree and Doubly Linked List BinSeaTreeNode { var <>left, <>right, <>prev, <>next, <>obj, <>count; *new { arg item; ^super.new.obj_(item) } } BinSeaTree { var tree, head, tail, first, last; *new { ^super.new.init; } init { tree = first = last = nil; head = BinSeaTree.new(nil); tail = BinSeaTree.new(nil); head.prev = tail.next = nil; head.next = tail; tail.prev = head; } search { arg key; this.searchBST(tree, key); } insert { arg key; this.insertBST(tree, key); } //private searchBST { arg cur, key; if (cur.isNil, { //this should not happen if 6 is searched for //in the test code ^nil; },{ if (key == cur.obj, { //this never happens. why? ^cur.obj; },{ if (key < cur.obj, { this.searchBST(cur.left, key); },{ if (key > cur.obj, { this.searchBST(cur.right, key); },{ })})})}); } insertBST { arg cur, key; if (cur.isNil, { cur = BinSeaTreeNode.new(key); cur.left = cur.right = nil; cur.count = 0; //more code... not relevant to this problem if (key < cur.obj, { this.insertBST(cur.left, key); },{ if (key > cur.obj, { this.insertBST(cur.right, key); },{ ^nil; })})}); cur.count = cur.count + 1; } test: var bTree; var value; bTree = BinSeaTree.new; bTree.insert(6); value = bTree.search(6); value.postln; a BinSeaTree now why is this returning a BinSeaTree? when i add some test code, tree keeps getting set to nil. after the first insertion, tree points to a new node. the first search should find the value of 6 contained in the root of the tree (tree). i don't understand why tree is being nilled, and why this is returning the object type, as opposed to nil. ??? cheers, christian ------------------------------ Date: Fri, 10 Aug 2001 08:32:13 -0500 From: James McCartney <---@---.---> Subject: Re: keeps getting nilled on 8/10/01 3:11 AM, christian adam hresko at godpup@ix.netcom.com wrote: > search { arg key; > this.searchBST(tree, key); > } Your search method has no ^ return statement. Therefore the object itself is returned. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ End of sc-users-digest V1 #341 ******************************