unique static device number
Im wondering if theres a way to give a device a unique static number? Ive tried using "—" and it seems to give me a different unique number each time I load the set. I would like the unique number to only be loaded once, when the device is loaded for the first time and then stay persistant throughout its usage, such as moving tracks, saving as a adv preset. Is there any way to do this? perhaps pattr? Ive tried a few things and I cant seem to get the unique number to persist
It might help if you describe what you’re actually trying to achieve….
Im trying to get a device to save a local file along with it. This file will follow the device as it gets copied, moved, presetted etc within the set. For instance, if the device is copied (or saved as an adv preset), this is a new device and therefore it will require a new file. However, if the device is moved, it should use the same file.
The only way I could think of is to create a file that is unique to the live_set ie. My_Live_Set-My_Device_File, but m4l dont give us an id or name for the live set in the api. Another way might be to listen to the "preset name", but m4l dont give us access to this as well.
The way Im trying to do it at the moment is to create a random number, when the device is used for the first time and then to never change that number, unless the device is copied or saved as an adv preset, but Im struggling to detect when the device is copied, or saved as a preset.
Here are the actions Im trying to achieve:
New Device: New Number
Copied Device: New Number
Saved as adv Preset: New Number
Moved Device: Same Number
Saved/Recalled along with the live set: Same Number
Heres the code Im using. Its not the best code, because Im trying every solution I can think of, to test if theres a way to do this. Im also a little new to m4l. Many thanks for taking the time out to help.
----------begin_max5_patcher---------- 2437.3oc6bkzaiaCE9rKP+OHXf4TyjJRp0dqKn.8ROTfhdHXPfrEShZkkLjn SloE8+d4h1nDoLcrTrbPGzZiPQS9deuU9Ho9mu9qVsdS9mwkqs9Nq6rVs5en srh2FqkU0MrZ8tnOuMMpj2w0ay2sCmQVeS0CI3OS3O3mSRwYQ6vVaKvQjj7L qOZY8a3nXq7Bq+nHgfa9MIw7eQ9l+7iflFeHOiTl72X1i.facCcAA90OL6vt jrTLgSCf5V2GQ19TR1i2Wf2RDrAxGdq8MVHG9WPHf+k8s1VepyXkefTOX1cm eF8yIsuuHIJcM+I+6W+UruoeciwfzFNkgKZXtmiJZF6eOijPm9XzcfOoBRfM Mtu.WRwZNZ1gGcBPbtxi8IP7G.jWWdDuaCNVBqjPvFld.Q4bKkQnT+5QvXfa HaJcb4TAf+G.Go4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wVun6c3f2D+NbvyVbwLEGYEvqWiYlzV5Us7Vj5G+tu8aU9Rt.9JPn wroD2zejscmyecvBBgzoJUefoK+Bi7r9P4GJUhWn4AuD22I.HXwoRMtSZnZm z.uoyKMDE14RFck4lVy0oSBq7OMrBX.Vg3G2m.2igUnwwJMWatIE4z9V642D GhyekedYs9FqehifV+RbyqwGkg+lZW9.2JSyK4asGs904Q9rXd2cBcb7bra2 OT0WWyIxsUUpAhWcDfpSn20fe95TFnpPwJQpvIV+oxjr5s+j3FsdU3fmjSiE tIOU4KBJ6YBkDA.cCu9yrBBlXStZe6gtuOSsBBmG.C4ft1xsZGlTj28Ubf56 ly4maUkgl.g7bWjoVIeSkTeSYNgv47PUPeeM2wnSkimo7p0I6cmbYu3VJ+9K sZn2zkVs.p.hqx8ELqZQekOZPU.Y+hGVCmCK8uTo.0UuPjToQUTrPMEJToP1 XZCfLg3jqb9aFsYNv81SbFQa7MS6sWnBsMl3t..mYR0vKBw4YDsEbpRUuPVp iNhyfJfF0u9ulF6jv4gpgN7yroSUkxpHaTvTQ1AlP1NWD8.jwH5Ev.xHkTn6 kg3bMh3tL9rAlgbfKCw4ajN2kITbui0htMscASafKTzNi7j.uLd45qoqg3rO ahi0.8q+CyGcV.B -----------end_max5_patcher-----------
Your approach doesn’t make much sense to me.
With pattrstorage you can handle multiple presets by numbering and storing in a single file. Or you can create multiple adv presets without using pattrstorage and thus no files at all.
Im afraid these files are fxp. There are things inside a vst~ object that max cannot reach. For instance in massive synth its possible to connect envelopes to parameters. However, max doesnt see any of these kinds of changes. The only way I can see to record these changes is through fxp files, hence the need for saving a unique fxp file for every instance of this device. Would love to hear if there are any other ways to solving this problem.
you can use the device id (from the Live API: [path this_device]) instead of the — identifier. Is unique and persistent (reloading the set, moving the device and so on…)
Hi Jan, thanks for the idea, Im trying to use the device id as well, but it seems something is happen on the creation of a new device that is limiting me. Ive posted another post here describing the issue, with patches included:
Im really confused now. Ive been working solidly for around 4 days to try and make this work. there must be a simple solution.
I simply would like my device to have two number boxes, saving the boxes in the following way using loadbang, based on how live saves devices/sets
New device – default id (0), new id
adv preset device – recall id, new id
copied device – recall id, new id
saved device in set – recall id
Ive been round and round in circles with pattr and coll. Is there anyone that can suggest a way to achieve this.