Easy way to read and parse JSON?

Hello everyone

I was curious if there are some existing opcodes for easily reading/parsing JSON files. Thanks in advance!

My channelSave/Recall opcodes write and read JSON dat. Perhaps you can hack the source code for your own needs?

1 Like

Ooo thank you, would not have found this on my own. Appreciate it :partying_face:

I recently started some UDOs which help with JSON (formatting and parsing). The parsing is a bit hacky, probably fragile and ideally needs some more effort, but it worked for what I wanted at the time, and might for you too. The zip also has an example of parsing a JSON string containing score directives.

csound-json.zip (3.6 KB)

I have created a set of plugin opcodes for JSON loading/parsing, saving/serialisation and querying/manipulation using various methods including JSONPath and JSON Pointer.

There are around 30 opcodes with over 50 type permutations - all run at init time and many are available at k-rate too.

Source is in a repository here along with documentation and examples.

Built and tested on Linux and Windows - 32 and 64 bit binaries for Windows are available here.

1 Like