First time here? Check out the FAQ!

How do you set a Sound's check-boxes using a Script?

0 votes

How would I set the check-box parameter of a Sound, for instance the "SetLoop" parameter of a Sample, from a Script?

I tried the example above but that doesn't work.


asked Dec 31, 2018 in Capytalk & Smalltalk by alan-jackson (Virtuoso) (15,840 points)
I think you need to use a ParameterTransformer to set the checkbox value to a green variable first.
What does "snd" mean in the ParameterTransformer's Transformation parameter? I'm guessing it means the input Sound, but I can't see it documented in either the Kyma X or 7 guides.
yes it means the input sound....

try  ' self debug: snd name' in the transformer script

3 Answers

+2 votes

Thanks SSC, using a ParameterTransformer works:



Above is a simple example Sound that enables looping of a Sample from a Script. The ParameterTransformer has this in it:

Things to watch out for - note that "setLoop" starts with a small "s", and "true" starts with a small "t".

Here's the example Sound


answered Dec 31, 2018 by alan-jackson (Virtuoso) (15,840 points)
Thanks, Alan! Happy New Year!
+1 vote
General rule of thumb in all cases of using ParameterTransformer:


* the parameter you want to transform from the script, should begin with lowercase always

* the Sound you want to transform (snd)  should be the one directly connected to the ParameterTransformer, don't expect it to work on anything beyond that scope.
answered Jan 6, 2019 by cristian-vogel (Master) (8,410 points)
0 votes
With caps lock key down, double-click on Sample. This changes the check box into a value field where you can type a green variable (for example, ?setLoop).
answered Jan 6, 2020 by ssc (Savant) (127,180 points)