From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #353 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 Saturday, September 8 2001 Volume 01 : Number 353 ---------------------------------------------------------------------- Date: Thu, 6 Sep 2001 14:16:54 -0700 From: "t. krakowiak" <---@---.---> Subject: OT: Yamaha DSP Factory Hello everyone! Music store in my neighbourhood has a great deal on these cards. Price in canadian dollars $250! call them: (416)233-2232 they're going fast! tomasz ------------------------------ Date: Thu, 06 Sep 2001 22:22:51 +0200 From: heiko goelzer <---@---.---> Subject: Re: matrix > > your supposed to go > > ^thisMethod.shouldNotImplement > > the owner class is that of the method thats it, thank you heiko ------------------------------ Date: Fri, 07 Sep 2001 00:08:27 -0400 From: Nick Phillips <---@---.---> Subject: newbie question hello everyone, i've been asked by a friend to supply live audio for a video performance and was hoping to use supercollider (since i much prefer it to MSP!). i've been using it for a little while and have a bunch of small individual patches which i think i can use, but i was wondering if there is a way to segue from one patch to the next without having to just stop and start the next. i've looked a little at the default 'run main' (from Lang menu) which comes up with some sort of mixer, running random selections of a bunch of small functions (i think). could someone help me out as to how to use this mixer? is it possible to use a mixer, each mixer channel running a certain patch? and if not, is there a way i can plug these individual patches into one long free-standing performance? basically i just need a way to fade one patch out while fading another in... any help would be greatly appreciated! thanks, nick ++++++++++++++++ +nick phillips +452 atlanta ave. +athens, ga 30601 +706.208.1181 +http://f-matic.net +----------->modular arts network ++++++++++++++++ ------------------------------ Date: Fri, 07 Sep 2001 01:15:36 -0400 From: "crucial" <---@---.---> Subject: Re: newbie question you can have a look at the library I have on my website. each of your small patches can be easily made into an Instr. a Patch can play that Instr,and many Patches can be put into a PatchBox which will switch between them at will (by gui or by programming). Instr([ \one ], { // some sound stuff }); Instr([\two],{ \\more sound stuff }); PatchBox([ Patch([\one]), Patch([\two]) ]).topGui that will give you play, stop, start, record controls, tempo slider and the switching you want. that PatchBox can be run into another PatchBox of effects, so you can quickly switch several layers of patches. 2 layers: Instr([ \one ], { // some sound stuff }); Instr([\two],{ \\more sound stuff }); Instr([\efx,\one],{ arg input; LPF.ar( input ) }); Instr([\efx,\two],{ arg input; HPF.ar(input) }); a=PatchBox([ Patch([\one]), Patch([\two]) ]); b=PatchBox([ Patch([\efx,\one]), Patch([\efx,\two]) ],[ a ]); b.topGui after that you can save start saving Patches to disk with all settings intact. PatchBox([ "path", "anotherpath", "morepath" ]).topGui patch box will load them. >hello everyone, > >i've been asked by a friend to supply live audio for a video performance and >was hoping to use supercollider (since i much prefer it to MSP!). i've been >using it for a little while and have a bunch of small individual patches >which i think i can use, but i was wondering if there is a way to segue from >one patch to the next without having to just stop and start the next. i've >looked a little at the default 'run main' (from Lang menu) which comes up >with some sort of mixer, running random selections of a bunch of small >functions (i think). could someone help me out as to how to use this mixer? >is it possible to use a mixer, each mixer channel running a certain patch? >and if not, is there a way i can plug these individual patches into one long >free-standing performance? basically i just need a way to fade one patch out >while fading another in... > >any help would be greatly appreciated! >thanks, >nick > >++++++++++++++++ > >+nick phillips > >+452 atlanta ave. >+athens, ga 30601 >+706.208.1181 > >+http://f-matic.net >+----------->modular arts network > >++++++++++++++++ > > > _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Fri, 07 Sep 2001 02:54:24 -0400 From: "crucial" <---@---.---> Subject: Re: matrix Hey, julian and I were looking at Matrix tonight. really interesting looking at all the matrix transforms. nice work! I had been talking a lot to josh at cycling74 about his new matrix stuff. i don't know shit, but i should and would like to. very important for video transforms. Array2D (started by jmc, fleshed out by jr) does not subclass Array, stores rows and cols (counts). it uses row * cols to index, whereas Matrix keeps nested arrays. jmc commented that with sc, that would probably be faster. jr decided it was cleaner to keep with the row * cols. I don't think Matrix should be a subclass of Array, there isn't any benefit to it, and actually a bunch of future probs. Also it should probably be either Array2D or Matrix2D until you go N dimensional (which we are anxiously awaiting :) ) and actually you already ran into several problems trying to make it fit. (the constructor, and having to cancel out methods) then there is the unaryOp and binaryOp support (see below). you have to overide all of that anyway, so in the end you don't get anything from Array. multi-d indexing could be matrix.put( [0,2,3,4,7], thing) ? jmc does multi level dictionary as mlid.put( \index,\here,\there, thing) // the last thing gets put but i kept tripping over stuff when working with it. i personally like [\index,\here,\there], thing The other interesting thing is to implement proper unaryOp and binaryOp support. this means adding performBinaryOpOnMatrix to numbers and collections and ugens/abstract functions. cf. the reverseComposeBinaryOp etc. discussion last month. i mean then you could multiply an oscillator with a matrix, and get a matrix of oscillators. Basically I would say its unnecessary at this point, and should only be done with N dimensional matrices anyway. and you can't add matrices of unmatched shapes, or is there a convention to wrap ? ( in real math ?) 4d matrix * 1d array ? should not be done. And its cleaner to do it for SC3 where you could do +extFiles that add all the methods to different classes, all code on the same page. >hi again, > >another strange thing with my class. i wanted to use *new for instance >creation. if i name this method > > > *newClear { arg rows=1, cols=1; // return (rows x cols) - zero matrix > ^super.fill(rows, { Array.newClear(cols).fill(0) }); > } > >to *new it does strange things: > >out of memory errors untill freeze. i can't see why it would...but in any case, your trying to make the subclassing fit, and it is fighting you. > >whats that. > >thanks for help > > heiko > > > _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Fri, 07 Sep 2001 03:14:17 -0400 From: "crucial" <---@---.---> Subject: Re: matrix just adding some more clarification >The other interesting thing is to implement proper unaryOp and binaryOp support. >this means adding performBinaryOpOnMatrix to numbers and collections and ugens/abstract >functions. >cf. the reverseComposeBinaryOp etc. discussion last month. > >i mean then you could multiply an oscillator with a matrix, and get a matrix of >oscillators. i'm not implying multi-channel expansion (or multi-dimensional expansion) >4d matrix * 1d array ? should not be done. but matrix * float matrix .clip2(float) matrix * matrix ( if of equal shape) are all useful. however one of the rules of xtreme programming is that you shouldn't write methods until you actually need them. so if you don't need binary op support yet, don't bother to do it. you should i think change equals to == 'add' to + even though it won't support non-matrices yet 'divide' to / etc. _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Fri, 07 Sep 2001 03:27:01 -0400 From: "crucial" <---@---.---> Subject: BinaryOpStream & UnaryOpStream okay I'll bet these definitely are faster: (makes use of ?? which wasn't around when these classes were originally written) UnaryOpStream:: next { // var vala; // vala = a.next; // if (vala.isNil, { ^nil },{ ^vala.perform(operator); }); // cx perl-esque speed trick ^(a.next ?? {^nil}).perform(operator); } UnaryOpStream.findMethod(\next).dumpByteCodes old: BYTECODES: (21) 0 88 01 04 PushInstVarAndSendSpecialMsg 'a' 'next' 3 80 01 StoreTempVar 'vala' 5 30 PushTempZeroVar 'vala' 6 D2 SendSpecialUnaryArithMsg 'isNil' 7 F8 00 04 JumpIfFalse 4 (14) 10 F7 ReturnNil 11 FC 00 05 JumpFwd 5 (19) 14 30 PushTempZeroVar 'vala' 15 10 PushInstVar 'operator' 16 A2 00 SendMsg 'perform' 18 F3 Return 19 F0 Drop 20 F4 ReturnSelf new: BYTECODES: (11) 0 88 01 04 PushInstVarAndSendSpecialMsg 'a' 'next' 3 04 02 PushLiteralX instance of FunctionDef in Method UnaryOpStream::next 5 A2 01 SendMsg '??' 7 10 PushInstVar 'operator' 8 A2 00 SendMsg 'perform' 10 F3 Return BinaryOpStream:: next { // var vala, valb; // vala = a.next; // if (vala.isNil, { ^nil }); // valb = b.next; // if (valb.isNil, { ^nil }); // cx perl-esque speed trick ^(a.next ?? { ^nil }).perform(operator, b.next ?? {^nil}); } _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Fri, 07 Sep 2001 03:27:27 -0400 From: "crucial" <---@---.---> Subject: ifNotNil I figure ifNotNil would be useful because its very very common to check if something is not nil before doing something. or is it slower ? ifNotNil Object::ifNotNil { arg function; ^function.value } Nil:: ifNotNil {} usage (var something; something = "I am somebody"; something.ifNotNil({ "do something".postln }); ) comparing: { if(a.notNil,{ "doit".postln; }) }.def.dumpByteCodes BYTECODES: (9) 0 12 PushInstVar 'a' 1 D3 SendSpecialUnaryArithMsg 'notNil' 2 F9 00 03 JumpIfFalsePushNil 3 (8) 5 41 PushLiteral "doit" 6 A1 00 SendMsg 'postln' 8 F2 BlockReturn { a.ifNotNil({ "doit".postln; }) }.def.dumpByteCodes BYTECODES: (6) 0 12 PushInstVar 'a' 1 04 01 PushLiteralX instance of FunctionDef in Method Interpreter::functionCompileContext 3 A2 00 SendMsg 'ifNotNil' 5 F2 BlockReturn miniscule difference ? or actually slower ? the functions for if get inlined ! whereas the second version has to push a FunctionDef, then get it and do it. _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Fri, 7 Sep 2001 21:34:21 -0500 (CDT) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: ifNotNil The inlined version is faster. There is overhead for pushing a closure and calling it. On Fri, 7 Sep 2001, crucial wrote: > > > > I figure ifNotNil would be useful because its very very common to > check if something is not nil before doing something. > > or is it slower ? > > > ifNotNil > > > Object::ifNotNil { arg function; ^function.value } > Nil:: ifNotNil {} > > usage > (var something; > something = "I am somebody"; > something.ifNotNil({ "do something".postln }); > ) > > comparing: > > { > if(a.notNil,{ "doit".postln; }) > }.def.dumpByteCodes > > BYTECODES: (9) > 0 12 PushInstVar 'a' > 1 D3 SendSpecialUnaryArithMsg 'notNil' > 2 F9 00 03 JumpIfFalsePushNil 3 (8) > 5 41 PushLiteral "doit" > 6 A1 00 SendMsg 'postln' > 8 F2 BlockReturn > > > { > a.ifNotNil({ "doit".postln; }) > }.def.dumpByteCodes > > BYTECODES: (6) > 0 12 PushInstVar 'a' > 1 04 01 PushLiteralX instance of FunctionDef in Method > Interpreter::functionCompileContext > 3 A2 00 SendMsg 'ifNotNil' > 5 F2 BlockReturn > > > > miniscule difference ? or actually slower ? > > the functions for if get inlined ! > whereas the second version has to push a FunctionDef, then get it and do it. > > > > > > _____(( > http://crucial-systems.com > _________________))_______ > ------------------------------ Date: Sat, 08 Sep 2001 15:49:14 -0400 From: "crucial" <---@---.---> Subject: Re: ifNotNil ah, so if(variable.isNil, { variable = Variable.new; }); is faster than variable ?? { variable = Variable.new }; or variable = variable ?? { Variable.new }; > >The inlined version is faster. There is overhead for pushing a closure and >calling it. > So you (james) could probably make ?? do an inline. but then i suppose you couldn't maybeNil ?? functionVariable the Binary/Unary OpStream i posted might be faster though. is there a reliable way to test performance (of non-synthesis code) ? BinaryOpStream:: classvar nilFunc; initClass { nilFunc = {^nil }; } next { // cx perl-esque speed trick ^(a.next ?? nilFunc).perform(operator, b.next ?? nilFunc); } i probably have better thing to worry about :) _____(( http://crucial-systems.com _________________))_______ ------------------------------ End of sc-users-digest V1 #353 ******************************