USB hubs… there are a bunch of threads on here with me discussing how it could be done by offloading the multiplexing to a Raspberry Pi or a Beaglebone Black (or even a normal computer). The AVR32 USB port is supposed to be able to switch between device and host mode at runtime. IMO this would be much easier than real USB hub support. Anyway, no more talking about it on this thread, if someone wants to implement this then bump an existing thread or start a new one.
Serialisation formats…
I’m generally in favour of text based. Remember we already have parsing and validation code from Teletype code. But I can understand not wanting to as it’s a lot of work to maintain.
IMO, that’s because the saving and loading code is too hard to work with. If we made a better version it should be a lot easier to make it more robust. As well as giving it the ability to save errors to an error.log file on the USB stick.
Using Javascript for the converter would force the data format to include potentially redundant metadata (e.g. OP names), otherwise you’d have to duplicate that information from the Teletype source base. A better idea would be to output a Markdown file with a read only copy of the scene in text format, and then a base64 encoded version of the binary data at the bottom: e.g.
<!-- WARNING the following content is READ ONLY -->
# First line of scene description
More scene description
## Script 1
``
ADD 1 1
``
## Script ...
## Pattern data
....
## Binary data
This is the actual data that is read by the Teletype. **Do not edit.**
``
----------------------- BEGIN TELETYPE DATA: v1 ------------------------
TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxp
dCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0IGRvbG9y
ZSBtYWduYSBhbGlxdWEuIFV0IGVuaW0gYWQgbWluaW0gdmVuaWFtLCBxdWlzIG5vc3RydWQg
ZXhlcmNpdGF0aW9uIHVsbGFtY28gbGFib3JpcyBuaXNpIHV0IGFsaXF1aXAgZXggZWEgY29t
bW9kbyBjb25zZXF1YXQuIER1aXMgYXV0ZSBpcnVyZSBkb2xvciBpbiByZXByZWhlbmRlcml0
IGluIHZvbHVwdGF0ZSB2ZWxpdCBlc3NlIGNpbGx1bSBkb2xvcmUgZXUgZnVnaWF0IG51bGxh
IHBhcmlhdHVyLiBFeGNlcHRldXIgc2ludCBvY2NhZWNhdCBjdXBpZGF0YXQgbm9uIHByb2lk
ZW50LCBzdW50IGluIGN1bHBhIHF1aSBvZmZpY2lhIGRlc2VydW50IG1vbGxpdCBhbmltIGlk
IGVzdCBsYWJvcnVtLg==
------------------------ END TELETYPE DATA: v1 -------------------------
``
(I’ve used double backticks rather than triple because Markdown.)
On the subject of binary serialisation formats. Why do we need something like msgpack? If the Teletype ends up being the only device that can read the data then we are not working in the heterogeneous environment that those formats are designed for.
Why not just a raw dump of a versioned struct1, with code to forward translate versions? We’re going to have to do that anyway msgpack or not.
If we do have a binary serialisation format, then we need to take special care that the format is independent of the layout of tele_ops. If we do get it right, then a potential future benefit would be saving the internal scenes in the same binary format. Then we could let internal saved scenes persist between firmware flashes!
Of course, if we switch to a binary format, someone will need to break the news that everyone will need to retype all their presets…
1 With some header bytes to indicate the version.