Skip to content

v2.1.2 I/O fixes

Compare
Choose a tag to compare
@Natooz Natooz released this 24 Jul 18:16
· 180 commits to main since this release

Thanks to @Kapitan11 who spotted bugs when decodings tokens given as ids / integers (#59), this update brings a few fixes that solve them alongside tests ensuring that the input / output (i/o) formats of the tokenizers are well handled in every cases.
The documentation has also been updated on this subject, that was unclear until now.

Changes

  • 394dc4d Fix in MuMIDI and Octuple token encodings that performed the preprocessing steps twice;
  • 394dc4d code of single track tests improved and now covering tempos for most tokenizations;
  • 394dc4d MuMIDI can now decode tempo tokens;
  • 394dc4d _in_as_seq decorator now used solely for the tokens_to_midi() method, and removed from tokens_to_track() which explicitly expects a TokSequence object as argument (089fa74);
  • 089fa74 _in_as_seq decorator now handling all token ids input formats as it should;
  • 9fe7639 Fix in TSD decoding with multiple input sequences when not in one_token_stream mode;
  • 9fe7639 Adding i/o input ids tests;
  • 8c2349b unique_track property renamed to one_token_stream as it is more explicit and accurate;
  • 8c2349b new convert_sequence_to_tokseq method, which can convert any input sequence holding ids (integer), tokens (string) or events (Event) data into a TokSequence or list of TokSequences objects, with the appropriate format depending on the tokenizer. This method is used by the _in_as_seq decorator;
  • 8c2349b new io_format tokenizer property, returning the tokenizer's io format as a tuple of strings. Their significations are: I for instrument (for non one_token_stream tokenizers), T for token, C for sub-token class (for multi-voc tokenizers)
  • Minor code lint improvements;

Compatibility

  • All good 🙌