maybites/NodeOSC

Cannot import/export OSC config with same address

Closed this issue · 2 comments

I see in your wiki that it is possible and permissible to create multiple OSC handlers and nodes with the same OSC address, but the way you structure your imported/exported config using JSON and address as object key neglect this.

// Invalid json
{
  "/my-address": { …messageHandler1 }, 
  "/my-address": { …messageHandler2 }
}

Do you think you could format your config object as such :

[
  { address: "/my-address", …messageHandler1 },
  { address: "/my-address", …messageHandler2 }
]

Or maybe I am missing something ?
Thank you for your time !

you are probably right. I never used that feature, its a leftover from an addon from which I started from, years ago.

I made a pull request if you are interested.

FYI this import feature is used in one of my workflow to allow setting a lot of addresses programmatically by generating a JSON file using a script with another piece of software.