justinsalamon/audio_to_midi_melodia

TypeError: Failed to load plugin: mtg-melodia:melodia

srianbury opened this issue · 34 comments

Vamp::HostExt::PluginLoader: No library found in Vamp path for plugin "mtg-melodia:melodia"
Traceback (most recent call last):
File ".../audio_to_midi_melodia.py", line 220, in
audio_to_midi_melodia("test.wav", "test.mid", 60)
File ".../audio_to_midi_melodia.py", line 166, in audio_to_midi_melodia
parameters={"voicing": 0.2})
File "...\audio_to_midi_melodia\venv\lib\site-packages\vamp\collect.py", line 166, in collect
plugin, step_size, block_size = vamp.load.load_and_configure(data, sample_rate, plugin_key, parameters, **kwargs)
File "...\audio_to_midi_melodia\venv\lib\site-packages\vamp\load.py", line 83, in load_and_configure
vampyhost.ADAPT_CHANNEL_COUNT)
TypeError: Failed to load plugin: mtg-melodia:melodia

Can anyone help me with this issue? I'm not sure why the plugin failed to load. Could it because I am working in a virtual environment (venv) within pycharm?

It looks like you don't have the melodia plugin installed?

@srianbury can you confirm whether installing the melodia plugin prior to running the script fixed your problem or not? Thanks

Hey Justin, I have it installed but it still does not work. I haven't touched it in a while so I forget what the exact issue was. I never did get it to work though.

ok, thanks. It's hard for me to help without further details, if you get back to trying at any point let me know. cheers

same problem here. I tested the plugin works well with sonic visualizer, but when it comes to python and went on jupyter notebook, the plugin detection was failed.

System: Windows 10 python 3.6 all required packages installed

@IAMLYCHEE thanks for reporting the issue, could you please provide more details:

  • Which version of the vamp module are you using?
  • What is the error message that you get?
  • Can you try it with python 2.7 and see if you get the same error?

Thanks

Hi I ran into the same problem.

Loading audio...
Extracting melody f0 with MELODIA...
Vamp::HostExt::PluginLoader: No library found in Vamp path for plugin "mtg-melodia:melodia"
Traceback (most recent call last):
File "audio_to_midi_melodia.py", line 217, in
savejams=args.jams)
File "audio_to_midi_melodia.py", line 166, in audio_to_midi_melodia
parameters={"voicing": 0.2})
File "/home/user/.local/lib/python2.7/site-packages/vamp/collect.py", line 166, in collect
plugin, step_size, block_size = vamp.load.load_and_configure(data, sample_rate, plugin_key, parameters, **kwargs)
File "/home/user/.local/lib/python2.7/site-packages/vamp/load.py", line 83, in load_and_configure
vampyhost.ADAPT_CHANNEL_COUNT)
TypeError: Failed to load plugin: mtg-melodia:melodia

I used Python 2.7 on Ubuntu, 64bit. I downloaded melodia vamp plugin and extracted it to the folder mentioned in installation instructions. I also added the environ variable VAMP_PATH. It points to the right folder.

The folder with melodia contains MELODIA - LIcense.txt, mtg-melodia.cat, mtg-meloda.n3 mtg-melodia.so and the readme file. What am I missing? How to fix this? Any help would be greatly appreciated. :)

@lordofluck first thing is to determine if this is a vamp issue or a python issue. Can you check whether you can load and run the plugin from Sonic Visualiser? If the plugin works in SV we know it's an issue with the python module, if you can't find/run it in SV we know it's an issue with the vamp plugin itself. Thanks.

Hi, i tried to view the plugin in Sonic Visualiser and it was not visible. I tried moving it to /usr/local/lib/vamp and it popped in the plugin list. After this I ran the script and it worked just fine. Thanks for the hint.

Thanks @lordofluck for reporting back. Closing this issue out.

I am having the same problem as above, except Sonic Visualizer says that it can't load melodia because it might be a 32 bit architecture in a 64 bit folder. I am running 64 bit windows and put the the melodia stuff in my Program Files (x86)/Vamp Plugins folder which is the instructed option. Please let me know what I could do.

@weeshal did you also install the required VS redistributable as instructed in the README file? Are you able to load other 32-bit vamp plugins?

Hi there, I have exactly same issue here with VS redistributable installed on my Win10 (x64).
When SV is loaded, the error msg shows:
e::/vamp/mtg-melodia.dll Library has wrong architecture - possible a 32-bit plugin installed in a 64-bit plugin folder. Is there anything I missed?
Thanks

@Steveliu melodia is a 32-bit plugin. Please make sure you followed the installation instructions for 32-bit vamp plugins: https://www.vamp-plugins.org/download.html?platform=win32#install

errormsg
II think I followed the instruction there. Put the plugin in designated directory e:\vamp set through VAMP_PATH. but I still got this loading error in attached screenshot.

@Steveliu these are the instructions:

When using a 64-bit version of Windows:
* Put 32-bit plugins in C:\Program Files (x86)\Vamp Plugins
* Put 64-bit plugins in C:\Program Files\Vamp Plugins
* Both 32-bit and 64-bit plugins can be used, as long as you put them in the right places as above
* If a plugin package is not described as 64-bit, then it is a 32-bit plugin. Some older plugins were only published in 32-bit form.

Since your system is 64 bit, you should place the plugin here: C:\Program Files (x86)\Vamp Plugins

this is exactly what I did before setting VAMP_PATH, but it still fails me. :(
err2
anything else I could possibly miss?

Hmm, the path in the error message is C:/Program Files/..., but the plugin should be in C:/Program Files (x86)/.... I can see you've placed the plugin in the latter location based on your screenshot, but could you have also placed it in another folder by any chance? If so make sure you don't have the plugin in any other folder, only in the x86 path, and try that.

Also some people have reported issues with the plugin with the latest versions of SV. If the above still doesn't work, I would try downloading an older version (e.g. 2.4) and seeing if that works.

yeah, I tried Program File (x86) fold after I removed the VAMP_PATH from environment setting and corresponding directory (which was e:\vamp) and still got this message.
Later

I tried VS 2.4 as suggested. This time it did not pop up any error msg at the time of loading. However, I still can't use the plugin. Melodiais grayed somehow as shown in screenshots.

err4

Any clue one this?

SV is recognizing the plugin, which is a good sign. Could it just be that you didn't load an audio file into SV yet? You can't run any plugins before you load an audio file.

sorry, I forgot to load the audio file. Now it works for me. Thanks a lot.
Actually, my original intension was to run this python program to extract melody
from audio and convert it to midi. Although SV loads melodia now, the python
program still fails. See this screenshot:

err5

Anything else I need to set up before running this python?

I'm having the same issue as @Steveliu . SV loads the plugin and analyses the audio file okay. I've tried everything that people have suggested, but no luck. Is there any way of getting it to load the dll directly?

If the plugin loads fine in SV and fails to load in python, it's probably a compatibility issue between the melodia plugin, the version of python you have installed, and the version of the python vamp module.

Since this worked fine a while back, my recommendation would be to try the following:

  • First make sure Melodia loads fine in Sonic Visualiser to confirm it's installed properly
  • Install the 32-bit version of Python 2.7
  • Install the vamp module via "pip install vamp"

If you decide to give this a try please let me know what you find. Thanks.

Yes, it works with 32-bit Python 2.7. Many thanks.
It seems that it does not extract the melody usually found in the vocal part of a song as I anticipated. All it captured was acompany or instrumental part. Not sure if there's any parameters I can play with to get desired result?

Yes I too can confirm that it works with 32-bit Python 2.7. I should really have read the README more closely, so apologies for that. Lesson learnt. Many thanks for your swift help @justinsalamon .

Thanks both for confirming, glad you got it working!

@Steveliu the conversion to MIDI is an experimental feature and your mileage will vary depending on the content you analyze.

My recommendation would be to try the Melodia plugin on its own (without the conversion to MIDI step) via Sonic Visualiser to see how well the continuous melody is being tracked. Generally, content with a clear predominant melody (e.g. vocals with pop/folk accompaniment) should work very well. Content where the accompaniment is very loud (e.g. EDM or Metal), or content without a clear predominant melody (e.g. classical music with counterpoint) is likely to result in poorer results.

@justinsalamon Thanks for the advise again.

I tried SV. When After I turn on the 'Melody Extraction' under Trransform, all I see is grean dash line or curve on top of spectrogram which I believe is the visualization of the melody? btw, is there any way I can listen to the melody in VS to experience the quality of the extraction?

btw, the song I pick to test melody extration is 'What a wonderful world'. Is this one considered to have 'predominant' melody with Louis Armstrong's magnetic voice and, in my opinion, a decent level acompaniment ? :)

The curve you're seeing in SV is the continuous melody pitch estimate (in Hertz) over time. You can listen to it directly in SV using the Play control on the estimated melody layer (this is SV 2.5):

explainer 001

The controls may look different depending on your version of Sonic Visualiser.

Alternatively, you can export the data from Sonic Visualiser as CSV (or obtain the CSV data from the python code) and use it as input to melosynth: https://github.com/justinsalamon/melosynth

hi, i use conda, and i create python2 (Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 17:26:54) [MSC v.1500 64 bit (AMD64)] on win32), but i get this error: TypeError: Failed to load plugin: mtg-melodia:melodia, but the Sonic Visualiser worked, so what happen to me?

you're using a 64-bit python installation, the README explicitly notes you need to use 32-bit.

Can you please help me, I dont know whats the problem here:

C:\Program Files (x86)\Vamp Plugins\audio_to_midi_melodia-master>python audio_to_midi_melodia.py --smooth 0.25 --minduration 0.1 --jams ./song.wav ./song.mid 60
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
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'

C:\Program Files (x86)\Vamp Plugins\audio_to_midi_melodia-master>

@groessi99 this is likely because you're using Python 3 to run the code when it only supports python 2. I plan to update the codebase to be Python 3 compatible, until then running in Python 2 should solve your issue.

I needed this to work with python3.x because it will be used with tensorflow.

After lots of troubleshooting i found out, that it only works with 32Bit python. You can use Python3.x 32Bit if you do the minor changes mentioned in https://github.com/justinsalamon/audio_to_midi_melodia/pulls .

With that configuration and the correct Vamp Plugin path, i got it to run