First time here? Check out the FAQ!
x

How can I process each input of a SoundCollectionVariable?

+1 vote
400 views
I want to use a SoundCollectionVariable so my resulting encapsulated class accepts an arbitrary number of inputs. Before all the inputs get summed they need some PreProcessing and that's where I struggle. Is there a way to do that?

Thanks!
asked Jul 13, 2016 in Capytalk & Smalltalk by kymaguy (Virtuoso) (10,580 points)

1 Answer

0 votes
 
Best answer

For example, let's say you wanted to process each input through the HarmonicResonator called res that comes as the default input in the Prototype Script.  Then in the Script field you could use:

?inputs do: [:i | res start: 0 s freq: !Freq input: i]

and provide a collection of inputs of arbitrary size from your user-defined encapsulated class based on the Script Sound.

answered Jul 14, 2016 by ssc (Savant) (126,300 points)
selected Jul 15, 2016 by kymaguy
ok, the first part I get. I'm familiar with replication using scripts, it all makes sense. but how do I provide the collection of inputs? Can you maybe give an example of a ready-to-build class that takes an arbitrary number of inputs and processes each input with the HarmonicResonator, then sums them and processes the sum further with let's say a LowPassFilter?
Thanks a lot!
Obviously there's still a long way to go from Master to Most Excellent Master ;)
I thought you would use the Script as the basis for a user-defined class.  Then you would set the Inputs by dragging Sounds into a parameter field labeled Inputs associated with your variable ?inputs.
ok now I got it, I didn't know that I can define a green variable to be a soundCollection in the Class Editor...Thanks ssc!
p.s. seems to be that I'm stuck with my Q&A points somehow? I selected the right answer and nothing changed...
...