diff --git a/docs/midi_tokenizer.rst b/docs/midi_tokenizer.rst index c4a82a6f..1c859f62 100644 --- a/docs/midi_tokenizer.rst +++ b/docs/midi_tokenizer.rst @@ -54,7 +54,7 @@ MidiTok offers to include additional tokens on music information. You can specif * **Rests:** includes *Rest* tokens whenever a portion of time is silent, i.e. no note is being played. This token type is decoded as a *TimeShift* event. You can choose the minimum and maximum rests values to represent with the ``rest_range`` key in the ``additional_tokens`` dictionary (default is 1/2 beat to 8 beats). Note that rests shorter than one beat are only divisible by the first beat resolution, e.g. a rest of 5/8th of a beat will be a succession of ``Rest_0.4`` and ``Rest_0.1``, where the first number indicate the rest duration in beats and the second in samples / positions. * **Tempos:** specifies the current tempo. This allows to train a model to predict tempo changes. Tempo values are quantized accordingly to the ``nb_tempos`` and ``tempo_range`` entries in the ``additional_tokens`` dictionary (default is 32 tempos from 40 to 250). * **Programs:** used to specify an instrument / MIDI program. MidiTok only offers the possibility to include these tokens in the vocabulary for you, but won't use them. If you need model multitrack symbolic music with other methods than Octuple / MuMIDI, MidiTok leaves you the choice / task to represent the track information the way you want. You can do it as in `LakhNES `_ or `MMM `_. -* **Time Signature:** specifies the current time signature. Only implemented with :ref:`REMIPlus`, :ref:`Octuple` and :ref:`OctupleMono` atow. +* **Time Signature:** specifies the current time signature. Only implemented with :ref:`REMIPlus`, :ref:`Octuple` and :ref:`Octuple Mono` atow. .. list-table:: Compatibility table of tokenizations and additional tokens. :header-rows: 1 diff --git a/miditok/midi_tokenizer.py b/miditok/midi_tokenizer.py index 98fe5793..e4725b6d 100644 --- a/miditok/midi_tokenizer.py +++ b/miditok/midi_tokenizer.py @@ -1534,7 +1534,7 @@ def tokenize_midi_dataset( :param midi_paths: paths of the MIDI files. :param out_dir: output directory to save the converted files. :param validation_fn: a function checking if the MIDI is valid on your requirements - (e.g. time signature, minimum/maximum length, instruments ...). + (e.g. time signature, minimum/maximum length, instruments ...). :param data_augment_offsets: data augmentation arguments, to be passed to the miditok.data_augmentation.data_augmentation_dataset method. Has to be given as a list / tuple of offsets pitch octaves, velocities, durations, and finally their directions (up/down). (default: None) @@ -1883,9 +1883,9 @@ def __getitem__( r"""Convert a token (int) to an event (str), or vice-versa. :param item: a token (int) or an event (str). For tokenizers with embedding pooling / multiple vocabularies - (`tokenizer.is_multi_voc`), you must either provide a string (token) that is within all vocabularies (e.g. - special tokens), or a tuple where the first element in the index of the vocabulary and the second the element to - index. + ( `tokenizer.is_multi_voc` ), you must either provide a string (token) that is within all vocabularies (e.g. + special tokens), or a tuple where the first element in the index of the vocabulary and the second the + element to index. :return: the converted object. """ if isinstance(item, tuple) and self.is_multi_voc: