Merge pull request #1166 from redtide/cmake-generic-names
Cmake generic names
This commit is contained in:
commit
09e81771bf
9 changed files with 266 additions and 80 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -308,7 +308,7 @@ jobs:
|
||||||
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
|
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
|
||||||
-D CMAKE_CXX_STANDARD=17
|
-D CMAKE_CXX_STANDARD=17
|
||||||
-D ENABLE_LTO=OFF
|
-D ENABLE_LTO=OFF
|
||||||
-D SFIZZ_STATIC_DEPENDENCIES=ON
|
-D SFIZZ_SNDFILE_STATIC=ON
|
||||||
-D SFIZZ_JACK=OFF
|
-D SFIZZ_JACK=OFF
|
||||||
)
|
)
|
||||||
${{ matrix.platform }}-w64-mingw32-cmake "${options[@]}"
|
${{ matrix.platform }}-w64-mingw32-cmake "${options[@]}"
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,12 @@ else()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project (libsfizz VERSION 1.2.2 LANGUAGES CXX C)
|
project(libsfizz
|
||||||
|
LANGUAGES CXX C
|
||||||
|
VERSION 1.2.2
|
||||||
|
)
|
||||||
set(PROJECT_DESCRIPTION "A library to load SFZ description files and use them to render music.")
|
set(PROJECT_DESCRIPTION "A library to load SFZ description files and use them to render music.")
|
||||||
|
set(PROJECT_REPOSITORY https://github.com/sfztools/sfizz)
|
||||||
|
|
||||||
# External configuration CMake scripts
|
# External configuration CMake scripts
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
@ -37,12 +41,12 @@ option_ex (SFIZZ_USE_SYSTEM_KISS_FFT "Use KISS FFT libraries preinstalled on sys
|
||||||
option_ex(SFIZZ_USE_SYSTEM_PUGIXML "Use pugixml libraries preinstalled on system" OFF)
|
option_ex(SFIZZ_USE_SYSTEM_PUGIXML "Use pugixml libraries preinstalled on system" OFF)
|
||||||
option_ex(SFIZZ_USE_SYSTEM_CXXOPTS "Use CXXOPTS libraries preinstalled on system" OFF)
|
option_ex(SFIZZ_USE_SYSTEM_CXXOPTS "Use CXXOPTS libraries preinstalled on system" OFF)
|
||||||
option_ex(SFIZZ_USE_SYSTEM_CATCH "Use Catch libraries preinstalled on system" OFF)
|
option_ex(SFIZZ_USE_SYSTEM_CATCH "Use Catch libraries preinstalled on system" OFF)
|
||||||
option_ex (SFIZZ_STATIC_DEPENDENCIES "Link dependencies statically" OFF)
|
|
||||||
option_ex(SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF)
|
option_ex(SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF)
|
||||||
option_ex(SFIZZ_PROFILE_BUILD "Profile the build time" OFF)
|
option_ex(SFIZZ_PROFILE_BUILD "Profile the build time" OFF)
|
||||||
|
option_ex(SFIZZ_SNDFILE_STATIC "Link the sndfile library statically" OFF)
|
||||||
|
|
||||||
# The fixed number of controller parameters
|
# Continuous Controller count (0 to 511)
|
||||||
set(MIDI_CC_MAX 512 CACHE STRING "Maximum amount of Control Change Messages")
|
set(MIDI_CC_COUNT 512 CACHE STRING "Maximum number of managed Control Change messages")
|
||||||
|
|
||||||
include(SfizzConfig)
|
include(SfizzConfig)
|
||||||
include(SfizzDeps)
|
include(SfizzDeps)
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,6 @@ Quit
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
sfizz_render(1)
|
sfizz_render(1)
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
See the main repository at @SFIZZ_REPOSITORY@.
|
See the main repository at @PROJECT_REPOSITORY@.
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
Contributors can be seen on the main repository at @SFIZZ_REPOSITORY@.
|
Contributors can be seen on the main repository at @PROJECT_REPOSITORY@.
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,6 @@ Show help
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
sfizz_jack(1)
|
sfizz_jack(1)
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
See the main repository at @SFIZZ_REPOSITORY@.
|
See the main repository at @PROJECT_REPOSITORY@.
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
Contributors can be seen on the main repository at @SFIZZ_REPOSITORY@.
|
Contributors can be seen on the main repository at @PROJECT_REPOSITORY@.
|
||||||
|
|
|
||||||
|
|
@ -123,21 +123,22 @@ if(USE_LIBCPP)
|
||||||
add_link_options(-lc++abi) # New command on CMake master, not in 3.12 release
|
add_link_options(-lc++abi) # New command on CMake master, not in 3.12 release
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SFIZZ_REPOSITORY https://github.com/sfztools/sfizz)
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||||
set(PROJECT_IS_MAIN TRUE)
|
set(PROJECT_IS_MAIN TRUE)
|
||||||
else()
|
|
||||||
set(PROJECT_IS_MAIN FALSE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Generate Config.h
|
||||||
|
configure_file("${PROJECT_SOURCE_DIR}/src/Config.h.in"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/sfizz/Config.h" @ONLY)
|
||||||
|
|
||||||
# Don't show build information when building a different project
|
# Don't show build information when building a different project
|
||||||
function(show_build_info_if_needed)
|
function(show_build_info_if_needed)
|
||||||
if(PROJECT_IS_MAIN)
|
if(PROJECT_IS_MAIN)
|
||||||
message(STATUS "
|
message(STATUS "
|
||||||
Project name: ${PROJECT_NAME}
|
Project name: ${PROJECT_NAME}
|
||||||
CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}
|
C++ standard version: ${CMAKE_CXX_STANDARD}
|
||||||
Build type: ${CMAKE_BUILD_TYPE}
|
Build type: ${CMAKE_BUILD_TYPE}
|
||||||
Build processor: ${PROJECT_SYSTEM_PROCESSOR}
|
Build processor: ${PROJECT_SYSTEM_PROCESSOR}
|
||||||
Build using LTO: ${ENABLE_LTO}
|
Build using LTO: ${ENABLE_LTO}
|
||||||
|
|
@ -148,9 +149,11 @@ Build benchmarks: ${SFIZZ_BENCHMARKS}
|
||||||
Build tests: ${SFIZZ_TESTS}
|
Build tests: ${SFIZZ_TESTS}
|
||||||
Build demos: ${SFIZZ_DEMOS}
|
Build demos: ${SFIZZ_DEMOS}
|
||||||
Build devtools: ${SFIZZ_DEVTOOLS}
|
Build devtools: ${SFIZZ_DEVTOOLS}
|
||||||
|
|
||||||
Use sndfile: ${SFIZZ_USE_SNDFILE}
|
Use sndfile: ${SFIZZ_USE_SNDFILE}
|
||||||
|
Statically link sndfile: ${SFIZZ_SNDFILE_STATIC}
|
||||||
|
|
||||||
Use vcpkg: ${SFIZZ_USE_VCPKG}
|
Use vcpkg: ${SFIZZ_USE_VCPKG}
|
||||||
Statically link dependencies: ${SFIZZ_STATIC_DEPENDENCIES}
|
|
||||||
Use clang libc++: ${USE_LIBCPP}
|
Use clang libc++: ${USE_LIBCPP}
|
||||||
Release asserts: ${SFIZZ_RELEASE_ASSERTS}
|
Release asserts: ${SFIZZ_RELEASE_ASSERTS}
|
||||||
|
|
||||||
|
|
@ -163,24 +166,28 @@ Use system pugixml: ${SFIZZ_USE_SYSTEM_PUGIXML}
|
||||||
Use system simde: ${SFIZZ_USE_SYSTEM_SIMDE}")
|
Use system simde: ${SFIZZ_USE_SYSTEM_SIMDE}")
|
||||||
if(CMAKE_PROJECT_NAME STREQUAL "sfizz")
|
if(CMAKE_PROJECT_NAME STREQUAL "sfizz")
|
||||||
message(STATUS "
|
message(STATUS "
|
||||||
Build AU plug-in: ${SFIZZ_AU}
|
|
||||||
Build LV2 plug-in: ${SFIZZ_LV2}
|
|
||||||
Build LV2 user interface: ${SFIZZ_LV2_UI}
|
|
||||||
Build VST plug-in: ${SFIZZ_VST}
|
|
||||||
|
|
||||||
Use system lv2: ${SFIZZ_USE_SYSTEM_LV2}
|
Use system lv2: ${SFIZZ_USE_SYSTEM_LV2}
|
||||||
Use system vst3sdk sources: ${SFIZZ_USE_SYSTEM_VST3SDK}
|
Use system vst3sdk sources: ${SFIZZ_USE_SYSTEM_VST3SDK}
|
||||||
|
|
||||||
LV2 plugin-side CC automation ${SFIZZ_LV2_PSA}
|
Build AU plug-in: ${PLUGIN_AU}
|
||||||
|
Build LV2 plug-in: ${PLUGIN_LV2}
|
||||||
|
Build LV2 user interface: ${PLUGIN_LV2_UI}
|
||||||
|
LV2 plugin-side CC automation ${PLUGIN_LV2_PSA}
|
||||||
|
Build Pure Data plug-in: ${PLUGIN_PUREDATA}
|
||||||
|
Build VST plug-in: ${PLUGIN_VST}
|
||||||
|
|
||||||
|
AU destination directory: ${AU_PLUGIN_INSTALL_DIR}
|
||||||
LV2 destination directory: ${LV2PLUGIN_INSTALL_DIR}
|
LV2 destination directory: ${LV2PLUGIN_INSTALL_DIR}
|
||||||
|
Pd destination directory: ${PD_PLUGIN_INSTALL_DIR}
|
||||||
VST destination directory: ${VSTPLUGIN_INSTALL_DIR}")
|
VST destination directory: ${VSTPLUGIN_INSTALL_DIR}")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "
|
message(STATUS "
|
||||||
Install prefix: ${CMAKE_INSTALL_PREFIX}
|
Install prefix: ${CMAKE_INSTALL_PREFIX}
|
||||||
|
|
||||||
Compiler CXX debug flags: ${CMAKE_CXX_FLAGS_DEBUG}
|
CXX Debug flags: ${CMAKE_CXX_FLAGS_DEBUG}
|
||||||
Compiler CXX release flags: ${CMAKE_CXX_FLAGS_RELEASE}
|
CXX Release flags: ${CMAKE_CXX_FLAGS_RELEASE}
|
||||||
Compiler CXX min size flags: ${CMAKE_CXX_FLAGS_MINSIZEREL}
|
CXX MinSize flags: ${CMAKE_CXX_FLAGS_MINSIZEREL}
|
||||||
|
CXX RelWithDebInfo flags: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
|
||||||
")
|
")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ if(OPENMP_FOUND)
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:${SFIZZ_OpenMP_CXX_OPTIONS}>)
|
$<$<COMPILE_LANGUAGE:CXX>:${SFIZZ_OpenMP_CXX_OPTIONS}>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# FIXME: remove UI libs which was used by plugins only
|
||||||
# Find macOS system libraries
|
# Find macOS system libraries
|
||||||
# TODO: remove UI libs which was used by plugins only
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
find_library(APPLE_COREFOUNDATION_LIBRARY "CoreFoundation")
|
find_library(APPLE_COREFOUNDATION_LIBRARY "CoreFoundation")
|
||||||
find_library(APPLE_FOUNDATION_LIBRARY "Foundation")
|
find_library(APPLE_FOUNDATION_LIBRARY "Foundation")
|
||||||
|
|
@ -122,7 +122,7 @@ if(SFIZZ_USE_SNDFILE OR SFIZZ_DEMOS OR SFIZZ_DEVTOOLS OR SFIZZ_BENCHMARKS)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(SNDFILE "sndfile" REQUIRED)
|
pkg_check_modules(SNDFILE "sndfile" REQUIRED)
|
||||||
target_include_directories(sfizz_sndfile INTERFACE ${SNDFILE_INCLUDE_DIRS})
|
target_include_directories(sfizz_sndfile INTERFACE ${SNDFILE_INCLUDE_DIRS})
|
||||||
if(SFIZZ_STATIC_DEPENDENCIES)
|
if(SFIZZ_SNDFILE_STATIC)
|
||||||
target_link_libraries(sfizz_sndfile INTERFACE ${SNDFILE_STATIC_LIBRARIES})
|
target_link_libraries(sfizz_sndfile INTERFACE ${SNDFILE_STATIC_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
target_link_libraries(sfizz_sndfile INTERFACE ${SNDFILE_LIBRARIES})
|
target_link_libraries(sfizz_sndfile INTERFACE ${SNDFILE_LIBRARIES})
|
||||||
|
|
|
||||||
|
|
@ -306,15 +306,6 @@ if(SFIZZ_IMPLEMENT_CXX17_ALIGNED_NEW_SUPPORT)
|
||||||
endif()
|
endif()
|
||||||
sfizz_enable_fast_math(sfizz_internal)
|
sfizz_enable_fast_math(sfizz_internal)
|
||||||
|
|
||||||
# TODO: sfz::config::numCCs generated with CMake
|
|
||||||
# Check that sfizz and cmake-side definitions are matching
|
|
||||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/sfizz_match_definitions.cpp" "
|
|
||||||
#include \"Config.h\"
|
|
||||||
static_assert(sfz::config::numCCs == ${MIDI_CC_MAX}, \"MIDI_CC_MAX did not match\");
|
|
||||||
")
|
|
||||||
add_library(sfizz_match_definitions STATIC "${CMAKE_CURRENT_BINARY_DIR}/sfizz_match_definitions.cpp")
|
|
||||||
target_link_libraries(sfizz_match_definitions PRIVATE sfizz::internal)
|
|
||||||
|
|
||||||
# Sfizz static library
|
# Sfizz static library
|
||||||
add_library(sfizz_static STATIC sfizz/sfizz_wrapper.cpp sfizz/sfizz.cpp sfizz/sfizz_private.hpp)
|
add_library(sfizz_static STATIC sfizz/sfizz_wrapper.cpp sfizz/sfizz.cpp sfizz/sfizz_private.hpp)
|
||||||
add_library(sfizz::static ALIAS sfizz_static)
|
add_library(sfizz::static ALIAS sfizz_static)
|
||||||
|
|
|
||||||
184
src/Config.h.in
Normal file
184
src/Config.h.in
Normal file
|
|
@ -0,0 +1,184 @@
|
||||||
|
// SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
|
||||||
|
// This code is part of the sfizz library and is licensed under a BSD 2-clause
|
||||||
|
// license. You should have receive a LICENSE.md file along with the code.
|
||||||
|
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#ifdef _WIN32
|
||||||
|
// There's a spurious min/max function in MSVC that makes everything go badly...
|
||||||
|
#ifndef NOMINMAX
|
||||||
|
#define NOMINMAX 1
|
||||||
|
#endif
|
||||||
|
#define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
|
||||||
|
#endif
|
||||||
|
#include "absl/strings/string_view.h"
|
||||||
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
namespace sfz {
|
||||||
|
|
||||||
|
enum ExtendedCCs {
|
||||||
|
pitchBend = 128,
|
||||||
|
channelAftertouch = 129,
|
||||||
|
polyphonicAftertouch = 130,
|
||||||
|
noteOnVelocity = 131,
|
||||||
|
noteOffVelocity = 132,
|
||||||
|
keyboardNoteNumber = 133,
|
||||||
|
keyboardNoteGate = 134,
|
||||||
|
unipolarRandom = 135,
|
||||||
|
bipolarRandom = 136,
|
||||||
|
alternate = 137,
|
||||||
|
keydelta = 140,
|
||||||
|
absoluteKeydelta = 141,
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace config {
|
||||||
|
constexpr float defaultSampleRate { 48000 };
|
||||||
|
constexpr float maxSampleRate { 192000 };
|
||||||
|
constexpr int defaultSamplesPerBlock { 1024 };
|
||||||
|
constexpr int maxBlockSize { 8192 };
|
||||||
|
constexpr int bufferPoolSize { 6 };
|
||||||
|
constexpr int stereoBufferPoolSize { 4 };
|
||||||
|
constexpr int indexBufferPoolSize { 4 };
|
||||||
|
constexpr int preloadSize { 8192 };
|
||||||
|
constexpr bool loadInRam { false };
|
||||||
|
constexpr int loggerQueueSize { 256 };
|
||||||
|
constexpr int voiceLoggerQueueSize { 256 };
|
||||||
|
constexpr bool loggingEnabled { false };
|
||||||
|
constexpr size_t maxChannels { 32 };
|
||||||
|
constexpr int numBackgroundThreads { 4 };
|
||||||
|
constexpr unsigned fileClearingPeriod { 5 }; // in seconds
|
||||||
|
constexpr int numVoices { 64 };
|
||||||
|
constexpr unsigned maxVoices { 256 };
|
||||||
|
constexpr unsigned smoothingSteps { 512 };
|
||||||
|
constexpr uint16_t xfadeSmoothing { 5 };
|
||||||
|
constexpr uint16_t gainSmoothing { 0 };
|
||||||
|
constexpr unsigned powerTableSizeExponent { 11 };
|
||||||
|
constexpr int maxFilePromises { maxVoices };
|
||||||
|
constexpr int allSoundOffCC { 120 };
|
||||||
|
constexpr int resetCC { 121 };
|
||||||
|
constexpr int allNotesOffCC { 123 };
|
||||||
|
constexpr int omniOffCC { 124 };
|
||||||
|
constexpr int omniOnCC { 125 };
|
||||||
|
constexpr int centPerSemitone { 100 };
|
||||||
|
constexpr float virtuallyZero { 0.001f };
|
||||||
|
constexpr float fastReleaseDuration { 0.01f };
|
||||||
|
constexpr char defineCharacter { '$' };
|
||||||
|
constexpr float A440 { 440.0 };
|
||||||
|
constexpr size_t powerHistoryLength { 16 };
|
||||||
|
constexpr size_t powerFollowerStep { 512 };
|
||||||
|
constexpr float powerFollowerAttackTime { 5e-3f };
|
||||||
|
constexpr float powerFollowerReleaseTime { 200e-3f };
|
||||||
|
constexpr uint16_t numCCs { @MIDI_CC_COUNT@ };
|
||||||
|
constexpr int maxCurves { 256 };
|
||||||
|
constexpr int fileChunkSize { 1024 };
|
||||||
|
constexpr int processChunkSize { 16 };
|
||||||
|
constexpr unsigned int defaultAlignment { 16 };
|
||||||
|
constexpr int filtersInPool { maxVoices * 2 };
|
||||||
|
constexpr int excessFileFrames { 64 };
|
||||||
|
constexpr int maxLFOSubs { 8 };
|
||||||
|
constexpr int maxLFOSteps { 128 };
|
||||||
|
/**
|
||||||
|
* @brief The threshold for age stealing.
|
||||||
|
* In percentage of the voice's max age.
|
||||||
|
*/
|
||||||
|
constexpr float stealingAgeCoeff { 0.5f };
|
||||||
|
/**
|
||||||
|
* @brief The threshold for power stealing.
|
||||||
|
* In percentage of the sum of all powers.
|
||||||
|
*/
|
||||||
|
constexpr float stealingPowerCoeff { 0.5f };
|
||||||
|
constexpr int filtersPerVoice { 2 };
|
||||||
|
constexpr int eqsPerVoice { 3 };
|
||||||
|
constexpr int oscillatorsPerVoice { 9 };
|
||||||
|
constexpr float uniformNoiseBounds { 1.0f };
|
||||||
|
constexpr float noiseVariance { 0.25f };
|
||||||
|
/**
|
||||||
|
Minimum interval in frames between recomputations of coefficients of the
|
||||||
|
modulated filter. The lower, the more CPU resources are consumed.
|
||||||
|
*/
|
||||||
|
constexpr int filterControlInterval { 16 };
|
||||||
|
/**
|
||||||
|
Amplitude below which an exponential releasing envelope is considered as
|
||||||
|
finished.
|
||||||
|
*/
|
||||||
|
constexpr float egReleaseThreshold = 1e-4;
|
||||||
|
/**
|
||||||
|
Duration of a linear transition user to smooth cases of otherwise
|
||||||
|
immediate level transitions. (eg. decay->sustain or release->off)
|
||||||
|
*/
|
||||||
|
constexpr float egTransitionTime = 50e-3;
|
||||||
|
/**
|
||||||
|
Default metadata for MIDIName documents
|
||||||
|
*/
|
||||||
|
const absl::string_view midnamManufacturer { "The Sfizz authors" };
|
||||||
|
const absl::string_view midnamModel { "Sfizz" };
|
||||||
|
/**
|
||||||
|
Limit of how many "fxN" buses are accepted (in SFZv2, maximum is 4)
|
||||||
|
*/
|
||||||
|
constexpr int maxEffectBuses { 256 };
|
||||||
|
// Wavetable constants; amplitude values are matched to reference
|
||||||
|
static constexpr unsigned tableSize = 1024;
|
||||||
|
static constexpr double tableRefSampleRate = 44100.0 * 1.1; // +10% aliasing permissivity
|
||||||
|
/**
|
||||||
|
Default wave amplitudes, adjusted for consistent RMS among all waves.
|
||||||
|
(except square curiously, but it's to match ARIA)
|
||||||
|
*/
|
||||||
|
static constexpr double amplitudeSine = 1.0;
|
||||||
|
static constexpr double amplitudeTriangle = 1.0;
|
||||||
|
static constexpr double amplitudeSaw = 0.8164965809277261; // sqrt(2)/sqrt(3)
|
||||||
|
static constexpr double amplitudeSquare = 0.8164965809277261; // should have been sqrt(2)?
|
||||||
|
/**
|
||||||
|
Frame count high limit, for automatically loading a sound file as wavetable.
|
||||||
|
Set to 3000 according to Cakewalk.
|
||||||
|
*/
|
||||||
|
static constexpr unsigned wavetableMaxFrames = 3000;
|
||||||
|
/**
|
||||||
|
Background file loading
|
||||||
|
*/
|
||||||
|
static constexpr int backgroundLoaderPthreadPriority = 50; // expressed in %
|
||||||
|
/**
|
||||||
|
@brief Ratio to target under which smoothing is considered as completed
|
||||||
|
*/
|
||||||
|
static constexpr float smoothingShortcutThreshold = 5e-3;
|
||||||
|
// loop crossfade settings
|
||||||
|
static constexpr int loopXfadeCurve = 2; // 0: linear
|
||||||
|
// 1: use curves 5 & 6
|
||||||
|
// 2: use S-shaped curve
|
||||||
|
/**
|
||||||
|
* @brief Overflow voices in the engine, relative to the required voices.
|
||||||
|
* These are additional voices that more or less hold the "dying" voices
|
||||||
|
* due to engine polyphony being reached.
|
||||||
|
*/
|
||||||
|
static constexpr float overflowVoiceMultiplier { 1.5f };
|
||||||
|
static_assert(overflowVoiceMultiplier >= 1.0f, "This needs to add voices");
|
||||||
|
/**
|
||||||
|
* @brief Minimum number of overflow voices to add
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static constexpr int minOverflowVoices { 4 };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The smoothing time constant per "smooth" steps
|
||||||
|
*/
|
||||||
|
constexpr float smoothTauPerStep { 3e-3 };
|
||||||
|
/**
|
||||||
|
* @brief If a value below this threshold is given to `ampeg_sustain`, the envelope will free-run
|
||||||
|
* and the voice will release itself at the end of the decay stage.
|
||||||
|
*/
|
||||||
|
constexpr float sustainFreeRunningThreshold { 0.0032f };
|
||||||
|
/**
|
||||||
|
* @brief Number of frames offset between the end of a block and the beginning of the next
|
||||||
|
* detected as a shift in the playhead position
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
constexpr int playheadMovedFrames { 16 };
|
||||||
|
/**
|
||||||
|
* @brief Max number of voices to start on release pedal up
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
constexpr unsigned delayedReleaseVoices { 16 };
|
||||||
|
} // namespace config
|
||||||
|
|
||||||
|
} // namespace sfz
|
||||||
Loading…
Add table
Reference in a new issue