First time here? Check out the FAQ!
x

HotVariable names as Custom Class field

0 votes
276 views
hello hello,

I tried to use a Green Variable inside the id field of a prefixer, but (of course) it was not working as I wished.

is there any way to construct Hot Variabe names inside a script in order to have then a field inside my new class. I would like to have a field in my Class where I can type a string to be used as a prefixer, instead of adding every time a Prefixer sound.

thanks for the help.

d
asked Nov 18, 2022 in Capytalk & Smalltalk by domenico-cipriani (Master) (3,110 points)
When you encapsulate, it binds any free variables in the Sound. But if you want to rename the EventValues of the Sound you're creating, then you could just use Prefixer or a Replicator (copies = 1) on the new Class.

1 Answer

0 votes

Hi Domenico!

You can create HotValues in a script using the asEventValue message. For instance:


('Source' & i & '_to_Destination' & j) asEventValue.

Where i and j are integer variables in this example. 


However I was warned a while ago that such algorithmically created HotValues inside a class won't necessarily work when in a Timeline. I haven't tested this rigorously to find out if that's still the case. So if I can, I avoid algorithmically creating HotValues. There are some instances where it makes sense though. I've made some matrix mixer and modulation matrix classes where I generate a fader for each source-to-destination combination. Getting the class user to enter every fader name would be tedious and error prone. 

answered Dec 15, 2022 by alan-jackson (Virtuoso) (15,840 points)
...