2011-04-25 22 views
6

No puedo importar fluidsynth. [Tal vez hay un mejor módulo?]python sintetizar midi con fluidsynth

Estoy tratando de sintetizar midi de python o pygame. Puedo enviar eventos midi de pygame. Estoy usando mingus, y parecía que pyfluidsynth sería bueno/más fácil.

Creo que esto significa que pyfluidsynth está instalado, pero un fluidsynth separado no lo estaba. No sé si requiere un instalador 'fluidsynth' para funcionar?

test.py:

import fluidsynth 
print ":(" 

error:

Traceback (most recent call last): 
    File "test.py", line 1, in <module> 
    import fluidsynth 
    File "C:\Users\jake\AppData\Roaming\Python\Python27\site-packages\fluidsynth.py", line 34, in <module> 
    raise ImportError, "Couldn't find the FluidSynth library." 
ImportError: Couldn't find the FluidSynth library. 

usando: pitón 2,7-win32

+0

¿Has probado https://github.com/MostAwesomeDude/pyfluidsynth? – endolith

Respuesta

0

En cuanto a fluidsynth.py, su conjetura es probablemente la correcta. Debería intentar poner fluidsynth.dll en algún lugar de la ruta de búsqueda de la biblioteca de su sistema (el más fácil sería probablemente el mismo directorio que su script o fluidsynth.py).

creo Este archivo (que se encuentra a google) contiene el binario Win32 necesario: http://svn.drdteam.org/zdoom/fluidsynth.7z

3

El módulo fluidsynth pitón está buscando el archivo de biblioteca binaria FluidSynth (es decir fluidsynth.dll).

Para hacer esto, puedes descargar, compilar e instalar http://sourceforge.net/projects/fluidsynth/files/fluidsynth-1.1.3/

O

que puede ser capaz de encontrar proyectos que utilizan fluidsynth (es decir QSynth) que incluyen copias precompilados del archivo .dll.

3

Sí, también necesita la lib de FuildSynth (dll para windows).

Para que funciona con:

  • synthsynth fluido 1.1.6
  • Python26 (32bits)
  • pyFluidSynth 1.1.4
  • de Windows

He puesto todo esta en el mismo directorio (fluidsynth dll, PyFluidSynth Module, python script).

y cambia las siguientes líneas en los módulos de pyFluidSynth (línea 30):

# A short circuited or expression to find the FluidSynth library 
# (mostly needed for Windows distributions of libfluidsynth supplied with QSynth) 
# and Dynamically link the FluidSynth library 

lib = find_library('fluidsynth') or find_library('libfluidsynth') or find_library('libfluidsynth-1') 
if lib is None: 
    _fl = ctypes.cdll.LoadLibrary("./libfluidsynth") 
    lib = "ok"; 
else: 
    _fl = CDLL(lib) 

if lib is None: 
    raise ImportError, "Couldn't find the FluidSynth library." 


# Helper function for declaring function prototypes 

Trabaja muy bien con esta configuración.

Cuestiones relacionadas