Music-and-Culture-Technology-Lab / omnizart

Omniscient Mozart, being able to transcribe everything in the music, including vocal, drum, chord, beat, instruments, and more.
https://music-and-culture-technology-lab.github.io/omnizart-doc/
MIT License
1.63k stars 99 forks source link

pyfluidsynth is missing when running omnizart synth #35

Closed hagenw closed 3 years ago

hagenw commented 3 years ago

I followed the examples in the Quickstart section, but got the following error:

$ omnizart synth song.mid
Output file as: ./song_synth.wav
Downloading default sondfont file...
Output path: /home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/omnizart/resource/soundfonts.sf2
Total size: 29.83MB
Progress: 100%, 29.83MB, 892.73KB/s
Synthesizing MIDI...
Traceback (most recent call last):
  File "/home/audeering.local/hwierstorf/.envs/omnizart/bin/omnizart", line 8, in <module>
    sys.exit(entry())
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/omnizart/cli/cli.py", line 220, in synth
    synth_midi(input_midi, output_path=output_file, sf2_path=sf2_path)
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/omnizart/utils.py", line 281, in synth_midi
    raw_wav = midi.fluidsynth(fs=sampling_rate, sf2_path=sf2_path)
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/pretty_midi/pretty_midi.py", line 946, in fluidsynth
    sf2_path=sf2_path) for i in self.instruments]
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/pretty_midi/pretty_midi.py", line 946, in <listcomp>
    sf2_path=sf2_path) for i in self.instruments]
  File "/home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages/pretty_midi/instrument.py", line 456, in fluidsynth
    raise ImportError("fluidsynth() was called but pyfluidsynth "
ImportError: fluidsynth() was called but pyfluidsynth is not installed.

Interestingly, I have that package installed:

$ pip show pyfluidsynth
Name: pyFluidSynth
Version: 1.3.0
Summary: Python bindings for FluidSynth, a MIDI synthesizer that uses SoundFont instruments
Home-page: https://github.com/nwhitehead/pyfluidsynth
Author: Nathan Whitehead
Author-email: nwhitehe@gmail.com
License: UNKNOWN
Location: /home/audeering.local/hwierstorf/.envs/omnizart/lib/python3.6/site-packages
Requires: numpy
Required-by: omnizart
hagenw commented 3 years ago

Relevant for https://github.com/openjournals/joss-reviews/issues/3391

hagenw commented 3 years ago

As before I'm running under Ubuntu 18.04 and using Python 3.6.9.

BreezeWhite commented 3 years ago

Hi, I found that it is due to the lack of fluidsynth on the system, not pyFluidSynth itself. This issue can be fixed by running apt-get install fluidsynth on Ubuntu. I will update the document later.

hagenw commented 3 years ago

Thanks for adding this to the docs.