wintergatan-community / virtual-mmx

A WebApp to program songs on a virtual Marble Machine X
https://wintergatan-community.github.io/virtual-mmx/
MIT License
36 stars 15 forks source link

Basic import / export JSON #10

Open mozi-h opened 4 years ago

ChemiCalChems commented 4 years ago

Claim

ChemiCalChems commented 4 years ago

@mozi-h Should we save the JSON files client-side or server-side?

EDIT: Discussion on Discord decided client-side, for obvious reasons.

wraybowling commented 4 years ago

I get writing to .JSON because it's easy, but then you're going to argue about how to structure the data. How about writing to .MIDI, where the data structure is already standardized?

mozi-h commented 4 years ago

@wraybowling We won't be arguing about it; we were, are and will be! 😄 Take a peek at all of vmmx-schema for that madness. There is absolutely no way around defining the representation in JS Objects. As we are programming in TypeScript and because we need to keep what we're doing in memory (for obvious reasons), we absolutely need such representation. Im- and exporting to / from JSON is the fastest and easiest (even native!) way to handle loading / saving. Bonus points!

Plans to support other file formats exist *ehem* – our object schema is oriented at MIDI quite a bit – but this will be a non-priority.

P.S. The Marble Machine is quite... unique. Instead of using some all-purpose MIDI-close JS object it makes much more sense to have a bit more of a custom schema. "Converting" concepts like muting levers, repeating programming wheel or even the limitations of dropping marbles to and from an all-purpose MIDI would be over complication.