Renaming a Live dial

orange_glass's icon

Hi

I'm am trying to rename a live.dial in a javascript using the following:

var c1 = this.patcher.getnamed("controller1");
c1.name="new name";

This does't seem to work, neither does "shortName". I'm shooting in the dark as to what property/method I should use. Or maybe I should be using the Live API. I don't seem to be having much success at firing a "set name xxx" message at a live.object either.

Ben Bracken's icon

As with most parameter attributes, this cannot be changed programatically. Live needs to know things such as the name, range, unit style, modulation mode, etc, when the object is instantiated in Live. The only supported way to change these things is via the object inspector (or the 'Parameters' window) in the Max editor.

-Ben

orange_glass's icon

Thanks for that info.

Did I not want to hear that :)

Peter McCulloch's icon

Any chance of providing ways of doing this at instantiation time? (I'm guessing that would be safe?)

I'm working on something that automatically constructs guis, and it would be really nice if I could use the live. objects for this, since they have so many useful features built-in. (like the rawfloat (or instant midi mapping message as I tend to think of it))

10Guitars's icon

Send a message to any live.object saying _parameter_shortname $1 $2 to change the name after initialization

patrickkidd's icon

10guitars: excellent. Is this a private api? If not, are these types of calls and valid params listed anywhere?

For example, I am writing a simple M4L device to map one parameter to another (f.ex. to assign a rack macro to a random control in the set) and would love to be able to set units, range, type, etc.

Thanks!

Jeremy's icon

The short name is generally safe to change after instantiation (it's used for display in Live's GUI, but not for identification). Changing the long name will set you up for a world of hurt, as will most of the other semi-secret parameter attributes. Which are "secret" for a reason, namely to prevent you from causing crashes or other undefined behavior.

When the device is instantiated, Live collects this information exactly once. Changing it after the fact will cause Live and Max to get out of sync.

There is currently no way to dynamically create valid, functioning parameters in realtime in Max for Live. That limitation is unlikely to change anytime soon. The "Macro Parameter" approach (e.g. a predefined bank of assignable pots) is the best approach here.

wbertrand's icon

You can change live.dial's long name if you check "link to scripting name" beforehand and then send a "varname foo" message on initialization. And on the "_parameter_shortname $1 $2", it seems like all the (hidden) parameter attributes can be accessed in this way. I understand why use of this functionality is discouraged, but why is it included but undocumented?