2019-09-08 18:19:43 +02:00
# sfizz
2019-09-09 12:18:01 +02:00
2019-12-01 16:32:27 +01:00
[](https://travis-ci.com/sfztools/sfizz)
2019-09-18 09:13:36 +02:00
2019-09-09 12:18:01 +02:00
## Building
2020-01-05 16:40:36 +01:00
`sfizz` depends on the `libsndfile` library.
The JACK client depends on the `jack` library.
2019-09-09 12:18:01 +02:00
To build `sfizz` you need to install both as shared libraries on the system.
In Debian-based distributions, this translates into
```
sudo apt install libjack-jackd2-dev libsndfile1-dev
```
The process is as follows:
1. Clone the repository with all the submodules
2. Create a build directory for CMake and `cd` into it
2020-01-05 16:40:36 +01:00
3. Build as release
2019-12-01 16:32:27 +01:00
4. Enjoy :)
2019-09-09 12:18:01 +02:00
In the shell world, this means
```sh
2019-09-26 01:27:07 +02:00
git clone --recursive https://github.com/sfztools/sfizz.git
2020-01-05 16:40:36 +01:00
git checkout develop
2019-09-09 12:18:01 +02:00
cd sfizz
mkdir build & & cd build
2020-01-05 16:40:36 +01:00
cmake -DCMAKE_BUILD_TYPE=Release ..
2019-09-09 12:18:01 +02:00
make
2020-01-05 16:40:36 +01:00
sudo make install
2019-09-09 12:18:01 +02:00
```
2020-01-05 16:40:36 +01:00
By default this builds and installs:
- The shared library version of sfizz
- The JACK client
- The LV2 plugin
The JACK client client will forcefully connect to the system output, and open an event input in Jack for you to connect a midi capable software or hardware (e.g. `jack-keyboard` ).
Note that you can disable all targets but the LV2 plugin using
```sh
cmake -DCMAKE_BUILD_TYPE=Release -DSFIZZ_JACK=OFF -DSFIZZ_SHARED=OFF ..
```
and process as before.
2019-09-09 12:18:01 +02:00
### Possible pitfalls and alternatives
If you already cloned the repository without the `--recursive` option, update the submodules manually with
```
git submodule update --init --recursive
```
2019-09-18 09:13:36 +02:00
You can build with `clang` , although in that case the CMakeFile defaults to using `libc++` instead of `libstdc++` .
2020-01-05 00:44:37 +01:00
### Building with MSVC on windows
The simplest is to use `vcpkg` as a package manager, which will give you access to `libsndfile` .
2020-01-05 00:51:19 +01:00
```powershell
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
.\vcpkg integrate powershell
2020-01-05 00:44:37 +01:00
```
Assuming you want to build for x64, install the relevant packages as follows
2020-01-05 00:51:19 +01:00
```powershell
.\vcpkg.exe install libsndfile:x64-windows zlib:x64-windows libsamplerate:x64-windows
2020-01-05 00:44:37 +01:00
```
In the sfizz source directory, you can then build with CMake as usual, although you should clone the windows branch:
2020-01-05 00:51:19 +01:00
```powershell
2020-01-05 11:42:41 +01:00
git clone --recursive https://github.com/sfztools/sfizz.git
2020-01-05 00:44:37 +01:00
cd sfizz
2020-01-05 00:51:19 +01:00
mkdir build
cd build
2020-01-05 00:44:37 +01:00
cmake .. -DSFIZZ_JACK=OFF "-DCMAKE_TOOLCHAIN_FILE=C:\Users\Paul\source\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows
cmake --build . -j 16 --config Release
```
2020-01-05 00:51:19 +01:00
This builds the lv2 plugin in `build\lv2\Release` and the Turtle files in `build\sfizz.lv2` , but the installation procedure is not entirely automatic yet.
In particular, having the required DLLs along with `sfizz.dll` is actually not helpful because the system cannot find dlls from another dll's root directory.
You thus need to add all of `FLAC.dll` , `libsndfile-1.dll` , `vorbis.dll` , `ogg.dll` , `vorbisenc.dll` in some directory in your `PATH` variable, and manually add `sfizz.dll` to the `sfizz.lv2` directory, and the the `sfizz.lv2` directory to `%APPDATA%\Roaming\LV2` .
Ardour should then find the plugin correctly and load it without issues.