Comments (8)
It doesn't seem to work with Python3:
Loading audio...
Extracting melody f0 with MELODIA...
Converting Hz to MIDI notes...
Traceback (most recent call last):
File "audio_to_midi_melodia.py", line 225, in <module>
savejams=args.jams)
File "audio_to_midi_melodia.py", line 191, in audio_to_midi_melodia
notes = midi_to_notes(midi_pitch, fs, hop, smooth, minduration)
File "audio_to_midi_melodia.py", line 115, in midi_to_notes
if p_prev > 0:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
from audio_to_midi_melodia.
This specific error is described in #5. Fixing this issue seems straight forward, full python 3 support might require a few more changes. I'll have time to look into python 3 support in about 1 month. In the meanwhile, the easiest solution is to create a python 2.7 environment (e.g. using miniconda) and run the script from within this environment. Thanks in advance for your patience!
from audio_to_midi_melodia.
I changed the initialisation of p_prev (about line 107) to
p_prev = 0
from audio_to_midi_melodia.
I just want to add, there are two instances of p_prev you need to change. Line 126, and 107. Otherwise you get the error specified here
The codes sound, no pun intended and it's honestly amazing how it works with such a newer version of python so easily. I wouldn't abandon this project, it has a LOT of potential for DJs, Parody makers, and samplers like me alike.
from audio_to_midi_melodia.
I have the same question.
We also need python3 support !
from audio_to_midi_melodia.
What is broken with Python 3? I've just used it.
from audio_to_midi_melodia.
I fixed it as follow.
change
notes.append((onset_sec, duration_sec, p_prev))
to
notes.append((onset_sec, duration_sec, int(p_prev)))
from audio_to_midi_melodia.
Great code Justin π & Great fix guys !
Set p_prev = 0 at line 107
Replace p_prev by int(p_prev) at lines 121 & 133 and it just works fine in Python 3 !! Awesome result !!
from audio_to_midi_melodia.
Related Issues (20)
- Failed to load plugin: mtg-melodia:melodia HOT 8
- Converted mid file play just ding... dang dong... HOT 1
- Failed on launch HOT 3
- Audioread NoBackendError HOT 4
- Replace librosa with soundfile HOT 1
- Vamp::HostExt::PluginLoader: No library found in Vamp path for plugin "mtg-melodia:melodia" HOT 4
- how to set the program as βmonophonicβ HOT 8
- TypeError: Failed to load plugin: mtg-melodia:melodia HOT 2
- Melodia plugin download link has disappeared HOT 2
- Could you please tell me how to solve this problem when I install vamp? HOT 1
- Failed to load plugin: mtg-melodia:melodia HOT 3
- error when installing dependencies HOT 3
- Better algorithm for note segmentation/quantization ? HOT 1
- Is Exporting Only WAV possible? HOT 1
- need 'arm64' - Mac m1 HOT 1
- Song requirements
- Timestamps for pitch
- Divide by zero in log2 calculation HOT 2
- Use contour salience to set MIDI note velocity HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audio_to_midi_melodia.