synthv1-1.4.2/PaxHeaders/CMakeLists.txt 0000644 0000000 0000000 00000000132 15174622017 014755 x ustar 00 30 mtime=1777542159.038465743
30 atime=1777542159.038465743
30 ctime=1777542159.038465743
synthv1-1.4.2/CMakeLists.txt 0000644 0001750 0000144 00000027171 15174622017 014755 0 ustar 00rncbc users cmake_minimum_required (VERSION 3.15)
project (synthv1
VERSION 1.4.2
DESCRIPTION "an old-school polyphonic synthesizer"
HOMEPAGE_URL "https://synthv1.sourceforge.io"
LANGUAGES C CXX)
set (PROJECT_COPYRIGHT "Copyright (C) 2012-2026, rncbc aka Rui Nuno Capela. All rights reserved.")
set (PROJECT_DOMAIN "rncbc.org")
execute_process (
COMMAND git describe --tags --dirty --abbrev=6
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT
RESULT_VARIABLE GIT_DESCRIBE_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (GIT_DESCRIBE_RESULT EQUAL 0)
set (GIT_VERSION "${GIT_DESCRIBE_OUTPUT}")
string (REGEX REPLACE "^[^0-9]+" "" GIT_VERSION "${GIT_VERSION}")
string (REGEX REPLACE "-g" "git." GIT_VERSION "${GIT_VERSION}")
string (REGEX REPLACE "[_|-]" "." GIT_VERSION "${GIT_VERSION}")
execute_process (
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_REVPARSE_OUTPUT
RESULT_VARIABLE GIT_REVPARSE_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (GIT_REVPARSE_RESULT EQUAL 0 AND NOT GIT_REVPARSE_OUTPUT STREQUAL "main")
set (GIT_VERSION "${GIT_VERSION} [${GIT_REVPARSE_OUTPUT}]")
endif ()
set (PROJECT_VERSION "${GIT_VERSION}")
endif ()
if (CMAKE_BUILD_TYPE MATCHES "Debug")
set (CONFIG_DEBUG 1)
set (CONFIG_BUILD_TYPE "debug")
else ()
set (CONFIG_DEBUG 0)
set (CONFIG_BUILD_TYPE "release")
set (CMAKE_BUILD_TYPE "Release")
endif ()
set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
include (GNUInstallDirs)
set (CONFIG_BINDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_BINDIR}")
set (CONFIG_LIBDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set (CONFIG_DATADIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_DATADIR}")
set (CONFIG_MANDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_MANDIR}")
# Enable JACK standalone build.
option (CONFIG_JACK "Enable JACK stand-alone build (default=yes)" 1)
# Enable JACK session support.
option (CONFIG_JACK_SESSION "Enable JACK session support (default=yes)" 1)
# Enable JACK MIDI support option.
option (CONFIG_JACK_MIDI "Enable JACK MIDI support (default=yes)" 1)
# Enable ALSA MIDI support option.
option (CONFIG_ALSA_MIDI "Enable ALSA MIDI support (default=yes)" 1)
# Enable LV2 plugin build.
option (CONFIG_LV2 "Enable LV2 plug-in build (default=yes)" 1)
if (WIN32)
option (CONFIG_LV2_UI_WINDOWS "Enable LV2 plug-in Windows UI support (default=yes)" 1)
# Windows install target path.
set (CONFIG_WINDOWS_LV2_PATH "$ENV{SYSTEMDRIVE}/Program Files/Common Files/LV2" CACHE STRING "Specify Windows LV2 install path")
else ()
option (CONFIG_LV2_UI_X11 "Enable LV2 plug-in X11 UI support (default=yes)" 1)
endif ()
option (CONFIG_LV2_UI_EXTERNAL "Enable LV2 plug-in External UI support (default=yes)" 1)
option (CONFIG_LV2_UI_IDLE "Enable LV2 UI Idle interface support (default=yes)" 1)
option (CONFIG_LV2_UI_SHOW "Enable LV2 UI Show interface support (default=yes)" 1)
option (CONFIG_LV2_UI_RESIZE "Enable LV2 UI Resize interface support (default=yes)" 1)
option (CONFIG_LV2_PROGRAMS "Enable LV2 plug-in Programs support (default=yes)" 1)
option (CONFIG_LV2_PATCH "Enable LV2 plug-in Patch support (default=yes)" 1)
option (CONFIG_LV2_PORT_EVENT "Enable LV2 plug-in Port-event support (default=yes)" 1)
option (CONFIG_LV2_PORT_CHANGE_REQUEST "Enable LV2 plug-in Port-change request support (default=yes)" 1)
# Enable liblo availability.
option (CONFIG_LIBLO "Enable liblo interface (default=yes)" 1)
# Enable NSM support.
option (CONFIG_NSM "Enable NSM support (default=yes)" 1)
# Enable Qt6 build preference.
option (CONFIG_QT6 "Enable Qt6 build (default=yes)" 1)
# Fix for new CMAKE_REQUIRED_LIBRARIES policy.
if (POLICY CMP0075)
cmake_policy (SET CMP0075 NEW)
endif ()
# Fix for CXX_VISIBILITY_PRESET policy.
if (POLICY CMP0063)
cmake_policy (SET CMP0063 NEW)
set (CMAKE_CXX_VISIBILITY_PRESET hidden)
set (CMAKE_VISIBILITY_INLINES_HIDDEN 1)
endif ()
# Check for Qt...
if (CONFIG_QT6)
find_package (Qt6 QUIET)
if (NOT Qt6_FOUND)
set (CONFIG_QT6 0)
endif ()
endif ()
if (CONFIG_QT6)
find_package (QT QUIET NAMES Qt6)
else ()
find_package (QT QUIET NAMES Qt5)
endif ()
find_package (Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets Xml Svg)
#find_package (Qt${QT_VERSION_MAJOR}LinguistTools)
include (CheckIncludeFile)
include (CheckIncludeFiles)
include (CheckIncludeFileCXX)
include (CheckFunctionExists)
include (CheckLibraryExists)
# Make sure we get some subtle optimizations out there...
add_compile_options (-ffast-math)
# Checks for header files.
if (UNIX AND NOT APPLE)
check_include_files ("fcntl.h;unistd.h;signal.h" HAVE_SIGNAL_H)
endif ()
# Find package modules
include (FindPkgConfig)
# Check for JACK libraries.
if (CONFIG_JACK)
pkg_check_modules (JACK IMPORTED_TARGET jack>=0.100.0)
if (JACK_FOUND)
find_library (JACK_LIBRARY NAMES ${JACK_LIBRARIES} HINTS ${JACK_LIBDIR})
endif ()
if (JACK_LIBRARY)
set (CONFIG_JACK 1)
set (CMAKE_REQUIRED_LIBRARIES "${JACK_LIBRARY};${CMAKE_REQUIRED_LIBRARIES}")
# Check for JACK MIDI headers availability.
if (CONFIG_JACK_MIDI)
check_include_file (jack/midiport.h HAVE_JACK_MIDIPORT_H)
if (NOT HAVE_JACK_MIDIPORT_H)
set (CONFIG_JACK_MIDI 0)
endif ()
endif ()
# Check for JACK session headers availability.
if (CONFIG_JACK_SESSION)
check_include_file (jack/session.h HAVE_JACK_SESSION_H)
if (NOT HAVE_JACK_SESSION_H)
set (CONFIG_JACK_SESSION 0)
endif ()
endif ()
# Check for JACK session event callback availability.
if (CONFIG_JACK_SESSION)
check_function_exists (jack_set_session_callback CONFIG_JACK_SESSION)
endif ()
# Check for ALSA libraries.
if (CONFIG_ALSA_MIDI)
pkg_check_modules (ALSA IMPORTED_TARGET alsa)
if (ALSA_FOUND)
find_library (ALSA_LIBRARY NAMES ${ALSA_LIBRARIES} HINTS ${ALSA_LIBDIR})
endif ()
if (ALSA_LIBRARY)
set (CONFIG_ALSA_MIDI 1)
#set (CMAKE_REQUIRED_LIBRARIES "${ALSA_LIBRARY};${CMAKE_REQUIRED_LIBRARIES}")
else ()
message (WARNING "*** ALSA library not found.")
endif ()
endif ()
else ()
message (WARNING "*** JACK library not found.")
set (CONFIG_JACK 0)
endif ()
endif ()
if (NOT CONFIG_JACK)
set (CONFIG_JACK_SESSION 0)
set (CONFIG_JACK_MIDI 0)
set (CONFIG_ALSA_MIDI 0)
set (CONFIG_LIBLO 0)
set (CONFIG_NSM 0)
endif ()
# Check for LIBLO libraries.
if (CONFIG_LIBLO)
pkg_check_modules (LIBLO IMPORTED_TARGET liblo)
if (NOT LIBLO_FOUND)
message (WARNING "*** LIBLO library not found.")
set (CONFIG_LIBLO 0)
endif ()
endif ()
# Check for LV2 support.
if (CONFIG_LV2)
pkg_check_modules (LV2 lv2)
if (LV2_FOUND)
include_directories (${LV2_INCLUDE_DIRS})
# Check for LV2 old/new headers style.
check_include_file (lv2/urid/urid.h HAVE_LV2_URID_H)
if (NOT HAVE_LV2_URID_H)
check_include_file (lv2/lv2plug.in/ns/ext/urid/urid.h HAVE_OLD_LV2_URID_H)
if (NOT HAVE_OLD_LV2_URID_H)
set (CONFIG_LV2 0)
else ()
set (CONFIG_LV2_OLD_HEADERS 1)
endif ()
else ()
set (CONFIG_LV2_OLD_HEADERS 0)
endif ()
endif ()
if (NOT CONFIG_LV2)
message (WARNING "*** LV2 SDK not found.")
endif ()
endif ()
if (CONFIG_LV2)
# Check for LV2 Atom support.
if (CONFIG_LV2_OLD_HEADERS)
check_include_file (lv2/lv2plug.in/ns/ext/atom/atom.h HAVE_LV2_ATOM_H)
else ()
check_include_file (lv2/atom/atom.h HAVE_LV2_ATOM_H)
endif ()
if (NOT HAVE_LV2_ATOM_H)
set (CONFIG_LV2_ATOM 0)
else ()
set (CONFIG_LV2_ATOM 1)
endif ()
set (CONFIG_LV2_ATOM_FORGE_OBJECT ${CONFIG_LV2_ATOM})
set (CONFIG_LV2_ATOM_FORGE_KEY ${CONFIG_LV2_ATOM})
# Check for LV2 UI support.
if (CONFIG_LV2_OLD_HEADERS)
check_include_file (lv2/lv2plug.in/ns/extensions/ui/ui.h HAVE_LV2_UI_H)
else ()
check_include_file (lv2/ui/ui.h HAVE_LV2_UI_H)
endif ()
if (NOT HAVE_LV2_UI_H)
set (CONFIG_LV2_UI 0)
else ()
set (CONFIG_LV2_UI 1)
endif ()
if (NOT CONFIG_LV2_UI)
set (CONFIG_LV2_UI_X11 0)
set (CONFIG_LV2_UI_WINDOWS 0)
set (CONFIG_LV2_UI_EXTERNAL 0)
set (CONFIG_LV2_UI_IDLE 0)
set (CONFIG_LV2_UI_SHOW 0)
set (CONFIG_LV2_UI_RESIZE 0)
endif ()
endif ()
# Check for LV2 headers.
if (CONFIG_LV2)
set (LV2_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/src/lv2)
set (CMAKE_REQUIRED_INCLUDES "${LV2_INCLUDES};${CMAKE_REQUIRED_INCLUDES}")
include_directories (${LV2_INCLUDES})
if (CONFIG_LV2_OLD_HEADERS)
set (CMAKE_REQUIRED_DEFINITIONS "-DCONFIG_LV2_OLD_HEADERS;${CMAKE_REQUIRED_DEFINITIONS}")
endif ()
else ()
set (CONFIG_LV2_UI_X11 0)
set (CONFIG_LV2_UI_WINDOWS 0)
set (CONFIG_LV2_UI_EXTERNAL 0)
set (CONFIG_LV2_UI_IDLE 0)
set (CONFIG_LV2_UI_SHOW 0)
set (CONFIG_LV2_UI_RESIZE 0)
set (CONFIG_LV2_PROGRAMS 0)
set (CONFIG_LV2_PATCH 0)
set (CONFIG_LV2_PORT_EVENT 0)
set (CONFIG_LV2_PORT_CHANGE_REQUEST 0)
endif ()
if (CONFIG_LV2_UI_EXTERNAL)
check_include_file (lv2_external_ui.h HAVE_LV2_EXTERNAL_UI_H)
if (NOT HAVE_LV2_EXTERNAL_UI_H)
set (CONFIG_LV2_UI_EXTERNAL 0)
endif ()
endif ()
if (CONFIG_LV2_PROGRAMS)
check_include_file (lv2_programs.h HAVE_LV2_PROGRAMS_H)
if (NOT HAVE_LV2_PROGRAMS_H)
set (CONFIG_LV2_PROGRAMS 0)
endif ()
endif ()
if (CONFIG_LV2_PATCH)
if (CONFIG_LV2_OLD_HEADERS)
check_include_file (lv2/lv2plug.in/ns/ext/patch/patch.h HAVE_LV2_PATCH_H)
else ()
check_include_file (lv2/patch/patch.h HAVE_LV2_PATCH_H)
endif ()
if (NOT HAVE_LV2_PATCH_H)
set (CONFIG_LV2_PATCH 0)
endif ()
endif ()
if (CONFIG_LV2_PORT_CHANGE_REQUEST)
check_include_file (lv2_port_change_request.h HAVE_LV2_PORT_CHANGE_REQUEST_H)
if (NOT HAVE_LV2_PORT_CHANGE_REQUEST_H)
set (CONFIG_LV2_PORT_CHANGE_REQUEST 0)
endif ()
endif ()
add_subdirectory (src)
# Finally check whether Qt is statically linked.
if (QT_FEATURE_static)
set(QT_VERSION "${QT_VERSION}-static")
endif ()
# Configuration status
macro (SHOW_OPTION text value)
if (${value})
message ("${text}: yes")
else ()
message ("${text}: no")
endif ()
endmacro ()
message ("\n ${PROJECT_NAME} ${PROJECT_VERSION} (Qt ${QT_VERSION})")
message ("\n Build target . . . . . . . . . . . . . . . . . . .: ${CONFIG_BUILD_TYPE}\n")
show_option (" JACK stand-alone build . . . . . . . . . . . . . ." CONFIG_JACK)
show_option (" JACK session support . . . . . . . . . . . . . . ." CONFIG_JACK_SESSION)
show_option (" JACK MIDI support . . . . . . . . . . . . . . . ." CONFIG_JACK_MIDI)
show_option (" ALSA MIDI support . . . . . . . . . . . . . . . ." CONFIG_ALSA_MIDI)
show_option (" LV2 plug-in build . . . . . . . . . . . . . . . ." CONFIG_LV2)
if (WIN32)
show_option (" LV2 plug-in Windows UI support . . . . . . . . ." CONFIG_LV2_UI_WINDOWS)
else ()
show_option (" LV2 plug-in X11 UI support . . . . . . . . . . ." CONFIG_LV2_UI_X11)
endif ()
show_option (" LV2 plug-in External UI support . . . . . . . . ." CONFIG_LV2_UI_EXTERNAL)
show_option (" LV2 plug-in UI Idle interface support . . . . . ." CONFIG_LV2_UI_IDLE)
show_option (" LV2 plug-in UI Show interface support . . . . . ." CONFIG_LV2_UI_SHOW)
show_option (" LV2 plug-in UI Resize interface support . . . . ." CONFIG_LV2_UI_RESIZE)
show_option (" LV2 plug-in Programs support . . . . . . . . . . ." CONFIG_LV2_PROGRAMS)
show_option (" LV2 plug-in Patch support . . . . . . . . . . . ." CONFIG_LV2_PATCH)
show_option (" LV2 plug-in Port-event support . . . . . . . . . ." CONFIG_LV2_PORT_EVENT)
show_option (" LV2 plug-in Port-change request . . . . . . . . ." CONFIG_LV2_PORT_CHANGE_REQUEST)
show_option (" OSC service support (liblo) . . . . . . . . . . ." CONFIG_LIBLO)
show_option (" Non/New Session Management (NSM) support . . . . ." CONFIG_NSM)
message ("\n Install prefix . . . . . . . . . . . . . . . . . .: ${CONFIG_PREFIX}\n")
synthv1-1.4.2/PaxHeaders/ChangeLog 0000644 0000000 0000000 00000000132 15174622017 013767 x ustar 00 30 mtime=1777542159.038465743
30 atime=1777542159.038465743
30 ctime=1777542159.038465743
synthv1-1.4.2/ChangeLog 0000644 0001750 0000144 00000063560 15174622017 013771 0 ustar 00rncbc users synthv1 - an old-school polyphonic synthesizer
----------------------------------------------
ChangeLog
1.4.2 2026-04-30 A Spring'26 Release.
- Bumping into next development cycle (Qt >= 6.11)
1.4.1 2026-03-18 An Early-Spring'26 Release.
- DejaVuSansCondensed.ttf is now the officially bundled font.
1.4.0 2026-02-12 A Mid-Winter'26 Release.
- DejaVuSans TTF font is now firmly embedded to improve on the
self-containment status (ie. freetype2 static linking).
- Fixed 'mime-info' file to the correct MIME-type icon names.
- Get rid of CONFIG_WAYLAND build config option; add underlying
platform name (eg. xcb, wayland) to Qt version string.
1.3.2 2025-05-20 A Mid-Spring'25 Release.
- Stepping up next development cycle (Qt >= 6.9)
1.3.1 2025-04-03 An Early Spring'25 Release.
- Fixed command line parsing (QCommandLineParser/Option) to not
exiting the application with a segfault when showing help and
version information.
1.3.0 2025-01-16 A New-Year'25 Release.
- Just another Vee-One's release for the New Year...
1.2.0 2024-12-15 An End-of-Year'24 Release.
- Configure/Tuning: fixed initial scale and keyboard map tooltips.
1.1.3 2024-10-31 A Halloween'24 Release.
- Prepping up next development cycle (Qt >= 6.8)
1.1.2 2024-10-02 An Early-Fall'24 Release.
- Configure: disable widget style option on LV2 plug-ins only,
for which it wasn't working on the JACK stand-alones either.
1.1.1 2024-09-20 An End-ofSummer'24 Release.
- NSM: prevent loading any preset(s) given on command line.
1.1.0 2024-08-28 A Mid-Summer'24 Release.
- LV2 Plug-in Control Input Port-Change Request extension is not
tagged experimental anymore.
1.0.0 2024-06-20 An Unthinkable Release.
- Making up the unthinkable (aka. v1.0.0)
0.9.91 2024-05-02 A Spring'24 Release Candidate 2.
- Prepping the unthinkable (aka. v1.0.0-rc2)
- Updated to latest framework level (Qt >= 6.7)
0.9.90 2024-04-11 A Spring'24 Release Candidate.
- Prepping the unthinkable (aka. v1.0.0-rc1)
- Custom color themes are now file based (*.conf); legacy still
preserved ntl.
- Fixed the build checks on whether to use old or newer style of
LV2 include headers.
0.9.34 2024-01-26 A Winter'24 Release.
- Added build checks on whether to use old or newer style of LV2
include headers.
- LV2 plugin Control Input Port-change request extension feature
support added.
- Updated copyright headers into the New Year (2024).
0.9.33 2023-12-20 An End-of-Autumn'23 Release.
- Minor optimization to denormal avoidance on some fx's.
- Bumping into next development cycle (Qt >= 6.6)
0.9.32 2023-09-12 An End-of-Summer'23 Release.
- Preppings to next development cycle (Qt >= 6.6)
0.9.31 2023-06-06 A Spring'23 Release.
- Make sure the XCB interface is in use when instantiating the
LV2 plugin on non-Qt hosts, allowing LV2 X11 UI embedding to
work and show up properly.
- Prepping into the next development cycle (with Qt >= 6.5).
0.9.30 2023-03-24 An Early-Spring'23 Release.
- Restrict to existing named presets when adding new or editing
programs; load and restore presets directly when previewing
programs (cf. Configure... > Programs).
- NSM open and save operation failures are now replied with an
error status (was always OK before).
- JACK client watchdog introduced for automatic reactivation and
resilience (standalone only).
- NSM announcement reply/error messages now relegated to debug
builds only.
0.9.29 2023-01-25 A Winter'23 Release.
- Bumping copyright headers to the brand new year.
0.9.28 2022-12-29 An End-of-Year'22 Release.
- Mitigate NSM sending lots of dirty messages on SIGTERM signal.
- Although being deprecated to use, JACK Session support hopefuly
fixed once again.
0.9.27 2022-10-04 An Early-Autumn'22 Release.
- Fixed MIDI Controller... modeless dialog (de)instantiation.
- Custom color/style themes applies only to main widget only.
- Fixed typos and updated some old MIDI GM2 Controller names.
0.9.26 2022-06-07 An End-of-Sping'22 Release.
- Corrected an incredible mistake introduced in the last year's
Glide/portamento protential crash fix.
- Added Qt::Svg module as required at build time.
0.9.25 2022-04-07 A Spring'22 Release.
- Added missing file code to desktop exec entry (standalone only).
- Main application icon is now presented in scalable format (SVG).
- Migrated command line parsing to QCommandLineParser/Option
(Qt >= 5.2)
- Avoid issuing NSM dirty messages as much as possible.
0.9.24 2022-01-09 A Winter'22 Release.
- Dropped autotools (autoconf, automake, etc.) build system.
- Fixed deprecate warnings in preparation for Qt >= 6.2.
0.9.23 2021-07-07 An Early-Summer'21 Release.
- Fixed some ages old Glide/portamento potential crash bug
(reported by AnClark).
- Add support for LV2 UI Windows platform (by AnClark).
- Sustenuto pedal controller (MIDI CC#66) is now implemented.
- Have some tolerance for buffer-size changes.
- All builds default to Qt6 (Qt >= 6.1) where available.
- CMake is now the official build system.
0.9.22 2021-05-13 A Spring'21 Release.
- All packaging builds switching to CMake.
0.9.21 2021-03-16 An End-of-Winter'21 Release.
- Fixed an old lurker, causing slight differences to voice
on-sets, due to a wrong initial LFO Volume ramping value.
- Slightly improved eye-candyness to all graphic widgets,
most especially on the EG widget handling, curved lines
and gradient fills.
0.9.20 2021-02-10 A Winter'21 Release.
- When under under the NSM auspices, fix SIGTERM handler
on exit and just hide the main-window on close (applies
to the JACK stand-alone only).
0.9.19 20220-12-19 A Winter'20 Release.
- Fixed display of old knob/dial values on status-bar.
- Reduced formant filter coefficient slew rate, aiming
to a tenfold DSP performance gain.
- Get a chance on bringing Wayland into the picture when
dealing Qt static-linked deliverables.
0.9.18 2020-10-27 A Fall'20 Release.
- Upstream package naming for the JACK standalone and LV2
plugin deliverables are suffixed to '-jack' and '-lv2',
respectively.
- White keys on the virtual piano keyboard are now fully
highlighted.
0.9.17 2020-09-08 Late Summer'10 Release.
- Added -n, --client-name to the JACK stand-alone client
application command line option arguments.
- Fixed unitialized number of voices variable; early-bird
adaptations to Qt6 >= 6.0.0 and C++17 standard.
0.9.16 2020-08-06 A Summer'20 Release.
- Fixed deprecated stuff on an early preparation for Qt6.
0.9.15 2020-06-22 An Early-Summer'20 Release.
- A long awaited expedite "Panic" button is now featured.
- Note velocity doesn't affect DCF envelope anymore.
- Avoid glib event-loop upon LV2 plug-in instantiation.
0.9.14 2020-05-05 A Mid-Spring'20 Release.
- Fixed initial DCF1, LFO1 group enablement (GUI).
- Fixed initial window title for the LV2 External UI.
- LV2 Atom/Port-event host notification support has been
implemented (unofficial).
- Prevent execution of duplicate or redundant MIDI bank-
select/program-change commands.
- Early fixing to build for Qt >= 5.15.0.
0.9.13 2020-03-26 A Spring'20 Release.
- Maximum pitch-bend range has been expanded to 0..400%,
allegedly to support some PME driven instruments (as
kindly requested by sacarlson PR#10).
- Make man page compression reproducible (after request
by Jelle van der Waa, thanks).
- Fixed crash when showing the tooltip of a negative note
number that results from dragging over and beyond the
left edge of the virtual piano keyboard.
- Remove -v (verbose) flag from 'strip' post-link command.
- Fixed CMake build by adding missing Custom Color Theme
(palette) form file (.ui).
- Bumped copyright headers into the New Year (2020).
0.9.12 2019-12-26 The Winter'19 Release.
- Custom color (palette) theme editor introduced; color
(palette) theme changes are now effective immediately,
except on default.
- Second attempt to fix the yet non-official though
CMake build configuration.
- Move QApplication construction/destruction from LV2 UI
to plug-in instantiation and cleanup.
0.9.11 2019-10-31 A Halloween'19 Release.
- When using autotools and ./configure --with-qt=...,
it is also necessary to adjust the PKG_CONFIG_PATH
environment variable (after a merge request by plcl
aka. Pedro López-Cabanillas, while on qmidinet).
- Upstream packaging is now split to JACK standalone and
LV2 plugin only: the former shared common core and UI
package is now duplicated but statically linked though.
0.9.10 2019-09-24 An Early-Fall'19 Release.
- Upstream packaging is now split on JACK standalone,
LV2 plugin and common core and UI packages, similar
to recent Debian practice.
- Added alternate yet non-official CMake build option.
- Fix HiDPI display screen effective support (Qt >= 5.6).
- All randomizers now compliant to the standard normal
distribution.
- Make sure compiler flags comply to c++11 as standard.
0.9.9 2019-07-18 A Summer'19 Release.
- Randomization of current parameters is now available
through a new top-level push-button.
- Updated for the newer Qt5 development tools (>= 5.13).
- Per instance custom tuning (micro-tonal) option has
been added to the previously existing global settings
(cf. Help > Configure... > Tuning > Global, Instance).
- New DCF and LFO Enabled parameters.
- Configure updated to check for qtchooser availability.
0.9.8 2019-06-06 A Spring'19 Release.
- Improved slew-rate to DCF Formant coefficient updates.
- Refactored the LFO Sync for correctness.
- Fixed all LFO Panning and Volume modulation, now being
correctly isolated on a per voice basis.
- Fixed DC offset on all main DCO wavetable oscillators.
- Fixed initial DCO and LFO wave shapes on LV2 plug-in UI.
- Minor update to Debian packaging control file.
0.9.7 2019-04-14 A Spring-Break'19 Release.
- All audio input now get through without being processed
by any or whole effects stage anymore.
- Re-defined all JACK stand-alone client application UNIX
signal handling.
0.9.6 2019-03-18 Pre-LAC2019 Release Frenzy.
- A gentlier shutdown for the JACK client standalone client.
0.9.5 2019-03-04 The End of Winter'19 release.
- HiDPI display screen support (Qt >= 5.6).
- A fake/visual piano-keyboard widget is now being introduced
to the status bar.
- Avoid destructing the possibly shared QApplication instance
on LV2 plug-in UI clean-up.
0.9.4 2018-12-12 A Late Autumn'18 release.
- Old deprecated Qt4 build support is no more.
- Normalized wavetable oscillator phasors.
- Added missing include to shut up some stricter
compilers from build failures.
0.9.3 2018-10-22 An Autumn'18 release.
- For safety reasons, all processing is now suspended while
loading presets or program changes are issued.
- AppStream metadata updated to be the most compliant with
latest freedesktop.org specification and recommendation.
- SIGTERM (and SIGINT) signal handler added to close the JACK
stand-alone client applications properly.
- Make the GUI not to show initially on NSM.
- Make NSM state independent to session display name, keeping
backward compatibility for old sessions.
- Give some more slack to schedule/worker thread ring-buffer.
0.9.2 2018-07-24 A Summer'18 release.
- Add LV2 UI Resize extension data support.
- Process MIDI Controlllers even though the channel filter
is on (DEF Channel is set anything but "Omni").
- AppData/AppStream metadata is now settled under an all
permisssive license (FSFAP).
0.9.1 2018-06-26 An Early Summer'18 release.
- Fixed for some g++ >= 8.1.1 warnings and quietness.
- Added LV2 UI X11 support option.
- Disable reference micro-tuning settings when a Scala
keyboard map override is in effect.
- Added "All files (*.*)" filter to every file requestor
dialog, wherever missing.
0.9.0 2018-03-07 The End of Winter'18 release.
- Introducing Scala micro-tuning classes, borrowed, stirred
and refactored from original Nick Dowell's amsynth code,
all under the GPL umbrella, of course.
- An internal note-key/frequency indirection table is now in
place, as a baseline for any micro-tuning implementations.
- Whether to use native file browser/requester dialogs is
now an effective option when launching under NSM session
management (was once disabled initially).
- Trying to get CC14 MSB+LSB (course+fine) running status on,
no matter whether each pairing event are under 200ms apart.
- A little hardening on the configure (autoconf) macro side.
0.8.6 2017-12-20 The End of Autumn'17 release.
- Sync option added to DCO wavetable oscillators, as for
making either one to hard-sync (slave) with the other
one (master) in each pair.
- Set on a minimum attack time of 500usec as much to prevent
audible clicking on low-pitched notes.
0.8.5 2017-10-29 An Autumn'17 release.
- Opening multiple preset files is now possible, populating
the preset drop-down listing, while only the first one is
loaded effectively into the scene as usual.
- Mono(phonic) "Legato" mode option introduced.
- Desktop entry specification file is now finally independent
from all build/configure template chains, whatever.
- Updated target path for freedesktop.org's AppStream metainfo
file (formerly AppData).
0.8.4 2017-08-22 A Late-Summer'17 release.
- Disabled "Custom style theme" option on LV2 plug-in form.
- Brand new LFO Balance parameter introduced.
0.8.3 2017-06-21 A Summer'17 release.
- Added StartupWMClass entry to desktop file.
- Long overdue, some brand new and fundamental icons revamp.
0.8.2 2017-05-02 Pre-LAC2017 release frenzy.
- A custom knob/spin-box behavioral option have been added:
Configure/Knob edit mode, as to avoid abrupt changes upon
editing values (still the default behavior) and only take
effect (Deferred) when enter is pressed or the spin-box
loses focus.
- The main GUI has been partially revamped, after replacing
some rotary knob/dial combos with kinda more skeuomorphic
fake-LED radio-buttons or check-boxes.
- Alias-free/band-limited wavetable oscillators have been
fixed to prevent cross-octave, polyphonic interference.
- A MIDI In(put) status fake-LED is now featured on the
bottom-left status bar, adding up to eye-candy as usual.
0.8.1 2017-03-21 A Spring'17 release.
- Fixed a probable old miss about changing spin-box and
drop-down list not reflecting changes immediately into
the respective parameter dial knobs.
- Fixed middle-button clicking on the dial-knobs to reset
to the current default parameter value.
- Help/Configure.../Options/Use desktop environment native
dialogs option is now set initially off by default.
- Added French man page (by Olivier Humbert, thanks).
- Make builds reproducible byte for byte, by getting rid of
the configure build date and time stamps.
0.8.0 2016-11-17 A Fall'16 release.
- LV2_STATE__StateChanged is now transmitted as a regular
atom notification event, as far as to give some careful
hosts enough slack to raise a dirty flag.
- Fixed input MIDI RPN/NRPN running status processing.
- Almost complete overhaul on the configure script command
line options, wrt. installation directories specification,
eg. --prefix, --bindir, --libdir, --datadir and --mandir.
0.7.6 2016-09-19 The Eleventh official beta.
- MIDI RPN/NRPN running status and RPN NULL reset command
are now supported (input only).
- The core engine implementation is now delivered as a shared
object library, common to both the JACK stand-alone client
and the LV2 instrument plug-in.
- Discretely fixed MIDI Controlllers catch-up algorithm.
0.7.5 2016-06-16 The Tenth official beta.
- All changes to most continuous parameter values are now
smoothed to a fast but finite slew rate.
- All BPM sync options to current transport (Auto) have been
refactored to new special minimum value (which is now zero).
- In compliance to the LV2 spec. MIDI Controllers now affect
cached parameter values only, via shadow ports, instead of
input control ports directly, mitigating their read-only
restriction.
- Make sure LV2 plug-in state is properly reset on restore.
- Dropped the --enable-qt5 from configure as found redundant
given that's the build default anyway (suggestion by Guido
Scholz, while for Qtractor, thanks).
0.7.4 2016-03-02 The ninth-bis official beta.
- Fixed the DCF Formant filter voice initialization reset.
0.7.3 2016-02-22 The ninth official beta.
- Avoid out-of-bound MIDI events as much as possible, coping
with LV2 plug-in hosts that feed/run them in on border line
circumstances (as reported by Thorsten Wilms, on suspected
Ardour looping crash/bug, probably fixed already, thanks).
- Safe defaults are tentatively sbeing introduced to internal
OUT FX buffer-sizes, as read from JACK buffer-size changes
and LV2 block-length instantiation bound options.
- Added application keywords to freedesktop.org's AppData.
0.7.2 2015-12-04 The eighth official beta.
- A brand new LFO BPM control parameter is being introduced,
as a subordinate to LFO Rate, with follow/sync to current
transport/host option (BPM=Auto).
- LFO Sync (free running) mode option has been introduced.
- A fourth DCF type has been added: a vocal Formant filter.
- A third DCF slope/type has been added: the RBJ's bi-quad.
- Prefer Qt5 over Qt4 by default with configure script.
- Introducing brand new OUT FX Send parameter per engine.
- Introducing brand new DCO, LFO Ring Mod(ulator) parameters.
- Special value (0=Off) added to DCO1,2 Glide knob spin-boxes.
0.7.1 2015-08-24 A seventh-bis official beta.
- Improved Qt4 vs. Qt5 configure builds (via qmake).
0.7.0 2015-07-24 A seventh official beta.
- Complete rewrite of Qt4 vs. Qt5 configure builds.
- Reset ramps after LV2 control port reconnection; small fixes
to LV2.ttl (pull-requests by Hanspeter Portner aka. ventosus,
thanks).
- MIDI Controllers/Programs is now an optional feature on the
LV2 plugin forms, as some LV2 hosts might enforce the purity
restriction to input control ports as being absolutely read-
only parameter values from a plugin's instance perspective.
- MIDI Controller mapping/learn is now possible on all parameter
control knobs; with global configuration also avaiable on the
Help/Configure dialog.
- French (fr) translation line to desktop file added (by Olivier
Humbert, thanks).
0.6.3 2015-05-09 A sixth official beta.
- Main widget layout changed as much to expand or grow vertically
as needed.
0.6.2 2015-04-30 A fifth official beta.
- Custom knob/dial behavior mode options are now introduced:
linear and angular (aka. radial) as far to avoid abrupt
changes on first mouse click (still the default behavior).
- Fixed for some strict tests for Qt4 vs. Qt5 configure builds.
0.6.1 2015-03-09 A fourth official beta.
- Added application description as freedesktop.org's AppData.
- Introducing LV2 port-groups (as proposed by Amadeus Folego aka.
badosu, thanks).
- Improved envelope widget nodes click-and-drag precision.
- Introducing a brand new user preference on eye-candy: cf.Help
/Configure.../Options/Custom style theme (applies to the JACK
stand-alone client only though).
- Envelope and filter now rendered with anti-aliased lines.
- Fixed a Qt5 FTBFS re. QHeaderView::set[Section]ResizeMode().
0.6.0 2014-01-23 A third official beta.
- MIDI bank-select/program-changes is now supported, for patch,
preset and/or instrument program control.
- New Help/Configure dialog is introduced for editing the also
new MIDI bank/programs interface and user preference options
as well (new home of the old Help/Use native dialogs option).
- Presets may now be specified by base name, as an alternative
to the complete preset file-path on command line argument (re.
stand-alone JACK client).
- Fixed parameters A/B comparison swap.
0.5.1 2014-09-12 One second official beta.
- One decimal digit added to all scalar parameters and knobs.
- Stand-alone JACK client ports outrageously renamed from a
zero based numbering scheme into a plus one natural one.
- Experimental LV2 Time/position atom-event support (Delay BPM).
0.5.0 2014-06-30 Officially beta now.
- LV2 UI Idle and Show interfaces support added.
- First attempt to allow a headless stand-alone JACK client
application run mode, without a GUI, with option given as
command line argument (--no-gui).
- A man page has beed added (re. stand-alone JACK client).
- Disable band-limit option for 'Noise' oscillator wave-shapes.
- Allow the build system to include an user specified LDFLAGS.
0.4.2 2014-04-29 A pre-LAC frenzy beta.
- Badly named 'Noise' wave-shape oscillators get their band-
limited treat option and re-labeled as 'Rand'; also a brand
new wave-shape 'Noise' is then introduced (now for real :)).
- New user preference option, cf. Help/Use native dialogs.
- An anti-denormal regression applied to the Phaser fx stage
(affecting early proto-beta >= 0.4.0).
0.4.1 2014-04-07 A proto-beta bis.
- Once so called 'Noise' wave-shapes are now being made a lot
more deterministic, read idempotent ;).
- Fully alias-free/band-limited wavetable oscillators are now
in place, making it a better virtual-analog synthesizer (esp.
for running sample-rates below 96KHz).
- Late optimizations to basic wave-table oscillators.
- Make sure the LV2 plugin back-end always builds first, before
its respective LV2 UI front-end client.
0.4.0 2014-03-06 A proto-beta party.
- All knobs default value setting slightly improved.
- A run-time circumvention have been hacked, strictly related
to when NSM session management is in charge: the native file
browser/requester dialogs are then disabled (were taking too
long to list the current directory on first time invocation).
- Auto-detection of the correct target library path for the
LV2 plugin, whether it may be .../lib or .../lib64 on bi
-arch targets, when libdir is not specified on configure
time (--libdir=LIBDIR).
- Reverb has been added as a brand new effects stage, though
based on good old FreeVerb :).
- Introduced a variable env.stage time control parameter.
- Dummy change-log entry for the new year.
0.3.6 2013-12-31 A fifth of a Jubilee.
- Effects/Delay BPM sync option to current transport (Auto).
- More preparations for Qt5 configure build.
0.3.5 2013-09-30 Fall greetings.
- First attempt on separating the DSP code from UI as runtime
objects, effective for the LV2 plugin deploy.
- MIDI channel filter switch is now introduced.
- Fixed uninstall target make rule.
- Mono(phonic) mode switch is now being introduced.
- Another minor fix to note-off fast-release.
0.3.4 2013-07-16 Brand new icon ready.
- Preset file icon and mimetype now introduced.
- A brand new icon drops the lamest old-schooler's out, in a
master lesson taught by Jarle Richard Akselsen, thanks.
0.3.3 2013-05-31 Late spring blossoming
- Some sympathy to extreme dark color (read black) schemes is
now being indulged; some discrete changes on the icon front
has also emerged ;)
- MIDI Key pressure/polyphonic aftertouch events now properly
recognized, in addition to MIDI channel pressure/aftertouch
processing.
- Parameter value ramping moved into the late post-processing,
an attempt to reduce some pop/click artifacts even further.
- NSM support introduced to JACK client.
- A slight GUI behavior change: (re)writing existing names
doesn't load the respective preset anymore (after ticket
by Jiri Prochazka aka. Anchakor, thanks).
- Introducing LV2 External UI "rogue" support.
- Moog-like 24dB/oct resonant filter slight modification.
- Fixed JACK client fail/fake initialization.
0.3.2 2013-03-01 One third bug-fix release.
- Pitch-bend, Modwheel and LFO Pitch range internal fixes.
- Sustain/damper pedal switch (MIDI CC#64) support added.
- Color palette hack on Qt5 dark themes.
0.3.1 2013-02-08 One second bug-fix release.
- Improved filters parameter sensitivity (cutoff, reso).
- Envelope generators stage curves now gone a little more old-
schooler and analog-like, hopefully improving on the punchy
and click-less sound front.
- Experimental LV2 Time designated port support (Delay BPM).
- Preparations for Qt5 migration.
0.3.0 2012-12-21 Third coming release.
- Dropped all SSE dummy build optimization flags as they were
making more harm than real good, performance wise.
- GUI layout moved from a toolbox into a stacked tab widget;
also, a status-bar has been added at the bottom display.
- LV2 Atom/MIDI event processing is now official, a replacement
for the formerly deprecated LV2 Event/MIDI specification.
- Added dirty checking also on switching from unamed presets.
- JACK stand-alone: preset loader initialization fix.
0.2.0 2012-11-22 Second public release.
- Parameters A/B comparison toggle buttons have been added.
- Keep LV2 event buffer valid on each run(), as found for strict
LV2 specification and compliance (as suggested by falkTX).
- Increased polyphony baseline from 24 to 32 voices.
- Prepared for relative paths from preset file references.
- Velocity sensitivity configuration control has been added.
- Reset (all values to preset defaults) button has been added.
- Slight minor fix on fast-release re-triggering.
- Added some command line options to the stand-alone JACK client
program (--help and --version information).
- Reimplemented mouse-wheel stepping on combo-dial knob widgets.
- Detached generic double-linked list class into its own header.
0.1.1 2012-09-24 One first bug-fix release.
- Fixed a crash bug on LV2 main widget close (GUI) due to some
superfluous preset dirty checking.
- Fixed a nasty rather fundamental bug introduced by late voice
list optimization, which was seriously crippled and noticeable
when more than one LV2 plug-in were being instantiated.
0.1.0 2012-09-10 First true official release.
- Preset drop-down list is now sorted.
- Migrated to sourceforge.net.
0.0.9 2012-08-27 Post-vacation relax.
- Main widget now a plain basic QWidget, instead of QDialog.
- Preset salvage query check on main widget close (GUI).
- Voice list alloc/free optimization--doubled polyphony.
0.0.8 2012-07-15 Second coming consolidation.
- Proto-icon, Desktop file and Help About menus added.
0.0.7 2012-07-07 Initial change-log entry.
synthv1-1.4.2/PaxHeaders/LICENSE 0000644 0000000 0000000 00000000132 15174622017 013222 x ustar 00 30 mtime=1777542159.038465743
30 atime=1777542159.038465743
30 ctime=1777542159.038465743
synthv1-1.4.2/LICENSE 0000644 0001750 0000144 00000043103 15174622017 013213 0 ustar 00rncbc users GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
synthv1-1.4.2/PaxHeaders/README 0000644 0000000 0000000 00000000132 15174622017 013075 x ustar 00 30 mtime=1777542159.038465743
30 atime=1777542159.038465743
30 ctime=1777542159.038465743
synthv1-1.4.2/README 0000644 0001750 0000144 00000005265 15174622017 013075 0 ustar 00rncbc users synthv1 - an old-school polyphonic synthesizer
----------------------------------------------
an old-school 4-oscillator subtractive polyphonic synthesizer
with stereo fx.
Features:
- pure stand-alone JACK [1] client with JACK-session, NSM [3] and both
JACK MIDI and ALSA MIDI [2] input support;
- LV2 [4] instrument plugin.
URI: http://synthv1.sourceforge.net/lv2
License:
synthv1 is free, Linux Audio [5] open-source software, distributed under
the terms of the GNU General Public License (GPL) [6] version 2 or later.
Website:
https://synthv1.sourceforge.io
http://synthv1.sourceforge.net
Project page:
https://sourceforge.net/projects/synthv1
Git repos:
https://git.code.sf.net/p/synthv1/code
https://github.com/rncbc/synthv1.git
https://gitlab.com/rncbc/synthv1.git
https://codeberg.org/rncbc/synthv1.git
Weblog:
https://www.rncbc.org
Requirements:
mandatory,
- Qt framework [7], C++ class library and tools for
cross-platform application and UI development
https://qt.io/
optional (opted-in at build time),
- JACK [1] Audio Connection Kit
https://jackaudio.org/
- ALSA [2], Advanced Linux Sound Architecture
https://www.alsa-project.org/
- LV2 [4], Audio Plugin Standard, the extensible successor of LADSPA
https://lv2plug.in/
- liblo [8], Lightweight OSC implementation
(needed for NSM support [3])
http://liblo.sourceforge.net/
Installation:
- unpack tarball as usual; in the extracted source directory:
cmake [-DCMAKE_INSTALL_PREFIX=] -B build
cmake --build build [--parallel ]
- optionally, as root:
[sudo] cmake --install build
- note that the default installation path () is /usr/local .
Acknowledgements:
synthv1 logo/icon is an original fine work of Jarle Richard Akselsen.
References:
[1] JACK Audio Connection Kit
https://jackaudio.org/
[2] ALSA, Advanced Linux Sound Architecture
https://www.alsa-project.org/
[3] Non Session Management (NSM) (legacy)
http://non.tuxfamily.org/nsm/
New Session Manager (NSM)
https://new-session-manager.jackaudio.org/
[4] LV2, Audio Plugin Standard, the extensible successor of LADSPA
http://lv2plug.in/
[5] Linux Audio consortium of libre software for audio-related work
https://linuxaudio.org
[6] GNU General Public License
https://www.gnu.org/copyleft/gpl.html
[7] Qt framework, C++ class library and tools for
cross-platform application and UI development
https://qt.io/
[8] liblo [8], Lightweight OSC implementation
(needed for NSM support)
http://liblo.sourceforge.net/
Cheers && Enjoy.
--
rncbc aka. Rui Nuno Capela
rncbc@rncbc.org
https://www.rncbc.org
synthv1-1.4.2/PaxHeaders/src 0000644 0000000 0000000 00000000132 15174622017 012727 x ustar 00 30 mtime=1777542159.047209678
30 atime=1777542159.039209737
30 ctime=1777542159.047209678
synthv1-1.4.2/src/ 0000755 0001750 0000144 00000000000 15174622017 012774 5 ustar 00rncbc users synthv1-1.4.2/src/PaxHeaders/synthv1_nsm.h 0000644 0000000 0000000 00000000124 15174622017 015447 x ustar 00 28 mtime=1777542159.0442097
28 atime=1777542159.0442097
28 ctime=1777542159.0442097
synthv1-1.4.2/src/synthv1_nsm.h 0000644 0001750 0000144 00000006461 15174622017 015445 0 ustar 00rncbc users // synthv1_nsm.h
//
/****************************************************************************
Copyright (C) 2012-2023, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1_nsm_h
#define __synthv1_nsm_h
#include "synthv1_config.h"
#include
#ifdef CONFIG_LIBLO
#include
#endif
//---------------------------------------------------------------------------
// synthv1_nsm - NSM OSC client agent.
class synthv1_nsm : public QObject
{
Q_OBJECT
public:
// Constructor.
synthv1_nsm(const QString& nsm_url, QObject *pParent = 0);
// Destructor.
~synthv1_nsm();
// Session activation accessor.
bool is_active() const;
// Session manager accessors.
const QString& manager() const;
const QString& capabilities() const;
// Session client accessors.
const QString& path_name() const;
const QString& display_name() const;
const QString& client_name() const;
// Session client methods.
void announce(const QString& app_name, const QString& capabilities);
void dirty(bool is_dirty);
void visible(bool is_visible);
void progress(float percent);
void message(int priority, const QString& mesg);
// Status/error codes
enum ReplyCode
{
ERR_OK = 0,
ERR_GENERAL = -1,
ERR_INCOMPATIBLE_API = -2,
ERR_BLACKLISTED = -3,
ERR_LAUNCH_FAILED = -4,
ERR_NO_SUCH_FILE = -5,
ERR_NO_SESSION_OPEN = -6,
ERR_UNSAVED_CHANGES = -7,
ERR_NOT_NOW = -8,
ERR_BAD_PROJECT = -9,
ERR_CREATE_FAILED = -10
};
// Session client reply methods.
void open_reply(ReplyCode reply_code = ERR_OK);
void save_reply(ReplyCode reply_code = ERR_OK);
// Server methods response methods.
void nsm_announce_error(
const char *mesg);
void nsm_announce_reply(
const char *mesg,
const char *manager,
const char *capabilities);
void nsm_open(
const char *path_name,
const char *display_name,
const char *client_name);
void nsm_save();
void nsm_loaded();
void nsm_show();
void nsm_hide();
protected:
void reply(const QString& path, ReplyCode reply_code);
signals:
// Session client callbacks.
void active(bool is_active);
void open();
void save();
void loaded();
void show();
void hide();
private:
// Instance variables.
#ifdef CONFIG_LIBLO
lo_address m_address;
lo_server_thread m_thread;
lo_server m_server;
#endif
bool m_active;
bool m_dirty;
QString m_manager;
QString m_capabilities;
QString m_path_name;
QString m_display_name;
QString m_client_name;
};
#endif // __synthv1_nsm_h
// end of synthv1_nsm.h
synthv1-1.4.2/src/PaxHeaders/synthv1_wave.cpp 0000644 0000000 0000000 00000000132 15174622017 016146 x ustar 00 30 mtime=1777542159.045209693
30 atime=1777542159.045209693
30 ctime=1777542159.045209693
synthv1-1.4.2/src/synthv1_wave.cpp 0000644 0001750 0000144 00000025122 15174622017 016140 0 ustar 00rncbc users // synthv1_wave.cpp
//
/****************************************************************************
Copyright (C) 2012-2023, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#include "synthv1_wave.h"
#include
#include
//-------------------------------------------------------------------------
// synthv1_wave_sched - local module schedule thread stuff.
//
#include "synthv1_sched.h"
class synthv1_wave_sched : public synthv1_sched
{
public:
// ctor.
synthv1_wave_sched (synthv1_wave *wave)
: synthv1_sched(nullptr, Wave), m_wave(wave) {}
// process reset (virtual).
void process(int)
{ m_wave->reset_sync(); }
private:
// instance variables.
synthv1_wave *m_wave;
};
//-------------------------------------------------------------------------
// synthv1_wave - smoothed (integrating oversampled) wave table.
//
// ctor.
synthv1_wave::synthv1_wave ( uint32_t nsize, uint16_t nover, uint16_t ntabs )
: m_nsize(nsize), m_nover(nover), m_ntabs(ntabs),
m_shape(Saw), m_width(1.0f), m_bandl(false),
m_srate(44100.0f), m_phase0(0.0f), m_srand(0),
m_min_freq(0.0f), m_max_freq(0.0f), m_sched(nullptr)
{
const uint16_t ntabs1 = m_ntabs + 1;
m_tables = new float * [ntabs1];
for (uint16_t itab = 0; itab < ntabs1; ++itab)
m_tables[itab] = new float [m_nsize + 4];
if (m_ntabs > 0)
m_sched = new synthv1_wave_sched(this);
reset_sync();
}
// dtor.
synthv1_wave::~synthv1_wave (void)
{
if (m_sched)
delete m_sched;
const uint16_t ntabs1 = m_ntabs + 1;
for (uint16_t itab = 0; itab < ntabs1; ++itab)
delete [] m_tables[itab];
delete [] m_tables;
}
// init.
void synthv1_wave::reset ( Shape shape, float width, bool bandl )
{
m_shape = shape;
m_width = width;
m_bandl = bandl;
if (m_sched)
m_sched->schedule();
else
reset_sync();
}
void synthv1_wave::reset_sync (void)
{
switch (m_shape) {
case Pulse:
reset_pulse();
break;
case Saw:
reset_saw();
break;
case Sine:
reset_sine();
break;
case Rand:
reset_rand();
break;
case Noise:
reset_noise();
// Fall thru...
default:
break;
}
}
// init pulse tables.
void synthv1_wave::reset_pulse (void)
{
reset_pulse_part(m_ntabs);
if (m_bandl) {
for (uint16_t itab = 0; itab < m_ntabs; ++itab)
reset_pulse_part(itab);
m_max_freq = (0.25f * m_srate);
m_min_freq = m_max_freq / float(1 << m_ntabs);
} else {
m_max_freq = (0.5f * m_srate);
m_min_freq = m_max_freq;
}
}
// init saw tables.
void synthv1_wave::reset_saw (void)
{
reset_saw_part(m_ntabs);
if (m_bandl) {
for (uint16_t itab = 0; itab < m_ntabs; ++itab)
reset_saw_part(itab);
m_max_freq = (0.25f * m_srate);
m_min_freq = m_max_freq / float(1 << m_ntabs);
} else {
m_max_freq = (0.5f * m_srate);
m_min_freq = m_max_freq;
}
}
// init sine tables.
void synthv1_wave::reset_sine (void)
{
reset_sine_part(m_ntabs);
if (m_bandl && m_width < 1.0f) {
for (uint16_t itab = 0; itab < m_ntabs; ++itab)
reset_sine_part(itab);
m_max_freq = (0.25f * m_srate);
m_min_freq = m_max_freq / float(1 << m_ntabs);
} else {
m_max_freq = (0.5f * m_srate);
m_min_freq = m_max_freq;
}
}
// init random tables.
void synthv1_wave::reset_rand (void)
{
reset_rand_part(m_ntabs);
if (m_bandl) {
for (uint16_t itab = 0; itab < m_ntabs; ++itab)
reset_rand_part(itab);
m_max_freq = (0.25f * m_srate);
m_min_freq = m_max_freq / float(1 << m_ntabs);
} else {
m_max_freq = (0.5f * m_srate);
m_min_freq = m_max_freq;
}
}
// init noise tables.
void synthv1_wave::reset_noise (void)
{
reset_noise_part(m_ntabs);
if (m_bandl) {
for (uint16_t itab = 0; itab < m_ntabs; ++itab)
reset_noise_part(itab);
m_max_freq = (0.25f * m_srate);
m_min_freq = m_max_freq / float(1 << m_ntabs);
} else {
m_max_freq = (0.5f * m_srate);
m_min_freq = m_max_freq;
}
}
// init pulse partial table.
void synthv1_wave::reset_pulse_part ( uint16_t itab )
{
const uint16_t nparts = (itab < m_ntabs ? 1 << itab : 0);
const float p0 = float(m_nsize);
const float w2 = p0 * m_width * 0.5f + 0.001f;
float *frames = m_tables[itab];
for (uint32_t i = 0; i < m_nsize; ++i) {
const float p = float(i);
if (nparts > 0) {
const float gibbs = 0.5f * M_PI / float(nparts);
float sum = 0.0f;
for (uint32_t n = 0; n < nparts; ++n) {
const float gn = ::cosf(gibbs * float(n));
const float dn = float(n + 1) * M_PI;
const float wn = 2.0f * dn;
const float g2 = gn * gn / dn;
sum += g2 * ::sinf(wn * (w2 - p) / p0);
sum += g2 * ::sinf(wn * (p - p0) / p0);
}
frames[i] = 2.0f * sum;
} else {
frames[i] = (p < w2 ? 1.0f : -1.0f);
}
}
reset_filter(itab);
reset_normalize(itab);
reset_interp(itab);
}
// init saw partial table.
void synthv1_wave::reset_saw_part ( uint16_t itab )
{
const uint16_t nparts = (itab < m_ntabs ? 1 << itab : 0);
const float p0 = float(m_nsize);
const float w0 = p0 * m_width;
float *frames = m_tables[itab];
for (uint32_t i = 0; i < m_nsize; ++i) {
const float p = float(i);
if (nparts > 0) {
const float gibbs = 0.5f * M_PI / float(nparts);
float sum = 0.0f;
float sgn = 2.0f;
for (uint32_t n = 0; n < nparts; ++n) {
const float gn = ::cosf(gibbs * float(n));
const float dn = float(n + 1) * M_PI;
const float wn = 2.0f * dn;
const float g2 = gn * gn / dn;
if (w0 < 1.0f)
sum += g2 * ::sinf(wn * p / p0);
else
if (w0 >= p0)
sum += g2 * ::sinf(wn * (p0 - p) / p0);
else {
sum -= sgn * g2 * ::cosf(wn * (w0 - p) / p0) / dn;
sum += sgn * g2 * ::cosf(wn * (p - p0) / p0) / dn;
sgn = -sgn;
}
}
frames[i] = 2.0f * sum;
}
else if (p < w0) {
frames[i] = 2.0f * p / w0 - 1.0f;
} else {
frames[i] = 1.0f - 2.0f * (1.0f + (p - w0)) / (p0 - w0);
}
}
reset_filter(itab);
reset_normalize(itab);
reset_interp(itab);
}
// init sine partial table.
void synthv1_wave::reset_sine_part ( uint16_t itab )
{
const float width = (itab >= m_ntabs ? m_width
: 1.0f + float(itab) * (m_width - 1.0f) / float(m_ntabs));
const float p0 = float(m_nsize);
const float w0 = p0 * width;
const float w2 = w0 * 0.5f;
float *frames = m_tables[itab];
for (uint32_t i = 0; i < m_nsize; ++i) {
float p = float(i);
if (p < w2)
frames[i] = ::sinf(2.0f * M_PI * p / w0);
else
frames[i] = ::sinf(M_PI * (p + (p0 - w0)) / (p0 - w2));
}
if (width < 1.0f) {
reset_filter(itab);
reset_normalize(itab);
}
reset_interp(itab);
}
// init random partial table.
void synthv1_wave::reset_rand_part ( uint16_t itab )
{
const uint16_t nparts = (itab < m_ntabs ? 1 << itab : 0);
const float p0 = float(m_nsize);
const float w0 = p0 * m_width;
const uint32_t ihold = (uint32_t(p0 - w0) >> 3) + 1;
float *frames = m_tables[itab];
if (nparts > 0) {
const float *pntabs = m_tables[m_ntabs];
const uint32_t nholds = m_nsize / ihold;
const uint32_t ntabs2 = m_ntabs << itab;
uint32_t npart2 = nparts;
uint32_t nhold2 = nholds;
while (npart2 * nhold2 > ntabs2) {
if (npart2 > m_ntabs)
npart2 >>= 1;
else
if (nhold2 > m_ntabs)
nhold2 >>= 1;
}
const float wk = p0 / float(nhold2);
const float w2 = 0.5f * wk;
const float gibbs = 0.5f * M_PI / float(npart2);
for (uint32_t i = 0; i < m_nsize; ++i) {
const float p = float(i);
float sum = 0.0f;
for (uint32_t n = 0; n < npart2; ++n) {
const float gn = ::cosf(gibbs * float(n));
const float dn = float(n + 1) * M_PI;
const float wn = 2.0f * dn;
const float g2 = gn * gn / dn;
float pk = 0.0f;
for (uint32_t k = 0; k < nhold2; ++k) {
const float gk = g2 * pntabs[uint32_t(pk + w2)];
sum += gk * ::sinf(wn * (wk - p + pk) / p0);
sum += gk * ::sinf(wn * (p - p0 - pk) / p0);
pk += wk;
}
}
frames[i] = 2.0f * sum;
}
} else {
m_srand = uint32_t(w0);
float phold = 0.0f;
for (uint32_t i = 0; i < m_nsize; ++i) {
if ((i % ihold) == 0)
phold = pseudo_randf();
frames[i] = phold;
}
}
reset_filter(itab);
reset_normalize(itab);
reset_interp(itab);
}
// init random partial table.
void synthv1_wave::reset_noise_part ( uint16_t itab )
{
if (itab == m_ntabs) {
const float p0 = float(m_nsize);
const float w0 = p0 * m_width;
m_srand = uint32_t(w0) ^ 0x9631; // magic!
}
float *frames = m_tables[itab];
for (uint32_t i = 0; i < m_nsize; ++i)
frames[i] = pseudo_randf();
// reset_filter(itab);
// reset_normalize(itab);
reset_interp(itab);
}
// post-processors.
void synthv1_wave::reset_filter ( uint16_t itab )
{
float *frames = m_tables[itab];
uint32_t i, k = 0;
for (i = 1; i < m_nsize; ++i) {
const float p1 = frames[i - 1];
const float p2 = frames[i];
if (p1 < 0.0f && p2 >= 0.0f) {
k = i;
break;
}
}
for (uint16_t n = 0; n < m_nover; ++n) {
float p = frames[k];
for (i = 0; i < m_nsize; ++i) {
if (++k >= m_nsize) k = 0;
p = 0.5f * (frames[k] + p);
frames[k] = p;
}
}
}
void synthv1_wave::reset_normalize ( uint16_t itab )
{
float *frames = m_tables[itab];
uint32_t i;
float pmax = 0.0f;
float pmid = 0.0f;
if (m_ntabs > 0) {
for (i = 0; i < m_nsize; ++i)
pmid += frames[i];
pmid /= float(m_nsize);
} else {
for (i = 0; i < m_nsize; ++i) {
const float p = frames[i];
if (pmax < p)
pmax = p;
else
if (pmid > p)
pmid = p;
}
pmid = 0.5f * (pmax + pmid);
pmax = 0.0f;
}
pmax = 0.0f;
for (i = 0; i < m_nsize; ++i) {
frames[i] -= pmid;
const float p = ::fabsf(frames[i]);
if (pmax < p)
pmax = p;
}
if (pmax > 0.0f) {
const float gain = 1.0f / pmax;
for (i = 0; i < m_nsize; ++i)
frames[i] *= gain;
}
}
void synthv1_wave::reset_interp ( uint16_t itab )
{
float *frames = m_tables[itab];
uint32_t i;
for (i = m_nsize; i < m_nsize + 4; ++i)
frames[i] = frames[i - m_nsize];
if (itab == m_ntabs) {
uint32_t k = 0;
for (i = 1; i < m_nsize; ++i) {
const float p1 = frames[i - 1];
const float p2 = frames[i];
if (p1 < 0.0f && p2 >= 0.0f)
k = i;
}
m_phase0 = float(k) / float(m_nsize);
}
}
// end of synthv1_wave.cpp
synthv1-1.4.2/src/PaxHeaders/appdata 0000644 0000000 0000000 00000000132 15174622017 014341 x ustar 00 30 mtime=1777542159.039485034
30 atime=1777542159.039209737
30 ctime=1777542159.039485034
synthv1-1.4.2/src/appdata/ 0000755 0001750 0000144 00000000000 15174622017 014406 5 ustar 00rncbc users synthv1-1.4.2/src/appdata/PaxHeaders/org.rncbc.synthv1.desktop 0000644 0000000 0000000 00000000132 15174622017 021301 x ustar 00 30 mtime=1777542159.039455517
30 atime=1777542159.039455517
30 ctime=1777542159.039455517
synthv1-1.4.2/src/appdata/org.rncbc.synthv1.desktop 0000644 0001750 0000144 00000001001 15174622017 021261 0 ustar 00rncbc users [Desktop Entry]
Name=synthv1
Version=1.0
GenericName=MIDI
Comment=synthv1 is an old school polyphonic synthesizer
Comment[fr]=synthv1 est un synthétiseur polyphonique à l'ancienne
Exec=synthv1_jack %f
Icon=org.rncbc.synthv1
Categories=Audio;AudioVideo;Midi;X-Alsa;X-Jack;Qt;
MimeType=application/x-synthv1-preset;
Keywords=Audio;MIDI;ALSA;JACK;Synthesizer;LV2;Qt;
Terminal=false
Type=Application
StartupWMClass=synthv1_jack
X-Window-Icon=synthv1
X-SuSE-translate=true
X-NSM-Capable=true
X-NSM-Exec=synthv1_jack
synthv1-1.4.2/src/appdata/PaxHeaders/org.rncbc.synthv1.metainfo.xml 0000644 0000000 0000000 00000000132 15174622017 022231 x ustar 00 30 mtime=1777542159.039485034
30 atime=1777542159.039455517
30 ctime=1777542159.039485034
synthv1-1.4.2/src/appdata/org.rncbc.synthv1.metainfo.xml 0000644 0001750 0000144 00000003417 15174622017 022226 0 ustar 00rncbc users
org.rncbc.synthv1
FSFAP
GPL-2.0+
synthv1
an old-school polyphonic synthesizer
synthv1 is an old-school 4-oscillator subtractive polyphonic synthesizer
with stereo fx.
features:
- pure stand-alone JACK client with JACK-session, NSM and both JACK MIDI
and ALSA MIDI input support;
- LV2 instrument plugin.
URI: http\://synthv1.sourceforge.net/lv2
org.rncbc.synthv1.desktop
synthv1_jack
https://synthv1.sourceforge.io/image/synthv1-screenshot9.png
The main window showing the application in action
Audio
MIDI
ALSA
JACK
Synthesizer
LV2
Qt
https://synthv1.sourceforge.io
https://github.com/rncbc/synthv1
rncbc.org
rncbc aka. Rui Nuno Capela
rncbc@rncbc.org
synthv1-1.4.2/src/PaxHeaders/synthv1_lv2.h 0000644 0000000 0000000 00000000124 15174622017 015355 x ustar 00 28 mtime=1777542159.0442097
28 atime=1777542159.0442097
28 ctime=1777542159.0442097
synthv1-1.4.2/src/synthv1_lv2.h 0000644 0001750 0000144 00000010547 15174622017 015353 0 ustar 00rncbc users // synthv1_lv2.h
//
/****************************************************************************
Copyright (C) 2012-2025, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1_lv2_h
#define __synthv1_lv2_h
#include "synthv1.h"
#ifdef CONFIG_LV2_OLD_HEADERS
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
#include "lv2/lv2plug.in/ns/ext/worker/worker.h"
#else
#include "lv2/urid/urid.h"
#include "lv2/atom/atom.h"
#include "lv2/atom/forge.h"
#include "lv2/worker/worker.h"
#endif
#define SYNTHV1_LV2_URI "http://synthv1.sourceforge.net/lv2"
#define SYNTHV1_LV2_PREFIX SYNTHV1_LV2_URI "#"
#ifdef CONFIG_LV2_PROGRAMS
#include "lv2_programs.h"
#include
#endif
#ifdef CONFIG_LV2_PORT_CHANGE_REQUEST
#include "lv2_port_change_request.h"
#endif
// Forward decls.
class QApplication;
//-------------------------------------------------------------------------
// synthv1_lv2 - decl.
//
class synthv1_lv2 : public synthv1
{
public:
synthv1_lv2(double sample_rate, const LV2_Feature *const *host_features);
~synthv1_lv2();
enum PortIndex {
MidiIn = 0,
Notify,
AudioInL,
AudioInR,
AudioOutL,
AudioOutR,
ParamBase
};
void connect_port(uint32_t port, void *data);
void run(uint32_t nframes);
void activate();
void deactivate();
uint32_t urid_map(const char *uri) const;
#ifdef CONFIG_LV2_PROGRAMS
const LV2_Program_Descriptor *get_program(uint32_t index);
void select_program(uint32_t bank, uint32_t program);
#endif
bool worker_work(const void *data, uint32_t size);
bool worker_response(const void *data, uint32_t size);
static void qapp_instantiate();
static void qapp_cleanup();
static QApplication *qapp_instance();
protected:
void updatePreset(bool bDirty);
void updateParam(synthv1::ParamIndex index);
void updateParams();
void updateTuning();
bool state_changed();
#ifdef CONFIG_LV2_PATCH
bool patch_set(LV2_URID key);
bool patch_get(LV2_URID key);
#endif
#ifdef CONFIG_LV2_PORT_EVENT
bool port_event(synthv1::ParamIndex index);
bool port_events();
#endif
#ifdef CONFIG_LV2_PORT_CHANGE_REQUEST
bool port_change_request(synthv1::ParamIndex index);
bool port_change_requests();
#endif
private:
LV2_URID_Map *m_urid_map;
struct lv2_urids
{
LV2_URID p201_tuning_enabled;
LV2_URID p202_tuning_refPitch;
LV2_URID p203_tuning_refNote;
LV2_URID p204_tuning_scaleFile;
LV2_URID p205_tuning_keyMapFile;
LV2_URID tun1_update;
LV2_URID atom_Blank;
LV2_URID atom_Object;
LV2_URID atom_Float;
LV2_URID atom_Int;
LV2_URID atom_Bool;
LV2_URID atom_Path;
#ifdef CONFIG_LV2_PORT_EVENT
LV2_URID atom_PortEvent;
LV2_URID atom_portTuple;
#endif
LV2_URID time_Position;
LV2_URID time_beatsPerMinute;
LV2_URID midi_MidiEvent;
LV2_URID bufsz_minBlockLength;
LV2_URID bufsz_maxBlockLength;
LV2_URID bufsz_nominalBlockLength;
LV2_URID state_StateChanged;
#ifdef CONFIG_LV2_PATCH
LV2_URID patch_Get;
LV2_URID patch_Set;
LV2_URID patch_property;
LV2_URID patch_value;
#endif
} m_urids;
LV2_Atom_Forge m_forge;
LV2_Atom_Forge_Frame m_notify_frame;
LV2_Worker_Schedule *m_schedule;
uint32_t m_ndelta;
LV2_Atom_Sequence *m_atom_in;
LV2_Atom_Sequence *m_atom_out;
float **m_ins;
float **m_outs;
#ifdef CONFIG_LV2_PROGRAMS
LV2_Program_Descriptor m_program;
QByteArray m_aProgramName;
#endif
#ifdef CONFIG_LV2_PORT_CHANGE_REQUEST
LV2_ControlInputPort_Change_Request *m_port_change_request;
#endif
static QApplication *g_qapp_instance;
static unsigned int g_qapp_refcount;
};
#endif// __synthv1_lv2_h
// end of synthv1_lv2.h
synthv1-1.4.2/src/PaxHeaders/synthv1widget.h 0000644 0000000 0000000 00000000132 15174622017 015775 x ustar 00 30 mtime=1777542159.045209693
30 atime=1777542159.045209693
30 ctime=1777542159.045209693
synthv1-1.4.2/src/synthv1widget.h 0000644 0001750 0000144 00000012140 15174622017 015763 0 ustar 00rncbc users // synthv1widget.h
//
/****************************************************************************
Copyright (C) 2012-2026, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1widget_h
#define __synthv1widget_h
#include "synthv1_config.h"
#include "synthv1_sched.h"
#include "synthv1_ui.h"
#include
// forward decls.
namespace Ui { class synthv1widget; }
class synthv1widget_param;
class synthv1widget_sched;
//-------------------------------------------------------------------------
// synthv1widget - decl.
//
class synthv1widget : public QWidget
{
Q_OBJECT
public:
// Constructor
synthv1widget(QWidget *pParent = nullptr);
// Destructor.
virtual ~synthv1widget();
// Open/close the scheduler/work notifier.
void openSchedNotifier();
void closeSchedNotifier();
// Param port accessors.
void setParamValue(synthv1::ParamIndex index, float fValue);
float paramValue(synthv1::ParamIndex index) const;
// Param kbob (widget) mapper.
void setParamKnob(synthv1::ParamIndex index, synthv1widget_param *pKnob);
synthv1widget_param *paramKnob(synthv1::ParamIndex index) const;
// Preset init.
void initPreset();
// Preset clear.
void clearPreset();
// Dirty close prompt,
bool queryClose();
// Update visual configuration.
void updateConfig();
public slots:
// Preset file I/O.
bool loadPreset(const QString& sFilename);
bool savePreset(const QString& sFilename);
// Direct note-on/off slot.
void directNoteOn(int iNote, int iVelocity);
protected slots:
// Preset renewal.
void newPreset();
// Param knob (widget) slots.
void paramChanged(float fValue);
// Reset param knobs to default value.
void resetParams();
// Randomize params (partial).
void randomParams();
// Swap params A/B.
void swapParams(bool bOn);
// Panic: all-notes/sound-off (reset).
void panic();
// Schedule notification updater.
void updateSchedNotify(int stype, int sid);
// MIDI In LED timeout.
void midiInLedTimeout();
// Keyboard note range change.
void noteRangeChanged();
// Param knob context menu.
void paramContextMenu(const QPoint& pos);
// Menu actions.
void helpConfigure();
void helpAbout();
void helpAboutQt();
protected:
// Synth engine accessor.
virtual synthv1_ui *ui_instance() const = 0;
// Reset swap params A/B group.
void resetSwapParams();
// Initialize all param/knob values.
void updateParamValues();
// Reset all param/knob default values.
void resetParamValues();
void resetParamKnobs();
// Param port methods.
virtual void updateParam(synthv1::ParamIndex index, float fValue) const = 0;
// Update local tied widgets.
void updateParamEx(synthv1::ParamIndex index, float fValue);
// Update scheduled controllers param/knob widgets.
void updateSchedParam(synthv1::ParamIndex index, float fValue);
// Preset status updater.
void updateLoadPreset(const QString& sPreset);
// Dirty flag (overridable virtual) methods.
virtual void updateDirtyPreset(bool bDirtyPreset);
// Show/hide dget handlers.
void showEvent(QShowEvent *pShowEvent);
void hideEvent(QHideEvent *pHideEvent);
private:
// Instance variables.
Ui::synthv1widget *p_ui;
Ui::synthv1widget& m_ui;
synthv1widget_sched *m_sched_notifier;
QHash m_paramKnobs;
QHash m_knobParams;
float m_params_ab[synthv1::NUM_PARAMS];
int m_iUpdate;
};
//-------------------------------------------------------------------------
// synthv1widget_sched - worker/schedule proxy decl.
//
class synthv1widget_sched : public QObject
{
Q_OBJECT
public:
// ctor.
synthv1widget_sched(synthv1 *pSynth, QObject *pParent = nullptr)
: QObject(pParent), m_notifier(pSynth, this) {}
signals:
// Notification signal.
void notify(int stype, int sid);
protected:
// Notififier visitor.
class Notifier : public synthv1_sched::Notifier
{
public:
Notifier(synthv1 *pSynth, synthv1widget_sched *pSched)
: synthv1_sched::Notifier(pSynth), m_pSched(pSched) {}
void notify(synthv1_sched::Type stype, int sid) const
{ m_pSched->emit_notify(stype, sid); }
private:
synthv1widget_sched *m_pSched;
};
// Notification method.
void emit_notify(synthv1_sched::Type stype, int sid)
{ emit notify(int(stype), sid); }
private:
// Instance variables.
Notifier m_notifier;
};
#endif // __synthv1widget_h
// end of synthv1widget.h
synthv1-1.4.2/src/PaxHeaders/synthv1_reverb.h 0000644 0000000 0000000 00000000132 15174622017 016136 x ustar 00 30 mtime=1777542159.045209693
30 atime=1777542159.045209693
30 ctime=1777542159.045209693
synthv1-1.4.2/src/synthv1_reverb.h 0000644 0001750 0000144 00000014334 15174622017 016133 0 ustar 00rncbc users // synthv1_reverb.h
//
/****************************************************************************
Copyright (C) 2012-2021, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1_reverb_h
#define __synthv1_reverb_h
#include
#include
//-------------------------------------------------------------------------
// synthv1_reverb
//
// -- borrowed, stirred and refactored from original FreeVerb --
// by Jezar at Dreampoint, June 2000 (public domain)
//
class synthv1_reverb
{
public:
synthv1_reverb (float srate = 44100.0f)
: m_srate(srate), m_room(0.5f), m_damp(0.5f), m_feedb(0.5f)
{ reset(); }
void setSampleRate(float srate)
{ m_srate = srate; }
float sampleRate() const
{ return m_srate; }
void reset()
{
static const uint32_t s_comb[NUM_COMBS]
= { 1116, 1188, 1277, 1356, 1422, 1491, 1557, 1617, 1685, 1748 };
static const uint32_t s_allpass[NUM_ALLPASSES]
= { 556, 441, 341, 225, 180, 153 };
const float sr = m_srate / 44100.0f;
uint32_t j;
for (j = 0; j < NUM_ALLPASSES; ++j) {
m_allpass0[j].resize(uint32_t(s_allpass[j] * sr));
m_allpass0[j].reset();
m_allpass1[j].resize(uint32_t((s_allpass[j] + STEREO_SPREAD) * sr));
m_allpass1[j].reset();
}
for (j = 0; j < NUM_COMBS; ++j) {
m_comb0[j].resize(uint32_t(s_comb[j] * sr));
m_comb0[j].reset();
m_comb1[j].resize(uint32_t((s_comb[j] + STEREO_SPREAD) * sr));
m_comb1[j].reset();
}
reset_feedb();
reset_room();
reset_damp();
}
void process(float *in0, float *in1, uint32_t nframes,
float wet, float feedb, float room, float damp, float width)
{
if (wet < 1E-9f)
return;
if (m_feedb != feedb) {
m_feedb = feedb;
reset_feedb();
}
if (m_room != room) {
m_room = room;
reset_room();
}
if (m_damp != damp) {
m_damp = damp;
reset_damp();
}
uint32_t i, j;
for (i = 0; i < nframes; ++i) {
float out0 = *in0 * 0.05f; // 0.015f;
float out1 = *in1 * 0.05f; // 0.015f;
float tmp0 = 0.0f;
float tmp1 = 0.0f;
for (j = 0; j < NUM_COMBS; ++j) {
tmp0 += m_comb0[j].output(out0);
tmp1 += m_comb1[j].output(out1);
}
for (j = 0; j < NUM_ALLPASSES; ++j) {
tmp0 = m_allpass0[j].output(tmp0);
tmp1 = m_allpass1[j].output(tmp1);
}
if (width < 0.0f) {
out0 = tmp0 * (1.0f + width) - tmp1 * width;
out1 = tmp1 * (1.0f + width) - tmp0 * width;
} else {
out0 = tmp0 * width + tmp1 * (1.0f - width);
out1 = tmp1 * width + tmp0 * (1.0f - width);
}
*in0++ += wet * out0;
*in1++ += wet * out1;
}
}
protected:
static const uint32_t NUM_COMBS = 10;
static const uint32_t NUM_ALLPASSES = 6;
static const uint32_t STEREO_SPREAD = 23;
void reset_room()
{
for (uint32_t j = 0; j < NUM_COMBS; ++j) {
m_comb0[j].set_feedb(m_room);
m_comb1[j].set_feedb(m_room);
}
}
void reset_damp()
{
const float damp2 = m_damp * m_damp;
for (uint32_t j = 0; j < NUM_COMBS; ++j) {
m_comb0[j].set_damp(damp2);
m_comb1[j].set_damp(damp2);
}
}
void reset_feedb()
{
const float feedb2 = 2.0f * m_feedb * (2.0f - m_feedb) / 3.0f;
for (uint32_t j = 0; j < NUM_ALLPASSES; ++j) {
m_allpass0[j].set_feedb(feedb2);
m_allpass1[j].set_feedb(feedb2);
}
}
class sample_buffer
{
public:
sample_buffer (uint32_t size = 0)
: m_buffer(0), m_size(0), m_index(0)
{ resize(size); }
virtual ~sample_buffer()
{ delete [] m_buffer; }
void reset()
{ ::memset(m_buffer, 0, m_size * sizeof(float)); m_index = 0; }
void resize(uint32_t size)
{
if (size < 1)
size = 1;
if (m_size != size) {
const uint32_t old_size = m_size;
if (size > old_size) {
float *old_buffer = m_buffer;
m_buffer = new float [size];
m_size = size;
if (old_buffer) {
::memcpy(m_buffer, old_buffer,
old_size * sizeof(float));
delete [] old_buffer;
}
}
}
}
float *tick()
{
float *buf = m_buffer + m_index;
if (++m_index >= m_size)
m_index = 0;
return buf;
}
private:
float *m_buffer;
uint32_t m_size;
uint32_t m_index;
};
class comb_filter : public sample_buffer
{
public:
comb_filter (uint32_t size = 0)
: sample_buffer(size), m_feedb(0.5f), m_damp(0.5f), m_out(0.0f) {}
void set_feedb(float feedb)
{ m_feedb = feedb; }
float feedb() const
{ return m_feedb; }
void set_damp(float damp)
{ m_damp = damp; }
float damp() const
{ return m_damp; }
void reset()
{ sample_buffer::reset(); m_out = 0.0f; }
float output(float in)
{
float *buf = tick();
float out = *buf;
m_out = denormal(out * (1.0f - m_damp) + m_out * m_damp);
*buf = in + (m_out * m_feedb);
return out;
}
private:
float m_feedb;
float m_damp;
float m_out;
};
class allpass_filter : public sample_buffer
{
public:
allpass_filter(uint32_t size = 0)
: sample_buffer(size), m_feedb(0.5f) {}
void set_feedb(float feedb)
{ m_feedb = feedb; }
float feedb () const
{ return m_feedb; }
float output(float in)
{
float *buf = tick();
float out = *buf;
*buf = denormal(in + out * m_feedb);
return out - in;
}
private:
float m_feedb;
};
static float denormal(float v)
{
union { float f; uint32_t w; } u;
u.f = v;
return (u.w & 0x7f800000) ? v : 0.0f;
}
private:
float m_srate;
float m_room;
float m_damp;
float m_feedb;
comb_filter m_comb0[NUM_COMBS];
comb_filter m_comb1[NUM_COMBS];
allpass_filter m_allpass0[NUM_ALLPASSES];
allpass_filter m_allpass1[NUM_ALLPASSES];
};
#endif // __synthv1_reverb_h
synthv1-1.4.2/src/PaxHeaders/synthv1widget.ui 0000644 0000000 0000000 00000000132 15174622017 016163 x ustar 00 30 mtime=1777542159.045209693
30 atime=1777542159.045209693
30 ctime=1777542159.045209693
synthv1-1.4.2/src/synthv1widget.ui 0000644 0001750 0000144 00000230771 15174622017 016165 0 ustar 00rncbc users
rncbc aka Rui Nuno Capela
synthv1 - an old-school polyphonic synthesizer
Copyright (C) 2012-2026, rncbc aka Rui Nuno Capela. All rights reserved.
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.
synthv1widget
:/images/synthv1.svg
0
0
-
-
-
Randomize
Random
-
Swap A
A
true
-
Swap B
B
true
-
Panic
Panic
-
QTabBar::RoundedNorth
-
Qt::Horizontal
20
20
-
-
0
Synth 1
-
DCO1
-
DCO1 Wave 1
-
DCO1 Wave Shape 1
Shape 1
-
DCO1 Wave Width 1
Width 1
-
-
Qt::Vertical
20
8
-
DCO1 Wave Bandlimit 1
Bandl.1
-
DCO1 Wave Sync 1
Sync 1
-
Qt::Horizontal
8
8
-
DCO1 Wave 2
-
DCO1 Wave Shape 2
Shape 2
-
DCO1 Wave Width 2
Width 2
-
-
Qt::Vertical
20
8
-
DCO1 Wave Bandlimit 2
Bandl.2
-
DCO1 Wave Sync 2
Sync 2
-
Qt::Horizontal
8
8
-
DCO1 Balance
Balance
-
DCO1 Detune
Detune
-
DCO1 Phase
Phase
-
Qt::Horizontal
8
8
-
DCO1 Ring Mod
Ring Mod
-
Qt::Horizontal
8
8
-
DCO1 Octave
Octave
-
DCO1 Tuning
Tuning
-
Qt::Horizontal
8
8
-
DCO1 Glide
Glide
-
Qt::Horizontal
8
8
-
DCO1 Env.Time
Env.Time
-
Qt::Vertical
8
0
-
DCF1 Enabled
DCF1
true
-
-
DCF1
-
DCF1 Cutoff
Cutoff
-
DCF1 Resonance
Reso
-
DCF1 Type
Type
-
DCF1 Slope
Slope
-
-
DCF1 Envelope
Envelope
-
DCF1 Envelope
-
DCF1 Attack
Attack
-
DCF1 Decay
Decay
-
DCF1 Sustain
Sustain
-
DCF1 Release
Release
-
LFO1 Enabled
LFO1
true
-
-
LFO1 Wave
-
LFO1 Wave Shape
Shape
-
LFO1 Wave Width
Width
-
LFO1 Envelope
-
LFO1 Attack
Attack
-
LFO1 Decay
Decay
-
LFO1 Sustain
Sustain
-
LFO1 Release
Release
-
-
LFO1 BPM
BPM
-
LFO1 Rate
Rate
-
LFO1 Sync
Sync
-
Qt::Horizontal
8
8
-
LFO1 Sweep
Sweep
-
LFO1 Pitch
Pitch
-
Qt::Horizontal
8
8
-
LFO1 Balance
Balance
-
LFO1 Ring Mod
Ring Mod
-
Qt::Horizontal
8
8
-
LFO1 Cutoff
Cutoff
-
LFO1 Resonance
Reso
-
Qt::Horizontal
8
8
-
LFO1 Panning
Panning
-
LFO1 Volume
Volume
-
Qt::Vertical
8
0
-
DCA1
-
DCA1 Volume
Volume
-
DCA1 Envelope
-
DCA1 Attack
Attack
-
DCA1 Decay
Decay
-
DCA1 Sustain
Sustain
-
DCA1 Release
Release
-
DEF1
-
DEF1 Pitchbend
Pitchbend
-
DEF1 Modwheel
Modwheel
-
DEF1 Pressure
Pressure
-
DEF1 Velocity
Velocity
-
DEF1 Channel
Channel
-
DEF1 Mono
Mono
-
OUT1
-
OUT1 Stereo Width
Width
-
OUT1 Panning
Panning
-
Qt::Horizontal
8
8
-
OUT1 FX Send
Effects
-
Qt::Horizontal
8
8
-
OUT1 Volume
Volume
Synth 2
-
DCO2
-
DCO2 Wave 1
-
DCO2 Wave Shape 1
Shape 1
-
DCO2 Wave Width 1
Width 1
-
-
Qt::Vertical
20
8
-
DCO2 Wave Bandlimit 1
Bandl.1
-
DCO2 Wave Sync 1
Sync 1
-
Qt::Horizontal
8
8
-
DCO2 Wave 2
-
DCO2 Wave Shape 2
Shape 2
-
DCO2 Wave Width 2
Width 2
-
-
Qt::Vertical
20
8
-
DCO2 Wave Bandlimit 2
Bandl.2
-
DCO2 Wave Sync 2
Sync 2
-
Qt::Horizontal
8
8
-
DCO2 Balance
Balance
-
DCO2 Detune
Detune
-
DCO2 Phase
Phase
-
Qt::Horizontal
8
8
-
DCO2 Ring Mod
Ring Mod
-
Qt::Horizontal
8
8
-
DCO2 Octave
Octave
-
DCO2 Tuning
Tuning
-
Qt::Horizontal
8
8
-
DCO2 Glide
Glide
-
Qt::Horizontal
8
8
-
DCO2 Env.Time
Env.Time
-
Qt::Vertical
8
0
-
DCF2 Enabled
DCF2
true
-
-
DCF2
-
DCF2 Cutoff
Cutoff
-
DCF2 Resonance
Reso
-
DCF2 Type
Type
-
DCF2 Slope
Slope
-
-
DCF2 Envelope
Envelope
-
DCF2 Envelope
-
DCF2 Attack
Attack
-
DCF2 Decay
Decay
-
DCF2 Sustain
Sustain
-
DCF2 Release
Release
-
LFO2 Enabled
LFO2
true
-
-
LFO2 Wave
-
LFO2 Wave Shape
Shape
-
LFO2 Wave Width
Width
-
LFO2 Envelope
-
LFO2 Attack
Attack
-
LFO2 Decay
Decay
-
LFO2 Sustain
Sustain
-
LFO2 Release
Release
-
-
LFO2 BPM
BPM
-
LFO2 Rate
Rate
-
LFO2 Sync
Sync
-
Qt::Horizontal
8
8
-
LFO2 Sweep
Sweep
-
LFO2 Pitch
Pitch
-
Qt::Horizontal
8
8
-
LFO2 Balance
Balance
-
LFO1 Ring Mod
Ring Mod
-
Qt::Horizontal
8
8
-
LFO2 Cutoff
Cutoff
-
LFO2 Resonance
Reso
-
Qt::Horizontal
8
8
-
LFO2 Panning
Panning
-
LFO2 Volume
Volume
-
Qt::Vertical
8
0
-
DCA2
-
DCA2 Volume
Volume
-
DCA2 Envelope
-
DCA2 Attack
Attack
-
DCA2 Decay
Decay
-
DCA2 Sustain
Sustain
-
DCA2 Release
Release
-
DEF2
-
DEF2 Pitchbend
Pitchbend
-
DEF2 Modwheel
Modwheel
-
DEF2 Pressure
Pressure
-
DEF2 Velocity
Velocity
-
DEF2 Channel
Channel
-
DEF2 Mono
Mono
-
OUT2
-
OUT2 Stereo Width
Width
-
OUT2 Panning
Panning
-
Qt::Horizontal
8
8
-
OUT2 FX Send
Effects
-
Qt::Horizontal
8
8
-
OUT2 Volume
Volume
Effects
-
Qt::Horizontal
20
20
-
Chorus
-
Chorus Wet
Wet
-
Qt::Horizontal
20
20
-
Chorus Delay
Delay
-
Chorus Feedback
Feedback
-
Chorus Rate
Rate
-
Chorus Modulation
Modulation
-
Flanger
-
Flanger Wet
Wet
-
Qt::Horizontal
20
20
-
Flanger Delay
Delay
-
Flanger Feedback
Feedback
-
Flanger Daft
Daft
-
Phaser
-
Phaser Wet
Wet
-
Qt::Horizontal
20
20
-
Phaser Rate
Rate
-
Phaser Feedback
Feedback
-
Phaser Depth
Depth
-
Phaser Daft
Daft
-
Delay
-
Delay Wet
Wet
-
Qt::Horizontal
20
20
-
Delay Delay
Delay
-
Delay Feedback
Feedback
-
Delay BPM
BPM
-
Qt::Horizontal
20
20
-
Reverb
-
Reverb Wet
Wet
-
Qt::Horizontal
20
20
-
Reverb Room
Room
-
Reverb Damp
Damp
-
Reverb Feedback
Feedback
-
Reverb Width
Width
-
Dynamic
-
Dynamic Compressor
Compress
-
Dynamic Limiter
Limiter
-
Qt::Vertical
8
8
-
&Configure...
Configure
Configure options
&About...
About
Show information about this application program
About &Qt...
About Qt
Show information about the Qt toolkit
synthv1widget_preset
QComboBox
synthv1widget_status
QStatusBar
synthv1widget_spin
QDial
synthv1widget_combo
QDial
synthv1widget_radio
QDial
synthv1widget_check
QCheckBox
synthv1widget_group
QGroupBox
synthv1widget_env
QFrame
1
synthv1widget_filt
QFrame
1
synthv1widget_wave
QFrame
1
synthv1-1.4.2/src/PaxHeaders/synthv1_formant.cpp 0000644 0000000 0000000 00000000124 15174622017 016653 x ustar 00 28 mtime=1777542159.0442097
28 atime=1777542159.0442097
28 ctime=1777542159.0442097
synthv1-1.4.2/src/synthv1_formant.cpp 0000644 0001750 0000144 00000020121 15174622017 016636 0 ustar 00rncbc users // synthv1_formant.cpp
//
/****************************************************************************
Copyright (C) 2012-2021, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#include "synthv1_formant.h"
//---------------------------------------------------------------------
// formant filter.
//
// A formant parallel filter after Dennis H. Klatt's
// Software for a cascade/parallel formant synthesizer
// 1979 MIT; 1980 Acoustical Society of America.
//
// formant tables.
//
// The Canonical Csound Reference Manual
// Appendix D. Formant Values
// http://www.csounds.com/manual/html/MiscFormants.html
//
synthv1_formant::Vtab synthv1_formant::g_alto_vtab[NUM_VOWELS] = {
// Table D.1. alto “a�
{{ 800.0f, 1150.0f, 2800.0f, 3500.0f, 4950.0f },
{ 0.0f, -4.0f, -20.0f, -36.0f, -60.0f },
{ 80.0f, 90.0f, 120.0f, 130.0f, 140.0f }},
// Table D.2. alto “e�
{{ 400.0f, 1600.0f, 2700.0f, 3300.0f, 4950.0f },
{ 0.0f, -24.0f, -30.0f, -35.0f, -60.0f },
{ 60.0f, 80.0f, 120.0f, 150.0f, 200.0f }},
// Table D.3. alto “i�
{{ 350.0f, 1700.0f, 2700.0f, 3700.0f, 4950.0f },
{ 0.0f, -20.0f, -30.0f, -36.0f, -60.0f },
{ 50.0f, 100.0f, 120.0f, 150.0f, 200.0f }},
// Table D.4. alto “o�
{{ 450.0f, 800.0f, 2830.0f, 3500.0f, 4950.0f },
{ 0.0f, -9.0f, -16.0f, -28.0f, -55.0f },
{ 70.0f, 80.0f, 100.0f, 130.0f, 135.0f }},
// Table D.5. alto “u�
{{ 325.0f, 700.0f, 2530.0f, 3500.0f, 4950.0f },
{ 0.0f, -12.0f, -30.0f, -40.0f, -64.0f },
{ 50.0f, 60.0f, 170.0f, 180.0f, 200.0f }}
};
synthv1_formant::Vtab synthv1_formant::g_bass_vtab[NUM_VOWELS] = {
// Table D.6. bass “a�
{{ 600.0f, 1040.0f, 2250.0f, 2450.0f, 2750.0f },
{ 0.0f, -7.0f, -9.0f, -9.0f, -20.0f },
{ 60.0f, 70.0f, 110.0f, 120.0f, 130.0f }},
// Table D.7. bass “e�
{{ 400.0f, 1620.0f, 2400.0f, 2800.0f, 3100.0f },
{ 0.0f, -12.0f, -9.0f, -12.0f, -18.0f },
{ 40.0f, 80.0f, 100.0f, 120.0f, 120.0f }},
// Table D.8. bass “i�
{{ 250.0f, 1750.0f, 2600.0f, 3050.0f, 3340.0f },
{ 0.0f, -30.0f, -16.0f, -22.0f, -28.0f },
{ 60.0f, 90.0f, 100.0f, 120.0f, 120.0f }},
// Table D.9. bass “o�
{{ 400.0f, 750.0f, 2400.0f, 2600.0f, 2900.0f },
{ 0.0f, -11.0f, -21.0f, -20.0f, -40.0f },
{ 40.0f, 80.0f, 100.0f, 120.0f, 120.0f }},
// Table D.10. bass “u�
{{ 350.0f, 600.0f, 2400.0f, 2675.0f, 2950.0f },
{ 0.0f, -20.0f, -32.0f, -28.0f, -36.0f },
{ 40.0f, 80.0f, 100.0f, 120.0f, 120.0f }}
};
synthv1_formant::Vtab synthv1_formant::g_countertenor_vtab[NUM_VOWELS] = {
// Table D.11. countertenor “a�
{{ 660.0f, 1120.0f, 2750.0f, 3000.0f, 3350.0f },
{ 0.0f, -6.0f, -23.0f, -24.0f, -38.0f },
{ 80.0f, 90.0f, 120.0f, 130.0f, 140.0f }},
// Table D.12. countertenor “e�
{{ 440.0f, 1800.0f, 2700.0f, 3000.0f, 3300.0f },
{ 0.0f, -14.0f, -18.0f, -20.0f, -20.0f },
{ 70.0f, 80.0f, 100.0f, 120.0f, 120.0f }},
// Table D.13. countertenor “i�
{{ 270.0f, 1850.0f, 2900.0f, 3350.0f, 3590.0f },
{ 0.0f, -24.0f, -24.0f, -36.0f, -36.0f },
{ 40.0f, 90.0f, 100.0f, 120.0f, 120.0f }},
// Table D.14. countertenor “o�
{{ 430.0f, 820.0f, 2700.0f, 3000.0f, 3300.0f },
{ 0.0f, -10.0f, -26.0f, -22.0f, -34.0f },
{ 40.0f, 80.0f, 100.0f, 120.0f, 120.0f }},
// Table D.15. countertenor “u�
{{ 370.0f, 630.0f, 2750.0f, 3000.0f, 3400.0f },
{ 0.0f, -20.0f, -23.0f, -30.0f, -34.0f },
{ 40.0f, 60.0f, 100.0f, 120.0f, 120.0f }}
};
synthv1_formant::Vtab synthv1_formant::g_soprano_vtab[NUM_VOWELS] = {
// Table D.16. soprano “a�
{{ 800.0f, 1150.0f, 2900.0f, 3900.0f, 4950.0f },
{ 0.0f, -6.0f, -32.0f, -20.0f, -50.0f },
{ 80.0f, 90.0f, 120.0f, 130.0f, 140.0f }},
// Table D.17. soprano “e�
{{ 350.0f, 2000.0f, 2800.0f, 3600.0f, 4950.0f },
{ 0.0f, -20.0f, -15.0f, -40.0f, -56.0f },
{ 60.0f, 100.0f, 120.0f, 150.0f, 200.0f }},
// Table D.18. soprano “i�
{{ 270.0f, 2140.0f, 2950.0f, 3900.0f, 4950.0f },
{ 0.0f, -12.0f, -26.0f, -26.0f, -44.0f },
{ 60.0f, 90.0f, 100.0f, 120.0f, 120.0f }},
// Table D.19. soprano “o�
{{ 450.0f, 800.0f, 2830.0f, 3800.0f, 4950.0f },
{ 0.0f, -11.0f, -22.0f, -22.0f, -50.0f },
{ 40.0f, 80.0f, 100.0f, 120.0f, 120.0f }},
// Table D.20. soprano “u�
{{ 325.0f, 700.0f, 2700.0f, 3800.0f, 4950.0f },
{ 0.0f, -16.0f, -35.0f, -40.0f, -60.0f },
{ 50.0f, 60.0f, 170.0f, 180.0f, 200.0f }}
};
synthv1_formant::Vtab synthv1_formant::g_tenor_vtab[NUM_VOWELS] = {
// Table D.21. tenor “a�
{{ 650.0f, 1080.0f, 2650.0f, 2900.0f, 3250.0f },
{ 0.0f, -6.0f, -7.0f, -8.0f, -22.0f },
{ 80.0f, 90.0f, 120.0f, 130.0f, 140.0f }},
// Table D.22. tenor “e�
{{ 400.0f, 1700.0f, 2600.0f, 3200.0f, 3580.0f },
{ 0.0f, -14.0f, -12.0f, -14.0f, -20.0f },
{ 70.0f, 80.0f, 100.0f, 120.0f, 120.0f }},
// Table D.23. tenor “i�
{{ 290.0f, 1870.0f, 2800.0f, 3250.0f, 3540.0f },
{ 0.0f, -15.0f, -18.0f, -20.0f, -30.0f },
{ 40.0f, 90.0f, 100.0f, 120.0f, 120.0f }},
// Table D.24. tenor “o�
{{ 400.0f, 800.0f, 2600.0f, 2800.0f, 3000.0f },
{ 0.0f, -10.0f, -12.0f, -12.0f, -26.0f },
{ 70.0f, 80.0f, 100.0f, 130.0f, 135.0f }},
// Table D.25. tenor “u�
{{ 350.0f, 600.0f, 2700.0f, 2900.0f, 3300.0f },
{ 0.0f, -20.0f, -17.0f, -14.0f, -26.0f },
{ 40.0f, 60.0f, 100.0f, 120.0f, 120.0f }}
};
// base vocal tables.
synthv1_formant::Vtab *synthv1_formant::g_vtabs[NUM_VTABS] = {
g_bass_vtab,
g_tenor_vtab,
g_countertenor_vtab,
g_soprano_vtab,
g_alto_vtab
};
// compute coeffs. for given vocal formant table
void synthv1_formant::Impl::vtab_coeffs (
Coeffs& coeffs, const Vtab *vtab, uint32_t i, float p )
{
const float Fi = vtab->freq[i];
const float Gi = vtab->gain[i];
const float Bi = vtab->band[i] * p;
const float Ai = ::powf(10.0f, (0.05f * Gi));
const float Ri = ::expf(-M_PI * Bi / m_srate);
coeffs.b2 = Ri * Ri;
coeffs.b1 = 2.0f * Ri * ::cosf(2.0f * M_PI * Fi / m_srate);
coeffs.a0 = Ai * (1.0f - coeffs.b1 + coeffs.b2);
}
// reset method impl.
void synthv1_formant::Impl::reset_coeffs ( float cutoff, float reso )
{
const float fK = cutoff * float(NUM_VTABS - 1);
const uint32_t k = uint32_t(fK);
const float fJ = (fK - float(k)) * float(NUM_VOWELS - 1);
const uint32_t j = uint32_t(fJ);
const float dJ = (fJ - float(j)); // vowel morph fraction
const float q = 4.0f * reso * reso + 1.0f;
const float p = 1.0f / q;
// vocal/vowel formant morphing
const Vtab *vtabs = g_vtabs[k];
const Vtab *vtab1 = &vtabs[j];
const Vtab *vtab2 = vtab1;
if (j < NUM_VOWELS - 1)
vtab2 = &vtabs[j + 1];
else
if (k < NUM_VTABS - 1)
vtab2 = &g_vtabs[k + 1][0];
Coeffs coeff2;
for (uint32_t i = 0; i < NUM_FORMANTS; ++i) {
Coeffs& coeff1 = m_ctabs[i];
vtab_coeffs(coeff1, vtab1, i, p);
vtab_coeffs(coeff2, vtab2, i, p);
coeff1.a0 += dJ * (coeff2.a0 - coeff1.a0);
coeff1.b1 += dJ * (coeff2.b1 - coeff1.b1);
coeff1.b2 += dJ * (coeff2.b2 - coeff1.b2);
}
}
// reset coeffs. method
void synthv1_formant::reset_coeffs (void)
{
if (m_pImpl) {
m_pImpl->reset_coeffs(m_cutoff, m_reso);
for (uint32_t i = 0; i < NUM_FORMANTS; ++i)
m_filters[i].reset_coeffs(m_pImpl->coeffs(i));
}
}
// end of synthv1_formant.cpp
synthv1-1.4.2/src/PaxHeaders/synthv1_programs.h 0000644 0000000 0000000 00000000132 15174622017 016503 x ustar 00 30 mtime=1777542159.045209693
30 atime=1777542159.045209693
30 ctime=1777542159.045209693
synthv1-1.4.2/src/synthv1_programs.h 0000644 0001750 0000144 00000007510 15174622017 016476 0 ustar 00rncbc users // synthv1_programs.h
//
/****************************************************************************
Copyright (C) 2012-2024, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1_programs_h
#define __synthv1_programs_h
#include "synthv1_sched.h"
#include "synthv1_param.h"
#include
//-------------------------------------------------------------------------
// synthv1_programs - Bank/programs database class.
//
class synthv1_programs
{
public:
// ctor.
synthv1_programs(synthv1 *pSynth);
// dtor.
~synthv1_programs();
// operational mode flags.
void enabled(bool on)
{ m_enabled = on; }
bool enabled() const
{ return m_enabled; }
// prog. base node
class Prog
{
public:
Prog(uint16_t id, const QString& name)
: m_id(id), m_name(name) {}
uint16_t id() const { return m_id; }
const QString& name() const { return m_name; }
void set_name(const QString& name) { m_name = name; }
private:
uint16_t m_id;
QString m_name;
};
typedef QMap Progs;
// bank node
class Bank : public Prog
{
public:
Bank(uint16_t id, const QString& name)
: Prog(id, name) {}
~Bank() { clear_progs(); }
const Progs& progs() const { return m_progs; }
// prog. managers
Prog *find_prog(uint16_t prog_id) const;
Prog *add_prog(uint16_t prog_id, const QString& prog_name);
void remove_prog(uint16_t prog_id);
void clear_progs();
private:
Progs m_progs;
};
typedef QMap Banks;
const Banks& banks() const { return m_banks; }
// bank managers
Bank *find_bank(uint16_t bank_id) const;
Bank *add_bank(uint16_t bank_id, const QString& bank_name);
void remove_bank(uint16_t bank_id);
void clear_banks();
// current bank/prog. managers
void bank_select_msb(uint8_t bank_msb);
void bank_select_lsb(uint8_t bank_lsb);
void bank_select(uint16_t bank_id);
void prog_change(uint16_t prog_id);
void select_program(uint16_t bank_id, uint16_t prog_id);
void process_program(synthv1 *pSynth, uint16_t bank_id, uint16_t prog_id);
Bank *current_bank() const { return m_bank; }
Prog *current_prog() const { return m_prog; }
protected:
uint16_t current_bank_id() const;
// current bank/prog. scheduled thread
class Sched : public synthv1_sched
{
public:
// ctor.
Sched (synthv1 *pSynth)
: synthv1_sched(pSynth, Programs), m_bank_id(0), m_prog_id(0) {}
// schedule (override)
void select_program(uint16_t bank_id, uint16_t prog_id)
{
if (m_bank_id != bank_id ||
m_prog_id != prog_id) {
m_bank_id = bank_id;
m_prog_id = prog_id;
schedule();
}
}
// process (virtual).
void process(int)
{
synthv1 *pSynth = instance();
synthv1_programs *pPrograms = pSynth->programs();
pPrograms->process_program(pSynth, m_bank_id, m_prog_id);
}
private:
// instance variables.
uint16_t m_bank_id;
uint16_t m_prog_id;
};
private:
// instance variables.
bool m_enabled;
Sched m_sched;
uint8_t m_bank_msb;
uint8_t m_bank_lsb;
Bank *m_bank;
Prog *m_prog;
Banks m_banks;
};
#endif // __synthv1_programs_h
// end of synthv1_programs.h
synthv1-1.4.2/src/PaxHeaders/synthv1_formant.h 0000644 0000000 0000000 00000000124 15174622017 016320 x ustar 00 28 mtime=1777542159.0442097
28 atime=1777542159.0442097
28 ctime=1777542159.0442097
synthv1-1.4.2/src/synthv1_formant.h 0000644 0001750 0000144 00000012253 15174622017 016312 0 ustar 00rncbc users // synthv1_formant.h
//
/****************************************************************************
Copyright (C) 2012-2021, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1_formant_h
#define __synthv1_formant_h
#include
#include
//---------------------------------------------------------------------
// synthv1_formant - formant parallel filter after Dennis H. Klatt's
// Software for a cascade/parallel formant synthesizer
// 1979 MIT; 1980 Acoustical Society of America.
//
class synthv1_formant
{
public:
// constants
static const uint32_t NUM_VTABS = 5;
static const uint32_t NUM_VOWELS = 5;
static const uint32_t NUM_FORMANTS = 5;
static const uint32_t NUM_STEPS = 320;
// 2-pole filter coeffs.
struct Coeffs { float a0, b1, b2; };
// vocal/vowel table
struct Vtab
{
float freq[NUM_FORMANTS]; // frequency [Hz]
float gain[NUM_FORMANTS]; // peak gain [dB]
float band[NUM_FORMANTS]; // bandwidth [Hz]
};
// main impl.
class Impl
{
public:
// ctor.
Impl(float srate = 44100.0f)
: m_srate(srate) { reset_coeffs(); }
// sample-rate accessors
void setSampleRate(float srate)
{ m_srate = srate; reset_coeffs(); }
float sampleRate() const
{ return m_srate; }
// formant coeffs. accessor
const Coeffs& coeffs(uint32_t i) const
{ return m_ctabs[i]; }
// reset coeffs. method
void reset_coeffs(float cutoff = 0.5f, float reso = 0.0f);
protected:
// compute coeffs. for given vocal formant table
void vtab_coeffs(Coeffs& coeffs, const Vtab *vtab, uint32_t i, float p);
private:
// instance members
float m_srate;
// filter coeffs.
Coeffs m_ctabs[NUM_FORMANTS];
};
// ctor.
synthv1_formant(Impl *pImpl = 0)
: m_pImpl(pImpl), m_cutoff(0.5f), m_reso(0.0f), m_nstep(0)
{ reset_coeffs(); }
// reset impl.
void reset(Impl *pImpl)
{ m_pImpl = pImpl; reset_coeffs(); }
void reset_filters(float cutoff, float reso)
{
for (uint32_t i = 0; i < NUM_FORMANTS; ++i)
m_filters[i].reset();
update(cutoff, reso);
}
// output tick
float output(float in, float cutoff, float reso)
{
update(cutoff, reso);
float out = 0.0f;
for (uint32_t i = 0; i < NUM_FORMANTS; ++i)
out += m_filters[i].output(in);
return out;
}
// process block
void process(float *in, uint32_t nframes, float wet, float cutoff, float reso)
{
for (uint32_t i = 0; i < nframes; ++i) {
const float out = output(in[i], cutoff, reso);
in[i] *= (1.0f - wet);
in[i] += (wet * out);
}
}
protected:
// step-wise smoothed coeff.
class Coeff
{
public:
Coeff() { reset(); }
void reset()
{
m_value = m_vstep = 0.0f;
m_nstep = 0;
}
void set_value(float value)
{
m_nstep = NUM_STEPS;
m_vstep = (value - m_value) / float(m_nstep);
}
float value() const
{ return m_value + m_vstep * float(m_nstep); }
float tick()
{
if (m_nstep > 0) {
m_value += m_vstep;
--m_nstep;
}
return m_value;
}
private:
float m_value;
float m_vstep;
uint32_t m_nstep;
};
// 2-pole resonator filter
class Filter
{
public:
Filter() { reset(); }
void reset()
{
m_a0.reset();
m_b1.reset();
m_b2.reset();
m_out1 = m_out2 = 0.0f;
}
void reset_coeffs(const Coeffs& coeffs)
{
m_a0.set_value(coeffs.a0);
m_b1.set_value(coeffs.b1);
m_b2.set_value(coeffs.b2);
}
float output(float in)
{
const float out
= m_a0.tick() * in
+ m_b1.tick() * m_out1
- m_b2.tick() * m_out2;
m_out2 = m_out1;
m_out1 = out;
return out;
}
private:
Coeff m_a0, m_b1, m_b2;
float m_out1, m_out2;
};
// update method
void update(float cutoff, float reso)
{
if (m_nstep > 0)
--m_nstep;
else
if (::fabsf(m_cutoff - cutoff) > 0.001f ||
::fabsf(m_reso - reso) > 0.001f) {
m_nstep = NUM_STEPS;
m_cutoff = cutoff;
m_reso = reso;
reset_coeffs();
}
}
// reset coeffs. method
void reset_coeffs();
private:
// instance members
Impl *m_pImpl;
// parameters.
float m_cutoff;
float m_reso;
// slew-rate control.
uint32_t m_nstep;
// formant filters
Filter m_filters[NUM_FORMANTS];
// base vocal tables
static Vtab g_bass_vtab[NUM_VOWELS];
static Vtab g_tenor_vtab[NUM_VOWELS];
static Vtab g_countertenor_vtab[NUM_VOWELS];
static Vtab g_soprano_vtab[NUM_VOWELS];
static Vtab g_alto_vtab[NUM_VOWELS];
static Vtab *g_vtabs[NUM_VTABS];
};
#endif // __synthv1_formant_h
// end of synthv1_formant.h
synthv1-1.4.2/src/PaxHeaders/synthv1widget_control.h 0000644 0000000 0000000 00000000132 15174622017 017535 x ustar 00 30 mtime=1777542159.046209685
30 atime=1777542159.046209685
30 ctime=1777542159.046209685
synthv1-1.4.2/src/synthv1widget_control.h 0000644 0001750 0000144 00000006574 15174622017 017541 0 ustar 00rncbc users // synthv1widget_control.h
//
/****************************************************************************
Copyright (C) 2012-2022, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1widget_control_h
#define __synthv1widget_control_h
#include "synthv1_controls.h"
#include "synthv1_param.h"
#include
// forward decls.
namespace Ui { class synthv1widget_control; }
class QAbstractButton;
class QCloseEvent;
//----------------------------------------------------------------------------
// synthv1widget_control -- UI wrapper form.
class synthv1widget_control : public QDialog
{
Q_OBJECT
public:
// Pseudo-singleton instance.
static synthv1widget_control *getInstance();
// Pseudo-constructor.
static void showInstance(
synthv1_controls *pControls, synthv1::ParamIndex index,
const QString& sTitle, QWidget *pParent = nullptr);
// Control accessors.
void setControls(synthv1_controls *pControls, synthv1::ParamIndex index);
synthv1_controls *controls() const;
synthv1::ParamIndex controlIndex() const;
// Process incoming controller key event.
void setControlKey(const synthv1_controls::Key& key);
synthv1_controls::Key controlKey() const;
protected slots:
void changed();
void clicked(QAbstractButton *);
void reset();
void accept();
void reject();
void activateControlType(int);
void editControlParamFinished();
void stabilize();
protected:
// Constructor.
synthv1widget_control(QWidget *pParent = nullptr);
// Destructor.
~synthv1widget_control();
// Pseudo-destructor.
void cleanup();
void closeEvent(QCloseEvent *pCloseEvent);
// Control type dependency refresh.
void updateControlType(int iControlType);
void setControlType(synthv1_controls::Type ctype);
synthv1_controls::Type controlType() const;
void setControlParam(unsigned short param);
unsigned short controlParam() const;
unsigned short controlChannel() const;
synthv1_controls::Type controlTypeFromIndex (int iIndex) const;
int indexFromControlType(synthv1_controls::Type ctype) const;
unsigned short controlParamFromIndex(int iIndex) const;
int indexFromControlParam(unsigned short param) const;
private:
// The Qt-designer UI struct...
Ui::synthv1widget_control *p_ui;
Ui::synthv1widget_control& m_ui;
// Instance variables.
synthv1_controls *m_pControls;
// Target subject.
synthv1_controls::Key m_key;
synthv1::ParamIndex m_index;
// Instance variables.
int m_iControlParamUpdate;
int m_iDirtyCount;
int m_iDirtySetup;
// Pseudo-singleton instance.
static synthv1widget_control *g_pInstance;
};
#endif // __synthv1widget_control_h
// end of synthv1widget_control.h
synthv1-1.4.2/src/PaxHeaders/synthv1_config.cpp 0000644 0000000 0000000 00000000132 15174622017 016451 x ustar 00 30 mtime=1777542159.044036209
30 atime=1777542159.044036209
30 ctime=1777542159.044036209
synthv1-1.4.2/src/synthv1_config.cpp 0000644 0001750 0000144 00000026032 15174622017 016444 0 ustar 00rncbc users // synthv1_config.cpp
//
/****************************************************************************
Copyright (C) 2012-2024, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#include "synthv1_config.h"
#include "synthv1_programs.h"
#include "synthv1_controls.h"
#include
//-------------------------------------------------------------------------
// synthv1_config - Prototype settings structure (pseudo-singleton).
//
// Singleton instance accessor (static).
synthv1_config *synthv1_config::g_pSettings = nullptr;
synthv1_config *synthv1_config::getInstance (void)
{
return g_pSettings;
}
// Constructor.
synthv1_config::synthv1_config (void)
: QSettings(PROJECT_DOMAIN, PROJECT_NAME)
{
g_pSettings = this;
load();
}
// Default destructor.
synthv1_config::~synthv1_config (void)
{
save();
g_pSettings = nullptr;
}
// Preset utility methods.
QString synthv1_config::presetGroup (void) const
{
return "/Presets/";
}
QString synthv1_config::presetFile ( const QString& sPreset )
{
QSettings::beginGroup(presetGroup());
const QString sPresetFile(QSettings::value(sPreset).toString());
QSettings::endGroup();
return sPresetFile;
}
void synthv1_config::setPresetFile (
const QString& sPreset, const QString& sPresetFile )
{
QSettings::beginGroup(presetGroup());
QSettings::setValue(sPreset, sPresetFile);
QSettings::endGroup();
m_presetList.clear();
}
void synthv1_config::removePreset ( const QString& sPreset )
{
QSettings::beginGroup(presetGroup());
const QString& sPresetFile = QSettings::value(sPreset).toString();
if (QFileInfo(sPresetFile).exists())
QFile(sPresetFile).remove();
QSettings::remove(sPreset);
QSettings::endGroup();
m_presetList.clear();
}
const QStringList& synthv1_config::presetList (void)
{
if (m_presetList.isEmpty()) {
QSettings::beginGroup(presetGroup());
QStringListIterator iter(QSettings::childKeys());
while (iter.hasNext()) {
const QString& sPreset = iter.next();
if (QFileInfo(QSettings::value(sPreset).toString()).exists())
m_presetList.append(sPreset);
}
QSettings::endGroup();
}
return m_presetList;
}
// Programs utility methods.
QString synthv1_config::programsGroup (void) const
{
return "/Programs";
}
QString synthv1_config::bankPrefix (void) const
{
return "/Bank_";
}
void synthv1_config::loadPrograms ( synthv1_programs *pPrograms )
{
pPrograms->clear_banks();
QSettings::beginGroup(programsGroup());
const QStringList& bank_keys = QSettings::childKeys();
QStringListIterator bank_iter(bank_keys);
while (bank_iter.hasNext()) {
const QString& bank_key = bank_iter.next();
uint16_t bank_id = bank_key.toInt();
const QString& bank_name
= QSettings::value(bank_key).toString();
synthv1_programs::Bank *pBank = pPrograms->add_bank(bank_id, bank_name);
QSettings::beginGroup(bankPrefix() + bank_key);
const QStringList& prog_keys = QSettings::childKeys();
QStringListIterator prog_iter(prog_keys);
while (prog_iter.hasNext()) {
const QString& prog_key = prog_iter.next();
uint16_t prog_id = prog_key.toInt();
const QString& prog_name
= QSettings::value(prog_key).toString();
pBank->add_prog(prog_id, prog_name);
}
QSettings::endGroup();
}
QSettings::endGroup();
pPrograms->enabled(bProgramsEnabled);
}
void synthv1_config::savePrograms ( synthv1_programs *pPrograms )
{
bProgramsEnabled = pPrograms->enabled();
clearPrograms();
QSettings::beginGroup(programsGroup());
const synthv1_programs::Banks& banks = pPrograms->banks();
synthv1_programs::Banks::ConstIterator bank_iter = banks.constBegin();
const synthv1_programs::Banks::ConstIterator& bank_end = banks.constEnd();
for ( ; bank_iter != bank_end; ++bank_iter) {
synthv1_programs::Bank *pBank = bank_iter.value();
const QString& bank_key = QString::number(pBank->id());
const QString& bank_name = pBank->name();
QSettings::setValue(bank_key, bank_name);
QSettings::beginGroup(bankPrefix() + bank_key);
const synthv1_programs::Progs& progs = pBank->progs();
synthv1_programs::Progs::ConstIterator prog_iter = progs.constBegin();
const synthv1_programs::Progs::ConstIterator& prog_end = progs.constEnd();
for ( ; prog_iter != prog_end; ++prog_iter) {
synthv1_programs::Prog *pProg = prog_iter.value();
const QString& prog_key = QString::number(pProg->id());
const QString& prog_name = pProg->name();
QSettings::setValue(prog_key, prog_name);
}
QSettings::endGroup();
}
QSettings::endGroup();
QSettings::sync();
}
void synthv1_config::clearPrograms (void)
{
QSettings::beginGroup(programsGroup());
const QStringList& bank_keys = QSettings::childKeys();
QStringListIterator bank_iter(bank_keys);
while (bank_iter.hasNext()) {
const QString& bank_key = bank_iter.next();
QSettings::beginGroup(bankPrefix() + bank_key);
const QStringList& prog_keys = QSettings::childKeys();
QStringListIterator prog_iter(prog_keys);
while (prog_iter.hasNext()) {
const QString& prog_key = prog_iter.next();
QSettings::remove(prog_key);
}
QSettings::endGroup();
QSettings::remove(bank_key);
}
QSettings::endGroup();
}
// Programs utility methods.
QString synthv1_config::controlsGroup (void) const
{
return "/Controllers";
}
QString synthv1_config::controlPrefix (void) const
{
return "/Control";
}
void synthv1_config::loadControls ( synthv1_controls *pControls )
{
pControls->clear();
QSettings::beginGroup(controlsGroup());
const QStringList& keys = QSettings::childKeys();
QStringListIterator iter(keys);
while (iter.hasNext()) {
const QString& sKey = '/' + iter.next();
const QStringList& clist = sKey.split('_');
if (clist.at(0) == controlPrefix()) {
const unsigned short channel
= clist.at(1).toInt();
const synthv1_controls::Type ctype
= synthv1_controls::typeFromText(clist.at(2));
synthv1_controls::Key key;
key.status = ctype | (channel & 0x1f);
key.param = clist.at(3).toInt();
const QStringList& vlist
= QSettings::value(sKey).toStringList();
synthv1_controls::Data data;
data.index = vlist.at(0).toInt();
if (vlist.count() > 1)
data.flags = vlist.at(1).toInt();
pControls->add_control(key, data);
}
}
QSettings::endGroup();
pControls->enabled(bControlsEnabled);
}
void synthv1_config::saveControls ( synthv1_controls *pControls )
{
bControlsEnabled = pControls->enabled();
clearControls();
QSettings::beginGroup(controlsGroup());
const synthv1_controls::Map& map = pControls->map();
synthv1_controls::Map::ConstIterator iter = map.constBegin();
const synthv1_controls::Map::ConstIterator& iter_end = map.constEnd();
for ( ; iter != iter_end; ++iter) {
const synthv1_controls::Key& key = iter.key();
QString sKey = controlPrefix();
sKey += '_' + QString::number(key.channel());
sKey += '_' + synthv1_controls::textFromType(key.type());
sKey += '_' + QString::number(key.param);
const synthv1_controls::Data& data = iter.value();
QStringList vlist;
vlist.append(QString::number(data.index));
vlist.append(QString::number(data.flags));
QSettings::setValue(sKey, vlist);
}
QSettings::endGroup();
QSettings::sync();
}
void synthv1_config::clearControls (void)
{
QSettings::beginGroup(controlsGroup());
const QStringList& keys = QSettings::childKeys();
QStringListIterator iter(keys);
while (iter.hasNext()) {
const QString& key = iter.next();
QSettings::remove(key);
}
QSettings::endGroup();
}
// Explicit I/O methods.
void synthv1_config::load (void)
{
QSettings::beginGroup("/Default");
sPreset = QSettings::value("/Preset").toString();
sPresetDir = QSettings::value("/PresetDir").toString();
iKnobDialMode = QSettings::value("/KnobDialMode", 0).toInt();
iKnobEditMode = QSettings::value("/KnobEditMode", 0).toInt();
fRandomizePercent = QSettings::value("/RandomizePercent", 20.0f).toFloat();
bControlsEnabled = QSettings::value("/ControlsEnabled", false).toBool();
bProgramsEnabled = QSettings::value("/ProgramsEnabled", false).toBool();
QSettings::endGroup();
QSettings::beginGroup("/Dialogs");
bProgramsPreview = QSettings::value("/ProgramsPreview", false).toBool();
bUseNativeDialogs = QSettings::value("/UseNativeDialogs", false).toBool();
// Run-time special non-persistent options.
bDontUseNativeDialogs = !bUseNativeDialogs;
QSettings::endGroup();
QSettings::beginGroup("/Custom");
sCustomColorTheme = QSettings::value("/ColorTheme").toString();
sCustomStyleTheme = QSettings::value("/StyleTheme").toString();
QSettings::endGroup();
// Micro-tuning options.
QSettings::beginGroup("/Tuning");
bTuningEnabled = QSettings::value("/Enabled", false).toBool();
fTuningRefPitch = float(QSettings::value("/RefPitch", 440.0).toDouble());
iTuningRefNote = QSettings::value("/RefNote", 69).toInt();
sTuningScaleDir = QSettings::value("/ScaleDir").toString();
sTuningScaleFile = QSettings::value("/ScaleFile").toString();
sTuningKeyMapDir = QSettings::value("/KeyMapDir").toString();
sTuningKeyMapFile = QSettings::value("/KeyMapFile").toString();
QSettings::endGroup();
}
void synthv1_config::save (void)
{
QSettings::beginGroup("/Program");
QSettings::setValue("/Version", PROJECT_VERSION);
QSettings::endGroup();
QSettings::beginGroup("/Default");
QSettings::setValue("/Preset", sPreset);
QSettings::setValue("/PresetDir", sPresetDir);
QSettings::setValue("/KnobDialMode", iKnobDialMode);
QSettings::setValue("/KnobEditMode", iKnobEditMode);
QSettings::setValue("/RandomizePercent", fRandomizePercent);
QSettings::setValue("/ControlsEnabled", bControlsEnabled);
QSettings::setValue("/ProgramsEnabled", bProgramsEnabled);
QSettings::endGroup();
QSettings::beginGroup("/Dialogs");
QSettings::setValue("/ProgramsPreview", bProgramsPreview);
QSettings::setValue("/UseNativeDialogs", bUseNativeDialogs);
QSettings::endGroup();
QSettings::beginGroup("/Custom");
QSettings::setValue("/ColorTheme", sCustomColorTheme);
QSettings::setValue("/StyleTheme", sCustomStyleTheme);
QSettings::endGroup();
// Micro-tuning options.
QSettings::beginGroup("/Tuning");
QSettings::setValue("/Enabled", bTuningEnabled);
QSettings::setValue("/RefPitch", double(fTuningRefPitch));
QSettings::setValue("/RefNote", iTuningRefNote);
QSettings::setValue("/ScaleDir", sTuningScaleDir);
QSettings::setValue("/ScaleFile", sTuningScaleFile);
QSettings::setValue("/KeyMapDir", sTuningKeyMapDir);
QSettings::setValue("/KeyMapFile", sTuningKeyMapFile);
QSettings::endGroup();
QSettings::sync();
}
// end of synthv1_config.cpp
synthv1-1.4.2/src/PaxHeaders/synthv1widget.cpp 0000644 0000000 0000000 00000000132 15174622017 016330 x ustar 00 30 mtime=1777542159.045209693
30 atime=1777542159.045209693
30 ctime=1777542159.045209693
synthv1-1.4.2/src/synthv1widget.cpp 0000644 0001750 0000144 00000137611 15174622017 016331 0 ustar 00rncbc users // synthv1widget.cpp
//
/****************************************************************************
Copyright (C) 2012-2026, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#include "synthv1widget.h"
#include "synthv1_param.h"
#include "synthv1_wave.h"
#include "synthv1_sched.h"
#include "synthv1widget_config.h"
#include "synthv1widget_control.h"
#include "synthv1widget_keybd.h"
#include "synthv1_controls.h"
#include "synthv1_programs.h"
#include "ui_synthv1widget.h"
#include
#include
#include
#include
#include
#include
#include
#include
//-------------------------------------------------------------------------
// synthv1widget - impl.
//
// Constructor.
synthv1widget::synthv1widget ( QWidget *pParent )
: QWidget(pParent), p_ui(new Ui::synthv1widget), m_ui(*p_ui)
{
Q_INIT_RESOURCE(synthv1);
#if defined(QT_STATIC)
QFontDatabase::removeAllApplicationFonts();
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32)
::_putenv_s("QT_QPA_FONTDIR", ".");
#else
::setenv("QT_QPA_FONTDIR", ".", 1);
#endif
QFontDatabase::addApplicationFont(":/fonts/DejaVuSansCondensed.ttf");
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
// HACK: Dark themes grayed/disabled color group fix...
QPalette pal;
if (pal.base().color().value() < 0x7f) {
const QColor& color = pal.window().color();
const int iGroups = int(QPalette::Active | QPalette::Inactive) + 1;
for (int i = 0; i < iGroups; ++i) {
const QPalette::ColorGroup group = QPalette::ColorGroup(i);
pal.setBrush(group, QPalette::Light, color.lighter(150));
pal.setBrush(group, QPalette::Midlight, color.lighter(120));
pal.setBrush(group, QPalette::Dark, color.darker(150));
pal.setBrush(group, QPalette::Mid, color.darker(120));
pal.setBrush(group, QPalette::Shadow, color.darker(200));
}
pal.setColor(QPalette::Disabled, QPalette::ButtonText, pal.mid().color());
QWidget::setPalette(pal);
}
#endif
m_ui.setupUi(this);
#if QT_VERSION < QT_VERSION_CHECK(6, 1, 0)
QWidget::setWindowIcon(QIcon(":/images/synthv1.png"));
#endif
// Init sched notifier.
m_sched_notifier = nullptr;
// Init swapable params A/B to default.
for (uint32_t i = 0; i < synthv1::NUM_PARAMS; ++i)
m_params_ab[i] = synthv1_param::paramDefaultValue(synthv1::ParamIndex(i));
// Start clean.
m_iUpdate = 0;
// Replicate the stacked/pages
for (int iTab = 0; iTab < m_ui.StackedWidget->count(); ++iTab)
m_ui.TabBar->addTab(m_ui.StackedWidget->widget(iTab)->windowTitle());
// Swappable params A/B group.
QButtonGroup *pSwapParamsGroup = new QButtonGroup(this);
pSwapParamsGroup->addButton(m_ui.SwapParamsAButton);
pSwapParamsGroup->addButton(m_ui.SwapParamsBButton);
pSwapParamsGroup->setExclusive(true);
m_ui.SwapParamsAButton->setChecked(true);
// Wave shapes.
QStringList shapes;
shapes << tr("Pulse");
shapes << tr("Saw");
shapes << tr("Sine");
shapes << tr("Rand");
shapes << tr("Noise");
m_ui.Dco1Shape1Knob->insertItems(0, shapes);
m_ui.Dco1Shape2Knob->insertItems(0, shapes);
m_ui.Dco2Shape1Knob->insertItems(0, shapes);
m_ui.Dco2Shape2Knob->insertItems(0, shapes);
m_ui.Lfo1ShapeKnob->insertItems(0, shapes);
m_ui.Lfo2ShapeKnob->insertItems(0, shapes);
// Filter types.
QStringList types;
types << tr("LPF");
types << tr("BPF");
types << tr("HPF");
types << tr("BRF");
m_ui.Dcf1TypeKnob->insertItems(0, types);
m_ui.Dcf2TypeKnob->insertItems(0, types);
// Filter slopes.
QStringList slopes;
slopes << tr("12dB/oct");
slopes << tr("24dB/oct");
slopes << tr("Biquad");
slopes << tr("Formant");
m_ui.Dcf1SlopeKnob->insertItems(0, slopes);
m_ui.Dcf2SlopeKnob->insertItems(0, slopes);
m_ui.Dco1Sync1Knob->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
m_ui.Dco1Sync2Knob->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
m_ui.Dco2Sync1Knob->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
m_ui.Dco2Sync2Knob->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
// Dynamic states.
QStringList states;
states << tr("Off");
states << tr("On");
#if 0
m_ui.Dco1Bandl1Knob->insertItems(0, states);
m_ui.Dco1Bandl2Knob->insertItems(0, states);
m_ui.Dco2Bandl1Knob->insertItems(0, states);
m_ui.Dco2Bandl2Knob->insertItems(0, states);
m_ui.Lfo1SyncKnob->insertItems(0, states);
m_ui.Lfo2SyncKnob->insertItems(0, states);
m_ui.Dyn1CompressKnob->insertItems(0, states);
m_ui.Dyn1LimiterKnob->insertItems(0, states);
#else
m_ui.Lfo1SyncKnob->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
m_ui.Lfo2SyncKnob->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
#endif
// Special values
const QString& sOff = states.first();
m_ui.Dco1RingModKnob->setSpecialValueText(sOff);
m_ui.Dco2RingModKnob->setSpecialValueText(sOff);
m_ui.Dco1GlideKnob->setSpecialValueText(sOff);
m_ui.Dco2GlideKnob->setSpecialValueText(sOff);
m_ui.Cho1WetKnob->setSpecialValueText(sOff);
m_ui.Fla1WetKnob->setSpecialValueText(sOff);
m_ui.Pha1WetKnob->setSpecialValueText(sOff);
m_ui.Del1WetKnob->setSpecialValueText(sOff);
m_ui.Rev1WetKnob->setSpecialValueText(sOff);
const QString& sAuto = tr("Auto");
m_ui.Lfo1BpmKnob->setSpecialValueText(sAuto);
m_ui.Lfo2BpmKnob->setSpecialValueText(sAuto);
m_ui.Del1BpmKnob->setSpecialValueText(sAuto);
// Wave integer widths.
m_ui.Dco1Width1Knob->setDecimals(0);
m_ui.Dco1Width2Knob->setDecimals(0);
m_ui.Dco2Width1Knob->setDecimals(0);
m_ui.Dco2Width2Knob->setDecimals(0);
m_ui.Lfo1WidthKnob->setDecimals(0);
m_ui.Lfo2WidthKnob->setDecimals(0);
// DCO octave limits.
m_ui.Dco1OctaveKnob->setMinimum(-4.0f);
m_ui.Dco1OctaveKnob->setMaximum(+4.0f);
m_ui.Dco2OctaveKnob->setMinimum(-4.0f);
m_ui.Dco2OctaveKnob->setMaximum(+4.0f);
// DCO balance limits.
m_ui.Dco1BalanceKnob->setMinimum(-1.0f);
m_ui.Dco1BalanceKnob->setMaximum(+1.0f);
m_ui.Dco2BalanceKnob->setMinimum(-1.0f);
m_ui.Dco2BalanceKnob->setMaximum(+1.0f);
// DCO tune limits.
m_ui.Dco1TuningKnob->setMinimum(-1.0f);
m_ui.Dco1TuningKnob->setMaximum(+1.0f);
m_ui.Dco2TuningKnob->setMinimum(-1.0f);
m_ui.Dco2TuningKnob->setMaximum(+1.0f);
// DCF volume (env.amount) limits.
m_ui.Dcf1EnvelopeKnob->setMinimum(-1.0f);
m_ui.Dcf1EnvelopeKnob->setMaximum(+1.0f);
m_ui.Dcf2EnvelopeKnob->setMinimum(-1.0f);
m_ui.Dcf2EnvelopeKnob->setMaximum(+1.0f);
// LFO parameter limits.
m_ui.Lfo1BpmKnob->setScale(1.0f);
m_ui.Lfo1BpmKnob->setMinimum(0.0f);
m_ui.Lfo1BpmKnob->setMaximum(360.0f);
// m_ui.Lfo1BpmKnob->setSingleStep(1.0f);
m_ui.Lfo1SweepKnob->setMinimum(-1.0f);
m_ui.Lfo1SweepKnob->setMaximum(+1.0f);
m_ui.Lfo1CutoffKnob->setMinimum(-1.0f);
m_ui.Lfo1CutoffKnob->setMaximum(+1.0f);
m_ui.Lfo1ResoKnob->setMinimum(-1.0f);
m_ui.Lfo1ResoKnob->setMaximum(+1.0f);
m_ui.Lfo1PitchKnob->setMinimum(-1.0f);
m_ui.Lfo1PitchKnob->setMaximum(+1.0f);
m_ui.Lfo1BalanceKnob->setMinimum(-1.0f);
m_ui.Lfo1BalanceKnob->setMaximum(+1.0f);
m_ui.Lfo1RingModKnob->setMinimum(-1.0f);
m_ui.Lfo1RingModKnob->setMaximum(+1.0f);
m_ui.Lfo1PanningKnob->setMinimum(-1.0f);
m_ui.Lfo1PanningKnob->setMaximum(+1.0f);
m_ui.Lfo1VolumeKnob->setMinimum(-1.0f);
m_ui.Lfo1VolumeKnob->setMaximum(+1.0f);
m_ui.Lfo2BpmKnob->setScale(1.0f);
m_ui.Lfo2BpmKnob->setMinimum(0.0f);
m_ui.Lfo2BpmKnob->setMaximum(360.0f);
// m_ui.Lfo2BpmKnob->setSingleStep(1.0f);
m_ui.Lfo2SweepKnob->setMinimum(-1.0f);
m_ui.Lfo2SweepKnob->setMaximum(+1.0f);
m_ui.Lfo2CutoffKnob->setMinimum(-1.0f);
m_ui.Lfo2CutoffKnob->setMaximum(+1.0f);
m_ui.Lfo2ResoKnob->setMinimum(-1.0f);
m_ui.Lfo2ResoKnob->setMaximum(+1.0f);
m_ui.Lfo2PitchKnob->setMinimum(-1.0f);
m_ui.Lfo2PitchKnob->setMaximum(+1.0f);
m_ui.Lfo2BalanceKnob->setMinimum(-1.0f);
m_ui.Lfo2BalanceKnob->setMaximum(+1.0f);
m_ui.Lfo2RingModKnob->setMinimum(-1.0f);
m_ui.Lfo2RingModKnob->setMaximum(+1.0f);
m_ui.Lfo2PanningKnob->setMinimum(-1.0f);
m_ui.Lfo2PanningKnob->setMaximum(+1.0f);
m_ui.Lfo2VolumeKnob->setMinimum(-1.0f);
m_ui.Lfo2VolumeKnob->setMaximum(+1.0f);
// added by scotty to try to support linnstruments need for bigger bend range
m_ui.Def1PitchbendKnob->setMinimum(0.0f);
m_ui.Def1PitchbendKnob->setMaximum(+4.0f);
m_ui.Def2PitchbendKnob->setMinimum(0.0f);
m_ui.Def2PitchbendKnob->setMaximum(+4.0f);
// Channel filters
QStringList channels;
channels << tr("Omni");
for (int iChannel = 0; iChannel < 16; ++iChannel)
channels << QString::number(iChannel + 1);
m_ui.Def1ChannelKnob->insertItems(0, channels);
m_ui.Def2ChannelKnob->insertItems(0, channels);
// Mono switches.
QStringList modes;
modes << tr("Poly");
modes << tr("Mono");
modes << tr("Legato");
m_ui.Def1MonoKnob->insertItems(0, modes);
m_ui.Def2MonoKnob->insertItems(0, modes);
// Output (stereo-)width limits.
m_ui.Out1WidthKnob->setMinimum(-1.0f);
m_ui.Out1WidthKnob->setMaximum(+1.0f);
m_ui.Out2WidthKnob->setMinimum(-1.0f);
m_ui.Out2WidthKnob->setMaximum(+1.0f);
// Output (stereo-)panning limits.
m_ui.Out1PanningKnob->setMinimum(-1.0f);
m_ui.Out1PanningKnob->setMaximum(+1.0f);
m_ui.Out2PanningKnob->setMinimum(-1.0f);
m_ui.Out2PanningKnob->setMaximum(+1.0f);
// Effects (delay BPM)
m_ui.Del1BpmKnob->setScale(1.0f);
m_ui.Del1BpmKnob->setMinimum(0.0f);
m_ui.Del1BpmKnob->setMaximum(360.0f);
// m_ui.Del1BpmKnob->setSingleStep(1.0f);
// Reverb (stereo-)width limits.
m_ui.Rev1WidthKnob->setMinimum(-1.0f);
m_ui.Rev1WidthKnob->setMaximum(+1.0f);
// DCO1
setParamKnob(synthv1::DCO1_SHAPE1, m_ui.Dco1Shape1Knob);
setParamKnob(synthv1::DCO1_WIDTH1, m_ui.Dco1Width1Knob);
setParamKnob(synthv1::DCO1_BANDL1, m_ui.Dco1Bandl1Knob);
setParamKnob(synthv1::DCO1_SYNC1, m_ui.Dco1Sync1Knob);
setParamKnob(synthv1::DCO1_SHAPE2, m_ui.Dco1Shape2Knob);
setParamKnob(synthv1::DCO1_WIDTH2, m_ui.Dco1Width2Knob);
setParamKnob(synthv1::DCO1_BANDL2, m_ui.Dco1Bandl2Knob);
setParamKnob(synthv1::DCO1_SYNC2, m_ui.Dco1Sync2Knob);
setParamKnob(synthv1::DCO1_BALANCE, m_ui.Dco1BalanceKnob);
setParamKnob(synthv1::DCO1_DETUNE, m_ui.Dco1DetuneKnob);
setParamKnob(synthv1::DCO1_PHASE, m_ui.Dco1PhaseKnob);
setParamKnob(synthv1::DCO1_RINGMOD, m_ui.Dco1RingModKnob);
setParamKnob(synthv1::DCO1_OCTAVE, m_ui.Dco1OctaveKnob);
setParamKnob(synthv1::DCO1_TUNING, m_ui.Dco1TuningKnob);
setParamKnob(synthv1::DCO1_GLIDE, m_ui.Dco1GlideKnob);
setParamKnob(synthv1::DCO1_ENVTIME, m_ui.Dco1EnvTimeKnob);
QObject::connect(
m_ui.Dco1Shape1Knob, SIGNAL(valueChanged(float)),
m_ui.Dco1Wave1, SLOT(setWaveShape(float)));
QObject::connect(
m_ui.Dco1Wave1, SIGNAL(waveShapeChanged(float)),
m_ui.Dco1Shape1Knob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dco1Width1Knob, SIGNAL(valueChanged(float)),
m_ui.Dco1Wave1, SLOT(setWaveWidth(float)));
QObject::connect(
m_ui.Dco1Wave1, SIGNAL(waveWidthChanged(float)),
m_ui.Dco1Width1Knob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dco1Shape2Knob, SIGNAL(valueChanged(float)),
m_ui.Dco1Wave2, SLOT(setWaveShape(float)));
QObject::connect(
m_ui.Dco1Wave2, SIGNAL(waveShapeChanged(float)),
m_ui.Dco1Shape2Knob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dco1Width2Knob, SIGNAL(valueChanged(float)),
m_ui.Dco1Wave2, SLOT(setWaveWidth(float)));
QObject::connect(
m_ui.Dco1Wave2, SIGNAL(waveWidthChanged(float)),
m_ui.Dco1Width2Knob, SLOT(setValue(float)));
// DCF1
setParamKnob(synthv1::DCF1_ENABLED, m_ui.Dcf1GroupBox->param());
setParamKnob(synthv1::DCF1_CUTOFF, m_ui.Dcf1CutoffKnob);
setParamKnob(synthv1::DCF1_RESO, m_ui.Dcf1ResoKnob);
setParamKnob(synthv1::DCF1_TYPE, m_ui.Dcf1TypeKnob);
setParamKnob(synthv1::DCF1_SLOPE, m_ui.Dcf1SlopeKnob);
setParamKnob(synthv1::DCF1_ENVELOPE, m_ui.Dcf1EnvelopeKnob);
setParamKnob(synthv1::DCF1_ATTACK, m_ui.Dcf1AttackKnob);
setParamKnob(synthv1::DCF1_DECAY, m_ui.Dcf1DecayKnob);
setParamKnob(synthv1::DCF1_SUSTAIN, m_ui.Dcf1SustainKnob);
setParamKnob(synthv1::DCF1_RELEASE, m_ui.Dcf1ReleaseKnob);
QObject::connect(
m_ui.Dcf1Filt, SIGNAL(cutoffChanged(float)),
m_ui.Dcf1CutoffKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf1CutoffKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf1Filt, SLOT(setCutoff(float)));
QObject::connect(
m_ui.Dcf1Filt, SIGNAL(resoChanged(float)),
m_ui.Dcf1ResoKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf1ResoKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf1Filt, SLOT(setReso(float)));
QObject::connect(
m_ui.Dcf1TypeKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf1Filt, SLOT(setType(float)));
QObject::connect(
m_ui.Dcf1SlopeKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf1Filt, SLOT(setSlope(float)));
QObject::connect(
m_ui.Dcf1Env, SIGNAL(attackChanged(float)),
m_ui.Dcf1AttackKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf1AttackKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf1Env, SLOT(setAttack(float)));
QObject::connect(
m_ui.Dcf1Env, SIGNAL(decayChanged(float)),
m_ui.Dcf1DecayKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf1DecayKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf1Env, SLOT(setDecay(float)));
QObject::connect(
m_ui.Dcf1Env, SIGNAL(sustainChanged(float)),
m_ui.Dcf1SustainKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf1SustainKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf1Env, SLOT(setSustain(float)));
QObject::connect(
m_ui.Dcf1Env, SIGNAL(releaseChanged(float)),
m_ui.Dcf1ReleaseKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf1ReleaseKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf1Env, SLOT(setRelease(float)));
// LFO1
setParamKnob(synthv1::LFO1_ENABLED, m_ui.Lfo1GroupBox->param());
setParamKnob(synthv1::LFO1_SHAPE, m_ui.Lfo1ShapeKnob);
setParamKnob(synthv1::LFO1_WIDTH, m_ui.Lfo1WidthKnob);
setParamKnob(synthv1::LFO1_BPM, m_ui.Lfo1BpmKnob);
setParamKnob(synthv1::LFO1_RATE, m_ui.Lfo1RateKnob);
setParamKnob(synthv1::LFO1_SYNC, m_ui.Lfo1SyncKnob);
setParamKnob(synthv1::LFO1_PANNING, m_ui.Lfo1PanningKnob);
setParamKnob(synthv1::LFO1_VOLUME, m_ui.Lfo1VolumeKnob);
setParamKnob(synthv1::LFO1_CUTOFF, m_ui.Lfo1CutoffKnob);
setParamKnob(synthv1::LFO1_RESO, m_ui.Lfo1ResoKnob);
setParamKnob(synthv1::LFO1_PITCH, m_ui.Lfo1PitchKnob);
setParamKnob(synthv1::LFO1_BALANCE, m_ui.Lfo1BalanceKnob);
setParamKnob(synthv1::LFO1_RINGMOD, m_ui.Lfo1RingModKnob);
setParamKnob(synthv1::LFO1_SWEEP, m_ui.Lfo1SweepKnob);
setParamKnob(synthv1::LFO1_ATTACK, m_ui.Lfo1AttackKnob);
setParamKnob(synthv1::LFO1_DECAY, m_ui.Lfo1DecayKnob);
setParamKnob(synthv1::LFO1_SUSTAIN, m_ui.Lfo1SustainKnob);
setParamKnob(synthv1::LFO1_RELEASE, m_ui.Lfo1ReleaseKnob);
QObject::connect(
m_ui.Lfo1ShapeKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo1Wave, SLOT(setWaveShape(float)));
QObject::connect(
m_ui.Lfo1Wave, SIGNAL(waveShapeChanged(float)),
m_ui.Lfo1ShapeKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo1WidthKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo1Wave, SLOT(setWaveWidth(float)));
QObject::connect(
m_ui.Lfo1Wave, SIGNAL(waveWidthChanged(float)),
m_ui.Lfo1WidthKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo1Env, SIGNAL(attackChanged(float)),
m_ui.Lfo1AttackKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo1AttackKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo1Env, SLOT(setAttack(float)));
QObject::connect(
m_ui.Lfo1Env, SIGNAL(decayChanged(float)),
m_ui.Lfo1DecayKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo1DecayKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo1Env, SLOT(setDecay(float)));
QObject::connect(
m_ui.Lfo1Env, SIGNAL(sustainChanged(float)),
m_ui.Lfo1SustainKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo1SustainKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo1Env, SLOT(setSustain(float)));
QObject::connect(
m_ui.Lfo1Env, SIGNAL(releaseChanged(float)),
m_ui.Lfo1ReleaseKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo1ReleaseKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo1Env, SLOT(setRelease(float)));
// DCA1
setParamKnob(synthv1::DCA1_VOLUME, m_ui.Dca1VolumeKnob);
setParamKnob(synthv1::DCA1_ATTACK, m_ui.Dca1AttackKnob);
setParamKnob(synthv1::DCA1_DECAY, m_ui.Dca1DecayKnob);
setParamKnob(synthv1::DCA1_SUSTAIN, m_ui.Dca1SustainKnob);
setParamKnob(synthv1::DCA1_RELEASE, m_ui.Dca1ReleaseKnob);
QObject::connect(
m_ui.Dca1Env, SIGNAL(attackChanged(float)),
m_ui.Dca1AttackKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dca1AttackKnob, SIGNAL(valueChanged(float)),
m_ui.Dca1Env, SLOT(setAttack(float)));
QObject::connect(
m_ui.Dca1Env, SIGNAL(decayChanged(float)),
m_ui.Dca1DecayKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dca1DecayKnob, SIGNAL(valueChanged(float)),
m_ui.Dca1Env, SLOT(setDecay(float)));
QObject::connect(
m_ui.Dca1Env, SIGNAL(sustainChanged(float)),
m_ui.Dca1SustainKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dca1SustainKnob, SIGNAL(valueChanged(float)),
m_ui.Dca1Env, SLOT(setSustain(float)));
QObject::connect(
m_ui.Dca1Env, SIGNAL(releaseChanged(float)),
m_ui.Dca1ReleaseKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dca1ReleaseKnob, SIGNAL(valueChanged(float)),
m_ui.Dca1Env, SLOT(setRelease(float)));
// DEF1
setParamKnob(synthv1::DEF1_PITCHBEND, m_ui.Def1PitchbendKnob);
setParamKnob(synthv1::DEF1_MODWHEEL, m_ui.Def1ModwheelKnob);
setParamKnob(synthv1::DEF1_PRESSURE, m_ui.Def1PressureKnob);
setParamKnob(synthv1::DEF1_VELOCITY, m_ui.Def1VelocityKnob);
setParamKnob(synthv1::DEF1_CHANNEL, m_ui.Def1ChannelKnob);
setParamKnob(synthv1::DEF1_MONO, m_ui.Def1MonoKnob);
// OUT1
setParamKnob(synthv1::OUT1_WIDTH, m_ui.Out1WidthKnob);
setParamKnob(synthv1::OUT1_PANNING, m_ui.Out1PanningKnob);
setParamKnob(synthv1::OUT1_FXSEND, m_ui.Out1FxSendKnob);
setParamKnob(synthv1::OUT1_VOLUME, m_ui.Out1VolumeKnob);
// DCO2
setParamKnob(synthv1::DCO2_SHAPE1, m_ui.Dco2Shape1Knob);
setParamKnob(synthv1::DCO2_WIDTH1, m_ui.Dco2Width1Knob);
setParamKnob(synthv1::DCO2_BANDL1, m_ui.Dco2Bandl1Knob);
setParamKnob(synthv1::DCO2_SYNC1, m_ui.Dco2Sync1Knob);
setParamKnob(synthv1::DCO2_SHAPE2, m_ui.Dco2Shape2Knob);
setParamKnob(synthv1::DCO2_WIDTH2, m_ui.Dco2Width2Knob);
setParamKnob(synthv1::DCO2_BANDL2, m_ui.Dco2Bandl2Knob);
setParamKnob(synthv1::DCO2_SYNC2, m_ui.Dco2Sync2Knob);
setParamKnob(synthv1::DCO2_BALANCE, m_ui.Dco2BalanceKnob);
setParamKnob(synthv1::DCO2_DETUNE, m_ui.Dco2DetuneKnob);
setParamKnob(synthv1::DCO2_PHASE, m_ui.Dco2PhaseKnob);
setParamKnob(synthv1::DCO2_RINGMOD, m_ui.Dco2RingModKnob);
setParamKnob(synthv1::DCO2_OCTAVE, m_ui.Dco2OctaveKnob);
setParamKnob(synthv1::DCO2_TUNING, m_ui.Dco2TuningKnob);
setParamKnob(synthv1::DCO2_GLIDE, m_ui.Dco2GlideKnob);
setParamKnob(synthv1::DCO2_ENVTIME, m_ui.Dco2EnvTimeKnob);
QObject::connect(
m_ui.Dco2Shape1Knob, SIGNAL(valueChanged(float)),
m_ui.Dco2Wave1, SLOT(setWaveShape(float)));
QObject::connect(
m_ui.Dco2Wave1, SIGNAL(waveShapeChanged(float)),
m_ui.Dco2Shape1Knob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dco2Width1Knob, SIGNAL(valueChanged(float)),
m_ui.Dco2Wave1, SLOT(setWaveWidth(float)));
QObject::connect(
m_ui.Dco2Wave1, SIGNAL(waveWidthChanged(float)),
m_ui.Dco2Width1Knob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dco2Shape2Knob, SIGNAL(valueChanged(float)),
m_ui.Dco2Wave2, SLOT(setWaveShape(float)));
QObject::connect(
m_ui.Dco2Wave2, SIGNAL(waveShapeChanged(float)),
m_ui.Dco2Shape2Knob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dco2Width2Knob, SIGNAL(valueChanged(float)),
m_ui.Dco2Wave2, SLOT(setWaveWidth(float)));
QObject::connect(
m_ui.Dco2Wave2, SIGNAL(waveWidthChanged(float)),
m_ui.Dco2Width2Knob, SLOT(setValue(float)));
// DCF2
setParamKnob(synthv1::DCF2_ENABLED, m_ui.Dcf2GroupBox->param());
setParamKnob(synthv1::DCF2_CUTOFF, m_ui.Dcf2CutoffKnob);
setParamKnob(synthv1::DCF2_RESO, m_ui.Dcf2ResoKnob);
setParamKnob(synthv1::DCF2_TYPE, m_ui.Dcf2TypeKnob);
setParamKnob(synthv1::DCF2_SLOPE, m_ui.Dcf2SlopeKnob);
setParamKnob(synthv1::DCF2_ENVELOPE, m_ui.Dcf2EnvelopeKnob);
setParamKnob(synthv1::DCF2_ATTACK, m_ui.Dcf2AttackKnob);
setParamKnob(synthv1::DCF2_DECAY, m_ui.Dcf2DecayKnob);
setParamKnob(synthv1::DCF2_SUSTAIN, m_ui.Dcf2SustainKnob);
setParamKnob(synthv1::DCF2_RELEASE, m_ui.Dcf2ReleaseKnob);
QObject::connect(
m_ui.Dcf2Filt, SIGNAL(cutoffChanged(float)),
m_ui.Dcf2CutoffKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf2CutoffKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf2Filt, SLOT(setCutoff(float)));
QObject::connect(
m_ui.Dcf2Filt, SIGNAL(resoChanged(float)),
m_ui.Dcf2ResoKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf2ResoKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf2Filt, SLOT(setReso(float)));
QObject::connect(
m_ui.Dcf2TypeKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf2Filt, SLOT(setType(float)));
QObject::connect(
m_ui.Dcf2SlopeKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf2Filt, SLOT(setSlope(float)));
QObject::connect(
m_ui.Dcf2Env, SIGNAL(attackChanged(float)),
m_ui.Dcf2AttackKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf2AttackKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf2Env, SLOT(setAttack(float)));
QObject::connect(
m_ui.Dcf2Env, SIGNAL(decayChanged(float)),
m_ui.Dcf2DecayKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf2DecayKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf2Env, SLOT(setDecay(float)));
QObject::connect(
m_ui.Dcf2Env, SIGNAL(sustainChanged(float)),
m_ui.Dcf2SustainKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf2SustainKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf2Env, SLOT(setSustain(float)));
QObject::connect(
m_ui.Dcf2Env, SIGNAL(releaseChanged(float)),
m_ui.Dcf2ReleaseKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dcf2ReleaseKnob, SIGNAL(valueChanged(float)),
m_ui.Dcf2Env, SLOT(setRelease(float)));
// LFO2
setParamKnob(synthv1::LFO2_ENABLED, m_ui.Lfo2GroupBox->param());
setParamKnob(synthv1::LFO2_SHAPE, m_ui.Lfo2ShapeKnob);
setParamKnob(synthv1::LFO2_WIDTH, m_ui.Lfo2WidthKnob);
setParamKnob(synthv1::LFO2_BPM, m_ui.Lfo2BpmKnob);
setParamKnob(synthv1::LFO2_RATE, m_ui.Lfo2RateKnob);
setParamKnob(synthv1::LFO2_SYNC, m_ui.Lfo2SyncKnob);
setParamKnob(synthv1::LFO2_PANNING, m_ui.Lfo2PanningKnob);
setParamKnob(synthv1::LFO2_VOLUME, m_ui.Lfo2VolumeKnob);
setParamKnob(synthv1::LFO2_CUTOFF, m_ui.Lfo2CutoffKnob);
setParamKnob(synthv1::LFO2_RESO, m_ui.Lfo2ResoKnob);
setParamKnob(synthv1::LFO2_PITCH, m_ui.Lfo2PitchKnob);
setParamKnob(synthv1::LFO2_BALANCE, m_ui.Lfo2BalanceKnob);
setParamKnob(synthv1::LFO2_RINGMOD, m_ui.Lfo2RingModKnob);
setParamKnob(synthv1::LFO2_SWEEP, m_ui.Lfo2SweepKnob);
setParamKnob(synthv1::LFO2_ATTACK, m_ui.Lfo2AttackKnob);
setParamKnob(synthv1::LFO2_DECAY, m_ui.Lfo2DecayKnob);
setParamKnob(synthv1::LFO2_SUSTAIN, m_ui.Lfo2SustainKnob);
setParamKnob(synthv1::LFO2_RELEASE, m_ui.Lfo2ReleaseKnob);
QObject::connect(
m_ui.Lfo2ShapeKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo2Wave, SLOT(setWaveShape(float)));
QObject::connect(
m_ui.Lfo2Wave, SIGNAL(waveShapeChanged(float)),
m_ui.Lfo2ShapeKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo2WidthKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo2Wave, SLOT(setWaveWidth(float)));
QObject::connect(
m_ui.Lfo2Wave, SIGNAL(waveWidthChanged(float)),
m_ui.Lfo2WidthKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo2Env, SIGNAL(attackChanged(float)),
m_ui.Lfo2AttackKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo2AttackKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo2Env, SLOT(setAttack(float)));
QObject::connect(
m_ui.Lfo2Env, SIGNAL(decayChanged(float)),
m_ui.Lfo2DecayKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo2DecayKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo2Env, SLOT(setDecay(float)));
QObject::connect(
m_ui.Lfo2Env, SIGNAL(sustainChanged(float)),
m_ui.Lfo2SustainKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo2SustainKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo2Env, SLOT(setSustain(float)));
QObject::connect(
m_ui.Lfo2Env, SIGNAL(releaseChanged(float)),
m_ui.Lfo2ReleaseKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Lfo2ReleaseKnob, SIGNAL(valueChanged(float)),
m_ui.Lfo2Env, SLOT(setRelease(float)));
// DCA2
setParamKnob(synthv1::DCA2_VOLUME, m_ui.Dca2VolumeKnob);
setParamKnob(synthv1::DCA2_ATTACK, m_ui.Dca2AttackKnob);
setParamKnob(synthv1::DCA2_DECAY, m_ui.Dca2DecayKnob);
setParamKnob(synthv1::DCA2_SUSTAIN, m_ui.Dca2SustainKnob);
setParamKnob(synthv1::DCA2_RELEASE, m_ui.Dca2ReleaseKnob);
QObject::connect(
m_ui.Dca2Env, SIGNAL(attackChanged(float)),
m_ui.Dca2AttackKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dca2AttackKnob, SIGNAL(valueChanged(float)),
m_ui.Dca2Env, SLOT(setAttack(float)));
QObject::connect(
m_ui.Dca2Env, SIGNAL(decayChanged(float)),
m_ui.Dca2DecayKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dca2DecayKnob, SIGNAL(valueChanged(float)),
m_ui.Dca2Env, SLOT(setDecay(float)));
QObject::connect(
m_ui.Dca2Env, SIGNAL(sustainChanged(float)),
m_ui.Dca2SustainKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dca2SustainKnob, SIGNAL(valueChanged(float)),
m_ui.Dca2Env, SLOT(setSustain(float)));
QObject::connect(
m_ui.Dca2Env, SIGNAL(releaseChanged(float)),
m_ui.Dca2ReleaseKnob, SLOT(setValue(float)));
QObject::connect(
m_ui.Dca2ReleaseKnob, SIGNAL(valueChanged(float)),
m_ui.Dca2Env, SLOT(setRelease(float)));
// DEF2
setParamKnob(synthv1::DEF2_PITCHBEND, m_ui.Def2PitchbendKnob);
setParamKnob(synthv1::DEF2_MODWHEEL, m_ui.Def2ModwheelKnob);
setParamKnob(synthv1::DEF2_PRESSURE, m_ui.Def2PressureKnob);
setParamKnob(synthv1::DEF2_VELOCITY, m_ui.Def2VelocityKnob);
setParamKnob(synthv1::DEF2_CHANNEL, m_ui.Def2ChannelKnob);
setParamKnob(synthv1::DEF2_MONO, m_ui.Def2MonoKnob);
// OUT2
setParamKnob(synthv1::OUT2_WIDTH, m_ui.Out2WidthKnob);
setParamKnob(synthv1::OUT2_PANNING, m_ui.Out2PanningKnob);
setParamKnob(synthv1::OUT2_FXSEND, m_ui.Out2FxSendKnob);
setParamKnob(synthv1::OUT2_VOLUME, m_ui.Out2VolumeKnob);
// Effects
setParamKnob(synthv1::CHO1_WET, m_ui.Cho1WetKnob);
setParamKnob(synthv1::CHO1_DELAY, m_ui.Cho1DelayKnob);
setParamKnob(synthv1::CHO1_FEEDB, m_ui.Cho1FeedbKnob);
setParamKnob(synthv1::CHO1_RATE, m_ui.Cho1RateKnob);
setParamKnob(synthv1::CHO1_MOD, m_ui.Cho1ModKnob);
setParamKnob(synthv1::FLA1_WET, m_ui.Fla1WetKnob);
setParamKnob(synthv1::FLA1_DELAY, m_ui.Fla1DelayKnob);
setParamKnob(synthv1::FLA1_FEEDB, m_ui.Fla1FeedbKnob);
setParamKnob(synthv1::FLA1_DAFT, m_ui.Fla1DaftKnob);
setParamKnob(synthv1::PHA1_WET, m_ui.Pha1WetKnob);
setParamKnob(synthv1::PHA1_RATE, m_ui.Pha1RateKnob);
setParamKnob(synthv1::PHA1_FEEDB, m_ui.Pha1FeedbKnob);
setParamKnob(synthv1::PHA1_DEPTH, m_ui.Pha1DepthKnob);
setParamKnob(synthv1::PHA1_DAFT, m_ui.Pha1DaftKnob);
setParamKnob(synthv1::DEL1_WET, m_ui.Del1WetKnob);
setParamKnob(synthv1::DEL1_DELAY, m_ui.Del1DelayKnob);
setParamKnob(synthv1::DEL1_FEEDB, m_ui.Del1FeedbKnob);
setParamKnob(synthv1::DEL1_BPM, m_ui.Del1BpmKnob);
// Reverb
setParamKnob(synthv1::REV1_WET, m_ui.Rev1WetKnob);
setParamKnob(synthv1::REV1_ROOM, m_ui.Rev1RoomKnob);
setParamKnob(synthv1::REV1_DAMP, m_ui.Rev1DampKnob);
setParamKnob(synthv1::REV1_FEEDB, m_ui.Rev1FeedbKnob);
setParamKnob(synthv1::REV1_WIDTH, m_ui.Rev1WidthKnob);
// Dynamics
setParamKnob(synthv1::DYN1_COMPRESS, m_ui.Dyn1CompressKnob);
setParamKnob(synthv1::DYN1_LIMITER, m_ui.Dyn1LimiterKnob);
// Make status-bar keyboard range active.
m_ui.StatusBar->keybd()->setAllNotesEnabled(true);
m_ui.StatusBar->keybd()->setNoteRange(true);
// Preset management
QObject::connect(m_ui.Preset,
SIGNAL(newPresetFile()),
SLOT(newPreset()));
QObject::connect(m_ui.Preset,
SIGNAL(loadPresetFile(const QString&)),
SLOT(loadPreset(const QString&)));
QObject::connect(m_ui.Preset,
SIGNAL(savePresetFile(const QString&)),
SLOT(savePreset(const QString&)));
QObject::connect(m_ui.Preset,
SIGNAL(resetPresetFile()),
SLOT(resetParams()));
// Randomize params...
QObject::connect(m_ui.RandomParamsButton,
SIGNAL(clicked()),
SLOT(randomParams()));
// Swap params A/B
QObject::connect(m_ui.SwapParamsAButton,
SIGNAL(toggled(bool)),
SLOT(swapParams(bool)));
QObject::connect(m_ui.SwapParamsBButton,
SIGNAL(toggled(bool)),
SLOT(swapParams(bool)));
// Randomize params...
QObject::connect(m_ui.PanicButton,
SIGNAL(clicked()),
SLOT(panic()));
// Direct stacked-page signal/slot
QObject::connect(m_ui.TabBar, SIGNAL(currentChanged(int)),
m_ui.StackedWidget, SLOT(setCurrentIndex(int)));
// Direct status-bar keyboard input
QObject::connect(m_ui.StatusBar->keybd(),
SIGNAL(noteOnClicked(int, int)),
SLOT(directNoteOn(int, int)));
QObject::connect(m_ui.StatusBar->keybd(),
SIGNAL(noteRangeChanged()),
SLOT(noteRangeChanged()));
// Menu actions
QObject::connect(m_ui.helpConfigureAction,
SIGNAL(triggered(bool)),
SLOT(helpConfigure()));
QObject::connect(m_ui.helpAboutAction,
SIGNAL(triggered(bool)),
SLOT(helpAbout()));
QObject::connect(m_ui.helpAboutQtAction,
SIGNAL(triggered(bool)),
SLOT(helpAboutQt()));
// General knob/dial behavior init...
updateConfig();
// Epilog.
// QWidget::adjustSize();
m_ui.StatusBar->showMessage(tr("Ready"), 5000);
m_ui.StatusBar->modified(false);
m_ui.Preset->setDirtyPreset(false);
}
// Destructor.
synthv1widget::~synthv1widget (void)
{
if (m_sched_notifier)
delete m_sched_notifier;
delete p_ui;
}
// Open/close the scheduler/work notifier.
void synthv1widget::openSchedNotifier (void)
{
if (m_sched_notifier)
return;
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi == nullptr)
return;
m_sched_notifier = new synthv1widget_sched(pSynthUi->instance(), this);
QObject::connect(m_sched_notifier,
SIGNAL(notify(int, int)),
SLOT(updateSchedNotify(int, int)));
pSynthUi->midiInEnabled(true);
}
void synthv1widget::closeSchedNotifier (void)
{
if (m_sched_notifier) {
delete m_sched_notifier;
m_sched_notifier = nullptr;
}
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi)
pSynthUi->midiInEnabled(false);
}
// Show/hide widget handlers.
void synthv1widget::showEvent ( QShowEvent *pShowEvent )
{
QWidget::showEvent(pShowEvent);
openSchedNotifier();
}
void synthv1widget::hideEvent ( QHideEvent *pHideEvent )
{
closeSchedNotifier();
QWidget::hideEvent(pHideEvent);
}
// Param kbob (widget) map accesors.
void synthv1widget::setParamKnob ( synthv1::ParamIndex index, synthv1widget_param *pParam )
{
pParam->setDefaultValue(synthv1_param::paramDefaultValue(index));
m_paramKnobs.insert(index, pParam);
m_knobParams.insert(pParam, index);
QObject::connect(pParam,
SIGNAL(valueChanged(float)),
SLOT(paramChanged(float)));
pParam->setContextMenuPolicy(Qt::CustomContextMenu);
QObject::connect(pParam,
SIGNAL(customContextMenuRequested(const QPoint&)),
SLOT(paramContextMenu(const QPoint&)));
}
synthv1widget_param *synthv1widget::paramKnob ( synthv1::ParamIndex index ) const
{
return m_paramKnobs.value(index, nullptr);
}
// Param port accessors.
void synthv1widget::setParamValue ( synthv1::ParamIndex index, float fValue )
{
++m_iUpdate;
synthv1widget_param *pParam = paramKnob(index);
if (pParam)
pParam->setValue(fValue);
updateParamEx(index, fValue);
--m_iUpdate;
}
float synthv1widget::paramValue ( synthv1::ParamIndex index ) const
{
float fValue = 0.0f;
synthv1widget_param *pParam = paramKnob(index);
if (pParam) {
fValue = pParam->value();
} else {
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi)
fValue = pSynthUi->paramValue(index);
}
return fValue;
}
// Param knob (widget) slot.
void synthv1widget::paramChanged ( float fValue )
{
if (m_iUpdate > 0)
return;
synthv1widget_param *pParam = qobject_cast (sender());
if (pParam) {
const synthv1::ParamIndex index = m_knobParams.value(pParam);
updateParam(index, fValue);
updateParamEx(index, fValue);
m_ui.StatusBar->showMessage(QString("%1: %2")
.arg(pParam->toolTip())
.arg(pParam->valueText()), 5000);
updateDirtyPreset(true);
}
}
// Update local tied widgets.
void synthv1widget::updateParamEx ( synthv1::ParamIndex index, float fValue )
{
++m_iUpdate;
switch (index) {
case synthv1::DCO1_SHAPE1:
m_ui.Dco1Wave1->setWaveShape(fValue);
m_ui.Dco1Bandl1Knob->setEnabled(
synthv1_wave::Shape(int(fValue)) != synthv1_wave::Noise);
break;
case synthv1::DCO1_SHAPE2:
m_ui.Dco1Wave2->setWaveShape(fValue);
m_ui.Dco1Bandl2Knob->setEnabled(
synthv1_wave::Shape(int(fValue)) != synthv1_wave::Noise);
break;
case synthv1::DCO1_SYNC1:
if (fValue > 0.5f) {
m_ui.Dco1Sync2Knob->setValue(0.0f);
updateParam(synthv1::DCO1_SYNC2, 0.0f);
}
break;
case synthv1::DCO1_SYNC2:
if (fValue > 0.5f) {
m_ui.Dco1Sync1Knob->setValue(0.0f);
updateParam(synthv1::DCO1_SYNC1, 0.0f);
}
break;
case synthv1::DCO2_SHAPE1:
m_ui.Dco2Wave1->setWaveShape(fValue);
m_ui.Dco2Bandl1Knob->setEnabled(
synthv1_wave::Shape(int(fValue)) != synthv1_wave::Noise);
break;
case synthv1::DCO2_SHAPE2:
m_ui.Dco2Wave2->setWaveShape(fValue);
m_ui.Dco2Bandl2Knob->setEnabled(
synthv1_wave::Shape(int(fValue)) != synthv1_wave::Noise);
break;
case synthv1::DCO2_SYNC1:
if (fValue > 0.5f) {
m_ui.Dco2Sync2Knob->setValue(0.0f);
updateParam(synthv1::DCO2_SYNC1, 0.0f);
}
break;
case synthv1::DCO2_SYNC2:
if (fValue > 0.5f) {
m_ui.Dco2Sync1Knob->setValue(0.0f);
updateParam(synthv1::DCO1_SYNC1, 0.0f);
}
break;
case synthv1::DCF1_ENABLED:
if (m_ui.Lfo1GroupBox->isChecked()) {
const bool bDcf1Enabled = (fValue > 0.5f);
m_ui.Lfo1CutoffKnob->setEnabled(bDcf1Enabled);
m_ui.Lfo1ResoKnob->setEnabled(bDcf1Enabled);
}
break;
case synthv1::LFO1_ENABLED:
if (fValue > 0.5f) {
const bool bDcf1Enabled = m_ui.Dcf1GroupBox->isChecked();
m_ui.Lfo1CutoffKnob->setEnabled(bDcf1Enabled);
m_ui.Lfo1ResoKnob->setEnabled(bDcf1Enabled);
}
break;
case synthv1::DCF2_ENABLED:
if (m_ui.Lfo2GroupBox->isChecked()) {
const bool bDcf2Enabled = (fValue > 0.5f);
m_ui.Lfo2CutoffKnob->setEnabled(bDcf2Enabled);
m_ui.Lfo2ResoKnob->setEnabled(bDcf2Enabled);
}
break;
case synthv1::LFO2_ENABLED:
if (fValue > 0.5f) {
const bool bDcf2Enabled = m_ui.Dcf2GroupBox->isChecked();
m_ui.Lfo2CutoffKnob->setEnabled(bDcf2Enabled);
m_ui.Lfo2ResoKnob->setEnabled(bDcf2Enabled);
}
break;
case synthv1::DCF1_SLOPE:
if (m_ui.Dcf1GroupBox->isChecked())
m_ui.Dcf1TypeKnob->setEnabled(int(fValue) != 3); // !Formant
break;
case synthv1::DCF2_SLOPE:
if (m_ui.Dcf2GroupBox->isChecked())
m_ui.Dcf2TypeKnob->setEnabled(int(fValue) != 3); // !Formant
break;
case synthv1::LFO1_SHAPE:
m_ui.Lfo1Wave->setWaveShape(fValue);
break;
case synthv1::LFO2_SHAPE:
m_ui.Lfo2Wave->setWaveShape(fValue);
break;
case synthv1::KEY1_LOW:
m_ui.StatusBar->keybd()->setNoteLow(int(fValue));
break;
case synthv1::KEY1_HIGH:
m_ui.StatusBar->keybd()->setNoteHigh(int(fValue));
break;
case synthv1::DEF1_VELOCITY: {
const int vel = int(79.375f * fValue + 47.625f) & 0x7f;
m_ui.StatusBar->keybd()->setVelocity(vel);
break;
}
default:
break;
}
--m_iUpdate;
}
// Update scheduled controllers param/knob widgets.
void synthv1widget::updateSchedParam ( synthv1::ParamIndex index, float fValue )
{
++m_iUpdate;
synthv1widget_param *pParam = paramKnob(index);
if (pParam) {
pParam->setValue(fValue);
updateParam(index, fValue);
updateParamEx(index, fValue);
m_ui.StatusBar->showMessage(QString("%1: %2")
.arg(pParam->toolTip())
.arg(pParam->valueText()), 5000);
updateDirtyPreset(true);
}
--m_iUpdate;
}
// Reset all param knobs to default values.
void synthv1widget::resetParams (void)
{
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi == nullptr)
return;
pSynthUi->reset();
resetSwapParams();
for (uint32_t i = 0; i < synthv1::NUM_PARAMS; ++i) {
const synthv1::ParamIndex index = synthv1::ParamIndex(i);
float fValue = synthv1_param::paramDefaultValue(index);
synthv1widget_param *pParam = paramKnob(index);
if (pParam && pParam->isDefaultValue())
fValue = pParam->defaultValue();
setParamValue(index, fValue);
updateParam(index, fValue);
m_params_ab[i] = fValue;
}
m_ui.StatusBar->showMessage(tr("Reset preset"), 5000);
updateDirtyPreset(false);
}
// Randomize params (partial).
void synthv1widget::randomParams (void)
{
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi == nullptr)
return;
float p = 1.0f;
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig)
p = 0.01f * pConfig->fRandomizePercent;
if (QMessageBox::warning(this,
tr("Warning"),
tr("About to randomize current parameter values:\n\n"
"-/+ %1%.\n\n"
"Are you sure?").arg(100.0f * p),
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel)
return;
std::default_random_engine re(::time(nullptr));
for (uint32_t i = 0; i < synthv1::NUM_PARAMS; ++i) {
const synthv1::ParamIndex index = synthv1::ParamIndex(i);
// Filter out some non-randomizable parameters!...
if (index == synthv1::DCO1_OCTAVE ||
index == synthv1::DCO1_TUNING ||
index == synthv1::DCO1_ENVTIME ||
index == synthv1::DCF1_ENABLED ||
index == synthv1::LFO1_ENABLED)
continue;
if (index >= synthv1::OUT1_WIDTH && index < synthv1::DCO2_SHAPE1)
continue;
if (index == synthv1::DCO2_OCTAVE ||
index == synthv1::DCO2_TUNING ||
index == synthv1::DCO2_ENVTIME ||
index == synthv1::DCF2_ENABLED ||
index == synthv1::LFO2_ENABLED)
continue;
if (index >= synthv1::OUT2_WIDTH)
break;
synthv1widget_param *pParam = paramKnob(index);
if (pParam) {
std::normal_distribution nd;
const float q = p * (pParam->maximum() - pParam->minimum());
float fValue = pParam->value();
if (synthv1_param::paramFloat(index))
fValue += 0.5f * q * nd(re);
else
fValue = std::round(fValue + q * nd(re));
if (fValue < pParam->minimum())
fValue = pParam->minimum();
else
if (fValue > pParam->maximum())
fValue = pParam->maximum();
setParamValue(index, fValue);
updateParam(index, fValue);
}
}
m_ui.StatusBar->showMessage(tr("Randomize"), 5000);
updateDirtyPreset(true);
}
// Swap params A/B.
void synthv1widget::swapParams ( bool bOn )
{
if (m_iUpdate > 0 || !bOn)
return;
#ifdef CONFIG_DEBUG
qDebug("synthv1widget::swapParams(%d)", int(bOn));
#endif
for (uint32_t i = 0; i < synthv1::NUM_PARAMS; ++i) {
const synthv1::ParamIndex index = synthv1::ParamIndex(i);
synthv1widget_param *pParam = paramKnob(index);
if (pParam) {
const float fOldValue = pParam->value();
const float fNewValue = m_params_ab[i];
setParamValue(index, fNewValue);
updateParam(index, fNewValue);
m_params_ab[i] = fOldValue;
}
}
const bool bSwapA = m_ui.SwapParamsAButton->isChecked();
m_ui.StatusBar->showMessage(tr("Swap %1").arg(bSwapA ? 'A' : 'B'), 5000);
updateDirtyPreset(true);
}
// Panic: all-notes/sound-off (reset).
void synthv1widget::panic (void)
{
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi)
pSynthUi->reset();
}
// Reset swap params A/B group.
void synthv1widget::resetSwapParams (void)
{
++m_iUpdate;
m_ui.SwapParamsAButton->setChecked(true);
--m_iUpdate;
}
// Initialize param values.
void synthv1widget::updateParamValues (void)
{
resetSwapParams();
synthv1_ui *pSynthUi = ui_instance();
for (uint32_t i = 0; i < synthv1::NUM_PARAMS; ++i) {
const synthv1::ParamIndex index = synthv1::ParamIndex(i);
const float fValue = (pSynthUi
? pSynthUi->paramValue(index)
: synthv1_param::paramDefaultValue(index));
setParamValue(index, fValue);
updateParam(index, fValue);
// updateParamEx(index, fValue);
m_params_ab[i] = fValue;
}
}
// Reset all param default values.
void synthv1widget::resetParamValues (void)
{
resetSwapParams();
for (uint32_t i = 0; i < synthv1::NUM_PARAMS; ++i) {
const synthv1::ParamIndex index = synthv1::ParamIndex(i);
const float fValue = synthv1_param::paramDefaultValue(index);
setParamValue(index, fValue);
updateParam(index, fValue);
// updateParamEx(index, fValue);
m_params_ab[i] = fValue;
}
}
// Reset all knob default values.
void synthv1widget::resetParamKnobs (void)
{
for (uint32_t i = 0; i < synthv1::NUM_PARAMS; ++i) {
synthv1widget_param *pParam = paramKnob(synthv1::ParamIndex(i));
if (pParam)
pParam->resetDefaultValue();
}
}
// Preset init.
void synthv1widget::initPreset (void)
{
m_ui.Preset->initPreset();
}
// Preset clear.
void synthv1widget::clearPreset (void)
{
m_ui.Preset->clearPreset();
}
// Preset renewal.
void synthv1widget::newPreset (void)
{
#ifdef CONFIG_DEBUG
qDebug("synthv1widget::newPreset()");
#endif
resetParamKnobs();
resetParamValues();
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi)
pSynthUi->newPreset();
m_ui.StatusBar->showMessage(tr("New preset"), 5000);
updateDirtyPreset(false);
}
// Preset file I/O slots.
bool synthv1widget::loadPreset ( const QString& sFilename )
{
#ifdef CONFIG_DEBUG
qDebug("synthv1widget::loadPreset(\"%s\")", sFilename.toUtf8().constData());
#endif
resetParamKnobs();
resetParamValues();
bool bLoad = false;
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi)
bLoad = pSynthUi->loadPreset(sFilename);
if (bLoad)
updateLoadPreset(QFileInfo(sFilename).completeBaseName());
else
updateDirtyPreset(true);
return bLoad;
}
bool synthv1widget::savePreset ( const QString& sFilename )
{
#ifdef CONFIG_DEBUG
qDebug("synthv1widget::savePreset(\"%s\")", sFilename.toUtf8().constData());
#endif
bool bSave = false;
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi)
bSave = pSynthUi->savePreset(sFilename);
if (bSave) {
const QString& sPreset
= QFileInfo(sFilename).completeBaseName();
m_ui.StatusBar->showMessage(tr("Save preset: %1").arg(sPreset), 5000);
}
updateDirtyPreset(!bSave);
return bSave;
}
// Dirty close prompt,
bool synthv1widget::queryClose (void)
{
return m_ui.Preset->queryPreset();
}
// Update visual configuration.
void synthv1widget::updateConfig (void)
{
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig) {
synthv1widget_dial::setDialMode(
synthv1widget_dial::DialMode(pConfig->iKnobDialMode));
synthv1widget_edit::setEditMode(
synthv1widget_edit::EditMode(pConfig->iKnobEditMode));
}
}
// Preset status updater.
void synthv1widget::updateLoadPreset ( const QString& sPreset )
{
resetParamKnobs();
updateParamValues();
m_ui.Preset->setPreset(sPreset);
m_ui.StatusBar->showMessage(tr("Load preset: %1").arg(sPreset), 5000);
updateDirtyPreset(false);
}
// Notification updater.
void synthv1widget::updateSchedNotify ( int stype, int sid )
{
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi == nullptr)
return;
#ifdef CONFIG_DEBUG_0
qDebug("synthv1widget::updateSchedNotify(%d, 0x%04x)", stype, sid);
#endif
switch (synthv1_sched::Type(stype)) {
case synthv1_sched::MidiIn:
if (sid >= 0) {
const int key = (sid & 0x7f);
const int vel = (sid >> 7) & 0x7f;
m_ui.StatusBar->midiInNote(key, vel);
}
else
if (pSynthUi->midiInCount() > 0) {
m_ui.StatusBar->midiInLed(true);
QTimer::singleShot(200, this, SLOT(midiInLedTimeout()));
}
break;
case synthv1_sched::Controller: {
synthv1widget_control *pInstance
= synthv1widget_control::getInstance();
if (pInstance) {
synthv1_controls *pControls = pSynthUi->controls();
pInstance->setControlKey(pControls->current_key());
}
break;
}
case synthv1_sched::Controls: {
const synthv1::ParamIndex index = synthv1::ParamIndex(sid);
updateSchedParam(index, pSynthUi->paramValue(index));
break;
}
case synthv1_sched::Programs: {
synthv1_programs *pPrograms = pSynthUi->programs();
synthv1_programs::Prog *pProg = pPrograms->current_prog();
if (pProg) updateLoadPreset(pProg->name());
break;
}
case synthv1_sched::Wave:
if (sid > 0) {
updateParamValues();
resetParamKnobs();
updateDirtyPreset(false);
}
// fall thru...
default:
break;
}
}
// Direct note-on/off slot.
void synthv1widget::directNoteOn ( int iNote, int iVelocity )
{
#ifdef CONFIG_DEBUG
qDebug("synthv1widget::directNoteOn(%d, %d)", iNote, iVelocity);
#endif
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi)
pSynthUi->directNoteOn(iNote, iVelocity); // note-on!
}
// Keyboard note range change.
void synthv1widget::noteRangeChanged (void)
{
const int iNoteLow = m_ui.StatusBar->keybd()->noteLow();
const int iNoteHigh = m_ui.StatusBar->keybd()->noteHigh();
#ifdef CONFIG_DEBUG
qDebug("padthv1widget::noteRangeChanged(%d, %d)", iNoteLow, iNoteHigh);
#endif
updateParam(synthv1::KEY1_LOW, float(iNoteLow));
updateParam(synthv1::KEY1_HIGH, float(iNoteHigh));
m_ui.StatusBar->showMessage(QString("KEY Low: %1 (%2) High: %3 (%4)")
.arg(synthv1_ui::noteName(iNoteLow)).arg(iNoteLow)
.arg(synthv1_ui::noteName(iNoteHigh)).arg(iNoteHigh), 5000);
updateDirtyPreset(true);
}
// MIDI In LED timeout.
void synthv1widget::midiInLedTimeout (void)
{
m_ui.StatusBar->midiInLed(false);
}
// Menu actions.
void synthv1widget::helpConfigure (void)
{
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi)
synthv1widget_config(this, pSynthUi).exec();
}
void synthv1widget::helpAbout (void)
{
// About...
QStringList list;
#ifdef CONFIG_DEBUG
list << tr("Debugging option enabled.");
#endif
#ifndef CONFIG_JACK
list << tr("JACK stand-alone build disabled.");
#endif
#ifndef CONFIG_JACK_SESSION
list << tr("JACK session support disabled.");
#endif
#ifndef CONFIG_JACK_MIDI
list << tr("JACK MIDI support disabled.");
#endif
#ifndef CONFIG_ALSA_MIDI
list << tr("ALSA MIDI support disabled.");
#endif
#ifndef CONFIG_LV2
list << tr("LV2 plug-in build disabled.");
#endif
QString sText = "" PROJECT_NAME "
\n";
sText += "" + tr(PROJECT_DESCRIPTION) + "
\n";
sText += "
\n";
sText += tr("Version") + ": " PROJECT_VERSION "
\n";
// sText += "" + tr("Build") + ": " CONFIG_BUILD_DATE "
\n";
if (!list.isEmpty()) {
sText += "";
sText += list.join("
\n");
sText += "\n";
}
sText += "
\n";
sText += tr("Using: Qt %1").arg(qVersion());
#if defined(QT_STATIC)
sText += "-static";
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
sText += ' ';
sText += '(';
sText += QApplication::platformName();
sText += ')';
#endif
sText += "
\n";
sText += "
\n";
sText += tr("Website") + ": " PROJECT_HOMEPAGE_URL "
\n";
sText += "
\n";
sText += "";
sText += PROJECT_COPYRIGHT "
\n";
sText += "
\n";
sText += tr("This program is free software; you can redistribute it and/or modify it") + "
\n";
sText += tr("under the terms of the GNU General Public License version 2 or later.");
sText += "";
sText += "
\n";
sText += "
\n";
QMessageBox::about(this, tr("About"), sText);
}
void synthv1widget::helpAboutQt (void)
{
// About Qt...
QMessageBox::aboutQt(this);
}
// Dirty flag (overridable virtual) methods.
void synthv1widget::updateDirtyPreset ( bool bDirtyPreset )
{
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi)
pSynthUi->updatePreset(bDirtyPreset);
m_ui.StatusBar->modified(bDirtyPreset);
m_ui.Preset->setDirtyPreset(bDirtyPreset);
}
// Param knob context menu.
void synthv1widget::paramContextMenu ( const QPoint& pos )
{
synthv1widget_param *pParam
= qobject_cast (sender());
if (pParam == nullptr)
return;
synthv1_ui *pSynthUi = ui_instance();
if (pSynthUi == nullptr)
return;
synthv1_controls *pControls = pSynthUi->controls();
if (pControls == nullptr)
return;
if (!pControls->enabled())
return;
QMenu menu(this);
QAction *pAction = menu.addAction(
QIcon(":/images/synthv1_control.png"),
tr("MIDI &Controller..."));
if (menu.exec(pParam->mapToGlobal(pos)) == pAction) {
const synthv1::ParamIndex index = m_knobParams.value(pParam);
const QString& sTitle = pParam->toolTip();
synthv1widget_control::showInstance(pControls, index, sTitle, this);
}
}
// end of synthv1widget.cpp
synthv1-1.4.2/src/PaxHeaders/synthv1widget_preset.cpp 0000644 0000000 0000000 00000000132 15174622017 017712 x ustar 00 30 mtime=1777542159.047209678
30 atime=1777542159.047209678
30 ctime=1777542159.047209678
synthv1-1.4.2/src/synthv1widget_preset.cpp 0000644 0001750 0000144 00000030077 15174622017 017711 0 ustar 00rncbc users // synthv1widget_preset.cpp
//
/****************************************************************************
Copyright (C) 2012-2024, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#include "synthv1widget_preset.h"
#include "synthv1_config.h"
#include
#include
#include
#include
#include
#include
//-------------------------------------------------------------------------
// synthv1widget_preset - Custom edit-box widget.
//
// Constructor.
synthv1widget_preset::synthv1widget_preset ( QWidget *pParent )
: QWidget (pParent)
{
m_pNewButton = new QToolButton();
m_pOpenButton = new QToolButton();
m_pComboBox = new QComboBox();
m_pSaveButton = new QToolButton();
m_pDeleteButton = new QToolButton();
m_pResetButton = new QToolButton();
m_pNewButton->setIcon(QIcon(":/images/presetNew.png"));
m_pOpenButton->setIcon(QIcon(":/images/presetOpen.png"));
m_pComboBox->setEditable(true);
m_pComboBox->setMinimumWidth(240);
#if QT_VERSION >= QT_VERSION_CHECK(4, 2, 0)
m_pComboBox->setCompleter(nullptr);
#endif
m_pComboBox->setInsertPolicy(QComboBox::NoInsert);
m_pSaveButton->setIcon(QIcon(":/images/presetSave.png"));
m_pDeleteButton->setIcon(QIcon(":/images/presetDelete.png"));
m_pResetButton->setText("Reset");
m_pNewButton->setToolTip(tr("New Preset"));
m_pOpenButton->setToolTip(tr("Open Preset"));
m_pSaveButton->setToolTip(tr("Save Preset"));
m_pDeleteButton->setToolTip(tr("Delete Preset"));
m_pResetButton->setToolTip(tr("Reset Preset"));
QHBoxLayout *pHBoxLayout = new QHBoxLayout();
pHBoxLayout->setContentsMargins(2, 2, 2, 2);
pHBoxLayout->setSpacing(4);
pHBoxLayout->addWidget(m_pNewButton);
pHBoxLayout->addWidget(m_pOpenButton);
pHBoxLayout->addWidget(m_pComboBox);
pHBoxLayout->addWidget(m_pSaveButton);
pHBoxLayout->addWidget(m_pDeleteButton);
pHBoxLayout->addSpacing(4);
pHBoxLayout->addWidget(m_pResetButton);
QWidget::setLayout(pHBoxLayout);
m_iInitPreset = 0;
m_iDirtyPreset = 0;
// UI signal/slot connections...
QObject::connect(m_pNewButton,
SIGNAL(clicked()),
SLOT(newPreset()));
QObject::connect(m_pOpenButton,
SIGNAL(clicked()),
SLOT(openPreset()));
QObject::connect(m_pComboBox,
SIGNAL(editTextChanged(const QString&)),
SLOT(stabilizePreset()));
QObject::connect(m_pComboBox,
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
SIGNAL(textActivated(const QString&)),
#else
SIGNAL(activated(const QString&)),
#endif
SLOT(activatePreset(const QString&)));
QObject::connect(m_pSaveButton,
SIGNAL(clicked()),
SLOT(savePreset()));
QObject::connect(m_pDeleteButton,
SIGNAL(clicked()),
SLOT(deletePreset()));
QObject::connect(m_pResetButton,
SIGNAL(clicked()),
SLOT(resetPreset()));
refreshPreset();
stabilizePreset();
}
// Preset name/text accessors.
void synthv1widget_preset::clearPreset (void)
{
++m_iInitPreset;
const bool bBlockSignals = m_pComboBox->blockSignals(true);
m_pComboBox->clearEditText();
m_pComboBox->blockSignals(bBlockSignals);
}
void synthv1widget_preset::setPreset ( const QString& sPreset )
{
const bool bBlockSignals = m_pComboBox->blockSignals(true);
m_pComboBox->setEditText(sPreset);
m_pComboBox->blockSignals(bBlockSignals);
}
QString synthv1widget_preset::preset (void) const
{
return m_pComboBox->currentText();
}
// Check whether current preset may be reset.
bool synthv1widget_preset::queryPreset (void)
{
if (m_iInitPreset == 0)
return true;
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig == nullptr)
return false;
if (m_iDirtyPreset > 0) {
const QString& sPreset(pConfig->sPreset);
if (sPreset.isEmpty()) {
if (QMessageBox::warning(this,
tr("Warning"),
tr("Some parameters have been changed.\n\n"
"Do you want to discard the changes?"),
QMessageBox::Discard |
QMessageBox::Cancel) == QMessageBox::Cancel)
return false;
} else {
switch (QMessageBox::warning(this,
tr("Warning"),
tr("Some preset parameters have been changed:\n\n"
"\"%1\".\n\nDo you want to save the changes?")
.arg(sPreset),
QMessageBox::Save |
QMessageBox::Discard |
QMessageBox::Cancel)) {
case QMessageBox::Save:
savePreset(sPreset);
// Fall thru...
case QMessageBox::Discard:
break;
default: // Cancel...
setPreset(sPreset);
return false;
}
}
}
return true;
}
// Preset management slots...
void synthv1widget_preset::activatePreset ( const QString& sPreset )
{
if (!sPreset.isEmpty() && queryPreset())
loadPreset(sPreset);
}
void synthv1widget_preset::loadPreset ( const QString& sPreset )
{
if (sPreset.isEmpty())
return;
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig) {
emit loadPresetFile(pConfig->presetFile(sPreset));
++m_iInitPreset;
pConfig->sPreset = sPreset;
setPreset(sPreset);
refreshPreset();
}
stabilizePreset();
}
void synthv1widget_preset::newPreset (void)
{
if (!queryPreset())
return;
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig) {
emit newPresetFile();
pConfig->sPreset.clear();
clearPreset();
refreshPreset();
}
stabilizePreset();
}
void synthv1widget_preset::openPreset (void)
{
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig == nullptr)
return;
QStringList files;
const QString sExt(PROJECT_NAME);
const QString& sTitle = tr("Open Preset");
const QString& sFilter = tr("Preset files (*.%1)").arg(sExt);
QWidget *pParentWidget = nullptr;
QFileDialog::Options options;
if (pConfig->bDontUseNativeDialogs) {
options |= QFileDialog::DontUseNativeDialog;
pParentWidget = QWidget::window();
}
#if 1//QT_VERSION < QT_VERSION_CHECK(4, 4, 0)
files = QFileDialog::getOpenFileNames(pParentWidget,
sTitle, pConfig->sPresetDir, sFilter, nullptr, options);
#else
QFileDialog fileDialog(pParentWidget,
sTitle, pConfig->sPresetDir, sFilter);
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
fileDialog.setFileMode(QFileDialog::ExistingFiles);
fileDialog.setDefaultSuffix(sExt);
QList urls(fileDialog.sidebarUrls());
urls.append(QUrl::fromLocalFile(pConfig->sPresetDir));
fileDialog.setSidebarUrls(urls);
fileDialog.setOptions(options);
if (fileDialog.exec())
files = fileDialog.selectedFiles();
#endif
if (!files.isEmpty() && queryPreset()) {
int iPreset = 0;
QStringListIterator iter(files);
while (iter.hasNext()) {
const QString& sFilename = iter.next();
const QFileInfo fi(sFilename);
if (fi.exists()) {
const QString& sPreset = fi.completeBaseName();
pConfig->setPresetFile(sPreset, sFilename);
if (++iPreset == 1) {
++m_iInitPreset;
emit loadPresetFile(sFilename);
pConfig->sPreset = sPreset;
pConfig->sPresetDir = fi.absolutePath();
setPreset(sPreset);
}
}
refreshPreset();
}
}
stabilizePreset();
}
void synthv1widget_preset::savePreset (void)
{
savePreset(m_pComboBox->currentText());
}
void synthv1widget_preset::savePreset ( const QString& sPreset )
{
if (sPreset.isEmpty())
return;
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig == nullptr)
return;
const QString sExt(PROJECT_NAME);
QFileInfo fi(QDir(pConfig->sPresetDir), sPreset + '.' + sExt);
QString sFilename = fi.absoluteFilePath();
if (!fi.exists()) {
const QString& sTitle = tr("Save Preset");
const QString& sFilter = tr("Preset files (*.%1)").arg(sExt);
QWidget *pParentWidget = nullptr;
QFileDialog::Options options;
if (pConfig->bDontUseNativeDialogs) {
options |= QFileDialog::DontUseNativeDialog;
pParentWidget = QWidget::window();
}
#if 1//QT_VERSION < QT_VERSION_CHECK(4, 4, 0)
sFilename = QFileDialog::getSaveFileName(pParentWidget,
sTitle, sFilename, sFilter, nullptr, options);
#else
QFileDialog fileDialog(pParentWidget,
sTitle, sFilename, sFilter);
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
fileDialog.setFileMode(QFileDialog::AnyFile);
fileDialog.setDefaultSuffix(sExt);
QList urls(fileDialog.sidebarUrls());
urls.append(QUrl::fromLocalFile(pConfig->sPresetDir));
fileDialog.setSidebarUrls(urls);
fileDialog.setOptions(options);
if (fileDialog.exec())
sFilename = fileDialog.selectedFiles().first();
#endif
} else {
if (QMessageBox::warning(QWidget::window(),
tr("Warning"),
tr("About to replace preset:\n\n"
"\"%1\"\n\n"
"Are you sure?")
.arg(sPreset),
QMessageBox::Ok | QMessageBox::Cancel)
== QMessageBox::Cancel) {
sFilename.clear();
}
}
if (!sFilename.isEmpty()) {
if (QFileInfo(sFilename).suffix() != sExt)
sFilename += '.' + sExt;
emit savePresetFile(sFilename);
pConfig->setPresetFile(sPreset, sFilename);
++m_iInitPreset;
pConfig->sPreset = sPreset;
pConfig->sPresetDir = QFileInfo(sFilename).absolutePath();
refreshPreset();
}
stabilizePreset();
}
void synthv1widget_preset::deletePreset (void)
{
const QString& sPreset = m_pComboBox->currentText();
if (sPreset.isEmpty())
return;
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig == nullptr)
return;
if (QMessageBox::warning(QWidget::window(),
tr("Warning"),
tr("About to remove preset:\n\n"
"\"%1\"\n\n"
"Are you sure?")
.arg(sPreset),
QMessageBox::Ok | QMessageBox::Cancel)
== QMessageBox::Cancel)
return;
pConfig->removePreset(sPreset);
pConfig->sPreset.clear();
clearPreset();
refreshPreset();
stabilizePreset();
}
void synthv1widget_preset::resetPreset (void)
{
const QString& sPreset = m_pComboBox->currentText();
const bool bLoadPreset = (!sPreset.isEmpty()
&& m_pComboBox->findText(sPreset) >= 0);
if (bLoadPreset && !queryPreset())
return;
if (bLoadPreset) {
loadPreset(sPreset);
} else {
emit resetPresetFile();
m_iDirtyPreset = 0;
stabilizePreset();
}
}
// Widget refreshner-loader.
void synthv1widget_preset::refreshPreset (void)
{
const bool bBlockSignals = m_pComboBox->blockSignals(true);
const QString sOldPreset = m_pComboBox->currentText();
const QIcon icon(":/images/synthv1_preset.png");
m_pComboBox->clear();
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig) {
QStringListIterator iter(pConfig->presetList());
while (iter.hasNext()) {
const QString& sPreset = iter.next();
m_pComboBox->addItem(icon, sPreset);
}
m_pComboBox->model()->sort(0);
}
const int iIndex = m_pComboBox->findText(sOldPreset);
if (iIndex >= 0)
m_pComboBox->setCurrentIndex(iIndex);
else
m_pComboBox->setEditText(sOldPreset);
m_iDirtyPreset = 0;
m_pComboBox->blockSignals(bBlockSignals);
}
// Preset control.
void synthv1widget_preset::initPreset (void)
{
synthv1_config *pConfig = synthv1_config::getInstance();
if (pConfig && !pConfig->sPreset.isEmpty())
loadPreset(pConfig->sPreset);
else
newPreset();
}
// Dirty flag accessors.
void synthv1widget_preset::setDirtyPreset ( bool bDirtyPreset )
{
if (bDirtyPreset) {
++m_iDirtyPreset;
} else {
m_iDirtyPreset = 0;
}
stabilizePreset();
}
bool synthv1widget_preset::isDirtyPreset (void) const
{
return (m_iDirtyPreset > 0);
}
void synthv1widget_preset::stabilizePreset (void)
{
const QString& sPreset = m_pComboBox->currentText();
const bool bEnabled = (!sPreset.isEmpty());
const bool bExists = (m_pComboBox->findText(sPreset) >= 0);
const bool bDirty = (m_iDirtyPreset > 0);
m_pSaveButton->setEnabled(bEnabled && (!bExists || bDirty));
m_pDeleteButton->setEnabled(bEnabled && bExists);
m_pResetButton->setEnabled(bDirty);
}
// end of synthv1widget_preset.cpp
synthv1-1.4.2/src/PaxHeaders/synthv1_ramp.h 0000644 0000000 0000000 00000000132 15174622017 015610 x ustar 00 30 mtime=1777542159.045209693
30 atime=1777542159.045209693
30 ctime=1777542159.045209693
synthv1-1.4.2/src/synthv1_ramp.h 0000644 0001750 0000144 00000013101 15174622017 015574 0 ustar 00rncbc users // synthv1_ramp.h
//
/****************************************************************************
Copyright (C) 2012-2021, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1_ramp_h
#define __synthv1_ramp_h
#include
#include
//-------------------------------------------------------------------------
// synthv1_ramp - ramp/smooth parameter changes
class synthv1_ramp
{
public:
synthv1_ramp(uint16_t nvalues = 1)
{
m_nvalues = nvalues;
m_value0 = new float [m_nvalues];
m_value1 = new float [m_nvalues];
m_delta = new float [m_nvalues];
for (uint16_t i = 0; i < m_nvalues; ++i)
m_value0[i] = m_value1[i] = m_delta[i] = 0.0f;
m_frames = 0;
}
virtual ~synthv1_ramp()
{
delete [] m_delta;
delete [] m_value1;
delete [] m_value0;
}
void reset()
{
for (uint16_t i = 0; i < m_nvalues; ++i) {
m_value0[i] = m_value1[i];
m_value1[i] = evaluate(i);
}
m_frames = 0;
}
void process(uint32_t nframes)
{
if (m_frames > 0) {
if (nframes > m_frames)
nframes = m_frames;
for (uint16_t i = 0; i < m_nvalues; ++i)
m_value0[i] += float(nframes) * m_delta[i];
m_frames -= nframes;
}
else
if (probe()) {
reset();
m_frames = nframes;
const uint32_t MIN_FRAMES = 32;
if (m_frames < MIN_FRAMES)
m_frames = MIN_FRAMES;
for (uint16_t i = 0; i < m_nvalues; ++i)
m_delta[i] = (m_value1[i] - m_value0[i]) / float(m_frames);
}
}
float value(uint32_t n, uint16_t i = 0) const
{
return (n < m_frames ? (m_value0[i] + float(n) * m_delta[i]) : m_value1[i]);
}
protected:
virtual bool probe() const = 0;
virtual float evaluate(uint16_t i) = 0;
private:
uint16_t m_nvalues;
float *m_value1;
float *m_value0;
float *m_delta;
uint32_t m_frames;
};
//-------------------------------------------------------------------------
// synthv1_ramp1 (1 port tracking)
class synthv1_ramp1 : public synthv1_ramp
{
public:
synthv1_ramp1(uint16_t nvalues = 1)
: synthv1_ramp(nvalues), m_param1(nullptr), m_param1_v(0.0f) {}
void reset(float *param1)
{
m_param1 = param1;
m_param1_v = 0.0f;
synthv1_ramp::reset();
}
protected:
virtual bool probe() const
{
return m_param1 && ::fabsf(*m_param1 - m_param1_v) > 0.001f;
}
virtual float evaluate(uint16_t)
{
update();
return m_param1_v;
}
void update()
{
if (m_param1)
m_param1_v = *m_param1;
}
float *m_param1;
float m_param1_v;
};
//-------------------------------------------------------------------------
// synthv1_ramp2 (2 port tracking)
class synthv1_ramp2 : public synthv1_ramp1
{
public:
synthv1_ramp2(uint16_t nvalues = 1)
: synthv1_ramp1(nvalues), m_param2(nullptr), m_param2_v(0.0f) {}
void reset(float *param1, float *param2)
{
m_param2 = param2;
m_param2_v = 0.0f;
synthv1_ramp1::reset(param1);
}
protected:
virtual bool probe() const
{
return synthv1_ramp1::probe()
|| (m_param2 && ::fabsf(*m_param2 - m_param2_v) > 0.001f);
}
virtual float evaluate(uint16_t i)
{
update();
return synthv1_ramp1::evaluate(i) * m_param2_v;
}
void update()
{
synthv1_ramp1::update();
if (m_param2)
m_param2_v = *m_param2;
}
float *m_param2;
float m_param2_v;
};
//-------------------------------------------------------------------------
// synthv1_ramp3 (3 port tracking)
class synthv1_ramp3 : public synthv1_ramp2
{
public:
synthv1_ramp3(uint16_t nvalues = 1)
: synthv1_ramp2(nvalues), m_param3(nullptr), m_param3_v(0.0f) {}
void reset(float *param1, float *param2, float *param3)
{
m_param3 = param3;
m_param3_v = 0.0f;
synthv1_ramp2::reset(param1, param2);
}
protected:
virtual bool probe() const
{
return synthv1_ramp2::probe()
|| (m_param3 && ::fabsf(*m_param3 - m_param3_v) > 0.001f);
}
virtual float evaluate(uint16_t i)
{
update();
return synthv1_ramp2::evaluate(i) * m_param3_v;
}
void update()
{
synthv1_ramp2::update();
if (m_param3)
m_param3_v = *m_param3;
}
float *m_param3;
float m_param3_v;
};
//-------------------------------------------------------------------------
// synthv1_ramp4 (4 port tracking)
class synthv1_ramp4 : public synthv1_ramp3
{
public:
synthv1_ramp4(uint16_t nvalues = 1)
: synthv1_ramp3(nvalues), m_param4(nullptr), m_param4_v(0.0f) {}
void reset(float *param1, float *param2, float *param3, float *param4)
{
m_param4 = param4;
m_param4_v = 0.0f;
synthv1_ramp3::reset(param1, param2, param3);
}
protected:
virtual bool probe() const
{
return synthv1_ramp3::probe()
|| (m_param4 && ::fabsf(*m_param4 - m_param4_v) > 0.001f);
}
virtual float evaluate(uint16_t i)
{
update();
return synthv1_ramp3::evaluate(i) * m_param4_v;
}
void update()
{
synthv1_ramp3::update();
if (m_param4)
m_param4_v = *m_param4;
}
float *m_param4;
float m_param4_v;
};
#endif // __synthv1_ramp_h
// end of synthv1_ramp.h
synthv1-1.4.2/src/PaxHeaders/synthv1widget_keybd.cpp 0000644 0000000 0000000 00000000132 15174622017 017506 x ustar 00 30 mtime=1777542159.046209685
30 atime=1777542159.046209685
30 ctime=1777542159.046209685
synthv1-1.4.2/src/synthv1widget_keybd.cpp 0000644 0001750 0000144 00000043121 15174622017 017477 0 ustar 00rncbc users // synthv1widget_keybd.cpp
//
/****************************************************************************
Copyright (C) 2012-2025, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#include "synthv1widget_keybd.h"
#include "synthv1_ui.h"
#include
#include
#include
#include
#include
#include
#include
#include
//-------------------------------------------------------------------------
// synthv1widget_keybd - A horizontal piano keyboard widget.
// Constructor.
synthv1widget_keybd::synthv1widget_keybd ( QWidget *pParent )
: QWidget(pParent)
{
const QFont& font = QWidget::font();
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
QWidget::setFont(QFont(font.family(), font.pointSize() - 3));
#else
QWidget::setFont(QFont(QStringList() << font.family(), font.pointSize() - 3));
#endif
QWidget::setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
QWidget::setMinimumSize(QSize(440, 22));
QWidget::setMouseTracking(true);
for (int n = 0; n < NUM_NOTES; ++n) {
Note& note = m_notes[n];
note.enabled = false;
note.on = false;
}
m_dragCursor = DragNone;
m_bNoteRange = false;
m_iNoteLow = MIN_NOTE;
m_iNoteLowX = 0;
m_iNoteHigh = MAX_NOTE;
m_iNoteHighX = 0;
m_iNoteOn = -1;
m_iTimeout = 0;
m_iVelocity = (MIN_VELOCITY + MAX_VELOCITY) / 2;
m_iNoteKey = -1;
resetDragState();
// Trap for help/tool-tips and leave events.
QWidget::installEventFilter(this);
}
// Note range predicate.
void synthv1widget_keybd::setNoteRange ( bool bNoteRange )
{
m_bNoteRange = bNoteRange;
QWidget::update();
}
bool synthv1widget_keybd::isNoteRange (void) const
{
return m_bNoteRange;
}
// Note enabled predicate.
void synthv1widget_keybd::setNoteEnabled ( int iNote, bool bEnabled )
{
if (iNote >= MIN_NOTE && MAX_NOTE >= iNote)
m_notes[iNote].enabled = bEnabled;
}
bool synthv1widget_keybd::isNoteEnabled ( int iNote ) const
{
if (iNote >= MIN_NOTE && MAX_NOTE >= iNote)
return m_notes[iNote].enabled;
else
return false;
}
void synthv1widget_keybd::setAllNotesEnabled ( bool bEnabled )
{
for (int n = 0; n < NUM_NOTES; ++n)
setNoteEnabled(n, bEnabled);
}
// Default note-on velocity.
void synthv1widget_keybd::setVelocity ( int iVelocity )
{
if (iVelocity < MIN_VELOCITY)
iVelocity = MIN_VELOCITY;
if (iVelocity > MAX_VELOCITY)
iVelocity = MAX_VELOCITY;
m_iVelocity = iVelocity;
}
int synthv1widget_keybd::velocity (void) const
{
return m_iVelocity;
}
// Keyboard note range sanitizers.
int synthv1widget_keybd::safeNoteLow ( int iNoteLow ) const
{
if (iNoteLow < MIN_NOTE)
iNoteLow = MIN_NOTE;
if (iNoteLow > m_iNoteHigh)
iNoteLow = m_iNoteHigh;
return iNoteLow;
}
int synthv1widget_keybd::safeNoteHigh ( int iNoteHigh ) const
{
if (iNoteHigh > MAX_NOTE)
iNoteHigh = MAX_NOTE;
if (iNoteHigh < m_iNoteLow)
iNoteHigh = m_iNoteLow;
return iNoteHigh;
}
// Keyboard note range setters/getters.
void synthv1widget_keybd::setNoteLow ( int iNoteLow )
{
m_iNoteLow = safeNoteLow(iNoteLow);
m_iNoteLowX = noteRect(m_iNoteLow).left();
QWidget::update();
}
int synthv1widget_keybd::noteLow (void) const
{
return m_iNoteLow;
}
void synthv1widget_keybd::setNoteHigh ( int iNoteHigh )
{
m_iNoteHigh = safeNoteHigh(iNoteHigh);
m_iNoteHighX = noteRect(m_iNoteHigh).right();
QWidget::update();
}
int synthv1widget_keybd::noteHigh (void) const
{
return m_iNoteHigh;
}
void synthv1widget_keybd::setNoteKey ( int iNoteKey )
{
if (iNoteKey >= MIN_NOTE && MAX_NOTE >= iNoteKey) {
m_notes[iNoteKey].path = notePath(iNoteKey, true);
m_iNoteKey = iNoteKey;
} else {
m_iNoteKey = -1;
}
QWidget::update();
}
int synthv1widget_keybd::noteKey (void) const
{
return m_iNoteKey;
}
// Piano key rectangle finder.
QRect synthv1widget_keybd::noteRect ( int iNote, bool bOn ) const
{
return notePath(iNote, bOn).boundingRect().toRect();
}
QPainterPath synthv1widget_keybd::notePath ( int iNote, bool bOn ) const
{
QPainterPath path;
const int w = QWidget::width();
const int h = QWidget::height();
const float wn = float(w - 4) / float(NUM_NOTES);
const float wk = 12.0f * wn / 7.0f;
int k = (iNote % 12);
if (k >= 5) ++k;
const int nk = (iNote / 12) * 7 + (k >> 1);
const int x2 = int(wk * float(nk));
const int w2 = int(wn + 0.5f);
QPainterPath path1;
path1.addRect(x2 + int(wk - float(w2 >> 1)), 0, w2 + 1, (h << 1) / 3);
if (k & 1) {
path = path1;
} else if (bOn) {
path.addRect(x2, 0, wk, h);
if ((k == 0 || k == 2 || k == 6 || k == 8 || k == 10) && iNote < MAX_NOTE)
path = path.subtracted(path1.translated(+ 0.5f, 0.0f));
if ((k == 2 || k == 4 || k == 8 || k == 10 || k == 12) && iNote > MIN_NOTE)
path = path.subtracted(path1.translated(+ 0.5f - wk, 0.0f));
} else {
path.addRect(x2, 0, (w2 << 1), h);
}
return path;
}
// Piano keyboard note/key actions.
void synthv1widget_keybd::noteOn ( int iNote )
{
if (iNote < m_iNoteLow || iNote > m_iNoteHigh)
return;
// If it ain't changed we won't change it ;)
Note& note = m_notes[iNote];
if (note.on)
return;
// Now for the sounding new one...
note.on = true;
note.path = notePath(iNote, true);
QWidget::update(note.path.boundingRect().toRect());
}
void synthv1widget_keybd::noteOff ( int iNote )
{
if (iNote < m_iNoteLow || iNote > m_iNoteHigh)
return;
// Turn off old note...
Note& note = m_notes[iNote];
if (!note.on)
return;
// Now for the sounding new one...
note.on = false;
QWidget::update(note.path.boundingRect().toRect());
}
void synthv1widget_keybd::allNotesOff (void)
{
for (int n = 0; n < NUM_NOTES; ++n)
noteOff(n);
}
// Kill dangling notes, if any...
void synthv1widget_keybd::allNotesTimeout (void)
{
if (m_iTimeout < 1)
return;
if (m_iNoteOn >= 0) {
++m_iTimeout;
QTimer::singleShot(1200, this, SLOT(allNotesTimeout())); // +3sec.
return;
}
for (int n = 0; n < NUM_NOTES; ++n) {
Note& note = m_notes[n];
if (note.on) {
note.on = false;
QWidget::update(note.path.boundingRect().toRect());
emit noteOnClicked(n, 0);
}
}
m_iTimeout = 0;
}
// Piano keyboard note-on handler.
void synthv1widget_keybd::dragNoteOn ( const QPoint& pos )
{
// Compute new key cordinates...
const int iNote = noteAt(pos);
if (iNote < m_iNoteLow || iNote > m_iNoteHigh || iNote == m_iNoteOn)
return;
// Were we pending on some sounding note?
dragNoteOff();
// Now for the sounding new one...
m_iNoteOn = iNote;
// noteOn(iNote);
emit noteOnClicked(iNote, m_iVelocity);
if (++m_iTimeout == 1)
QTimer::singleShot(1200, this, SLOT(allNotesTimeout())); // +3sec.
}
// Piano keyboard note-off handler.
void synthv1widget_keybd::dragNoteOff (void)
{
if (m_iNoteOn < 0)
return;
// Turn off old note...
const int iNote = m_iNoteOn;
m_iNoteOn = -1;
// noteOff(iNote);
emit noteOnClicked(iNote, 0);
}
// Piano keyboard note descriminator.
int synthv1widget_keybd::noteAt ( const QPoint& pos ) const
{
const int w = QWidget::width();
const int h = QWidget::height();
const int yk = (h << 1) / 3;
int iNote = (NUM_NOTES * pos.x()) / w;
if (pos.y() >= yk) {
int k = (iNote % 12);
if (k >= 5) ++k;
if (k & 1) {
const int xk = ((w * iNote) + (w >> 1)) / NUM_NOTES;
if (pos.x() >= xk)
++iNote;
else
--iNote;
}
}
return iNote;
}
// (Re)create the complete view pixmap.
void synthv1widget_keybd::updatePixmap (void)
{
const int w = QWidget::width();
const int h = QWidget::height();
if (w < 4 || h < 4)
return;
const QPalette& pal = QWidget::palette();
const bool bDark = (pal.base().color().value() < 128);
const QColor& rgbLine = pal.mid().color();
const QColor& rgbLight = QColor(Qt::white).darker(bDark ? 240 : 160);
const QColor& rgbDark = QColor(Qt::black).lighter(bDark ? 120 : 180);
m_pixmap = QPixmap(w, h);
m_pixmap.fill(pal.window().color());
QPainter painter(&m_pixmap);
// painter.initFrom(this);
const float wn = float(w - 4) / float(NUM_NOTES);
const float wk = 12.0f * wn / 7.0f;
const int w2 = int(wn + 0.5f);
const int h3 = (h << 1) / 3;
QLinearGradient gradLight(0, 0, 0, h);
gradLight.setColorAt(0.0, rgbLight);
gradLight.setColorAt(0.1, rgbLight.lighter());
painter.fillRect(0, 0, w, h, gradLight);
painter.setPen(rgbLine);
int n, k;
for (n = 0; n < NUM_NOTES; ++n) {
k = (n % 12);
if (k >= 5) ++k;
if ((k & 1) == 0) {
const int nk = (n / 12) * 7 + (k >> 1);
const int x1 = int(wk * float(nk));
painter.drawLine(x1, 0, x1, h);
if (k == 0 && w2 > 10)
painter.drawText(x1 + 4, h - 4, noteName(n));
}
}
QLinearGradient gradDark(0, 0, 0, h3);
gradDark.setColorAt(0.0, rgbLight);
gradDark.setColorAt(0.4, rgbDark);
gradDark.setColorAt(0.92, rgbDark);
gradDark.setColorAt(0.96, rgbLight);
gradDark.setColorAt(1.0, rgbDark);
painter.setBrush(gradDark);
for (n = 0; n < NUM_NOTES; ++n) {
k = (n % 12);
if (k >= 5) ++k;
if (k & 1) {
const int nk = (n / 12) * 7 + (k >> 1);
const int x1 = int(wk * float(nk + 1) - float(w2 >> 1));
painter.drawRect(x1, 0, w2, h3);
}
m_notes[n].path = notePath(n, (n == m_iNoteKey
&& m_iNoteKey >= MIN_NOTE && MAX_NOTE >= m_iNoteKey));
}
m_iNoteLowX = noteRect(m_iNoteLow).left();
m_iNoteHighX = noteRect(m_iNoteHigh).right();
}
// Paint event handler.
void synthv1widget_keybd::paintEvent ( QPaintEvent *pPaintEvent )
{
QPainter painter(this);
// Render the pixmap region...
const QRect& rect = pPaintEvent->rect();
painter.drawPixmap(rect, m_pixmap, rect);
const QPalette& pal = QWidget::palette();
QColor rgbGray = pal.mid().color();
rgbGray.setAlpha(120);
// Are we enabled still?
if (!QWidget::isEnabled()) {
painter.fillRect(rect, rgbGray);
return;
}
// Are we sticking in some note?
QColor rgbOver = pal.highlight().color().darker(120);
rgbOver.setAlpha(180);
for (int n = 0; n < NUM_NOTES; ++n) {
Note& note = m_notes[n];
if (!note.enabled)
painter.fillPath(note.path, rgbGray);
else
if (note.on)
painter.fillPath(note.path, rgbOver);
}
// Keyboard range lines...
if (m_bNoteRange) {
const int w = QWidget::width();
const int h = QWidget::height();
const int x1 = m_iNoteLowX;
const int x2 = m_iNoteHighX;
rgbOver = pal.dark().color().darker();
rgbOver.setAlpha(120);
if (x1 > 0)
painter.fillRect(0, 0, x1, h, rgbOver);
if (x2 < w)
painter.fillRect(x2, 0, w, h, rgbOver);
}
// Current highlighted note.
if (m_iNoteKey >= MIN_NOTE && MAX_NOTE >= m_iNoteKey) {
rgbOver = pal.highlight().color().lighter();
rgbOver.setAlpha(120);
painter.fillPath(m_notes[m_iNoteKey].path, rgbOver);
}
}
// Resize event handler.
void synthv1widget_keybd::resizeEvent ( QResizeEvent *pResizeEvent )
{
updatePixmap();
return QWidget::resizeEvent(pResizeEvent);
}
// Alternate mouse behavior event handlers.
void synthv1widget_keybd::mousePressEvent ( QMouseEvent *pMouseEvent )
{
const QPoint& pos = pMouseEvent->pos();
switch (pMouseEvent->button()) {
case Qt::LeftButton:
if (m_dragCursor == DragNone) {
// Are we keying in some keyboard?
if ((pMouseEvent->modifiers()
& (Qt::ShiftModifier | Qt::ControlModifier)) == 0) {
dragNoteOn(pos);
noteToolTip(pos);
}
// Maybe we'll start something...
m_dragState = DragStart;
m_posDrag = pos;
} else {
m_dragState = m_dragCursor;
}
// Fall thru...
default:
break;
}
// QWidget::mousePressEvent(pMouseEvent);
}
void synthv1widget_keybd::mouseMoveEvent ( QMouseEvent *pMouseEvent )
{
const QPoint& pos = pMouseEvent->pos();
switch (m_dragState) {
case DragNone:
if (m_bNoteRange) {
// Are we already moving/dragging something?
const int dx = 4;
const int x1 = m_iNoteLowX;
const int x2 = m_iNoteHighX;
if (::abs(x2 - pos.x()) < dx) {
m_dragCursor = DragNoteHigh;
QWidget::setCursor(QCursor(Qt::SizeHorCursor));
QToolTip::showText(
QWidget::mapToGlobal(pos),
tr("High: %1 (%2)")
.arg(noteName(m_iNoteHigh)).arg(m_iNoteHigh), this);
}
else
if (::abs(x1 - pos.x()) < dx) {
m_dragCursor = DragNoteLow;
QWidget::setCursor(QCursor(Qt::SizeHorCursor));
QToolTip::showText(
QWidget::mapToGlobal(pos),
tr("Low: %1 (%2)")
.arg(noteName(m_iNoteLow)).arg(m_iNoteLow), this);
}
else
if (m_dragCursor != DragNone) {
m_dragCursor = DragNone;
QWidget::unsetCursor();
}
}
break;
case DragNoteLow:
if (m_bNoteRange) {
const int iNoteLow = safeNoteLow(noteAt(pos));
m_iNoteLowX = noteRect(iNoteLow).left();
QWidget::update();
QToolTip::showText(
QCursor::pos(),
tr("Low: %1 (%2)")
.arg(noteName(iNoteLow)).arg(iNoteLow), this);
}
break;
case DragNoteHigh:
if (m_bNoteRange) {
const int iNoteHigh = safeNoteHigh(noteAt(pos));
m_iNoteHighX = noteRect(iNoteHigh).right();
QWidget::update();
QToolTip::showText(
QCursor::pos(),
tr("High: %1 (%2)")
.arg(noteName(iNoteHigh)).arg(iNoteHigh), this);
}
break;
case DragNoteRange:
if (m_bNoteRange) {
const int w = QWidget::width();
if (w > 0) {
// Rubber-band offset selection...
const QRect& rect = QRect(m_posDrag, pos).normalized();
int iNoteLow = (NUM_NOTES * rect.left()) / w;
int iNoteHigh = (NUM_NOTES * rect.right()) / w;
if (iNoteLow < MIN_NOTE)
iNoteLow = MIN_NOTE;
if (iNoteLow > iNoteHigh)
iNoteLow = iNoteHigh;
if (iNoteHigh > MAX_NOTE)
iNoteHigh = MAX_NOTE;
if (iNoteHigh < iNoteLow)
iNoteHigh = iNoteLow;
m_iNoteLowX = noteRect(iNoteLow).left();
m_iNoteHighX = noteRect(iNoteHigh).right();
QWidget::update();
QToolTip::showText(
QWidget::mapToGlobal(pos),
tr("Low: %1 (%2) High: %3 (%4)")
.arg(noteName(iNoteLow)).arg(iNoteLow)
.arg(noteName(iNoteHigh)).arg(iNoteHigh), this);
}
}
break;
case DragStart:
if (m_bNoteRange) {
if ((m_posDrag - pos).manhattanLength()
> QApplication::startDragDistance()) {
// Start dragging alright...
if (m_dragCursor != DragNone)
m_dragState = m_dragCursor;
else
if (pMouseEvent->modifiers()
& (Qt::ShiftModifier | Qt::ControlModifier)) {
// Rubber-band starting...
m_dragState = m_dragCursor = DragNoteRange;
QWidget::setCursor(QCursor(Qt::SizeHorCursor));
}
}
}
// Are we still hovering the keyboard?
if (m_dragState == DragStart) {
dragNoteOn(pos);
noteToolTip(pos);
}
// Fall thru...
default:
break;
}
// QWidget::mouseMoveEvent(pMouseEvent);
}
void synthv1widget_keybd::mouseReleaseEvent ( QMouseEvent *pMouseEvent )
{
const QPoint& pos = pMouseEvent->pos();
switch (m_dragState) {
case DragNoteLow:
if (m_bNoteRange) {
setNoteLow(noteAt(pos));
emit noteRangeChanged();
}
break;
case DragNoteHigh:
if (m_bNoteRange) {
setNoteHigh(noteAt(pos));
emit noteRangeChanged();
}
break;
case DragNoteRange:
if (m_bNoteRange) {
const int w = QWidget::width();
if (w > 0) {
const QRect& rect = QRect(m_posDrag, pos).normalized();
int iNoteLow = (NUM_NOTES * rect.left()) / w;
int iNoteHigh = (NUM_NOTES * rect.right()) / w;
if (iNoteLow < MIN_NOTE)
iNoteLow = MIN_NOTE;
if (iNoteHigh > MAX_NOTE)
iNoteHigh = MAX_NOTE;
if (iNoteLow > iNoteHigh)
iNoteLow = iNoteHigh;
if (iNoteHigh < iNoteLow)
iNoteHigh = iNoteLow;
m_iNoteLow = iNoteLow;
m_iNoteLowX = noteRect(iNoteLow).left();
m_iNoteHigh = iNoteHigh;
m_iNoteHighX = noteRect(iNoteHigh).right();
QWidget::update();
emit noteRangeChanged();
}
}
break;
// Fall thru...
default:
break;
}
// Were we stuck on some keyboard note?
resetDragState();
// QWidget::mouseReleaseEvent(pMouseEvent);
}
// Keyboard event handler.
void synthv1widget_keybd::keyPressEvent ( QKeyEvent *pKeyEvent )
{
switch (pKeyEvent->key()) {
case Qt::Key_Escape:
resetDragState();
QWidget::update();
break;
default:
QWidget::keyPressEvent(pKeyEvent);
break;
}
}
// Trap for help/tool-tip events.
bool synthv1widget_keybd::eventFilter ( QObject *pObject, QEvent *pEvent )
{
if (static_cast (pObject) == this) {
if (pEvent->type() == QEvent::ToolTip) {
QHelpEvent *pHelpEvent = static_cast (pEvent);
if (pHelpEvent && m_dragCursor == DragNone) {
noteToolTip(pHelpEvent->pos());
return true;
}
}
else
if (pEvent->type() == QEvent::Leave) {
dragNoteOff();
return true;
}
}
// Not handled here.
return QWidget::eventFilter(pObject, pEvent);
}
// Present a tooltip for a note.
void synthv1widget_keybd::noteToolTip ( const QPoint& pos ) const
{
const int iNote = noteAt(pos);
if (iNote < MIN_NOTE || iNote > MAX_NOTE)
return;
QToolTip::showText(QWidget::mapToGlobal(pos),
QString("%1 (%2)").arg(noteName(iNote)).arg(iNote));
}
// Default note name map accessor.
QString synthv1widget_keybd::noteName ( int iNote ) const
{
return synthv1_ui::noteName(iNote);
}
// Reset drag/select state.
void synthv1widget_keybd::resetDragState (void)
{
dragNoteOff();
if (m_dragCursor != DragNone)
QWidget::unsetCursor();
m_dragState = m_dragCursor = DragNone;
}
// end of synthv1widget_keybd.cpp
synthv1-1.4.2/src/PaxHeaders/synthv1widget_filt.h 0000644 0000000 0000000 00000000132 15174622017 017013 x ustar 00 30 mtime=1777542159.046209685
30 atime=1777542159.046209685
30 ctime=1777542159.046209685
synthv1-1.4.2/src/synthv1widget_filt.h 0000644 0001750 0000144 00000005121 15174622017 017002 0 ustar 00rncbc users // synthv1widget_filt.h
//
/****************************************************************************
Copyright (C) 2012-2021, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1widget_filt_h
#define __synthv1widget_filt_h
#include
#include
//----------------------------------------------------------------------------
// synthv1widget_filt -- Custom widget
class synthv1widget_filt : public QFrame
{
Q_OBJECT
public:
// Constructor.
synthv1widget_filt(QWidget *pParent = nullptr);
// Destructor.
~synthv1widget_filt();
// Parameter getters.
float cutoff() const;
float reso() const;
float type() const;
float slope() const;
public slots:
// Parameter setters.
void setCutoff(float fCutoff);
void setReso(float fReso);
void setType(float fType);
void setSlope(float fSlope);
signals:
// Parameter change signals.
void cutoffChanged(float fCutoff);
void resoChanged(float fReso);
protected:
// Draw canvas.
void paintEvent(QPaintEvent *);
// Filter types/slopes.
enum Types {
LPF = 0,
BPF = 1,
HPF = 2,
BRF = 3,
L2F = 4
};
enum Slopes {
S12DB = 0,
S24DB = 1,
SBIQUAD = 2,
SFORMANT = 3
};
// Drag/move curve.
void dragCurve(const QPoint& pos);
// Mouse interaction.
void mousePressEvent(QMouseEvent *pMouseEvent);
void mouseMoveEvent(QMouseEvent *pMouseEvent);
void mouseReleaseEvent(QMouseEvent *pMouseEvent);
void wheelEvent(QWheelEvent *pWheelEvent);
// Resize canvas.
void resizeEvent(QResizeEvent *);
// Update the drawing path.
void updatePath();
private:
// Instance state.
float m_fCutoff;
float m_fReso;
int m_iType;
int m_iSlope;
// Drag state.
bool m_bDragging;
QPoint m_posDrag;
// Drawable path.
QPainterPath m_path;
};
#endif // __synthv1widget_filt_h
// end of synthv1widget_filt.h
synthv1-1.4.2/src/PaxHeaders/synthv1widget_filt.cpp 0000644 0000000 0000000 00000000132 15174622017 017346 x ustar 00 30 mtime=1777542159.046209685
30 atime=1777542159.046209685
30 ctime=1777542159.046209685
synthv1-1.4.2/src/synthv1widget_filt.cpp 0000644 0001750 0000144 00000017521 15174622017 017344 0 ustar 00rncbc users // synthv1widget_filt.cpp
//
/****************************************************************************
Copyright (C) 2012-2021, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#include "synthv1widget_filt.h"
#include
#include
#include
#include
#include
// Safe value capping.
inline float safe_value ( float x )
{
return (x < 0.0f ? 0.0f : (x > 1.0f ? 1.0f : x));
}
//----------------------------------------------------------------------------
// synthv1widget_filt -- Custom widget
// Constructor.
synthv1widget_filt::synthv1widget_filt ( QWidget *pParent )
: QFrame(pParent),
m_fCutoff(0.0f), m_fReso(0.0f), m_iType(LPF), m_iSlope(S12DB),
m_bDragging(false)
{
// setMouseTracking(true);
setMinimumSize(QSize(180, 72));
QFrame::setFrameShape(QFrame::Panel);
QFrame::setFrameShadow(QFrame::Sunken);
}
// Destructor.
synthv1widget_filt::~synthv1widget_filt (void)
{
}
// Parameter accessors.
void synthv1widget_filt::setCutoff ( float fCutoff )
{
if (::fabsf(m_fCutoff - fCutoff) > 0.001f) {
m_fCutoff = safe_value(fCutoff);
updatePath();
emit cutoffChanged(cutoff());
}
}
float synthv1widget_filt::cutoff (void) const
{
return m_fCutoff;
}
void synthv1widget_filt::setReso ( float fReso )
{
if (::fabsf(m_fReso - fReso) > 0.001f) {
m_fReso = safe_value(fReso);
updatePath();
emit resoChanged(reso());
}
}
float synthv1widget_filt::reso (void) const
{
return m_fReso;
}
void synthv1widget_filt::setType ( float fType )
{
const int iType = int(fType);
if (m_iType != iType) {
m_iType = iType;
updatePath();
}
}
float synthv1widget_filt::type (void) const
{
return float(m_iType);
}
void synthv1widget_filt::setSlope ( float fSlope )
{
const int iSlope = int(fSlope);
if (m_iSlope != iSlope) {
m_iSlope = iSlope;
updatePath();
}
}
float synthv1widget_filt::slope (void) const
{
return float(m_iSlope);
}
// Draw curve.
void synthv1widget_filt::paintEvent ( QPaintEvent *pPaintEvent )
{
QPainter painter(this);
const QRect& rect = QWidget::rect();
const int h = rect.height();
const int w = rect.width();
const QPalette& pal = palette();
const bool bDark = (pal.window().color().value() < 0x7f);
const QColor& rgbLite = (isEnabled() ? Qt::yellow : pal.mid().color());
const QColor& rgbDark = pal.window().color().darker();
painter.fillRect(rect, rgbDark);
QColor rgbLite1(rgbLite);
QColor rgbDrop1(Qt::black);
rgbLite1.setAlpha(bDark ? 80 : 120);
rgbDrop1.setAlpha(80);
QLinearGradient grad(0, 0, w << 1, h << 1);
grad.setColorAt(0.0f, rgbLite1);
grad.setColorAt(1.0f, rgbDrop1);
painter.setRenderHint(QPainter::Antialiasing, true);
// painter.setPen(bDark ? Qt::gray : Qt::darkGray);
painter.setPen(QPen(rgbLite1, 2));
painter.setBrush(grad);
painter.drawPath(m_path);
#ifdef CONFIG_DEBUG_0
painter.drawText(QFrame::rect(),
Qt::AlignTop|Qt::AlignHCenter,
tr("Cutoff(%1) Reso(%2)")
.arg(int(100.0f * cutoff()))
.arg(int(100.0f * reso())));
#endif
painter.setRenderHint(QPainter::Antialiasing, false);
painter.end();
QFrame::paintEvent(pPaintEvent);
}
// Drag/move curve.
void synthv1widget_filt::dragCurve ( const QPoint& pos )
{
const int h = height();
const int w = width();
const int dx = (pos.x() - m_posDrag.x());
const int dy = (pos.y() - m_posDrag.y());
if (dx || dy) {
const int h2 = (h >> 1);
const int x = int(cutoff() * float(w));
const int y = int(reso() * float(h2));
setCutoff(float(x + dx) / float(w));
setReso(float(y - dy) / float(h2));
m_posDrag = pos;
}
}
// Mouse interaction.
void synthv1widget_filt::mousePressEvent ( QMouseEvent *pMouseEvent )
{
if (pMouseEvent->button() == Qt::LeftButton)
m_posDrag = pMouseEvent->pos();
QFrame::mousePressEvent(pMouseEvent);
}
void synthv1widget_filt::mouseMoveEvent ( QMouseEvent *pMouseEvent )
{
const QPoint& pos = pMouseEvent->pos();
if (m_bDragging) {
dragCurve(pos);
} else { // if ((pos - m_posDrag).manhattanLength() > 4) {
setCursor(Qt::SizeAllCursor);
m_bDragging = true;
}
}
void synthv1widget_filt::mouseReleaseEvent ( QMouseEvent *pMouseEvent )
{
QFrame::mouseReleaseEvent(pMouseEvent);
if (m_bDragging) {
dragCurve(pMouseEvent->pos());
m_bDragging = false;
unsetCursor();
}
}
void synthv1widget_filt::wheelEvent ( QWheelEvent *pWheelEvent )
{
const int delta = (pWheelEvent->angleDelta().y() / 60);
if (pWheelEvent->modifiers() & (Qt::ShiftModifier | Qt::ControlModifier)) {
const int h2 = (height() >> 1);
const int y = int(reso() * float(h2));
setReso(float(y + delta) / float(h2));
} else {
const int w2 = (width() >> 1);
const int x = int(cutoff() * float(w2));
setCutoff(float(x + delta) / float(w2));
}
}
// Resize canvas.
void synthv1widget_filt::resizeEvent ( QResizeEvent *pResizeEvent )
{
QFrame::resizeEvent(pResizeEvent);
updatePath();
}
// Update the drawing polygon.
void synthv1widget_filt::updatePath (void)
{
const QRect& rect = QWidget::rect();
const int h = rect.height();
const int w = rect.width();
const int h2 = h >> 1;
const int h4 = h >> 2;
const int w4 = w >> 2;
const int w8 = w >> 3;
const int ws = w8 - (m_iSlope == S24DB ? (w8 >> 1) : 0);
int x = w8 + int(m_fCutoff * float(w - w4));
int y = h2 - int(m_fReso * float(h + h4));
QPolygon poly(6);
QPainterPath path;
const int iType = (m_iSlope == SFORMANT ? L2F : m_iType);
// Low, Notch
if (iType == LPF || iType == BRF) {
if (iType == BRF) x -= w8;
poly.putPoints(0, 6,
0, h2,
x - w8, h2,
x, h2,
x, y,
x + ws, h,
0, h);
path.moveTo(poly.at(0));
path.lineTo(poly.at(1));
path.cubicTo(poly.at(2), poly.at(3), poly.at(4));
path.lineTo(poly.at(5));
if (iType == BRF) x += w8;
}
// Band
if (iType == BPF) {
const int y2 = (y + h4) >> 1;
poly.putPoints(0, 6,
0, h,
x - w8 - ws, h,
x - ws, y2,
x + ws, y2,
x + w8 + ws, h,
0, h);
path.moveTo(poly.at(0));
path.lineTo(poly.at(1));
path.cubicTo(poly.at(2), poly.at(3), poly.at(4));
path.lineTo(poly.at(5));
}
// High, Notch
if (iType == HPF || iType == BRF) {
if (iType == BRF) { x += w8; y = h2; }
poly.putPoints(0, 6,
x - ws, h,
x, y,
x, h2,
x + w8, h2,
w, h2,
w, h);
path.moveTo(poly.at(0));
path.cubicTo(poly.at(1), poly.at(2), poly.at(3));
path.lineTo(poly.at(4));
path.lineTo(poly.at(5));
if (iType == BRF) x -= w8;
}
// Formant
if (iType == L2F) {
const int x2 = (x - w4) >> 2;
const int y2 = (y - h4) >> 2;
poly.putPoints(0, 6,
0, h2,
x2, h2,
x - ws, h2,
x, y2,
x + ws, h,
0, h);
path.moveTo(poly.at(0));
#if 0
path.lineTo(poly.at(1));
path.cubicTo(poly.at(2), poly.at(3), poly.at(4));
#else
const int n3 = 5; // num.formants
const int w3 = (x + ws - x2) / n3 - 1;
const int w6 = (w3 >> 1);
const int h3 = (h4 >> 1);
int x3 = x2; int y3 = y2;
for (int i = 0; i < n3; ++i) {
poly.putPoints(1, 3,
x3, h2,
x3 + w6, y3,
x3 + w3, y3 + h2);
path.cubicTo(poly.at(1), poly.at(2), poly.at(3));
x3 += w3; y3 += h3;
}
path.lineTo(poly.at(4));
#endif
path.lineTo(poly.at(5));
}
// Commit path.
m_path = path;
QFrame::update();
}
// end of synthv1widget_filt.cpp
synthv1-1.4.2/src/PaxHeaders/synthv1widget_controls.h 0000644 0000000 0000000 00000000132 15174622017 017720 x ustar 00 30 mtime=1777542159.046209685
30 atime=1777542159.046209685
30 ctime=1777542159.046209685
synthv1-1.4.2/src/synthv1widget_controls.h 0000644 0001750 0000144 00000004077 15174622017 017720 0 ustar 00rncbc users // synthv1widget_controls.h
//
/****************************************************************************
Copyright (C) 2012-2023, rncbc aka Rui Nuno Capela. All rights reserved.
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.
*****************************************************************************/
#ifndef __synthv1widget_controls_h
#define __synthv1widget_controls_h
#include
#include
// forward decls.
class synthv1_controls;
//----------------------------------------------------------------------------
// synthv1widget_controls -- Custom (tree) widget.
class synthv1widget_controls : public QTreeWidget
{
Q_OBJECT
public:
// ctor.
synthv1widget_controls(QWidget *pParent = nullptr);
// dtor.
~synthv1widget_controls();
// utilities.
void loadControls(synthv1_controls *pControls);
void saveControls(synthv1_controls *pControls);
// controller name utilities.
typedef QMap Names;
static const Names& controllerNames();
static const Names& rpnNames();
static const Names& nrpnNames();
static const Names& control14Names();
public slots:
// slots.
void addControlItem();
protected slots:
// private slots.
void itemChangedSlot(QTreeWidgetItem *, int);
protected:
// item delegate decl..
class ItemDelegate;
// factory methods.
QTreeWidgetItem *newControlItem();
};
#endif // __synthv1widget_controls_h
// end of synthv1widget_controls.h
synthv1-1.4.2/src/PaxHeaders/mimetypes 0000644 0000000 0000000 00000000132 15174622017 014743 x ustar 00 30 mtime=1777542159.043575059
30 atime=1777542159.043520042
30 ctime=1777542159.043575059
synthv1-1.4.2/src/mimetypes/ 0000755 0001750 0000144 00000000000 15174622017 015010 5 ustar 00rncbc users synthv1-1.4.2/src/mimetypes/PaxHeaders/org.rncbc.synthv1.xml 0000644 0000000 0000000 00000000132 15174622017 021032 x ustar 00 30 mtime=1777542159.043575059
30 atime=1777542159.043575059
30 ctime=1777542159.043575059
synthv1-1.4.2/src/mimetypes/org.rncbc.synthv1.xml 0000644 0001750 0000144 00000000553 15174622017 021025 0 ustar 00rncbc users
synthv1 preset
synthv1-1.4.2/src/mimetypes/PaxHeaders/org.rncbc.synthv1.application-x-synthv1-preset.svg 0000644 0000000 0000000 00000000132 15174622017 026512 x ustar 00 30 mtime=1777542159.043575059
30 atime=1777542159.043520042
30 ctime=1777542159.043575059
synthv1-1.4.2/src/mimetypes/org.rncbc.synthv1.application-x-synthv1-preset.svg 0000644 0001750 0000144 00000507007 15174622017 026513 0 ustar 00rncbc users
synthv1-1.4.2/src/mimetypes/PaxHeaders/org.rncbc.synthv1.application-x-synthv1-preset.png 0000644 0000000 0000000 00000000132 15174622017 026477 x ustar 00 30 mtime=1777542159.043520042
30 atime=1777542159.043520042
30 ctime=1777542159.043520042
synthv1-1.4.2/src/mimetypes/org.rncbc.synthv1.application-x-synthv1-preset.png 0000644 0001750 0000144 00000003225 15174622017 026471 0 ustar 00rncbc users ‰PNG
IHDR szzô pHYs à ÃÇo¨d tEXtSoftware www.inkscape.org›î< "IDATX…½—[l\W†¿½ÏÌÏ}<—x�ï6“ĉQÍÅA�"*%u å)Ró@‚„òÈOH4– öRT$Dª6ni$
jâÄ%qqíØm]׎oã¹Øgæ\6¾`{Æ3i£öšÙ{íµ¿³Î^kí#”RÔ’B ²†™RJ95�íõ½ ©³³åÒÐ^RJ‰PÊQŽÜ²SŽc½uýÍñç~ùó¯}ø° ®²Kí=ö°vª£+Ýë÷×=‹ÅžXZZºû0k*…µê“W“? ÕÜÚøëß<#ù“<’,¥ñÄɯùû»^oH¥¾R˾ì<ª"õQ–3«<óí§½
õZªíë3ÓÓ×?3€@0L¾°Ž®ëœ~ú©:¥Ôß›ÛÛ¿úÁÔÔ�ÏÀç󱸲ÊòJ†P0À·Oy,Ëzã`KˉÙ÷ßëSðÔy™üà=î¼}…¥…y¤p8˜Lx~rá§ÃBˆ£J©™O
‘>|”ô‘c躎ÇS‡RŠìÊb°³û¹ï!†v¬�
PÈg¹ùïk(Çþ¸KeGççÄãÒï÷ÿ£P(ÜúD ·oÞ`äú0n·€�*]®�ã[¿{u?