From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #332 Reply-To: sc-users Sender: owner-sc-users-digest@lists.io.com Errors-To: owner-sc-users-digest@lists.io.com Precedence: bulk sc-users-digest Tuesday, July 24 2001 Volume 01 : Number 332 ---------------------------------------------------------------------- Date: Mon, 23 Jul 2001 23:41:20 -0400 From: christian adam hresko <---@---.---> Subject: Re: atIdentityHash Paul Lansky wrote: > Thanks James, but I'm just grepping around for an easy way to find the location > of an element in an array. detect() and indexOf() also fail in the case of > arrays whose elements may themselves be arrays. > > paul you could try using the linked list class, and add the following method: indexOf { arg obj; var node, index = 0; node = head; while({ node.notNil }, { if(node.obj == obj, { ^index }); node = node.next; index = index + 1; }); ^nil } i haven't tested it thoroughly (i just wrote it...), but this should do the job. //test var list; list = LinkedList.new; list.addFirst(1); list.addFirst(2); list.addFirst(3); list.first.postln; list.indexOf(2).postln; list.indexOf(1).postln; cheers, christian ------------------------------ Date: Mon, 23 Jul 2001 20:42:21 -0700 From: "tomonori yamasaki" <---@---.---> Subject: Plug-in talk -Re: Mattel Power Glove I finally got a codewarrior at expo. (with free T-shirts!) I want to know how many of us are looking into it, and planning to release open plug-ins (not the one for yourself and secret) Because no two person should work on the same plugin separately... It'll be nice to at least know what's happening, so we can individually contact each other, to work together or interact etc... I like the Vocoder idea, I'd like to see something like the one in Nord, with graphic interface. Input plugins are nice too, some kind of generic serial plugin (some higher rate than MIDI?) or USB plugin (we can get a group USB ID and share it for the devices, as we share the plugin framework.) I can work on making USB microcontroller chip prototype (a board with chips USB jack and open ports, with minimum firmware, so everybody can get sorce, or distribute chip so you can connect just sensors...) There weren't much new stuff at mac expo. They took off the line-in for desktop, saying no pro use line-in. They're against internet phone ei? ------------------------------ Date: Mon, 23 Jul 2001 23:52:43 -0400 From: christian adam hresko <---@---.---> Subject: Re: atIdentityHash christian adam hresko wrote: > Paul Lansky wrote: > > > Thanks James, but I'm just grepping around for an easy way to find the location > > of an element in an array. detect() and indexOf() also fail in the case of > > arrays whose elements may themselves be arrays. > > > > paul > > you could try using the linked list class, and add the following method: > > indexOf { arg obj; > var node, index = 0; > node = head; > while({ node.notNil }, { > if(node.obj == obj, { ^index }); > node = node.next; > index = index + 1; > }); > ^nil > } > whoops. it's already there in Seq Collection. sorry, i'm a dumbass... christian ------------------------------ Date: Tue, 24 Jul 2001 01:00:54 -0400 From: christian adam hresko <---@---.---> Subject: Re: Plug-in talk -Re: Mattel Power Glove tomonori yamasaki wrote: > I finally got a codewarrior at expo. (with free T-shirts!) I want to know > how many of us are looking into it, and planning to release open plug-ins > (not the one for yourself and secret) Because no two person should work on > the same plugin separately... It'll be nice to at least know what's > happening, so we can individually contact each other, to work together or > interact etc... > > I like the Vocoder idea, I'd like to see something like the one in Nord, > with graphic interface. > > Input plugins are nice too, some kind of generic serial plugin (some higher > rate than MIDI?) or USB plugin (we can get a group USB ID and share it for > the devices, as we share the plugin framework.) I can work on making USB > microcontroller chip prototype (a board with chips USB jack and open ports, > with minimum firmware, so everybody can get sorce, or distribute chip so you > can connect just sensors...) > > There weren't much new stuff at mac expo. They took off the line-in for > desktop, saying no pro use line-in. They're against internet phone ei? well, i checked out wacom's website, and all the code is there. here's the important stuff: Boolean GetTablet(void) { myCntrlParam wacomDriverControl; short driverRefNum; Boolean getTabletResult = true; if (OpenDriver("\p.Wacom", &driverRefNum) != noErr) { // don't run if no driver installed getTabletResult = false; goto EXIT; } wacomDriverControl.ioCRefNum = driverRefNum; wacomDriverControl.csCode = GET_RECORD; if (PBStatusSync((ParmBlkPtr)(&wacomDriverControl)) != noErr) { getTabletResult = false; goto EXIT; } gTheTabletData = (tabletRecord *)(wacomDriverControl.csParam[0]); EXIT: return(getTabletResult); } so you're basically using a pointer to access the tablet struct. you compile the tablet plugin (available from the wacom site as well) and drop it in you extensions folder. i'm assuming other USB devices have similar APIs (so to speak...) the code for the wacom USB plugin isn't available though, so i have no idea what's going on there. (not really in the mood to break any laws today and reverse engineer the little bugger. i'm a model citizen...) the struct seems to be an apple defined struct from Apple Tech. Note #266 version #2. hopefully other USB hardware developers follow this convention. if 'we' could figure out how to translate the above into an SC plugin, that plugin would act as a primitive in SC, and the wacom plugin drops in your extensions folder. if done successfully, i suppose we could start looking at other USB interfaces and come up with a USB to SC plugin template based on this little experiment. maybe? christian ------------------------------ Date: Tue, 24 Jul 2001 02:32:39 -0400 From: christian adam hresko <---@---.---> Subject: can't find superclass if i have the following: MyClass : LinkedList why do i get a 'Cannot find superclass 'LinkedList' for class MyClass' in file... error? MyClass is in a separate file. i don't get this error if MyClass is in the same file as LinkedList. cheers, christian ------------------------------ Date: Tue, 24 Jul 2001 02:50:30 -0400 From: christian adam hresko <---@---.---> Subject: nested ifs is there a robust way of nesting if statements in SC? for example, i have the following C++ code: void BinaryTree::insert(node *&cur, int &key) { if(NULL == cur) { cur = new node; cur->left = cur->right = NULL; cur->value = key; cur->count = 0; if(NULL == first && NULL == last) // doubly linked list upkeep { first = last = cur; cur->prev = head; cur->next = tail; cur->prev->next = cur; cur->next->prev = cur; } else if(tail->prev == first) { last = cur; cur->prev = first; cur->next = tail; cur->prev->next = cur; cur->next->prev = cur; } else { cur->prev = last; cur->next = tail; cur->prev->next = cur; cur->next->prev = cur; } else if(key < cur->value) //search tree for avail new node insert(cur->left, key); else if(key > cur->value) insert(cur->right, key); else return; cur->count++; //update count field } since there's no else if in SC, i have a whopping mess. i think the above code is pretty clean C++ wise, but in SC land it's really ugly. thanks. cheers, christian ------------------------------ Date: Tue, 24 Jul 2001 17:11:45 +1100 From: newton armstrong <---@---.---> Subject: Re: Plug-in talk -Re: Mattel Power Glove christian adam hresko wrote: > if 'we' could figure out how to translate the above into an SC plugin, that > plugin would act as a primitive in SC, and the wacom plugin drops in your > extensions folder. if done successfully, i suppose we could start looking at > other USB interfaces and come up with a USB to SC plugin template based on this > little experiment. > > maybe? Adam Schabtach has made an external for Max which polls data from any generic USB (Input Sprocket) device. I've been using it a bit with hacked game controllers, sending data to SC via OSC. Anyway, I don't think there's a need for making a SC plug-in for each and every USB device - all of them could be accommodated by a single class, as with Adam's external. Maybe it's worth asking him if his C code is in the public domain... ------------------------------ Date: Tue, 24 Jul 2001 02:38:25 -0500 From: James McCartney <---@---.---> Subject: Re: nested ifs on 7/24/01 1:50 AM, christian adam hresko at godpup@ix.netcom.com wrote: > for example, i have the following C++ code: I think your function could be hugely simplified by refactoring. Martin Fowler's book Refactoring would be a good read. The principle of "once and only once" could be applied. For example the lines cur->prev->next = cur; cur->next->prev = cur; occur three times in this function. C++ compilers are very good about inlining these days. You should put repeated things into separate functions. Fowler: "Number one in the stink parade is duplicated code. If you see the same code structure in more than one place, you can be sure that your program would be better if you find a way to refactor it." My suspicion is your first three cases could be collapsed into one with two one liner if statements. I would try to rewrite it but I don't understand it. Why do you need a first and a last and a head and a tail? I thought a binary tree node had a left child, a right child, a key and maybe a parent pointer. Or is this really an N-ary tree? - -- Anyway there are no control structures in SC that are not method calls so you have to use method call syntax. I sometimes write it like this: if (testA, { stmtA },{ if (testB { stmtB },{ if (testC { stmtC },{ stmt })})}); - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Tue, 24 Jul 2001 03:41:17 -0400 From: christian adam hresko <---@---.---> Subject: Re: Plug-in talk -Re: Mattel Power Glove newton armstrong wrote: > christian adam hresko wrote: > > > if 'we' could figure out how to translate the above into an SC plugin, that > > plugin would act as a primitive in SC, and the wacom plugin drops in your > > extensions folder. if done successfully, i suppose we could start looking at > > other USB interfaces and come up with a USB to SC plugin template based on this > > little experiment. > > > > maybe? > > Adam Schabtach has made an external for Max which polls data from any > generic USB (Input Sprocket) device. I've been using it a bit with > hacked game controllers, sending data to SC via OSC. Anyway, I don't > think there's a need for making a SC plug-in for each and every USB > device - all of them could be accommodated by a single class, as with > Adam's external. Maybe it's worth asking him if his C code is in the > public domain... yeah, that would be cool. an all purpose USB sprocket. i don't own/use Max/MSP or know who adam schabtach is, but if you can get some code (or ideas) that would be helpful. chEErs, christian ------------------------------ Date: Tue, 24 Jul 2001 02:45:35 -0500 From: James McCartney <---@---.---> Subject: Re: can't find superclass on 7/24/01 1:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > i don't get this error if MyClass is in the same file as LinkedList. What other classes are in the file? You cannot have classes in the same file that inherit outside of the file from two different classes. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Tue, 24 Jul 2001 10:18:08 +0200 From: Julian Rohrhuber <---@---.---> Subject: codewarrior 5 are the plugin projects compatible with codewarrior 5? ------------------------------ Date: Tue, 24 Jul 2001 04:32:29 -0400 From: christian adam hresko <---@---.---> Subject: Re: nested ifs James McCartney wrote: > on 7/24/01 1:50 AM, christian adam hresko at godpup@ix.netcom.com wrote: > > > for example, i have the following C++ code: > > I think your function could be hugely simplified by refactoring. > Martin Fowler's book Refactoring would be a good read. > The principle of "once and only once" could be applied. > For example the lines > cur->prev->next = cur; > cur->next->prev = cur; > occur three times in this function. thanks for the tip. i'll check out his book. we never went over refactoring in my data structures class. (or any of my programming classes for that matter....) > > C++ compilers are very good about inlining these days. i was never taught inlining in college. i've been reading up on inlining code, and from what i understand, inlining a function causes the compiler to attempt to generate the function code once rather than 'calling' the function. yes? i believe this is extremely important for real-time or just-in-time systems/programs. > > You should put repeated things into separate functions. > Fowler: "Number one in the stink parade is duplicated code. If you see the > same code structure in more than one place, you can be sure that your > program would be better if you find a way to refactor it." > > My suspicion is your first three cases could be collapsed into one with two > one liner if statements. > I would try to rewrite it but I don't understand it. > Why do you need a first and a last and a head and a tail? > I thought a binary tree node had a left child, a right child, a key and > maybe a parent pointer. Or is this really an N-ary tree? this data structure is a binary search tree AND a doubly linked list. the main problem this introduces, is the remove method. say you have the following: 7 / \ 5 11 / 9 \ 10 if you want to remove 7, you could findMin(right) which is 9, copy the value of the node which contains 9 (value = 9), replace the value of the node containing 7 with the value 9, and have the left pointer of the node with a value of 11 point to 10. and then delete the node which used to contain the value 9. but this completely messes up the doubly linked list. but it's all good and it works perfectly after relinking instead of copying values. it was a pain in the ass, but it works with any given condition. just so i could keep track of things, i also have a pointer to the first node in the list and the last node in the list. this isn't necessary, but it helped me organize my program better... also, i have to relink the right, left, first and last pointers in each node to maintain the structure of the tree and the list. not to mention the head and the tail in special cases. the entire thing is finished in C++. it works quite well and meets the time requirements of a binary search tree. (nlogn) the doubly linked list aspect allows you to traverse through the tree in the order in which you've inserted each item without using a time stamp. this in turn allows for methods like finding the kth oldest value. actually, here's a list of the supported methods: search //search insert //insert remove //remove min //find min extractMin //find min and remove height //find height showValue //output node values in decreasing order dumpList //dump node values in the order in which they were inserted findK //output the kth smallest value showK //output the kth oldest value fullNodes //output the number of nodes with two children the only thing is, it's not AVL balanced. i didn't have time to balance the tree. (the doubly linked list aspect makes this extra yucky...) so it can approach a worse case scenario of O(n). maybe i'll fix this later... so... i'm 'porting' this whopping thing to SC. > > > -- > > Anyway there are no control structures in SC that are not method calls so > you have to use method call syntax. > > I sometimes write it like this: > > if (testA, { > stmtA > },{ > if (testB { > stmtB > },{ > if (testC { > stmtC > },{ > stmt > })})}); > i'll follow this pattern. thanks for the help. this is going to be a little more difficult than i thought. cheers, christian ------------------------------ Date: Tue, 24 Jul 2001 04:38:51 -0400 From: christian adam hresko <---@---.---> Subject: Re: codewarrior 5 Julian Rohrhuber wrote: > are the plugin projects compatible with codewarrior 5? yes. you'll get a message asking if you want to convert the projects. cheers, christian ------------------------------ Date: Tue, 24 Jul 2001 04:42:38 -0400 From: christian adam hresko <---@---.---> Subject: Re: can't find superclass James McCartney wrote: > on 7/24/01 1:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > > > i don't get this error if MyClass is in the same file as LinkedList. > > What other classes are in the file? > > You cannot have classes in the same file that inherit outside of the file > from two different classes. > i was just trying to create a BinSeaTree.sc file with one class. (the binary search tree and doubly linked list class) so it looked like: BinSeaTreeNode{... } BinSeaTree : LinkedList {... } this produced the error at compile time. placing this in the same file as the LinkedList class works. so why is this causing a problem? cheers, christian ------------------------------ Date: Tue, 24 Jul 2001 20:02:59 +1100 From: newton armstrong <---@---.---> Subject: Re: can't find superclass christian adam hresko wrote: > > James McCartney wrote: > > > on 7/24/01 1:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > > > > > i don't get this error if MyClass is in the same file as LinkedList. > > > > What other classes are in the file? > > > > You cannot have classes in the same file that inherit outside of the file > > from two different classes. > > > > i was just trying to create a BinSeaTree.sc file with one class. (the binary > search tree and doubly linked list class) > > so it looked like: > > BinSeaTreeNode{... > } > > BinSeaTree : LinkedList {... > } > > this produced the error at compile time. > > placing this in the same file as the LinkedList class works. > > so why is this causing a problem? Because BinSeaTreeNode inherits from Object and BinSeaTree inherits from LinkedList. That's your two classes outside the file. ------------------------------ Date: Tue, 24 Jul 2001 12:01:34 -0400 (EDT) From: Paul Lansky <---@---.---> Subject: Re: atIdentityHash Thanks james, this does the trick? will it be in the bug fixes? paul ======== Yes there is a bug which you can fix as follows : In SequenceableCollection, add the following method: indexOfEqual { arg item; this.do({ arg elem, i; if ( item == elem, { ^i }) }); ^nil } etc ------------------------------ Date: Tue, 24 Jul 2001 12:05:27 -0400 (EDT) From: Paul Lansky <---@---.---> Subject: Re: atIdentityHash whoops, I spoke a bit too soon. Doesn't seem to work when you substitute a variable. e.g. z = 66; [123,[45,6,2],66,1,[00,3]].indexOfEqual(z).postln; Am I missing something? paul ------------------------------ Date: Tue, 24 Jul 2001 12:09:33 -0400 (EDT) From: Paul Lansky <---@---.---> Subject: Re: atIdentityHash but, it works if you say z = [00,3]; [123,[45,6,2],66,1,[00,3]].indexOfEqual(z.asArray).postln; or z = 123; [123,[45,6,2],66,1,[00,3]].indexOfEqual(z.asInt).postln; paul ------------------------------ Date: Tue, 24 Jul 2001 10:06:33 -0600 From: Michael Theodore <---@---.---> Subject: Your tutorials Greetings, Would you mind pointing me to the new version of your tutorials? many thanks, Michael ------------------------------ Date: Tue, 24 Jul 2001 11:15:10 -0500 From: James McCartney <---@---.---> Subject: Re: atIdentityHash on 7/24/01 11:05 AM, Paul Lansky at paul@silvertone.Princeton.EDU wrote: > whoops, I spoke a bit too soon. Doesn't seem to work when you substitute > a variable. e.g. > > z = 66; > [123,[45,6,2],66,1,[00,3]].indexOfEqual(z).postln; > > Am I missing something? > > paul Works for me. (after those fixes are put in). Anyway indexOfEqual has no idea that the 66 was a constant or a variable, because arguments are passed by value. It gets the value 66 in either case. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Tue, 24 Jul 2001 11:16:11 -0500 From: James McCartney <---@---.---> Subject: Re: Your tutorials on 7/24/01 11:06 AM, Michael Theodore at michael.theodore@colorado.edu wrote: > Greetings, > Would you mind pointing me to the new version of your tutorials? > many thanks, > Michael > See the question on tutorials here: http://www.audiosynth.com/scfaq.html - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Tue, 24 Jul 2001 11:27:34 -0500 From: James McCartney <---@---.---> Subject: Re: atIdentityHash on 7/24/01 11:09 AM, Paul Lansky at paul@silvertone.Princeton.EDU wrote: > but, it works if you say > > z = [00,3]; > [123,[45,6,2],66,1,[00,3]].indexOfEqual(z.asArray).postln; > > or > > z = 123; > [123,[45,6,2],66,1,[00,3]].indexOfEqual(z.asInt).postln; > > paul > I just applied the fixes to a stock version of 2.2.10 and the following all work fine: z = 66; [123,[45,6,2],66,1,[00,3]].indexOfEqual(z).postln; 2 z = [00,3]; [123,[45,6,2],66,1,[00,3]].indexOfEqual(z).postln; 4 z = 123; [123,[45,6,2],66,1,[00,3]].indexOfEqual(z).postln; 0 - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Tue, 24 Jul 2001 11:33:04 -0600 From: Michael Theodore <---@---.---> Subject: Re: Your tutorials Oops - this was meant to go to David Cottle only. Apologies. Michael Theodore wrote: > Greetings, > Would you mind pointing me to the new version of your tutorials? > many thanks, > Michael ------------------------------ Date: Tue, 24 Jul 2001 14:53:48 -0400 From: christian adam hresko <---@---.---> Subject: Re: nested ifs i wrote: > > > the entire thing is finished in C++. it works quite well and meets the time > requirements of a binary search tree. (nlogn) > whoops. i should get an F for that one. the time complexity is O(logn). not O(nlogn). base 2 of course. bad christian. ------------------------------ Date: Tue, 24 Jul 2001 21:29:57 +0200 From: Julian Rohrhuber <---@---.---> Subject: Re: codewarrior 5 >Julian Rohrhuber wrote: > >> are the plugin projects compatible with codewarrior 5? > >yes. > >you'll get a message asking if you want to convert the projects. > > >cheers, > >christian oh, I just realize that I have CW 4. this does probably not work, I guess...? ------------------------------ Date: Tue, 24 Jul 2001 21:37:13 +0200 From: Julian Rohrhuber <---@---.---> Subject: sc-swiki up again sc-swiki is up again. We are now running it on macos 9 as the problems with the unix became too weird. Of course this means it is not as fast for now. We will try to move it back, but we'll have to experiment first. There is some new interesting contributions by David Cottle (thanks!) on: http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/19 (tutorials) and http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/72 (scplay app) that are worth hearing. ------------------------------ Date: Tue, 24 Jul 2001 21:39:37 +0200 From: Julian Rohrhuber <---@---.---> Subject: Re: atIdentityHash > > >z = 123; >[123,[45,6,2],66,1,[00,3]].indexOfEqual(z).postln; >0 > > > >--- james mccartney james@audiosynth.com >SuperCollider - a real time synthesis programming language for the PowerMac. > ah, nice! so I can throw out my clumsy indexOfLike from the MarkovSet classes... ------------------------------ Date: Tue, 24 Jul 2001 14:45:37 -0500 From: James McCartney <---@---.---> Subject: Re: sc-swiki up again on 7/24/01 2:37 PM, Julian Rohrhuber at sa6a014@rzaixsrv2.rrz.uni-hamburg.de wrote: > sc-swiki is up again. > on: http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/19 (tutorials) > and http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/72 (scplay app) 404 errors for me. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Tue, 24 Jul 2001 14:03:17 -0400 From: Lee Azzarello <---@---.---> Subject: Re: Mattel Power Glove on 7/23/01 6:14 PM, JoJoBuBu@aol.com at JoJoBuBu@aol.com wrote: > Now a question out of curiosity. What are you doing with the old music? Theres > a community of people that remake this type of old music as well, although > theres some controversy with copyright. I've never seen people do live remakes > of it though... I'm going to transcribe and arrange the tunes and we're going to play them live with a 5 piece band. Guitar, Bass, Drums, Synthesizer, Laptop. The power glove is going to be the icing on the cake. I think it'll be so fresh to bust out a theremin style PowerGlove solo during the main theme to Metroid. - -------------------- - -l[e^2] *old { ^this.shouldNotImplement(thisMethod) } http://eds.org/~lee ------------------------------ Date: Tue, 24 Jul 2001 14:51:08 -0400 From: christian adam hresko <---@---.---> Subject: Re: can't find superclass newton armstrong wrote: > christian adam hresko wrote: > > > > James McCartney wrote: > > > > > on 7/24/01 1:32 AM, christian adam hresko at godpup@ix.netcom.com wrote: > > > > > > > i don't get this error if MyClass is in the same file as LinkedList. > > > > > > What other classes are in the file? > > > > > > You cannot have classes in the same file that inherit outside of the file > > > from two different classes. > > > > > > > i was just trying to create a BinSeaTree.sc file with one class. (the binary > > search tree and doubly linked list class) > > > > so it looked like: > > > > BinSeaTreeNode{... > > } > > > > BinSeaTree : LinkedList {... > > } > > > > this produced the error at compile time. > > > > placing this in the same file as the LinkedList class works. > > > > so why is this causing a problem? > > Because BinSeaTreeNode inherits from Object and BinSeaTree inherits from > LinkedList. That's your two classes outside the file. is this a smalltalk thing, or an SC thing? i don't recall this being an OOP (class based) language 'rule' in general. cheers, christian ------------------------------ Date: Tue, 24 Jul 2001 20:15:40 +0200 From: Sean Reed <---@---.---> Subject: synth cessation and out of memory > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. - --MS_Mac_OE_3078850540_1254393_MIME_Part Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable hi. i've got a couple of things i could use some suggestions on: first, i'm trying to design an patch in which several functions are defined that i can then repeatedly turn on and off at different times and in different combinations over the course of a piece. my first approach has been the following (bare-boned version just to demonstrate the basic idea): ( Synth.play({ arg synth; t =3D TSpawn.ar({}); u =3D t.source; e =3D Env.adsr(0.02, 0.2, 0.25, 1, 1, -4); f=3D { FSinOsc.ar(220 + 300.rand) * EnvGen.ar(e)}; s =3D Synth.new(f); synth.sched(0, { u.triggerSynth(s);}); synth.sched(1, { s.release; }); synth.sched(2, { u.triggerSynth(s); }); t }); ) the goal: the variable 's' is a function which is called, then gets turned off, then gets called at some point again later in the piece. in the above constellation i get the error message: =80 ERROR: internal error: Synth ended already. (to avoid this error, i have been assigning the same function to different variables, and calling and releasing them all separately, but i am not completely convinced of the efficiency of such an approach). so i tried putting the 'Synth.new' directly into the function within the 'synth.sched', as such: ( Synth.play({ arg synth; t =3D TSpawn.ar({}); u =3D t.source; e =3D Env.adsr(0.02, 0.2, 0.25, 1, 1, -4); f=3D { FSinOsc.ar(220 + 300.rand) * EnvGen.ar(e)}; synth.sched(0, { u.triggerSynth( Synth.new(f););}); t }); ) but now i can't seem to find the appropriate method to specifically turn of= f the newly created Synth. any suggestions? SECOND: using the basic structure of the first of the above two examples i have constructed a piece which uses Spawns of playBufs of AIFF files as the functions implemented within the 'Synth.new'. i have about 16 functions defined to variables and call them and then release them over the course of about 7 minutes (so far). i can open the patch and run it, and it (at least appears to) run perfectly, no glitches, no memory problems. however, when i stop (cmd-.) and immediately try to restart it without changing ANYTHING, i get the DANGER OUT of MEMORY error. when i recompile the library, it runs perfectly again. i don't get the error when i stock up the amount of RAM i have allotted to SC to 120MB, but with any less i always get the error when i try to run it a second time. i'm using a G4 with 256MB RAM and MAC-OS9.1. i'd be extremely grateful for any suggestion on how to rectify this problem as well. thanks,=20 best, sean reed - --MS_Mac_OE_3078850540_1254393_MIME_Part Content-type: text/html; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable synth cessation and out of memory hi. i've got a couple of things i could = use some suggestions on:

first,
i'm trying to design an patch in which several functions are defined that i= can then repeatedly turn on and off at different times and in different com= binations over the course of a piece. my first approach has been the followi= ng (bare-boned version just to demonstrate the basic idea):

(
Synth.play({
arg synth;
t =3D TSpawn.ar({});
u =3D t.source;
e =3D Env.adsr(0.02, 0.2, 0.25, 1, 1, -4);
f=3D { FSinOsc.ar(220 + 300.rand) * EnvGen.ar(e)};
s =3D Synth.new(f);
synth.sched(0, { u.triggerSynth(s);});
synth.sched(1, { s.release;  });
synth.sched(2, { u.triggerSynth(s); });
t
});
)

the goal: the variable 's' is a function which is called, then gets turned = off, then gets called at some point again later in the piece. in the above c= onstellation i get the error message:

=80 ERROR: internal error: Synth ended already.<= BR>
(to avoid this error, i have been assigning the same function to different = variables, and calling and releasing them all separately, but i am not compl= etely convinced of the efficiency of such an approach).

so i tried putting the 'Synth.new' directly into the function within the 's= ynth.sched', as such:

(
Synth.play({
arg synth;
t =3D TSpawn.ar({});
u =3D t.source;
e =3D Env.adsr(0.02, 0.2, 0.25, 1, 1, -4);
f=3D { FSinOsc.ar(220 + 300.rand) * EnvGen.ar(e)};
synth.sched(0, { u.triggerSynth( Synth.new(f);= );});
t
});
)

but now i can't seem to find the appropriate method to specifically turn of= f the newly created Synth.

any suggestions?

SECOND:
using the basic structure of the first of the above two examples i have con= structed a piece which uses Spawns of playBufs of AIFF files as the function= s implemented within the 'Synth.new'. i have about 16 functions defined to v= ariables and call them and then release them over the course of about 7 minu= tes (so far). i can open the patch and run it, and it (at least appears to) = run perfectly, no glitches, no memory problems. however, when i stop (cmd-.)= and immediately try to restart it without changing ANYTHING, i get the DANG= ER OUT of MEMORY error. when i recompile the library, it runs perfectly agai= n. i don't get the error when i stock up the amount of RAM i have allotted t= o SC to 120MB, but with any less i always get the error when i try to run it= a second time. i'm using a G4 with 256MB RAM and MAC-OS9.1.

i'd be extremely grateful for any suggestion on how to rectify this problem= as well.

thanks,
best,
sean reed
- --MS_Mac_OE_3078850540_1254393_MIME_Part-- ------------------------------ Date: Tue, 24 Jul 2001 15:16:09 -0500 From: James McCartney <---@---.---> Subject: Re: can't find superclass on 7/24/01 1:51 PM, christian adam hresko at godpup@ix.netcom.com wrote: > is this a smalltalk thing, or an SC thing? i don't recall this being an OOP > (class based) language 'rule' in general. The compiler has to create an order for the files to be compiled that allows the classes to be compiled from Object down to the leaves. If you inherit from two classes outside the file, it tangles the graph. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Tue, 24 Jul 2001 22:22:46 +0200 From: Julian Rohrhuber <---@---.---> Subject: Re: sc-swiki up again >on 7/24/01 2:37 PM, Julian Rohrhuber at sa6a014@rzaixsrv2.rrz.uni-hamburg.de >wrote: > >> sc-swiki is up again. > >> on: http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/19 (tutorials) >> and http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/72 (scplay app) > >404 errors for me. nowhere to try except from home later. Anyone else the same problem? ------------------------------ Date: Tue, 24 Jul 2001 16:40:08 -0400 From: "crucial" <---@---.---> Subject: Re: can't find superclass >> Because BinSeaTreeNode inherits from Object and BinSeaTree inherits from >> LinkedList. That's your two classes outside the file. > >is this a smalltalk thing, or an SC thing? i don't recall this being an OOP >(class based) language 'rule' in general. > its an SC thing. Objective C, since it does dynamic binding, can add classes and methods even while running. Normal smalltalk certainly can do that. you can even add methods to classes and the already instantiated objects will then have those powers granted. SC compiles its library, fixes its class and method structure. this is partly for speed, partly for clarity. there is some confusion for the compiler trying to figure out what all the files are and where its supposed to look for what... >cheers, > >christian > > > _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Tue, 24 Jul 2001 16:41:55 -0400 From: Andrei <---@---.---> Subject: Re: sc-swiki up again On Tue, 24 Jul 2001, Julian Rohrhuber wrote: > >on 7/24/01 2:37 PM, Julian Rohrhuber at sa6a014@rzaixsrv2.rrz.uni-hamburg.de > >wrote: > > > >> sc-swiki is up again. > > > >> on: http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/19 (tutorials) > >> and http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/72 (scplay app) > > > >404 errors for me. > > nowhere to try except from home later. > Anyone else the same problem? Works for me. Great. Andrei ------------------------------ Date: Tue, 24 Jul 2001 14:42:36 -0600 From: "David Cottle" <---@---.---> Subject: Re: sc-swiki up again >> on 7/24/01 2:37 PM, Julian Rohrhuber at sa6a014@rzaixsrv2.rrz.uni-hamburg.de >> wrote: >> >>> sc-swiki is up again. >> >>> on: http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/19 (tutorials) >>> and http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/72 (scplay app) >> >> 404 errors for me. > > nowhere to try except from home later. > Anyone else the same problem? Works ok for me. - -- ><><><><><><><><><><><> David Cottle, computer music, contra, cottle@cerlsoundgroup.org "When one arrives at this correct conception of art, there can be no more distinction between science and inspired creating. The farther one presses, the more everything becomes identical, and at last one has the impression of encountering no human work, but rather a work of Nature." ‹Webern ------------------------------ Date: Tue, 24 Jul 2001 14:44:09 -0600 From: "David Cottle" <---@---.---> Subject: Re: sc-swiki up again > We will try to move it back, but we'll have to experiment first. > There is some new interesting contributions by David Cottle (thanks!) I've been updating them a lot. As a matter of fact I've combined the two texts and will be uploading soon. Who can (or how do I) remove the old files. They're pretty large. - -- ><><><><><><><><><><><> David Cottle, computer music, contra, cottle@cerlsoundgroup.org "When one arrives at this correct conception of art, there can be no more distinction between science and inspired creating. The farther one presses, the more everything becomes identical, and at last one has the impression of encountering no human work, but rather a work of Nature." ‹Webern ------------------------------ Date: Tue, 24 Jul 2001 16:58:09 -0500 From: "t. krakowiak" <---@---.---> Subject: Re: sc-swiki up again mine works ok. > Anyone else the same problem? > ------------------------------ End of sc-users-digest V1 #332 ******************************