fbpx
Skip to main content

MIDI Forum

Why JSON? Why not ...
 
Notifications
Clear all

Why JSON? Why not CBOR?

2 Posts
2 Users
0 Reactions
13 K Views
Brad
 Brad
Posts: 1
New Member
Topic starter
 

Why would JSON chosen for parameter exchange?

It seems that a standard such as CBOR (RFC 7049) would have been a better choice for several reasons:

  • It's binary, so rather than having to base64-encode binary data for things like PCM samples to send to samplers, we could just send the data
  • It's has very broad support, with implementations on most any language, just like JSON
  • It's streamable
  • It supports all the types JSON supports, and then some
  • The type system is extensible, so types relevant to MIDI could be easily added
  • It requires less CPU and memory to deal with, as parsing is simple.

 
Posted : 28/02/2020 8:12 am
Andrew Mee
Posts: 52
Admin
 

Thanks for the question.
JSON was chosen for a number of reasons

  • it's mainly 7 bit. There is a requirement to transfer the data over midi 1.0 SysEx messages which only allow 7bit. JSON has mechanism for handling utf16 values in 7 bit.
  • it's human readable. It was important to have a format that could be read easily in a text format
  • the eco system. JSON is very well known and it is recognisable to developers

If I understand CBOR correctly, CBOR has the same issue as msgpack in that it is an 8bit format. Future designs could perhaps make use of these technologies, if so decided ?

I hope that helps?
Andrew

 
Posted : 28/02/2020 1:38 pm
Share: