Skip to content

Commit

Permalink
fixes in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Natooz committed May 4, 2023
1 parent d4fa2a5 commit b1851a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/midi_tokenizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/chrisdonahue/LakhNES>`_ or `MMM <https://metacreation.net/mmm-multi-track-music-machine/>`_.
* **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
Expand Down
8 changes: 4 additions & 4 deletions miditok/midi_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b1851a8

Please sign in to comment.