From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #41 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 Monday, May 17 1999 Volume 01 : Number 041 ---------------------------------------------------------------------- Date: Sun, 16 May 1999 00:08:55 -0600 From: James McCartney <---@---.---> Subject: Re: Even more requests to Santa Claus (Re: Simulating MIDI input) At 5:19 PM -0600 5/15/99, Iannis Zannos wrote: >While at it ...: >What about Open Sound Control? Is that still on >the to-do-list? It would be just so great to have >SC communicate over ethernet with other machines >running SC, Squeak, Netscape or whatever. Yes it is on the list. I have a paper due on it for ICMC, so it must get done.. > >Another rather specialized feature to consider: > >*Access to any subset of audio channels. > >Currently one can choose a channel offset >with Synth : this.channelOffset. which is fine >when choosing a single channel to output a spawned >events sound on, or a group of *adjacent* channels >on the Synth channel list. But consider the following >situation: > >There are 8 loudspeakers in a corridor as follows: > >L1 R1 >L2 R2 >L3 R3 >L4 R4 > >As a person moves along the corridor one may like >to pan sounds along successively through >L1 -> L2 -> L3 -> L4 >and another sound at the same time through >R1 -> R2 -> R3 -> R4 > >This can easily be done with 2 PanAz >processes, each addressing 4 adjacent >channels in the Synth output array, the >loudspeakers being arranged to correspond >to channels as follows: > >[L1, L2, L3, L4, R1, R2, R3, R4]. > >But then what if one wants also to pan >accross the two groups in the corridor, >say between L2 and R2? Is it possible to >make say Pan2, address specifically L2 and >R2, which lie apart in the channel list? >The workaround would be to use the same >PanAz arrangement and set the pan level >appropriately to address only the channels >needed, but this is obviously inflexible, >inconvenient and CPU-intensive. ( // Spawn example 1 var env; env = Env.linen(2,5,2); // 9 second trapezoid envelope specification Synth.scope({ var a, b, z; #a, b = Spawn.ar({ // newEventFunc Pan2.ar( EnvGen.ar( env, Resonz.ar(WhiteNoise.ar(0.7), 2000.0.rand + 80, 0.05) ), 1.0.rand2 ); }, 2, // two channels 1); // new event every second z = Plug.ar(0); // generate silence [z, a, z, z, z, b, z, z] })) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Sun, 16 May 1999 09:10:47 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: Even more requests to Santa Claus (Re: Simulating MIDI input) - ---------- >From: James McCartney <---@---.---> >Subject: Re: Even more requests to Santa Claus (Re: Simulating MIDI input) >Date: Sun, 16 May 1999 8:08 AM ... >At 5:19 PM -0600 5/15/99, Iannis Zannos wrote: >>While at it ...: >>What about Open Sound Control? Is that still on >>the to-do-list? It would be just so great to have >>SC communicate over ethernet with other machines >>running SC, Squeak, Netscape or whatever. > >Yes it is on the list. I have a paper due on it for ICMC, >so it must get done.. ... Very nice to hear that. Looking forwards to your paper. >> >>Another rather specialized feature to consider: >> >>*Access to any subset of audio channels. >> .> >( >// Spawn example 1 >var env; > Many thanks indeed. IZ ------------------------------ Date: Sun, 16 May 1999 03:01:04 -0600 From: James McCartney <---@---.---> Subject: Re: Even more requests to Santa Claus (Re: Simulating MIDI input) At 1:10 AM -0600 5/16/99, Iannis Zannos wrote: >> >>>Another rather specialized feature to consider: >>> >>>*Access to any subset of audio channels. >>> >.> >>( >>// Spawn example 1 >>var env; >> >Many thanks indeed. Since multi channel audio is implemented by arrays, you can use all the methods for operating on arrays to manipulate the separate channels of audio. So you can concatenate channels, split them apart, scramble them, or anything you want. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sun, 16 May 1999 12:04:19 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: Even more requests to Santa Claus (Re: Simulating MIDI input) >Since multi channel audio is implemented by arrays, you can >use all the methods for operating on arrays to manipulate >the separate channels of audio. >So you can concatenate channels, split them apart, scramble them, >or anything you want. OK, you asked for it: Example? Sounds logical but cannot imagine what it amounts to in practice (sorry about my limited powers of imagination...). Maybe something like this?: It would be great if you could give an example where one Spawn process writes say channels no. 2 and 4, and then another Spawn process reads these two channels, does some processing on them (say a filter), and then outputs them say to channels 1, 2 on the top synth for output. If you can spare the time, then I should spare the time and put these examples on the Swiki site, when it is rebooted again soon. Best, Iannis Zannos SIM Tiergartenstr. 1, D-10785 Berlin, Germany Fax: +49 30 25481172 - ---------- >From: James McCartney <---@---.---> >To: sc-users@lists.io.com >Subject: Re: Even more requests to Santa Claus (Re: Simulating MIDI input) >Date: Sun, 16 May 1999 11:01 AM > >At 1:10 AM -0600 5/16/99, Iannis Zannos wrote: > >>> >>>>Another rather specialized feature to consider: >>>> >>>>*Access to any subset of audio channels. >>>> >>.> >>>( >>>// Spawn example 1 >>>var env; >>> >>Many thanks indeed. > >Since multi channel audio is implemented by arrays, you can >use all the methods for operating on arrays to manipulate >the separate channels of audio. >So you can concatenate channels, split them apart, scramble them, >or anything you want. > > > --- james mccartney james@audiosynth.com http://www.audiosynth.com >If you have a PowerMac check out SuperCollider2, a real time synth program: > > > > > > ------------------------------ Date: Sun, 16 May 1999 10:00:43 -0600 From: James McCartney <---@---.---> Subject: Re: Even more requests to Santa Claus (Re: Simulating MIDI input) At 4:04 AM -0600 5/16/99, Iannis Zannos wrote: >>Since multi channel audio is implemented by arrays, you can >>use all the methods for operating on arrays to manipulate >>the separate channels of audio. >>So you can concatenate channels, split them apart, scramble them, >>or anything you want. > >OK, you asked for it: > >Example? Sounds logical but cannot imagine what >it amounts to in practice (sorry about my limited >powers of imagination...). Maybe something like this?: This is more along the lines I was thinking: ( Synth.scope({ arg synth; var a, b, c, d, e; // 2 channels each of 3 different processes: a = Array.fill(2, { FSinOsc.ar(2000.0.rand, Decay2.kr(Impulse.kr(8.0.rand), 0.01, 0.3, 0.1)) }); b = Array.fill(2, { Resonz.ar(GrayNoise.ar( LFNoise2.kr(4.0.rand, 2).max(0)), 2000.0.rand, 0.05) }); c = Array.fill(2, { Klank.ar( `[ Array.rand(8, 80.0, 3000.0), nil, Array.rand(8, 0.2, 2.0) ], Dust.ar(2, 0.1) ) }); a = a ++ b ++ c; // concatenate all channels a = a.scramble; // scramble channels d = a.copyRange(0, 2); // copy first half, assign to d e = a.copyRange(3, 5); // copy second half, assign to e // echo elements of d d = CombN.ar(d, 0.3, 0.1.rand + 0.1, 4, 1, d); // absolute value distortion on elements of e e = e.abs; f = (d ++ e).scramble; // concatenate, scramble f = f.clump(2); // make into groups of 2 channels Mix.ar(f); // mix stereo pairs to one pair }); ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Sun, 16 May 1999 11:54:27 -0500 From: rkuivila@mail.wesleyan.edu Subject: Re: Simulating MIDI input Hi James, OK, let's quibble: >asynchronous process and would require new fifos. This would mean >that the virtual machine would have to check more fifos all the time >even if there is no data coming in, this costs CPU time. How so? 1. If the fifo is implemented in C, the expense should be about two instructions. 2. It also depends on how often the fifos are polled. Input handling does NOT have to be at control rate, it could be at a lower rate for MIDI or graphics tablets (say once every 5 milliseconds). >It would have to fifo all MIDI data coming in because you cannot >examine virtual machine data from any other process than the virtual >machine, because it may be in an indeterminate state. Therefore >the MIDI interrupt cannot check to see if it can just put it directly >in the table because there is no remapping function, it has to fifo it. This assumes that presence or absence of remapping is happening dynamically. I doubt that this would be the case. It would be a reasonable limitation that you would have to declare a particular class of MIDI input (command and channel) 'remappable' before synthesis begins. RJK ------------------------------ Date: Sun, 16 May 1999 11:25:06 -0600 From: James McCartney <---@---.---> Subject: Re: Simulating MIDI input At 10:54 AM -0600 5/16/99, rkuivila@mail.wesleyan.edu wrote: >Hi James, > >OK, let's quibble: > >>asynchronous process and would require new fifos. This would mean >>that the virtual machine would have to check more fifos all the time >>even if there is no data coming in, this costs CPU time. > >How so? > >1. If the fifo is implemented in C, the expense should be about >two instructions. > >2. It also depends on how often the fifos are polled. Input handling >does NOT have to be at control rate, it could be at a lower rate for >MIDI or graphics tablets (say once every 5 milliseconds). > >>It would have to fifo all MIDI data coming in because you cannot >>examine virtual machine data from any other process than the virtual >>machine, because it may be in an indeterminate state. Therefore >>the MIDI interrupt cannot check to see if it can just put it directly >>in the table because there is no remapping function, it has to fifo it. > >This assumes that presence or absence of remapping is happening >dynamically. I doubt that this would be the case. It would be a >reasonable limitation that you would have to declare a particular >class of MIDI input (command and channel) 'remappable' before >synthesis begins. Variable rate polling and enabling and disabling mappability both make the design more complicated, not less. The short answer is that in the short term I am going to work on compositional level things, like an Instrument class, finishing the Pattern, Stream, Event framework. Since SC is less MIDI oriented than MAX and MAX does not let you remap MIDI before it gets to a ctlin object for example, then I am inclined to wait a while before I do something like that. Plug already allows more flexibility than you can get elsewhere. There do need to be event triggering functions for notes and I intend to provide that, but I am not going to provide the ability to remap MIDI and put it back into the program input, at least in the short term. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sun, 16 May 1999 18:41:17 +0100 From: Arie van Schutterhoef <---@---.---> Subject: Re: Even more requests to Santa Claus (Re: Simulating MIDI input) Dear James, Looks and sounds impressive! > >( >Synth.scope({ arg synth; > var a, b, c, d, e; > > // 2 channels each of 3 different processes: > a = Array.fill(2, { > FSinOsc.ar(2000.0.rand, > Decay2.kr(Impulse.kr(8.0.rand), > 0.01, 0.3, 0.1)) > }); > b = Array.fill(2, { > Resonz.ar(GrayNoise.ar( > LFNoise2.kr(4.0.rand, 2).max(0)), > 2000.0.rand, 0.05) > }); > c = Array.fill(2, { > Klank.ar( > `[ > Array.rand(8, 80.0, 3000.0), > nil, > Array.rand(8, 0.2, 2.0) > ], > Dust.ar(2, 0.1) > ) > }); > > a = a ++ b ++ c; // concatenate all channels > a = a.scramble; // scramble channels > > d = a.copyRange(0, 2); // copy first half, assign to d > e = a.copyRange(3, 5); // copy second half, assign to e > > // echo elements of d > d = CombN.ar(d, 0.3, 0.1.rand + 0.1, 4, 1, d); > > // absolute value distortion on elements of e > e = e.abs; > > f = (d ++ e).scramble; // concatenate, scramble > f = f.clump(2); // make into groups of 2 channels > > Mix.ar(f); // mix stereo pairs to one pair >}); > >) Is this then also possible with sperate soundfiles from hard-disc? Arie van Schutterhoef <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Arie van Schutterhoef artistic director Schreck Ensemble # -laboratory for live electro-acoustic music- # The Netherlands e-mail:arsche@stad.dsl.nl http://www.xs4all.nl/~schreck/ Tel: 00-31-71-5612287 Fax: 00-31-70-3859268 <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ------------------------------ Date: Sun, 16 May 1999 21:38:14 +0100 From: Martin Robinson <---@---.---> Subject: Korg SPDIF output I seem to remember something regarding this on the list but can't find it. I'm having problems getting sound out of the SPDIF soutput on the Korg 1212. It works fine in MSP, all 12 outputs work, but not in SC. I've set the output routing to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], I presume this is correct. Any ideas? >>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ <><><>__this.liveElectronics.interFaces.diffusion ____ || ------------------------------ Date: Sun, 16 May 1999 14:17:16 -0700 From: "Garry Kling" <---@---.---> Subject: Re: Korg SPDIF output I have been having the same exact problem! I get SPDIF out, but it is a *very* low level. It works in Digital Performer and other application perfectly. I have the MIDIMan Flying Calf D/A, if that makes any difference. I wish I had something to offer. I've been trying to crack this nut for a week! It's too bad that such an expensive card has so many problems... Ideas about this would be VERY appreciated. Garry Kling Central Washington University <<< Martin Robinson 5/16 1:43p >>> I seem to remember something regarding this on the list but can't find it. I'm having problems getting sound out of the SPDIF soutput on the Korg 1212. It works fine in MSP, all 12 outputs work, but not in SC. I've set the output routing to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], I presume this is correct. Any ideas? >>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ <><><>__this.liveElectronics.interFaces.diffusion ____ || ------------------------------ Date: Sun, 16 May 1999 16:34:11 -0600 From: James McCartney <---@---.---> Subject: Re: Korg SPDIF output At 3:17 PM -0600 5/16/99, Garry Kling wrote: >I have been having the same exact problem! I get SPDIF out, but it is a >*very* low level. It works in Digital Performer and other application >perfectly. I have the MIDIMan Flying Calf D/A, if that makes any >difference. > >I wish I had something to offer. I've been trying to crack this nut for >a week! It's too bad that such an expensive card has so many problems... >Ideas about this would be VERY appreciated. ><<< Martin Robinson 5/16 1:43p >>> >I seem to remember something regarding this on the list but can't find >it. >I'm having problems getting sound out of the SPDIF soutput on the Korg >1212. >It works fine in MSP, all 12 outputs work, but not in SC. I've set the >output routing to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], I presume >this is >correct. Any ideas? > There is nothing wrong with the card. I am scaling the output wrong. If you multiply your output by 4096 then you should get a normal output level. This should be fixed in the next release. Also you must route channels 1 and 2 out the SPDIF outputs which are 11 and 12. You should usually have your output routing set to: [1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 1, 2] So that the analog and SPDIF outputs are mapped to your first two output channels. A mapping of : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] assumes that you are outputting a full 12 channel signal from SC, the last two of which will go to SPDIF. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Sun, 16 May 1999 23:39:01 +0100 From: Arie van Schutterhoef <---@---.---> Subject: Re: Korg SPDIF output Dear Martin, I found the answer to your question in the sc-users listing from November 1998 and it looks like this: >Is there a way to get AudioIn to read from the 1212 's S/PDIF in ? Yes. The S/PDIF inputs are 11 & 12. So you'd say AudioIn.ar([11,12]) Also, if you look in Main.sc you'll see: Synth.setInputRouting([9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); This means that AudioIn.ar([1,2]) is actually getting channels 9 & 10 from the hardware. These are the analog inputs. If you want to use the ADAT optical inputs you need to change this to normal: Synth.setInputRouting([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); Good luck, Arie van Schutterhoef >I seem to remember something regarding this on the list but can't find it. >I'm having problems getting sound out of the SPDIF soutput on the Korg 1212. >It works fine in MSP, all 12 outputs work, but not in SC. I've set the >output routing to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], I presume this is >correct. Any ideas? > >>>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ ><><><>__this.liveElectronics.interFaces.diffusion ____ > > || <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Arie van Schutterhoef artistic director Schreck Ensemble # -laboratory for live electro-acoustic music- # The Netherlands e-mail:arsche@stad.dsl.nl http://www.xs4all.nl/~schreck/ Tel: 00-31-71-5612287 Fax: 00-31-70-3859268 <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ------------------------------ Date: Mon, 17 May 1999 00:27:15 +0100 From: Arie van Schutterhoef <---@---.---> Subject: physical modelling Dear everyone Some time ago in January there was some talk in the sc-list amongst people, I think Staffan Liljegren was one of them, about implementing some physical modelling designs in SC. I wonder if any progress has been made on that? Arie van Schutterhoef <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Arie van Schutterhoef artistic director Schreck Ensemble # -laboratory for live electro-acoustic music- # The Netherlands e-mail:arsche@stad.dsl.nl http://www.xs4all.nl/~schreck/ Tel: 00-31-71-5612287 Fax: 00-31-70-3859268 <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ------------------------------ Date: Mon, 17 May 1999 01:15:19 +0200 From: "Martin Stepanek" <---@---.---> Subject: random loops hi sc-users, As i-m totally new to Super Collider as well as the World of Programming this may be a rather newbie question: Today i tried to modify one of the sound file examples so that it would loop a sampled drum beat at different measures of the beat in a randomized way (loop it, say, from the 2.nd until the 4th beat, then jump to the beginning and play it until the 3.rd and so on). Well, what i was able to build didn-t quite do what i wanted :) and i couldnt find an example that would give me a hint. Heres the relevant code: ( var filename, file, signal; filename = ":Sounds:conga&ride loop"; // the file's path name file = SoundFile.new; // create a SoundFile object if (file.read(filename), { // read the entire file signal = file.data.at(0); // get Signal buffer Synth.play({ x=MouseX.kr(1,4, 'exponential'); y=MouseY.kr(1,4, 'exponential'); PlayBuf.ar( signal, // sample buffer file.sampleRate, // sample rate 1, // playback rate 0, // starting offset sample signal.size/x, // loop start sample signal.size/y // loop end sample ) }); },{ (filename ++ " not found.\n").post }); ) thnx in advance, martin ------------------------------ Date: Sun, 16 May 1999 16:33:25 -0700 From: "Garry Kling" <---@---.---> Subject: Re: Korg SPDIF output Great! This is very good to know! I look forward to the fixed SPDIF output. It's the only way I can get 4 channel. Would my mapping look like [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4 ] ? Multiplying the output doesn't seem to work, ie SinOsc.ar(440, 0, 4096); It seems to balance better, but is clipped. I assume I shouldn't be astonished... Is there another way to scale the output so that it works, or is it internal? Thanks for the help! Garry Kling <<< James McCartney 5/16 2:39p >>> There is nothing wrong with the card. I am scaling the output wrong. If you multiply your output by 4096 then you should get a normal output level. This should be fixed in the next release. Also you must route channels 1 and 2 out the SPDIF outputs which are 11 and 12. You should usually have your output routing set to: [1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 1, 2] So that the analog and SPDIF outputs are mapped to your first two output channels. A mapping of : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] assumes that you are outputting a full 12 channel signal from SC, the last two of which will go to SPDIF. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 17 May 1999 04:47:54 +0200 From: "Iannis Zannos" <---@---.---> Subject: Re: physical modelling >Dear everyone > >Some time ago in January there was some talk in the sc-list >amongst people, I think Staffan Liljegren was one of them, >about implementing some physical modelling designs in SC. > >I wonder if any progress has been made on that? > >Arie van Schutterhoef Yes, Staffan has written several models, and Dan Trueman plus Colby Leider from Princeton also contributed. I did an analysis of Staffans simple string model, illustrating its construction with intermediate steps, using SoundModel of GUIUtils. Unfortunately, all of us seem to be held up by other stuff, but ... stay tuned ... Iannis Zannos SIM Tiergartenstr. 1, D-10785 Berlin, Germany Fax: +49 30 25481172 - ---------- >From: Arie van Schutterhoef <---@---.---> >To: sc-users@lists.io.com >Subject: physical modelling >Date: Mon, 17 May 1999 1:27 AM > >Dear everyone > >Some time ago in January there was some talk in the sc-list >amongst people, I think Staffan Liljegren was one of them, >about implementing some physical modelling designs in SC. > >I wonder if any progress has been made on that? > >Arie van Schutterhoef > ><<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > Arie van Schutterhoef > artistic director > Schreck Ensemble # -laboratory for live electro-acoustic music- # > > The Netherlands > e-mail:arsche@stad.dsl.nl > http://www.xs4all.nl/~schreck/ > Tel: 00-31-71-5612287 Fax: 00-31-70-3859268 > > ><<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > > ------------------------------ Date: Mon, 17 May 1999 01:25:11 -0400 From: "crucial" <---@---.---> Subject: SortedList, Array James, Based on your previous corrections, I found a couple of other things in SortedList. The following changes get the Lists to work as advertised. add { arg newObject; var nextIndex; if ( this.isEmpty, { ^super.add(newObject); }); nextIndex = this.indexForInserting(newObject); this.insert(nextIndex, newObject); } addAll { arg aCollection; if ( aCollection.size > (this.size div: 3), { // Faster to add the new elements and resort aCollection.do({ arg each; super.add(each) }); this.sort },{ // Faster to add the elements individually in their proper places aCollection.do({ arg each; this.add(each) }); }); } changes were: insert not insertAt, add not addLast super not this I hope that that is correct and helpful. - ---------------------------- Dictionary.keysDo (keysValuesDo etc.) returns the i arg as a Float, not an Integer as per usual. - --------------------------- ArrayedCollection add { arg item; // add item to end of array. // if the capacity is exceeded, this returns a new // ArrayedCollection. _ArrayAdd ^this.primitiveFailed; } But actually it doesn't, and I think maybe its not supposed to. An array 'should' have a fixed size I guess ? x=[]; x.species.postln; x.add(4); x.add(5); x.postln; Array [ 4 ] - --------------------------- I have finally figured out Patterns and Streams and FilterStreams and am having a wicked time ! I have a question (regarding pattern.asSpawn) but I need to clean up a proper example first. __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Mon, 17 May 1999 01:48:10 -0600 From: James McCartney <---@---.---> Subject: Re: SortedList, Array At 11:25 PM -0600 5/16/99, crucial wrote: >ArrayedCollection > add { arg item; > // add item to end of array. > // if the capacity is exceeded, this returns a new > // ArrayedCollection. > _ArrayAdd > ^this.primitiveFailed; > } > >But actually it doesn't, and I think maybe its not supposed to. >An array 'should' have a fixed size I guess ? > > >x=[]; >x.species.postln; >x.add(4); >x.add(5); > >x.postln; > > >Array >[ 4 ] No, the comment is correct. If the capacity of the Array is exceeded it returns a new Array and the RECEIVER IS UNCHANGED. So you should always assign the result of Array 'add' to a variable since it does not necessarily change the receiver. This way it is always satisfying the request in the most efficient manner: if there is space the new element is added to the receiver, otherwise a new Array is created. In your example above the empty Array has a capacity to hold one item. The first 'add' adds it to the receiver, but then that array cannot hold any more, so the next 'add' creates and returns new Array, but x is unchanged. So you must always write: x = x.add(5); ..unless you are certain you have allocated enough space, as in: x = Array.new(2); x.add(4); x.add(5); x.postln; --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 17 May 1999 02:21:41 -0600 From: James McCartney <---@---.---> Subject: Re: SortedList, Array At 11:25 PM -0600 5/16/99, crucial wrote: Thanks for the SortedList fixes and I have now fixed this one. >Dictionary.keysDo (keysValuesDo etc.) returns >the i arg as a Float, not an Integer as per usual. >--------------------------- >I have finally figured out Patterns and Streams and FilterStreams and am >having >a wicked time ! I have a question (regarding pattern.asSpawn) >but I need to clean up a proper example first. Some of this stuff is still in flux so you may need to make minor changes in the next version. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 17 May 1999 11:14:12 +0100 From: Martin Robinson <---@---.---> Subject: Re: Korg SPDIF output As I implied I'm using ALL 12 outputs of the card ADAT, analog[ue] and S/PDIF. I've got 8 famished Mackie HR824s, 2 ravenous bass bins and 2 hungry channels of tweeters to feed. (Via a Yamaha 01V and a KORG 880D/A.) Thanks James, I'll try scaling the output. >>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ <><><>__this.liveElectronics.interFaces.diffusion ____ || > Dear Martin, > > I found the answer to your question in the sc-users listing > from November 1998 and it looks like this: > > >>Is there a way to get AudioIn to read from the 1212 's S/PDIF in ? > > > Yes. The S/PDIF inputs are 11 & 12. > > So you'd say AudioIn.ar([11,12]) > > > Also, if you look in Main.sc you'll see: > > > Synth.setInputRouting([9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); > > > This means that AudioIn.ar([1,2]) is actually getting channels 9 & 10 > > from the hardware. These are the analog inputs. > > If you want to use the ADAT optical inputs you need to change this to > normal: > > > Synth.setInputRouting([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); > ------------------------------ Date: Mon, 17 May 1999 15:26:34 +0100 From: Arie van Schutterhoef <---@---.---> Subject: Re: physical modelling Thanks for your response Iannis >stuff, but ... stay tuned ... - -I will... Arie van Schutterhoef <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Arie van Schutterhoef artistic director Schreck Ensemble # -laboratory for live electro-acoustic music- # The Netherlands e-mail:arsche@stad.dsl.nl http://www.xs4all.nl/~schreck/ Tel: 00-31-71-5612287 Fax: 00-31-70-3859268 <<<<<<<<<<<<<<<<<<<<<<<<<-////||\\\\->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ------------------------------ Date: Mon, 17 May 1999 14:27:02 +0100 From: Martin Robinson <---@---.---> Subject: Re: random loops MouseX.kr and MouseY.kr output floats so you won't be dividing the signal's size by a whole number of beats (which is what you want to do what you're saying). You need to round the values you're getting from these UGens to integers. ( var filename, file, signal; filename = ":Sounds:conga&ride loop"; // the file's path name file = SoundFile.new; // create a SoundFile object if (file.read(filename), { // read the entire file signal = file.data.at(0); // get Signal buffer Synth.play({ x=MouseX.kr(1,4, 'linear'); y=MouseY.kr(1,4, 'linear'); PlayBuf.ar( signal, // sample buffer file.sampleRate, // sample rate 1, // playback rate 0, // starting offset sample signal.size/(x.round(1)), // loop start sample signal.size/(y.round(1)) // loop end sample ) }); },{ (filename ++ " not found.\n").post }); ) However, this gives you no sound in the areas of the screen in a diagonal from top left to bottom right: X - - - - - X - - - - - X - - - - - X since loop start and end are the same. One way round this is to make the y-axis an offset from the point given by the x-axis and throw away any excess (i.e. anything larger than the signal size): ( var filename, file, signal; filename = ":Sounds:conga&ride loop"; // the file's path name file = SoundFile.new; // create a SoundFile object if (file.read(filename), { // read the entire file signal = file.data.at(0); // get Signal buffer Synth.play({ var sigEnd, divFour; // The variable divFour will divide a number by four when // multiplied by it (more efficient than a divide??) divFour = 4.reciprocal; // the last sample in a signal is one less // than the size of the signal sigEnd = signal.size-1; x=MouseX.kr(1,4, 'linear'); y=MouseY.kr(1,4, 'linear'); PlayBuf.ar( signal, // sample buffer file.sampleRate, // sample rate 1, // playback rate 0, // starting offset sample sigEnd*divFour*(x.round(1)), // loop start sample min((x.round(1)+y.round(1))*sigEnd*divFour, sigEnd) // loop end sample ) }); },{ (filename ++ " not found.\n").post }); ) >>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ <><><>__this.liveElectronics.interFaces.diffusion ____ || > ( > var filename, file, signal; > filename = ":Sounds:conga&ride loop"; // the file's path name > file = SoundFile.new; // create a SoundFile object > if (file.read(filename), { // read the entire file > signal = file.data.at(0); // get Signal buffer > Synth.play({ > x=MouseX.kr(1,4, 'exponential'); > y=MouseY.kr(1,4, 'exponential'); > PlayBuf.ar( > signal, // sample buffer > file.sampleRate, // sample rate > 1, // playback rate > 0, // starting offset sample > signal.size/x, // loop start sample > signal.size/y // loop end sample > ) > }); > },{ (filename ++ " not found.\n").post }); > ) ------------------------------ Date: Mon, 17 May 1999 11:50:55 -0600 From: James McCartney <---@---.---> Subject: Re: BOUNCE sc-users@lists.io.com: Non-member submission from [John Smith ] >Date: Mon, 17 May 1999 16:44:17 +0100 >From: John Smith <---@---.---> >To: sc-users@lists.io.com >Subject: sc-entrance > >Hi, SC-users, >I'd like to join your list, because I would need some help in some quite >special questions. Could anybody send me some hints, how to attend the >list? >Would be great. Thanks in advance. >Yours Heiko To subscribe to the SuperCollider mailing list, send a one line message with no Subject line to : majordomo@lists.io.com The single line should read: subscribe sc-users Once you've subscribed, you can submit mail to the list by sending your message to : sc-users@lists.io.com >PS. What has happened to JMcC that he doesn't bother his letterbox? >Anybody knows? It is not that I do not bother with it. I get lots of emails a day from 7 different accounts, so sometimes things get lost. Especially if I don't have an answer at the moment. I have not had a chance to look at this patch yet. With a return address like jsmith@company.com, I'm not sure how you expect me to respond. >Here additionally follows a mail including a SC-patch I recently wrote >to him. Maybe somebody of you knows anything useful about the problems >documented therein: (Be careful not to confuse the lines in the patch >when running it!! Adjust the pagewidth wide enough!) Unfortunately that often doesn't help as things get wrapped before I get them. Patches sent via email should try to use lines no longer than 72 characters. > >Hallo, dear James McCartney! >I hope you are well, since i haven't heard from you for a long time. >Unfortunately I was not that successful with SC in what I wanted it to >do. So at the moment >I surrendered SC-hacking for our Swinging Structures-project (the one >with the 8-octaves pitchshift for transforming the >building-vibrations to audible sound, maybe you remember). >Here I'd like to document for you, what was not going the way I expected >it to. > >In general: I wanted to pitchtranspose the signal by localising its >zero-crossings with positive slope in a buffer and >playing the area in between with a higher playback-rate. > >Here's the patch I wrote for this purpose: >The intentions and resulting problems are described in the comments. [unquoted by JMcC..] ( // 8: pitchtransposing upwards by zero-crossing detection // CAUTION: Inaudible ultra-low-frequency signal on left channel!! var w; //Gui def for viewing certain variables w = GUIWindow.new("Loopend-panel", Rect.newBy( 628, 64, 260, 90 )); NumericalView.new( w, Rect.newBy( 10, 16, 64, 20 ), "NumericalView", 563.032, -1e+10, 1e+10, 0.00000001, 'linear'); NumericalView.new( w, Rect.newBy( 10, 40, 64, 20 ), "NumericalView", 0.4, -1e+10, 1e+10, 0.001, 'linear'); SliderView.new( w, Rect.newBy( 78, 16, 57, 20 ), "SliderView", 80, 0, 1500, 0, 'linear'); SliderView.new( w, Rect.newBy( 78, 40, 57, 20 ), "SliderView", 0, -80, 20, 0, 'linear'); StringView.new( w, Rect.newBy( 142, 16, 128, 20 ), "counter-detected"); StringView.new( w, Rect.newBy( 142, 40, 128, 20 ), "mouseX-controlled"); Synth.scope({ arg synth; var v1, v2; var freq, amp; var signalbuf1, signalbuf2, input, delinput, delingrid, delingridinv, recenable; var pulseidx1, loopend1, mouseloop; var frqtrp=8, out; signalbuf1 = Signal.newClear(Synth.sampleRate * 2.0); // Buffer of 2s length // input signal: Normally I use the first line for audio-in (commented out). Line 2 simulates a signal of similar // properties internally (25Hz). The frequency of the sine is switched by MouseY upwards 8 oct for testing // the system-reaction. // input = LPF.ar(LeakDC.ar(AudioIn.ar(1), 0.999, 7 ), 3000); input = SinOsc.ar(25 * (1 + (7 * (MouseY.kr(0, 2) > 1))), 0.5, 0.7); recenable = SetResetFF.ar(Delay2.ar(input.sign), input.sign); // Recording enable switch: see scope window, // It marks the cycles of the signal for RecordBuf. delinput = DelayN.ar(input, 0.005, 0.001502); // Ca. 64-sample delay: necessary because RecordBuf // seems not to reset to bufferstart instantly, but delayed. // With the delay 0-crossings are fixed to bufferstart exactly. RecordBuf.ar(signalbuf1, // buffername delinput, // input signal 1, // recording level 0, // level of "surviving" signal (blended to the newly recorded one) recenable, // reset to bufferstart, if ->0+ recenable, // recording runs, when >0 0 // loop mode, continous when =1, oneshot when =0 (reset ->0+ starts then) ); //Calculation of 'loopend1', the index of cycle-end-sample in the buffer: See panel-window --> frequency-dependent //The accuracy is only 4 samples here, but enough for low-frequent signals. delingrid = ToggleFF.ar(delinput); delingridinv = delingrid.neg + 1; pulseidx1 = PulseCount.ar(Impulse.ar(Synth.sampleRate * 0.25), delingrid); loopend1 = Latch.ar(pulseidx1, delingridinv) * 4; mouseloop = K2A.ar(MouseX.kr(1, 2048,'linear')); //Adjusting the bufferloopend with the mouseX: See panel-window v1 = loopend1; v2 = mouseloop; synth.trepeat(0, 0.04, { // use a synth task to update views w.at(0).value = v1.poll; w.at(2).value = v1.poll; w.at(1).value = v2.poll; w.at(3).value = v2.poll; }); out = PlayBuf.ar(signalbuf1, // name of buffer to play Synth.sampleRate, // samplerate of original signal frqtrp, // playbackrate-ratio, 1= original pitch , here: frqtrp = 8 (see above) 0, // offset of playstart (in samples) 0, // loopstart (in samples) mouseloop // loopend (in samples) ); //Output-signal: //The complete sine-cycle is reproduced, when you adjust the mouseX so, that the numbers in the panel are equal. // Now here's the main problem: 'loopend1' and 'mouseloop' both are calculated here normally, they both are in audiorate, //they can be monitored..... but: Try changing 'mouseloop' to 'loopend1', to adjust the loopend automatically! //What happens is a system crash then! ????? Is it a bug or a feature ?????? [input, out, recenable] }); w.close; ) >I have pointed out the major problem with the patch: the behavior of >PlayBuf. >But there are some problems with the RecordBuf as well: >When you switch the input-frequency forth and back by sliding the mouse >up and down, you'll notice that the >transformed frequency does not change instantly as I would expect, >because the 'record-head' should be ordered back to the >bufferstart cyclewise by the var 'recenable', so it should write shorter >cycles immediately after changing the input-frequency. >Probably the writing to the buffer is completed instead first, I >suppose, so the change is delayed. Nevertheless it is strange, >that sometimes up to 7s elapse until the change is detected and the new >signal appears. > >Maybe all this is of some interest for you and helps you to improve SC >further. >I would be glad about a reply. At first I will use the >ZeroCrossing-UGen, so we can reproduce at least the basic tone shifted. >(The PitchShift object is not capable to pick up frequencies below >8-10Hz I think, because of the huge buffer necessary, >right?) > >All the best for you. With best regards Heiko Lochas --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ End of sc-users-digest V1 #41 *****************************