Load mapping definitions automatically (in Max)

20 views
Skip to first unread message

d.andrew STEWART

unread,
Jun 12, 2026, 3:40:19 PMJun 12
to dot_mapper
Load mapping definitions automatically (in Max)

I'm at a stage in my work where I'm very satisfied with my current mappings.  Do I need to use Webmapper to load mapping connections?

I'm looking through the mapper .maxhelp files, searching for any examples of how to instantiate mapping connections within a Max patch. In the past, we've been able to format messages to, say, [mapper] to create the actual mapping connections. Ideally, this bit of programming should read the .JSON file, which is generated by the GUI.

Is this still possible?

By the way, I've also noticed that one can use @definition with [mapper]. Very nice !!  It would be interesting if [mapper] could contain a similar argument for the actual mapping connections.

[mapper @alias foo @definition sample_device_definition.json @connection mapping_connections.json]

However, timing issues would need to be worked out, correct? The devices need to be identified on the network, before [mapper] reads mapping connections.



Thank you

d.andrew STEWART

unread,
Jun 12, 2026, 3:42:24 PMJun 12
to dot_mapper
Or, some cmd line I can use to load the .JSON mapping connections file?

Joseph Malloch

unread,
Jun 15, 2026, 11:44:54 AMJun 15
to dot_m...@googlegroups.com
Hi Andrew,

The mappersession python module (which works as the backend for webmapper) can be used in this way, e.g.

python3 -m mappersession --load mymapping.json


You can also use it to save or unload mapping files. There are flags you can pass to determine whether mappersession should try to load maps flexibly or using exact device/signal name matching, whether to wait for the devices to show up, whether to keep waiting and keep recreating the maps if the devices appear again, etc.

You can even load multiple files at the same time, and if you pass the flag -—interactive mappersession will also declare its own libmapper signals for controlling loading/unloading of the maps.

Controlling things from within Max still requires seeing messages (e.g. /map, /unmap) to the libmapper admin bus using the [oscmulticast] object. There is not currently a [mpr.graph] object for Max but we have considered creating one.

Cheers,
Joe

-- 
You received this message because you are subscribed to the Google Groups "dot_mapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dot_mapper+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dot_mapper/317103db-7609-47f9-9a55-b211d82a4535n%40googlegroups.com.

d.andrew STEWART

unread,
Jun 15, 2026, 11:55:28 PMJun 15
to dot_mapper
Thanks

`/map and /unmap`...of course I remember that now.  I probably have a Max subpatch already built for this.  If I remember well, I simply need to make sure the actual syntax of what follows `/map` is still the same as when I used it, last time.  I know the syntax (e.g., @argument names get changed, some times)

I really like the `mappersession` option, though; however, was not able to get it to work.  Here's a print-out of what I did (below).  I'm sure this is just an issue with my lack of knowledge of implementation.  So, as always, if `mappersession` has been formally documented somewhere, please let me know. Thanks a bunch.


<code>
das@das-instrument ~ % cd ~/Repository/webmapper-2.4.12
das@das-instrument webmapper-2.4.12 % python3 -m mappersession --load /Users/das/Files/Computers/Software/Max9/3rd_party_active/STEWART\ D.\ Andrew/MaxComponents/mappings/wildtruth/23_RH_key_pressure.json
syncing graph...
searching for wildcard match with device:signal name '*:instrument/finger/effort/lefthand/key'
searching for wildcard match with device:signal name '*:1_channel/synth/hardsync'
searching for wildcard match with device:signal name '*:cooked/lefthand/key/extended/down'
searching for wildcard match with device:signal name '*:1_channel/makenote/note/01'
searching for wildcard match with device:signal name '*:cooked/lefthand/key/extended/up'
searching for wildcard match with device:signal name '*:1_channel/makenote/flush/01'
searching for wildcard match with device:signal name '*:cooked/lefthand/key/flush'
searching for wildcard match with device:signal name '*:1_channel/makenote/all_flush/01'
searching for wildcard match with device:signal name '*:instrument/knead'
searching for wildcard match with device:signal name '*:1_channel/makenote/velocity/01'
searching for wildcard match with device:signal name '*:instrument/knead'
searching for wildcard match with device:signal name '*:synth/global/amplitude'
searching for wildcard match with device:signal name '*:cooked/incline/frontal'
searching for wildcard match with device:signal name '*:synth/global/release'
searching for wildcard match with device:signal name '*:instrument/churn'
searching for wildcard match with device:signal name '*:synth/continuant/detune'
searching for wildcard match with device:signal name '*:raw/twist/resist/outward'
searching for wildcard match with device:signal name '*:synth/continuant/detune'
searching for wildcard match with device:signal name '*:cooked/roll-tilt-lateral'
searching for wildcard match with device:signal name '*:synth/continuant/articulation'
searching for wildcard match with device:signal name '*:cooked/roll-tilt-frontal'
searching for wildcard match with device:signal name '*:synth/continuant/shape'
searching for wildcard match with device:signal name '*:cooked/roll-tilt-lateral'
searching for wildcard match with device:signal name '*:synth/continuant/symmetry'
searching for wildcard match with device:signal name '*:cooked/righthand/key/extended/down'
searching for wildcard match with device:signal name '*:2_channel/makenote/note/01'
searching for wildcard match with device:signal name '*:cooked/righthand/key/extended/up'
searching for wildcard match with device:signal name '*:2_channel/makenote/flush/01'
searching for wildcard match with device:signal name '*:cooked/righthand/key/flush'
searching for wildcard match with device:signal name '*:2_channel/makenote/all_flush/01'
searching for wildcard match with device:signal name '*:instrument/knead'
searching for wildcard match with device:signal name '*:2_channel/makenote/velocity/01'
searching for wildcard match with device:signal name '*:instrument/finger/effort/righthand/key'
searching for wildcard match with device:signal name '*:2_channel/synth/hardsync'
searching for wildcard match with device:signal name '*:cooked/lefthand/piston/extended/down'
searching for wildcard match with device:signal name '*:3_channel/makenote/note/01'
searching for wildcard match with device:signal name '*:cooked/lefthand/piston/extended/up'
searching for wildcard match with device:signal name '*:3_channel/makenote/flush/01'
searching for wildcard match with device:signal name '*:cooked/lefthand/piston/flush'
searching for wildcard match with device:signal name '*:3_channel/makenote/all_flush/01'
searching for wildcard match with device:signal name '*:instrument/knead'
searching for wildcard match with device:signal name '*:3_channel/makenote/velocity/01'
searching for wildcard match with device:signal name '*:instrument/shake/up/quick'
searching for wildcard match with device:signal name '*:3_channel/synth/hardsync'
searching for wildcard match with device:signal name '*:cooked/righthand/piston/extended/down'
searching for wildcard match with device:signal name '*:4_channel/makenote/note/01'
searching for wildcard match with device:signal name '*:cooked/righthand/piston/extended/up'
searching for wildcard match with device:signal name '*:4_channel/makenote/flush/01'
searching for wildcard match with device:signal name '*:cooked/righthand/piston/flush'
searching for wildcard match with device:signal name '*:4_channel/makenote/all_flush/01'
searching for wildcard match with device:signal name '*:instrument/knead'
searching for wildcard match with device:signal name '*:4_channel/makenote/velocity/01'
searching for wildcard match with device:signal name '*:instrument/shake/up/quick'
searching for wildcard match with device:signal name '*:4_channel/synth/hardsync'
searching for wildcard match with device:signal name '*:cooked/roll-tilt'
searching for wildcard match with device:signal name '*:synth/global/tremolo'
searching for wildcard match with device:signal name '*:cooked/roll-tilt-frontal'
searching for wildcard match with device:signal name '*:synth/onset/attack'
searching for wildcard match with device:signal name '*:cooked/roll-tilt-lateral'
searching for wildcard match with device:signal name '*:synth/onset/hardsync'
searching for wildcard match with device:signal name '*:instrument/knead'
searching for wildcard match with device:signal name '*:synth/onset/noise'
searching for wildcard match with device:signal name '*:cooked/roll-tilt-frontal'
searching for wildcard match with device:signal name '*:synth/onset/decay'
searching for wildcard match with device:signal name '*:raw/program'
searching for wildcard match with device:signal name '*:1_channel/synth/timbre'
searching for wildcard match with device:signal name '*:raw/program'
searching for wildcard match with device:signal name '*:2_channel/synth/timbre'
searching for wildcard match with device:signal name '*:cooked/lefthand/button/front/top/right/tap'
searching for wildcard match with device:signal name '*:1_channel/mute/onset'
searching for wildcard match with device:signal name '*:cooked/lefthand/button/front/top/right/hold'
searching for wildcard match with device:signal name '*:1_channel/mute/continuant'
searching for wildcard match with device:signal name '*:cooked/righthand/button/front/top/left/tap'
searching for wildcard match with device:signal name '*:2_channel/mute/onset'
searching for wildcard match with device:signal name '*:cooked/righthand/button/front/top/left/hold'
searching for wildcard match with device:signal name '*:2_channel/mute/continuant'
searching for wildcard match with device:signal name '*:cooked/lefthand/button/front/bottom/right/tap'
searching for wildcard match with device:signal name '*:3_channel/mute/onset'
searching for wildcard match with device:signal name '*:cooked/lefthand/button/front/bottom/right/hold'
searching for wildcard match with device:signal name '*:3_channel/mute/continuant'
searching for wildcard match with device:signal name '*:cooked/righthand/button/front/bottom/left/tap'
searching for wildcard match with device:signal name '*:4_channel/mute/onset'
searching for wildcard match with device:signal name '*:cooked/righthand/button/front/bottom/left/hold'
searching for wildcard match with device:signal name '*:4_channel/mute/continuant'
searching for wildcard match with device:signal name '*:instrument/thrust/gyrate/lefthand/onset'
searching for wildcard match with device:signal name '*:8_channel/makenote/note/01'
searching for wildcard match with device:signal name '*:instrument/thrust/gyrate/lefthand/termination'
searching for wildcard match with device:signal name '*:8_channel/makenote/flush/01'
searching for wildcard match with device:signal name '*:instrument/twist/resist/inward/lefthand/piston'
searching for wildcard match with device:signal name '*:8_channel/makenote/all_flush/01'
searching for wildcard match with device:signal name '*:instrument/thrust/gyrate/righthand/onset'
searching for wildcard match with device:signal name '*:9_channel/makenote/note/01'
searching for wildcard match with device:signal name '*:instrument/thrust/gyrate/righthand/termination'
searching for wildcard match with device:signal name '*:9_channel/makenote/flush/01'
searching for wildcard match with device:signal name '*:instrument/twist/resist/inward/righthand/piston'
searching for wildcard match with device:signal name '*:9_channel/makenote/all_flush/01'
searching for wildcard match with device:signal name '*:instrument/knead'
searching for wildcard match with device:signal name '*:8_channel/makenote/velocity/01'
searching for wildcard match with device:signal name '*:instrument/churn'
searching for wildcard match with device:signal name '*:sample/detune'
searching for wildcard match with device:signal name '*:cooked/lefthand/button/front/top/left/tap'
searching for wildcard match with device:signal name '*:sample/mute'
searching for wildcard match with device:signal name '*:instrument/twist/resist/inward/lefthand/key'
searching for wildcard match with device:signal name '*:1_channel/makenote/all_flush/02'
searching for wildcard match with device:signal name '*:instrument/twist/resist/inward/righthand/key'
searching for wildcard match with device:signal name '*:2_channel/makenote/all_flush/02'
searching for wildcard match with device:signal name '*:cooked/righthand/button/front/bottom/right/tap'
searching for wildcard match with device:signal name '*:1_channel/makenote/all_flush/01'
searching for wildcard match with device:signal name '*:cooked/lefthand/button/front/bottom/left/tap'
searching for wildcard match with device:signal name '*:2_channel/makenote/all_flush/01'
searching for wildcard match with device:signal name '*:instrument/finger/pressure/lefthand/key'
searching for wildcard match with device:signal name '*:1_channel/synth/stack'
searching for wildcard match with device:signal name '*:instrument/finger/pressure/righthand/key'
searching for wildcard match with device:signal name '*:2_channel/synth/stack'
</code>

d.andrew STEWART

unread,
Aug 12, 2026, 3:55:50 PMAug 12
to dot_mapper
Hello there.  Could I get a few more details on how to load my mappings via command line, instead of using Webmapper, please? See above. I think I am probably just missing some components on my computer, yes? I have to download something? Thanks

Joseph Malloch

unread,
Aug 14, 2026, 2:59:08 PMAug 14
to dot_m...@googlegroups.com
Hi Andrew,

From your June email it looks like mappersession loaded the file just fine but couldn’t find any matching signal names on the graph. Were your Max patches running at the time? Are you telling the [mpr.device] objects to use a particular network interface?

–Joe

d.andrew STEWART

unread,
Aug 25, 2026, 12:25:59 AMAug 25
to dot_mapper
HI there, Joe.  Yes, always using `--iface lo0`. So is it:

`python3 -m mappersession --load /mappings_file_name.json --iface lo0`

Joseph Malloch

unread,
Aug 28, 2026, 3:17:03 PMAug 28
to dot_m...@googlegroups.com
Hi Andrew,

Unfortunately the interface selection argument is not currently supported by mappersession. I’ll look at adding it.

In the meantime you can still do what you want by launching python and creating a libmapper Graph object with the interface you want.

From inside Python interpreter:

import libmapper
Import mappersession

graph = libmapper.Graph()
graph.set_interface(‘lo0’)
graph.poll(2000)

mappersession.load(‘/mappings_file_name.json’, graph=graph)

You could save this small program as load_my_mapping.py and run it from the command line if you like:

python3 load_my_mapping.py


d.andrew STEWART

unread,
Aug 31, 2026, 12:51:16 AM (12 days ago) Aug 31
to dot_mapper
Thx for this suggestion @Joe
Reply all
Reply to author
Forward
0 new messages