-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
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
add a class to convert from absolute MIDI tick to milliseconds #62
base: master
Are you sure you want to change the base?
Conversation
Looks awesome, was looking for this. |
I am have trouble implementing your wrapper class. It gives me an error saying no such attribute "TimeResolver" using example_3.py. I have installed it using sudo python setup.py install. |
@billybob71a to the best of my knowledge the TimeResolver class was never added into the official code. You'd need to get the code from github directly by cloning my fork https://github.com/shimpe/python-midi |
Hi, Now, it is: I was just using your sample script example_3.py But it cannot even retrieve the milliseconds. Peter |
@billybob71a better check the changes in shimpe@9aa092e to see that you need to change some other things beside just appending the class. You could try to replace your version of sequencer.py with the one from my fork. |
Sorry, maybe I am a little bit new to using GIT. I did a git clone https://github.com/shimpe/python-midi.git. How, do I only get the changes in shimpe/python-midi@9aa092e ? |
@billybob71a If you cloned my fork, you should be able to install it as described in the readme file (sudo python setup.py install). My code is identical to the code here except for my changes related to TimeResolver. To be certain that we don't mix different versions of python-midi, you could remove the "pip install"-ed one first. |
Yes, I git cloned it from your fork. As follows: I ran : And I ran it in ipython, however, you can see that there is no "TimeResolver" option in "sequencer" module. In [1]: import midi In [2]: import midi.sequencer as sequencer In [3]: sequencer. In [3]: sequencer. |
The TimeResolver class is part of the sequencer.py file. If you open the sequencer.py file in a text editor, you should be able to locate it. Is it possible the autocompletion in ipython is still using some (outdated) cached information? |
There is no outdated cache information. I checked the .local directory and I removed the packages in /usr/local/lib/python2.7/dist-packages/mid and I re-installed it. This is the first time that I have installed it. Have you tried to install it on a new computer recently? Is it working for you? |
Thanks a lot for this feature! However I get this error: milliseconds = time_resolver.tick2ms(tick) Could you help? |
Pfff what a mess. It seems something is very wrong indeed. Let me see if there's a way to make some progress. |
Ok here's something to try (python 3 only - hope that's not too inconvenient). cd ~ (on my system python activates python3, on your system, you may need to explicitly call python3 instead) |
it seems to work for me, maybe it's also interesting for you
I've implemented it as a wrapper class to avoid messing up the existing code base and to avoid making the system slower if this functionality is not needed.