From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #342 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 Sunday, August 12 2001 Volume 01 : Number 342 ---------------------------------------------------------------------- Date: Fri, 10 Aug 2001 12:31:17 -0400 From: christian adam hresko <---@---.---> Subject: Re: keeps getting nilled James McCartney wrote: > 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. > man, i can be such a simpleton sometimes. thanks. cheers, christian ------------------------------ Date: Fri, 10 Aug 2001 10:01:49 -0700 From: "Thomas Miley" <---@---.---> Subject: Re: TSpawn question is zero considered positive? - ----- Original Message ----- From: "James McCartney" <---@---.---> To: Sent: Thursday, August 09, 2001 8:06 PM 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 13:03:40 -0400 From: christian adam hresko <---@---.---> Subject: Re: TSpawn question Thomas Miley wrote: > is zero considered positive? 0.isPositive.postln; true cheers, christian ------------------------------ Date: Fri, 10 Aug 2001 12:10:33 -0500 From: James McCartney <---@---.---> Subject: Re: TSpawn question on 8/10/01 12:01 PM, Thomas Miley at tmiley@prodigy.net wrote: > is zero considered positive? Zero is non-positive. A trigger is a transition from non-positive to positive. >> 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 12:19:56 -0500 From: James McCartney <---@---.---> Subject: Re: TSpawn question on 8/10/01 12:03 PM, christian adam hresko at godpup@ix.netcom.com wrote: >> is zero considered positive? > > 0.isPositive.postln; > > true Hmm. I copied the implementation of isPositive and isStrictlyPositive from some functional language but I don't like it. They are never really used anyway. I should remove them. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Fri, 10 Aug 2001 14:45:08 -0400 From: christian adam hresko <---@---.---> Subject: Re: keeps getting nilled James McCartney wrote: > 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. > i still don't get why my tree is getting nilled. i changed the search method to: search { arg key; var val; val = this.searchBST(tree, key); ^val; } so now this properly returns. but after a first insertion, it still returns nil. somewhere in my code, tree is not being updated. are 'pointers' in SC treated differently than in C++? (this works fine in the C++ code...) or does tree have to be explicitly assigned a new value? i.e. tree = something... as opposed to: this.searchBST(tree, key); searchBST { arg cur, key; //cur should now be tree if (cur.isNil, { ^nil the above is what keeps happening. but tree should contain whatever was inserted, and no longer be nil. but i can't do this: searchBST { arg cur, key; tree = cur; ... ... because the method is recursive, and i don't want to assign cur to tree on each call. i'm kinda stumped as to why tree is nil... cheers, christian ------------------------------ Date: Fri, 10 Aug 2001 14:09:48 -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: > if (key < cur.obj, { > this.searchBST(cur.left, key); > },{ > if (key > cur.obj, { > this.searchBST(cur.right, key); > },{ > })})})}); You don't return anything here either. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Fri, 10 Aug 2001 15:23:57 -0400 From: christian adam hresko <---@---.---> Subject: Re: keeps getting nilled James McCartney wrote: > on 8/10/01 3:11 AM, christian adam hresko at godpup@ix.netcom.com wrote: > > > if (key < cur.obj, { > > this.searchBST(cur.left, key); > > },{ > > if (key > cur.obj, { > > this.searchBST(cur.right, key); > > },{ > > })})})}); > > You don't return anything here either. > why do i have to return something here? i thought the only time i needed or wanted to return something, was in: if (cur.isNil, { ^nil; },{ if (key == cur.obj, { ^cur.obj; },{ are you saying i have to: if (key < cur.obj, { ^this.searchBST(cur.left, key); },{ if (key > cur.obj, { ^this.searchBST(cur.right,key); },{ but the first time i insert, let's say 6, and i search for 6, the key == cur.obj condition should be met, and cur.obj should be returned. this isn't happening. cheers, christian ------------------------------ Date: Fri, 10 Aug 2001 14:36:32 -0500 From: James McCartney <---@---.---> Subject: Re: keeps getting nilled on 8/10/01 2:23 PM, christian adam hresko at godpup@ix.netcom.com wrote: > why do i have to return something here? 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); },{ })})})}); } OK what happens: if cur is nil you return nil, else if key == cur.obj you return cur.obj else if key < cur.obj you call this.searchBST after which, since you do not specify a return value, the method returns 'this'. else if key > cur.obj you call this.searchBST after which, since you do not specify a return value, the method returns 'this'. else you return 'this'. In C++ it would not compile because you have a non void function with a void return. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Fri, 10 Aug 2001 16:31:08 -0400 From: christian adam hresko <---@---.---> Subject: Re: keeps getting nilled James McCartney wrote: > on 8/10/01 2:23 PM, christian adam hresko at godpup@ix.netcom.com wrote: > > > why do i have to return something here? > > 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); > },{ > })})})}); > } > > OK what happens: > if cur is nil you return nil, > else if key == cur.obj you return cur.obj > else if key < cur.obj you call this.searchBST after which, since you do > not specify a return value, the method returns 'this'. > else if key > cur.obj you call this.searchBST after which, since you do > not specify a return value, the method returns 'this'. > else you return 'this'. > > In C++ it would not compile because you have a non void function with a void > return. > yes, in my C++ implementation, the private member function is a void function. it just prints out " has been found" or " has not been found." in SC, this wouldn't make sense because you'd want to use that value for something, so i made it return. so i'm assuming i have to ^this.searchBST(cur.left, key); and ^this.searchBST(cur.right, key); },{ ^nil; or this.searchBST(cur.left, key); ^nil; and this.searchBST(cur.right, key); ^nil; },{ ^nil; ??? but here's my current problem. right now, key does equal cur.obj, but it's returning nil. this tells me that tree is meeting the condition cur.isNil, even after an insertion has been performed. var bTree; bTree = BinSeaTree.new; bTree.insert(6); bTree.search(6).postln; nil so my problem is two fold. cheers, christian ------------------------------ Date: Fri, 10 Aug 2001 23:00:34 -0500 From: James McCartney <---@---.---> Subject: Re: keeps getting nilled tree is nil, because it is never set to anything. You assign nil to tree in the constructor and there are no other assignments to tree in the code. One more thing : cur.left = cur.right = nil; will not do what you expect because it gets translated to: cur.left_(cur.right_(nil)); And setters like cur.right_(nil) always return the receiver, not the argument. do this: cur.left = nil; cur.right = nil; ------------------------------ Date: Sat, 11 Aug 2001 00:57:49 -0400 From: christian adam hresko <---@---.---> Subject: Re: keeps getting nilled James McCartney wrote: > tree is nil, because it is never set to anything. > You assign nil to tree in the constructor and there are no other assignments > to tree in the code. i thought the following would implicitly set cur to tree: insert { arg key; insertBST(tree, key); } insertBST {arg cur, key; ... ... } isn't tree passed as the argument, and therefore whatever operations are performed on cur, are actually being performed on tree (at least on the first call before insertBST is recursively called with cur.left or cur.right)? is this a pass by value vs. pass by reference problem? my C++ code looks like: void insert (int key) { //private insert method insert(tree, key); } void insert (node *&cur, int &key) { if(NULL == cur) { cur = new node; cur->value = key; //etc, etc.. } //more code } is there an equivalent of this in SC? > > > One more thing : > > cur.left = cur.right = nil; > > will not do what you expect because it gets translated to: > > cur.left_(cur.right_(nil)); > And setters like cur.right_(nil) always return the receiver, not the > argument. ahhh... so cur.left would get set to cur.right? (with no nil...) > > > do this: > > cur.left = nil; > cur.right = nil; okay, i'll change this. thanks for the tip. cheers, christian ------------------------------ Date: Sat, 11 Aug 2001 00:52:21 -0500 From: James McCartney <---@---.---> Subject: Re: keeps getting nilled on 8/10/01 11:57 PM, christian adam hresko at godpup@ix.netcom.com wrote: > i thought the following would implicitly set cur to tree: no. > > my C++ code looks like: > > void insert (int key) > { > //private insert method > insert(tree, key); > } > > void insert (node *&cur, int &key) > { > if(NULL == cur) > { > cur = new node; > cur->value = key; > //etc, etc.. > } > > //more code > } > > is there an equivalent of this in SC? There are no pointers in SC (or Smalltalk, or LISP, or many other languages). You can't have a pointer to a variable. SC is strictly pass by value. > ahhh... so cur.left would get set to cur.right? (with no nil...) No. cur.left gets set to cur. I'm sure this is boring most people here.. The list is not for interactive code debugging. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Sat, 11 Aug 2001 07:55:02 -0400 From: christian adam hresko <---@---.---> Subject: Re: keeps getting nilled James McCartney wrote: > > > I'm sure this is boring most people here.. > The list is not for interactive code debugging. > okay, i'll stop asking questions. c. ------------------------------ Date: Sat, 11 Aug 2001 14:03:31 +0200 From: Wouter Snoei <---@---.---> Subject: hammerfallDSP vs motu828 Hi, Does anyone on the list have a lot of experience with the RME Hammerfall DSP Multiface / Cardbus interface on a powerbook? I am considering purchase of one for my titanium PBg4, but I'm not sure if I'd better buy a Motu828 instead (it's about 1.5 times as expensive and I can't find any important differences between the two in the specs). Or if there are any other solutions in this price range - I need 8 i/o's + adat interface. cheers, Wouter ------------------------------ Date: Sat, 11 Aug 2001 08:38:20 -0700 From: jr@xs4all.nl (joel ryan) Subject: Re: hammerfallDSP vs motu828 Wouter , according to the MAX people at CNMAT there is a fatal flaw in the motu/firewire combination which manefests itself when cpu load goes above 40% they are putting their hope in RME but no real experience that I know of yet Joel At 14:03 +0200 8/11/01, you wrote: >Hi, > >Does anyone on the list have a lot of experience with the RME Hammerfall DSP >Multiface / Cardbus interface on a powerbook? I am considering purchase of >one for my titanium PBg4, but I'm not sure if I'd better buy a Motu828 >instead (it's about 1.5 times as expensive and I can't find any important >differences between the two in the specs). Or if there are any other >solutions in this price range - I need 8 i/o's + adat interface. > >cheers, Wouter - -- - -=-=-=-=---=-=-=-=-===-----=-==-=-=-====---=------=-------- Joel Ryan STEIM :: Ballett Frankfurt :: Institute of Sonology Achtergracht 19, 1017WL Amsterdam +31 (20) 624-3886 +31 (20) 626-4262 fax http://www.frankfurt-ballett.de/joel.html http://www.steim.nl ------------------------------ Date: Sat, 11 Aug 2001 11:57:08 -0400 (EDT) From: "Ronald J. Kuivila" <---@---.---> Subject: Re: hammerfallDSP vs motu828 Hi there, Personally, I am waiting to see about the RME Cardbus/Multiface. The RME puff page is indicating much better input latency down to a couple of milliseconds. User reports for the 828 seem to indicate 64 - 128 msec as best possible. ( This would make sense, as that interface has more or less direct access to the PC buss, where the 828 has to deal with Apple's Firewire implementation.) Also, there are continuing problems with USB/MIDI in contexts of continuous moderately heavy load. The built in MIDI interfaces on the RME products should work around that problem. (On desktop machines I replace the modem with a Griffin serial port to avoid the whole USB issue.) RJK On Sat, 11 Aug 2001, joel ryan wrote: > Wouter , > > according to the MAX people at CNMAT there is a fatal > flaw in the motu/firewire combination > which manefests itself when cpu load goes above 40% > they are putting their hope in RME > but no real experience that I know of yet > Joel > At 14:03 +0200 8/11/01, you wrote: > > >Hi, > > > >Does anyone on the list have a lot of experience with the RME Hammerfall DSP > >Multiface / Cardbus interface on a powerbook? I am considering purchase of > >one for my titanium PBg4, but I'm not sure if I'd better buy a Motu828 > >instead (it's about 1.5 times as expensive and I can't find any important > >differences between the two in the specs). Or if there are any other > >solutions in this price range - I need 8 i/o's + adat interface. > > > >cheers, Wouter > > -- > -=-=-=-=---=-=-=-=-===-----=-==-=-=-====---=------=-------- > Joel Ryan > STEIM :: Ballett Frankfurt :: Institute of Sonology > Achtergracht 19, 1017WL Amsterdam > +31 (20) 624-3886 > +31 (20) 626-4262 fax > http://www.frankfurt-ballett.de/joel.html > http://www.steim.nl > ------------------------------ Date: Sat, 11 Aug 2001 18:00:42 +0100 From: Arie van Schutterhoef <---@---.---> Subject: Re: hammerfallDSP vs motu828 >they are putting their hope in RME - -RME also seem to have a much better latency (2.73ms). as far I've read their information on their website, it's also much better expandable to more channels: http://www.rme-audio.com/english/hammer/d9652.htm AvS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................................................. ^ 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: Sat, 11 Aug 2001 11:22:50 -0500 From: James McCartney <---@---.---> Subject: Re: keeps getting nilled on 8/11/01 6:55 AM, christian adam hresko at godpup@ix.netcom.com wrote: >> I'm sure this is boring most people here.. >> The list is not for interactive code debugging. >> > > okay, i'll stop asking questions. No that's not the point. The point is that posting on sc-users should not be an integral step in your edit-run-debug cycle. ;-) - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Sat, 11 Aug 2001 10:35:48 -0700 (PDT) From: Chad Kirby <---@---.---> Subject: Re: hammerfallDSP vs motu828 I would wait for the HammerfallDSP (is it actually shipping yet?). The MOTU 828 works OK until you hit 80% CPU, then it suddenly stops working, and you must restart SC to get it to make sound again. Very bad. Chad Kirby // Technical Coordinator for Digital Arts // CARTAH ckirby@u.washington.edu // 206.295.3592 On Sat, 11 Aug 2001 at 14:03, Wouter Snoei wrote: > Hi, > > Does anyone on the list have a lot of experience with the RME Hammerfall DSP > Multiface / Cardbus interface on a powerbook? I am considering purchase of > one for my titanium PBg4, but I'm not sure if I'd better buy a Motu828 > instead (it's about 1.5 times as expensive and I can't find any important > differences between the two in the specs). Or if there are any other > solutions in this price range - I need 8 i/o's + adat interface. > > cheers, Wouter > > ------------------------------ Date: Sat, 11 Aug 2001 20:45:21 +0100 (BST) From: JL Anderson <---@---.---> Subject: MAudio Quattro?? vs hammerfallDSP vs motu828 Along this thread. . . Has anyone tried out the 4/4 USB MAudio Quattro? (http://midiman.com/m-audio/product.htm) Ive seen it available for $260. Im entertaining the thought of a cheap and cheerful 4channel recording setup using a powerbook and one of these things. Id be wanting to bring 4chnls in and for most cases do a touch of processing and listen to 2chnls out. (Record 4chnls of ambisonic b-format, and monitor 2chnls of ambisonic uhj.) I had been thinking of the 828 for this application. But for $260, one could easily deal w/ the quattro until other firewire gear is on the market. Any thoughts?? On Sat, 11 Aug 2001, Chad Kirby wrote: > I would wait for the HammerfallDSP (is it actually shipping yet?). The > MOTU 828 works OK until you hit 80% CPU, then it suddenly stops working, > and you must restart SC to get it to make sound again. Very bad. > > Chad Kirby // Technical Coordinator for Digital Arts // CARTAH > ckirby@u.washington.edu // 206.295.3592 > > On Sat, 11 Aug 2001 at 14:03, Wouter Snoei wrote: > > > Hi, > > > > Does anyone on the list have a lot of experience with the RME Hammerfall DSP > > Multiface / Cardbus interface on a powerbook? I am considering purchase of > > one for my titanium PBg4, but I'm not sure if I'd better buy a Motu828 > > instead (it's about 1.5 times as expensive and I can't find any important > > differences between the two in the specs). Or if there are any other > > solutions in this price range - I need 8 i/o's + adat interface. > > > > cheers, Wouter > > > > > > ------------------------------ Date: Sat, 11 Aug 2001 15:33:19 -0700 From: Sean Rooney <---@---.---> Subject: plug.source problem -- possible newbie issue Hi- Apologies is this is a newbie issue, but I'm getting an error message (see the bottom of the message) when I try to update the source of a Plug using myPlug.source = blah... inside of a synth.repeat. Ver is 2.2.8. Interestingly, the same error message is generated when I run the example code from the synth help file. sean - --------- * ERROR: A primitive was not bound. 0 413 Instance of Method { (049B1690, gc=80, fmt=00, flg=81, set=04) instance variables [12] code : instance of Int8Array (049B1798, size=3, set=00) literals : nil prototypeFrame : instance of Array (049B1760, size=2, set=01) context : nil argNames : instance of Array (049B1728, size=2, set=01) varNames : nil ownerClass : class Plug (049B0A50) name : Symbol 'source_' primitiveName : Symbol '_Plug_Source' lineNo : Integer 25 byteMeter : Integer 0 callMeter : Integer 0 } ERROR: Primitive 'none' failed. Failed. RECEIVER: nil CALL STACK: Object::primitiveFailed arg this = nil Plug::source_ arg this = nil arg newSource = nil < FunctionDef in Method Interpreter::functionCompileContext > (no arguments or variables) < FunctionDef in Method Synth::repeat > arg synth = arg now = 0.000000 arg repeatFunc = Synth::play arg this = arg duration = nil Meta_Synth::play arg this = class Synth arg ugenGraphFunc = arg duration = nil var newsynth = Function::play arg this = arg duration = nil < FunctionDef in Method Interpreter::functionCompileContext > (no arguments or variables) ... - -- - ----------- Sean Rooney srooney@ntet.net ------------------------------ Date: Sat, 11 Aug 2001 18:31:58 -0500 From: James McCartney <---@---.---> Subject: Re: plug.source problem -- possible newbie issue on 8/11/01 5:33 PM, Sean Rooney at srooney@ntet.net wrote: > Ver is 2.2.8 This was fixed. You need to get a newer version. Current version is 2.2.11 - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Sat, 11 Aug 2001 16:52:46 -0700 From: Sean Rooney <---@---.---> Subject: Re: plug.source problem -- possible newbie issue > > >This was fixed. You need to get a newer version. Current version is 2.2.11 ok. Thanks. Sean - -- - ----------- Sean Rooney srooney@ntet.net ------------------------------ Date: Sun, 12 Aug 2001 10:01:46 +1000 From: newton armstrong <---@---.---> Subject: Re: hammerfallDSP vs motu828 Chad Kirby wrote: > I would wait for the HammerfallDSP (is it actually shipping yet?). http://www.macmidimusic.com/motuhardware.html says it's in. keep scrolling down the page, you'll see it. rme have a good reputation, but after watching the 828 go by -- much excitement and enthusiasm on its appearance, followed by some months of horror stories -- i reckon it's a smart idea to wait a bit. ------------------------------ Date: Sat, 11 Aug 2001 17:21:21 -0800 From: Jeremy Zuckerman <---@---.---> Subject: Re: hammerfallDSP vs motu828 Anyone hear anything about the Metric Halo Mobile I/2882 / +DSP? jz > Chad Kirby wrote: > >> I would wait for the HammerfallDSP (is it actually shipping yet?). > > http://www.macmidimusic.com/motuhardware.html says it's in. keep scrolling > down the page, you'll see it. > rme have a good reputation, but after watching the 828 go by -- much > excitement and enthusiasm on its appearance, followed by some months of > horror stories -- i reckon it's a smart idea to wait a bit. > ------------------------------ Date: Sat, 11 Aug 2001 20:21:41 -0400 From: Phil C <---@---.---> Subject: Reference/SoundFile question My inexperience will probably show through in the following code, so if anyone wants to poke at it and tell me, 'Hey why the hell did you...', please do not hesitate ... I am trying to write something which will read in a list of files, put them into an Array of SoundFile objects and then pseudo randomize their lengths and concatenate them. While there may be things which do this (like BreakBeat3), it is also an excercise in learning the lanuage, which is why I am trying to do this in my own code. Right now I am having trouble dereferencing the Signal data array and using that number to set it as the segment of the sample to play ie (one more, detailed question in the code... which could not be put here): ( /* a lot of this is borrowed from SoundFiles.sc */ var files, size, snd, sig, dataLen; files = [ ":Sounds:comm-crunch", ":Sounds:nn_loop.aif", ":Sounds:sealedin.aif", ":Sounds:swank,aif", ":Sounds:violin/horn.aif" ]; size = files.size; snd = Array.fill(size, SoundFile.new); sig = Array.fill(size); dataLen = Array.fill(size); size.do ({ arg i; if( snd.at(i).read(files.at(i)), { # a = snd.at(i).data; c = (a.size * 0.5.rand).ceil; /* * This is my problem... * How can I find out what class * snd.at(i).data.at is using? * I tried using c as the first arg, which * keeps turning up errors. Calling the at * as (0, c) does not seem to do anything... * so how do i tell the data() method the index * i want to start at? Or is this not possible? * * Right now I am assuming that the * snd.at(i).data.at(0) is telling the data * method to being at index 0. Is this correct? */ sig.put(i, snd.at(i).data.at(0, c)); /* size-2, cause i saw it in SoundFiles.sc */ dataLen.put(i, sig.at(i).size-2); }, { (files.at(i) ++ " not found.\n").postln; } ); }); i = size.rand; j = size.rand; play({ arg synth; PlayBuf.ar( sig.at(1) ++ sig.at(j), snd.at(i).sampleRate, 1, 0, 0, (dataLen.at(1) + dataLen.at(j)) ) }) ) - -- '.QBkU.V3jOk''''''''''wv5b9iRxcVq.Plr.dJ yLMKtStIn'D2ygl,'''''''' ''e..4dTRe4c.''''''''cP6M3nu,''NSrP57.fw 2.yF9O7F".gD0DeQ.4`''''' '''''''."W.`WI ,.'Jz4QS3Y7,'''' 'fbPg83R LS.Z4JV, 7SWS9Tz''' '''''''''L.z GrTn....wQu.'''''' KY1"Jcp. BXDlu.cqjX13Y4kThm.0'''' ''''''''''bZw.bu5h7'VYjl''''''' PSuYqqh. y0Ec2DWfcW..RD'Chbk,'''' ''''''''''pfvvnDhpTxG1kR''''''' cxLI.TS8 91zf.V"H0p.1Ph..B''''''' '''''''''NYhsdkGw''.h 5,m'''''' EC.,SO4y DWj.3.. ..a4e.e''''''''' ''''''1x5C.Nfkmu''''NeydM0O'''' c5rc4uRR Y1nzNQO '''''''''''''''' ''''' INx...LfE''''''LqHpx3Gn'' 0ox.L8v2 WaOODeo`'''''''''''''xip '''o0mo"TMRek7''''''''i5FExlpCo 0fJ9Uu5k QJ5y.QO0o''''''''''''''' ------------------------------ Date: Sat, 11 Aug 2001 20:55:01 -0400 From: Phil C <---@---.---> Subject: Re: Reference/SoundFile question Sorry, forgot to mention I am using version 2.2.10. ------------------------------ Date: Sat, 11 Aug 2001 20:59:16 -0500 From: James McCartney <---@---.---> Subject: Re: Reference/SoundFile question on 8/11/01 7:21 PM, Phil C at flah@phess.org wrote: > /* > * This is my problem... > * How can I find out what class > * snd.at(i).data.at is using? > * I tried using c as the first arg, which > * keeps turning up errors. Calling the at > * as (0, c) does not seem to do anything... > * so how do i tell the data() method the index > * i want to start at? Or is this not possible? > * you cannot index with a Float. c is a Float. ceil does not make a Float into an Integer, it makes it a Float with an integral value. c = (a.size * 0.5.rand).ceil; would be better written as: c = (a.size + 1) div: 2; 'at' only takes one argument, so in .at(0, c) the c is ignored. > * Right now I am assuming that the > * snd.at(i).data.at(0) is telling the data > * method to being at index 0. Is this correct? I don't understand the sentence. snd.at(i).data.at(0) gets the i'th element from snd (a SoundFile), applies the .data getter method which will return an array of Signals because that is what is stored there, and gets the 0th element from that, which will be a Signal. A Signal is an array of Floats. Oh, you mean 'begin'. No data is just a getter method. It gets the value stored in the data instance variable. So, > * so how do i tell the data() method the index > * i want to start at? Or is this not possible? That is not the purpose of 'data'. 'data' is just a holder for the sample data of the SoundFile. The start point is controlled by the 'offset' argument of PlayBuf. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Sun, 12 Aug 2001 00:51:48 -0400 (EDT) From: koonce@Princeton.EDU (Paul C Koonce (koonce@Princeton.EDU)) Subject: Re: PlayBuf offset resolution I'm interested in getting sample-accurate (non-interpolated) access to the samples of a sound file. My eventual goal is to make a sound file playback instrument (using other processing) that produces higher fidelity sound than the linear interpolation of Playbuf. The code below is my tinkering to get at the samples. In it, a sound file playback rate function is translated into a sample pointer (using FOS) and then used to (in theory) directly access the samples of a sound file by controlling the sample offset in PlayBuf ( the rate is set to 0). It works except for the fact that the resolution of a float value somewhere in the filter is too low to eventually produce the large integer address needed to access the sound file samples. (As the address becomes larger and larger, you hear larger and longer pitch-shift steps as truncation of the least-significant bits sets in somewhere.) If I remove the filter summation and use a curved envelope with EnvGen to produce the offset directly, I can get the needed resolution, however, this is not a useful form to put it in since it makes the control not a function of rate but position. I need the FOS to make the translation from rate. Is there a way to code this? Or better yet, is there another way in SC2 to get high-fidelity playback of continuously pitch-shifted sound files? Paul Koonce **************************************************************** var filename, sound, signal, duration, playbackrate, offsetpointer ; filename = "YOUR LONG TONE SOUND FILE HERE"; sound = SoundFile.new; sound.read(filename) ; signal = sound.data.at(0); Synth.play({ duration = sound.numFrames / sound.sampleRate ; // PLAYBACK RATE playbackrate = Line.ar( 1.0, 0.5, duration ) ; // USING A FILTER, INTEGRATE RATE TO MAKE FILE POINTER offsetpointer = FOS.ar( playbackrate, 1.0, 0.0, 1.0 ) ; // PLAY BACK FILE BY MODULATING OFFSET WITH 0 RATE PlayBuf.ar(signal, 44100, 0, offsetpointer, 0 ); }); ------------------------------ Date: Sun, 12 Aug 2001 11:12:18 +0200 From: Wouter Snoei <---@---.---> Subject: Re: hammerfallDSP vs motu828 op 12-08-2001 02:01 schreef newton armstrong op newton@hard.net.au: > http://www.macmidimusic.com/motuhardware.html says it's in. only the multiface (8 analog i/o + adat - the one i need) isn't there yet according to them. I will buy it as soon as its available (might already be in europe) - thanks to reactions on this list i decided not to buy a motu, and rme seems to be the only alternative right now. When i've got it, ill post my findings to the list. wouter - - - - - - - - - - - -|- - - - - - - - - - - Wouter Snoei | Studio W. Snoei Bakkummerstraat 13a | J.H. v. Heekpad 3 1901 HJ, Castricum | 1024 BD, Amsterdam 0251 674447 | 06 54761741 - - - - - - - - - - - -|- - - - - - - - - - - woutersnoei@zonnet.nl ------------------------------ Date: Sun, 12 Aug 2001 14:41:15 -0400 (EDT) From: koonce@Princeton.EDU (Paul C Koonce (koonce@Princeton.EDU)) Subject: Re: free memory space I'm having trouble with an instrument that uses alot of memory to load and play sound files with PlayBuf. I've increased the memory allocation for the SC2 application to allow the instrument to run which it does fine the first time, and even the second time if it is allowed to terminate by itself. However, if I stop it early, and then run it again it gives the "Out of Memory" message when in fact nothing has changed--the memory usage is identical. The error suggests to me that the memory used by the previously interrupted run has not been made free. Is this true? And if so, is there a way I can release the memory short of restarting the app? Paul Koonce ------------------------------ End of sc-users-digest V1 #342 ******************************