A shared C/C++ library for synthesizer editor applications. Common code and third-party dependencies extracted from the editor projects to avoid duplication and keep behaviour consistent across them.
- G2-Edit — Nord G2 modular synthesizer editor
- EmuUtility — Emu sampler utility
- Z1-Edit — Korg Z1 synthesizer editor
SynthLib/
src/ — shared C/C++ source files
ThirdParty/
glfw/ — submodule: window/input/OpenGL context
freetype/ — submodule: font rendering
libusb/ — submodule: USB device access (used by G2-Edit)
Add as a git submodule:
git submodule add https://github.com/chrispurusha/SynthLib.git SynthLib
git submodule update --init --recursive
The --recursive flag is required to also initialise glfw, freetype, and libusb inside SynthLib.
Build the third-party libraries from the consuming project's root directory:
glfw:
cmake -S SynthLib/ThirdParty/glfw -B SynthLib/ThirdParty/glfw/build \
-DGLFW_BUILD_DOCS=OFF \
-DGLFW_BUILD_EXAMPLES=OFF \
-DGLFW_BUILD_TESTS=OFF
cmake --build SynthLib/ThirdParty/glfw/build
freetype:
cmake -S SynthLib/ThirdParty/freetype -B SynthLib/ThirdParty/freetype/build \
-DFT_DISABLE_BROTLI=ON \
-DFT_DISABLE_BZIP2=ON \
-DFT_DISABLE_PNG=ON \
-DFT_DISABLE_ZLIB=ON
cmake --build SynthLib/ThirdParty/freetype/build
libusb (G2-Edit only):
cd SynthLib/ThirdParty/libusb
./bootstrap.sh
./configure
make
cd ../../..
libusb requires autoconf, automake, and libtool: brew install autoconf automake libtool
In Xcode, add SynthLib/src as a file system synchronized root group in the target. Add to Header Search Paths:
$(PROJECT_DIR)/SynthLib/src
$(PROJECT_DIR)/SynthLib/ThirdParty/glfw/include
$(PROJECT_DIR)/SynthLib/ThirdParty/freetype/include
$(PROJECT_DIR)/SynthLib/ThirdParty/libusb/libusb
SynthLib headers include sysIncludes.h and defs.h, which must be provided by each consuming project's own src/.
GNU General Public License v3. See LICENSE.
Donations welcome: https://buymeacoffee.com/chrispurusha