musicjson icon indicating copy to clipboard operation
musicjson copied to clipboard

Use arrays for notes

Open Tomczik76 opened this issue 10 years ago • 3 comments

If a single note in a measure it uses and object.

{"score-partwise":{ "$":{ "version":"3.0" }, "part-list":{ "score-part":{ "$":{ "id":"P1" }, "part-name":"Music" } }, "part":{ "$":{ "id":"P1" }, "measure":{ "$":{ "number":"1" }, "attributes":{ "divisions":"1", "key":{ "fifths":"0" }, "time":{ "beats":"4", "beat-type":"4" }, "clef":{ "sign":"G", "line":"2" } }, "note":{ "pitch":{ "step":"C", "octave":"4" }, "duration":"4", "type":"whole" } } } } }

Tomczik76 avatar Sep 21 '15 20:09 Tomczik76

I'm not sure I understand what the issue is?

saebekassebil avatar Sep 23 '15 18:09 saebekassebil

Some JSON serializers only generate JSON array notation if multiple objects are to be contained, whereas they output object notation if only a single object is handled. This leads to inconsistent data structures that require more logic on the processing than necessary. If a consistent notation in arrays is the only allowed option both these problems are solved. E.G. measures: [{note1}] vs measures: [{notes: [{note1}]}]


Hochschule für Musik Detmold Zentrum für Musik - Edition - Medien Benjamin W. Bohl Hornsche-str. 44 D-32756 Detmold

Tel. +49 5231 975-874

---- Jakob Miland schrieb ----

I'm not sure I understand what the issue is?

— Reply to this email directly or view it on GitHub.

bwbohl avatar Sep 25 '15 10:09 bwbohl

Yes. Let's be consistent.

saebekassebil avatar Sep 25 '15 16:09 saebekassebil