Giter Club home page Giter Club logo

mutwo.midi's People

Contributors

levinericzimmermann avatar

Watchers

 avatar  avatar

mutwo.midi's Issues

Fix tempo_envelope parameter

Since mutwo.core 0.61.0 events have a tempo_envelope attribute. EventToMidiFile should use this tempo_envelope attribute instead of using its own field. But it should add a field metrize: bool = True.

Fix conversion of events with small durations

Currently conversion of events with smaller duration values is broken.

from mutwo import midi_converters
from mutwo import core_events
# this works
midi_converters.EventToMidiFile().convert(core_events.SimpleEvent(2), 'test.mid')
# this will fail
midi_converters.EventToMidiFile().convert(core_events.SimpleEvent(0.5), 'test.mid')

error message:

Traceback (most recent call last):
  File "/build/mutwo.midi/tests/converters/frontends_tests.py", line 768, in test_convert_event_with_small_duration
    self.converter.convert(simple_event, self.midi_file_path)
  File "/build/mutwo.midi/mutwo/midi_converters/frontends.py", line 947, in convert
    midi_file.save(filename=path)
  File "/nix/store/fnldc12gqvcydd3ggnpwrc48v5rckmwm-python3.9-mido-1.2.10/lib/python3.9/site-packages/mido/midifiles/midifiles.py", line 446, in save
    self._save(file)
  File "/nix/store/fnldc12gqvcydd3ggnpwrc48v5rckmwm-python3.9-mido-1.2.10/lib/python3.9/site-packages/mido/midifiles/midifiles.py", line 459, in _save
    write_track(outfile, track)
  File "/nix/store/fnldc12gqvcydd3ggnpwrc48v5rckmwm-python3.9-mido-1.2.10/lib/python3.9/site-packages/mido/midifiles/midifiles.py", line 251, in write_track
    raise ValueError('message time must be non-negative in MIDI file')
ValueError: message time must be non-negative in MIDI file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.