Csound Csound-dev Csound-tekno Search About

[Csnd] Plugin opcodes for JSON parsing and manipulation

Date2022-09-05 01:08
FromRichard Knight
Subject[Csnd] Plugin opcodes for JSON parsing and manipulation
Hi,
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.

It uses the jsoncons library (https://github.com/danielaparker/jsoncons) 
and is still open to expansion so I appreciate if anyone has 
suggestions/ideas etc, and hope it will be of use to someone.

Source is in a repository here along with documentation and examples:
     http://git.1bpm.net/csound-json/about/

Built and tested on Linux and Windows - 32 and 64 bit binaries for 
Windows are available here:
     http://plugins.csound.1bpm.net/#json

RK

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-09-05 07:54
FromTarmo Johannes
SubjectRe: [Csnd] Plugin opcodes for JSON parsing and manipulation
Great!

Seems very useful in many situations. Thanks a lot!

tarmo

Kontakt Richard Knight (<richard@1bpm.net>) kirjutas kuupäeval E, 5. september 2022 kell 03:08:
Hi,
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.

It uses the jsoncons library (https://github.com/danielaparker/jsoncons)
and is still open to expansion so I appreciate if anyone has
suggestions/ideas etc, and hope it will be of use to someone.

Source is in a repository here along with documentation and examples:
     http://git.1bpm.net/csound-json/about/

Built and tested on Linux and Windows - 32 and 64 bit binaries for
Windows are available here:
     http://plugins.csound.1bpm.net/#json

RK

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-09-05 09:08
FromRory Walsh
SubjectRe: [Csnd] Plugin opcodes for JSON parsing and manipulation
Nice one Richard. Just curious about why you choose to use jsoncons and not the Nlohmann header only json library? https://github.com/nlohmann/json I'm using it a lot, but perhaps jsoncons is better? 

On Mon, 5 Sept 2022 at 07:56, Tarmo Johannes <trmjhnns@gmail.com> wrote:
Great!

Seems very useful in many situations. Thanks a lot!

tarmo

Kontakt Richard Knight (<richard@1bpm.net>) kirjutas kuupäeval E, 5. september 2022 kell 03:08:
Hi,
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.

It uses the jsoncons library (https://github.com/danielaparker/jsoncons)
and is still open to expansion so I appreciate if anyone has
suggestions/ideas etc, and hope it will be of use to someone.

Source is in a repository here along with documentation and examples:
     http://git.1bpm.net/csound-json/about/

Built and tested on Linux and Windows - 32 and 64 bit binaries for
Windows are available here:
     http://plugins.csound.1bpm.net/#json

RK

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-09-05 13:02
FromRichard Knight
SubjectRe: [Csnd] Plugin opcodes for JSON parsing and manipulation

Good question, and I can't exactly remember deciding not to use Nlohmann - I did look at RapidJSON, Nlohmann and jsoncons , and I have used the Nlohmann library before, briefly. jsoncons is header only too, and does provide a few additional bits of functionality (namely JSONPath), but it seems they are quite similar in usage.

jsoncons claims to have better benchmarked performance (https://github.com/danielaparker/json_benchmarks) being up to 4 times faster in some circumstances, and apparently handles unreliable input data slightly better.
I wouldn't say jsoncons is necessarily better, and Nlohmann is widely used/supported so I think both have strong points in different ways.

 


On 2022-09-05 09:08, Rory Walsh wrote:

Nice one Richard. Just curious about why you choose to use jsoncons and not the Nlohmann header only json library? https://github.com/nlohmann/json I'm using it a lot, but perhaps jsoncons is better? 

On Mon, 5 Sept 2022 at 07:56, Tarmo Johannes <trmjhnns@gmail.com> wrote:
Great!
 
Seems very useful in many situations. Thanks a lot!
 
tarmo

Kontakt Richard Knight (<richard@1bpm.net>) kirjutas kuupäeval E, 5. september 2022 kell 03:08:
Hi,
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.

It uses the jsoncons library (https://github.com/danielaparker/jsoncons)
and is still open to expansion so I appreciate if anyone has
suggestions/ideas etc, and hope it will be of use to someone.

Source is in a repository here along with documentation and examples:
     http://git.1bpm.net/csound-json/about/

Built and tested on Linux and Windows - 32 and 64 bit binaries for
Windows are available here:
     http://plugins.csound.1bpm.net/#json

RK

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here