Compare commits

..

No commits in common. "native_win32" and "v2.1.0" have entirely different histories.

281 changed files with 6458 additions and 60332 deletions

50
.appveyor-vcpkg.yml Normal file
View file

@ -0,0 +1,50 @@
image:
- Visual Studio 2017
build:
parallel: true
verbosity: detailed
configuration:
- Release
environment:
# update the vcpkg cache even if build fails
APPVEYOR_SAVE_CACHE_ON_ERROR: true
matrix:
- platform: x86
- platform: x64
cache:
- c:\Tools\vcpkg\installed
init:
- set TARGET_PLATFORM=
- if "%platform%"=="x64" ( set TARGET_PLATFORM= Win64)
- if "%platform%"=="ARM" ( set TARGET_PLATFORM= ARM)
- echo %TARGET_PLATFORM%
- echo %APPVEYOR_BUILD_WORKER_IMAGE%
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set "generator=Visual Studio 15 2017%TARGET_PLATFORM%" && set "toolset=v141_xp" )
- echo %generator%
- echo %toolset%
install:
# make sure the latest version of git is installed
- choco upgrade git -y
- vcpkg install glib:%platform%-windows
build_script:
- mkdir build
- cd build
- cmake -G "%generator%" -T "%toolset%" -Denable-pkgconfig=0 -DCMAKE_TOOLCHAIN_FILE=c:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DNO_GUI=1 ..
- cmake --build . --config Release # build libfluidsynth and fluidsynth exec
- cmake --build . --config Release --target check # build and exec unittests
after_build:
- 7z a fluidsynth-vcpkg-%platform%.zip %APPVEYOR_BUILD_FOLDER%\build\src\Release\*
artifacts:
- path: build/fluidsynth-vcpkg-%platform%.zip
name: FluidSynth

24
.azure-pipelines-mac.yml Normal file
View file

@ -0,0 +1,24 @@
# C/C++ with GCC
# Build your C/C++ project with GCC using make.
# Add steps that publish test results, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc
jobs:
- job: macOS
pool:
vmImage: 'macOS-10.14'
steps:
- script: |
brew update
brew install glib gobject-introspection libsndfile pkg-config jack dbus-glib pulseaudio portaudio sdl2
displayName: 'Prerequisites'
- script: |
mkdir build && cd build
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
make
displayName: 'Compile fluidsynth'
- script: |
cd build || exit -1
make check || exit -1
displayName: 'Execute Unittests'

View file

@ -1,40 +1,28 @@
trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-mac.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
# C/C++ with GCC
# Build your C/C++ project with GCC using make.
# Add steps that publish test results, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc
jobs:
- job: WindowsXP
variables:
toolset: v141_xp
- job: Windows
strategy:
matrix:
x86:
XP_x86:
platform: Win32
toolset: v141_xp
gtk-bundle: $(gtk-bundle-x86)
libsndfile-url: $(libsndfile-url-x86)
artifact-prefix: "fluidsynth"
CFLAGS: "/arch:IA32"
CXXFLAGS: "/arch:IA32"
x64:
imageName: 'vs2017-win2016'
XP_x64:
platform: x64
toolset: v141_xp
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
artifact-prefix: "fluidsynth"
CFLAGS: ""
CXXFLAGS: ""
imageName: 'vs2017-win2016'
pool:
vmImage: 'windows-2019'
vmImage: $(imageName)
steps:
- task: DownloadBuildArtifacts@0
inputs:
@ -42,7 +30,7 @@ jobs:
# https://dev.azure.com/tommbrt/_apis/projects?api-version=5.0
project: 'd3638885-de4a-4ce7-afe7-f237ae461c07'
pipeline: 1
artifactName: libinstpatch-XP-$(platform)
artifactName: libinstpatch-$(platform)
downloadPath: '$(Build.ArtifactStagingDirectory)'
displayName: 'Get libinstpatch'
- script: |
@ -56,20 +44,19 @@ jobs:
REM need to fix the naming of libsndfile otherwise the linker won't find it
mv lib\libsndfile-1.lib lib\sndfile.lib || exit -1
mv lib\libsndfile-1.def lib\sndfile.def || exit -1
cd $(Build.ArtifactStagingDirectory)\libinstpatch-XP-$(platform)
cd $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform)
cp -rf * d:\deps\
mv -f * ..
cd ..
rmdir $(Build.ArtifactStagingDirectory)\libinstpatch-XP-$(platform)\
DEL /F C:\Strawberry\perl\bin\pkg-config.bat
rmdir $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform)\
displayName: 'Prerequisites'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
pkg-config --list-all
mkdir build && cd build || exit -1
cmake -Werror=dev -A $(platform) -T $(toolset) -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) -Denable-readline=0 -Denable-floats=1 -Denable-jack=0 -Denable-sdl2=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 -Dwindows-version=0x0501 .. || exit -1
cmake --build . --config Release --parallel 3 || exit -1
cmake -A $(platform) -T $(toolset) -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) -Denable-readline=0 -Denable-floats=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1
cmake --build . --config Release || exit -1
displayName: 'Compile fluidsynth'
- script: |
@ECHO ON
@ -77,12 +64,6 @@ jobs:
cd build || exit -1
cmake --build . --config Release --target check || exit -1
displayName: 'Execute Unittests'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
cd build || exit -1
cmake --build . --config Release --target demo || exit -1
displayName: 'Compile demos'
- script: |
@ECHO ON
cd build
@ -90,37 +71,43 @@ jobs:
del $(Build.ArtifactStagingDirectory)\bin\concrt*.dll
del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll
del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll
del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib
del $(Build.ArtifactStagingDirectory)\lib\libinstpatch*.lib
del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc
rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q
rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-1 /s /q
displayName: 'Copy Artifacts'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: $(artifact-prefix)-$(platform)
- job: Windows10
variables:
toolset: v142
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
- job: WindowsCI
strategy:
matrix:
default:
CMAKE_FLAGS:
CMAKE_CONFIG: Release
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
debug_prof:
CMAKE_FLAGS: -Denable-profiling=1 -Denable-trap-on-fpe=1 -Denable-fpe-check=1
CMAKE_CONFIG: Debug
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
no_network:
CMAKE_FLAGS: -Denable-network=0
CMAKE_CONFIG: Release
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
static_lib:
CMAKE_FLAGS: -DBUILD_SHARED_LIBS=0
CMAKE_CONFIG: Release
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
minimal:
CMAKE_FLAGS: -Denable-ipv6=0 -Denable-network=0 -Denable-aufile=0 -Denable-threads=0 -Denable-winmidi=0 -Denable-waveout=0 -Denable-dsound=0 -Denable-libsndfile=0 -Denable-floats=1
CMAKE_FLAGS: -Denable-ipv6=0 -Denable-network=0 -Denable-aufile=0 -Denable-dbus=0 -Denable-threads=0 -Denable-winmidi=0 -Denable-waveout=0 -Denable-dsound=0 -Denable-libsndfile=0 -Denable-floats=1
CMAKE_CONFIG: Release
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
pool:
vmImage: 'windows-2019'
steps:
@ -135,14 +122,13 @@ jobs:
REM need to fix the naming of libsndfile otherwise the linker won't find it
mv lib\libsndfile-1.lib lib\sndfile.lib || exit -1
mv lib\libsndfile-1.def lib\sndfile.def || exit -1
DEL /F C:\Strawberry\perl\bin\pkg-config.bat
displayName: 'Prerequisites'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
mkdir build && cd build || exit -1
cmake -Werror=dev -A x64 -T $(toolset) -DCMAKE_BUILD_TYPE=$(CMAKE_CONFIG) -DCMAKE_VERBOSE_MAKEFILE=1 $(CMAKE_FLAGS) -DNO_GUI=1 -Dwindows-version=0x0A00 -Denable-jack=0 -Denable-pulseaudio=0 -Denable-ladspa=0 -Denable-dbus=0 -Denable-readline=0 -Denable-sdl2=0 -Denable-libinstpatch=0 .. || exit -1
cmake --build . --config $(CMAKE_CONFIG) --parallel 3 || exit -1
cmake -A x64 -DCMAKE_BUILD_TYPE=$(CMAKE_CONFIG) -DCMAKE_VERBOSE_MAKEFILE=1 $(CMAKE_FLAGS) -DNO_GUI=1 .. || exit -1
cmake --build . --config $(CMAKE_CONFIG) || exit -1
displayName: 'Compile fluidsynth'
- script: |
@ECHO ON
@ -150,32 +136,24 @@ jobs:
cd build || exit -1
cmake --build . --config $(CMAKE_CONFIG) --target check || exit -1
displayName: 'Execute Unittests'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
cd build || exit -1
cmake --build . --config $(CMAKE_CONFIG) --target demo || exit -1
displayName: 'Compile demos'
- job: WindowsMinGW
variables:
artifact-prefix: "fluidsynth-mingw"
strategy:
matrix:
x86:
CMAKE_FLAGS: -DCMAKE_C_FLAGS="-m32"
platform: Win32
gtk-bundle: $(gtk-bundle-x86)
libsndfile-url: $(libsndfile-url-x86)
mingw-url: $(mingw-url-x86)
x64:
CMAKE_FLAGS:
platform: x64
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
mingw-url: $(mingw-url-x64)
x64-static:
CMAKE_FLAGS: '-DBUILD_SHARED_LIBS=0'
platform: x64
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
mingw-url: $(mingw-url-x64)
pool:
vmImage: 'windows-2019'
vmImage: 'vs2017-win2016'
steps:
- task: DownloadBuildArtifacts@0
inputs:
@ -202,7 +180,6 @@ jobs:
mv lib\libsndfile-1.def lib\sndfile.def || exit -1
cd mingw*\ && cp -rf * .. && cd .. && rm -rf mingw* || exit -1
cd $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform) && cp -rf * d:\deps\ && mv -f * .. && cd .. && rmdir $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform)\ || exit -1
DEL /F C:\Strawberry\perl\bin\pkg-config.bat
displayName: 'Prerequisites'
- script: |
@ECHO ON
@ -212,8 +189,8 @@ jobs:
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
pkg-config --list-all
mkdir build && cd build || exit -1
cmake -Werror=dev -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) $(CMAKE_FLAGS) -Denable-readline=0 -Denable-floats=1 -Denable-jack=0 -Denable-pulseaudio=0 -Denable-ladspa=0 -Denable-dbus=0 -Denable-sdl2=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1
mingw32-make.exe -j3 all || exit -1
cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) $(CMAKE_FLAGS) -Denable-readline=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1
mingw32-make.exe all || exit -1
displayName: 'Compile fluidsynth'
- script: |
@ECHO ON
@ -222,35 +199,5 @@ jobs:
set PATH=%PATH:C:\Program Files\Git\bin;=%
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
cd build || exit -1
mingw32-make.exe -j4 check || exit -1
mingw32-make.exe check || exit -1
displayName: 'Execute Unittests'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
REM remove that path from PATH to make sure sh.exe is not found (cmake will complain otherwise)
set PATH=%PATH:C:\Program Files\Git\bin;=%
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
cd build || exit -1
mingw32-make.exe -j4 demo || exit -1
displayName: 'Compile demos'
- script: |
@ECHO ON
cd build
mingw32-make.exe install || exit -1
xcopy d:\deps\bin\libgcc_s_sjlj-1.dll $(Build.ArtifactStagingDirectory)\bin
xcopy d:\deps\bin\libgcc_s_seh-1.dll $(Build.ArtifactStagingDirectory)\bin
xcopy d:\deps\bin\libgomp-1.dll $(Build.ArtifactStagingDirectory)\bin
xcopy d:\deps\bin\libstdc++-6.dll $(Build.ArtifactStagingDirectory)\bin
xcopy d:\deps\bin\libwinpthread-1.dll $(Build.ArtifactStagingDirectory)\bin
REM xcopy test $(Build.ArtifactStagingDirectory)\bin /s
del $(Build.ArtifactStagingDirectory)\bin\concrt*.dll
del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll
del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll
del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib
del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc
rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q
displayName: 'Copy Artifacts'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: $(artifact-prefix)-$(platform)

View file

@ -1,551 +0,0 @@
trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-mac.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.azure/azure-pipelines-win.yml'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
parameters:
- name: UseCache
displayName: Use Dependency Cache
type: boolean
default: true
values:
- true
- false
schedules:
- cron: "0 0 * * 1"
displayName: 'Weekly Monday Midnight build without caching'
branches:
include:
- master
always: true
variables:
ICONV_VERSION: '1.16'
# Use recent master libffi, because 3.3 is broken: checking host system type... Invalid configuration `arm-none-linux-eabi': machine `arm-none-linux' not recognized
FFI_VERSION: '3.4.2'
GETTEXT_VERSION: '0.21'
#need to switch to meson build system to use a more recent version
GLIB_VERSION: '2.71'
GLIB_EXTRAVERSION: '2'
OBOE_VERSION: '1.5.0'
SNDFILE_VERSION: '1.0.31'
INSTPATCH_VERSION: '1.1.6'
VORBIS_VERSION: '1.3.7'
OGG_VERSION: '1.3.5'
OPUS_VERSION: '1.3.1'
FLAC_VERSION: '1.3.4'
PCRE_VERSION: '8.45'
# Android NDK sources and standalone toolchain is put here
DEV: '$(System.DefaultWorkingDirectory)/android-build-root'
# This is a symlink pointing to the real Android NDK
# Must be the same as $ANDROID_NDK_HOME see:
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
# We cannot use $ANDROID_NDK_HOME because this is an environment variable, but here, we need a compile-time constant.
NDK: '/usr/local/lib/android/sdk/ndk-bundle'
# All the built binaries, libs and their headers will be installed here
PREFIX: '$(DEV)/opt/android'
# Prevent installing to lib64/
# This becomes important, if you would build on e.g. openSUSE
LIBPATH0: '$(PREFIX)/lib'
# The path of standalone NDK toolchain
# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
NDK_TOOLCHAIN: '$(NDK)/toolchains/llvm/prebuilt/linux-x86_64/'
# Don't mix up .pc files from your host and build target
PKG_CONFIG_PATH: '$(LIBPATH0)/pkgconfig'
# setting PKG_CONFIG_PATH alone does not seem to be enough to avoid mixing up with the host, also set PKG_CONFIG_LIBDIR
PKG_CONFIG_LIBDIR: '$(PKG_CONFIG_PATH)'
# Set Android target API level
# when compiling with clang use at least 28 as this makes sure that android provides the posix_spawn functions, so the compilation of gettext will (should) work out of the box
# it's probably a bug of gettext, if posix_spawn is not available it replaces it with its own implementation. Autotools of gettext set HAVE_POSIX_SPAWN==0 (which is correct) but for some reason REPLACE_POSIX_SPAWN==0 (which is wrong, as it should be 1).
#
# NOTE: API 24 is required because it provides fseeko() and ftello() required by libflac
ANDROID_API: '24'
# Tell configure what flags Android requires.
# Turn Wimplicit-function-declaration into errors. Else autotools will be fooled when checking for available functions (that in fact are NOT available) and compilation will fail later on.
# Also disable clangs integrated assembler, as the hand written assembly of libffi is not recognized by it, cf. https://crbug.com/801303
CFLAGS: "-fPIE -fPIC -I$(PREFIX)/include --sysroot=$(NDK_TOOLCHAIN)/sysroot -I$(NDK_TOOLCHAIN)/sysroot/usr/include -Werror=implicit-function-declaration"
CXXFLAGS: $(CFLAGS)
CPPFLAGS: $(CXXFLAGS)
DEBIAN_FRONTEND: 'noninteractive'
ARTIFACT_NAME: 'fluidsynth-android$(ANDROID_API)'
jobs:
- job: Android
strategy:
matrix:
ARM:
ARCH: 'arm'
ANDROID_ARCH: 'armv7a'
ANDROID_ABI_CMAKE: 'armeabi-v7a'
ANDROID_TARGET_ABI: "eabi"
ANDROID_ABI_MESON: 'arm'
# the --target to be used by autotools
AUTOTOOLS_TARGET: "$(ARCH)-linux-android$(ANDROID_TARGET_ABI)"
AARCH64:
ARCH: 'aarch64'
ANDROID_ARCH: 'aarch64'
ANDROID_ABI_CMAKE: 'arm64-v8a'
ANDROID_TARGET_ABI:
ANDROID_ABI_MESON: 'aarch64'
AUTOTOOLS_TARGET: "$(ARCH)-none-linux-android"
i686:
ARCH: 'i686'
ANDROID_ARCH: 'i686'
ANDROID_ABI_CMAKE: 'x86'
ANDROID_TARGET_ABI:
ANDROID_ABI_MESON: 'x86'
AUTOTOOLS_TARGET: "$(ARCH)-pc-linux-android"
x86_64:
ARCH: 'x86_64'
ANDROID_ARCH: 'x86_64'
ANDROID_ABI_CMAKE: 'x86_64'
ANDROID_TARGET_ABI:
ANDROID_ABI_MESON: 'x86_64'
AUTOTOOLS_TARGET: "$(ARCH)-pc-linux-android"
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
set -ex
mkdir -p $(DEV)
displayName: 'mkdir $(DEV)'
- script: |
sudo apt-get update -y
displayName: 'Update apt'
- script: |
set -ex
sudo -E apt-get -y --no-install-suggests --no-install-recommends install wget tar bzip2 xz-utils ca-certificates
displayName: 'apt-get install wget tar'
- script: |
set -ex
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz
tar zxf libiconv-${ICONV_VERSION}.tar.gz
wget -O libffi-${FFI_VERSION}.tar.gz https://github.com/libffi/libffi/releases/download/v${FFI_VERSION}/libffi-${FFI_VERSION}.tar.gz
tar zxf libffi-${FFI_VERSION}.tar.gz
wget http://ftp.gnu.org/pub/gnu/gettext/gettext-${GETTEXT_VERSION}.tar.gz
tar zxf gettext-${GETTEXT_VERSION}.tar.gz
wget http://ftp.gnome.org/pub/gnome/sources/glib/${GLIB_VERSION}/glib-${GLIB_VERSION}.${GLIB_EXTRAVERSION}.tar.xz
tar xf glib-${GLIB_VERSION}.${GLIB_EXTRAVERSION}.tar.xz
wget -O oboe-${OBOE_VERSION}.tar.gz https://github.com/google/oboe/archive/${OBOE_VERSION}.tar.gz
tar zxf oboe-${OBOE_VERSION}.tar.gz
wget https://github.com/libsndfile/libsndfile/releases/download/${SNDFILE_VERSION}/libsndfile-${SNDFILE_VERSION}.tar.bz2
tar jxf libsndfile-${SNDFILE_VERSION}.tar.bz2
wget -O libinstpatch-${INSTPATCH_VERSION}.tar.gz https://github.com/swami/libinstpatch/archive/refs/tags/v${INSTPATCH_VERSION}.tar.gz
tar zxf libinstpatch-${INSTPATCH_VERSION}.tar.gz
wget https://github.com/xiph/vorbis/releases/download/v${VORBIS_VERSION}/libvorbis-${VORBIS_VERSION}.tar.gz
tar zxf libvorbis-${VORBIS_VERSION}.tar.gz
wget https://github.com/xiph/ogg/releases/download/v${OGG_VERSION}/libogg-${OGG_VERSION}.tar.gz
tar zxf libogg-${OGG_VERSION}.tar.gz
wget -O flac-${FLAC_VERSION}.tar.gz https://github.com/xiph/flac/archive/refs/tags/${FLAC_VERSION}.tar.gz
tar xf flac-${FLAC_VERSION}.tar.gz
wget -O opus-${OPUS_VERSION}.tar.gz https://github.com/xiph/opus/archive/refs/tags/v${OPUS_VERSION}.tar.gz
tar xf opus-${OPUS_VERSION}.tar.gz
wget -O pcre-${PCRE_VERSION}.tar.bz2 https://sourceforge.net/projects/pcre/files/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.tar.bz2/download
tar jxf pcre-${PCRE_VERSION}.tar.bz2
cd pcre-${PCRE_VERSION}
# CMake checks for existence of strtoq() using the C compiler - and yes, it does exist!
# Later on, it's actually used by the C++ compiler, where it does not exist.
# Rename the function so CMake won't find it.
sed -i 's/strtoq/strtoqqqq/g' CMakeLists.txt
displayName: 'Download Dependencies'
workingDirectory: $(DEV)
- task: Cache@2
inputs:
key: '$(ARCH) | $(DEV)/*.tar.*'
path: '$(PREFIX)'
cacheHitVar: 'CACHE_RESTORED'
displayName: 'Cache fluidsynth dependency libraries'
condition: and(not(in(variables['Build.Reason'], 'Schedule')), ${{ parameters.useCache }})
- script: |
set -ex
sudo apt remove --purge --auto-remove cmake
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
displayName: 'Use recent CMake Version'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
enabled: 'false'
- script: |
set -ex
sudo -E apt-get -y --no-install-suggests --no-install-recommends install gettext cmake zlib1g-dev autogen automake autoconf libtool pkg-config autotools-dev build-essential meson ninja-build python3-distutils
displayName: 'apt-get install build-tools'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK_ROOT
displayName: 'Use NDK r22'
- script: |
set -e
# The cross-compile toolchain we use
export ANDROID_TARGET=${ARCH}-linux-android${ANDROID_TARGET_ABI}
echo "##vso[task.setvariable variable=ANDROID_TARGET]$ANDROID_TARGET"
export ANDROID_TARGET_API=${ANDROID_ARCH}-linux-android${ANDROID_TARGET_ABI}${ANDROID_API}
echo "##vso[task.setvariable variable=ANDROID_TARGET_API]$ANDROID_TARGET_API"
# Add the standalone toolchain to the search path.
export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib:${PREFIX}/include:${NDK_TOOLCHAIN}/bin
echo "##vso[task.setvariable variable=PATH]$PATH"
LIBPATH1=$(NDK_TOOLCHAIN)/sysroot/usr/lib
LIBPATH2=$(NDK_TOOLCHAIN)/sysroot/usr/lib/$(ARCH)-linux-android$(ANDROID_TARGET_ABI)/$(ANDROID_API)
LIBPATH3=$(NDK_TOOLCHAIN)/sysroot/usr/lib/$(ARCH)-linux-android$(ANDROID_TARGET_ABI)
export LDFLAGS="-pie -Wl,-rpath-link=${LIBPATH1} -L${LIBPATH1} -Wl,-rpath-link=${LIBPATH2} -L${LIBPATH2} -Wl,-rpath-link=${LIBPATH3} -L${LIBPATH3} -Wl,-rpath-link=${LIBPATH0} -L${LIBPATH0}"
echo "##vso[task.setvariable variable=LDFLAGS]$LDFLAGS"
# Tell configure what tools to use.
export AR=${ANDROID_TARGET}-ar
echo "##vso[task.setvariable variable=AR]$AR"
export AS=${ANDROID_TARGET_API}-clang
echo "##vso[task.setvariable variable=AS]$AS"
export CC=${ANDROID_TARGET_API}-clang
echo "##vso[task.setvariable variable=CC]$CC"
export CXX=${ANDROID_TARGET_API}-clang++
echo "##vso[task.setvariable variable=CXX]$CXX"
export LD=ld.lld
echo "##vso[task.setvariable variable=LD]$LD"
export STRIP=${ANDROID_TARGET}-strip
echo "##vso[task.setvariable variable=STRIP]$STRIP"
export RANLIB=${ANDROID_TARGET}-ranlib
echo "##vso[task.setvariable variable=RANLIB]$RANLIB"
displayName: 'Set environment variables'
- script: |
set -ex
pushd libiconv-${ICONV_VERSION}
./configure \
--host=${AUTOTOOLS_TARGET} \
--prefix=${PREFIX} \
--libdir=${LIBPATH0} \
--disable-rpath \
--enable-static \
--disable-shared \
--with-pic \
--disable-maintainer-mode \
--disable-silent-rules \
--disable-gtk-doc \
--disable-introspection \
--disable-nls
make -j$((`nproc`+1))
make install
popd
displayName: 'Compile libiconv'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
pushd libiconv-${ICONV_VERSION}
cat config.log
displayName: 'libiconv config.log'
workingDirectory: $(DEV)
condition: and(failed(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
pushd libffi-${FFI_VERSION}
NOCONFIGURE=true autoreconf -v -i
# install headers into the conventional ${PREFIX}/include rather than ${PREFIX}/lib/libffi-3.2.1/include.
#sed -e '/^includesdir/ s/$(libdir).*$/$(includedir)/' -i include/Makefile.in
#sed -e '/^includedir/ s/=.*$/=@includedir@/' -e 's/^Cflags: -I${includedir}/Cflags:/' -i libffi.pc.in
./configure --host=${AUTOTOOLS_TARGET} --prefix=${PREFIX} --libdir=${LIBPATH0} --enable-static --disable-shared
make -j$((`nproc`+1))
make install
popd
displayName: 'Compile libffi'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
pushd gettext-${GETTEXT_VERSION}
./configure \
--host=${AUTOTOOLS_TARGET} \
--prefix=${PREFIX} \
--libdir=${LIBPATH0} \
--disable-rpath \
--disable-libasprintf \
--disable-java \
--disable-native-java \
--disable-openmp \
--disable-curses \
--enable-static \
--disable-shared \
--with-pic \
--disable-maintainer-mode \
--disable-silent-rules \
--disable-gtk-doc \
--disable-introspection
make -j$((`nproc`+1))
make install
popd
displayName: 'Compile gettext'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- template: cmake-android.yml
parameters:
sourceDir: 'pcre-$(PCRE_VERSION)'
cmakeArgs: '-DPCRE_SUPPORT_UNICODE_PROPERTIES=1 -DPCRE_SUPPORT_UTF=1 -DPCRE_BUILD_PCRECPP=0 -DPCRE_BUILD_TESTS=0'
- script: |
set -ex
export PKGCFG=`which pkg-config`
pushd glib-${GLIB_VERSION}.${GLIB_EXTRAVERSION}
cat << EOF > cross_file.ini
[host_machine]
system = 'android'
cpu_family = '${ANDROID_ABI_MESON}'
cpu = '${ANDROID_ARCH}'
endian = 'little'
[binaries]
c = '${NDK_TOOLCHAIN}/bin/${CC}'
cpp = '${NDK_TOOLCHAIN}/bin/${CXX}'
ar = '${NDK_TOOLCHAIN}/bin/${AR}'
as = '${NDK_TOOLCHAIN}/bin/${AS}'
ld = '${NDK_TOOLCHAIN}/bin/${LD}'
strip = '${NDK_TOOLCHAIN}/bin/${STRIP}'
ranlib = '${NDK_TOOLCHAIN}/bin/${RANLIB}'
pkgconfig = '${PKGCFG}'
[properties]
prefix = '${PREFIX}'
c_args = '${CFLAGS}'
cpp_args = '${CXXFLAGS}'
pkg_config_libdir = '${PKG_CONFIG_LIBDIR}'
c_link_args = '${LDFLAGS}'
[project options]
libmount = 'disabled'
xattr = false
selinux = 'disabled'
nls = 'disabled'
glib_debug = 'disabled'
glib_assert = false
glib_checks = false
libelf = 'disabled'
EOF
cat cross_file.ini
# When CC and CXX are set, then meson detects them as host compiler (not cross compiler),
# so they tries to run arm binaries in x86. That's why sanity check is failing, and that's
# why we have to use env -i.
# And we must explicitly set PKG_CONFIG_LIBDIR, because pkg_config_libdir is only recognized by meson >= 0.54
env -i bash -c "export PATH && export PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR) && meson setup build --cross-file cross_file.ini --prefix=$(PREFIX)"
ninja -C build
ninja -C build install
popd
displayName: 'Compile glib (meson)'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
pushd glib-${GLIB_VERSION}.${GLIB_EXTRAVERSION}
ls -la build
cat build/meson-logs/meson-log.txt
popd
displayName: 'Meson LOG'
workingDirectory: $(DEV)
condition: and(succeededOrFailed(), ne(variables.CACHE_RESTORED, 'true'))
- template: cmake-android.yml
parameters:
sourceDir: 'libogg-$(OGG_VERSION)'
cmakeArgs: '-DINSTALL_DOCS=0'
- template: cmake-android.yml
parameters:
sourceDir: 'libvorbis-$(VORBIS_VERSION)'
# flac uses c99 macros, but doesnt specify a standard, so we need to do it explicitly.
# On i686, they invoke yasm with -fstack-protector-strong flag... turn off asm optimizations.
- template: cmake-android.yml
parameters:
sourceDir: 'flac-$(FLAC_VERSION)'
cmakeArgs: '-DCMAKE_C_STANDARD=99 -DCMAKE_C_STANDARD_REQUIRED=1 -DWITH_ASM=0 -DBUILD_CXXLIBS=0 -DBUILD_PROGRAMS=0 -DBUILD_EXAMPLES=0 -DBUILD_DOCS=0 -DINSTALL_MANPAGES=0'
# another broken xiph project that doesn't specify the C standard and keeps complaining of you don't have C99
- template: cmake-android.yml
parameters:
sourceDir: 'opus-$(OPUS_VERSION)'
cmakeArgs: '-DBUILD_PROGRAMS=0 -DOPUS_MAY_HAVE_NEON=1 -DCMAKE_C_STANDARD=99 -DCMAKE_C_STANDARD_REQUIRED=1'
- template: cmake-android.yml
parameters:
sourceDir: 'libsndfile-$(SNDFILE_VERSION)'
cmakeArgs: '-DBUILD_PROGRAMS=0 -DBUILD_EXAMPLES=0'
- template: cmake-android.yml
parameters:
sourceDir: 'oboe-$(OBOE_VERSION)'
installCommand: 'cp liboboe.* ${PREFIX}/lib/ && cp -ur ../include/oboe ${PREFIX}/include'
- script: |
set -ex
# create a custom pkgconfig file for oboe to allow fluidsynth to find it
cat << EOF > ${PKG_CONFIG_PATH}/oboe-1.0.pc
prefix=${PREFIX}
exec_prefix=\${prefix}
libdir=\${prefix}/lib
includedir=\${prefix}/include
Name: Oboe
Description: Oboe library
Version: ${OBOE_VERSION}
Libs: -L\${libdir} -loboe -landroid -llog
Cflags: -I\${includedir}
EOF
cat ${PKG_CONFIG_PATH}/oboe-1.0.pc
displayName: 'Create fake oboe.pc'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- template: cmake-android.yml
parameters:
sourceDir: 'libinstpatch-$(INSTPATCH_VERSION)'
# finally, compile fluidsynth
- template: cmake-android.yml
parameters:
workDir: '$(System.DefaultWorkingDirectory)'
sourceDir: '.'
condition: succeeded()
cmakeArgs: '-Denable-opensles=1 -Denable-floats=1 -Denable-oboe=1 -Denable-dbus=0 -Denable-oss=0'
installCommand: ''
- script: |
set -x
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(PREFIX)/lib:$(NDK_TOOLCHAIN)/sysroot/usr/lib/$(ARCH)-linux-android$(ANDROID_TARGET_ABI)/$(ANDROID_API)
pushd build
make -j$((`nproc`+1)) check
ldd test/test_sample_cache
popd
displayName: 'Execute fluidsynth unit test'
condition: and(succeeded(), in(variables['ARCH'], 'x86_64', 'i686'))
enabled: 'false'
- script: |
set -ex
pushd build
make install
popd
displayName: 'Install fluidsynth'
- template: cmake-android.yml
parameters:
workDir: '$(System.DefaultWorkingDirectory)/doc/android/fluidsynth-assetloader/'
sourceDir: '.'
condition: succeeded()
installCommand: 'cp *.so ${PREFIX}/lib/'
- script: |
ls -Rg $(PREFIX)
displayName: 'Show cross-compiled files in $(PREFIX)'
condition: or(succeeded(), failed())
- script: |
set -ex
# use ANDROID_ABI_CMAKE so libs can be simply copied to the archive contents in src/main/jniLibs
mkdir -p $(Build.ArtifactStagingDirectory)/lib/$(ANDROID_ABI_CMAKE)
cd $(Build.ArtifactStagingDirectory)/lib/$(ANDROID_ABI_CMAKE)
cp -LR $(PREFIX)/lib/* .
ls -Rg .
rm -rf *.dll *.alias gettext/ libtextstyle.* *.a *.la
rm -f *.so.*
mkdir -p $(Build.ArtifactStagingDirectory)/include
cd $(Build.ArtifactStagingDirectory)/include
cp -a $(PREFIX)/include/fluidsynth* .
displayName: 'Collecting artifacts'
- script: |
set -ex
ls libFLAC.so
ls libfluidsynth-assetloader.so
ls libfluidsynth.so
ls libgio-2.0.so
ls libglib-2.0.so
ls libgmodule-2.0.so
ls libgobject-2.0.so
ls libgthread-2.0.so
ls libinstpatch-1.0.so
ls liboboe.so
ls libogg.so
ls libopus.so
ls libsndfile.so
ls libvorbis.so
ls libvorbisenc.so
ls libvorbisfile.so
ls libpcre.so
ls libpcreposix.so
displayName: 'Verify all libs exist'
workingDirectory: '$(PREFIX)/lib'
- task: PublishBuildArtifacts@1
displayName: 'Publishing Artefacts for Android API$(ANDROID_API) $(ANDROID_ABI_CMAKE)'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(ARTIFACT_NAME)'
publishLocation: 'Container'
- script: |
set -ex
# as very last step before creating the pipeline cache, remove fluidsynth
pushd build
make uninstall
popd
displayName: 'Uninstall fluidsynth'

View file

@ -1,199 +0,0 @@
trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.azure/azure-pipelines-win.yml'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
parameters:
- name: UseCache
displayName: Use Dependency Cache
type: boolean
default: true
jobs:
- job: macOS_brew
strategy:
matrix:
UnixLibs:
imageName: 'macos-11'
CMakeFlags: '-Denable-framework=0'
10_15:
imageName: 'macOS-10.15'
CMakeFlags: ''
11_0:
imageName: 'macos-11'
CMakeFlags: ''
12_0:
imageName: 'macos-12'
CMakeFlags: ''
pool:
vmImage: $(imageName)
# recommended by https://github.com/Homebrew/brew/issues/2491#issuecomment-294207661
# brew update || brew update
# brew upgrade $PACKAGES
steps:
- script: |
set -ex
PACKAGES="glib gobject-introspection libsndfile pkg-config jack dbus-glib pulseaudio portaudio sdl2 libomp"
brew install $PACKAGES
displayName: 'Prerequisites'
- script: |
set -ex
mkdir build && cd build
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
cmake -Werror=dev $(CMakeFlags) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
make -j3
displayName: 'Compile fluidsynth'
- script: |
set -ex
cd build
make -j3 check
displayName: 'Execute Unittests'
- script: |
set -ex
cd build
make -j3 demo
displayName: 'Compile demos'
- script: |
set -ex
cd build
sudo make install
rm -f install_manifest.txt
displayName: 'Install fluidsynth to default location'
- script: |
set -ex
cd build
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) ..
make install
displayName: 'Install fluidsynth to artifact dir'
- job: macOS_ports
timeoutInMinutes: 300
strategy:
matrix:
# SDL2/SDL_cpuinfo.h includes some x86 specific headers, which ofc doesn't work when cross compiling for arm64
# And this universal build thingy doesn't work on Mac10.15 for some reason...
# Furthermore, there is a problem when restoring the cache on Mac11, so disable this job as well
#11_0_universal_unixlibs:
# macPortsUrl: 'https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-11-BigSur.pkg'
# imageName: 'macos-11'
# CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0 -DLIB_SUFFIX=""'
12_0_universal_unixlibs:
macPortsUrl: 'https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-12-Monterey.pkg'
imageName: 'macos-12'
CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0 -DLIB_SUFFIX=""'
pool:
vmImage: $(imageName)
steps:
- script: |
set -ex
brew install wget pkg-config
wget $(macPortsUrl)
sudo installer -pkg *.pkg -target /
rm -f *.pkg
sudo chown -R $(id -u):$(id -g) /opt/local
sudo chflags nouchg /opt/local
displayName: 'Prerequisites'
workingDirectory: $(Agent.TempDirectory)
- task: Cache@2
continueOnError: true
displayName: "Cache macPort packages"
condition: and(not(in(variables['Build.Reason'], 'Schedule')), ${{ parameters.useCache }})
inputs:
key: '"$(Agent.OS)" | "$(imageName)" | "$(macPortsUrl)" | "versionalways"'
path: '/opt/local'
cacheHitVar: CACHE_RESTORED
- script: |
set -ex
export PATH=$PATH:/opt/local/bin
echo $PATH
which codesign
which port
cmake --version || true
echo "+universal" | sudo tee -a /opt/local/etc/macports/variants.conf
sudo sh -c 'cat << EOF >> /opt/local/etc/macports/macports.conf
buildfromsource always
universal_archs arm64 x86_64
ui_interactive no
EOF'
sudo port install glib2-devel libsndfile dbus-glib readline
# fixup permissions to allow non-priv pipeline user access every directory, to make the caching step succeed at the end
sudo chown -R $(id -u):$(id -g) /opt/local
# remove all extended attributes, as they cannot be restored when restoring the pipeline cache
#sudo xattr -rcv /opt/local
displayName: 'Port install universal'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
export PATH=$PATH:/opt/local/bin
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig"
mkdir build && cd build
cmake -Werror=dev $(CMakeFlags) -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
make -j3
displayName: 'Compile fluidsynth'
- script: |
export PATH=$PATH:/opt/local/bin
sudo port -v install fluidsynth +universal
displayName: 'port install fluidsynth +universal'
condition: failed()
enabled: false
- script: |
set -x
cat /opt/local/var/macports/logs/*cmake-bootstrap/cmake-bootstrap/main.log
cat /opt/local/var/macports/build/*cmake-bootstrap/cmake-bootstrap/work/cmake-3.9.4-arm64/Bootstrap.cmk/*.log
cat /opt/local/var/macports/logs/*_fluidsynth/fluidsynth/main.log
condition: failed()
displayName: 'Print fluidsynth error log'
- script: |
set -ex
cd build
make -j3 check
displayName: 'Execute Unittests'
- script: |
set -ex
cd build
make -j3 demo
displayName: 'Compile demos'
- script: |
set -ex
cd build
sudo make install
rm -f install_manifest.txt
displayName: 'Install fluidsynth to default location'
- script: |
set -ex
cd build
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) ..
make install
cd /opt/local/lib/
cp -a libgthread*.dylib libglib*.dylib libintl*.dylib libsndfile*.dylib libdbus-*.dylib libreadline*.dylib $(Build.ArtifactStagingDirectory)/lib
file /opt/local/lib/libglib-2.0.dylib $(Build.ArtifactStagingDirectory)/bin/fluidsynth $(Build.ArtifactStagingDirectory)/lib/libfluidsynth*.dylib
displayName: 'Install fluidsynth to artifact dir'
- task: PublishBuildArtifacts@1
displayName: 'Publish fluidsynth artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'fluidsynth-$(imageName)'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
displayName: 'Publish macPorts deps'
enabled: false
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
inputs:
PathtoPublish: '/opt/local/lib'
ArtifactName: 'macports-$(imageName)'
publishLocation: 'Container'

View file

@ -1,154 +0,0 @@
trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-mac.yml'
- '.azure/azure-pipelines-win.yml'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
parameters:
- name: UseCache
displayName: Use Dependency Cache
type: boolean
default: true
schedules:
- cron: "0 0 * * 1"
displayName: 'Weekly Monday Midnight build without caching'
branches:
include:
- master
always: true
variables:
toolset: 'v142'
generator: 'Visual Studio 16 2019'
configuration: 'RelWithDebInfo'
VCPKG_REVISION: 'e809a42f87565e803b2178a0c11263f462d1800a'
jobs:
- job: vcpkg
workspace:
clean: all
strategy:
matrix:
ARM:
platform: 'arm'
cmake_platform: 'ARM'
ARM64:
platform: 'arm64'
cmake_platform: 'ARM64'
x86:
platform: 'x86'
cmake_platform: 'Win32'
x64:
platform: 'x64'
cmake_platform: 'x64'
pool:
vmImage: 'windows-2019'
steps:
- task: Cache@2
displayName: "Cache vcpkg's packages"
condition: and(not(in(variables['Build.Reason'], 'Schedule')), ${{ parameters.useCache }})
inputs:
key: $(VCPKG_REVISION) | "$(platform)"
path: '$(VCPKG_INSTALLATION_ROOT)\installed'
cacheHitVar: CACHE_RESTORED
- bash: |
set -ex
echo $(generator)
echo $(toolset)
# choco upgrade ninja -y
# ninja --version
cmake --version
rm -rf C:/Strawberry/perl/bin/pkg-config*
choco install --svc --sdc -i pkgconfiglite
# chocoTask=$!
# manually update vcpkg
cd $VCPKG_INSTALLATION_ROOT
# git checkout master
git remote -v
git fetch --tags --prune --progress origin
git checkout --force $(VCPKG_REVISION)
sed -i 's/arm64/arm/g' ports/glib/portfile.cmake
./bootstrap-vcpkg.sh
# wait $chocoTask
which pkg-config
displayName: 'Update vcpkg'
- task: DownloadBuildArtifacts@0
inputs:
buildType: specific
# https://dev.azure.com/tommbrt/_apis/projects?api-version=5.0
project: 'd3638885-de4a-4ce7-afe7-f237ae461c07'
pipeline: 1
artifactName: libinstpatch-$(cmake_platform)
downloadPath: '$(Agent.TempDirectory)'
displayName: 'Get libinstpatch'
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
- task: CopyFiles@2
inputs:
SourceFolder: '$(Agent.TempDirectory)\libinstpatch-$(cmake_platform)'
Contents: '**'
TargetFolder: '$(VCPKG_INSTALLATION_ROOT)\installed\$(platform)-windows'
displayName: 'Install libinstpatch'
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
- bash: |
set -ex
vcpkg install glib:$(platform)-windows libsndfile:$(platform)-windows
displayName: 'vcpkg build Dependencies'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- bash: |
set -ex
cd $VCPKG_INSTALLATION_ROOT/installed/$(platform)-windows/
pwd
rm -rf include/FLAC* include/ffi* include/iconv* include/opus tools share
ls -Rg .
pkg-config --list-all
pkg-config --cflags libinstpatch-1.0 || true
displayName: 'Cleanup dependencies'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- bash: |
set -ex
mkdir build
cd build
cmake -Werror=dev -G "$(generator)" -A "$(cmake_platform)" -T "$(toolset)" -Denable-readline=0 -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=$VCPKG_INSTALLATION_ROOT/installed/$(platform)-windows -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
cmake --build . --config $(configuration) --parallel 3
displayName: 'Compile fluidsynth'
- bash: |
set -ex
cmake --build build --config $(configuration) --target check --parallel 3
displayName: 'Execute Unittests'
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
- bash: |
set -ex
cmake --build build --config $(configuration) --target demo --parallel 3
displayName: 'Compile demos'
- script: |
@ECHO ON
cd build
cmake --build . --config $(configuration) --target install || exit -1
REM del bin\concrt*.dll
REM del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll
REM del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll
REM del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib
REM del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc
REM rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q
displayName: 'fluidsynth install'
- task: CopyFiles@2
inputs:
SourceFolder: '$(VCPKG_INSTALLATION_ROOT)/installed/$(platform)-windows/'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
CleanTargetFolder: true
displayName: 'Copy Binaries to Artifact Dir'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: fluidsynth-vcpkg-$(platform)

View file

@ -1,67 +0,0 @@
parameters:
- name: cmakeArgs
type: string
default: ''
- name: sourceDir
type: string
default: ''
- name: workDir
type: string
default: $(DEV)
- name: condition
type: string
default: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- name: installCommand
type: string
default: 'make install'
steps:
- script: |
set -ex
pushd ${{ parameters.sourceDir }}
mkdir -p build
pushd build
# Invoke cmake in the most correctest way I've could find while try and erroring:
#
# The biggest pain point is that CMake does not seem to respect our existing cross compilation CFLAGS and LDFLAGS.
# Hence we are passing them manually, once via Android flags and once for "Required" flags. The latter is necessary
# to let cmake correctly probe for any existing header, function, library, etc.
# Watch out: Sometimes the flags are passed as ;-limited list!
cmake -G "Unix Makefiles" \
-DCMAKE_MAKE_PROGRAM=make \
-DCMAKE_TOOLCHAIN_FILE=${NDK}/build/cmake/android.toolchain.cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DANDROID_NATIVE_API_LEVEL=${ANDROID_API} \
-DANDROID_ABI=${ANDROID_ABI_CMAKE} \
-DANDROID_TOOLCHAIN=${CC} \
-DANDROID_NDK=${NDK} \
-DANDROID_COMPILER_FLAGS="${CFLAGS// /;}" \
-DANDROID_LINKER_FLAGS="${LDFLAGS// /;}" \
-DANDROID_STL="c++_shared" \
-DCMAKE_REQUIRED_FLAGS="${CFLAGS}" \
-DCMAKE_REQUIRED_LINK_OPTIONS="${LDFLAGS// /;}" \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_STAGING_PREFIX=${PREFIX} \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DBUILD_SHARED_LIBS=1 \
-DLIB_SUFFIX="" \
${{ parameters.cmakeArgs }} ..
make -j$((`nproc`+1))
${{ parameters.installCommand }}
popd
popd
displayName: 'Compile ${{ parameters.sourceDir }}'
workingDirectory: ${{ parameters.workDir }}
condition: ${{ parameters.condition }}
- script: |
ls -la ${{ parameters.sourceDir }}/build/CMakeFiles/
cat ${{ parameters.sourceDir }}/build/CMakeFiles/CMakeError.log
cat ${{ parameters.sourceDir }}/build/CMakeFiles/CMakeOutput.log
true
displayName: 'Print ${{ parameters.sourceDir }} Cmake Error Log'
condition: or(${{ parameters.condition }}, failed())
workingDirectory: ${{ parameters.workDir }}

View file

@ -1,67 +1,55 @@
version: 2.1
orbs:
android: circleci/android@0.2.1
android: circleci/android@0.2.0
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-30
- image: circleci/android:api-29
environment:
JVM_OPTS: -Xmx3200m
steps:
- run:
name: Setup Git email and user for Cerbero
command: git config --global user.email "ci@beatscratch.io" && git config --global user.name "CI testing"
# - android/install-ndk:
# ndk-version: android-ndk-r18b
# ndk-sha: 500679655da3a86aecf67007e8ab230ea9b4dd7b
- android/install-ndk:
ndk-version: android-ndk-r18b
ndk-sha: 500679655da3a86aecf67007e8ab230ea9b4dd7b
- run:
name: Link NDK for Cerbero
command: |
mkdir -p /home/circleci/android-sdk-linux
ln -s /opt/android/android-ndk-r18b /home/circleci/android-sdk-linux/ndk-bundle
- run:
name: Install FluidSynth build dependencies
command: sudo apt-get update && sudo apt-get install autotools-dev automake autoconf libtool g++ autopoint make cmake
bison flex yasm pkg-config libpulse-dev
python3-dev gettext build-essential pkg-config curl
libasound2-dev dpkg-dev
bison flex yasm pkg-config gtk-doc-tools libxv-dev libx11-dev libpulse-dev
python3-dev texinfo gettext build-essential pkg-config doxygen curl libxext-dev
libxi-dev x11proto-record-dev libxrender-dev libgl1-mesa-dev libxfixes-dev
libxdamage-dev libxcomposite-dev libasound2-dev libxml-simple-perl dpkg-dev
debhelper build-essential devscripts fakeroot transfig gperf libdbus-glib-1-dev
wget glib-networking libxtst-dev libxrandr-dev
git intltool ccache python3-setuptools autogen maven make
wget glib-networking libxtst-dev libxrandr-dev libglu1-mesa-dev libegl1-mesa-dev
git subversion xutils-dev intltool ccache python3-setuptools autogen maven make
- checkout
- run:
name: Build Cerbero and Oboe
name: Prepare FluidSynth Android
working_directory: doc/android
command: |
export TERM=dumb
export VERBOSE=1
echo Starting `nproc` parallel jobs
make -f Makefile.android prepare
- run:
name: Link Cerbero NDK for build
command: |
mkdir -p /home/circleci/android-sdk-linux
echo "android-ndk-21 content"
ls /home/circleci/code/doc/android/external/cerbero/build/android-ndk-21
ln -s /home/circleci/code/doc/android/external/cerbero/build/android-ndk-21 /home/circleci/android-sdk-linux/ndk-bundle
echo "/home/circleci/android-sdk-linux/ndk-bundle content"
ls /home/circleci/android-sdk-linux/ndk-bundle
- run:
name: Build FluidSynth Android
working_directory: doc/android
command: |
export TERM=dumb
make -f Makefile.android
- run:
name: Show directory contents
working_directory: doc/android
command: |
ls -R
mv ./external/cerbero/build/logs dist/
cp ./external/cerbero/build/sources/android_armv7/glib-2.62.6/_builddir/meson*.txt dist/armeabi-v7a/
cp ./external/cerbero/build/sources/android_arm64/glib-2.62.6/_builddir/meson*.txt dist/arm64-v8a/
cp ./external/cerbero/build/sources/android_x86/glib-2.62.6/_builddir/meson*.txt dist/x86/
cp ./external/cerbero/build/sources/android_x86_64/glib-2.62.6/_builddir/meson*.txt dist/x86_64/
- run:
name: Zip FluidSynth Android Distribution
name: Zip FluidSnyth Android Distribution
working_directory: doc/android
command: zip -r android-dist.zip dist
- store_artifacts:
path: doc/android/android-dist.zip
destination: android-dist.zip
destination: android-dist.zip

View file

@ -3,11 +3,12 @@ task:
name: FreeBSD
freebsd_instance:
matrix:
image_family: freebsd-11-4
image_family: freebsd-12-2
image_family: freebsd-13-0
# There isn't a stable 13.0 image yet (2019-09)
image_family: freebsd-13-0-snap
image_family: freebsd-12-0
image_family: freebsd-10-4
install_script: pwd && ls -la && pkg update --force && pkg install -y cmake glib alsa-lib ladspa portaudio pulseaudio pkgconf sdl2
install_script: pwd && ls -la && pkg install -y cmake glib alsa-lib ladspa portaudio pulseaudio pkgconf sdl2
compile_script: pwd && ls -la && mkdir $HOME/fluidsynth_install/ && mkdir build && cd build && cmake -Werror=dev -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=0 -DNO_GUI=1 .. && make -j4 && make check && make install
compile_script: pwd && ls -la && mkdir $HOME/fluidsynth_install/ && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=0 -DNO_GUI=1 .. && make -j4 && make check && make install

View file

@ -13,14 +13,11 @@ Else it might be closed without further notice.
If you have a question look into our wiki
( https://github.com/FluidSynth/fluidsynth/wiki )
or the developer resources
( https://www.fluidsynth.org/api/ )
( http://www.fluidsynth.org/api/ )
If you still have a question, need support or want to discuss ideas, contact our mailing list
If you still have a question, need support or want to discuss ideas, contact our mailing list:
https://lists.nongnu.org/mailman/listinfo/fluid-dev
or start a GitHub Discussion:
https://github.com/FluidSynth/fluidsynth/discussions
Below is a form that shall help getting relevant information for bugs together.
We strongly recommend to use it! Feel free to edit or remove inapplicable/unneeded parts.
-->

View file

@ -13,23 +13,17 @@ Else it might be closed without further notice.
If you have a question look into our wiki
( https://github.com/FluidSynth/fluidsynth/wiki )
or the developer resources
( https://www.fluidsynth.org/api/ )
( http://www.fluidsynth.org/api/ )
If you still have a question, need support or want to discuss ideas, contact our mailing list
If you still have a question, need support or want to discuss ideas, contact our mailing list:
https://lists.nongnu.org/mailman/listinfo/fluid-dev
or start a GitHub Discussion:
https://github.com/FluidSynth/fluidsynth/discussions
Below is a form that shall help getting relevant information for features together.
Feel free to edit or remove inapplicable/unneeded parts.
-->
### Related discussion
_Feature requests should be discussed by the community, either on the mailing
list or via a GitHub Discussion. Please bring up your ideas there before
opening tickets. In case you already did that, please provide a link to the
thread._
### Related discussion on the mailing list
_Features should be discussed by the community. Historically, our community lives at the mailing list. Bring up your ideas there, before opening tickets. In case you already did that, provide a link to the thread._
### Is your feature request related to a problem?
_A clear and concise description of what the problem is._

View file

@ -5,13 +5,10 @@ Else it might be closed without further notice._
_If you have a question look into our wiki
( https://github.com/FluidSynth/fluidsynth/wiki )
or the developer resources
( https://www.fluidsynth.org/api/ )_
( http://www.fluidsynth.org/api/ )_
If you still have a question, need support or want to discuss ideas, contact our mailing list
https://lists.nongnu.org/mailman/listinfo/fluid-dev
or start a GitHub Discussion:
https://github.com/FluidSynth/fluidsynth/discussions
_If you still have a question, need support or want to discuss ideas, contact our mailing list:
https://lists.nongnu.org/mailman/listinfo/fluid-dev_
_Below is a form that shall help getting relevant information for bugs and feature requests together.
We strongly recommend to use it! Feel free to edit or remove inapplicable/unneeded parts._
@ -33,7 +30,7 @@ We strongly recommend to use it! Feel free to edit or remove inapplicable/unneed
### Other information
<!-- If you are able to illustrate the bug or feature request with an example, please provide simple
source code below or as attached file. List any other information that is relevant to your issue:
source code below or as attatched file. List any other information that is relevant to your issue:
Stack traces,
related issues,
build logs,

View file

@ -1,52 +0,0 @@
name: API Doc Build
on:
push:
branches:
- master
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install Dependencies
run: sudo apt-get install doxygen xsltproc
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config $BUILD_TYPE --target doxygen
- name: Install SSH Client 🔑
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.DEPLOY_API_TOKEN }}
- name: Publish API Docs to GH Pages
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
FOLDER: ${{runner.workspace}}/build/doc/api/html/
REPOSITORY_NAME: FluidSynth/fluidsynth.github.io
BRANCH: main
TARGET_FOLDER: api/
SSH: true
CLEAN: true
COMMIT_MESSAGE: Updating API doc from fluidsynth master
GIT_CONFIG_NAME: API Doc Deploy
GIT_CONFIG_EMAIL: fluid-api-deploy@fluidsynth.github.io

View file

@ -1,71 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '17 18 * * 4'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View file

@ -1,102 +0,0 @@
name: FluidSynth Linux
on:
pull_request:
push:
paths-ignore:
- '.azure/**'
- '.circleci/**'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-20.04
strategy:
matrix:
CC: [""]
CXX: [""]
CMAKE_FLAGS: ["-Denable-profiling=1","-Denable-floats=1 -Denable-profiling=1","-Denable-floats=1","-Denable-trap-on-fpe=1","-Denable-fpe-check=1","-Denable-ipv6=0","-Denable-network=0","-Denable-aufile=0","-DBUILD_SHARED_LIBS=0","-Denable-ubsan=1 -Denable-debug=1", "-Denable-debug=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold"]
include:
- CC: "clang-7"
CXX: "clang++-7"
CMAKE_FLAGS: ""
- CC: "clang-8"
CXX: "clang++-8"
CMAKE_FLAGS: ""
- CC: "clang-10"
CXX: "clang++-10"
CMAKE_FLAGS: ""
- CC: "clang-12"
CXX: "clang++-12"
CMAKE_FLAGS: ""
# clang9 is covered by openSUSE Leap 15.2
# clang11 is covered by openSUSE Leap 15.3
steps:
- uses: actions/checkout@v2
- name: Add apt-get repositories
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- name: Update apt
run: sudo apt-get update -y
- name: Install Dependencies
run: sudo -E apt-get -yq --no-install-suggests --no-install-recommends install cmake-data cmake libglib2.0-0 libsndfile-dev libasound2-dev libjack-dev portaudio19-dev libsdl2-dev libpulse-dev libdbus-1-dev libsystemd-dev libinstpatch-dev libreadline-dev g++-7 g++-8 clang-7 clang-8 clang-9 clang-10 clang-tidy-10
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: |
echo Can execute `nproc` make jobs in parallel
cmake --version
cmake -E make_directory ${{github.workspace}}/build
which clang-tidy || true
ls -la `which clang-tidy` || true
echo $PATH
echo $SONARSC
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
export CC=${{ matrix.CC }}
export CXX=${{ matrix.CXX }}
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Werror=dev ${{ matrix.CMAKE_FLAGS }} -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 $GITHUB_WORKSPACE
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: make -j`nproc`
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
run: make -j`nproc` check
- name: Demo
working-directory: ${{github.workspace}}/build
shell: bash
run: make -j`nproc` demo
- name: Install
working-directory: ${{github.workspace}}/build
run: make install

View file

@ -1,103 +0,0 @@
on:
# Trigger analysis when pushing in master or pull requests, and when creating
# a pull request.
push:
branches:
- master
paths-ignore:
- '.azure/**'
- '.circleci/**'
- '.github/workflows/linux.yml'
- '.cirrus.yml'
- 'README.md'
pull_request:
types: [opened, synchronize, reopened]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
# Use Debug build for better code coverage results
BUILD_TYPE: Debug
name: SonarCloud Workflow
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Add apt-get repositories
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- name: Update apt
run: sudo apt-get update -y
- name: Install Dependencies
run: sudo -E apt-get -yq --no-install-suggests --no-install-recommends install cmake-data cmake libglib2.0-0 libsndfile-dev libasound2-dev libjack-dev portaudio19-dev libsdl2-dev libpulse-dev libdbus-1-dev libsystemd-dev libinstpatch-dev libreadline-dev lcov gcovr ggcov
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: |
cmake -E make_directory ${{github.workspace}}/build
echo $PATH
- name: Get Sonar Build Wrapper
shell: bash
working-directory: ${{github.workspace}}/build
run: |
set -ex
wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
mv build-wrapper-linux-x86/* .
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Werror=dev -Denable-portaudio=1 -Denable-ladspa=1 -Denable-coverage=1 -DNO_GUI=1 $GITHUB_WORKSPACE
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
./build-wrapper-linux-x86-64 --out-dir bw-output make
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
run: |
./build-wrapper-linux-x86-64 --out-dir bw-output make coverage
# sonar-scanner does not like utf8 filenames
- name: Prepare for Sonar
run: |
rm -rf ${{ github.workspace }}/sf2
gcovr --version
gcovr --help
ls -la ${{ github.workspace }}
ls -la ${{ github.workspace }}/build
ls -la ${{ github.workspace }}/build/coverage
# The official sonarsource/sonarcloud-github-action@v1.5 action does not work properly.
# It keeps complaining that the build-wrapper.json cannot be found.
# Hence, use a third party action to download and add sonar-scanner to PATH and then run it manually.
- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v3
- name: Run sonarqube
env:
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.cfamily.build-wrapper-output=${{ github.workspace }}/build/bw-output
-Dsonar.coverageReportPaths=build/coverage/sonarqube.report
-Dsonar.verbose=false
-Dsonar.host.url=https://sonarcloud.io/

2
.gitignore vendored
View file

@ -1,5 +1,4 @@
build/
.vs/
CMakeCache.txt
CMakeFiles
@ -39,4 +38,3 @@ install_manifest.txt
# ProjectFiles
*.pro.user*
*.user

View file

@ -1,6 +0,0 @@
workflow:
steps:
- branch_package:
source_project: home:derselbst:anmp
source_package: fluidsynth
target_project: home:derselbst:anmp:github-ci

70
.travis.yml Normal file
View file

@ -0,0 +1,70 @@
language: c
sudo: false
os: linux
dist: bionic
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-bionic-7
- llvm-toolchain-bionic-8
packages:
- cmake-data
- cmake
- libglib2.0-0
- libsndfile-dev
- libasound2-dev
- libjack-dev
- portaudio19-dev
- libpulse-dev
- libdbus-glib-1-dev
- ladspa-sdk
- libsdl2-dev
env:
- CMAKE_FLAGS="-Denable-profiling=1"
- CMAKE_FLAGS="-Denable-floats=1 -Denable-profiling=1"
- CMAKE_FLAGS="-Denable-floats=0"
- CMAKE_FLAGS="-Denable-trap-on-fpe=1"
- CMAKE_FLAGS="-Denable-fpe-check=1"
- CMAKE_FLAGS="-Denable-ipv6=0"
- CMAKE_FLAGS="-Denable-network=0"
- CMAKE_FLAGS="-Denable-aufile=0"
- CMAKE_FLAGS="-DBUILD_SHARED_LIBS=0"
matrix:
include:
- arch: arm64
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && sudo apt-get install gcc-7"
- env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8 && sudo apt-get install gcc-8"
- CMAKE_FLAGS="-Denable-debug=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold"
- env:
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7 && sudo apt-get install clang-7"
- env:
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8 && sudo rm -f /usr/local/clang-7.0.0/bin/clang-tidy && sudo ln -s /usr/bin/clang-tidy-8 /usr/bin/clang-tidy && sudo apt-get install clang-8 clang-tidy-8"
- CMAKE_FLAGS="-Denable-profiling=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold"
- os: linux-ppc64le
env:
- CMAKE_FLAGS=""
before_install:
- eval "${MATRIX_EVAL}"
- which clang-tidy || true
- ls -la `which clang-tidy` || true
- echo $PATH
before_script:
- mkdir $HOME/fluidsynth_install/
- mkdir build && cd build
script:
- cmake -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install ${CMAKE_FLAGS} -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
- make -j4
- make check
- make install # install only on linux, as CMAKE_INSTALL_PREFIX is ignored for frameworks on macosx and I cant tell whether that's correct or a bug.

10
AUTHORS
View file

@ -70,7 +70,7 @@ summary of contributions.
* The initial alsa driver was based on the jMax alsa driver by
Francois Dechelle and his Real-time Team at Ircam
(https://www.ircam.fr/jmax). The jMax code was based upon Ardour's
(http://www.ircam.fr/jmax). The jMax code was based upon Ardour's
alsa_device.cc by Paul Barton-Davis. file: iiwu_alsa.c
* Code was borrowed from the glib library to the smurf files. The goal was
@ -84,7 +84,7 @@ summary of contributions.
Smurf's midi_alsaraw.c by Josh Green. file: iiwu_alsa.c
* The reverb algorithm was written by Jezar
(https://www.dreampoint.co.uk). His code is public domain. The code
(http://www.dreampoint.co.uk). His code is public domain. The code
was translated to C by Peter Hanappe. file: iiwu_synth.c
* The original code for the chorus effect was written by Juergen
@ -103,7 +103,7 @@ summary of contributions.
adapted version was integrated in the source code. files:
fluid_cmd.c, fluidsynth/synth.h, fluid_synth.c.
* Some interpolation algorithms were used that were found in
* Some interpolation algorihms were used that were found in
the music-dsp archives (http://www.smartelectronix.com/musicdsp).
They were written by Joshua Scholar and others. file: iiwu_synth.c
@ -150,6 +150,4 @@ Bernat Arlandis i Mañó
Sven Meier
Marcus Weseloh
Jean-jacques Ceresa
Vladimir Davidovich
Tamás Korodi
Evan Miller

File diff suppressed because it is too large Load diff

View file

@ -38,60 +38,3 @@ Find FluidSynth's style guide below. Syntax related issues, like missing braces,
* Every block after an if, else, while or for should be enclosed in braces
* **Allman-Style** braces everywhere
### Documentation Style Guide
We use Doxygen for public API functions, usage examples and other
information.
#### Order of Elements
Please ensure that the order of elements in the documentation block
is consistent with the existing documentation. Most importantly,
each function starts with a single sentence brief description,
followed by any `@param` and `@return` tags. `@deprecated` and
`@since` should always come last.
Example:
```
/**
* Brief description of the function (only a single sentence).
*
* @param ...
* @param ...
* @return ...
*
* Detailed description of the function. This can be multiple paragraphs,
* include code examples etc. It can also include @note, @warning or
* other special tags not mentioned below.
*
* @deprecated This is deprecated because ...
*
* @since 1.2.3
*/
```
#### Mark Lifecycle Functions
All functions are sorted alphabetically in the generated API documentation.
To ensure that the `new_*` and `delete_*` functions appear first, please make
sure to surround those lifecycle functions with `@startlifecycle{}` and
`@endlifecycle` tags.
Example:
```
/** @startlifecycle{Some Name} */
new_fluid_some_name(...);
delete_fluid_some_name(...);
/** @endlifecycle */
```
#### Referencing Setting Items
If you want to mention a setting item (for example `audio.periods`),
please use the custom `@setting{name}` tag. The argument `name` should be
the setting name with all `.` replaced by `_`.
Example:
```
/**
* This is a comment that references \setting{audio_periods}. You
* can also link to a group of settings with \setting{audio} or
* \setting{synth}.
*/
```

View file

@ -1,8 +1,8 @@
This file is no longer used. For detailed Changelog information, please refer to the
version control system's commits. For an overview of differences between versions,
see:
https://sourceforge.net/apps/trac/fluidsynth/wiki/ChangeLog1_1_2
https://sourceforge.net/apps/trac/fluidsynth/wiki/ChangeLog1_1_1
http://sourceforge.net/apps/trac/fluidsynth/wiki/ChangeLog1_1_2
http://sourceforge.net/apps/trac/fluidsynth/wiki/ChangeLog1_1_1
etc.
For developer related "What's new"-information, doc/fluidsynth-v11-devdoc contains

View file

@ -1,10 +0,0 @@
# for the find_dependency() macro:
# include(CMakeFindDependencyMacro)
# it has the same syntax as find_package:
# find_dependency(MYDEP REQUIRED)
# define variables for configuration options:
# set(network-enabled @enable-network@)
# finally, include the targets file
include("${CMAKE_CURRENT_LIST_DIR}/FluidSynthTargets.cmake")

View file

@ -1,32 +1,31 @@
# FluidSynth
| | Build Status |
|---|---|
| <img src="https://www.kernel.org/theme/images/logos/tux.png" height="30" alt=""> **Linux** | [![FluidSynth Linux](https://github.com/FluidSynth/fluidsynth/workflows/FluidSynth%20Linux/badge.svg)](https://github.com/FluidSynth/fluidsynth/actions?query=workflow%3A%22FluidSynth+Linux%22) |
| <img src="https://cdn.pling.com/img//hive/content-pre1/112422-1.png" height="25" alt=""> **FreeBSD** | [![Build Status](https://api.cirrus-ci.com/github/FluidSynth/fluidsynth.svg?branch=master)](https://cirrus-ci.com/github/FluidSynth/fluidsynth) |
| <img src="https://www.microsoft.com/windows/favicon.ico" height="25" alt=""> **Windows** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.Win?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=3&branchName=master) |
| <img src="https://www.microsoft.com/windows/favicon.ico" height="25" alt=""> **Windows (vcpkg)** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.vcpkg?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=6&branchName=master) |
| <img src="https://www.apple.com/favicon.ico" height="30" alt=""> **MacOSX** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.macOS?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=5&branchName=master) |
| <img src="https://www.android.com/favicon.ico" height="30" alt=""> **Android** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.Android?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=4&branchName=master) |
| Build Status | glib < 2.30 | glib >= 2.30 |
|---|---|---|
| <img src="https://www.kernel.org/theme/images/logos/tux.png" height="30" alt=""> **Linux** | n.a. | [![Build Status Travis](https://travis-ci.org/FluidSynth/fluidsynth.svg?branch=master)](https://travis-ci.org/FluidSynth/fluidsynth/branches) |
| <img src="https://www.theinquirer.net/w-images/866eae81-b13b-47b5-8180-929943e9dc21/0/daemonhammerfreebsd-580x358.jpg" height="25" alt=""> **FreeBSD** | n.a. | [![Build Status](https://api.cirrus-ci.com/github/FluidSynth/fluidsynth.svg?branch=master)](https://cirrus-ci.com/github/FluidSynth/fluidsynth) |
| <img src="https://www.microsoft.com/windows/favicon.ico" height="25" alt=""> **Windows** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.Win?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=3&branchName=master) | [![Build status](https://ci.appveyor.com/api/projects/status/anbmtebt5uk4q1it/branch/master?svg=true)](https://ci.appveyor.com/project/derselbst/fluidsynth-g2ouw/branch/master) |
| <img src="https://www.apple.com/favicon.ico" height="30" alt=""> **MacOSX** | n.a. | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.macOS?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=5&branchName=master) |
| <img src="https://www.android.com/favicon.ico" height="30" alt=""> **Android** | n.a. | [![CircleCI](https://circleci.com/gh/FluidSynth/fluidsynth/tree/master.svg?style=shield)](https://circleci.com/gh/FluidSynth/fluidsynth) |
#### FluidSynth is a cross-platform, real-time software synthesizer based on the Soundfont 2 specification.
FluidSynth generates audio by reading and handling MIDI events from MIDI input devices by using a [SoundFont](https://github.com/FluidSynth/fluidsynth/wiki/SoundFont). It is the software analogue of a MIDI synthesizer. FluidSynth can also play MIDI files.
[![SonarQube Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=FluidSynth_fluidsynth&metric=alert_status)](https://sonarcloud.io/dashboard?id=FluidSynth_fluidsynth) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/FluidSynth/fluidsynth.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/FluidSynth/fluidsynth/context:cpp) [![OHLOH Project Stats](https://www.openhub.net/p/fluidsynth/widgets/project_thin_badge?format=gif)](https://www.openhub.net/p/fluidsynth)
[![OHLOH Project Stats](https://www.openhub.net/p/fluidsynth/widgets/project_thin_badge?format=gif)](https://www.openhub.net/p/fluidsynth)
## Documentation
The central place for documentation and further links is our **wiki** here at GitHub:
#### https://github.com/FluidSynth/fluidsynth/wiki
**https://github.com/FluidSynth/fluidsynth/wiki**
If you are missing parts of the documentation, let us know by writing to our mailing list.
Of course, you are welcome to edit and improve the wiki yourself. All you need is an account at GitHub. Alternatively, you may send an EMail to our mailing list along with your suggested changes. Further information about the mailing list is available in the wiki as well.
Latest information about FluidSynth is also available on the web site at https://www.fluidsynth.org/.
Latest information about FluidSynth is also available on the web site at http://www.fluidsynth.org/.
## License
@ -38,11 +37,11 @@ For information on how to build FluidSynth from source, please [refer to our wik
## Links
- FluidSynth's Home Page, https://www.fluidsynth.org
- FluidSynth's Home Page, http://www.fluidsynth.org
- FluidSynth's wiki, https://github.com/FluidSynth/fluidsynth/wiki
- FluidSynth's API documentation, https://www.fluidsynth.org/api/
- FluidSynth's API documentation, http://www.fluidsynth.org/api/
---
@ -95,6 +94,6 @@ several reasons:
Xmms, WinAmp, Director, ...); develop language bindings (Python,
Java, Perl, ...); and integrate it into (game) frameworks (Crystal
Space, SDL, ...). For these reasons I've decided it would be easiest
if the project stayed very focused on its goal (a Soundfont
if the project stayed very focussed on its goal (a Soundfont
synthesizer), stayed small (ideally one file) and didn't dependent
on external code.

2
THANKS
View file

@ -5,7 +5,7 @@ file AUTHORS.
We would like to thank the Fondation Daniel Langlois for their
funding. Their help made this project to get of the ground. Without it
would simply not exist. Many thanks!
(https://www.fondation-langlois.org)
(http://www.fondation-langlois.org)
In alphabetic order:

14
TODO
View file

@ -21,15 +21,27 @@ Bugs to mash
------------
- Investigate why MIDI rendering causes burst of notes at start
Validation
----------
- Validation tests: create soundfont with basic wave forms [sine,
square, triangle]; make test midi file; compare with SBLive output;
"regression" test
- Validate chorus (often sounds rather crappy)
- Analyse performance
Documentation
-------------
- Write documentation on tuning
- Write documention on tuning
- Add usage scenarios in the documentation
- User and system configuration file
Misc
----
- Remove dependency of settings on audio driver and other (see
fluid_settings_init())
- When specifying -i -s (no console and TCP server) log to TCP clients
with easier parsable messages ("warning:", "error:", etc)
- Pause and resume the synthesizer/audio thread (run synthesizer as a daemon)
- set loop on/off on a sample (set_gen GEN_SAMPLEMODE?)

View file

@ -1,603 +0,0 @@
# Copyright (c) 2012 - 2017, Lars Bilke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# CHANGES:
#
# 2012-01-31, Lars Bilke
# - Enable Code Coverage
#
# 2013-09-17, Joakim Söderberg
# - Added support for Clang.
# - Some additional usage instructions.
#
# 2016-02-03, Lars Bilke
# - Refactored functions to use named parameters
#
# 2017-06-02, Lars Bilke
# - Merged with modified version from github.com/ufz/ogs
#
# 2019-05-06, Anatolii Kurotych
# - Remove unnecessary --coverage flag
#
# 2019-12-13, FeRD (Frank Dana)
# - Deprecate COVERAGE_LCOVR_EXCLUDES and COVERAGE_GCOVR_EXCLUDES lists in favor
# of tool-agnostic COVERAGE_EXCLUDES variable, or EXCLUDE setup arguments.
# - CMake 3.4+: All excludes can be specified relative to BASE_DIRECTORY
# - All setup functions: accept BASE_DIRECTORY, EXCLUDE list
# - Set lcov basedir with -b argument
# - Add automatic --demangle-cpp in lcovr, if 'c++filt' is available (can be
# overridden with NO_DEMANGLE option in setup_target_for_coverage_lcovr().)
# - Delete output dir, .info file on 'make clean'
# - Remove Python detection, since version mismatches will break gcovr
# - Minor cleanup (lowercase function names, update examples...)
#
# 2019-12-19, FeRD (Frank Dana)
# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets
#
# 2020-01-19, Bob Apthorpe
# - Added gfortran support
#
# 2020-02-17, FeRD (Frank Dana)
# - Make all add_custom_target()s VERBATIM to auto-escape wildcard characters
# in EXCLUDEs, and remove manual escaping from gcovr targets
#
# 2021-01-19, Robin Mueller
# - Add CODE_COVERAGE_VERBOSE option which will allow to print out commands which are run
# - Added the option for users to set the GCOVR_ADDITIONAL_ARGS variable to supply additional
# flags to the gcovr command
#
# 2020-05-04, Mihchael Davis
# - Add -fprofile-abs-path to make gcno files contain absolute paths
# - Fix BASE_DIRECTORY not working when defined
# - Change BYPRODUCT from folder to index.html to stop ninja from complaining about double defines
# USAGE:
#
# 1. Copy this file into your cmake modules path.
#
# 2. Add the following line to your CMakeLists.txt (best inside an if-condition
# using a CMake option() to enable it just optionally):
# include(CodeCoverage)
#
# 3. Append necessary compiler flags:
# append_coverage_compiler_flags()
#
# 3.a (OPTIONAL) Set appropriate optimization flags, e.g. -O0, -O1 or -Og
#
# 4. If you need to exclude additional directories from the report, specify them
# using full paths in the COVERAGE_EXCLUDES variable before calling
# setup_target_for_coverage_*().
# Example:
# set(COVERAGE_EXCLUDES
# '${PROJECT_SOURCE_DIR}/src/dir1/*'
# '/path/to/my/src/dir2/*')
# Or, use the EXCLUDE argument to setup_target_for_coverage_*().
# Example:
# setup_target_for_coverage_lcov(
# NAME coverage
# EXECUTABLE testrunner
# EXCLUDE "${PROJECT_SOURCE_DIR}/src/dir1/*" "/path/to/my/src/dir2/*")
#
# 4.a NOTE: With CMake 3.4+, COVERAGE_EXCLUDES or EXCLUDE can also be set
# relative to the BASE_DIRECTORY (default: PROJECT_SOURCE_DIR)
# Example:
# set(COVERAGE_EXCLUDES "dir1/*")
# setup_target_for_coverage_gcovr_html(
# NAME coverage
# EXECUTABLE testrunner
# BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
# EXCLUDE "dir2/*")
#
# 5. Use the functions described below to create a custom make target which
# runs your test executable and produces a code coverage report.
#
# 6. Build a Debug build:
# cmake -DCMAKE_BUILD_TYPE=Debug ..
# make
# make my_coverage_target
#
include(CMakeParseArguments)
option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE)
# Check prereqs
find_program( GCOV_PATH gcov )
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
find_program( CPPFILT_PATH NAMES c++filt )
if(NOT GCOV_PATH)
message(FATAL_ERROR "gcov not found! Aborting...")
endif() # NOT GCOV_PATH
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
list(GET LANGUAGES 0 LANG)
if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
if("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3)
message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
endif()
elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang")
# Do nothing; exit conditional without error if true
elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
# Do nothing; exit conditional without error if true
else()
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
endif()
endif()
set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
CACHE INTERNAL "")
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fprofile-abs-path HAVE_fprofile_abs_path)
if(HAVE_fprofile_abs_path)
set(COVERAGE_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
endif()
endif()
set(CMAKE_Fortran_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the Fortran compiler during coverage builds."
FORCE )
set(CMAKE_CXX_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the C++ compiler during coverage builds."
FORCE )
set(CMAKE_C_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the C compiler during coverage builds."
FORCE )
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used for linking binaries during coverage builds."
FORCE )
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
FORCE )
mark_as_advanced(
CMAKE_Fortran_FLAGS_COVERAGE
CMAKE_CXX_FLAGS_COVERAGE
CMAKE_C_FLAGS_COVERAGE
CMAKE_EXE_LINKER_FLAGS_COVERAGE
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
link_libraries(gcov)
endif()
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_lcov(
# NAME testrunner_coverage # New target name
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES testrunner # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
# # to BASE_DIRECTORY, with CMake 3.4+)
# NO_DEMANGLE # Don't demangle C++ symbols
# # even if c++filt is found
# )
function(setup_target_for_coverage_lcov)
set(options NO_DEMANGLE)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT LCOV_PATH)
message(FATAL_ERROR "lcov not found! Aborting...")
endif() # NOT LCOV_PATH
if(NOT GENHTML_PATH)
message(FATAL_ERROR "genhtml not found! Aborting...")
endif() # NOT GENHTML_PATH
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(DEFINED Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (CMake 3.4+: Also compute absolute paths)
set(LCOV_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES})
if(CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
list(APPEND LCOV_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES LCOV_EXCLUDES)
# Conditional arguments
if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
set(GENHTML_EXTRA_ARGS "--demangle-cpp")
endif()
# enable branch coverage
set ( Coverage_LCOV_ARGS ${Coverage_LCOV_ARGS} --rc lcov_branch_coverage=1 )
set ( Coverage_GENHTML_ARGS ${Coverage_GENHTML_ARGS} --branch-coverage )
# Setting up commands which will be run to generate coverage data.
# Cleanup lcov
set(LCOV_CLEAN_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory .
-b ${BASEDIR} --zerocounters
)
# Create baseline to make sure untouched files show up in the report
set(LCOV_BASELINE_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b
${BASEDIR} -o ${Coverage_NAME}.base
)
# Run tests
set(LCOV_EXEC_TESTS_CMD
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
)
# Capturing lcov counters and generating report
set(LCOV_CAPTURE_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b
${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
)
# add baseline counters
set(LCOV_BASELINE_COUNT_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base
-a ${Coverage_NAME}.capture --output-file ${Coverage_NAME}.total
)
# filter collected data to final coverage report
set(LCOV_FILTER_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove
${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info
)
# Generate HTML output
set(LCOV_GEN_HTML_CMD
${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o
${Coverage_NAME} ${Coverage_NAME}.info
)
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Executed command report")
message(STATUS "Command to clean up lcov: ")
string(REPLACE ";" " " LCOV_CLEAN_CMD_SPACED "${LCOV_CLEAN_CMD}")
message(STATUS "${LCOV_CLEAN_CMD_SPACED}")
message(STATUS "Command to create baseline: ")
string(REPLACE ";" " " LCOV_BASELINE_CMD_SPACED "${LCOV_BASELINE_CMD}")
message(STATUS "${LCOV_BASELINE_CMD_SPACED}")
message(STATUS "Command to run the tests: ")
string(REPLACE ";" " " LCOV_EXEC_TESTS_CMD_SPACED "${LCOV_EXEC_TESTS_CMD}")
message(STATUS "${LCOV_EXEC_TESTS_CMD_SPACED}")
message(STATUS "Command to capture counters and generate report: ")
string(REPLACE ";" " " LCOV_CAPTURE_CMD_SPACED "${LCOV_CAPTURE_CMD}")
message(STATUS "${LCOV_CAPTURE_CMD_SPACED}")
message(STATUS "Command to add baseline counters: ")
string(REPLACE ";" " " LCOV_BASELINE_COUNT_CMD_SPACED "${LCOV_BASELINE_COUNT_CMD}")
message(STATUS "${LCOV_BASELINE_COUNT_CMD_SPACED}")
message(STATUS "Command to filter collected data: ")
string(REPLACE ";" " " LCOV_FILTER_CMD_SPACED "${LCOV_FILTER_CMD}")
message(STATUS "${LCOV_FILTER_CMD_SPACED}")
message(STATUS "Command to generate lcov HTML output: ")
string(REPLACE ";" " " LCOV_GEN_HTML_CMD_SPACED "${LCOV_GEN_HTML_CMD}")
message(STATUS "${LCOV_GEN_HTML_CMD_SPACED}")
endif()
# Setup target
add_custom_target(${Coverage_NAME}
COMMAND ${LCOV_CLEAN_CMD}
COMMAND ${LCOV_BASELINE_CMD}
COMMAND ${LCOV_EXEC_TESTS_CMD}
COMMAND ${LCOV_CAPTURE_CMD}
COMMAND ${LCOV_BASELINE_COUNT_CMD}
COMMAND ${LCOV_FILTER_CMD}
COMMAND ${LCOV_GEN_HTML_CMD}
# Set output files as GENERATED (will be removed on 'make clean')
BYPRODUCTS
${Coverage_NAME}.base
${Coverage_NAME}.capture
${Coverage_NAME}.total
${Coverage_NAME}.info
${Coverage_NAME}/index.html
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
)
# Show where to find the lcov info report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
)
# Show info where to find the report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
)
endfunction() # setup_target_for_coverage_lcov
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_gcovr_html(
# NAME ctest_coverage # New target name
# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES executable_target # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
# # to BASE_DIRECTORY, with CMake 3.4+)
# )
# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
# GCVOR command.
function(setup_target_for_coverage_gcovr_html)
set(options NONE)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT GCOVR_PATH)
message(FATAL_ERROR "gcovr not found! Aborting...")
endif() # NOT GCOVR_PATH
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(DEFINED Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (CMake 3.4+: Also compute absolute paths)
set(GCOVR_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
if(CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
# Combine excludes to several -e arguments
set(GCOVR_EXCLUDE_ARGS "")
foreach(EXCLUDE ${GCOVR_EXCLUDES})
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
endforeach()
# Set up commands which will be run to generate coverage data
# Run tests
set(GCOVR_HTML_EXEC_TESTS_CMD
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
)
# Create folder
set(GCOVR_HTML_FOLDER_CMD
${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME}
)
# Running gcovr
set(GCOVR_HTML_CMD
${GCOVR_PATH} --html --html-details -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
-o ${Coverage_NAME}/index.html
)
# The --keep option is broken since gcovr 4.0 all our gcov files are deleted before SonarQube
# can use them. Hence create an additional sonarqube report, but do not fail if this fails.
set(GCOVR_SONAR_CMD
${GCOVR_PATH} --sonarqube -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
-o ${Coverage_NAME}/sonarqube.report || true
)
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Executed command report")
message(STATUS "Command to run tests: ")
string(REPLACE ";" " " GCOVR_HTML_EXEC_TESTS_CMD_SPACED "${GCOVR_HTML_EXEC_TESTS_CMD}")
message(STATUS "${GCOVR_HTML_EXEC_TESTS_CMD_SPACED}")
message(STATUS "Command to create a folder: ")
string(REPLACE ";" " " GCOVR_HTML_FOLDER_CMD_SPACED "${GCOVR_HTML_FOLDER_CMD}")
message(STATUS "${GCOVR_HTML_FOLDER_CMD_SPACED}")
message(STATUS "Command to generate gcovr HTML coverage data: ")
string(REPLACE ";" " " GCOVR_HTML_CMD_SPACED "${GCOVR_HTML_CMD}")
message(STATUS "${GCOVR_HTML_CMD_SPACED}")
endif()
add_custom_target(${Coverage_NAME}
COMMAND ${GCOVR_HTML_EXEC_TESTS_CMD}
COMMAND ${GCOVR_HTML_FOLDER_CMD}
COMMAND ${GCOVR_HTML_CMD}
COMMAND ${GCOVR_SONAR_CMD}
BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html # report directory
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Running gcovr to produce HTML code coverage report."
)
# Show info where to find the report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
)
endfunction() # setup_target_for_coverage_gcovr_html
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_fastcov(
# NAME testrunner_coverage # New target name
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES testrunner # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/" "src/dir2/" # Patterns to exclude.
# NO_DEMANGLE # Don't demangle C++ symbols
# # even if c++filt is found
# SKIP_HTML # Don't create html report
# )
function(setup_target_for_coverage_fastcov)
set(options NO_DEMANGLE SKIP_HTML)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES FASTCOV_ARGS GENHTML_ARGS)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT FASTCOV_PATH)
message(FATAL_ERROR "fastcov not found! Aborting...")
endif()
if(NOT GENHTML_PATH)
message(FATAL_ERROR "genhtml not found! Aborting...")
endif()
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (Patterns, not paths, for fastcov)
set(FASTCOV_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_FASTCOV_EXCLUDES})
list(APPEND FASTCOV_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES FASTCOV_EXCLUDES)
# Conditional arguments
if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
set(GENHTML_EXTRA_ARGS "--demangle-cpp")
endif()
# Set up commands which will be run to generate coverage data
set(FASTCOV_EXEC_TESTS_CMD ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS})
set(FASTCOV_CAPTURE_CMD ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
--search-directory ${BASEDIR}
--process-gcno
--lcov
--output ${Coverage_NAME}.info
--exclude ${FASTCOV_EXCLUDES}
--exclude ${FASTCOV_EXCLUDES}
)
if(Coverage_SKIP_HTML)
set(FASTCOV_HTML_CMD ";")
else()
set(FASTCOV_HTML_CMD ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS}
-o ${Coverage_NAME} ${Coverage_NAME}.info
)
endif()
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Code coverage commands for target ${Coverage_NAME} (fastcov):")
message(" Running tests:")
string(REPLACE ";" " " FASTCOV_EXEC_TESTS_CMD_SPACED "${FASTCOV_EXEC_TESTS_CMD}")
message(" ${FASTCOV_EXEC_TESTS_CMD_SPACED}")
message(" Capturing fastcov counters and generating report:")
string(REPLACE ";" " " FASTCOV_CAPTURE_CMD_SPACED "${FASTCOV_CAPTURE_CMD}")
message(" ${FASTCOV_CAPTURE_CMD_SPACED}")
if(NOT Coverage_SKIP_HTML)
message(" Generating HTML report: ")
string(REPLACE ";" " " FASTCOV_HTML_CMD_SPACED "${FASTCOV_HTML_CMD}")
message(" ${FASTCOV_HTML_CMD_SPACED}")
endif()
endif()
# Setup target
add_custom_target(${Coverage_NAME}
# Cleanup fastcov
COMMAND ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
--search-directory ${BASEDIR}
--zerocounters
COMMAND ${FASTCOV_EXEC_TESTS_CMD}
COMMAND ${FASTCOV_CAPTURE_CMD}
COMMAND ${FASTCOV_HTML_CMD}
# Set output files as GENERATED (will be removed on 'make clean')
BYPRODUCTS
${Coverage_NAME}.info
${Coverage_NAME}/index.html # report directory
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Resetting code coverage counters to zero. Processing code coverage counters and generating report."
)
set(INFO_MSG "fastcov code coverage info report saved in ${Coverage_NAME}.info.")
if(NOT Coverage_SKIP_HTML)
string(APPEND INFO_MSG " Open ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html in your browser to view the coverage report.")
endif()
# Show where to find the fastcov info report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo ${INFO_MSG}
)
endfunction() # setup_target_for_coverage_fastcov
function(append_coverage_compiler_flags)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
endfunction() # append_coverage_compiler_flags

View file

@ -1,56 +1,92 @@
# Provides install directory variables as defined by the GNU Coding Standards
include ( GNUInstallDirs )
# Several directory names used by FluidSynth to install files
# the variable names are similar to the KDE4 build system
# DEFAULT_SOUNDFONT - automatically loaded in some use cases
if ( WIN32 )
set (DEFAULT_SOUNDFONT "C:\\\\ProgramData\\\\soundfonts\\\\default.sf2" CACHE STRING
set (DEFAULT_SOUNDFONT "C:\\\\soundfonts\\\\default.sf2" CACHE STRING
"Default soundfont file")
else ( WIN32 )
set (DEFAULT_SOUNDFONT "${CMAKE_INSTALL_FULL_DATADIR}/soundfonts/default.sf2" CACHE STRING
set (DEFAULT_SOUNDFONT "${CMAKE_INSTALL_PREFIX}/share/soundfonts/default.sf2" CACHE STRING
"Default soundfont file")
endif ( WIN32 )
mark_as_advanced (DEFAULT_SOUNDFONT)
set(FRAMEWORK_INSTALL_PREFIX "")
if ( CMAKE_VERSION VERSION_GREATER "3.7.0" AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set(FRAMEWORK_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
endif()
# BUNDLE_INSTALL_DIR - Mac only: the directory for application bundles
set (BUNDLE_INSTALL_DIR "Applications" CACHE STRING
set (BUNDLE_INSTALL_DIR "/Applications" CACHE STRING
"The install dir for application bundles")
mark_as_advanced (BUNDLE_INSTALL_DIR)
# FRAMEWORK_INSTALL_DIR - Mac only: the directory for framework bundles
set (FRAMEWORK_INSTALL_DIR "Library/Frameworks" CACHE STRING
set (FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING
"The install dir for framework bundles")
mark_as_advanced (FRAMEWORK_INSTALL_DIR)
mark_as_advanced (FRAMEWORK_INSTALL_DIR)
# BIN_INSTALL_DIR - the directory where executables will be installed
set (BIN_INSTALL_DIR "bin" CACHE STRING "The install dir for executables")
mark_as_advanced (BIN_INSTALL_DIR)
# SBIN_INSTALL_DIR - the directory where system executables will be installed
set (SBIN_INSTALL_DIR "sbin" CACHE STRING
"The install dir for system executables")
mark_as_advanced (SBIN_INSTALL_DIR)
# LIB_INSTALL_DIR - the directory where libraries will be installed
set (LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE STRING "The install dir for libraries")
mark_as_advanced (LIB_INSTALL_DIR)
# INCLUDE_INSTALL_DIR - the install dir for header files
set (INCLUDE_INSTALL_DIR "include" CACHE STRING "The install dir for headers")
mark_as_advanced (INCLUDE_INSTALL_DIR)
# DATA_INSTALL_DIR - the base install directory for data files
set (DATA_INSTALL_DIR "share" CACHE STRING
"The base install dir for data files")
mark_as_advanced (DATA_INSTALL_DIR)
# DOC_INSTALL_DIR - the install dir for documentation
set (DOC_INSTALL_DIR "share/doc" CACHE STRING
"The install dir for documentation")
mark_as_advanced (DOC_INSTALL_DIR)
# INFO_INSTALL_DIR - the info install dir
set (INFO_INSTALL_DIR "share/info" CACHE STRING "The info install dir")
mark_as_advanced (INFO_INSTALL_DIR)
# MAN_INSTALL_DIR - the man pages install dir
if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD|DragonFly")
set (MAN_INSTALL_DIR "man/man1" CACHE STRING "The man pages install dir")
else()
set (MAN_INSTALL_DIR "share/man/man1" CACHE STRING "The man pages install dir")
endif()
mark_as_advanced (MAN_INSTALL_DIR)
# SYSCONF_INSTALL_DIR - the config file install dir
set (SYSCONF_INSTALL_DIR "/etc" CACHE PATH
"The sysconfig install dir")
mark_as_advanced (SYSCONF_INSTALL_DIR)
# XDG_APPS_INSTALL_DIR - the XDG apps dir, where .desktop files are installed
set (XDG_APPS_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/applications" CACHE STRING "The XDG apps dir")
set (XDG_APPS_INSTALL_DIR "share/applications" CACHE STRING "The XDG apps dir")
mark_as_advanced (XDG_APPS_INSTALL_DIR)
# XDG_MIME_INSTALL_DIR - the XDG mimetypes install dir
set (XDG_MIME_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/mime/packages" CACHE STRING
set (XDG_MIME_INSTALL_DIR "share/mime/packages" CACHE STRING
"The install dir for the xdg mimetypes")
mark_as_advanced (XDG_MIME_INSTALL_DIR)
# DBUS_INTERFACES_INSTALL_DIR - the directory where dbus interfaces are
# installed
set (DBUS_INTERFACES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/dbus-1/interfaces" CACHE STRING
set (DBUS_INTERFACES_INSTALL_DIR "share/dbus-1/interfaces" CACHE STRING
"The dbus interfaces install dir")
mark_as_advanced (DBUS_INTERFACES_INSTALL_DIR)
# DBUS_SERVICES_INSTALL_DIR - the directory where dbus services are installed
set (DBUS_SERVICES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/dbus-1/services" CACHE STRING
set (DBUS_SERVICES_INSTALL_DIR "share/dbus-1/services" CACHE STRING
"The dbus services install dir")
mark_as_advanced (DBUS_SERVICES_INSTALL_DIR)
# DBUS_SYSTEM_SERVICES_INSTALL_DIR - the directory where dbus system services
# are installed
set (DBUS_SYSTEM_SERVICES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/dbus-1/system-services"
set (DBUS_SYSTEM_SERVICES_INSTALL_DIR "share/dbus-1/system-services"
CACHE STRING "The dbus system services install dir")
mark_as_advanced (DBUS_SYSTEM_SERVICES_INSTALL_DIR)

View file

@ -45,4 +45,7 @@ ENDIF(NOT WIN32)
MARK_AS_ADVANCED (
OSS_FOUND
OSS_INCLUDE_DIR
)
LINUX_OSS_INCLUDE_DIR
SYS_OSS_INCLUDE_DIR
MACHINE_OSS_INCLUDE_DIR
)

View file

@ -1,14 +1,14 @@
macro ( ADD_FLUID_TEST _test )
add_executable( ${_test} ${_test}.c )
ADD_EXECUTABLE(${_test} ${_test}.c $<TARGET_OBJECTS:libfluidsynth-OBJ> )
# only build this unit test when explicitly requested by "make check"
set_target_properties(${_test} PROPERTIES EXCLUDE_FROM_ALL TRUE)
# import necessary compile flags and dependency libraries
if ( FLUID_CPPFLAGS )
set_target_properties ( ${_test} PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} )
endif ( FLUID_CPPFLAGS )
target_link_libraries( ${_test} libfluidsynth-OBJ )
TARGET_LINK_LIBRARIES(${_test} $<TARGET_PROPERTY:libfluidsynth,INTERFACE_LINK_LIBRARIES>)
# use the local include path to look for fluidsynth.h, as we cannot be sure fluidsynth is already installed
target_include_directories(${_test}
@ -16,85 +16,13 @@ macro ( ADD_FLUID_TEST _test )
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> # include auto generated headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> # include "normal" public (sub-)headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> # include private headers
$<TARGET_PROPERTY:libfluidsynth-OBJ,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
$<TARGET_PROPERTY:libfluidsynth,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
)
# add the test to ctest
ADD_TEST(NAME ${_test} COMMAND ${_test})
# append the current unit test to check-target as dependency
add_dependencies(check ${_test})
endmacro ( ADD_FLUID_TEST )
macro ( ADD_FLUID_TEST_UTIL _util )
add_executable( ${_util} ${_util}.c )
# only build this unit test when explicitly requested by "make check"
set_target_properties(${_util} PROPERTIES EXCLUDE_FROM_ALL TRUE)
# append no-op generator expression to avoid VS or XCode from adding per-config subdirectories
set_target_properties(${_util} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/utils/$<0:>)
# import necessary compile flags and dependency libraries
if ( FLUID_CPPFLAGS )
set_target_properties ( ${_util} PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} )
endif ( FLUID_CPPFLAGS )
target_link_libraries( ${_util} libfluidsynth-OBJ )
# use the local include path to look for fluidsynth.h, as we cannot be sure fluidsynth is already installed
target_include_directories(${_util}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> # include auto generated headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> # include "normal" public (sub-)headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> # include private headers
$<TARGET_PROPERTY:libfluidsynth-OBJ,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
)
# append the current unit test to check-target as dependency
add_dependencies(check ${_util})
endmacro ( ADD_FLUID_TEST_UTIL )
# This macro adds a test that writes its output to a file called
# <test>.output (in the current working dir) and then compares
# the content with the file given in _expected_output
macro ( ADD_FLUID_SF_DUMP_TEST _sfname)
set( test_args "${CMAKE_SOURCE_DIR}/sf2/${_sfname} ${_sfname}.yml" )
ADD_TEST(${_sfname}_dump_test
${CMAKE_COMMAND}
-Dtest_cmd=${CMAKE_BINARY_DIR}/test/utils/dump_sfont${CMAKE_EXECUTABLE_SUFFIX}
-Dtest_args=${test_args}
-Dtest_output=${_sfname}.yml
-Dexpected_output=${CMAKE_SOURCE_DIR}/sf2/${_sfname}.yml
-P ${CMAKE_SOURCE_DIR}/cmake_admin/RunOutputTest.cmake
)
endmacro ( ADD_FLUID_SF_DUMP_TEST )
macro ( ADD_FLUID_DEMO _demo )
ADD_EXECUTABLE(${_demo} ${_demo}.c )
# only build this unit test when explicitly requested by "make check"
set_target_properties(${_demo} PROPERTIES EXCLUDE_FROM_ALL TRUE)
# import necessary compile flags and dependency libraries
if ( FLUID_CPPFLAGS )
set_target_properties ( ${_demo} PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} )
endif ( FLUID_CPPFLAGS )
TARGET_LINK_LIBRARIES(${_demo} libfluidsynth)
# use the local include path to look for fluidsynth.h, as we cannot be sure fluidsynth is already installed
target_include_directories(${_demo}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> # include auto generated headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> # include "normal" public (sub-)headers
$<TARGET_PROPERTY:libfluidsynth,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
)
# append the current unit test to check-target as dependency
add_dependencies(demo ${_demo})
endmacro ( ADD_FLUID_DEMO )

View file

@ -1,75 +0,0 @@
macro ( sanitize_property_dirs target property )
set(_cleandirs)
get_target_property(_dirs ${target} ${property})
if(_dirs)
foreach(_d IN LISTS _dirs)
if(EXISTS ${_d})
list(APPEND _cleandirs ${_d})
else()
message(DEBUG "removing spurious directory ${_d} from property ${property} of target ${target}")
endif()
endforeach()
set_property(TARGET ${target} PROPERTY ${property} ${_cleandirs})
endif()
endmacro ( sanitize_property_dirs )
macro ( sanitize_target_dirs target )
if (TARGET ${target})
message(DEBUG "performing sanitize_target_dirs(${target})")
sanitize_property_dirs( ${target} INTERFACE_INCLUDE_DIRECTORIES )
sanitize_property_dirs( ${target} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES )
sanitize_property_dirs( ${target} INTERFACE_LINK_DIRECTORIES )
endif()
endmacro ( sanitize_target_dirs )
macro ( generate_pkgconfig_spec template outfile target )
#message(DEBUG "generate_pkgconfig_spec: ${outfile} from template: ${template}")
if (TARGET ${target})
# retrieve all the private libs we depend on
get_target_property (_libs ${target} INTERFACE_LINK_LIBRARIES)
set(_cleanlibs)
foreach(_lib IN LISTS _libs)
if (TARGET ${_lib})
# All the imported PkgConfig target are explicitly added to PC_REQUIRES_PRIV.
# Do not duplicate them into the Libs.private section, as they will be already part of Requires.private
else()
list(APPEND _cleanlibs ${_lib})
endif()
endforeach()
list(REMOVE_DUPLICATES _cleanlibs)
set (LIBS_PRIVATE ${_cleanlibs})
# make a copy
set ( LIBS_PRIVATE_WITH_PATH ${LIBS_PRIVATE} )
# this matches any path and any flag entries (starting with '-')
set ( LIB_LIST_REGEX "(^(.+)\/([^\/]+)$)|(^\-.*$)" )
# remove all entries from the list which are specified by path and which already have -l
list ( FILTER LIBS_PRIVATE EXCLUDE REGEX ${LIB_LIST_REGEX} )
# include only entries specifed by path
list ( FILTER LIBS_PRIVATE_WITH_PATH INCLUDE REGEX ${LIB_LIST_REGEX} )
# prepend the linker flag to all entries except the ones that already have it
list ( TRANSFORM LIBS_PRIVATE PREPEND "-l")
list ( JOIN LIBS_PRIVATE " " LIBS_PRIVATE_JOINED )
list ( JOIN LIBS_PRIVATE_WITH_PATH " " LIBS_PRIVATE_WITH_PATH_JOINED )
list ( JOIN PC_REQUIRES_PRIV " " PC_REQUIRES_PRIV_JOINED )
configure_file ( ${template} ${outfile} IMMEDIATE @ONLY)
endif()
endmacro ( generate_pkgconfig_spec )
macro ( unset_pkg_config _prefix )
unset ( ${_prefix}_VERSION CACHE )
unset ( ${_prefix}_PREFIX CACHE )
unset ( ${_prefix}_CFLAGS CACHE )
unset ( ${_prefix}_CFLAGS_OTHER CACHE )
unset ( ${_prefix}_LDFLAGS CACHE )
unset ( ${_prefix}_LDFLAGS_OTHER CACHE )
unset ( ${_prefix}_LIBRARIES CACHE )
unset ( ${_prefix}_INCLUDEDIR CACHE )
unset ( ${_prefix}_INCLUDE_DIRS CACHE )
unset ( ${_prefix}_LIBDIR CACHE )
unset ( ${_prefix}_LIBRARY_DIRS CACHE )
unset ( __pkg_config_checked_${_prefix} CACHE )
endmacro ( unset_pkg_config )

View file

@ -1,31 +0,0 @@
if( NOT test_cmd )
message( FATAL_ERROR "test_cmd not defined" )
endif( NOT test_cmd )
if( NOT test_output )
message( FATAL_ERROR "test_output not defined" )
endif( NOT test_output )
if( NOT expected_output )
message( FATAL_ERROR "expected_output not defined" )
endif( NOT expected_output )
separate_arguments( test_args )
execute_process(
COMMAND ${test_cmd} ${test_args}
RESULT_VARIABLE test_not_successful
)
if( test_not_successful )
message( FATAL_ERROR "${test_cmd} ${test_args} returned error ${test_not_successful}!" )
endif( test_not_successful )
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${expected_output} ${test_output}
RESULT_VARIABLE compare_not_successful
)
if( compare_not_successful )
message( SEND_ERROR "${test_output} does not match ${expected_output}!" )
endif( compare_not_successful )

View file

@ -0,0 +1,14 @@
macro ( unset_pkg_config _prefix )
unset ( ${_prefix}_VERSION CACHE )
unset ( ${_prefix}_PREFIX CACHE )
unset ( ${_prefix}_CFLAGS CACHE )
unset ( ${_prefix}_CFLAGS_OTHER CACHE )
unset ( ${_prefix}_LDFLAGS CACHE )
unset ( ${_prefix}_LDFLAGS_OTHER CACHE )
unset ( ${_prefix}_LIBRARIES CACHE )
unset ( ${_prefix}_INCLUDEDIR CACHE )
unset ( ${_prefix}_INCLUDE_DIRS CACHE )
unset ( ${_prefix}_LIBDIR CACHE )
unset ( ${_prefix}_LIBRARY_DIRS CACHE )
unset ( __pkg_config_checked_${_prefix} CACHE )
endmacro ( unset_pkg_config )

View file

@ -61,12 +61,6 @@ else ( OSS_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} OSS: no\n" )
endif ( OSS_SUPPORT )
if ( PIPEWIRE_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} PipeWire: yes\n" )
else ( PIPEWIRE_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} PipeWire: no\n" )
endif ( PIPEWIRE_SUPPORT )
if ( PORTAUDIO_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} PortAudio: yes\n" )
else ( PORTAUDIO_SUPPORT )
@ -85,12 +79,6 @@ else ( SDL2_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} SDL2: no\n" )
endif ( SDL2_SUPPORT )
if ( WASAPI_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} WASAPI: yes\n" )
else ( WASAPI_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} WASAPI: no\n" )
endif ( WASAPI_SUPPORT )
if ( WAVEOUT_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} WaveOut: yes\n" )
else ( WAVEOUT_SUPPORT )
@ -183,12 +171,6 @@ else ( SYSTEMD_SUPPORT )
set ( MISC_REPORT "${MISC_REPORT} systemd: no\n" )
endif ( SYSTEMD_SUPPORT )
if ( HAVE_GETOPT_H )
set ( MISC_REPORT "${MISC_REPORT} getopt: yes\n" )
else ( HAVE_GETOPT_H )
set ( MISC_REPORT "${MISC_REPORT} getopt: no\n" )
endif ( HAVE_GETOPT_H )
set ( DEVEL_REPORT "\nDeveloper nerds info:\n" )
@ -240,20 +222,6 @@ else ( ENABLE_UBSAN )
set ( DEVEL_REPORT "${DEVEL_REPORT} UBSan (debug): no\n" )
endif ( ENABLE_UBSAN )
if ( ENABLE_COVERAGE )
set ( DEVEL_REPORT "${DEVEL_REPORT} Coverage: yes\n" )
else ( ENABLE_COVERAGE )
set ( DEVEL_REPORT "${DEVEL_REPORT} Coverage: no\n" )
endif ( ENABLE_COVERAGE )
if ( MSVC )
if ( enable-static-msvcrt )
set ( DEVEL_REPORT "${DEVEL_REPORT} Static MSVC Runtime: yes\n" )
else ( enable-static-msvcrt )
set ( DEVEL_REPORT "${DEVEL_REPORT} Static MSVC Runtime: no\n" )
endif ( enable-static-msvcrt )
endif ( MSVC )
message( STATUS
"\n**************************************************************\n"
"Build Summary:\n"

View file

@ -1 +0,0 @@
libfluidsynth2

View file

@ -1,23 +0,0 @@
fluidsynth (1.1.8-1) unstable; urgency=low
- Update to version 1.1.8:
* fix build against glib < 2.30 (#202)
* fix dsound audio driver on windows (#215)
* fix a bug around `synth.audio-groups` setting, which caused improper multi-channel rendering (#225)
* cmake 3.0.2 is now required
* compilation with clang is now possible
* build fixes on OS/2 (thanks to @komh)
-- Tom Moebert <tom.mbrt@googlemail.com> Fri, 13 Oct 2017 15:53:00 +0000
fluidsynth (1.1.7-1) unstable; urgency=low
* OBS snapshot.
-- Rui Nuno Capela <rncbc@rncbc.org> Tue, 5 Sep 2017 20:00:00 +0000
fluidsynth (1.1.6-1) unstable; urgency=low
* OBS snapshot.
-- Rui Nuno Capela <rncbc@rncbc.org> Sun, 19 Aug 2012 23:45:01 +0000

View file

@ -1 +0,0 @@
9

View file

@ -1,34 +0,0 @@
Source: fluidsynth
Priority: optional
Section: sound
Maintainer: Rui Nuno Capela <rncbc@rncbc.org>
Build-Depends: debhelper (>= 5.0.0), cmake, pkg-config, libdb-dev, libjack-dev, libasound2-dev,
libsndfile-dev, libglib2.0-dev
Standards-Version: 3.7.2
Package: libfluidsynth1
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: FluidSynth is a real-time software synthesizer
FluidSynth is a real-time software synthesizer based on
the SoundFont 2 specifications.
Package: libfluidsynth-dev
Section: libdevel
Architecture: any
Depends: libfluidsynth1 (= ${source:Version})
Description: FluidSynth is a real-time software synthesizer
FluidSynth is a real-time software synthesizer based on
the SoundFont 2 specifications.
This package contains the header file required for compiling
hosts and plugins.
Package: fluidsynth
Section: sound
Architecture: any
Depends: libfluidsynth1 (= ${source:Version})
Description: FluidSynth is a real-time software synthesizer
FluidSynth is a real-time software synthesizer based on
the SoundFont 2 specifications.
This package contains the command-line utilities.

View file

@ -1,30 +0,0 @@
This package was debianized by Rui Nuno Capela <rncbc@rncbc.org> on
Mon, 25 Jun 2007 10:42:40 +0100.
It was downloaded from http://www.fluidsynth.org
Upstream Author: Rui Nuno Capela <rncbc@rncbc.org>
Copyright:
Copyright (C) 2003-2015, rncbc aka Rui Nuno Capela. All rights reserved.
License:
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The Debian packaging is (C) 2007-2013, Rui Nuno Capela <rncbc@rncbc.org> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.

View file

@ -1,2 +0,0 @@
debian/tmp/usr/bin/*
debian/tmp/usr/share/*

View file

@ -1,4 +0,0 @@
debian/tmp/usr/include/*
debian/tmp/usr/lib/*/*.so
debian/tmp/usr/lib/*/pkgconfig/*.pc
debian/tmp/usr/lib/*/cmake/fluidsynth/*.cmake

View file

@ -1 +0,0 @@
debian/tmp/usr/lib/*/lib*.so.*

View file

@ -1,98 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatibility version to use.
#export DH_COMPAT=7
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
config.status: CMakeLists.txt
dh_testdir
# Add here commands to configure the package.
cmake -DCMAKE_INSTALL_PREFIX=/usr .
build: build-stamp
build-stamp: config.status
dh_testdir
# Add here commands to compile the package.
$(MAKE)
# the build should fail if the tests are not successful
#$(MAKE) check
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
#-$(MAKE) distclean
dh_clean -a
install: build
dh_testdir
dh_testroot
dh_clean -k -a
dh_installdirs
# Add here commands to install the package into debian/tmp
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_install -a --list-missing
# dh_installchangelogs -a ChangeLog
# dh_installdocs -a
# dh_installexamples
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installinfo
# dh_installman
# dh_link
dh_strip -a
dh_compress -a
dh_fixperms -a
# dh_perl
# dh_python
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

View file

View file

@ -1,8 +0,0 @@
Format: 1.0
Source: fluidsynth
Version: 2.2.0-1
Binary: fluidsynth, libfluidsynth1, libfluidsynth-dev
Maintainer: Rui Nuno Capela <rncbc@rncbc.org>
Architecture: any
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 5.0.0), cmake (>= 3.13.0), pkg-config, libdb-dev, libjack-dev, libasound2-dev, libsndfile-dev, libglib2.0-dev

View file

@ -1,144 +0,0 @@
#
# spec file for package fluidsynth
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# fix build for older distros and architectures where _fillupdir is
# not yet defined by using the old path as recommended by
# https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25_fillupdir
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
Name: fluidsynth
Version: 2.2.2
Release: 0
Summary: A Real-Time Software Synthesizer That Uses Soundfont(tm)
License: LGPL-2.1-or-later
Group: Productivity/Multimedia/Sound/Midi
Url: http://www.fluidsynth.org/
Source: https://github.com/FluidSynth/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1000: baselibs.conf
BuildRequires: cmake >= 3.13.0
BuildRequires: gcc-c++
%if 0%{?is_opensuse}
BuildRequires: ladspa-devel
%endif
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(jack)
BuildRequires: pkgconfig(libinstpatch-1.0) >= 1.1.0
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(sndfile)
%if 0%{?suse_version}
%{?systemd_requires}
PreReq: %fillup_prereq
%endif
%description
FluidSynth (formerly IIWU Synth) is a real-time software synthesizer
based on the SoundFont(tm) 2 specifications. It can read MIDI events
from the MIDI input device and render them to the audio device. It
can also play MIDI files.
%package devel
Summary: Development package for the fluidsynth library
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libfluidsynth3 = %{version}
Provides: libfluidsynth-devel = %{version}
%description devel
This package contains the files needed to compile programs that use the
fluidsynth library.
%package -n libfluidsynth3
Summary: Library for Fluidsynth
Group: System/Libraries
%description -n libfluidsynth3
This package contains the shared library for Fluidsynth.
%prep
%setup -q
%build
%cmake \
-DFLUID_DAEMON_ENV_FILE=%{_fillupdir}/sysconfig.%{name} \
-Denable-lash=0
%cmake_build
%check
%cmake
%if 0%{?fedora_version} || 0%{?mageia}
%cmake_build --target check
%else
%cmake_build check
%endif
%install
%cmake_install
%if 0%{?suse_version}
# manually install systemd service files
install -Dm 644 build/fluidsynth.conf %{buildroot}%{_fillupdir}/sysconfig.%{name}
install -Dm 644 build/fluidsynth.service %{buildroot}%{_unitdir}/%{name}.service
install -d %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%pre
%service_add_pre %{name}.service
%post
%fillup_only
%service_add_post %{name}.service
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%endif
%post -n libfluidsynth3 -p /sbin/ldconfig
%postun -n libfluidsynth3 -p /sbin/ldconfig
%files
%license LICENSE
%doc AUTHORS ChangeLog README.md THANKS TODO
%{_mandir}/man?/*
%{_bindir}/*
%if 0%{?suse_version}
%{_unitdir}/%{name}.service
%{_sbindir}/rc%{name}
%{_fillupdir}/sysconfig.%{name}
%endif
%files devel
%{_libdir}/lib*.so
%dir %{_libdir}/cmake/%{name}
%{_libdir}/cmake/%{name}/*.cmake
%{_libdir}/pkgconfig/*.pc
%{_includedir}/*
%files -n libfluidsynth3
%{_libdir}/lib*.so.*
%changelog

View file

@ -27,25 +27,9 @@ if ( DOXYGEN_FOUND )
${DOXYGEN} Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
find_package ( LibXslt )
if ( LIBXSLT_XSLTPROC_EXECUTABLE )
add_custom_target ( doxygen_settings
${LIBXSLT_XSLTPROC_EXECUTABLE}
--output ${CMAKE_CURRENT_BINARY_DIR}/fluidsettings.txt
${CMAKE_CURRENT_SOURCE_DIR}/doxygen/fluidsettings.xsl
${CMAKE_CURRENT_SOURCE_DIR}/fluidsettings.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_dependencies(doxygen doxygen_settings)
endif ( LIBXSLT_XSLTPROC_EXECUTABLE )
endif ( DOXYGEN_FOUND )
if ( UNIX )
install ( FILES fluidsynth.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
DESTINATION ${MAN_INSTALL_DIR} )
endif ( UNIX )
add_subdirectory ( examples )

246
doc/Doxyfile Normal file
View file

@ -0,0 +1,246 @@
# Doxyfile 1.6
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = libfluidsynth
PROJECT_NUMBER = 2.1.0
OUTPUT_DIRECTORY = api
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" "The $name widget" "The $name file" is provides specifies contains represents a an the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH = ../
STRIP_FROM_INC_PATH = ../include/
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = NO
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = NO
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = NO
GENERATE_TESTLIST = NO
GENERATE_BUGLIST = NO
GENERATE_DEPRECATEDLIST = YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../doc/fluidsynth-v20-devdoc.txt ../include ../include/fluidsynth ../src
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c *.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = fluid_*.h
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = ../doc
EXAMPLE_PATTERNS = *.c
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_EXTRA_STYLESHEET = ../doc/doxy_formula.css
HTML_ALIGN_MEMBERS = YES
HTML_EXTRA_FILES = ../doc/fluidsettings.xml ../doc/fluidsettings.xsl
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = YES
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = __DOXYGEN__
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_FONTNAME = FreeSans
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = YES
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = YES

View file

@ -11,7 +11,7 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "Functions for" "Functions to" "The $name class" "The $name widget" "The $name file" is provides specifies contains represents a an the
ABBREVIATE_BRIEF = "The $name class" "The $name widget" "The $name file" is provides specifies contains represents a an the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
@ -24,9 +24,7 @@ MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES += startlifecycle{1}="\name Lifecycle Functions for \1\_linebr@{"
ALIASES += endlifecycle="@}"
ALIASES += setting{1}="\ref settings_\1"
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
@ -36,7 +34,7 @@ CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
SUBGROUPING = NO
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
@ -56,9 +54,9 @@ CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES
SORT_GROUP_NAMES = YES
SORT_MEMBER_DOCS = NO
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = NO
GENERATE_TESTLIST = NO
@ -67,6 +65,7 @@ GENERATE_DEPRECATEDLIST = YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
@ -83,27 +82,18 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = \
@CMAKE_SOURCE_DIR@/doc/fluidsynth-v20-devdoc.txt \
@CMAKE_SOURCE_DIR@/doc/recent_changes.txt \
@CMAKE_SOURCE_DIR@/doc/usage \
@CMAKE_SOURCE_DIR@/include \
@CMAKE_SOURCE_DIR@/include/fluidsynth \
@CMAKE_SOURCE_DIR@/src \
@CMAKE_BINARY_DIR@/include/fluidsynth \
@CMAKE_BINARY_DIR@/doc/fluidsettings.txt
INPUT = @CMAKE_SOURCE_DIR@/doc/fluidsynth-v20-devdoc.txt @CMAKE_SOURCE_DIR@/include @CMAKE_SOURCE_DIR@/include/fluidsynth @CMAKE_SOURCE_DIR@/src @CMAKE_BINARY_DIR@/include/fluidsynth
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c *.h *.txt
FILE_PATTERNS = *.c *.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = fluid_*.h
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc/examples
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc
EXAMPLE_PATTERNS = *.c
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = @CMAKE_SOURCE_DIR@/doc/images
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
@ -113,8 +103,8 @@ FILTER_SOURCE_FILES = NO
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = NO
@ -130,19 +120,11 @@ IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_EXTRA_FILES = \
@CMAKE_SOURCE_DIR@/doc/fluidsettings.xml \
@CMAKE_SOURCE_DIR@/doc/fluidsettings.xsl
# FluidSynth specific layout and style customizations.
# Comment the following four lines to return to the
# default doxygen styling and layout
LAYOUT_FILE = @CMAKE_SOURCE_DIR@/doc/doxygen/layout.xml
HTML_HEADER =
HTML_FOOTER = @CMAKE_SOURCE_DIR@/doc/doxygen/footer.html
HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/doc/doxygen/custom.css
# end FluidSynth styling and layout
HTML_HEADER =
HTML_FOOTER =
HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/doc/doxy_formula.css
HTML_ALIGN_MEMBERS = YES
HTML_EXTRA_FILES = @CMAKE_SOURCE_DIR@/doc/fluidsettings.xml @CMAKE_SOURCE_DIR@/doc/fluidsettings.xsl
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
@ -155,9 +137,9 @@ CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 1
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 350
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
@ -195,6 +177,8 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
@ -211,14 +195,12 @@ PERLMOD_MAKEVAR_PREFIX =
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = __DOXYGEN__ \
FLUIDSYNTH_API \
FLUID_DEPRECATED
PREDEFINED = __DOXYGEN__
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
@ -236,7 +218,7 @@ CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_FONTNAME =
DOT_FONTNAME = FreeSans
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES

Binary file not shown.

View file

@ -7,7 +7,7 @@ execute the following command in this doc/ directory:
$ make doxygen
The latest generated API HTML docs can also be found at:
https://www.fluidsynth.org/api/
http://www.fluidsynth.org/api/
Even more documentation references are provided on our wiki page:
https://github.com/FluidSynth/fluidsynth/wiki/Documentation

View file

@ -16,9 +16,8 @@ PWD=$(shell pwd)
CERBERO=$(PWD)/external/cerbero
OBOE=$(PWD)/external/oboe
CMAKE=cmake
JOBS=$(shell nproc)
ANDROID_NDK = $(PWD)/external/cerbero/build/android-ndk-21
ANDROID_NDK = $(PWD)/external/cerbero/build/android-ndk-18
ABIS_SIMPLE = x86 x86-64 armv7 arm64
@ -31,22 +30,22 @@ all: build
.PHONY: prepare
prepare: checkout-oboe checkout-cerbero
for abi in $(ABIS_SIMPLE) ; do \
cd $(CERBERO) && ./cerbero-uninstalled -c config/cross-android-$$abi.cbc bootstrap --jobs $(JOBS) && cd $(PWD) ; \
cd $(CERBERO) && ./cerbero-uninstalled -c config/cross-android-$$abi.cbc bootstrap && cd $(PWD) ; \
done
.PHONY: checkout-oboe
checkout-oboe: $(OBOE)
cd $(OBOE) && git checkout 1.5.0
cd $(OBOE) && git checkout 9bf3943
$(OBOE):
git clone https://github.com/Google/oboe.git $(OBOE)
.PHONY: checkout-cerbero
checkout-cerbero: $(CERBERO)
cd $(CERBERO) && git checkout e9f18b3b340de1648d885a0542d2f06c3fcfffe8
cd $(CERBERO) && git checkout 0acd9b0
$(CERBERO):
git clone https://github.com/falrm/cerbero.git $(CERBERO)
git clone https://github.com/atsushieno/cerbero.git $(CERBERO)
.PHONY: build
build: build-oboe dist-oboe build-deps-cerbero dist-deps-cerbero build-fluidsynth dist-fluidsynth build-fluidsynth-assetloader dist-fluidsynth-assetloader
@ -54,7 +53,7 @@ build: build-oboe dist-oboe build-deps-cerbero dist-deps-cerbero build-fluidsynt
.PHONY: build-deps-cerbero
build-deps-cerbero:
for abi in $(ABIS_SIMPLE) ; do \
cd $(CERBERO) && ./cerbero-uninstalled -c config/cross-android-$$abi.cbc build --jobs $(JOBS) glib libsndfile && cd $(PWD) ; \
cd $(CERBERO) && ./cerbero-uninstalled -c config/cross-android-$$abi.cbc build glib libsndfile && cd $(PWD) ; \
done
define run_make_abi_target
@ -105,11 +104,11 @@ build-fluidsynth-one:
-DCMAKE_TOOLCHAIN_FILE=$(ANDROID_NDK)/build/cmake/android.toolchain.cmake \
-Denable-opensles=on -Denable-oboe=on -Denable-oss=off -Denable-libsndfile=on \
-DANDROID_NATIVE_API_LEVEL=android-27 -DANDROID_PLATFORM=android-27 -DANDROID_ABI=$(A_ABI) ../../../.. && \
make -j$(JOBS)
make
build-oboe-one:
mkdir -p $(OBOE)/build/$(A_ABI) && cd $(OBOE)/build/$(A_ABI) && \
$(CMAKE) -DCMAKE_TOOLCHAIN_FILE=$(ANDROID_NDK)/build/cmake/android.toolchain.cmake -DANDROID_ABI=$(A_ABI) -DANDROID_NATIVE_API_LEVEL=android-27 -DANDROID_PLATFORM=android-27 -DBUILD_SHARED_LIBS=on ../.. && make -j$(JOBS)
$(CMAKE) -DCMAKE_TOOLCHAIN_FILE=$(ANDROID_NDK)/build/cmake/android.toolchain.cmake -DANDROID_ABI=$(A_ABI) -DANDROID_NATIVE_API_LEVEL=android-27 -DANDROID_PLATFORM=android-27 -DBUILD_SHARED_LIBS=on ../.. && make
cp oboe-1.0.pc $(OBOE)/build/$(A_ABI)
dist-oboe-one:

View file

@ -2,8 +2,6 @@
Fluidsynth supports Android audio outputs by Oboe and OpenSLES audio drivers.
If you are new to Fluidsynth on Android, check out [Hector Ricardo's Hello World App for Android](https://medium.com/swlh/creating-a-fluidsynth-hello-world-app-for-android-5e112454a8eb).
Android also has Android MIDI API which is exposed only in Android Java API, but it is not exposed as a native API, therefore there is no `mdriver` support for Android. There is an example MidiDeviceService implementation for Fluidsynth at: https://github.com/atsushieno/fluidsynth-midi-service-j
## Usage
@ -33,8 +31,8 @@ There is [an example source code](https://github.com/atsushieno/fluidsynth-midi-
## Building
In this directory the Cerbero build system is (ab)used for cross-compiling Fluidsynth's dependencies for Android. The entrypoint is `Makefile.android`. If you are looking for a step by step introduction guide for cross-compiling Fluidsynth, [you'll find it in the wiki](https://github.com/FluidSynth/fluidsynth/wiki/BuildingForAndroid).
By default, you are supposed to provide `PKG_CONFIG_PATH` to glib etc. as well as oboe. There is nothing special.
However, in reality, Oboe does not come up with an official package specification, so you will have to create it manually... unless you use `oboe-1.0.pc` in this directory as well as the build system set up here.
There are "non-normative" build scripts i.e. `Makefile.android` and a couple of helper files in this directory. In case you don't have any dependencies such as glib for Android, then it would be helpful.

View file

@ -11,7 +11,7 @@ target_compile_options ( fluidsynth-assetloader
PRIVATE -Wall
PRIVATE "$<$<CONFIG:DEBUG>:-Werror>") # Only include -Werror when building debug config
target_include_directories ( fluidsynth-assetloader PRIVATE ../../../include )
include_directories ( ../../../include )
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L../../../dist/${ANDROID_ABI} -lfluidsynth" )

View file

@ -83,7 +83,7 @@ int asset_close(void *handle)
return 0;
}
fluid_long_long_t asset_tell(void *handle)
long asset_tell(void *handle)
{
AAsset *asset;
@ -91,7 +91,7 @@ fluid_long_long_t asset_tell(void *handle)
return AAsset_getLength(asset) - AAsset_getRemainingLength(asset);
}
int asset_seek(void *handle, fluid_long_long_t offset, int origin)
int asset_seek(void *handle, long offset, int origin)
{
AAsset *asset;
@ -99,7 +99,7 @@ int asset_seek(void *handle, fluid_long_long_t offset, int origin)
return AAsset_seek (asset, (off_t) offset, origin);
}
int asset_read(void *buf, fluid_long_long_t count, void *handle)
int asset_read(void *buf, int count, void *handle)
{
AAsset *asset;

View file

@ -34,9 +34,9 @@ void Java_fluidsynth_androidextensions_NativeHandler_setAssetManagerContext(JNIE
void *asset_open(const char *path);
int asset_close(void *handle);
fluid_long_long_t asset_tell(void *handle);
int asset_seek(void *handle, fluid_long_long_t offset, int origin);
int asset_read(void *buf, fluid_long_long_t count, void *handle);
long asset_tell(void *handle);
int asset_seek(void *handle, long offset, int origin);
int asset_read(void *buf, int count, void *handle);
#ifdef __cplusplus
} /* extern "C" */

12
doc/doxy_formula.css Normal file
View file

@ -0,0 +1,12 @@
code {
background-color: #eeeeee;
text-shadow: none;
color: black;
margin-left: 4px;
margin-right: 4px;
padding-left: 4px;
padding-right: 4px;
border-radius: 3px;
white-space: nowrap;
}

View file

@ -1,282 +0,0 @@
body
{
background: #eee;
}
#titlearea
{
background: white;
}
*
{
text-shadow: none !important;
}
/* Reduce width of main content for more readability */
div.contents,
div.header
{
max-width: 60em;
background: white;
margin: 0;
padding: 1em;
}
#titlearea
{
border: 0;
}
div.headertitle
{
padding-left: 0;
}
/* Hide permalink icon in front of method name and make whole name clickable
* instead (by invisibly streting the permalink over the title). Not ideal,
* as the name can't be selected anymore, but better than the distracting
* icon. */
span.permalink
{
display: block;
position: relative;
font-size: unset;
}
span.permalink a {
position: absolute;
width: 100%;
opacity: 0;
}
/* Hide "libfluidsynth" root node of nav tree */
#nav-tree-contents > ul > li:first-child > .item > .label,
#nav-tree-contents > ul > li:first-child > .item > a
{
display: none;
}
#nav-tree,
#side-nav
{
background: #333;
}
#nav-tree .label a {
color: #fff;
}
#nav-tree .selected {
background: #666;
}
#side-nav {
width: 350px;
}
.ui-resizable-e {
background: #ddd;
}
#nav-sync {
display: none;
}
@media (max-width: 767px) {
#side-nav {
display: none !important;
}
#doc-content {
margin-left: 0 !important;
height: auto !important;
width: auto !important;
}
#MSearchBox {
display: none !important;
}
}
.sm-dox a:hover {
color: black !important;
}
#nav-tree,
div.header,
.ui-resizable-e,
.sm-dox,
.navpath ul,
.memtitle,
.sm-dox a,
.fieldtable th
{
background-image: none !important;
}
#main-nav {
background: #DFE5F1;
}
.memitem,
.memproto,
.memdoc,
.memtitle,
dl.reflist dd,
dl.reflist dt
{
box-shadow: none;
text-shadow: none;
border-right: none;
border-bottom: none;
border-bottom-left-radius: 0;
background-image: none;
border-color: #DFE5F1;
}
.memtitle,
dl.reflist dt
{
width: 100%;
box-sizing: border-box;
background: #DFE5F1;
border: 0;
}
.memproto {
background: #fafafa;
border-bottom: 1px solid #DFE5F1;
border-right: 1px solid #DFE5F1;
}
.mdescLeft,
.mdescRight,
.memItemLeft,
.memItemRight,
.memTemplItemLeft,
.memTemplItemRight,
.memTemplParams
{
background: none;
}
.memSeparator {
}
dl.reflist {
padding: 0;
}
dl.reflist dd {
margin-bottom: 1.5em;
padding: 1em;
}
code {
background-color: #eeeeee;
text-shadow: none;
color: black;
margin-left: 4px;
margin-right: 4px;
padding-left: 4px;
padding-right: 4px;
border-radius: 3px;
white-space: nowrap;
}
table.fieldtable,
table.fieldtable td,
table.fieldtable th
{
box-shadow: none;
text-shadow: none;
border-radius: 0;
border-color: #DFE5F1 !important;
}
div.fragment {
padding: 5px;
}
div.fragment .line {
line-height: 1.4;
}
.memdoc dl {
padding-left: 0;
}
dl.note {
margin-left: -10px;
padding-left: 5px;
border-left: 5px solid;
border-color: lightblue;
}
dl.deprecated {
margin-left: -10px;
padding-left: 5px;
border-left: 5px solid;
border-color: orange;
}
dl.warning {
margin-left: -10px;
padding-left: 5px;
border-left: 5px solid;
border-color: red;
}
table.directory .arrow {
height: inherit;
}
table.directory tr td {
padding: 0.4em 6px;
}
table.directory td.desc {
border: 0;
}
table.directory tr.even {
background-color: inherit;
}
table.directory tr {
border-bottom: 1px solid #eee;
}
.image img,
.image object
{
width: 100%;
height: auto;
}
.setting-item {
border-left: 1px solid #DFE5F1;
padding-bottom: 0.5em;
border-top-left-radius: 4px;
}
.setting-item h1 {
width: 100%;
padding: 0.3em 0 0.3em 10px;
box-sizing: border-box;
background: #DFE5F1;
border: 0;
font-size: 1.5em;
font-weight: normal;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
.setting-item dl,
.setting-item p {
margin-left: 10px;
}

View file

@ -1,94 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" omit-xml-declaration="yes" indent="no"/>
<!-- main template -->
<xsl:template match="/fluidsettings">
/*!
\page fluidsettings Settings Reference
<xsl:apply-templates match="*" mode="PageRef">
<xsl:sort select="@label"/>
</xsl:apply-templates>
<xsl:apply-templates match="*" mode="Page">
<xsl:sort select="@label"/>
</xsl:apply-templates>
*/
</xsl:template>
<!-- Page reference template -->
<xsl:template match="*" mode="PageRef">
- \subpage <xsl:value-of select="concat('settings_', name(.), ' ', @label)"/>
</xsl:template>
<!-- Page template -->
<xsl:template match="*" mode="Page">
\page <xsl:value-of select="concat('settings_', name(.), ' ', @label)"/>
<xsl:apply-templates match="*" mode="Setting">
<xsl:sort select="name(..)" />
</xsl:apply-templates>
</xsl:template>
<!-- Setting template -->
<xsl:template match="*" mode="Setting">
\htmlonly
<div class="setting-item">
\endhtmlonly
\section <xsl:value-of select="concat('settings_', name(..), '_', translate(name, '.', '_'))" /><xsl:text> </xsl:text><xsl:value-of select="concat(name(..), '.', name)" />
<xsl:text>&#xa;</xsl:text>
\par Type
<xsl:choose>
<xsl:when test="type = 'bool'">Boolean (int)</xsl:when>
<xsl:when test="type = 'int'">Integer (int)</xsl:when>
<xsl:when test="type = 'str'">
<xsl:choose>
<xsl:when test="vals">Selection (str)</xsl:when>
<xsl:otherwise>String (str)</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="type = 'num'">Float (num)</xsl:when>
<xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="type = 'str' and vals">\par Options
<xsl:value-of select="vals" /></xsl:when>
<xsl:when test="type = 'bool'">\par Values
0, 1</xsl:when>
<xsl:when test="min or max">\par Min - Max
<xsl:value-of select="min" /> - <xsl:value-of select="max" /></xsl:when>
</xsl:choose>
\par Default
\htmlonly
<xsl:copy-of select="def" />
\endhtmlonly
<xsl:if test="realtime">
\par Real-time
<xsl:choose>
<xsl:when test="realtime/text()">
\htmlonly
<xsl:copy-of select="realtime" />
\endhtmlonly
</xsl:when>
<xsl:otherwise>This setting can be changed during runtime of the synthesizer.</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="deprecated">
\deprecated This setting is deprecated and might be removed in a future version of FluidSynth.
</xsl:if>
\htmlonly
<xsl:copy-of select="desc"/>
\endhtmlonly
\htmlonly
</div>
\endhtmlonly
</xsl:template>
</xsl:stylesheet>

View file

@ -1,2 +0,0 @@
</body>
</html>

View file

@ -1,199 +0,0 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.13 -->
<!-- Navigation index tabs for HTML output -->
<!-- FluidSynth related changes in this file compared to default layout:
- Custom title and intro for <navindev><tab type="modules">
- <membergroups> moved in front of <functions> in group layout so that we can change
constructors and destructors before all other functions
-->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="API Reference" intro="Reference of the FluidSynth API separated into functional groups."/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<membergroups visible="yes"/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View file

@ -19,64 +19,40 @@
#if defined(WIN32)
#include <windows.h>
#define sleep(_t) Sleep(_t * 1000)
#include <process.h>
#define getpid _getpid
#else
#include <stdlib.h>
#include <unistd.h>
#endif
int main(int argc, char **argv)
{
fluid_settings_t *settings = NULL;
fluid_synth_t *synth = NULL;
fluid_audio_driver_t *adriver = NULL;
fluid_settings_t *settings;
fluid_synth_t *synth;
fluid_audio_driver_t *adriver;
int sfont_id;
int i, key;
/* Create the settings. */
settings = new_fluid_settings();
if(settings == NULL)
{
puts("Failed to create the settings!");
goto err;
}
/* Change the settings if necessary*/
/* Create the synthesizer. */
synth = new_fluid_synth(settings);
if(synth == NULL)
{
puts("Failed to create the synth!");
goto err;
}
/* Load a SoundFont and reset presets (so that new instruments
* get used from the SoundFont)
* Depending on the size of the SoundFont, this will take some time to complete...
*/
sfont_id = fluid_synth_sfload(synth, "example.sf2", 1);
if(sfont_id == FLUID_FAILED)
{
puts("Loading the SoundFont failed!");
goto err;
}
/* Create the audio driver. The synthesizer starts playing as soon
as the driver is created. */
adriver = new_fluid_audio_driver(settings, synth);
if(adriver == NULL)
{
puts("Failed to create the audio driver!");
goto err;
}
/* Load a SoundFont and reset presets (so that new instruments
* get used from the SoundFont) */
sfont_id = fluid_synth_sfload(synth, "example.sf2", 1);
/* Initialize the random number generator */
srand(getpid());
for(i = 0; i < 12; i++)
{
/* Generate a random key */
key = 60 + (int)(12.0f * rand() / (float) RAND_MAX);
@ -90,7 +66,6 @@ int main(int argc, char **argv)
fluid_synth_noteoff(synth, 0, key);
}
err:
/* Clean up */
delete_fluid_audio_driver(adriver);
delete_fluid_synth(synth);

View file

@ -1,30 +0,0 @@
# FluidSynth - A Software Synthesize
#
# Copyright (C) 2003-2010 Peter Hanappe and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307, USA
# CMake based build system. Pedro Lopez-Cabanillas <plcl@users.sf.net>
include ( FluidUnitTest )
add_custom_target ( demo )
ADD_FLUID_DEMO ( example )
ADD_FLUID_DEMO ( fluidsynth_arpeggio )
ADD_FLUID_DEMO ( fluidsynth_fx )
ADD_FLUID_DEMO ( fluidsynth_metronome )
ADD_FLUID_DEMO ( fluidsynth_simple )

View file

@ -11,14 +11,13 @@ NOTE: You're not expected to look at this raw XML file. Please open it in a webb
https://stackoverflow.com/a/3839054
https://stackoverflow.com/a/6251757
Developers:
- Settings can be deprecated by adding: <deprecated>SOME TEXT</deprecated>
- Real-time settings can be marked with <realtime>SOME OPTIONAL TEXT</realtime>.
Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</deprecated>
-->
<?xml-stylesheet type="text/xsl" href="fluidsettings.xsl"?>
<fluidsettings>
<synth label="Synthesizer settings">
<synth>
<setting>
<isFirst>Synthesizer settings</isFirst>
<name>audio-channels</name>
<type>int</type>
<def>1</def>
@ -40,27 +39,24 @@ Developers:
<name>chorus.active</name>
<type>bool</type>
<def>1 (TRUE)</def>
<realtime/>
<desc>
When set to 1 (TRUE) the chorus effects module is activated. Otherwise, no chorus will be added to the output signal. Note that the amount of signal sent to the chorus module depends on the "chorus send" generator defined in the SoundFont.</desc>
</setting>
<setting>
<name>chorus.depth</name>
<type>num</type>
<def>8.0</def>
<min>0.0</min>
<max>256.0</max>
<realtime/>
<def>8</def>
<min>0</min>
<max>256</max>
<desc>
Specifies the modulation depth of the chorus.</desc>
</setting>
<setting>
<name>chorus.level</name>
<type>num</type>
<def>2.0</def>
<min>0.0</min>
<max>10.0</max>
<realtime/>
<def>2</def>
<min>0</min>
<max>10</max>
<desc>
Specifies the output amplitude of the chorus signal.</desc>
</setting>
@ -70,7 +66,6 @@ Developers:
<def>3</def>
<min>0</min>
<max>99</max>
<realtime/>
<desc>
Sets the voice count of the chorus.</desc>
</setting>
@ -79,8 +74,7 @@ Developers:
<type>num</type>
<def>0.3</def>
<min>0.1</min>
<max>5.0</max>
<realtime/>
<max>5</max>
<desc>
Sets the modulation speed in Hz.</desc>
</setting>
@ -91,9 +85,7 @@ Developers:
<min>1</min>
<max>256</max>
<desc>
Sets the number of synthesis CPU cores. If set to a value greater than 1, additional synthesis threads will be created to do the actual rendering work that is then returned synchronously by the render function. This has the affect of utilizing more of the total CPU for voices or decreasing render times when synthesizing audio.
So for example, if you set cpu-cores to 4, fluidsynth will attempt to split the synthesis work it needs to do between the client's calling thread and three additional (internal) worker threads. As soon as all threads have done their work, their results are collected and the resulting buffer is returned to the caller.
</desc>
Sets the number of synthesis CPU cores. If set to a value greater than 1, then additional synthesis threads will be created to take advantage of a multi CPU or CPU core system. This has the affect of utilizing more of the total CPU for voices or decreasing render times when synthesizing audio to a file.</desc>
</setting>
<setting>
<name>default-soundfont</name>
@ -109,16 +101,16 @@ Developers:
<def>0</def>
<min>0</min>
<max>126</max>
<realtime/>
<desc>
Device identifier used for SYSEX commands, such as MIDI Tuning Standard commands. Fluidsynth will only process those SYSEX commands destined for this ID. Broadcast commands (with ID=127) will always be processed.</desc>
Device identifier used for SYSEX commands, such as MIDI Tuning Standard commands. Only those SYSEX commands destined for this ID or to all devices will be acted upon.</desc>
</setting>
<setting>
<name>dynamic-sample-loading</name>
<type>bool</type>
<def>0 (FALSE)</def>
<desc>
When set to 1 (TRUE), samples are loaded to and unloaded from memory whenever presets are being selected or unselected for a MIDI channel. PROGRAM_CHANGE and PROGRAM_SELECT events are typically responsible for this.
When set to 1 (TRUE), samples are loaded to and unloaded from memory
on demand.
</desc>
</setting>
<setting>
@ -127,7 +119,7 @@ Developers:
<def>2</def>
<min>2</min>
<max>2</max>
<desc>Specifies the number of effects per effects group. Currently this value can not be changed so there are always two effects per group available (reverb and chorus).</desc>
<desc>Specifies the number of effects per group. Currently there only are two effects (i.e. reverb and chorus).</desc>
</setting>
<setting>
<name>effects-groups</name>
@ -135,7 +127,7 @@ Developers:
<def>1</def>
<min>1</min>
<max>128</max>
<desc>Specifies the number of effects groups. By default, the sound of all voices is rendered by one reverb and one chorus effect respectively (even for multi-channel rendering). This setting gives the user control which effects of a voice to render to which independent audio channels. E.g. setting synth.effects-groups == synth.midi-channels allows to render the effects of each MIDI channel to separate audio buffers. If synth.effects-groups is smaller than the number of MIDI channels, it will wrap around. Note that any value >1 will significantly increase CPU usage.</desc>
<desc>Specifies the number of effect units. By default, the sound of all voices is rendered by one reverb unit and one chorus unit respectively (even for multi-channel rendering). This setting gives the user control which effects of a voice to render to which independent audio channels. E.g. setting synth.effects-groups == synth.midi-channels allows to render the effects of each MIDI channel to separate audio buffers. If synth.effects-groups is smaller, it will wrap around. Note that any value >1 will significantly increase CPU usage.</desc>
</setting>
<setting>
<name>gain</name>
@ -143,7 +135,6 @@ Developers:
<def>0.2</def>
<min>0.0</min>
<max>10.0</max>
<realtime/>
<desc>The gain is applied to the final or master output of the synthesizer. It is set to a low value by default to avoid the saturation of the output when many notes are played.</desc>
</setting>
<setting>
@ -151,7 +142,7 @@ Developers:
<type>bool</type>
<def>0 (FALSE)</def>
<desc>
When set to 1 (TRUE) the LADSPA subsystem will be enabled. This subsystem allows to load and interconnect LADSPA plug-ins. The output of the synthesizer is processed by the LADSPA subsystem. Note that the synthesizer has to be compiled with LADSPA support. More information about the LADSPA subsystem can be found in doc/ladspa.md or on the FluidSynth website.</desc>
When set to "yes" the LADSPA subsystem will be enabled. This subsystem allows to load and interconnect LADSPA plug-ins. The output of the synthesizer is processed by the LADSPA subsystem. Note that the synthesizer has to be compiled with LADSPA support. More information about the LADSPA subsystem later.</desc>
</setting>
<setting>
<name>lock-memory</name>
@ -173,12 +164,12 @@ Developers:
<name>midi-bank-select</name>
<type>str</type>
<def>gs</def>
<vals>gs, gm, xg, mma</vals>
<vals>gm, gs, xg, mma</vals>
<desc>
This setting defines how the synthesizer interprets Bank Select messages.
<ul>
<li>gs: (default) CC0 becomes the bank number, CC32 is ignored.</li>
<li>gm: ignores CC0 and CC32 messages.</li>
<li>gs: (default) CC0 becomes the bank number, CC32 is ignored.</li>
<li>xg: CC32 becomes the bank number, CC0 toggles between melodic or drum channel.</li>
<li>mma: bank is calculated as CC0*128+CC32.</li>
</ul>
@ -196,10 +187,9 @@ Developers:
<setting>
<name>overflow.age</name>
<type>num</type>
<def>1000.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<def>1000</def>
<min>-10000</min>
<max>10000</max>
<desc>
This score is divided by the number of seconds this voice has been
active and is added to the overflow priority. It is usually a positive
@ -210,10 +200,9 @@ Developers:
<setting>
<name>overflow.important</name>
<type>num</type>
<def>5000.0</def>
<min>-50000.0</min>
<max>50000.0</max>
<realtime/>
<def>5000</def>
<min>-50000</min>
<max>50000</max>
<desc>
This score is added to voices on channels marked with the
synth.overflow.important-channels setting.
@ -222,8 +211,7 @@ Developers:
<setting>
<name>overflow.important-channels</name>
<type>str</type>
<def>(empty string)</def>
<realtime/>
<def>""</def>
<desc>
This setting is a comma-separated list of MIDI channel numbers that should
be treated as "important" by the overflow calculation, adding the score
@ -237,10 +225,9 @@ Developers:
<setting>
<name>overflow.percussion</name>
<type>num</type>
<def>4000.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<def>4000</def>
<min>-10000</min>
<max>10000</max>
<desc>
Sets the overflow priority score added to voices on a percussion
channel. This is usually a positive score, to give percussion voices
@ -251,10 +238,9 @@ Developers:
<setting>
<name>overflow.released</name>
<type>num</type>
<def>-2000.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<def>-2000</def>
<min>-10000</min>
<max>10000</max>
<desc>
Sets the overflow priority score added to voices that have already
received a note-off event. This is usually a negative score, to give released
@ -265,10 +251,9 @@ Developers:
<setting>
<name>overflow.sustained</name>
<type>num</type>
<def>-1000.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<def>-1000</def>
<min>-10000</min>
<max>10000</max>
<desc>
Sets the overflow priority score added to voices that are currently
sustained. With the default value, sustained voices are considered less
@ -278,10 +263,9 @@ Developers:
<setting>
<name>overflow.volume</name>
<type>num</type>
<def>500.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<def>500</def>
<min>-10000</min>
<max>10000</max>
<desc>
Sets the overflow priority score added to voices based on their current
volume. The voice volume is normalized to a value between 0 and 1 and
@ -296,7 +280,6 @@ Developers:
<def>256</def>
<min>1</min>
<max>65535</max>
<realtime/>
<desc>
The polyphony defines how many voices can be played in parallel. A note event produces one or more voices. Its good to set this to a value which the system can handle and will thus limit FluidSynth's CPU usage. When FluidSynth runs out of voices it will begin terminating lower priority voices for new note events.</desc>
</setting>
@ -304,7 +287,6 @@ Developers:
<name>reverb.active</name>
<type>bool</type>
<def>1 (TRUE)</def>
<realtime/>
<desc>
When set to 1 (TRUE) the reverb effects module is activated. Otherwise, no reverb will be added to the output signal. Note that the amount of signal sent to the reverb module depends on the "reverb send" generator defined in the SoundFont.
</desc>
@ -312,10 +294,9 @@ Developers:
<setting>
<name>reverb.damp</name>
<type>num</type>
<def>0.0</def>
<min>0.0</min>
<max>1.0</max>
<realtime/>
<def>0</def>
<min>0</min>
<max>1</max>
<desc>
Sets the amount of reverb damping.</desc>
</setting>
@ -323,9 +304,8 @@ Developers:
<name>reverb.level</name>
<type>num</type>
<def>0.9</def>
<min>0.0</min>
<max>1.0</max>
<realtime/>
<min>0</min>
<max>1</max>
<desc>
Sets the reverb output amplitude.</desc>
</setting>
@ -333,9 +313,8 @@ Developers:
<name>reverb.room-size</name>
<type>num</type>
<def>0.2</def>
<min>0.0</min>
<max>1.0</max>
<realtime/>
<min>0</min>
<max>1</max>
<desc>
Sets the room size (i.e. amount of wet) reverb.</desc>
</setting>
@ -343,9 +322,8 @@ Developers:
<name>reverb.width</name>
<type>num</type>
<def>0.5</def>
<min>0.0</min>
<max>100.0</max>
<realtime/>
<min>0</min>
<max>100</max>
<desc>
Sets the stereo spread of the reverb signal.</desc>
</setting>
@ -356,7 +334,7 @@ Developers:
<min>8000.0</min>
<max>96000.0</max>
<desc>
The sample rate of the audio generated by the synthesizer. For optimal performance, make sure this value equals the native output rate of the audio driver (in case you are using any of fluidsynth's audio drivers). Some drivers, such as Oboe, will interpolate sample-rates, whereas others, such as Jack, will override this setting, if a mismatch with the native output rate is detected.
The sample rate of the audio generated by the synthesizer.
</desc>
</setting>
<setting>
@ -376,18 +354,20 @@ Developers:
</desc>
</setting>
</synth>
<audio label="Audio driver settings">
<audio>
<setting>
<isFirst>Audio driver settings</isFirst>
<name>driver</name>
<type>str</type>
<def>alsa (Linux),<br />
<def>jack (Linux),<br />
dsound (Windows),<br />
sndman (MacOS9),<br />
coreaudio (Mac OS X),<br />
dart (OS/2)
</def>
<vals>alsa, coreaudio, dart, dsound, file, jack, oboe, opensles, oss, portaudio, pulseaudio, sdl2, sndman, wasapi, waveout</vals>
<vals>alsa, coreaudio, dart, dsound, file, jack, oss, portaudio, pulseaudio, sdl2, sndman, waveout</vals>
<desc>
The audio system to be used. In order to use sdl2 as audio driver, the application is responsible for initializing SDL's audio subsystem.<br /><br /><strong>Note:</strong> sdl2 and waveout are available since fluidsynth 2.1.
</desc>
@ -395,8 +375,8 @@ Developers:
<setting>
<name>periods</name>
<type>int</type>
<def>8 (Windows, MacOS9),<br />
16 (all other)
<def>16 (Linux, Mac OS X),<br />
8 (Windows)
</def>
<min>2</min>
<max>64</max>
@ -407,13 +387,13 @@ Developers:
<setting>
<name>period-size</name>
<type>int</type>
<def>512 (Windows),<br />
64 (all other)
<def>64 (Linux, Mac OS X),<br />
512 (Windows)
</def>
<min>64</min>
<max>8192</max>
<desc>
This is the number of audio samples most audio drivers will request from the synth at one time. In other words, it's the amount of samples the synth is allowed to render in one go when no state changes (events) are about to happen. Because of that, specifying too big numbers here may cause MIDI events to be poorly quantized (=untimed) when a MIDI driver or the synth's API directly is used, as fluidsynth cannot determine when those events are to arrive. This issue does not matter, when using the MIDI player or the MIDI sequencer, because in this case, fluidsynth does know when events will be received.
The size of the audio buffers (in frames).
</desc>
</setting>
<setting>
@ -423,7 +403,7 @@ Developers:
<min>0</min>
<max>99</max>
<desc>
Sets the realtime scheduling priority of the audio synthesis thread. This includes the synthesis threads created by the synth (in case synth.cpu-cores was greater 1). A value of 0 disables high priority scheduling. Linux is the only platform which currently makes use of different priority levels as specified by this setting. On other operating systems the thread priority is set to maximum. Drivers which use this option: alsa, oss and pulseaudio
Sets the realtime scheduling priority of the audio synthesis thread (0 disables high priority scheduling). Linux is the only platform which currently makes use of different priority levels. Drivers which use this option: alsa, oss and pulseaudio
</desc>
</setting>
<setting>
@ -452,32 +432,6 @@ Developers:
Selects the CoreAudio device to use.
</desc>
</setting>
<setting>
<name>coreaudio.channel-map</name>
<type>str</type>
<def>(empty string)</def>
<desc>
This setting is a comma-separated integer list that maps fluidsynth mono-channels
to CoreAudio device output channels. Each position in the list represents the output channel
of the CoreAudio device.
The value of each position indicates the zero-based index of the fluidsynth
output mono-channel to route there (i.e. the buffer index used for fluid_synth_process()).
Additionally, the special value of -1 will turn off an output.
<br /><br />
For example, the default map for a single stereo output is "0,1". A value of "0,0" will
copy the left channel to the right, a value of "1,0" will flip left and right, and a
value of "-1,1" will play only the right channel.
<br /><br />
With a six-channel output device, and the synth.audio-channels and synth.audio-groups
settings both set to "2", a channel map of "-1,-1,0,1,2,3" will result in notes from odd
MIDI channels (audible on the first stereo channel, i.e. mono-indices 0,1) being sent to
outputs 3 and 4, and even MIDI channels (audible on the second stereo channel, i.e. mono-indices 2,3)
being sent to outputs 5 and 6.
<br /><br />
If the list specifies less than the number of available outputs channels, outputs
beyond those specified will maintain the default channel mapping given by the CoreAudio driver.
</desc>
</setting>
<setting>
<name>dart.device</name>
<type>str</type>
@ -568,7 +522,7 @@ Developers:
<setting>
<name>jack.server</name>
<type>str</type>
<def>(empty string)</def>
<def></def>
<desc>
Jack server to connect to. Defaults to an empty string, which uses default Jack server.
</desc>
@ -583,15 +537,6 @@ Developers:
Request an audio device identified device using an ID as pointed out by Oboe's documentation.
</desc>
</setting>
<setting>
<name>oboe.sample-rate-conversion-quality</name>
<type>str</type>
<def>None</def>
<vals>None, Fastest, Low, Medium, High, Best</vals>
<desc>
Sets the sample-rate conversion quality as pointed out by Oboe's documentation.
</desc>
</setting>
<setting>
<name>oboe.sharing-mode</name>
<type>str</type>
@ -610,15 +555,6 @@ Developers:
Sets the performance mode as pointed out by Oboe's documentation.
</desc>
</setting>
<setting>
<name>oboe.error-recovery-mode</name>
<type>str</type>
<def>Reconnect</def>
<vals>Reconnect, Stop</vals>
<desc>
Sets the error recovery mode when audio device error such as earphone disconnection occurred. It reconnects by default (same as OpenSLES behavior), but can be stopped if Stop is specified.
</desc>
</setting>
<setting>
<name>oss.device</name>
<type>str</type>
@ -627,30 +563,6 @@ Developers:
Device to use for OSS audio output.
</desc>
</setting>
<setting>
<name>pipewire.media-category</name>
<type>str</type>
<def>Playback</def>
<desc>
The media category to use. This value will be passed to <code>PW_KEY_MEDIA_CATEGORY</code>, see Pipewire documentation for valid values.
</desc>
</setting>
<setting>
<name>pipewire.media-role</name>
<type>str</type>
<def>Music</def>
<desc>
The media role to use. This value will be passed to <code>PW_KEY_MEDIA_ROLE</code>, see Pipewire documentation for valid values.
</desc>
</setting>
<setting>
<name>pipewire.media-type</name>
<type>str</type>
<def>Audio</def>
<desc>
The media type to use. This value will be passed to <code>PW_KEY_MEDIA_TYPE</code>, see Pipewire documentation for valid values.
</desc>
</setting>
<setting>
<name>portaudio.device</name>
<type>str</type>
@ -691,42 +603,11 @@ Developers:
Server to use for PulseAudio driver output.
</desc>
</setting>
<setting>
<name>sdl2.device</name>
<type>str</type>
<def>default</def>
<desc>
Device to use for SDL2 driver output.
</desc>
</setting>
<setting>
<name>wasapi.device</name>
<type>str</type>
<def>default</def>
<desc>
Device to use for WASAPI driver output.
</desc>
</setting>
<setting>
<name>wasapi.exclusive-mode</name>
<type>bool</type>
<def>0 (FALSE)</def>
<desc>
By default, WASAPI will operate in shared mode. Set it to 1 (TRUE) to use WASAPI in exclusive mode. In this mode, you'll benefit from direct soundcard access via kernel streaming, which has an extremely low latency. However, you must pay close attention to other settings, such as synth.sample-rate and audio.sample-format as your soundcard may not accept any possible sample configuration.
</desc>
</setting>
<setting>
<name>waveout.device</name>
<type>str</type>
<def>default</def>
<desc>
Device to use for WaveOut driver output.
</desc>
</setting>
</audio>
<midi label="MIDI driver settings">
<midi>
<setting>
<isFirst>MIDI driver settings</isFirst>
<name>autoconnect</name>
<type>bool</type>
<def>0 (FALSE)</def>
@ -754,20 +635,20 @@ Developers:
<setting>
<name>portname</name>
<type>str</type>
<def>(empty string)</def>
<def></def>
<desc>Used by coremidi and alsa_seq drivers for the portnames registered with the MIDI subsystem.</desc>
</setting>
<setting>
<name>alsa.device</name>
<type>str</type>
<def>default</def>
<desc>ALSA MIDI hardware device to use for RAW ALSA MIDI driver (not to be confused with the MIDI port).</desc>
<desc>ALSA MIDI device to use for RAW ALSA MIDI driver.</desc>
</setting>
<setting>
<name>alsa_seq.device</name>
<type>str</type>
<def>default</def>
<desc>ALSA sequencer hardware device to use for ALSA sequencer driver (not to be confused with the MIDI port).</desc>
<desc>ALSA sequencer device to use for ALSA sequencer driver.</desc>
</setting>
<setting>
<name>alsa_seq.id</name>
@ -784,7 +665,7 @@ Developers:
<setting>
<name>jack.server</name>
<type>str</type>
<def>(empty string)</def>
<def></def>
<desc>Jack server to connect to for Jack MIDI driver. If an empty string then the default server will be used.</desc>
</setting>
<setting>
@ -797,23 +678,23 @@ Developers:
<name>oss.device</name>
<type>str</type>
<def>/dev/midi</def>
<desc>The hardware device to use for OSS MIDI driver (not to be confused with the MIDI port).</desc>
<desc>Device to use for OSS MIDI driver.</desc>
</setting>
<setting>
<name>winmidi.device</name>
<type>str</type>
<def>default</def>
<desc>The hardware device to use for Windows MIDI driver (not to be confused with the MIDI port). Multiple devices can be specified by a list of devices index separated by a semicolon (e.g "2;0", which is equivalent to one device with 32 MIDI channels).</desc>
<desc>Device for Windows MIDI driver.</desc>
</setting>
</midi>
<player label="MIDI player settings">
<player>
<setting>
<isFirst>MIDI player settings</isFirst>
<name>reset-synth</name>
<type>bool</type>
<def>1 (TRUE)</def>
<realtime/>
<desc>If true, reset the synth after the end of a MIDI song, so that the state of a previous song can't affect the next song. Turn it off for seamless looping of a song.</desc>
<desc>If true, reset the synth before starting a new MIDI song, so the state of a previous song can't affect the new song. Turn it off for seamless looping of a song.</desc>
</setting>
<setting>
<name>timing-source</name>
@ -824,16 +705,17 @@ Developers:
</setting>
</player>
<shell label="Shell (command line) settings">
<shell>
<setting>
<isFirst>Shell (command line) settings</isFirst>
<name>prompt</name>
<type>str</type>
<def>(empty string)</def>
<desc>In dump mode we set the prompt to "" (empty string). The ui cannot easily handle lines, which don't end with cr. Changing the prompt cannot be done through a command, because the current shell does not handle empty arguments.</desc>
<def>""</def>
<desc>In dump mode we set the prompt to "". The ui cannot easily handle lines, which don't end with cr. Changing the prompt cannot be done through a command, because the current shell does not handle empty arguments.</desc>
</setting>
<setting>
<name>port</name>
<type>int</type>
<type>num</type>
<def>9800</def>
<min>1</min>
<max>65535</max>

View file

@ -1,312 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" doctype-system="about:legacy-compat"/>
<xsl:template match="/">
<html>
<head>
<style>
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background: #eee;
}
#sidebar {
position: fixed;
width: 25em;
top: 0;
bottom: 0;
padding-bottom: 2em;
box-sizing: border-box;
overflow-y: auto;
color: white;
background: #333;
}
#sidebar ul li a {
display: block;
padding-left: 5%;
padding-top: 0.3em;
padding-bottom: 0.3em;
color: #fafafa;
}
#sidebar a:hover {
background: #666;
}
#sidebar .muted {
color: #ccc !important;
}
#sidebar h1 {
padding-top: 1em;
margin: 0;
padding-left: 5%;
}
#sidebar h2 {
padding-left: 5%;
margin-top: 1.5em;
margin-bottom: 0.5em;
color: lightblue;
}
#sidebar ul,
#sidebar ul li
<xsl:output method="html" doctype-system="about:legacy-compat"/>
<xsl:template match="/">
<html>
<head>
<style>
table
{
list-style: none;
margin: 0;
padding: 0;
border: 3px solid black;
}
#sidebar li a {
text-decoration: none;
.first-row
{
border-top: 3px solid black;
}
.deprecated-badge {
margin-left: 0.5em;
font-size: 80%;
font-weight: bold;
color: red;
th
{
font-weight: normal;
white-space: nowrap;
padding: 15px 5px 15px 5px;
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
}
#main {
margin-left: 25em;
padding: 1em 2em;
box-sizing: border-box;
max-width: 60em;
background: white;
color: #333;
td
{
padding: 15px 5px 15px 5px;
}
#main h2 {
margin-top: 2em;
.cell-def
{
white-space: nowrap;
border-top: 1px solid black;
}
.cell-vals
{
border-top: 1px solid black;
}
.cell-desc
{
border-top: 1px solid black;
}
#main h2:first-child {
margin-top: 1em;
}
.setting {
padding: 0;
margin: 1em 0;
border-left: 1px solid #eee;
border-radius: 5px 0px 0px 0px;
}
@-webkit-keyframes flash-header {
from { background: lightblue; }
50% { background: #eee; }
to { background: lightblue; }
}
@keyframes flash-header {
from { background: lightblue; }
50% { background: #eee; }
to { background: lightblue; }
}
.setting:target .setting-header {
background: lightblue;
-webkit-animation: flash-header .5s 2 linear;
animation: flash-header .5s 2 linear;
}
.setting-header {
background: #eee;
border-radius: 5px 0px 0px 0px;
padding: 0.5em 1em;
position: relative;
}
.setting-body {
padding: 1em;
}
.setting-name {
font-weight: bold;
display: inline;
color: #333;
}
.setting-type {
color: #666;
font-weight: bold;
float: right;
}
.setting-attribute {
margin-bottom: 0.8em;
color: #666;
}
.setting-attribute .label {
display: inline-block;
vertical-align: top;
min-width: 6em;
}
.setting-attribute .value {
display: inline-block;
color: #333;
}
.setting-deprecated {
color: red;
}
.setting-description {
color: black;
margin-top: 1.5em;
}
a {
color: darkblue;
}
</style>
<title>FluidSynth Settings</title>
</head>
<body>
<div id="sidebar">
<h1>FluidSynth Settings</h1>
<xsl:for-each select="fluidsettings/*">
<xsl:sort select="@label" />
<h2><xsl:value-of select="@label" /></h2>
<ul>
<xsl:for-each select="*">
<li>
<a>
<xsl:attribute name="href"><![CDATA[#]]><xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" /></xsl:attribute>
<span class="muted"><xsl:value-of select="name(..)" /></span>.<xsl:value-of select="name" />
<xsl:if test="deprecated">
<span class="deprecated-badge">deprecated</span>
</xsl:if>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:for-each>
</div>
<div id="main">
<xsl:for-each select="fluidsettings/*">
<xsl:sort select="@label" />
<h2><xsl:value-of select="@label" /></h2>
<xsl:for-each select="*">
<xsl:sort select="name(..)" />
<div class="setting">
<xsl:attribute name="id">
<xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" />
</xsl:attribute>
<div class="setting-header">
<div class="setting-name">
<xsl:value-of select="name(..)" />.<xsl:value-of select="name" />
</div>
<div class="setting-type">
</div>
</div>
<div class="setting-body">
<div class="setting-attribute">
<div class="label">Type:</div>
<div class="value">
<xsl:choose>
<xsl:when test="type = 'bool'">
Boolean (int)
</xsl:when>
<xsl:when test="type = 'int'">
Integer (int)
</xsl:when>
<xsl:when test="type = 'str'">
<xsl:choose>
<xsl:when test="vals">
Selection (str)
</xsl:when>
<xsl:otherwise>
String (str)
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="type = 'num'">
Float (num)
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="type" />
</xsl:otherwise>
</xsl:choose>
</div>
</div>
<xsl:choose>
<xsl:when test="type = 'str' and vals">
<div class="setting-attribute">
<div class="label">Options:</div>
<div class="value"><xsl:value-of select="vals" /></div>
</div>
</xsl:when>
<xsl:when test="type = 'bool'">
<div class="setting-attribute">
<div class="label">Values:</div>
<div class="value">0, 1</div>
</div>
</xsl:when>
<xsl:when test="min or max">
<div class="setting-attribute">
<div class="label">Min - Max:</div>
<div class="value">
<xsl:value-of select="min" />
-
<xsl:value-of select="max" />
</div>
</div>
</xsl:when>
</xsl:choose>
<div class="setting-attribute">
<div class="label">Default:</div>
<div class="value"><xsl:copy-of select="def" /></div>
</div>
<xsl:if test="realtime">
<div class="setting-attribute">
<div class="label">Real-time:</div>
<div class="value">
<xsl:choose>
<xsl:when test="realtime/text()">
<xsl:copy-of select="realtime"/>
</xsl:when>
<xsl:otherwise>
This setting can be changed during runtime of the synthesizer.
</xsl:otherwise>
</xsl:choose>
</div>
</div>
</xsl:if>
<xsl:if test="deprecated">
<div class="setting-deprecated">
This setting is deprecated and might be removed in a future version of FluidSynth.
</div>
</xsl:if>
<div class="setting-description">
<xsl:copy-of select="desc" />
</div>
</div>
</div>
</xsl:for-each>
</xsl:for-each>
</div>
</body>
</html>
</xsl:template>
.audio {background-color: hsl(170, 100%, 90%);}
.midi {background-color: hsl(125, 100%, 90%);}
.player {background-color: hsl(85, 100%, 85%);}
.shell {background-color: hsl(60, 100%, 90%);}
.synth {background-color: hsl(35, 100%, 90%);}
.deprecated {background-color: hsl(0, 0%, 93%);}
</style>
<title>FluidSettings</title>
</head>
<body>
<h1>FluidSettings</h1>
<ul>
<!-- Select the first setting of each group and use it for building up a TOC -->
<xsl:for-each select="fluidsettings/*/*[isFirst]">
<xsl:sort select="name(..)" />
<li style="margin-bottom: 15px">
<xsl:attribute name="class">
<xsl:value-of select="name(..)" />
</xsl:attribute>
<a>
<xsl:attribute name="href"><![CDATA[#]]><xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" /></xsl:attribute>
<xsl:value-of select="isFirst" />
</a>
</li>
</xsl:for-each>
</ul>
<table>
<!--print each and every setting row by row in the table-->
<xsl:for-each select="fluidsettings/*/*">
<xsl:sort select="name(..)" />
<!-- <xsl:sort select="name" /> -->
<tr>
<!-- the class attribute of tr shall be the name of the settings group of the current setting, unless the setting is marked deprecated -->
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="deprecated">
deprecated
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name(..)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td class="cell-name first-row">
<xsl:attribute name="id"><xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" /></xsl:attribute>
<a>
<xsl:attribute name="href"><![CDATA[#]]><xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" /></xsl:attribute>
<xsl:value-of select="name(..)" />.<xsl:value-of select="name" />
</a>
</td>
<th class="first-row">Type</th>
<td class="cell-type first-row">
<xsl:choose>
<xsl:when test="type = 'bool'">
int (bool)
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="type" />
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="deprecated">
deprecated
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name(..)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td></td>
<th>Default</th>
<td class="cell-def">
<xsl:copy-of select="def" />
</td>
</tr>
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="deprecated">
deprecated
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name(..)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td></td>
<th>
<xsl:choose>
<xsl:when test="type = 'str'">
Values
</xsl:when>
<xsl:when test="type = 'bool'">
Values
</xsl:when>
<xsl:otherwise>
Min
-
Max
</xsl:otherwise>
</xsl:choose>
</th>
<td class="cell-vals">
<xsl:choose>
<xsl:when test="type = 'str'">
<xsl:value-of select="vals" />
</xsl:when>
<xsl:when test="type = 'bool'">
1, 0
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="min" />
-
<xsl:value-of select="max" />
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="deprecated">
deprecated
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name(..)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td></td>
<th>Description</th>
<td class="cell-desc">
<xsl:copy-of select="desc" />
<xsl:choose>
<xsl:when test="deprecated">
<br /><br />
<strong style="color:red">DEPRECATED</strong><br /><br />
<xsl:copy-of select="deprecated" />
</xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,5 +1,5 @@
/*!
\mainpage FluidSynth 2.2 Developer Documentation
/*!
\mainpage FluidSynth 2.0 Developer Documentation
\author Peter Hanappe
\author Conrad Berhörster
\author Antoine Schmitt
@ -7,15 +7,43 @@
\author Josh Green
\author David Henningsson
\author Tom Moebert
\author Copyright &copy; 2003-2022 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
\version Revision 2.2.8
\date 2022-07-10
\author Copyright &copy; 2003-2019 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
\version Revision 2.1.0
\date 2019-11-30
All the source code examples in this document are in the public domain; you can use them as you please. This document is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/3.0/ . The FluidSynth library is distributed under the GNU Lesser General Public License. A copy of the GNU Lesser General Public License is contained in the FluidSynth package; if not, visit https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
All the source code examples in this document are in the public domain; you can use them as you please. This document is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ . The FluidSynth library is distributed under the GNU Lesser General Public License. A copy of the GNU Lesser General Public License is contained in the FluidSynth package; if not, visit http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\section Abstract
<a href="https://www.fluidsynth.org">FluidSynth</a> is a software synthesizer based on the <a href="https://en.wikipedia.org/wiki/SoundFont">SoundFont 2</a> specifications. The synthesizer is available as a shared object that can easily be reused in any application that wants to use wave-table synthesis. This document explains the basic usage of FluidSynth. Some of the more advanced features are not yet discussed but will be added in future versions.
<a href="http://www.fluidsynth.org">FluidSynth</a> is a software synthesizer based on the <a href="http://en.wikipedia.org/wiki/SoundFont">SoundFont 2</a> specifications. The synthesizer is available as a shared object that can easily be reused in any application that wants to use wave-table synthesis. This document explains the basic usage of FluidSynth. Some of the more advanced features are not yet discussed but will be added in future versions.
\section Contents Table of Contents
- \ref Disclaimer
- \ref Introduction
- \ref NewIn2_1_0
- \ref NewIn2_0_8
- \ref NewIn2_0_7
- \ref NewIn2_0_6
- \ref NewIn2_0_5
- \ref NewIn2_0_3
- \ref NewIn2_0_2
- \ref NewIn2_0_0
- \ref CreatingSettings
- \ref CreatingSynth
- \ref CreatingAudioDriver
- \ref UsingSynth
- \ref LoadingSoundfonts
- \ref SendingMIDI
- \ref RealtimeMIDI
- \ref MIDIPlayer
- \ref FileRenderer
- \ref MIDIPlayerMem
- \ref MIDIRouter
- \ref Sequencer
- \ref Shell
- \ref Multi-channel
- \ref Advanced
\section Disclaimer
@ -23,7 +51,7 @@ This documentation may be partly incomplete. As always, the source code is the f
SoundFont(R) is a registered trademark of E-mu Systems, Inc.
\page Introduction Introduction
\section Introduction
What is FluidSynth?
@ -33,19 +61,688 @@ What is FluidSynth?
- FluidSynth is an API (Application Programming Interface) relieving programmers from a lot of details of reading SoundFont and MIDI events and files, and sending the digital audio output to a Sound Card. These tasks can be accomplished using a small set of functions. This document explains most of the API functions and gives short examples about them.
- FluidSynth uses instrument samples contained in standard SF2 (SoundFont 2) files, having a file structure based on the RIFF format. The specification is publicly available on the internet, but most users don't need to know any details of the format.
- FluidSynth uses instrument samples contained in standard SF2 (SoundFont 2) files, having a file structure based on the RIFF format. The specification can be obtained here: http://connect.creativelabs.com/developer/SoundFont/Forms/AllItems.aspx but most users don't need to know any details of the format.
- FluidSynth can easily be embedded in an application. It has a main header file, fluidsynth.h, and one dynamically linkable library. FluidSynth runs on Linux, Mac OS X, and the Windows platforms, and support for OS/2 and OpenSolaris is experimental. It has audio and midi drivers for all mentioned platforms but you can use it with your own drivers if your application already handles MIDI and audio input/output. This document explains the basic usage of FluidSynth and provides examples that you can reuse.
- FluidSynth is open source, in active development. For more details, take a look at https://www.fluidsynth.org
- FluidSynth is open source, in active development. For more details, take a look at http://www.fluidsynth.org
\section NewIn2_1_0 Whats new in 2.1.0?
- <span style="color:red">refrain from using fluid_synth_set_sample_rate()</span>
- new reverb engine
- chorus is now stereophonic
- smallest allowed chorus speed is now 0.1 Hz (previously 0.29 Hz)
- the following audio drivers were added:
- opensles
- oboe
- sdl2
- waveout
\section NewIn2_0_8 Whats new in 2.0.8?
- fluid_sample_set_sound_data() caused broken sound when copying sample data
\section NewIn2_0_7 Whats new in 2.0.7?
- fluid_free() has been added to allow proper deallocation by programming languages other than C/C++
\section NewIn2_0_6 Whats new in 2.0.6?
- the MIDI player did not emit any audio when calling fluid_player_play() after fluid_player_stop()
\section NewIn2_0_5 Whats new in 2.0.5?
- fluid_synth_process() omitted audio samples when called with arbitrary sample counts that were not a multiple of fluid_synth_get_internal_bufsize()
- fluid_synth_sfunload() was not releasing sample buffers of SoundFont3 files if <a href="fluidsettings.xml#synth.dynamic-sample-loading">"synth.dynamic-sample-loading"</a> was set to FALSE
\section NewIn2_0_3 Whats new in 2.0.3?
- fix incorrect behaviour of fluid_sample_set_sound_data()
- add missing getters for midi events:
- fluid_midi_event_get_text()
- fluid_midi_event_get_lyrics()
\section NewIn2_0_2 Whats new in 2.0.2?
- fluid_synth_error() has been deprecated, use fluid_set_log_function() to interfere log messages
\section NewIn2_0_0 Whats new in 2.0.0?
FluidSynths major version was bumped. The API was reworked, deprecated functions were removed.
<strong><span style="color:red">Important changes that may not result in a compilation error but may cause your app to misbehave:</span></strong>
- all public \c fluid_settings_* functions that return an integer which is not meant to be interpreted as bool consistently return either FLUID_OK or FLUID_FAILED
- fluid_settings_setstr() cannot be used to set integer (toggle) settings with "yes" or "no" values anymore. Use fluid_settings_setint() instead, for example: <br /><code>fluid_settings_setint(settings, "synth.reverb.active", 0)</code> instead of <code>fluid_settings_setstr(settings, "synth.reverb.active", "no")</code>
- explicit client unregistering is required for fluid_sequencer_register_client() and fluid_sequencer_register_fluidsynth()
- all public functions consistently receive signed integers for soundfont ids, bank and program numbers
- use unique device names for the "audio.portaudio.device" setting
- fluid_synth_process() received a new more flexible implementation, but now requires zeroed-out sample buffers
<strong>Other changes in FluidSynth 2.0.0 concerning developers:</strong>
- all public \c delete_* functions return void and are safe when called with NULL
- the shell command handler was decoupled internally, as a consequence the param list of new_fluid_server() and new_fluid_cmd_handler() was adapted
- \c fluid_settings_set* functions no longer silently register unknown settings but return an error instead
- reverb: roomsize is now limited to an upper threshold of 1.0 to avoid exponential volume increase
- rename \c fluid_mod_new() and \c fluid_mod_delete() to match naming conventions: new_fluid_mod() and delete_fluid_mod()
- rename chorus getters to match naming conventions: fluid_synth_get_chorus_speed() and fluid_synth_get_chorus_depth()
- fluid_synth_remove_sfont() returns FLUID_OK or FLUID_FAILED
- introduce a separate data type for sequencer client IDs: #fluid_seq_id_t
- fluid_get_userconf() has been implemented for Windows
<strong>New Features and API additions:</strong>
- add <a href="fluidsettings.xml#midi.autoconnect">"midi.autoconnect"</a> a setting for automatically connecting fluidsynth to available MIDI input ports
- add <a href="fluidsettings.xml#synth.overflow.important">"synth.overflow.important"</a> and <a href="fluidsettings.xml#synth.overflow.important-channels">"synth.overflow.important-channels"</a> settings to take midi channels during overflow calculation into account that are considered to be "important"
- add <a href="fluidsettings.xml#synth.dynamic-sample-loading">"synth.dynamic-sample-loading"</a> a setting for enabling on demand sample loading
- add support for polyphonic key pressure events, see fluid_event_key_pressure() and fluid_synth_key_pressure()
- add fluid_synth_add_default_mod() and fluid_synth_remove_default_mod() for manipulating default modulators
- add individual reverb setters: fluid_synth_set_reverb_roomsize(), fluid_synth_set_reverb_damp(), fluid_synth_set_reverb_width(), fluid_synth_set_reverb_level()
- add individual chorus setters: fluid_synth_set_chorus_nr(), fluid_synth_set_chorus_level(), fluid_synth_set_chorus_speed(), fluid_synth_set_chorus_depth(), fluid_synth_set_chorus_type()
- add realtime settings for <a href="fluidsettings.xml#synth.reverb.damp">reverb</a> and <a href="fluidsettings.xml#synth.chorus.depth">chorus</a> parameters
- add seek support to midi-player, see fluid_player_seek()
- expose functions to manipulate the ladspa effects unit (see ladspa.h)
- add support for text and lyrics midi events, see fluid_midi_event_set_lyrics() and fluid_midi_event_set_text()
- complete rewrite of the soundfont loader API, see sfont.h
- support for 24 bit audio samples, see fluid_sample_set_sound_data()
- expose new_fluid_defsfloader() to support loading soundfonts from memory, see fluid_sfloader_set_callbacks() and <a href="fluidsynth_sfload_mem_8c-example.html">fluidsynth_sfload_mem.c</a>
- remove these structs from the public API and provide proper getter and setter functions instead:
- struct _fluid_sfloader_t
- struct _fluid_sample_t
- struct _fluid_sfont_t
- struct _fluid_preset_t
- add an additional general-purpose IIR filter, see fluid_synth_set_custom_filter()
- add a custom sinusoidal modulator mapping function, see #FLUID_MOD_SIN
- implement polymono support according to MIDI specs:
- add basic channel support, see fluid_synth_reset_basic_channel(), fluid_synth_set_basic_channel(), fluid_synth_get_basic_channel()
- implement MIDI modes Omni On, Omni Off, Poly, Mono, see #fluid_basic_channel_modes
- implement portamento control, see fluid_synth_set_portamento_mode(), fluid_synth_get_portamento_mode()
- implement legato control, see fluid_synth_set_legato_mode(), fluid_synth_get_legato_mode()
- implement breath control, see fluid_synth_set_breath_mode(), fluid_synth_get_breath_mode()
<strong>API cleanups:</strong>
- the ramsfont has been removed, because it is unmaintained and believed to be unused; please get in touch with the mailing list if you still need it
- remove deprecated fluid_synth_get_channel_info() in favour of fluid_synth_get_program() and fluid_synth_get_channel_preset()
- remove deprecated fluid_settings_getstr()
- remove deprecated fluid_synth_set_midi_router(), instead supply the midi-router instance when creating a command handler with new_fluid_cmd_handler()
- remove deprecated fluid_get_hinstance() and fluid_set_hinstance() (dsound driver now uses the desktop window)
- remove deprecated fluid_synth_create_key_tuning(), use fluid_synth_activate_key_tuning(synth, bank, prog, name, pitch, FALSE) instead
- remove deprecated fluid_synth_create_octave_tuning(), use fluid_synth_activate_octave_tuning(synth, bank, prog, name, pitch, FALSE) instead
- remove deprecated fluid_synth_select_tuning(), use fluid_synth_activate_tuning(synth, chan, bank, prog, FALSE) instead
- remove deprecated fluid_synth_reset_tuning(), use fluid_synth_deactivate_tuning(synth, chan, FALSE) instead
- remove deprecated FLUID_HINT_INTEGER
- remove deprecated fluid_synth_set_gen2() as there doesn't seem to be a use case for absolute generator values
- remove deprecated "synth.parallel-render" setting
- remove obsolete "audio.[out|in]put-channels" settings
- remove unimplemented "synth.dump" setting
- remove fluid_cmd_handler_register() and fluid_cmd_handler_unregister() from public API, as they seem to be unused downstream
- remove misspelled FLUID_SEQ_PITCHWHHELSENS macro
- remove struct _fluid_mod_t from public API, use the getters and setters of mod.h instead
- remove struct _fluid_gen_t, fluid_gen_set_default_values() and enum fluid_gen_flags from public API
- remove macros fluid_sfont_get_id() and fluid_sample_refcount() from public API
- remove FLUID_NUM_MOD macro from public API
- remove the following deprecated enum values from public API:
- GEN_LAST
- LAST_LOG_LEVEL
- FLUID_SEQ_LASTEVENT
- FLUID_MIDI_ROUTER_RULE_COUNT
\page deprecated Deprecated Functions
\section CreatingSettings Creating and changing the settings
This page contains functions that have been marked obsolete.
Functions listed here will be removed in the next major release.
It is therefore not wise to use them in new code.
Before you can use the synthesizer, you have to create a settings object. The settings objects is used by many components of the FluidSynth library. It gives a unified API to set the parameters of the audio drivers, the midi drivers, the synthesizer, and so forth. A number of default settings are defined by the current implementation.
All settings have a name that follows the "dotted-name" notation. For example, "synth.polyphony" refers to the number of voices (polyphony) allocated by the synthesizer. The settings also have a type. There are currently three types: strings, numbers (double floats), and integers. You can change the values of a setting using the fluid_settings_setstr(), fluid_settings_setnum(), and fluid_settings_setint() functions. For example:
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings = new_fluid_settings();
fluid_settings_setint(settings, "synth.polyphony", 128);
/* ... */
delete_fluid_settings(settings);
return 0;
}
\endcode
The API contains the functions to query the type, the current value, the default value, the range and the "hints" of a setting. The range is the minimum and maximum value of the setting. The hints gives additional information about a setting. For example, whether a string represents a filename. Or whether a number should be interpreted on on a logarithmic scale. Check the settings.h API documentation for a description of all functions.
\section CreatingSynth Creating the synthesizer
To create the synthesizer, you pass it the settings object, as in the following example:
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_synth_t* synth;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
/* Do useful things here */
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
For a full list of available <strong>synthesizer settings</strong>, please refer to <a href="fluidsettings.xml" target="_blank"><b>FluidSettings Documentation</b></a>.
\section CreatingAudioDriver Creating the Audio Driver
The synthesizer itself does not write any audio to the audio output. This allows application developers to manage the audio output themselves if they wish. The next section describes the use of the synthesizer without an audio driver in more detail.
Creating the audio driver is straightforward: set the <code>audio.driver</code> settings and create the driver object. Because the FluidSynth has support for several audio systems, you may want to change which one you want to use. The list below shows the audio systems that are currently supported. It displays the name, as used by the fluidsynth library, and a description.
- jack: JACK Audio Connection Kit (Linux, Mac OS X, Windows)
- alsa: Advanced Linux Sound Architecture (Linux)
- oss: Open Sound System (Linux, Unix)
- pulseaudio: PulseAudio (Linux, Mac OS X, Windows)
- coreaudio: Apple CoreAudio (Mac OS X)
- dsound: Microsoft DirectSound (Windows)
- portaudio: PortAudio Library (Mac OS 9 & X, Windows, Linux)
- sndman: Apple SoundManager (Mac OS Classic)
- dart: DART sound driver (OS/2)
- opensles: OpenSL ES (Android)
- oboe: Oboe (Android)
- waveout: Microsoft WaveOut, alternative to DirectSound (Windows CE x86, Windows Mobile 2003 for ARMv5, Windows 98 SE, Windows NT 4.0, Windows XP and later)
- file: Driver to output audio to a file
- sdl2*: Simple DirectMedia Layer (Linux, Windows, Mac OS X, iOS, Android, FreeBSD, Haiku, etc.)
The default audio driver depends on the settings with which FluidSynth was compiled. You can get the default driver with fluid_settings_getstr_default(). To get the list of available drivers use the fluid_settings_foreach_option() function. Finally, you can set the driver with fluid_settings_setstr(). In most cases, the default driver should work out of the box.
Additional options that define the audio quality and latency are "audio.sample-format", "audio.period-size", and "audio.periods". The details are described later.
You create the audio driver with the new_fluid_audio_driver() function. This function takes the settings and synthesizer object as arguments. For example:
\code
void init()
{
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
/* Set the synthesizer settings, if necessary */
synth = new_fluid_synth(settings);
fluid_settings_setstr(settings, "audio.driver", "jack");
adriver = new_fluid_audio_driver(settings, synth);
}
\endcode
As soon as the audio driver is created, it will start playing. The audio driver creates a separate thread that uses the synthesizer object to generate the audio.
There are a number of general audio driver settings. The audio.driver settings define the audio subsystem that will be used. The audio.periods and audio.period-size settings define the latency and robustness against scheduling delays. There are additional settings for the audio subsystems used. For a full list of available <strong>audio driver settings</strong>, please refer to <a href="fluidsettings.xml" target="_blank"><strong>FluidSettings Documentation</strong></a>.
<strong>*Note:</strong> In order to use sdl2 as audio driver, the application is responsible for initializing SDL (e.g. with SDL_Init()). This must be done <strong>before</strong> the first call to <code>new_fluid_settings()</code>! Also make sure to call SDL_Quit() after all fluidsynth instances have been destroyed.
\section UsingSynth Using the synthesizer without an audio driver
It is possible to use the synthesizer object without creating an audio driver. This is desirable if the application using FluidSynth manages the audio output itself. The synthesizer has several API functions that can be used to obtain the audio output:
fluid_synth_write_s16() fills two buffers (left and right channel) with samples coded as signed 16 bits (the endian-ness is machine dependent). fluid_synth_write_float() fills a left and right audio buffer with 32 bits floating point samples. The function fluid_synth_process() is the generic interface for synthesizing audio, which is also capable of multi channel audio output.
\section LoadingSoundfonts Loading and managing SoundFonts
Before any sound can be produced, the synthesizer needs a SoundFont.
SoundFonts are loaded with the fluid_synth_sfload() function. The function takes the path to a SoundFont file and a boolean to indicate whether the presets of the MIDI channels should be updated after the SoundFont is loaded. When the boolean value is TRUE, all MIDI channel bank and program numbers will be refreshed, which may cause new instruments to be selected from the newly loaded SoundFont.
The synthesizer can load any number of SoundFonts. The loaded SoundFonts are treated as a stack, where each new loaded SoundFont is placed at the top of the stack. When selecting presets by bank and program numbers, SoundFonts are searched beginning at the top of the stack. In the case where there are presets in different SoundFonts with identical bank and program numbers, the preset from the most recently loaded SoundFont is used. The fluid_synth_program_select() can be used for unambiguously selecting a preset or bank offsets could be applied to each SoundFont with fluid_synth_set_bank_offset(), to try and ensure that each preset has unique bank and program numbers.
The fluid_synth_sfload() function returns the unique identifier of the loaded SoundFont, or -1 in case of an error. This identifier is used in subsequent management functions: fluid_synth_sfunload() removes the SoundFont, fluid_synth_sfreload() reloads the SoundFont. When a SoundFont is reloaded, it retains it's ID and position on the SoundFont stack.
Additional API functions are provided to get the number of loaded SoundFonts and to get a pointer to the SoundFont.
\section SendingMIDI Sending MIDI Events
Once the synthesizer is up and running and a SoundFont is loaded, most people will want to do something useful with it. Make noise, for example. MIDI messages can be sent using the fluid_synth_noteon(), fluid_synth_noteoff(), fluid_synth_cc(), fluid_synth_pitch_bend(), fluid_synth_pitch_wheel_sens(), and fluid_synth_program_change() functions. For convenience, there's also a fluid_synth_bank_select() function (the bank select message is normally sent using a control change message).
The following example show a generic graphical button that plays a note when clicked:
\code
class SoundButton : public SomeButton
{
public:
SoundButton() : SomeButton() {
if (!_synth) {
initSynth();
}
}
static void initSynth() {
_settings = new_fluid_settings();
_synth = new_fluid_synth(_settings);
_adriver = new_fluid_audio_driver(_settings, _synth);
}
/* ... */
virtual int handleMouseDown(int x, int y) {
/* Play a note on key 60 with velocity 100 on MIDI channel 0 */
fluid_synth_noteon(_synth, 0, 60, 100);
}
virtual int handleMouseUp(int x, int y) {
/* Release the note on key 60 */
fluid_synth_noteoff(_synth, 0, 60);
}
protected:
static fluid_settings_t* _settings;
static fluid_synth_t* _synth;
static fluid_audio_driver_t* _adriver;
};
\endcode
\section RealtimeMIDI Creating a Real-time MIDI Driver
FluidSynth can process real-time MIDI events received from hardware MIDI ports or other applications. To do so, the client must create a MIDI input driver. It is a very similar process to the creation of the audio driver: you initialize some properties in a settings instance and call the new_fluid_midi_driver() function providing a callback function that will be invoked when a MIDI event is received. The following MIDI drivers are currently supported:
- jack: JACK Audio Connection Kit MIDI driver (Linux, Mac OS X)
- oss: Open Sound System raw MIDI (Linux, Unix)
- alsa_raw: ALSA raw MIDI interface (Linux)
- alsa_seq: ALSA sequencer MIDI interface (Linux)
- winmidi: Microsoft Windows MM System (Windows)
- midishare: MIDI Share (Linux, Mac OS X)
- coremidi: Apple CoreMIDI (Mac OS X)
\code
#include <fluidsynth.h>
int handle_midi_event(void* data, fluid_midi_event_t* event)
{
printf("event type: %d\n", fluid_midi_event_get_type(event));
}
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_midi_driver_t* mdriver;
settings = new_fluid_settings();
mdriver = new_fluid_midi_driver(settings, handle_midi_event, NULL);
/* ... */
delete_fluid_midi_driver(mdriver);
return 0;
}
\endcode
There are a number of general MIDI driver settings. The midi.driver setting
defines the MIDI subsystem that will be used. There are additional settings for
the MIDI subsystems used. For a full list of available <strong>midi driver settings</strong>, please refer to <a href="fluidsettings.xml" target="_blank"><strong>FluidSettings Documentation</strong></a>.
\section MIDIPlayer Loading and Playing a MIDI file
FluidSynth can be used to play MIDI files, using the MIDI File Player interface. It follows a high level implementation, though its implementation is currently incomplete. After initializing the synthesizer, create the player passing the synth instance to new_fluid_player(). Then, you can add some SMF file names to the player using fluid_player_add(), and finally call fluid_player_play() to start the playback. You can check if the player has finished by calling fluid_player_get_status(), or wait for the player to terminate using fluid_player_join().
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
int i;
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
player = new_fluid_player(synth);
/* process command line arguments */
for (i = 1; i < argc; i++) {
if (fluid_is_soundfont(argv[i])) {
fluid_synth_sfload(synth, argv[1], 1);
}
if (fluid_is_midifile(argv[i])) {
fluid_player_add(player, argv[i]);
}
}
/* start the synthesizer thread */
adriver = new_fluid_audio_driver(settings, synth);
/* play the midi files, if any */
fluid_player_play(player);
/* wait for playback termination */
fluid_player_join(player);
/* cleanup */
delete_fluid_audio_driver(adriver);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
A list of available <strong>MIDI player settings</strong> can be found in <a href="fluidsettings.xml" target="_blank"><b>FluidSettings Documentation</b></a>.
\section FileRenderer Fast file renderer for non-realtime MIDI file rendering
Instead of creating an audio driver as described in section \ref MIDIPlayer one may chose to use the file renderer, which is the fastest way to synthesize MIDI files.
\code
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_file_renderer_t* renderer;
settings = new_fluid_settings();
// specify the file to store the audio to
// make sure you compiled fluidsynth with libsndfile to get a real wave file
// otherwise this file will only contain raw s16 stereo PCM
fluid_settings_setstr(settings, "audio.file.name", "/path/to/output.wav");
// use number of samples processed as timing source, rather than the system timer
fluid_settings_setstr(settings, "player.timing-source", "sample");
// since this is a non-realtime szenario, there is no need to pin the sample data
fluid_settings_setint(settings, "synth.lock-memory", 0);
synth = new_fluid_synth(settings);
// *** loading of a soundfont omitted ***
player = new_fluid_player(synth);
fluid_player_add(player, "/path/to/midifile.mid");
fluid_player_play(player);
renderer = new_fluid_file_renderer (synth);
while (fluid_player_get_status(player) == FLUID_PLAYER_PLAYING)
{
if (fluid_file_renderer_process_block(renderer) != FLUID_OK)
{
break;
}
}
// just for sure: stop the playback explicitly and wait until finished
fluid_player_stop(player);
fluid_player_join(player);
delete_fluid_file_renderer(renderer);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
\endcode
Various output files types are supported, if compiled with libsndfile. Those can be specified via the \c settings object as well. Refer to the <a href="fluidsettings.xml#audio.file.endian" target="_blank"><b>FluidSettings Documentation</b></a> for more \c audio.file\.\* options.
\section MIDIPlayerMem Playing a MIDI file from memory
FluidSynth can be also play MIDI files directly from a buffer in memory. If you need to play a file from a stream (such as stdin, a network, or a high-level file interface), you can load the entire file into a buffer first, and then use this approach. Use the same technique as above, but rather than calling fluid_player_add(), load it into memory and call fluid_player_add_mem() instead. Once you have passed a buffer to fluid_player_add_mem(), it is copied, so you may use it again or free it immediately (it is your responsibility to free it if you allocated it).
\code
#include <stdlib.h>
#include <string.h>
#include <fluidsynth.h>
/* An example midi file */
const char MIDIFILE[] = {
0x4d, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06,
0x00, 0x01, 0x00, 0x01, 0x01, 0xe0, 0x4d, 0x54,
0x72, 0x6b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x90,
0x3c, 0x64, 0x87, 0x40, 0x80, 0x3c, 0x7f, 0x00,
0x90, 0x43, 0x64, 0x87, 0x40, 0x80, 0x43, 0x7f,
0x00, 0x90, 0x48, 0x64, 0x87, 0x40, 0x80, 0x48,
0x7f, 0x83, 0x60, 0xff, 0x2f, 0x00
};
int main(int argc, char** argv)
{
int i;
void* buffer;
size_t buffer_len;
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
player = new_fluid_player(synth);
adriver = new_fluid_audio_driver(settings, synth);
/* process command line arguments */
for (i = 1; i < argc; i++) {
if (fluid_is_soundfont(argv[i])) {
fluid_synth_sfload(synth, argv[1], 1);
}
}
/* queue up the in-memory midi file */
fluid_player_add_mem(player, MIDIFILE, sizeof(MIDIFILE));
/* play the midi file */
fluid_player_play(player);
/* wait for playback termination */
fluid_player_join(player);
/* cleanup */
delete_fluid_audio_driver(adriver);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
\section MIDIRouter Real-time MIDI router
The MIDI router is one more processing layer directly behind the MIDI input. It processes incoming MIDI events and generates control events for the synth. It can be used to filter or modify events prior to sending them to the synthesizer. When created, the MIDI router is transparent and simply passes all MIDI events. Router "rules" must be added to actually make use of its capabilities.
Some examples of MIDI router usage:
- Filter messages (Example: Pass sustain pedal CCs only to selected channels)
- Split the keyboard (Example: noteon with notenr < x: to ch 1, >x to ch 2)
- Layer sounds (Example: for each noteon received on ch 1, create a noteon on ch1, ch2, ch3,...)
- Velocity scaling (Example: for each noteon event, scale the velocity by 1.27)
- Velocity switching (Example: v <= 100: "Angel Choir"; v > 100: "Hell's Bells")
- Get rid of aftertouch
The MIDI driver API has a clean separation between the midi thread and the synthesizer. That opens the door to add a midi router module.
MIDI events coming from the MIDI player do not pass through the MIDI router.
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_midi_router_t* router;
fluid_midi_router_rule_t* rule;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
/* Create the MIDI router and pass events to the synthesizer */
router = new_fluid_midi_router (settings, fluid_synth_handle_midi_event, synth);
/* Clear default rules */
fluid_midi_router_clear_rules (router);
/* Add rule to map all notes < MIDI note #60 on any channel to channel 4 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 0, 15, 0.0, 4); /* Map all to channel 4 */
fluid_midi_router_rule_set_param1 (rule, 0, 59, 1.0, 0); /* Match notes < 60 */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_NOTE);
/* Add rule to map all notes >= MIDI note #60 on any channel to channel 5 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 0, 15, 0.0, 5); /* Map all to channel 5 */
fluid_midi_router_rule_set_param1 (rule, 60, 127, 1.0, 0); /* Match notes >= 60 */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_NOTE);
/* Add rule to reverse direction of pitch bender on channel 7 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 7, 7, 1.0, 0); /* Match channel 7 only */
fluid_midi_router_rule_set_param1 (rule, 0, 16383, -1.0, 16383); /* Reverse pitch bender */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_PITCH_BEND);
/* ... Create audio driver, process events, etc ... */
/* cleanup */
delete_fluid_midi_router(router);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
\section Sequencer
FluidSynth's sequencer can be used to play MIDI events in a more flexible way than using the MIDI file player, which expects the events to be stored as Standard MIDI Files. Using the sequencer, you can provide the events one by one, with an optional timestamp for scheduling.
The client program should first initialize the sequencer instance using the function new_fluid_sequencer2(). There is a complementary function delete_fluid_sequencer() to delete it. After creating the sequencer instance, the destinations can be registered using fluid_sequencer_register_fluidsynth() for the synthesizer destination, and optionally using fluid_sequencer_register_client() for the client destination providing a suitable callback function. It can be unregistered using fluid_sequencer_unregister_client(). After the initialization, events can be sent with fluid_sequencer_send_now() and scheduled to the future with fluid_sequencer_send_at(). The registration functions return identifiers, that can be used as destinations of an event using fluid_event_set_dest().
The function fluid_sequencer_get_tick() returns the current playing position. A program may choose a new timescale in milliseconds using fluid_sequencer_set_time_scale().
The following example uses the fluidsynth sequencer to implement a sort of music box. FluidSynth internal clock is used to schedule repetitive sequences of notes. The next sequence is scheduled on advance before the end of the current one, using a timer event that triggers a callback function. The scheduling times are always absolute values, to avoid slippage.
\code
#include "fluidsynth.h"
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
fluid_sequencer_t* sequencer;
short synthSeqID, mySeqID;
unsigned int now;
unsigned int seqduration;
// prototype
void seq_callback(unsigned int time, fluid_event_t* event, fluid_sequencer_t* seq, void* data);
void createsynth()
{
fluid_settings_t* settings;
settings = new_fluid_settings();
fluid_settings_setint(settings, "synth.reverb.active", 0);
fluid_settings_setint(settings, "synth.chorus.active", 0);
synth = new_fluid_synth(settings);
adriver = new_fluid_audio_driver(settings, synth);
sequencer = new_fluid_sequencer2(0);
// register synth as first destination
synthSeqID = fluid_sequencer_register_fluidsynth(sequencer, synth);
// register myself as second destination
mySeqID = fluid_sequencer_register_client(sequencer, "me", seq_callback, NULL);
// the sequence duration, in ms
seqduration = 1000;
}
void deletesynth()
{
delete_fluid_sequencer(sequencer);
delete_fluid_audio_driver(adriver);
delete_fluid_synth(synth);
}
void loadsoundfont()
{
int fluid_res;
// put your own path here
fluid_res = fluid_synth_sfload(synth, "Inside:VintageDreamsWaves-v2.sf2", 1);
}
void sendnoteon(int chan, short key, unsigned int date)
{
int fluid_res;
fluid_event_t *evt = new_fluid_event();
fluid_event_set_source(evt, -1);
fluid_event_set_dest(evt, synthSeqID);
fluid_event_noteon(evt, chan, key, 127);
fluid_res = fluid_sequencer_send_at(sequencer, evt, date, 1);
delete_fluid_event(evt);
}
void schedule_next_callback()
{
int fluid_res;
// I want to be called back before the end of the next sequence
unsigned int callbackdate = now + seqduration/2;
fluid_event_t *evt = new_fluid_event();
fluid_event_set_source(evt, -1);
fluid_event_set_dest(evt, mySeqID);
fluid_event_timer(evt, NULL);
fluid_res = fluid_sequencer_send_at(sequencer, evt, callbackdate, 1);
delete_fluid_event(evt);
}
void schedule_next_sequence() {
// Called more or less before each sequence start
// the next sequence start date
now = now + seqduration;
// the sequence to play
// the beat : 2 beats per sequence
sendnoteon(0, 60, now + seqduration/2);
sendnoteon(0, 60, now + seqduration);
// melody
sendnoteon(1, 45, now + seqduration/10);
sendnoteon(1, 50, now + 4*seqduration/10);
sendnoteon(1, 55, now + 8*seqduration/10);
// so that we are called back early enough to schedule the next sequence
schedule_next_callback();
}
/* sequencer callback */
void seq_callback(unsigned int time, fluid_event_t* event, fluid_sequencer_t* seq, void* data) {
schedule_next_sequence();
}
int main(void) {
createsynth();
loadsoundfont();
// initialize our absolute date
now = fluid_sequencer_get_tick(sequencer);
schedule_next_sequence();
sleep(100000);
deletesynth();
return 0;
}
\endcode
\section Shell Shell interface
The shell interface allows you to send simple textual commands to the synthesizer, to parse a command file, or to read commands from the stdin or other input streams. To find the list of currently supported commands, please check the fluid_cmd.c file or type "help" in the fluidsynth command line shell. For a full list of available <strong>command line settings</strong>, please refer to <a href="fluidsettings.xml" target="_blank"><b>FluidSettings Documentation</b></a>.
\section Multi-channel Multi-Channel audio rendering
FluidSynth is capable of rendering all audio and all effects from all MIDI channels to separate stero buffers. Refer to the documentation of fluid_synth_process() and review the different use-cases in the example file for information on how to do that: \ref fluidsynth_process.c
\section Advanced Advanced features, not yet documented. API reference may contain more info.
- Accessing low-level voice parameters
- Reverb settings
- Chorus settings
- Interpolation settings (set_gen, get_gen, NRPN)
- Voice overflow settings
- LADSPA effects unit
- MIDI tunings
*/
/*!

View file

@ -13,7 +13,7 @@
.\" along with this program; see the file LICENSE. If not, write to
.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.\"
.TH FluidSynth 1 "Jan 1, 2022"
.TH FluidSynth 1 "Oct 27, 2019"
.\" Please update the above date whenever this man page is modified.
.\"
.\" Some roff macros, for reference:
@ -135,7 +135,7 @@ Start FluidSynth as a server process
Audio file type for fast rendering or aufile driver ("\T help" for list)
.TP
.B \-v, \-\-verbose
Print out verbose messages about midi events (synth.verbose=1) as well as other debug messages
Print out verbose messages about midi events
.TP
.B \-V, \-\-version
Show version of program
@ -144,7 +144,7 @@ Show version of program
Size of each audio buffer
.SH SETTINGS
The settings to be specified with \-o are documented in the fluidsettings.xml hopefully shipped with this distribution or online at https://www.fluidsynth.org/api/fluidsettings.xml . We recommend viewing this file in a webbrowser, favourably Firefox.
The settings to be specified with \-o are documented in the fluidsettings.xml hopefully shipped with this distribution or online at http://www.fluidsynth.org/api/fluidsettings.xml . We recommend viewing this file in a webbrowser, favourably Firefox.
.SH SHELL COMMANDS
.TP

View file

@ -57,7 +57,7 @@ schedule_noteoff(int chan, short key, unsigned int ticks)
/* schedule a timer event (shall trigger the callback) */
void
schedule_timer_event(void)
schedule_timer_event()
{
fluid_event_t *ev = new_fluid_event();
fluid_event_set_source(ev, -1);
@ -69,10 +69,9 @@ schedule_timer_event(void)
/* schedule the arpeggio's notes */
void
schedule_pattern(void)
schedule_pattern()
{
unsigned int i;
int note_time, note_duration;
int i, note_time, note_duration;
note_time = time_marker;
note_duration = duration / pattern_size;
@ -125,7 +124,7 @@ main(int argc, char *argv[])
if(n != -1)
{
sequencer = new_fluid_sequencer2(0);
sequencer = new_fluid_sequencer();
/* register the synth with the sequencer */
synth_destination = fluid_sequencer_register_fluidsynth(sequencer,
synth);
@ -136,7 +135,7 @@ main(int argc, char *argv[])
{
n = atoi(argv[2]);
if((n > 1) && (n <= (int)pattern_size))
if((n > 1) && (n <= pattern_size))
{
pattern_size = n;
}

View file

@ -44,36 +44,21 @@ int fx_function(void *data, int len,
{
struct fx_data_t *fx_data = (struct fx_data_t *) data;
int i, k;
float *out_i;
if(fx == 0)
/* Call the synthesizer to fill the output buffers with its
* audio output. */
if(fluid_synth_process(fx_data->synth, len, nfx, fx, nout, out) != FLUID_OK)
{
/* Note that some audio drivers may not provide buffers for effects like
* reverb and chorus. In this case it's your decision what to do. If you
* had called fluid_synth_process() like in the else branch below, no
* effects would have been rendered. Instead, you may mix the effects
* directly into the out buffers. */
if(fluid_synth_process(fx_data->synth, len, nout, out, nout, out) != FLUID_OK)
{
/* Some error occurred. Very unlikely to happen, though. */
return FLUID_FAILED;
}
}
else
{
/* Call the synthesizer to fill the output buffers with its
* audio output. */
if(fluid_synth_process(fx_data->synth, len, nfx, fx, nout, out) != FLUID_OK)
{
/* Some error occurred. Very unlikely to happen, though. */
return FLUID_FAILED;
}
/* Some error occured. Very unlikely to happen, though. */
return FLUID_FAILED;
}
/* Apply your effects here. In this example, the gain is
* applied to all the dry-audio output buffers. */
* applied to all the output buffers. */
for(i = 0; i < nout; i++)
{
float *out_i = out[i];
out_i = out[i];
for(k = 0; k < len; k++)
{
@ -81,17 +66,6 @@ int fx_function(void *data, int len,
}
}
/* Apply the same effect to all available effect buffer. */
for(i = 0; i < nfx; i++)
{
float *fx_i = fx[i];
for(k = 0; k < len; k++)
{
fx_i[k] *= fx_data->gain;
}
}
return FLUID_OK;
}
@ -141,7 +115,7 @@ int main(int argc, char **argv)
/* Fill in the data of the effects unit */
fx_data.synth = synth;
fx_data.gain = (float)atof(argv[2]);
fx_data.gain = atof(argv[2]);
/* Create the audio driver. As soon as the audio driver is
* created, the synthesizer can be played. */

View file

@ -47,7 +47,7 @@ schedule_noteon(int chan, short key, unsigned int ticks)
/* schedule a timer event (shall trigger the callback) */
void
schedule_timer_event(void)
schedule_timer_event()
{
fluid_event_t *ev = new_fluid_event();
fluid_event_set_source(ev, -1);
@ -59,10 +59,9 @@ schedule_timer_event(void)
/* schedule the metronome pattern */
void
schedule_pattern(void)
schedule_pattern()
{
unsigned int i;
int note_time;
int i, note_time;
note_time = time_marker;
for(i = 0; i < pattern_size; ++i)
@ -112,7 +111,7 @@ main(int argc, char *argv[])
if(n != -1)
{
sequencer = new_fluid_sequencer2(0);
sequencer = new_fluid_sequencer();
/* register the synth with the sequencer */
synth_destination = fluid_sequencer_register_fluidsynth(sequencer,
synth);

View file

@ -21,7 +21,7 @@ int main()
// array of buffers used to setup channel mapping
float *dry[1 * 2], *fx[1 * 2];
// first make sure to zero out the sample buffers every time before calling fluid_synth_process()
// first make sure to zero out the sample buffers everytime before calling fluid_synth_process()
memset(left, 0, sizeof(left));
memset(right, 0, sizeof(right));

View file

@ -18,10 +18,6 @@ int main()
const char *DRV[] = { "alsa", "jack", "portaudio" };
const char *adrivers[2];
/* three iterations, first register only alsa, then only jack, and last portaudio
* ...just to demonstrate how and under which conditions fluid_audio_driver_register()
* can be called
*/
for(int i = 0; i < sizeof(DRV) / sizeof(DRV[0]); i++)
{
adrivers[0] = DRV[i];
@ -43,10 +39,11 @@ int main()
fluid_settings_t *settings = new_fluid_settings();
res = fluid_settings_setstr(settings, "audio.driver", DRV[i]);
/* As of fluidsynth 2, settings API has been refactored to return FLUID_OK|FAILED
* rather than returning TRUE or FALSE
/* settings API will be refactored to return FLUID_OK|FAILED next major release
* returning TRUE or FALSE is deprecated
*/
#if FLUIDSYNTH_VERSION_MAJOR >= 2
if(res != FLUID_OK)
#else
if(res == 0)

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 150 KiB

View file

@ -1,6 +1,6 @@
# FluidSynth LADSPA Interface
The [LADSPA](https://ladspa.org/) (Linux Audio Developer's Simple Plugin API)
The [LADSPA](http://ladspa.org/) (Linux Audio Developer's Simple Plugin API)
binding can be used to route the FluidSynth audio output through any number of
LADSPA plugins. Please note that even though the "L" in LADSPA stands for
"Linux", it can also be used on different platforms, for example Windows or
@ -31,7 +31,7 @@ file.
## Introduction to LADSPA
You don't need to to have detailed knowledge of LADSPA to use effects with
FluidSynth, but knowing some of the LADSPA concepts will help if you want to make the
FluidSynth, but knowing some of it's concepts will help if you want to make the
best use of it.
If you have the LADSPA SDK installed you should be able to use the `listplugins`
@ -76,13 +76,13 @@ that only have a single output port and no input at all (think of noise
generators...)
Also note the line `Has run_adding() Function: No`. This specifies that this
plugin can not mix its audio output into an output buffer, but will always
plugin can not mix it's audio output into an output buffer, but will always
replace anything that is already there. This will become important again later
on.
## FluidSynth Host Ports
Just as LADSPA plugins have input and output ports, FluidSynth provides its
Just as LADSPA plugins have input and output ports, FluidSynth provides it's
own audio ports that can be connected to plugins. On a standard stereo setup,
the following four ports are automatically created:
@ -135,7 +135,7 @@ Please note that we only specified the path to the library
`/usr/lib/ladspa/delay.so` when creating the "e1" effect, but not which plugin
from the library to use. This is possible because the delay.so library contains
only a single plugin. If you want to use a library that contains more than one
plugin, you would need to specify the plugin name as well, as we've done when
plugin, you would need to give the plugin name as well, as we've done when
creating the "e2" effect. The string to use here is what is called "Plugin
Label" in the `analyseplugin` output.
@ -230,8 +230,8 @@ send amount specified in the SoundFont.
If you want to replace the internal reverb or chorus effects with a LADSPA
plugin and you want to honour the decisions made by the SoundFont designer, you
should use the `Reverb:Send` or `Chorus:Send` ports as inputs to the effects and
`Main:L` and `Main:R` ports as outputs. (See the "Example Setups" section
should use the `Reverb:Send` or `Chorus:Send` ports as effect input and
`Main:L` and `Main:R` ports as effect outputs. (See the "Example Setups" section
below for an example on how to replace the internal reverb with a LADSPA plugin.)
Please note that FluidSynth uses a mono signal for both effects, that is why
@ -260,16 +260,17 @@ ladspa_effect <effect-name> <library-path> [plugin-name] [--mix [gain]]
```
Load the LADSPA plugin library given by `<library-path>` and create a new effect
(i.e. an instance of a plugin). `<effect-name>` can be chosen by the user and must be
(i.e. an instance of a plugin). `<effect-name>` can be chosen by the user and must
unique. `<plugin-name>` is optional if the library contains only one plugin.
If the optional `--mix` parameter is given, then the LADSPA engine will call the
`run_adding` interface of the plugin. This will tell the effect to mix its output into the output buffers instead of replacing them. The `--mix` parameter takes an
`run_adding` interface of the plugin. This will make the effect add it's output
to the output buffers instead of replacing them. The `--mix` parameter takes an
optional float value `gain`, which will be multiplied with each sample before
adding to the output buffers.
Please note that there is no command to delete a single effect once created. To
remove effects, please use `ladspa_reset` to clear everything and start from
remove effects, please use `ladspa_reset` to clear everything start from
scratch.
Can only be called when the effect unit is not active.
@ -280,8 +281,8 @@ Can only be called when the effect unit is not active.
ladspa_buffer <buffer-name>
```
Create a new audio buffer called `<buffer-name>`. The buffer can be used as
mono output or mono input for an effect. Buffers can be used to connect plugins
Create a new audio buffer called `<buffer-name>`. The buffer is able to be used as
mono output or mono input to an effect. Buffers can be used to connect plugins
between each other without overwriting the host ports with temporary data.
Please note that there is no command to delete a buffer. To remove buffers,
@ -295,7 +296,7 @@ Can only be used when the effect unit is not active.
ladspa_link <effect-name> <audio-port-name> <buffer-or-host-port-name>
```
Connects an effect input or output port to a buffer or a host port. This
Connects an effect input or output port with a buffer or a host port. This
command can be called multiple times and will overwrite the previous connection
made on that effect port.
@ -347,7 +348,7 @@ it can be started again with `ladspa_start`.
ladspa_reset
```
Deactivates the effects unit if it is currently active and clears all configuration and loaded
Deactivates the effects unit if active and clears all configuration and loaded
plugins.
@ -439,7 +440,7 @@ Explaining multi-channel output in detail is out of scope for this guide. But
using multiple output channels has an effect on the host ports that are
available to LADSPA plugins.
As soon as you configure more than one audio-group, the main audio ports will
As soon as you configure more than one audio-channel, the main audio ports will
not be called "Main:L" and "Main:R" anymore, but will have indices added to
their name. So if you start FluidSynth with `-o synth.audio-groups=2`, then the
following ports will be created:
@ -460,8 +461,8 @@ then you also need to increase the `synth.audio-channels` setting.
LADSPA is a very simple plugin architecture and only requires the ladspa.h
header file as compile-time dependency. To build FluidSynth on non-Linux
platform with LADSPA support, download the ladspa.h file from
https://www.ladspa.org and place it somewhere in your compiler include path. Then
configure and build FluidSynth as you normally would.
http://www.ladspa.org and place it somewhere in your compiler include path. Then
configure and build LADSPA as you normally would.
All information in the above documentation is valid for all other platforms as
well. Just make sure you use the file path format specific to your platform in
@ -475,7 +476,7 @@ ladspa_effect /path/to/ladspa/plugin.so
```
Audacity provides a large number of precompiled LADSPA plugins for Windows and
MacOS: https://www.audacityteam.org/download/plug-ins/
MacOS: http://www.audacityteam.org/download/plug-ins/
To get the `analyseplugin` and `listplugins` commands on Windows, you can either
compile them yourself using the LADSPA-SDK source code from ladspa.org or install

View file

@ -1,169 +0,0 @@
/*!
\page RecentChanges Recent Changes
\section NewIn2_2_7 What's new in 2.2.7?
- Most getter functions of the MIDI event API are now const correct
- fluid_event_from_midi_event() has been added
\section NewIn2_2_0 What's new in 2.2.0?
- #fluid_file_callbacks_t <span style="color:red">now uses <code>long long</code> as file-offset type (see #fluid_long_long_t).</span><span style="color:red;font-weight:bold">This is a breaking change</span>, which allows to load SoundFonts bigger than 2GiB on Windows. This change required to bump fluidsynth's SOVERSION.
- <span style="color:red">various fluid_event_*() functions that received a "value" argument of type <code>short</code> now receive an <code>int</code> argument</span> in preparation for MIDI 2.0 support
- fluid_event_any_control_change() has been removed
- the sequencer has received a major revisal. For you that means:
- the sequencer's queue no longer blocks the synthesizer thread, due to being busy arranging its events internally.
- events that share the same tick was given a new, documented order, see fluid_sequencer_send_at().
- the sequencer's scale can now be used for arbitrary tempo changes. Previously, the scale of the sequencer was limited to 1000. The only limitation now is >0.
- there is now a dedicated event type for changing the sequencer's time scale, see fluid_event_scale().
- the dynamic-sample-loader has learned support to pin samples, see fluid_synth_pin_preset() and fluid_synth_unpin_preset()
- added getter and setter functions for individual effect groups
- support for UTF-8 filenames under Windows, see fluid_synth_sfload()
- MIDI Tempo of the fluid_player can now be overridden, see fluid_player_set_tempo()
- a per-tick callback has been added to the MIDI player, see fluid_player_set_tick_callback()
- WASAPI audio driver is now available on Windows
- the following drivers have gained support for new_fluid_audio_driver2():
- DSound
- WaveOut
- WASAPI
\section NewIn2_1_7 What's new in 2.1.7?
- a regression introduced in 2.1.0 prevented chorus from being audible when fluid_synth_process() was used
\section NewIn2_1_4 What's new in 2.1.4?
- a regression introduced in 2.1.3 broke fluid_synth_start() for DLS presets
\section NewIn2_1_1 What's new in 2.1.1?
- requirements for explicit sequencer client unregistering have been relaxed: delete_fluid_sequencer() now correctly frees any registered sequencer clients (clients can still be explicitly unregistered)
- using the sequencer with the system timer as timing source has been deprecated
\section NewIn2_1_0 What's new in 2.1.0?
- <span style="color:red">refrain from using fluid_synth_set_sample_rate()</span>
- \setting{synth_sample-rate} is no real-time setting anymore, see note about fluid_synth_set_sample_rate()
- new reverb engine
- chorus is now stereophonic
- smallest allowed chorus speed is now 0.1 Hz (previously 0.29 Hz)
- the following audio drivers were added:
- opensles
- oboe
- sdl2
- waveout
\section NewIn2_0_8 What's new in 2.0.8?
- fluid_sample_set_sound_data() caused broken sound when copying sample data
\section NewIn2_0_7 What's new in 2.0.7?
- fluid_free() has been added to allow proper deallocation by programming languages other than C/C++
\section NewIn2_0_6 What's new in 2.0.6?
- the MIDI player did not emit any audio when calling fluid_player_play() after fluid_player_stop()
\section NewIn2_0_5 What's new in 2.0.5?
- fluid_synth_process() omitted audio samples when called with arbitrary sample counts that were not a multiple of fluid_synth_get_internal_bufsize()
- fluid_synth_sfunload() was not releasing sample buffers of SoundFont3 files if \setting{synth_dynamic-sample-loading} was set to FALSE
\section NewIn2_0_3 What's new in 2.0.3?
- fix incorrect behaviour of fluid_sample_set_sound_data()
- add missing getters for midi events:
- fluid_midi_event_get_text()
- fluid_midi_event_get_lyrics()
\section NewIn2_0_2 What's new in 2.0.2?
- fluid_synth_error() has been deprecated, use fluid_set_log_function() to interfere log messages
\section NewIn2_0_0 What's new in 2.0.0?
FluidSynths major version was bumped. The API was reworked, deprecated functions were removed.
<strong><span style="color:red">Important changes that may not result in a compilation error but may cause your app to misbehave:</span></strong>
- all public \c fluid_settings_* functions that return an integer which is not meant to be interpreted as bool consistently return either FLUID_OK or FLUID_FAILED
- fluid_settings_setstr() cannot be used to set integer (toggle) settings with "yes" or "no" values anymore. Use fluid_settings_setint() instead, for example: <br /><code>fluid_settings_setint(settings, "synth.reverb.active", 0)</code> instead of <code>fluid_settings_setstr(settings, "synth.reverb.active", "no")</code>
- <span style="text-decoration:line-through;">explicit client unregistering is required for fluid_sequencer_register_client() and fluid_sequencer_register_fluidsynth()</span> (since fluidsynth 2.1.1 not required anymore, but still recommend)
- all public functions consistently receive signed integers for soundfont ids, bank and program numbers
- use unique device names for the \setting{audio_portaudio_device} setting
- fluid_synth_process() received a new more flexible implementation, but now requires zeroed-out sample buffers
<strong>Other changes in FluidSynth 2.0.0 concerning developers:</strong>
- all public \c delete_* functions return void and are safe when called with NULL
- the shell command handler was decoupled internally, as a consequence the param list of new_fluid_server() and new_fluid_cmd_handler() was adapted
- \c fluid_settings_set* functions no longer silently register unknown settings but return an error instead
- reverb: roomsize is now limited to an upper threshold of 1.0 to avoid exponential volume increase
- rename \c fluid_mod_new() and \c fluid_mod_delete() to match naming conventions: new_fluid_mod() and delete_fluid_mod()
- rename chorus getters to match naming conventions: fluid_synth_get_chorus_speed() and fluid_synth_get_chorus_depth()
- fluid_synth_remove_sfont() returns FLUID_OK or FLUID_FAILED
- introduce a separate data type for sequencer client IDs: #fluid_seq_id_t
- fluid_get_userconf() has been implemented for Windows
<strong>New Features and API additions:</strong>
- add \setting{midi_autoconnect} a setting for automatically connecting fluidsynth to available MIDI input ports
- add \setting{synth_overflow_important} and \setting{synth_overflow_important-channels} settings to take midi channels during overflow calculation into account that are considered to be "important"
- add \setting{synth_dynamic-sample-loading} a setting for enabling on demand sample loading
- add support for polyphonic key pressure events, see fluid_event_key_pressure() and fluid_synth_key_pressure()
- add fluid_synth_add_default_mod() and fluid_synth_remove_default_mod() for manipulating default modulators
- add individual reverb setters: fluid_synth_set_reverb_roomsize(), fluid_synth_set_reverb_damp(), fluid_synth_set_reverb_width(), fluid_synth_set_reverb_level()
- add individual chorus setters: fluid_synth_set_chorus_nr(), fluid_synth_set_chorus_level(), fluid_synth_set_chorus_speed(), fluid_synth_set_chorus_depth(), fluid_synth_set_chorus_type()
- add realtime settings for \setting{synth_reverb_damp} and \setting{synth_chorus_depth} parameters
- add seek support to midi-player, see fluid_player_seek()
- expose functions to manipulate the ladspa effects unit (see ladspa.h)
- add support for text and lyrics midi events, see fluid_midi_event_set_lyrics() and fluid_midi_event_set_text()
- complete rewrite of the soundfont loader API, see sfont.h
- support for 24 bit audio samples, see fluid_sample_set_sound_data()
- expose new_fluid_defsfloader() to support loading soundfonts from memory, see fluid_sfloader_set_callbacks() and <a href="fluidsynth_sfload_mem_8c-example.html">fluidsynth_sfload_mem.c</a>
- remove these structs from the public API and provide proper getter and setter functions instead:
- struct _fluid_sfloader_t
- struct _fluid_sample_t
- struct _fluid_sfont_t
- struct _fluid_preset_t
- add an additional general-purpose IIR filter, see fluid_synth_set_custom_filter()
- add a custom sinusoidal modulator mapping function, see #FLUID_MOD_SIN
- implement polymono support according to MIDI specs:
- add basic channel support, see fluid_synth_reset_basic_channel(), fluid_synth_set_basic_channel(), fluid_synth_get_basic_channel()
- implement MIDI modes Omni On, Omni Off, Poly, Mono, see #fluid_basic_channel_modes
- implement portamento control, see fluid_synth_set_portamento_mode(), fluid_synth_get_portamento_mode()
- implement legato control, see fluid_synth_set_legato_mode(), fluid_synth_get_legato_mode()
- implement breath control, see fluid_synth_set_breath_mode(), fluid_synth_get_breath_mode()
<strong>API cleanups:</strong>
- the ramsfont has been removed, because it is unmaintained and believed to be unused; please get in touch with the mailing list if you still need it
- remove deprecated fluid_synth_get_channel_info() in favour of fluid_synth_get_program() and fluid_synth_get_channel_preset()
- remove deprecated fluid_settings_getstr()
- remove deprecated fluid_synth_set_midi_router(), instead supply the midi-router instance when creating a command handler with new_fluid_cmd_handler()
- remove deprecated fluid_get_hinstance() and fluid_set_hinstance() (dsound driver now uses the desktop window)
- remove deprecated fluid_synth_create_key_tuning(), use fluid_synth_activate_key_tuning(synth, bank, prog, name, pitch, FALSE) instead
- remove deprecated fluid_synth_create_octave_tuning(), use fluid_synth_activate_octave_tuning(synth, bank, prog, name, pitch, FALSE) instead
- remove deprecated fluid_synth_select_tuning(), use fluid_synth_activate_tuning(synth, chan, bank, prog, FALSE) instead
- remove deprecated fluid_synth_reset_tuning(), use fluid_synth_deactivate_tuning(synth, chan, FALSE) instead
- remove deprecated FLUID_HINT_INTEGER
- remove deprecated fluid_synth_set_gen2() as there doesn't seem to be a use case for absolute generator values
- remove deprecated "synth.parallel-render" setting
- remove obsolete "audio.[out|in]put-channels" settings
- remove unimplemented "synth.dump" setting
- remove fluid_cmd_handler_register() and fluid_cmd_handler_unregister() from public API, as they seem to be unused downstream
- remove misspelled FLUID_SEQ_PITCHWHHELSENS macro
- remove struct _fluid_mod_t from public API, use the getters and setters of mod.h instead
- remove struct _fluid_gen_t, fluid_gen_set_default_values() and enum fluid_gen_flags from public API
- remove macros fluid_sfont_get_id() and fluid_sample_refcount() from public API
- remove FLUID_NUM_MOD macro from public API
- remove the following deprecated enum values from public API:
- GEN_LAST
- LAST_LOG_LEVEL
- FLUID_SEQ_LASTEVENT
- FLUID_MIDI_ROUTER_RULE_COUNT
*/

View file

@ -1,21 +0,0 @@
/*!
\page UsageGuide Usage Guide
- \subpage CreatingSettings
- \subpage CreatingSynth
- \subpage LoadingSoundfonts
- \subpage CreatingAudioDriver
- \subpage UsingSynth
- \subpage SendingMIDI
- \subpage RealtimeMIDI
- \subpage MIDIPlayer
- \subpage FileRenderer
- \subpage MIDIPlayerMem
- \subpage MIDIRouter
- \subpage Sequencer
- \subpage Shell
- \subpage Multi-channel
- \subpage synth-context
- \subpage Advanced
*/

View file

@ -1,16 +0,0 @@
/*!
\page Advanced Advanced features
The following features are not yet fully documented. Some information can be
found in the API reference and in the GitHub Wiki.
- Accessing low-level voice parameters
- Reverb settings
- Chorus settings
- Interpolation settings (set_gen, get_gen, NRPN)
- Voice overflow settings
- LADSPA effects unit
- MIDI tunings
*/

View file

@ -1,89 +0,0 @@
/*!
\page CreatingAudioDriver Creating the audio driver
The synthesizer itself does not write any audio to the audio output. This
allows application developers to manage the audio output themselves if they
wish. The next section describes the use of the synthesizer without an audio
driver in more detail.
Creating the audio driver is straightforward: set the
<code>audio.driver</code> settings and create the driver object. Because the
FluidSynth has support for several audio systems, you may want to change
which one you want to use. The list below shows the audio systems that are
currently supported. It displays the name, as used by the fluidsynth library,
and a description.
- jack: JACK Audio Connection Kit (Linux, Mac OS X, Windows)
- alsa: Advanced Linux Sound Architecture (Linux)
- oss: Open Sound System (primarily needed on BSD, rarely also Linux and Unix in general)
- pulseaudio: PulseAudio (Linux, Mac OS X, Windows)
- coreaudio: Apple CoreAudio (Mac OS X)
- dsound: Microsoft DirectSound (Windows)
- portaudio: PortAudio Library (Mac OS 9 & X, Windows, Linux)
- sndman: Apple SoundManager (Mac OS Classic)
- dart: DART sound driver (OS/2)
- opensles: OpenSL ES (Android)
- oboe: Oboe (Android)
- waveout: Microsoft WaveOut, alternative to DirectSound (Windows CE x86,
Windows Mobile 2003 for ARMv5, Windows 98 SE, Windows NT 4.0, Windows XP
and later)
- file: Driver to output audio to a file
- sdl2*: Simple DirectMedia Layer (Linux, Windows, Mac OS X, iOS, Android,
FreeBSD, Haiku, etc.)
- pipewire**: PipeWire (Linux)
The default audio driver depends on the settings with which FluidSynth was
compiled. You can get the default driver with
fluid_settings_getstr_default(). To get the list of available drivers use the
fluid_settings_foreach_option() function. Finally, you can set the driver
with fluid_settings_setstr(). In most cases, the default driver should work
out of the box.
Additional options that define the audio quality and latency are
\setting{audio_sample-format}, \setting{audio_period-size}, and
\setting{audio_periods}. The details are described later.
You create the audio driver with the new_fluid_audio_driver() function. This
function takes the settings and synthesizer object as arguments. For example:
\code
void init()
{
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
/* Set the synthesizer settings, if necessary */
synth = new_fluid_synth(settings);
fluid_settings_setstr(settings, "audio.driver", "jack");
adriver = new_fluid_audio_driver(settings, synth);
}
\endcode
As soon as the audio driver is created, it will start playing. The audio
driver creates a separate thread that uses the synthesizer object to generate
the audio.
There are a number of general audio driver settings. The audio.driver settings
define the audio subsystem that will be used. The \setting{audio_periods} and
\setting{audio_period-size} settings define the latency and robustness against
scheduling delays. There are additional settings for the audio subsystems used.
For a full list of available <strong>audio driver settings</strong>, please
refer to the \setting{audio} documentation.
<strong>*Note:</strong> In order to use sdl2 as audio driver, the application
is responsible for initializing SDL (e.g. with SDL_Init()). This must be done
<strong>before</strong> the first call to <code>new_fluid_settings()</code>!
Also make sure to call SDL_Quit() after all fluidsynth instances have been
destroyed.
<strong>**Note:</strong> In order to use pipeiwre as audio driver, the application
is responsible for initializing PipeWire (e.g. with pw_init()). This must be done
<strong>before</strong> the first call to <code>new_fluid_settings()</code>!
Also make sure to call pw_deinit() after all fluidsynth instances have been
destroyed.
*/

View file

@ -1,38 +0,0 @@
/*!
\page CreatingSettings Creating and changing the settings
Before you can use the synthesizer, you have to create a settings object. The
settings objects is used by many components of the FluidSynth library. It gives
a unified API to set the parameters of the audio drivers, the midi drivers, the
synthesizer, and so forth. A number of default settings are defined by the
current implementation.
All settings have a name that follows the "dotted-name" notation. For example,
\setting{synth_polyphony} refers to the number of voices (polyphony) allocated
by the synthesizer. The settings also have a type. There are currently three
types: strings, numbers (double floats), and integers. You can change the
values of a setting using the fluid_settings_setstr(), fluid_settings_setnum(),
and fluid_settings_setint() functions. For example:
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings = new_fluid_settings();
fluid_settings_setint(settings, "synth.polyphony", 128);
/* ... */
delete_fluid_settings(settings);
return 0;
}
\endcode
The API contains the functions to query the type, the current value, the
default value, the range and the "hints" of a setting. The range is the minimum
and maximum value of the setting. The hints gives additional information about
a setting. For example, whether a string represents a filename. Or whether a
number should be interpreted on a logarithmic scale. Check the settings.h
API documentation for a description of all functions.
*/

View file

@ -1,29 +0,0 @@
/*!
\page CreatingSynth Creating the synthesizer
To create the synthesizer, you pass it the settings object, as in the
following example:
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_synth_t* synth;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
/* Do useful things here */
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
For a full list of available <strong>synthesizer settings</strong>, please
refer to the \setting{synth} documentation.
*/

View file

@ -1,60 +0,0 @@
/*!
\page FileRenderer Fast file renderer for non-realtime MIDI file rendering
Instead of creating an audio driver as described in section \ref MIDIPlayer
one may chose to use the file renderer, which is the fastest way to
synthesize MIDI files.
\code
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_file_renderer_t* renderer;
settings = new_fluid_settings();
// specify the file to store the audio to
// make sure you compiled fluidsynth with libsndfile to get a real wave file
// otherwise this file will only contain raw s16 stereo PCM
fluid_settings_setstr(settings, "audio.file.name", "/path/to/output.wav");
// use number of samples processed as timing source, rather than the system timer
fluid_settings_setstr(settings, "player.timing-source", "sample");
// since this is a non-realtime scenario, there is no need to pin the sample data
fluid_settings_setint(settings, "synth.lock-memory", 0);
synth = new_fluid_synth(settings);
// *** loading of a soundfont omitted ***
player = new_fluid_player(synth);
fluid_player_add(player, "/path/to/midifile.mid");
fluid_player_play(player);
renderer = new_fluid_file_renderer (synth);
while (fluid_player_get_status(player) == FLUID_PLAYER_PLAYING)
{
if (fluid_file_renderer_process_block(renderer) != FLUID_OK)
{
break;
}
}
// just for sure: stop the playback explicitly and wait until finished
fluid_player_stop(player);
fluid_player_join(player);
delete_fluid_file_renderer(renderer);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
\endcode
Various output files types are supported, if compiled with libsndfile. Those
can be specified via the \c settings object as well. Refer to the
\setting{audio} documentation for more \c audio.file\.\* options.
*/

View file

@ -1,34 +0,0 @@
/*!
\page LoadingSoundfonts Loading and managing SoundFonts
Before any sound can be produced, the synthesizer needs a SoundFont.
SoundFonts are loaded with the fluid_synth_sfload() function. The function
takes the path to a SoundFont file and a boolean to indicate whether the
presets of the MIDI channels should be updated after the SoundFont is loaded.
When the boolean value is TRUE, all MIDI channel bank and program numbers
will be refreshed, which may cause new instruments to be selected from the
newly loaded SoundFont.
The synthesizer can load any number of SoundFonts. The loaded SoundFonts are
treated as a stack, where each new loaded SoundFont is placed at the top of
the stack. When selecting presets by bank and program numbers, SoundFonts are
searched beginning at the top of the stack. In the case where there are
presets in different SoundFonts with identical bank and program numbers, the
preset from the most recently loaded SoundFont is used. The
fluid_synth_program_select() can be used for unambiguously selecting a preset
or bank offsets could be applied to each SoundFont with
fluid_synth_set_bank_offset(), to try and ensure that each preset has unique
bank and program numbers.
The fluid_synth_sfload() function returns the unique identifier of the loaded
SoundFont, or -1 in case of an error. This identifier is used in subsequent
management functions: fluid_synth_sfunload() removes the SoundFont,
fluid_synth_sfreload() reloads the SoundFont. When a SoundFont is reloaded,
it retains it's ID and position on the SoundFont stack.
Additional API functions are provided to get the number of loaded SoundFonts
and to get a pointer to the SoundFont.
*/

View file

@ -1,17 +0,0 @@
/*!
\page UsingSynth Using the synthesizer without an audio driver
It is possible to use the synthesizer object without creating an audio
driver. This is desirable if the application using FluidSynth manages the
audio output itself. The synthesizer has several API functions that can be
used to obtain the audio output:
fluid_synth_write_s16() fills two buffers (left and right channel) with
samples coded as signed 16 bits (the endian-ness is machine dependent).
fluid_synth_write_float() fills a left and right audio buffer with 32 bits
floating point samples. The function fluid_synth_process() is the generic
interface for synthesizing audio, which is also capable of multi channel
audio output.
*/

View file

@ -1,55 +0,0 @@
/*!
\page MIDIPlayer Loading and playing a MIDI file
FluidSynth can be used to play MIDI files, using the MIDI File Player
interface. It follows a high level implementation, though its implementation
is currently incomplete. After initializing the synthesizer, create the
player passing the synth instance to new_fluid_player(). Then, you can add
some SMF file names to the player using fluid_player_add(), and finally call
fluid_player_play() to start the playback. You can check if the player has
finished by calling fluid_player_get_status(), or wait for the player to
terminate using fluid_player_join().
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
int i;
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
player = new_fluid_player(synth);
/* process command line arguments */
for (i = 1; i < argc; i++) {
if (fluid_is_soundfont(argv[i])) {
fluid_synth_sfload(synth, argv[1], 1);
}
if (fluid_is_midifile(argv[i])) {
fluid_player_add(player, argv[i]);
}
}
/* start the synthesizer thread */
adriver = new_fluid_audio_driver(settings, synth);
/* play the midi files, if any */
fluid_player_play(player);
/* wait for playback termination */
fluid_player_join(player);
/* cleanup */
delete_fluid_audio_driver(adriver);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
A list of available <strong>MIDI player settings</strong> can be found in the
\setting{player} documentation.
*/

View file

@ -1,64 +0,0 @@
/*!
\page MIDIPlayerMem Playing a MIDI file from memory
FluidSynth can be also play MIDI files directly from a buffer in memory. If
you need to play a file from a stream (such as stdin, a network, or a
high-level file interface), you can load the entire file into a buffer first,
and then use this approach. Use the same technique as above, but rather than
calling fluid_player_add(), load it into memory and call
fluid_player_add_mem() instead. Once you have passed a buffer to
fluid_player_add_mem(), it is copied, so you may use it again or free it
immediately (it is your responsibility to free it if you allocated it).
\code
#include <stdlib.h>
#include <string.h>
#include <fluidsynth.h>
/* An example midi file */
const char MIDIFILE[] = {
0x4d, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06,
0x00, 0x01, 0x00, 0x01, 0x01, 0xe0, 0x4d, 0x54,
0x72, 0x6b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x90,
0x3c, 0x64, 0x87, 0x40, 0x80, 0x3c, 0x7f, 0x00,
0x90, 0x43, 0x64, 0x87, 0x40, 0x80, 0x43, 0x7f,
0x00, 0x90, 0x48, 0x64, 0x87, 0x40, 0x80, 0x48,
0x7f, 0x83, 0x60, 0xff, 0x2f, 0x00
};
int main(int argc, char** argv)
{
int i;
void* buffer;
size_t buffer_len;
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
player = new_fluid_player(synth);
adriver = new_fluid_audio_driver(settings, synth);
/* process command line arguments */
for (i = 1; i < argc; i++) {
if (fluid_is_soundfont(argv[i])) {
fluid_synth_sfload(synth, argv[1], 1);
}
}
/* queue up the in-memory midi file */
fluid_player_add_mem(player, MIDIFILE, sizeof(MIDIFILE));
/* play the midi file */
fluid_player_play(player);
/* wait for playback termination */
fluid_player_join(player);
/* cleanup */
delete_fluid_audio_driver(adriver);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
*/

View file

@ -1,76 +0,0 @@
/*!
\page MIDIRouter Real-time MIDI router
The MIDI router is one more processing layer directly behind the MIDI input.
It processes incoming MIDI events and generates control events for the synth.
It can be used to filter or modify events prior to sending them to the
synthesizer. When created, the MIDI router is transparent and simply passes
all MIDI events. Router "rules" must be added to actually make use of its
capabilities.
Some examples of MIDI router usage:
- Filter messages (Example: Pass sustain pedal CCs only to selected channels)
- Split the keyboard (Example: noteon with notenr < x: to ch 1, >x to ch 2)
- Layer sounds (Example: for each noteon received on ch 1, create a noteon on
ch1, ch2, ch3,...)
- Velocity scaling (Example: for each noteon event, scale the velocity by
1.27)
- Velocity switching (Example: v <= 100: "Angel Choir"; v > 100: "Hell's
Bells")
- Get rid of aftertouch
The MIDI driver API has a clean separation between the midi thread and the
synthesizer. That opens the door to add a midi router module.
MIDI events coming from the MIDI player do not pass through the MIDI router.
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_midi_router_t* router;
fluid_midi_router_rule_t* rule;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
/* Create the MIDI router and pass events to the synthesizer */
router = new_fluid_midi_router (settings, fluid_synth_handle_midi_event, synth);
/* Clear default rules */
fluid_midi_router_clear_rules (router);
/* Add rule to map all notes < MIDI note #60 on any channel to channel 4 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 0, 15, 0.0, 4); /* Map all to channel 4 */
fluid_midi_router_rule_set_param1 (rule, 0, 59, 1.0, 0); /* Match notes < 60 */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_NOTE);
/* Add rule to map all notes >= MIDI note #60 on any channel to channel 5 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 0, 15, 0.0, 5); /* Map all to channel 5 */
fluid_midi_router_rule_set_param1 (rule, 60, 127, 1.0, 0); /* Match notes >= 60 */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_NOTE);
/* Add rule to reverse direction of pitch bender on channel 7 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 7, 7, 1.0, 0); /* Match channel 7 only */
fluid_midi_router_rule_set_param1 (rule, 0, 16383, -1.0, 16383); /* Reverse pitch bender */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_PITCH_BEND);
/* ... Create audio driver, process events, etc ... */
/* cleanup */
delete_fluid_midi_router(router);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
*/

View file

@ -1,15 +0,0 @@
/*!
\page Multi-channel Multi-channel audio rendering
FluidSynth is capable of rendering all audio and all effects from all MIDI
channels to separate stereo buffers. Refer to the documentation of
fluid_synth_process() and review the different use-cases in the example file
for information on how to do that: \ref fluidsynth_process.c
The following chart illustrates how the voices (produced by MIDI NoteOns) are
dispatched or mapped to their dry/effects audio buffers.
\image html fluid_mixer.svg "FluidSynth Mixer Chart"
*/

View file

@ -1,46 +0,0 @@
/*!
\page RealtimeMIDI Creating a real-time MIDI driver
FluidSynth can process real-time MIDI events received from hardware MIDI
ports or other applications. To do so, the client must create a MIDI input
driver. It is a very similar process to the creation of the audio driver: you
initialize some properties in a settings instance and call the
new_fluid_midi_driver() function providing a callback function that will be
invoked when a MIDI event is received. The following MIDI drivers are
currently supported:
- jack: JACK Audio Connection Kit MIDI driver (Linux, Mac OS X)
- oss: Open Sound System raw MIDI (Linux, Unix)
- alsa_raw: ALSA raw MIDI interface (Linux)
- alsa_seq: ALSA sequencer MIDI interface (Linux)
- winmidi: Microsoft Windows MM System (Windows)
- midishare: MIDI Share (Linux, Mac OS X)
- coremidi: Apple CoreMIDI (Mac OS X)
\code
#include <fluidsynth.h>
int handle_midi_event(void* data, fluid_midi_event_t* event)
{
printf("event type: %d\n", fluid_midi_event_get_type(event));
}
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_midi_driver_t* mdriver;
settings = new_fluid_settings();
mdriver = new_fluid_midi_driver(settings, handle_midi_event, NULL);
/* ... */
delete_fluid_midi_driver(mdriver);
return 0;
}
\endcode
There are a number of general MIDI driver settings. The \setting{midi_driver} setting
defines the MIDI subsystem that will be used. There are additional settings
for the MIDI subsystems used. For a full list of available
<strong>midi driver settings</strong>, please refer to the \setting{midi} documentation.
*/

View file

@ -1,53 +0,0 @@
/*!
\page SendingMIDI Sending MIDI events
Once the synthesizer is up and running and a SoundFont is loaded, most people
will want to do something useful with it. Make noise, for example. MIDI
messages can be sent using the fluid_synth_noteon(), fluid_synth_noteoff(),
fluid_synth_cc(), fluid_synth_pitch_bend(), fluid_synth_pitch_wheel_sens(),
and fluid_synth_program_change() functions. For convenience, there's also a
fluid_synth_bank_select() function (the bank select message is normally sent
using a control change message).
The following example show a generic graphical button that plays a note when
clicked:
\code
class SoundButton : public SomeButton
{
public:
SoundButton() : SomeButton() {
if (!_synth) {
initSynth();
}
}
static void initSynth() {
_settings = new_fluid_settings();
_synth = new_fluid_synth(_settings);
_adriver = new_fluid_audio_driver(_settings, _synth);
}
/* ... */
virtual int handleMouseDown(int x, int y) {
/* Play a note on key 60 with velocity 100 on MIDI channel 0 */
fluid_synth_noteon(_synth, 0, 60, 100);
}
virtual int handleMouseUp(int x, int y) {
/* Release the note on key 60 */
fluid_synth_noteoff(_synth, 0, 60);
}
protected:
static fluid_settings_t* _settings;
static fluid_synth_t* _synth;
static fluid_audio_driver_t* _adriver;
};
\endcode
*/

View file

@ -1,142 +0,0 @@
/*!
\page Sequencer Using the MIDI sequencer
FluidSynth's sequencer can be used to play MIDI events in a more flexible way
than using the MIDI file player, which expects the events to be stored as
Standard MIDI Files. Using the sequencer, you can provide the events one by
one, with an optional timestamp for scheduling.
The client program should first initialize the sequencer instance using the
function new_fluid_sequencer2(). There is a complementary function
delete_fluid_sequencer() to delete it. After creating the sequencer instance,
the destinations can be registered using
fluid_sequencer_register_fluidsynth() for the synthesizer destination, and
optionally using fluid_sequencer_register_client() for the client destination
providing a suitable callback function. It can be unregistered using
fluid_sequencer_unregister_client(). After the initialization, events can be
sent with fluid_sequencer_send_now() and scheduled to the future with
fluid_sequencer_send_at(). The registration functions return identifiers,
that can be used as destinations of an event using fluid_event_set_dest().
The function fluid_sequencer_get_tick() returns the current playing position.
A program may choose a new timescale in milliseconds using
fluid_sequencer_set_time_scale().
The following example uses the fluidsynth sequencer to implement a sort of
music box. FluidSynth internal clock is used to schedule repetitive sequences
of notes. The next sequence is scheduled on advance before the end of the
current one, using a timer event that triggers a callback function. The
scheduling times are always absolute values, to avoid slippage.
\code
#include "fluidsynth.h"
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
fluid_sequencer_t* sequencer;
short synthSeqID, mySeqID;
unsigned int now;
unsigned int seqduration;
// prototype
void seq_callback(unsigned int time, fluid_event_t* event, fluid_sequencer_t* seq, void* data);
void createsynth()
{
fluid_settings_t* settings;
settings = new_fluid_settings();
fluid_settings_setint(settings, "synth.reverb.active", 0);
fluid_settings_setint(settings, "synth.chorus.active", 0);
synth = new_fluid_synth(settings);
adriver = new_fluid_audio_driver(settings, synth);
sequencer = new_fluid_sequencer2(0);
// register synth as first destination
synthSeqID = fluid_sequencer_register_fluidsynth(sequencer, synth);
// register myself as second destination
mySeqID = fluid_sequencer_register_client(sequencer, "me", seq_callback, NULL);
// the sequence duration, in ms
seqduration = 1000;
}
void deletesynth()
{
delete_fluid_sequencer(sequencer);
delete_fluid_audio_driver(adriver);
delete_fluid_synth(synth);
}
void loadsoundfont()
{
int fluid_res;
// put your own path here
fluid_res = fluid_synth_sfload(synth, "Inside:VintageDreamsWaves-v2.sf2", 1);
}
void sendnoteon(int chan, short key, unsigned int date)
{
int fluid_res;
fluid_event_t *evt = new_fluid_event();
fluid_event_set_source(evt, -1);
fluid_event_set_dest(evt, synthSeqID);
fluid_event_noteon(evt, chan, key, 127);
fluid_res = fluid_sequencer_send_at(sequencer, evt, date, 1);
delete_fluid_event(evt);
}
void schedule_next_callback()
{
int fluid_res;
// I want to be called back before the end of the next sequence
unsigned int callbackdate = now + seqduration/2;
fluid_event_t *evt = new_fluid_event();
fluid_event_set_source(evt, -1);
fluid_event_set_dest(evt, mySeqID);
fluid_event_timer(evt, NULL);
fluid_res = fluid_sequencer_send_at(sequencer, evt, callbackdate, 1);
delete_fluid_event(evt);
}
void schedule_next_sequence() {
// Called more or less before each sequence start
// the next sequence start date
now = now + seqduration;
// the sequence to play
// the beat : 2 beats per sequence
sendnoteon(0, 60, now + seqduration/2);
sendnoteon(0, 60, now + seqduration);
// melody
sendnoteon(1, 45, now + seqduration/10);
sendnoteon(1, 50, now + 4*seqduration/10);
sendnoteon(1, 55, now + 8*seqduration/10);
// so that we are called back early enough to schedule the next sequence
schedule_next_callback();
}
/* sequencer callback */
void seq_callback(unsigned int time, fluid_event_t* event, fluid_sequencer_t* seq, void* data) {
schedule_next_sequence();
}
int main(void) {
createsynth();
loadsoundfont();
// initialize our absolute date
now = fluid_sequencer_get_tick(sequencer);
schedule_next_sequence();
sleep(100000);
deletesynth();
return 0;
}
\endcode
*/

View file

@ -1,12 +0,0 @@
/*!
\page Shell Shell interface
The shell interface allows you to send simple textual commands to the
synthesizer, to parse a command file, or to read commands from the stdin or
other input streams. To find the list of currently supported commands, type
@c help in the fluidsynth command line shell. For a full list of available
<strong>command line settings</strong>, please refer to the \ref
settings_shell documentation.
*/

View file

@ -1,30 +0,0 @@
/*!
\page synth-context Understanding the "synthesis context"
When reading through the functions exposed via our API, you will often read the
note: "May or may not be called from synthesis context."
The reason for this is that some functions are intentionally not thread-safe.
Or they require to be called from this context to behave correctly.
FluidSynth's rendering engine is implemented by using the "Dispatcher Thread
Pattern". This means that a certain thread @c A which calls one of FluidSynth's
rendering functions, namely
- fluid_synth_process()
- fluid_synth_nwrite_float()
- fluid_synth_write_float()
- fluid_synth_write_s16()
automatically becomes the "synthesis thread". The terms "synthesis context" and
"synthesis thread" are equivalent. A few locations in our API provide hooks
that allow you to interfere this "synthesis context". At those locations you
can register your own custom functions that will always be called by thread
@c A. For this use-case, the following functions are of interest:
- new_fluid_audio_driver2()
- fluid_player_set_playback_callback()
- fluid_sequencer_register_client()
*/

View file

@ -6,7 +6,5 @@ includedir=@includedir@
Name: FluidSynth
Description: Software SoundFont synth
Version: @VERSION@
Requires.private: @PC_REQUIRES_PRIV_JOINED@
Libs: -L${libdir} -lfluidsynth
Libs.private: @LIBS_PRIVATE_JOINED@ @LIBS_PRIVATE_WITH_PATH_JOINED@
Cflags: -I${includedir}

View file

@ -8,8 +8,8 @@ Type=notify
NotifyAccess=main
EnvironmentFile=@FLUID_DAEMON_ENV_FILE@
EnvironmentFile=-%h/.config/fluidsynth
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/fluidsynth -is $OTHER_OPTS $SOUND_FONT
ExecStart=@CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/fluidsynth -is $OTHER_OPTS $SOUND_FONT
[Install]
WantedBy=default.target
WantedBy=multi-user.target

76
fluidsynth.spec.in Normal file
View file

@ -0,0 +1,76 @@
%define name @PACKAGE@
%define version @VERSION@
%define release 1
%define prefix /usr
Summary: A real-time software synthesizer based on SoundFont 2 specifications.
Name: %{name}
Version: %{version}
Release: %{release}
Prefix: %{prefix}
Copyright: LGPL
Group: Sound
Source: http://savannah.nongnu.org/download/fluid/stable.pkg/%{version}/fluidsynth-%{version}.tar.gz
URL: http://www.fluidsynth.org/
BuildRoot: /var/tmp/%{name}-%{version}
%description
FluidSynth is a real-time software synthesizer based on the SoundFont
2 specifications. FluidSynth can read MIDI events from MIDI input
devices and render them to audio devices using SoundFont files to
define the instrument sounds. It can also play MIDI files and supports
real time effect control via SoundFont modulators and MIDI
controls. FluidSynth can be interfaced to other programs in different
ways, including linking as a shared library.
%package devel
Summary: Libraries and includes to build FluidSynth into other applications
Group: Development/Libraries
%description devel
FluidSynth is a real-time software synthesizer based on the SoundFont
2 specifications. FluidSynth can read MIDI events from MIDI input
devices and render them to audio devices using SoundFont files to
define the instrument sounds. It can also play MIDI files and supports
real time effect control via SoundFont modulators and MIDI
controls. FluidSynth can be interfaced to other programs in different
ways, including linking as a shared library.
This package contains libraries and includes for building applications
with FluidSynth support.
%prep
%setup
%build
./configure --prefix=%{prefix}
make
%install
if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
mkdir -p $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} install
%clean
if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%{prefix}/bin/fluidsynth
%{prefix}/lib/libfluidsynth.so*
%{prefix}/man/man1/*
%files devel
%defattr(-,root,root)
%doc doc/example.c doc/example.sf2 doc/api doc/html/*
%{prefix}/lib/libfluidsynth.a
%{prefix}/lib/libfluidsynth.la
%{prefix}/lib/pkgconfig/fluidsynth.pc
%{prefix}/include/fluidsynth.h
%{prefix}/include/fluidsynth
%changelog
* Mon Aug 25 2003 Josh Green <jgreen@users.sourceforge.net>
- Created initial fluidsynth.spec.in

View file

@ -43,9 +43,6 @@ extern "C" {
#elif defined(MACOS9)
#define FLUIDSYNTH_API __declspec(export)
#elif defined(__OS2__)
#define FLUIDSYNTH_API __declspec(dllexport)
#elif defined(__GNUC__)
#define FLUIDSYNTH_API __attribute__ ((visibility ("default")))

Some files were not shown because too many files have changed in this diff Show more