Skip to content

[WIP] Fix unit conversions#1

Open
superbock wants to merge 4 commits intomasterfrom
fix_unit_conversions
Open

[WIP] Fix unit conversions#1
superbock wants to merge 4 commits intomasterfrom
fix_unit_conversions

Conversation

@superbock
Copy link
Copy Markdown
Owner

@superbock superbock commented Aug 19, 2017

This PR addresses mido#102 and adds the necessary time signature arguments to the functions in mido.midifiles.units and modifies MidiFile.__iter__ to also respect time signature events in a MIDI stream/file.

This PR furthermore adds a couple of other (related) things:

  • add option to MidiFile to choose the timing unit to be used (ticks, seconds, beats),
  • add option to MidiFile to choose between relative and absolute timing when iterating over messages.

Before being able to be merged, these points should be discussed/addressed:

  • Extend the documentation to reflect all introduced changes, especially update the image in midi_files.rst.
  • Import the new tick2beat and beat2tick into the main namespace?
  • Include tick2beat and beat2tick in the API docs.
  • MidiFile.length raises a ValueError whereas MidiFile.__iter__ a TypeError in case of type 2 MIDI files. Which one is more appropriate?
  • Add docstrings, but which docstring format to use?
  • renaming ticks_per_beat to ticks_per_quarter_note or add new variable (how to deprecate the old one)?

@superbock superbock force-pushed the fix_unit_conversions branch 3 times, most recently from 92290e1 to 9a18de8 Compare August 23, 2017 08:50
@superbock superbock force-pushed the fix_unit_conversions branch 2 times, most recently from 9adf766 to a4678d1 Compare September 27, 2017 12:26
@superbock superbock force-pushed the fix_unit_conversions branch from a4678d1 to 4008d43 Compare December 14, 2017 15:06
@superbock superbock force-pushed the fix_unit_conversions branch 2 times, most recently from 58b87fd to 83caf8d Compare March 4, 2018 14:28
@superbock superbock force-pushed the fix_unit_conversions branch from 83caf8d to c086918 Compare March 4, 2018 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant