loadJSON in custom module

hello all

i converted a cubase expression map to json and now i try to load it in the custom module and get this error:
Bildschirmfoto 2022-01-12 um 23.18.57

this is my custom module:

var my_data = loadJSON('./data.json')

module.exports = {

    oscInFilter:function(data){
        var {address, args, host, port} = data
            return {address, args, host, port}
    },
    
    oscOutFilter:function(data){
      var {address, args, host, port, clientId} = data
        return {address, args, host, port}
    },
}

and here is the JSON file:

if i should be able to load the file the next step would be how to access these articulations:

if somebody is able to help that would be great.

kind regards
mario

Not sure on the exact error you are getting here but you need to make sure you're accessing the correct part of the xml to get the articulation name in the sound slot, not the name in the articulations box.

If you have a look at these two threads this explains how I have used vba to pull the map name, the articulation and the colour into excel. From excel I can then easily create the variables text that I copy into my custom module.

this is awsome! :ghost: :ghost: :ghost:

thank you very much!
i have to check that out asap.

i tried it with a json because of the arrays. these could be accessed some how through the custom module and then i think it wouldn't matter from where you pull it. i'm talking like i'm a programmer but i have nearly no plan what i'm doing programming wise. :joy: copy paste and try my best to think logical is the way i went.

thanks for your feedback and the freds

This explains the json error question: node.js - NodeJS SyntaxError: Unexpected token in JSON at position 0 - Stack Overflow
I'll update loadJSON so that it ignore the file's BOM, you might have an option in your editor to remove the BOM as well.

thank you very much @jean-emmanuel :pray:

you're a genius!

i'll check that out.

@jean-emmanuel

:ghost: :ghost: :ghost:

i could remove the BOM. no more error. now i have to figure out how to access the data from the custom module. there are like billions of arrays :crazy_face:
and i have no clue how to access them and pull the data i need. i'm gonna try anyway but if you could give me a hint that would be great.

regards