Synth triggered by the level of a sample

Hello Nina,

If a synth is a kind of ruby object, shouldn’t be a way to access to its parameters?

There is no way to retrieve the current value of a synth or fx opt directly from the playing synth or fx itself.
You can still use conditional checks to affect your script based on opt values, but you must deal with the opt values by assigning them to variables and working with them before assigning them to the fx or synth.

The reason that you cannot access opt values directly from the synth or fx “object” is that Sonic Pi is its own language that is built on top of Ruby. It is not, however, intended to be an extension of, or 100% compatible with all of Ruby.
(If you wish to read a bit more about that, see topics such as the following):

Hope that clears things up a bit - there will no doubt be plenty of folks able to help if you have further questions :slight_smile:

1 Like