From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #358 Reply-To: sc-users Sender: owner-sc-users-digest@lists.io.com Errors-To: owner-sc-users-digest@lists.io.com Precedence: bulk sc-users-digest Friday, September 21 2001 Volume 01 : Number 358 ---------------------------------------------------------------------- Date: Wed, 19 Sep 2001 09:43:25 -0600 From: Michael Theodore <---@---.---> Subject: Re: Arrays of sample buffers question Martin Robinson wrote: > > on 18/9/01 6:20 pm, it is said that Michael Theodore did write: > > > In any case, here's an answer to my own question. I'm > > sure there's a more elegant way to do it, and would love > > to hear about it. > > try this: Wow - a million times more elegant! I think I owe you some big karmic debts - that's the second incredibly useful patch that you've sent (the first being a nato feedback patch). Many juicy tricks for this sc neophyte to digest. Love that GetFileDialog, and the cascading collects. Since what I wanted to do was to be able to traverse the files randomly, or in some pattern, I made a few changes, which follow below. (Thank you so much!)^1000 regards, Michael ( Synth.scope({ var numSounds = 3; //or whatever var filenames, sounds, signals, playbufs; var numChannels, duration, sampleRate, env; var signal; var dispatch; filenames = Array.fill(numSounds, { GetFileDialog.new.path }); sounds = filenames.collect({ arg filename; var sound; sound = SoundFile.new; sound.read(filename); sound }); signals = sounds.collect({ arg sound; sound.data }); env = Env.linen(0.01, 0.98, 0.01, 1.0); Spawn.ar({ dispatch = numSounds.rand; //or pattern, etc signal = signals.at(dispatch); numChannels = signal.size; duration = signal.first.size; sampleRate = sounds.at(dispatch).sampleRate; PlayBuf.ar(signal, sampleRate, 1.0, 0, 0, duration, EnvGen.kr(env, timeScale: duration/sampleRate ) ) }, signal.size, 4.0.rand + 0.75) //or some other rate, etc }) ) ------------------------------ Date: Fri, 21 Sep 2001 16:57:43 +0900 From: Takeko KAWAMURA <---@---.---> Subject: get an array... Hello, Now I'm trying to make my plugin for SC3 with CodeWarrior. I want to use an array as an argument (like Klang). But i don't have any idea to get the array in the C++ code. How can I describe it on the C++ code? thanks. ///////////////////////////////* takakeko kawamura tn800@iamas.ac.jp www.iamas.ac.jp/~tn800/sc/index.html */////////////////////////////// ------------------------------ Date: Fri, 21 Sep 2001 18:42:14 -0500 (CDT) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: get an array... Next week I will put up an example using a table. On Fri, 21 Sep 2001, Takeko KAWAMURA wrote: > Hello, > > Now I'm trying to make my plugin for SC3 with CodeWarrior. > I want to use an array as an argument (like Klang). > But i don't have any idea to get the array in the C++ code. > How can I describe it on the C++ code? > > thanks. > > ///////////////////////////////* > takakeko kawamura > tn800@iamas.ac.jp > www.iamas.ac.jp/~tn800/sc/index.html > */////////////////////////////// > ------------------------------ End of sc-users-digest V1 #358 ******************************