We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.1.5
When using REMI tokenizer, the time_signature_changes in the first measure will not be changed, but will use the default value '4/4'.
import pretty_midi midi = pretty_midi.PrettyMIDI(midi_path) print("MIDI time_signature_changes:\n", midi.time_signature_changes)
from miditok import REMI, REMIPlus, TokenizerConfig, MIDITokenizer config = TokenizerConfig(use_tempos=True, nb_tempos=240, tempo_range=(20, 259), use_rests=True, use_time_signatures=True, time_signature_range={8: (3,12), 4: (1,6)}, use_programs=False) tokenizer = REMI(config) tokens = tokenizer(midi_path) print("MIDI tokens: \n", tokens)
MIDI time_signature_changes: [TimeSignature(numerator=5, denominator=8, time=0.0), TimeSignature(numerator=8, denominator=8, time=2.5), TimeSignature(numerator=5, denominator=8, time=4.5)] MIDI tokens: [TokSequence(tokens=['Bar_None', 'TimeSig_4/4', 'Position_0', 'Tempo_120.0', 'Pitch_46', 'Velocity_79', 'Duration_0.2.8', 'Pitch_65', 'Velocity_79', 'Duration_1.0.8', 'Pitch_70', 'Velocity_79', 'Duration_1.0.8', 'Pitch_74', 'Velocity_79', 'Duration_1.0.8', 'Position_2', 'Pitch_58', 'Velocity_79', 'Duration_0.2.8', 'Position_6', 'Pitch_82', 'Velocity_79', 'Duration_0.2.8', 'Rest_0.2.8', 'Position_10', 'Pitch_82', 'Velocity_79', 'Duration_0.2.8', 'Position_12', 'Pitch_94', 'Velocity_79', 'Duration_0.2.8', 'Position_14', 'Pitch_82', 'Velocity_79', 'Duration_0.2.8', 'Position_16', 'Pitch_70', 'Velocity_79', 'Duration_0.2.8', 'Rest_0.2.8', 'Position_0', 'Pitch_46', 'Velocity_79', 'Duration_0.2.8', 'Pitch_70', 'Velocity_79', 'Duration_0.2.8', 'Position_2', 'Pitch_58', 'Velocity_79', 'Duration_0.2.8', 'Position_4', 'Pitch_70', 'Velocity_79', 'Duration_0.2.8', 'Position_6', 'Pitch_70', 'Velocity_79', 'Duration_0.2.8', 'Position_8', 'Pitch_82', 'Velocity_79', 'Duration_0.2.8', 'Position_10', 'Pitch_94', ...]
The text was updated successfully, but these errors were encountered:
Hey 👋, Thank you for the bug report! I'll take a look into it shortly and come back to you
Sorry, something went wrong.
This is fixed and will be featured in the next update that will be released when #74 is fixed!
No branches or pull requests
miditok version
2.1.5
Problem summary
When using REMI tokenizer, the time_signature_changes in the first measure will not be changed, but will use the default value '4/4'.
Steps to reproduce
import pretty_midi
midi = pretty_midi.PrettyMIDI(midi_path)
print("MIDI time_signature_changes:\n", midi.time_signature_changes)
from miditok import REMI, REMIPlus, TokenizerConfig, MIDITokenizer
config = TokenizerConfig(use_tempos=True, nb_tempos=240, tempo_range=(20, 259), use_rests=True, use_time_signatures=True, time_signature_range={8: (3,12), 4: (1,6)}, use_programs=False)
tokenizer = REMI(config)
tokens = tokenizer(midi_path)
print("MIDI tokens: \n", tokens)
Expected vs. actual behavior
MIDI time_signature_changes:
[TimeSignature(numerator=5, denominator=8, time=0.0), TimeSignature(numerator=8, denominator=8, time=2.5), TimeSignature(numerator=5, denominator=8, time=4.5)]
MIDI tokens:
[TokSequence(tokens=['Bar_None', 'TimeSig_4/4', 'Position_0', 'Tempo_120.0', 'Pitch_46', 'Velocity_79', 'Duration_0.2.8', 'Pitch_65', 'Velocity_79', 'Duration_1.0.8', 'Pitch_70', 'Velocity_79', 'Duration_1.0.8', 'Pitch_74', 'Velocity_79', 'Duration_1.0.8', 'Position_2', 'Pitch_58', 'Velocity_79', 'Duration_0.2.8', 'Position_6', 'Pitch_82', 'Velocity_79', 'Duration_0.2.8', 'Rest_0.2.8', 'Position_10', 'Pitch_82', 'Velocity_79', 'Duration_0.2.8', 'Position_12', 'Pitch_94', 'Velocity_79', 'Duration_0.2.8', 'Position_14', 'Pitch_82', 'Velocity_79', 'Duration_0.2.8', 'Position_16', 'Pitch_70', 'Velocity_79', 'Duration_0.2.8', 'Rest_0.2.8', 'Position_0', 'Pitch_46', 'Velocity_79', 'Duration_0.2.8', 'Pitch_70', 'Velocity_79', 'Duration_0.2.8', 'Position_2', 'Pitch_58', 'Velocity_79', 'Duration_0.2.8', 'Position_4', 'Pitch_70', 'Velocity_79', 'Duration_0.2.8', 'Position_6', 'Pitch_70', 'Velocity_79', 'Duration_0.2.8', 'Position_8', 'Pitch_82', 'Velocity_79', 'Duration_0.2.8', 'Position_10', 'Pitch_94', ...]
The text was updated successfully, but these errors were encountered: