Saving thispatcher generated object - pattr?

newtfish's icon

Hi,

I'm wondering whether there is a way to save generated objects from thispatcher in a patch, so when the user reopens the patch the generated objects appear?

Pattr doesnt seem to be able to do this.

When the patch opens, it just opens with no object (blank) and any generated objects have to be re-generated again.

Cheers

N

Jeremy's icon

I don't understand what pattr's involvement in this plan is. Are you trying to save the instructions that you used to script the objects or something?

Please attach a simplified patcher demonstrating what you're trying to do.

Thanks, Jeremy

newtfish's icon

Hi Jeremy,

1) Load the amxd in a live set
2) press the button
3) save the liveset
4) reopen the liveset

The slider thats been created by the button doesnt get saved with the patch.

Also, is it not possible to set the _parameter_modmode (ie modulation mode to "unipolar") to 1 by using thispatcher? Live doesnt seem to recognise the parameters.

Cheers

N

CreateSliderTest.amxd
amxd
newtfish's icon
Jeremy's icon

Hi,

When you generate a new object via scripting, you are modifying the patcher. Inside of M4L, though, you are in a runtime environment: you can't save your modifications. So you'll need to get a little creative to reconstruct those changes when you load the device, see the attached AMXD.

In the example, the script messages are cached to a dictionary configured as a blob parameter. When the device loads, the dictionary value is restored and iterated and the scripting messages resent. Voilà. Plenty of ways to refine this, but that's the basic idea.

Jeremy

CreateSliderTest1.amxd
amxd
newtfish's icon

Hi Jeremy,

Many thanks for the example patch. Unfortunately it only solves part of my problem. There are two parts:

1) Objects not saved - this is solved by dict
2) Modulation mode is not set.

It seems that the only way it is possible to set Modulation Mode is when a patcher is in edit mode.

I can use "_parameter_modmode 1" when in edit mode and it sets the dial to unipolar. However, if I do this inside a patcher that's closed, the modmode is not set. Such a shame. If we had this ability we could create parameters on the fly in ableton - would be an amazing step forward.

Thanks for the help. I'm sure this will turn out useful.

N

Jeremy's icon

Hi, now that I understand the full project, the answer is: don't do this. The reason why we make changing parameter attributes so difficult is simple: it will break things if changed during runtime. When Live loads your device, it gets information about the number of parameters, their types, modulation modes, etc. and caches this information in a static table which cannot change for the lifetime of the device. If you start sending Live parameter changes from some unknown parameter, it will crash sooner or later. The dict trick can be used to reconstruct scripting activity, but scripting parameters is a big no-no.

Sorry for the bad news, this won't be changing anytime soon.

Jeremy

newtfish's icon

Hi Jeremy,

Thanks for clarifying. Pretty amazing things you've done so far with parameter automation - so I find it hard to complain.

It would be great if Ableton let you create parameters in a way that doesnt affect the stability of live. A bit like the "configure" button for VSTs, which seems to allow you to register new parameters in live without much trouble.

Thanks for the help Jeremy, I appreciate it.

N