Recall mapped midi in Standalone

Jonatan Krogh's icon

Hi!

I'm trying to figure out how to remember and later recall midi mappings automatically when closing and opening a standalone. I'm trying to send read/write to the "mappings" object, but i can't get it to load the file it by itself. I'm quite sure my search path is correct, and a file is already in place, but still i get a popup for making a new one instead of loading the one i specify.

How do i do this best? I can't find anything about this on the forums, if anyone has some resources or examples please let me know! Thanks in advance!

Source Audio's icon

post what you exactly send to mappings object.
I hope you use absolute path and not just name...

Jonatan Krogh's icon

I do like this:

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

Your path is broken.
read Macintosh HD:/Applications//LastMappings.maxmap

should be

read "Macintosh HD:/Applications//LastMappings.maxmap"

because there is a space between Macintosh and HD

Also issuing the path to patch or standalone is all but efficient
and does not work on my mac with max 6.1

try this...

Max Patch
Copy patch and select New From Clipboard in Max.

Jonatan Krogh's icon

Just spent about 15 hours fighting with this issue again, and when searching for help all i found was my own thread here from two years ago, so I'll leave some important notes for other people (or myself in the future)

- The "Enable for Mapping" states of each control is NOT saved in the mappings object. It is saved in the patcher itself.

- It is also NOT saved in the top level patcher, or project. For any bpatcher you need to open it up, enable all controls for mapping, and save.

- If you try to load mappings for controls that are not "enabled for mapping", for example because you just enabled them in the built application, not before building, those controls are simply erased from the mappings list.

Some documentation on this would be great! A checkbox in the mappings object to also store the "enabled for mapping"-states in the .maxmap file would be even greater!

Source Audio's icon

I would never use midi mappings, because they can't
distinguish between midi ports or devices, which makes it useless
in any serious midi environment.


Jonatan Krogh's icon

If by serious you mean large, then I'd agree, but i can think of many situations where it can still be useful. I agree though that the current implementation is far from optimal. Is there some good example floating around on how to DIY a midi/key mapping solution? I have a feeling it should be possible to make something relatively clean with pattrstorage but haven't really given it a shot yet.

Source Audio's icon

you can address elements which you want to control from central place, either by patchcord, send - receive, forward, or scripting.

That was the usual procedure in pre - mappings, pattr or dict days.
one can for example make jit.cell containing list with elements to assign
control sources, and assign midi input there, including also midi ports or devices if needed.

needs a bit of work, but at the end you have something 100% reliable.

If you prefer to keep max mappings, then it is a matter to test and see how to overcome limitations you discovered, in first place with bpatchers,

to map adhoc , object needs varnme, parametr mode and visible to mapping attributes enabled, in that order, which can be done using messages.
after that mappings object recognises it.

Roman Thilenius's icon

it is a great feature for quick live coding, but i also would not use something like this in a standalone.

invest once in your own midi mapping system made of rudimentary max objects, and it´ll will work like you planned.

and yes, "enable mapping" on/off is a property of the objects and not stored elsewhere.

the only thing what remains a bit difficult is that getting the data from [midiinfo] at startup is not thread safe. you always have to wait until the data is present before you refer to it from somewhere else.

and of course you can not have a contextmenu shown to the user to set a controller number or enable a learn mode, rather you need an extra button for this.

billyanok's icon

@SOURCE AUDIO
Could you elaborate on
"...one can for example make jit.cell containing list with elements to assign control sources, and assign midi input there, including also midi ports or devices if needed."

I about to add DMX control to quite a large existing patch with 100's of parameters. Looking for the most efficient way to distribute a large amount of incoming control data to objects params.

I've attached a very small example, I'm assuming there is a simpler way???

Thx, B

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

what you ask for is quite different from the topic here.

you want to send large list of values to dedicated destinations.

is 10000 enough ?

Max Patch
Copy patch and select New From Clipboard in Max.

billyanok's icon

Hey, thx for that, interesting!
B