Looked through this documentation page and didn’t see it, figured I’d ask here in case I’m missing it.
How can I reference a parameter by the name I’ve given it (via script), instead of name0?
I know I can do op('constant1').par.name0 to get its name. But I have a constant CHOP with numerous entries in it, so it’d make my script, which is trying to set values for those constant CHOP entries, a lot more legible if I could do what I intuitively thought might be something like op('constant1').par('myNamedParam').value0.
Is there a way to do this or must I stick with the generic name0, value0?
@ben shouldn’t there be a link from the par class page to the ParCollection class page ? most people start looking on the par page when they look for that info
Thanks @Achim, that does work, but the issue doesn’t seem to have been addressed then, as it’s still using the generic value0 to reference the parameter rather than the name I’d given it (in this case, myNamedParam; see screenshot below for clarification):
… In the meantime I guess I’ll work on getting the intellisense-like support up and running soon, which would probably help a ton with minor syntax questions like this in the future.
I think we’re getting bogged down in the peculiarity of the Constant CHOP whose purpose is to put the name in one parameter name0… and the value in another parameter, value0, which then creates a CHOP channel with the name in name0, and the value in value0.
This is entirely different from custom parameters, where you are creating one parameter with a name and a value, and no channels.
So, as Achim says, instead of using the Constant CHOP (I use it less and less over time), you can create a Base COMP and add custom parameters to it. Then you can use it the way you describe. If you want the parameters to generate a CHOP with channels, you can use the Parameter CHOP.