jdxi_editor.midi.fluidsynth_library
Native FluidSynth library lookup
pyfluidsynth (import fluidsynth) is only the Python interface: it loads the
native FluidSynth library when imported. On Windows it finds
libfluidsynth-3.dll only through PATH or C:\tools\fluidsynth\bin, so
call prepare_fluidsynth_library() before importing it. That adds the
first folder that has the DLL, searched in this order:
FLUIDSYNTH_DIR(environment variable): the folder holding the DLL, or a FluidSynth install whosebinfolder holds itfluidsynth/binin the application bundle (the Windows build ships it) or the repository checkout (it is committed there)the folder of the executable (frozen builds)
C:\tools\fluidsynth\bin,%ProgramFiles%\FluidSynth\binand a Chocolatey install (choco install fluidsynth)
On macOS and Linux the system loader finds Homebrew or distribution packages, so nothing is done there.
Example
>>> prepare_fluidsynth_library()
>>> import fluidsynth
Attributes
Functions
|
Folders that may hold libfluidsynth-*.dll, most specific first. |
|
The first folder that contains libfluidsynth-*.dll, or None. |
|
Make the native FluidSynth library findable before |
|
How to install the native library, for this platform. |
|
A status line for a failed |
Module Contents
- jdxi_editor.midi.fluidsynth_library._prepared_dir: pathlib.Path | None = None[source]
- jdxi_editor.midi.fluidsynth_library.candidate_dirs() list[pathlib.Path][source]
Folders that may hold libfluidsynth-*.dll, most specific first.
- jdxi_editor.midi.fluidsynth_library.find_library_dir(dirs: Iterable[pathlib.Path] | None = None) pathlib.Path | None[source]
The first folder that contains libfluidsynth-*.dll, or None.
- jdxi_editor.midi.fluidsynth_library.prepare_fluidsynth_library(platform: str = sys.platform) pathlib.Path | None[source]
Make the native FluidSynth library findable before
import fluidsynth.- Returns:
the folder added to the DLL search (Windows), else None