# ot-tools-io

rust library crate for reading/writing binary data files used by the [Elektron Octatrack DPS-1](https://www.elektron.se/en/octratrack-mkii-explorer)

## License
[GNU GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html)

## About

Library crate for reading/writing Octatrack binary data files.
Most of this is just the [`serde`](https://serde.rs) and
[`bincode`](https://github.com/bincode-org/bincode) crates with a bunch of
function definitions for reading/writing different files or creating new types.

The majority of fields contained within binary data files have been reverse engineered.
See the list in [./TODO.md](ot-tools-io/TODO.md) for information about missing/unknown data fields.

## Current Features (mostly working-ish)
- Read Octatrack binary data files and deserialize into rust types
- Serialize rust types and write into Octatrack binary data files
- Convert Octatrack binary data files into YAML (string or file)
- Convert Octatrack binary data files into JSON (string or file)
- Convert JSON (string or file) into Octatrack binary data files
- Convert YAML (string or file) into Octatrack binary data files

## Versioning

The plan for `1.0.0` onwards (when I get there)
- MAJOR changes `X.0.0` --> Elektron have released a new OS version which introduces 
  breaking changes in the files. Ongoing versions of this library will only support 
  those latest OS changes. Backwards compatibility between OS versions will not be provided.  
- MINOR changes `0.X.0` --> I'm releasing changes which will break existing codebases.
- PATCH changes `0.0.X` --> Anything else.

## Notes

The JSON / YAML data structures are a bit ... weird. I have done my best to not
parse the underlying data into new structures, keeping it so that the library
returns data that is *as-close-to-the-raw-data-as-possible*.

Like, the arrangements data could do with some work to deal with all the
`{"empty": ""}` arranger rows. Header fields *probably* don't need to be there
and can be injected in during deserialization.

## Credits

The following projects were used a starting references for the initial
serialization/deserialization efforts of data files (mostly the `.ot` files).
Without them, ot-tools probably wouldn't exist.

- [Digichain by brian3kb](https://github.com/brian3kb/digichain) 
- [OctaChainer by KaiDrange](https://github.com/KaiDrange/OctaChainer)

A special shout out to [OctaEdit by Rusty](http://www.octaedit.com) (no longer available)
which showed the community what it was possible to do.
Hopefully there are lots of moonbeams and bunny rabbits wherever you are.

Other rust based credits:

- the [serde](https://serde.rs) framework made reverse engineering data files a lot easier,
  `ot-tools-io` probably wouldn't exist without serde.
- same with [bincode](https://github.com/bincode-org/bincode) for reading the binary data
