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.

2 Likes

Hello there!

Very late response, but I was curious how you go about getting these installed with Cabbage? I downloaded the binary and placed it into my plugins64 directory, but it doesn’t seem to be showing up when I try to use the opcodes in Cabbage IDE

That should be enough for them to be seen. But you can also try loading them manually using the --opcode-lib command line flag.