From eadb1b4bebbdfaa3d4fd905cbeaa6db16c0993e8 Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Wed, 20 Oct 2021 23:53:34 +0200 Subject: [PATCH] Add man pages for executables And correct a small bug in the jack client --- clients/CMakeLists.txt | 8 ++++++++ clients/jack_client.cpp | 2 +- clients/sfizz_jack.man.in | 37 +++++++++++++++++++++++++++++++++++++ clients/sfizz_render.man.in | 30 ++++++++++++++++++++++++++++++ cmake/LV2Config.cmake | 2 +- cmake/SfizzConfig.cmake | 3 +++ src/CMakeLists.txt | 2 -- 7 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 clients/sfizz_jack.man.in create mode 100644 clients/sfizz_render.man.in diff --git a/clients/CMakeLists.txt b/clients/CMakeLists.txt index a22bbe29..cf10957b 100644 --- a/clients/CMakeLists.txt +++ b/clients/CMakeLists.txt @@ -1,14 +1,22 @@ +string(TIMESTAMP MAN_TODAY "%Y-%m-%d") + if(SFIZZ_JACK) add_executable(sfizz_jack MidiHelpers.h jack_client.cpp) target_link_libraries(sfizz_jack PRIVATE sfizz::import sfizz::sfizz sfizz::jack sfizz::spin_mutex absl::flags_parse) sfizz_enable_lto_if_needed(sfizz_jack) + configure_file(sfizz_jack.man.in sfizz_jack.man @ONLY) install(TARGETS sfizz_jack DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT "jack" OPTIONAL) + install(FILES ${PROJECT_BINARY_DIR}/clients/sfizz_jack.man DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 + RENAME sfizz_jack COMPONENT "jack" OPTIONAL) endif() if(SFIZZ_RENDER) add_executable(sfizz_render MidiHelpers.h sfizz_render.cpp) target_link_libraries(sfizz_render PRIVATE sfizz::internal sfizz::fmidi sfizz::cxxopts st_audiofile_formats) sfizz_enable_lto_if_needed(sfizz_render) + configure_file(sfizz_render.man.in sfizz_render.man @ONLY) install(TARGETS sfizz_render DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT "render" OPTIONAL) + install(FILES ${PROJECT_BINARY_DIR}/clients/sfizz_render.man DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 + RENAME sfizz_render COMPONENT "render" OPTIONAL) endif() diff --git a/clients/jack_client.cpp b/clients/jack_client.cpp index 8f5f30d1..20d6e6d5 100644 --- a/clients/jack_client.cpp +++ b/clients/jack_client.cpp @@ -369,7 +369,7 @@ int main(int argc, char** argv) jack_free(systemPorts); } - if (filesToParse[0]) { + if (!filesToParse.empty() && filesToParse[0]) { loadInstrument(filesToParse[0]); } diff --git a/clients/sfizz_jack.man.in b/clients/sfizz_jack.man.in new file mode 100644 index 00000000..35815adc --- /dev/null +++ b/clients/sfizz_jack.man.in @@ -0,0 +1,37 @@ +.TH sfizz_jack 1 "@MAN_TODAY@" "@CMAKE_PROJECT_VERSION@" "sfizz_jack man page" +.SH NAME +sfizz_jack \- Launch a sfizz instance as a JACK client +.SH SYNOPSIS +sfizz_jack [FILE] [OPTIONS...] +.SH DESCRIPTION +sfizz_jack wraps the sfizz SFZ library in a JACK client that can be controlled by a text interface. +.SH OPTIONS +.IP FILE +An optional SFZ file name to load at firsts +.IP "--client_name" +Name for the JACK client +.IP "--num_voices NUMBER" +Change the maximum polyphony +.IP "--preload_size NUMBER" +Bytes to preload in cache for samples +.IP "--state" +Output the state in the JACK loop +.IP "--jack_autoconnect" +Autoconnect the JACK outputs +.SH TEXT INTERFACE +It is possible it interact with the JACK client through the standard input. +The possible commands are +.IP "load_instrument FILE" +Load an instrument +.IP "set_preload_size NUMBER" +Set the number of bytes to preload in cache for samples +.IP "set_voices NUMBER" +Change the maximum polyphony +.IP quit +Quit +.SH SEE ALSO +sfizz_render(1) +.SH BUGS +See the main repository at @SFIZZ_REPOSITORY@. +.SH AUTHOR +Contributors can be seen on the main repository at @SFIZZ_REPOSITORY@. diff --git a/clients/sfizz_render.man.in b/clients/sfizz_render.man.in new file mode 100644 index 00000000..73a12e12 --- /dev/null +++ b/clients/sfizz_render.man.in @@ -0,0 +1,30 @@ +.TH sfizz_render 1 "@MAN_TODAY@" "@CMAKE_PROJECT_VERSION@" "sfizz_render man page" +.SH NAME +sfizz_render \- Render a MIDI file as a WAV file using an SFZ instrument description. +.SH SYNOPSIS +sfizz_render --sfz FILE --wav FILE --midi FILE [OPTIONS...] +.SH DESCRIPTION +sfizz_render wraps the sfizz SFZ library and can be used to render midi file as sound files using an SFZ description file and its associated samples. +.SH OPTIONS +.IP "-b, --blocksize NUMBER" +Block size for the sfizz callbacks +.IP "-s, --samplerate NUMBER" +Output sample rate +.IP "-q, --quality NUMBER" +Resampling quality, like the SFZ sample_quality opcode. A value of 1 will use a linear interpolation of source samples, while higher value will use increasingly better algorithms. +.IP "-p, --polyphony NUMBER" +Maximum polyphony +.IP "-v, --verbose" +Verbose output +.IP "--log PREFIX" +Produce logs +.IP "--use-eot" +End the rendering at the last End of Track Midi message +.IP "-h, --help" +Show help +.SH SEE ALSO +sfizz_jack(1) +.SH BUGS +See the main repository at @SFIZZ_REPOSITORY@. +.SH AUTHOR +Contributors can be seen on the main repository at @SFIZZ_REPOSITORY@. diff --git a/cmake/LV2Config.cmake b/cmake/LV2Config.cmake index a7ca3cd1..da2bd40f 100644 --- a/cmake/LV2Config.cmake +++ b/cmake/LV2Config.cmake @@ -8,7 +8,7 @@ set(LV2PLUGIN_VERSION_MICRO 0) set(LV2PLUGIN_NAME "sfizz") set(LV2PLUGIN_COMMENT "SFZ sampler") set(LV2PLUGIN_URI "http://sfztools.github.io/sfizz") -set(LV2PLUGIN_REPOSITORY "https://github.com/sfztools/sfizz") +set(LV2PLUGIN_REPOSITORY SFIZZ_REPOSITORY) set(LV2PLUGIN_AUTHOR "SFZTools") set(LV2PLUGIN_EMAIL "paul@ferrand.cc") if(SFIZZ_USE_VCPKG) diff --git a/cmake/SfizzConfig.cmake b/cmake/SfizzConfig.cmake index 9d134fe9..74c0e6a9 100644 --- a/cmake/SfizzConfig.cmake +++ b/cmake/SfizzConfig.cmake @@ -129,6 +129,9 @@ if(USE_LIBCPP) add_link_options(-lc++abi) # New command on CMake master, not in 3.12 release endif() +set(SFIZZ_REPOSITORY https://github.com/sfztools/sfizz) +include(GNUInstallDirs) + # Don't show build information when building a different project function(show_build_info_if_needed) if(CMAKE_PROJECT_NAME STREQUAL "sfizz") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 13f17efd..ad678666 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,3 @@ -include(GNUInstallDirs) - set(FAUST_FILES sfizz/dsp/filters/filters_modulable.dsp sfizz/dsp/filters/rbj_filters.dsp