mirror of
https://github.com/thestk/stk
synced 2026-01-12 04:21:52 +00:00
Compare commits
70 Commits
cocoapods-
...
5.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cb2c81d04 | ||
|
|
b671638f99 | ||
|
|
169b005a2d | ||
|
|
73008d02a1 | ||
|
|
e364d81c8f | ||
|
|
3675846c66 | ||
|
|
fd5e37863d | ||
|
|
7f97ab5f71 | ||
|
|
8b29e0ea6d | ||
|
|
2af2f1c816 | ||
|
|
f39c1fb06d | ||
|
|
35ca4abcb9 | ||
|
|
cc2dd22e97 | ||
|
|
e0279e305b | ||
|
|
ce765cc391 | ||
|
|
9bf39f53c6 | ||
|
|
4397e05158 | ||
|
|
70835eccb4 | ||
|
|
79334d2c8d | ||
|
|
16918b0914 | ||
|
|
3acb9502ae | ||
|
|
92d81d67c2 | ||
|
|
893ff3d954 | ||
|
|
b343913233 | ||
|
|
f3ce5f4d04 | ||
|
|
d4750edc66 | ||
|
|
6a6a9cdfbe | ||
|
|
dec667bab5 | ||
|
|
1fd900263b | ||
|
|
67d573b169 | ||
|
|
500d2972f9 | ||
|
|
ee7a1a31f8 | ||
|
|
feb123c9b8 | ||
|
|
509c6cf9e9 | ||
|
|
e5454b85c7 | ||
|
|
f0a22c463d | ||
|
|
ba6ea9f5db | ||
|
|
f00e38611c | ||
|
|
367893bf50 | ||
|
|
a6266131cb | ||
|
|
1fec6e0157 | ||
|
|
d308c8aeb7 | ||
|
|
deddcbaa3e | ||
|
|
76127ffc6c | ||
|
|
d77b093a9d | ||
|
|
c7d37545d3 | ||
|
|
15a1359671 | ||
|
|
51f9676229 | ||
|
|
7840967816 | ||
|
|
8132c90515 | ||
|
|
73004ac9c4 | ||
|
|
a49f6e71e7 | ||
|
|
926a9faca7 | ||
|
|
34192d9a63 | ||
|
|
fb2b0aa305 | ||
|
|
ba967ff851 | ||
|
|
109f0bd9a8 | ||
|
|
7b94384705 | ||
|
|
b379160f2b | ||
|
|
4b5b142531 | ||
|
|
f1a75a8691 | ||
|
|
e5cab23433 | ||
|
|
5a8b2234c7 | ||
|
|
314835cc70 | ||
|
|
700ff2c459 | ||
|
|
fb15f76d45 | ||
|
|
921493d4fe | ||
|
|
4cbdd0d3dc | ||
|
|
c97f5b4b3a | ||
|
|
809cb26e12 |
167
CMakeLists.txt
Normal file
167
CMakeLists.txt
Normal file
@@ -0,0 +1,167 @@
|
||||
cmake_minimum_required(VERSION 3.1) ##TODO: which version is better
|
||||
|
||||
project(STK VERSION 4.6.1)
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
|
||||
endif()
|
||||
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release" "Debug" "RelWithDebInfo" "MinSizeRel")
|
||||
message("Build type: " ${CMAKE_BUILD_TYPE})
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /clr")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7 /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=2 /D_STK_DEBUG_ /D__RTAUDIO_DEBUG__ /D__RTMIDI_DEBUG__")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -D_STK_DEBUG_ -D__RTAUDIO_DEBUG__ -D__RTMIDI_DEBUG__")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
||||
message("GCC.")
|
||||
set(CMAKE_CXX_FLAGS "-Wall")
|
||||
endif()
|
||||
|
||||
option(BUILD_SHARED "Whether to build the shared library" ON)
|
||||
option(BUILD_STATIC "Whether to build the static library" ON)
|
||||
option(REALTIME "Realtime support" ON)
|
||||
option(ENABLE_JACK "Enable JACK" ON)
|
||||
option(ENABLE_ALSA "Enable ALSA API support (linux only)" ON)
|
||||
# option(ENABLE_OSS "Enable OSS API Support (unixes only)" ON)
|
||||
option(ENABLE_ASIO "Enable ASIO API support (windows only)" OFF)
|
||||
option(ENABLE_DS "Enable DirectSound API support (windows only)" ON)
|
||||
option(ENABLE_WASAPI "Enable Windows Audio Session API support (windows only)" OFF)
|
||||
# option(ENABLE_CORE "Enable CoreAudio API support (mac only)" ON)
|
||||
option(COMPILE_PROJECTS "Compile all the example projects" ON)
|
||||
option(INSTALL_HEADERS "Install headers" ON)
|
||||
|
||||
include_directories("./include")
|
||||
file(GLOB STK_SRC "./src/*.cpp") # GLOB instead of GLOB_RECURSE as the asio depends on system
|
||||
|
||||
#========================================#
|
||||
#========== Realtime Support ============#
|
||||
#========================================#
|
||||
if(REALTIME)
|
||||
if(ENABLE_JACK)
|
||||
find_library(JACK_LIBRARY jack) # find_package(JACK) # TODO: NEED FindJACK.cmake
|
||||
if(JACK_LIBRARY)
|
||||
message("Jack API found: ${JACK_LIBRARY}")
|
||||
link_libraries(${JACK_LIBRARY})
|
||||
add_definitions(-D__UNIX_JACK__)
|
||||
else()
|
||||
message(WARNING "JACK support requires the jack library!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message("${CMAKE_SYSTEM_NAME}")
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
link_libraries(Threads::Threads)
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
|
||||
# TODO: Finish Linux configuration, include different audio API supports
|
||||
#============== LINUX ================#
|
||||
message("Linux DETECTED!")
|
||||
if(ENABLE_ALSA)
|
||||
find_package(ALSA REQUIRED)
|
||||
if(ALSA_FOUND)
|
||||
include_directories(${ALSA_INCLUDE_DIRS})
|
||||
link_libraries(${ALSA_LIBRARIES})
|
||||
add_definitions(-D__LINUX_ALSA__)
|
||||
endif()
|
||||
endif()
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
|
||||
#============== MAC OS ================#
|
||||
message("Machintosh DETECTED!")
|
||||
find_package(CoreAudio REQUIRED)
|
||||
include_directories(${COREAUDIO_INCLUDE_DIRS})
|
||||
add_definitions(-D__MACOSX_CORE__)
|
||||
link_libraries(${COREAUDIO_LIBRARY} ${COREAUDIO_FOUNDATION} ${COREAUDIO_MIDI})
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL Windows)
|
||||
# TODO: MORE SUPPORT (e.g., MSYS)?
|
||||
# Tested under MSYS2 with Mingw64 toolchain
|
||||
#============== WINDOWS ================#
|
||||
message("Windows DETECTED!")
|
||||
link_libraries(winmm ole32 wsock32)
|
||||
add_definitions(-D__WINDOWS_MM__)
|
||||
|
||||
# TODO: ASIO NOT WORKING YET
|
||||
if(ENABLE_ASIO)
|
||||
message("ENALBING ASIO")
|
||||
include_directories("./src/include")
|
||||
# target_sources(stk PUBLIC "${CMAKE_SOURCE_DIR}/src/include/asio.cpp" "${CMAKE_SOURCE_DIR}/src/include/asiodrivers.cpp"
|
||||
# "${CMAKE_SOURCE_DIR}/src/include/asiolist.cpp" "${CMAKE_SOURCE_DIR}/src/include/iasiothiscallresolver.cpp")
|
||||
add_definitions(-D__WINDOWS_ASIO__)
|
||||
endif()
|
||||
|
||||
if(ENABLE_WASAPI)
|
||||
message("ENALBING WASAPI")
|
||||
link_libraries(mfuuid mfplat wmcodecdspuuid ksuser)
|
||||
add_definitions(-D__WINDOWS_WASAPI__)
|
||||
endif()
|
||||
|
||||
if(ENABLE_DS)
|
||||
message("ENALBING Directsound")
|
||||
link_libraries(dsound)
|
||||
add_definitions(-D__WINDOWS_DS__)
|
||||
endif()
|
||||
else()
|
||||
message("CMAKE_SYSTEM_NAME:" ${CMAKE_SYSTEM_NAME})
|
||||
message(FATAL_ERROR "Unknown system type for realtime support.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(TestBigEndian)
|
||||
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
|
||||
if(NOT IS_BIG_ENDIAN)
|
||||
add_definitions(-D__LITTLE_ENDIAN__)
|
||||
endif()
|
||||
add_definitions(-D_USE_MATH_DEFINES)
|
||||
if(INSTALL_HEADERS)
|
||||
file(GLOB STK_HEADERS "include/*.h")
|
||||
install(FILES ${STK_HEADERS} DESTINATION include/stk)
|
||||
endif()
|
||||
#========================================#
|
||||
#========== Build the Library ===========#
|
||||
#========================================#
|
||||
if(BUILD_STATIC)
|
||||
add_library(stk STATIC ${STK_SRC} )
|
||||
target_include_directories(stk PRIVATE include PUBLIC $<INSTALL_INTERFACE:include>)
|
||||
set_target_properties(stk PROPERTIES PUBLIC_HEADER "${LIBSTK_HEADERS}")
|
||||
list(APPEND STK_TARGETS stk)
|
||||
endif()
|
||||
|
||||
if(BUILD_SHARED)
|
||||
add_library(stk_SHARED SHARED ${STK_SRC})
|
||||
set_target_properties(stk_SHARED PROPERTIES OUTPUT_NAME stk) # rename the shared library name
|
||||
target_include_directories(stk_SHARED PRIVATE include PUBLIC $<INSTALL_INTERFACE:include>)
|
||||
set_target_properties(stk_SHARED PROPERTIES PUBLIC_HEADER "${LIBSTK_HEADERS}")
|
||||
list(APPEND STK_TARGETS stk_SHARED)
|
||||
endif()
|
||||
|
||||
#========================================#
|
||||
#========= Build the examples ===========#
|
||||
#========================================#
|
||||
if(COMPILE_PROJECTS)
|
||||
message("COMPILE PROJECTS!")
|
||||
add_subdirectory(projects/examples)
|
||||
add_subdirectory(projects/eguitar)
|
||||
add_subdirectory(projects/demo)
|
||||
add_subdirectory(projects/effects)
|
||||
add_subdirectory(projects/ragamatic)
|
||||
endif()
|
||||
|
||||
#========================================#
|
||||
#========= Install ======================#
|
||||
#========================================#
|
||||
|
||||
install(TARGETS ${STK_TARGETS} EXPORT stk-config
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
PUBLIC_HEADER DESTINATION include/stk)
|
||||
|
||||
install(EXPORT stk-config DESTINATION lib/cmake/stk)
|
||||
@@ -1,5 +1,5 @@
|
||||
# The Synthesis ToolKit in C++ (STK)
|
||||
By Perry R. Cook and Gary P. Scavone, 1995-2019.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995-2023.
|
||||
|
||||
The Synthesis ToolKit in C++ can be used in a variety of ways, depending on your particular needs. Some people simply choose the classes they need for a particular project and copy those to their project directory. Others like to compile and link to a library of object files. STK was not designed with one particular style of use in mind.
|
||||
|
||||
@@ -49,6 +49,6 @@ If you wish to use a different compiler than that selected by configure, specify
|
||||
|
||||
MinGW support is provided in the configure script. In addition, Visual Studio 2017 project files are included for each of the example STK projects.
|
||||
|
||||
##iOS
|
||||
## iOS
|
||||
|
||||
You can integrate the STK in iOS projects either by using its iOS static library or CocoaPods. See the [iOS README file](iOS/README-iOS.md) for instructions.
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
Copyright (c) 1995-2019 Perry R. Cook and Gary P. Scavone
|
||||
Copyright (c) 1995-2023 Perry R. Cook and Gary P. Scavone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# The Synthesis ToolKit in C++ (STK)
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
|
||||
This distribution of the Synthesis ToolKit in C++ (STK) contains the following:
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'STK'
|
||||
spec.version = '4.6.1'
|
||||
spec.version = '4.6.2'
|
||||
spec.summary = 'The Synthesis ToolKit in C++ is a set of open source audio signal processing and algorithmic synthesis classes.'
|
||||
spec.homepage = 'https://ccrma.stanford.edu/software/stk/'
|
||||
spec.source = { :git => 'https://github.com/thestk/stk.git', :tag => spec.version }
|
||||
|
||||
21
cmake/FindCoreAudio.cmake
Normal file
21
cmake/FindCoreAudio.cmake
Normal file
@@ -0,0 +1,21 @@
|
||||
find_library(COREAUDIO_LIBRARY CoreAudio)
|
||||
find_library(COREAUDIO_FOUNDATION CoreFoundation)
|
||||
find_library(COREAUDIO_MIDI CoreMIDI)
|
||||
find_path(COREAUDIO_INCLUDE_DIRS CoreAudio/CoreAudio.h)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
||||
CoreAudio
|
||||
DEFAULT_MSG
|
||||
COREAUDIO_LIBRARY
|
||||
COREAUDIO_FOUNDATION
|
||||
COREAUDIO_MIDI
|
||||
COREAUDIO_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(
|
||||
COREAUDIO_LIBRARY
|
||||
COREAUDIO_FOUNDATION
|
||||
COREAUDIO_MIDI
|
||||
COREAUDIO_INCLUDE_DIRS)
|
||||
|
||||
|
||||
41
configure.ac
41
configure.ac
@@ -1,5 +1,5 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(STK, 4.6.1, gary@music.mcgill.ca, stk)
|
||||
AC_INIT([STK],[5.0.0],[gary.scavone@mcgill.ca],[stk])
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
AC_CONFIG_SRCDIR(src/Stk.cpp)
|
||||
AC_CONFIG_FILES(Makefile src/Makefile projects/demo/Makefile projects/effects/Makefile projects/ragamatic/Makefile projects/examples/Makefile projects/examples/libMakefile projects/eguitar/Makefile)
|
||||
@@ -7,6 +7,10 @@ AC_CONFIG_FILES(Makefile src/Makefile projects/demo/Makefile projects/effects/Ma
|
||||
# Fill GXX with something before test.
|
||||
AC_SUBST( GXX, ["no"] )
|
||||
|
||||
# standards version
|
||||
m4_include([m4/ax_cxx_compile_stdcxx.m4])
|
||||
AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX(g++ CC c++ cxx)
|
||||
AC_PROG_RANLIB
|
||||
@@ -16,13 +20,34 @@ if [[ $AR = "no" ]] ; then
|
||||
fi
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
m4_warn([obsolete],
|
||||
[The preprocessor macro `STDC_HEADERS' is obsolete.
|
||||
Except in unusual embedded environments, you can safely include all
|
||||
ISO C90 headers unconditionally.])dnl
|
||||
# Autoupdate added the next two lines to ensure that your configure
|
||||
# script's behavior did not change. They are probably safe to remove.
|
||||
AC_CHECK_INCLUDES_DEFAULT
|
||||
AC_PROG_EGREP
|
||||
|
||||
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h termio.h unistd.h)
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
AC_HEADER_TIME
|
||||
m4_warn([obsolete],
|
||||
[Update your code to rely only on HAVE_SYS_TIME_H,
|
||||
then remove this warning and the obsolete code below it.
|
||||
All current systems provide time.h; it need not be checked for.
|
||||
Not all systems provide sys/time.h, but those that do, all allow
|
||||
you to include it and time.h simultaneously.])dnl
|
||||
AC_CHECK_HEADERS_ONCE([sys/time.h])
|
||||
# Obsolete code to be removed.
|
||||
if test $ac_cv_header_sys_time_h = yes; then
|
||||
AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both <sys/time.h>
|
||||
and <time.h>. This macro is obsolete.])
|
||||
fi
|
||||
# End of obsolete code.
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
AC_EGREP_CPP(yes,
|
||||
[#ifndef WORDS_BIGENDIAN
|
||||
@@ -120,7 +145,7 @@ case $host in
|
||||
*-apple*)
|
||||
AC_SUBST( sharedlib, ["libstk.dylib"] )
|
||||
AC_SUBST( sharedname, ["${basesharedname}.dylib"] )
|
||||
AC_SUBST( libflags, ["-dynamiclib -o ${basesharedname}.dylib"] )
|
||||
AC_SUBST( libflags, ["-dynamiclib -install_name \$(libdir)/${basesharedname}.dylib -o ${basesharedname}.dylib"] )
|
||||
esac
|
||||
|
||||
if test $realtime = yes; then
|
||||
@@ -158,6 +183,14 @@ api="$api -D__UNIX_JACK__"
|
||||
AC_MSG_RESULT(using ALSA)
|
||||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))])
|
||||
|
||||
# Look for PulseAudio flag
|
||||
AC_ARG_WITH(pulse, [ --with-pulse = choose PulseAudio support (linux only)])
|
||||
AS_IF([test "x$with_pulse" == "xyes"], [
|
||||
api="$api -D__LINUX_PULSE__"
|
||||
AC_MSG_RESULT(using PulseAudio)
|
||||
AC_CHECK_LIB(pulse, pa_proplist_gets, , AC_MSG_ERROR(PulseAudio support requires the libpulse library!))
|
||||
AC_CHECK_LIB(pulse-simple, pa_simple_new, , AC_MSG_ERROR(PulseAudio support requires the libpulse-simple library!))])
|
||||
|
||||
# Look for OSS flag
|
||||
AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (unixes only)])
|
||||
AS_IF([test "x$with_oss" == "xyes"], [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
|
||||
Please read the file README and INSTALL for more general STK information.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
|
||||
Please read the file README and INSTALL for more general STK information.
|
||||
|
||||
@@ -10,7 +10,7 @@ It is necessary to install the OS X developer kit (or the command line tools) in
|
||||
|
||||
Tcl/Tk on OS X:
|
||||
|
||||
I think that Tcl/Tk interpreter is now included in the Xcode package, since I haven't had to download it for several years now.
|
||||
The Tcl/Tk interpreter included in the Xcode package seems outdated. Try getting tcl-tk through HomeBrew for an updated version.
|
||||
|
||||
It appears that socket support in Tcl/Tk on OS X uses the Nagle algorithm, which produces poor response between changes made in the Tcl/Tk script and the resulting audio updates. Note that this is only a problem when using a socket connection from a Tcl/Tk script.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
|
||||
Please read the file README and INSTALL for more general STK information.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
|
||||
Please read the file README.md for more general STK information.
|
||||
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
|
||||
v.5.0.1 (10 August 2023)
|
||||
- see github site for complete details (github.com/thestk/stk)
|
||||
- cmake updates
|
||||
- fix for demo msvc project in Windows
|
||||
|
||||
v.5.0.0 (4 August 2023)
|
||||
- see github site for complete details (github.com/thestk/stk)
|
||||
- new filter design functionality in BiQuad (thanks to Navin Kumar!)
|
||||
- update to PitShift to use a single delay line
|
||||
- various updates for new RtAudio API
|
||||
|
||||
v.4.6.2 (17 November 2021)
|
||||
- see github site for complete details (github.com/thestk/stk)
|
||||
- bug fixes in LentPitShift and Granulate classes
|
||||
- Makefile fixes
|
||||
- miscellaneous bug fixes
|
||||
|
||||
v.4.6.1 (18 April 2019)
|
||||
- see github site for complete details (github.com/thestk/stk)
|
||||
|
||||
3105
doc/doxygen/Doxyfile
3105
doc/doxygen/Doxyfile
File diff suppressed because it is too large
Load Diff
@@ -38,19 +38,19 @@ STK compiles with realtime support on the following flavors of the Unix operatin
|
||||
<TR>
|
||||
<TD>Linux</TD>
|
||||
<TD>ALSA</TD>
|
||||
<TD>__LINUX_ALSA__, __LITTLE_ENDIAN__</TD>
|
||||
<TD>__LINUX_ALSA__, \__LITTLE_ENDIAN__</TD>
|
||||
<TD><TT>asound, pthread</TT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>Linux</TD>
|
||||
<TD>OSS (version 4.0 only, use ALSA for MIDI support)</TD>
|
||||
<TD>__LINUX_OSS__, __LINUX_ALSA__, __LITTLE_ENDIAN__</TD>
|
||||
<TD>__LINUX_OSS__, \__LINUX_ALSA__, \__LITTLE_ENDIAN__</TD>
|
||||
<TD><TT>asound, pthread</TT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>Linux and Macintosh OS-X</TD>
|
||||
<TD>Jack</TD>
|
||||
<TD>__UNIX_JACK__, __LITTLE_ENDIAN__</TD>
|
||||
<TD>__UNIX_JACK__, \__LITTLE_ENDIAN__</TD>
|
||||
<TD><TT>asound, pthread, jack</TT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
|
||||
@@ -1,10 +1,27 @@
|
||||
/*! \page download Download and Release Notes
|
||||
|
||||
\section down Download Version 4.6.1 (18 April 2019):
|
||||
\section down Download Version 5.0.1 (10 August 2023):
|
||||
|
||||
- <A HREF="http://ccrma.stanford.edu/software/stk/release/stk-4.6.1.tar.gz">Source distribution</A>
|
||||
- <A HREF="http://ccrma.stanford.edu/software/stk/release/stk-5.0.1.tar.gz">Source distribution</A>
|
||||
|
||||
\section notes Release Notes:
|
||||
\subsection v5dot0dot1 Version 5.0.1
|
||||
- see github site for complete details (github.com/thestk/stk)
|
||||
- cmake updates
|
||||
- fix for demo msvc project in Windows
|
||||
|
||||
\subsection v5dot0dot0 Version 5.0.0
|
||||
- see github site for complete details (github.com/thestk/stk)
|
||||
- new filter design functionality in BiQuad (thanks to Navin Kumar!)
|
||||
- update to PitShift to use a single delay line
|
||||
- various updates for new RtAudio API
|
||||
|
||||
\subsection v4dot6dot2 Version 4.6.2
|
||||
- see github site for complete details (github.com/thestk/stk)
|
||||
- bug fixes in LentPitShift and Granulate classes
|
||||
- Makefile fixes
|
||||
- miscellaneous bug fixes
|
||||
|
||||
\subsection v4dot6dot1 Version 4.6.1
|
||||
- see github site for complete details (github.com/thestk/stk)
|
||||
- various documentation updates
|
||||
|
||||
@@ -25,7 +25,7 @@ STK GitHub site: https://github.com/thestk/stk
|
||||
STK WWW site: http://ccrma.stanford.edu/software/stk/
|
||||
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
Copyright (c) 1995--2019 Perry R. Cook and Gary P. Scavone
|
||||
Copyright (c) 1995--2023 Perry R. Cook and Gary P. Scavone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<table>
|
||||
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
||||
<tr><td>©1995--2019 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
<tr><td>©1995--2023 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
</table>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -30,6 +30,7 @@ platforms and should work with any standard C++ compiler.
|
||||
- \ref links
|
||||
- \ref faq
|
||||
- \ref tutorial
|
||||
- <A href="http://github.com/thestk/stk">Stk on GitHub</A>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
STK: A ToolKit of Audio Synthesis Classes and Instruments in C++
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
|
||||
STK Classes - See the HTML documentation in the html directory for complete information.
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace stk {
|
||||
be non-negative. All time settings are in seconds and must be
|
||||
positive.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace stk {
|
||||
to \e keyOn and \e keyOff messages by ramping to
|
||||
1.0 on keyOn and to 0.0 on keyOff.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,10 +13,15 @@ namespace stk {
|
||||
Methods are provided for creating a resonance or notch in the
|
||||
frequency response while maintaining a constant filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
Formulae used calculate coefficients for lowpass, highpass,
|
||||
bandpass, bandreject and allpass are found on pg. 55 of
|
||||
Udo Zölzer's "DAFX - Digital Audio Effects" (2011 2nd ed).
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
const StkFloat RECIP_SQRT_2 = static_cast<StkFloat>( M_SQRT1_2 );
|
||||
class BiQuad : public Filter
|
||||
{
|
||||
public:
|
||||
@@ -74,12 +79,72 @@ public:
|
||||
*/
|
||||
void setNotch( StkFloat frequency, StkFloat radius );
|
||||
|
||||
//! Set the filter coefficients for a low-pass with cutoff frequency \e fc (in Hz) and Q-factor \e Q.
|
||||
/*!
|
||||
This method determines the filter coefficients corresponding to a
|
||||
low-pass filter with cutoff placed at \e fc, where sloping behaviour
|
||||
and resonance are determined by \e Q. The default value for \e Q is
|
||||
1/sqrt(2), resulting in a gradual attenuation of frequencies higher than
|
||||
\e fc without added resonance. Values greater than this will more
|
||||
aggressively attenuate frequencies above \e fc while also adding a
|
||||
resonance at \e fc. Values less than this will result in a more gradual
|
||||
attenuation of frequencies above \e fc, but will also attenuate
|
||||
frequencies below \e fc as well. Both \e fc and \e Q must be positive.
|
||||
*/
|
||||
void setLowPass( StkFloat fc, StkFloat Q=RECIP_SQRT_2 );
|
||||
|
||||
//! Set the filter coefficients for a high-pass with cutoff frequency \e fc (in Hz) and Q-factor \e Q.
|
||||
/*!
|
||||
This method determines the filter coefficients corresponding to a high-pass
|
||||
filter with cutoff placed at \e fc, where sloping behaviour and resonance
|
||||
are determined by \e Q. The default value for \e Q is 1/sqrt(2), resulting
|
||||
in a gradual attenuation of frequencies lower than \e fc without added
|
||||
resonance. Values greater than this will more aggressively attenuate
|
||||
frequencies below \e fc while also adding a resonance at \e fc. Values less
|
||||
than this will result in a more gradual attenuation of frequencies below
|
||||
\e fc, but will also attenuate frequencies above \e fc as well.
|
||||
Both \e fc and \e Q must be positive.
|
||||
*/
|
||||
void setHighPass( StkFloat fc, StkFloat Q=RECIP_SQRT_2 );
|
||||
|
||||
//! Set the filter coefficients for a band-pass centered at \e fc (in Hz) with Q-factor \e Q.
|
||||
/*!
|
||||
This method determines the filter coefficients corresponding to a band-pass
|
||||
filter with pass-band centered at \e fc, where band width and slope a
|
||||
determined by \e Q. Values for \e Q that are less than 1.0 will attenuate
|
||||
frequencies above and below \e fc more gradually, resulting in a convex
|
||||
slope and a wider band. Values for \e Q greater than 1.0 will attenuate
|
||||
frequencies above and below \e fc more aggressively, resulting in a
|
||||
concave slope and a narrower band. Both \e fc and \e Q must be positive.
|
||||
*/
|
||||
void setBandPass( StkFloat fc, StkFloat Q );
|
||||
|
||||
//! Set the filter coefficients for a band-reject centered at \e fc (in Hz) with Q-factor \e Q.
|
||||
/*!
|
||||
This method determines the filter coefficients corresponding to a
|
||||
band-reject filter with stop-band centered at \e fc, where band width
|
||||
and slope are determined by \e Q. Values for \e Q that are less than 1.0
|
||||
will yield a wider band with greater attenuation of \e fc. Values for \e Q
|
||||
greater than 1.0 will yield a narrower band with less attenuation of \e fc.
|
||||
Both \e fc and \e Q must be positive.
|
||||
*/
|
||||
void setBandReject( StkFloat fc, StkFloat Q );
|
||||
|
||||
//! Set the filter coefficients for an all-pass centered at \e fc (in Hz) with Q-factor \e Q.
|
||||
/*!
|
||||
This method determines the filter coefficients corresponding to
|
||||
an all-pass filter whose phase response crosses -pi radians at \e fc.
|
||||
High values for \e Q will result in a more instantaenous shift in phase
|
||||
response at \e fc. Lower values will result in a more gradual shift in
|
||||
phase response around \e fc. Both \e fc and \e Q must be positive.
|
||||
*/
|
||||
void setAllPass( StkFloat fc, StkFloat Q );
|
||||
|
||||
//! Sets the filter zeroes for equal resonance gain.
|
||||
/*!
|
||||
When using the filter as a resonator, zeroes places at z = 1, z
|
||||
= -1 will result in a constant gain at resonance of 1 / (1 - R),
|
||||
where R is the pole radius setting.
|
||||
|
||||
*/
|
||||
void setEqualGainZeroes( void );
|
||||
|
||||
@@ -114,6 +179,14 @@ public:
|
||||
protected:
|
||||
|
||||
virtual void sampleRateChanged( StkFloat newRate, StkFloat oldRate );
|
||||
|
||||
// Helper function to update the three intermediate values for the predefined filter types
|
||||
// along with the feedback filter coefficients. Performs the debug check for fc and Q-factor arguments.
|
||||
void setCommonFilterValues( StkFloat fc, StkFloat Q );
|
||||
|
||||
StkFloat K_;
|
||||
StkFloat kSqr_;
|
||||
StkFloat denom_;
|
||||
};
|
||||
|
||||
inline StkFloat BiQuad :: tick( StkFloat input )
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Volume = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace stk {
|
||||
- Register State = 1
|
||||
- Breath Pressure = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace stk {
|
||||
(1986). The output is an instantaneous
|
||||
reflection coefficient value.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace stk {
|
||||
- Frequency = 101
|
||||
- Volume = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
Contributions by Esteban Maestre, 2011.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Volume = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace stk {
|
||||
This class implements a chorus effect. It takes a monophonic
|
||||
input signal and produces a stereo output signal.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Breath Pressure = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace stk {
|
||||
A non-interpolating delay line is typically used in fixed
|
||||
delay-length applications, such as for reverberation.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace stk {
|
||||
minimum delay possible in this implementation is limited to a
|
||||
value of 0.5.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace stk {
|
||||
delay setting. The use of higher order Lagrange interpolators can
|
||||
typically improve (minimize) this attenuation characteristic.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace stk {
|
||||
of simultaneous voices) via a #define in the
|
||||
Drummer.h.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace stk {
|
||||
|
||||
This class implements an echo effect.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace stk {
|
||||
subclasses. It is general enough to support both monophonic and
|
||||
polyphonic input/output classes.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace stk {
|
||||
keyOff messages, ramping to a specified target (default = 1.0) on
|
||||
keyOn and to a specified target (default = 0.0) on keyOff.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace stk {
|
||||
the overloaded one that takes an StkFrames object for
|
||||
multi-channel and/or multi-frame data.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace stk {
|
||||
such variable is found, the sample rate is
|
||||
assumed to be 44100 Hz.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace stk {
|
||||
type, the data type will automatically be modified. Compressed
|
||||
data types are not supported.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace stk {
|
||||
See the FileRead class for a description of the supported audio
|
||||
file formats.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
Currently, FileWvOut is non-interpolating and the output rate is
|
||||
always Stk::sampleRate().
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace stk {
|
||||
filter subclasses. It is general enough to support both
|
||||
monophonic and polyphonic input/output classes.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace stk {
|
||||
This structure results in one extra multiply per computed sample,
|
||||
but allows easy control of the overall filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Breath Pressure = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
over time from one frequency setting to another. It provides
|
||||
methods for controlling the sweep rate and target frequency.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
implement tables or other types of input to output function
|
||||
mappings.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
generator sample-source subclasses. It is general enough to
|
||||
support both monophonic and polyphonic output classes.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace stk {
|
||||
Chris Rolfe and Damian Keller, though there are likely to be a
|
||||
number of differences in the actual implementation.
|
||||
|
||||
by Gary Scavone, 2005--2019.
|
||||
by Gary Scavone, 2005--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace stk {
|
||||
This structure results in one extra multiply per computed sample,
|
||||
but allows easy control of the overall filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
data type for the incoming stream is signed 16-bit integers,
|
||||
though any of the defined StkFormats are permissible.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
data type is signed 16-bit integers but any of the defined
|
||||
StkFormats are permissible.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace stk {
|
||||
This class provides a common interface for
|
||||
all STK instruments.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace stk {
|
||||
one-pole lowpass filters have been added inside
|
||||
the feedback comb filters.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace stk {
|
||||
Consult Fletcher and Rossing, Karjalainen,
|
||||
Cook, and others for more information.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ inline void LentPitShift::process()
|
||||
dpt[delay_] = dt[delay_] * delay_ / cumDt[delay_];
|
||||
|
||||
// Look for a minimum
|
||||
if ( dpt[delay_-1]-dpt[delay_-2] < 0 && dpt[delay_]-dpt[delay_-1] > 0 ) {
|
||||
if ( delay_ > 1 && dpt[delay_-1]-dpt[delay_-2] < 0 && dpt[delay_]-dpt[delay_-1] > 0 ) {
|
||||
// Check if the minimum is under the threshold
|
||||
if ( dpt[delay_-1] < threshold_ ){
|
||||
lastPeriod_ = delay_-1;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
- String Detuning = 1
|
||||
- Microphone Position = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace stk {
|
||||
This class is primarily for use in STK example programs but it is
|
||||
generic enough to work in many other contexts.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace stk {
|
||||
Tempo changes are internally tracked by the class and reflected in
|
||||
the values returned by the function getTickSeconds().
|
||||
|
||||
by Gary P. Scavone, 2003--2019.
|
||||
by Gary P. Scavone, 2003--2023.
|
||||
*/
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace stk {
|
||||
(non-sweeping BiQuad filters), where N is set
|
||||
during instantiation.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
- Two Fixed = 7
|
||||
- Clump = 8
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
//! Select a bar preset (currently modulo 9).
|
||||
void setPreset( int preset );
|
||||
|
||||
//! Set the modulation (vibrato) depth.
|
||||
//! Set the modulation (vibrato) depth (0.0 - 1.0).
|
||||
void setModulationDepth( StkFloat mDepth );
|
||||
|
||||
//! Perform the control change specified by \e number and \e value (0.0 - 128.0).
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace stk {
|
||||
modulations to give a nice, natural human
|
||||
modulation function.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Gain = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace stk {
|
||||
systems, the pthread library is used. Under
|
||||
Windows, critical sections are used.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace stk {
|
||||
another allpass in series, followed by two allpass filters in
|
||||
parallel with corresponding right and left outputs.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace stk {
|
||||
C rand() function. The quality of the rand()
|
||||
function varies from one OS to another.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
provided for setting the pole position along the real axis of the
|
||||
z-plane while maintaining a constant peak filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
provided for setting the zero position along the real axis of the
|
||||
z-plane while maintaining a constant filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace stk {
|
||||
allpass and comb delay filters. This class implements two series
|
||||
allpass units and two parallel comb filters.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
set of 32 static phoneme formant parameters
|
||||
and provide access to those values.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace stk {
|
||||
\brief STK simple pitch shifter effect class.
|
||||
|
||||
This class implements a simple pitch shifter
|
||||
using delay lines.
|
||||
using a delay line.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -61,7 +61,7 @@ class PitShift : public Effect
|
||||
|
||||
protected:
|
||||
|
||||
DelayL delayLine_[2];
|
||||
DelayL delayLine_;
|
||||
StkFloat delay_[2];
|
||||
StkFloat env_[2];
|
||||
StkFloat rate_;
|
||||
@@ -83,16 +83,15 @@ inline StkFloat PitShift :: tick( StkFloat input )
|
||||
while ( delay_[1] < 12 ) delay_[1] += delayLength_;
|
||||
|
||||
// Set the new delay line lengths.
|
||||
delayLine_[0].setDelay( delay_[0] );
|
||||
delayLine_[1].setDelay( delay_[1] );
|
||||
delayLine_.setDelay( delay_[0] );
|
||||
|
||||
// Calculate a triangular envelope.
|
||||
env_[1] = fabs( ( delay_[0] - halfLength_ + 12 ) * ( 1.0 / (halfLength_ + 12 ) ) );
|
||||
env_[0] = 1.0 - env_[1];
|
||||
|
||||
// Delay input and apply envelope.
|
||||
lastFrame_[0] = env_[0] * delayLine_[0].tick( input );
|
||||
lastFrame_[0] += env_[1] * delayLine_[1].tick( input );
|
||||
lastFrame_[0] = env_[1] * delayLine_.tapOut( delay_[1] );
|
||||
lastFrame_[0] = +env_[0] * delayLine_.tick( input );
|
||||
|
||||
// Compute effect mix and output.
|
||||
lastFrame_[0] *= effectMix_;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace stk {
|
||||
Stanford, bearing the names of Karplus and/or
|
||||
Strong.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace stk {
|
||||
coefficient. Another method is provided to create a DC blocking
|
||||
filter.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace stk {
|
||||
- Breath Pressure = 128
|
||||
|
||||
by Mathias Bredholt, McGill University.
|
||||
Formatted for STK by Gary Scavone, 2019.
|
||||
Formatted for STK by Gary Scavone, 2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace stk {
|
||||
Smith (1986), Hirschman, Cook, Scavone, and
|
||||
others for more information.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace stk {
|
||||
- Zero Radii = 1
|
||||
- Envelope Gain = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@
|
||||
RtMidi WWW site: http://www.music.mcgill.ca/~gary/rtmidi/
|
||||
|
||||
RtMidi: realtime MIDI i/o C++ classes
|
||||
Copyright (c) 2003-2019 Gary P. Scavone
|
||||
Copyright (c) 2003-2023 Gary P. Scavone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
@@ -58,13 +58,31 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define RTMIDI_VERSION "4.0.0"
|
||||
#define RTMIDI_VERSION_MAJOR 6
|
||||
#define RTMIDI_VERSION_MINOR 0
|
||||
#define RTMIDI_VERSION_PATCH 0
|
||||
#define RTMIDI_VERSION_BETA 0
|
||||
|
||||
#define RTMIDI_TOSTRING2(n) #n
|
||||
#define RTMIDI_TOSTRING(n) RTMIDI_TOSTRING2(n)
|
||||
|
||||
#if RTMIDI_VERSION_BETA > 0
|
||||
#define RTMIDI_VERSION RTMIDI_TOSTRING(RTMIDI_VERSION_MAJOR) \
|
||||
"." RTMIDI_TOSTRING(RTMIDI_VERSION_MINOR) \
|
||||
"." RTMIDI_TOSTRING(RTMIDI_VERSION_PATCH) \
|
||||
"beta" RTMIDI_TOSTRING(RTMIDI_VERSION_BETA)
|
||||
#else
|
||||
#define RTMIDI_VERSION RTMIDI_TOSTRING(RTMIDI_VERSION_MAJOR) \
|
||||
"." RTMIDI_TOSTRING(RTMIDI_VERSION_MINOR) \
|
||||
"." RTMIDI_TOSTRING(RTMIDI_VERSION_PATCH)
|
||||
#endif
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/*! \class RtMidiError
|
||||
\brief Exception handling class for RtMidi.
|
||||
@@ -85,12 +103,12 @@ class RTMIDI_DLL_PUBLIC RtMidiError : public std::exception
|
||||
UNSPECIFIED, /*!< The default, unspecified error type. */
|
||||
NO_DEVICES_FOUND, /*!< No devices found on system. */
|
||||
INVALID_DEVICE, /*!< An invalid device ID was specified. */
|
||||
MEMORY_ERROR, /*!< An error occured during memory allocation. */
|
||||
MEMORY_ERROR, /*!< An error occurred during memory allocation. */
|
||||
INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */
|
||||
INVALID_USE, /*!< The function was called incorrectly. */
|
||||
DRIVER_ERROR, /*!< A system driver error occured. */
|
||||
SYSTEM_ERROR, /*!< A system error occured. */
|
||||
THREAD_ERROR /*!< A thread error occured. */
|
||||
DRIVER_ERROR, /*!< A system driver error occurred. */
|
||||
SYSTEM_ERROR, /*!< A system error occurred. */
|
||||
THREAD_ERROR /*!< A thread error occurred. */
|
||||
};
|
||||
|
||||
//! The constructor.
|
||||
@@ -132,6 +150,8 @@ class MidiApi;
|
||||
class RTMIDI_DLL_PUBLIC RtMidi
|
||||
{
|
||||
public:
|
||||
|
||||
RtMidi(RtMidi&& other) noexcept;
|
||||
//! MIDI API specifier arguments.
|
||||
enum Api {
|
||||
UNSPECIFIED, /*!< Search for a working compiled API. */
|
||||
@@ -140,6 +160,9 @@ class RTMIDI_DLL_PUBLIC RtMidi
|
||||
UNIX_JACK, /*!< The JACK Low-Latency MIDI Server API. */
|
||||
WINDOWS_MM, /*!< The Microsoft Multimedia MIDI API. */
|
||||
RTMIDI_DUMMY, /*!< A compilable but non-functional API. */
|
||||
WEB_MIDI_API, /*!< W3C Web MIDI API. */
|
||||
WINDOWS_UWP, /*!< The Microsoft Universal Windows Platform MIDI API. */
|
||||
ANDROID_AMIDI, /*!< Native Android MIDI API. */
|
||||
NUM_APIS /*!< Number of values in this enum. */
|
||||
};
|
||||
|
||||
@@ -202,9 +225,9 @@ class RTMIDI_DLL_PUBLIC RtMidi
|
||||
*/
|
||||
virtual bool isPortOpen( void ) const = 0;
|
||||
|
||||
//! Set an error callback function to be invoked when an error has occured.
|
||||
//! Set an error callback function to be invoked when an error has occurred.
|
||||
/*!
|
||||
The callback function will be called whenever an error has occured. It is best
|
||||
The callback function will be called whenever an error has occurred. It is best
|
||||
to set the error callback function before opening a port.
|
||||
*/
|
||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 ) = 0;
|
||||
@@ -213,6 +236,10 @@ class RTMIDI_DLL_PUBLIC RtMidi
|
||||
RtMidi();
|
||||
virtual ~RtMidi();
|
||||
MidiApi *rtapi_;
|
||||
|
||||
/* Make the class non-copyable */
|
||||
RtMidi(RtMidi& other) = delete;
|
||||
RtMidi& operator=(RtMidi& other) = delete;
|
||||
};
|
||||
|
||||
/**********************************************************************/
|
||||
@@ -248,7 +275,6 @@ class RTMIDI_DLL_PUBLIC RtMidi
|
||||
class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
|
||||
{
|
||||
public:
|
||||
|
||||
//! User callback function type definition.
|
||||
typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData );
|
||||
|
||||
@@ -274,6 +300,8 @@ class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
|
||||
const std::string& clientName = "RtMidi Input Client",
|
||||
unsigned int queueSizeLimit = 100 );
|
||||
|
||||
RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
|
||||
|
||||
//! If a MIDI connection is still open, it will be closed by the destructor.
|
||||
~RtMidiIn ( void ) throw();
|
||||
|
||||
@@ -364,13 +392,26 @@ class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
|
||||
*/
|
||||
double getMessage( std::vector<unsigned char> *message );
|
||||
|
||||
//! Set an error callback function to be invoked when an error has occured.
|
||||
//! Set an error callback function to be invoked when an error has occurred.
|
||||
/*!
|
||||
The callback function will be called whenever an error has occured. It is best
|
||||
The callback function will be called whenever an error has occurred. It is best
|
||||
to set the error callback function before opening a port.
|
||||
*/
|
||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 );
|
||||
|
||||
//! Set maximum expected incoming message size.
|
||||
/*!
|
||||
For APIs that require manual buffer management, it can be useful to set the buffer
|
||||
size and buffer count when expecting to receive large SysEx messages. Note that
|
||||
currently this function has no effect when called after openPort(). The default
|
||||
buffer size is 1024 with a count of 4 buffers, which should be sufficient for most
|
||||
cases; as mentioned, this does not affect all API backends, since most either support
|
||||
dynamically scalable buffers or take care of buffer handling themselves. It is
|
||||
principally intended for users of the Windows MM backend who must support receiving
|
||||
especially large messages.
|
||||
*/
|
||||
virtual void setBufferSize( unsigned int size, unsigned int count );
|
||||
|
||||
protected:
|
||||
void openMidiApi( RtMidi::Api api, const std::string &clientName, unsigned int queueSizeLimit );
|
||||
};
|
||||
@@ -403,6 +444,8 @@ class RTMIDI_DLL_PUBLIC RtMidiOut : public RtMidi
|
||||
RtMidiOut( RtMidi::Api api=UNSPECIFIED,
|
||||
const std::string& clientName = "RtMidi Output Client" );
|
||||
|
||||
RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
|
||||
|
||||
//! The destructor closes any open MIDI connections.
|
||||
~RtMidiOut( void ) throw();
|
||||
|
||||
@@ -467,9 +510,9 @@ class RTMIDI_DLL_PUBLIC RtMidiOut : public RtMidi
|
||||
*/
|
||||
void sendMessage( const unsigned char *message, size_t size );
|
||||
|
||||
//! Set an error callback function to be invoked when an error has occured.
|
||||
//! Set an error callback function to be invoked when an error has occurred.
|
||||
/*!
|
||||
The callback function will be called whenever an error has occured. It is best
|
||||
The callback function will be called whenever an error has occurred. It is best
|
||||
to set the error callback function before opening a port.
|
||||
*/
|
||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 );
|
||||
@@ -523,6 +566,7 @@ protected:
|
||||
RtMidiErrorCallback errorCallback_;
|
||||
bool firstErrorOccurred_;
|
||||
void *errorCallbackUserData_;
|
||||
|
||||
};
|
||||
|
||||
class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
|
||||
@@ -534,7 +578,8 @@ class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
|
||||
void setCallback( RtMidiIn::RtMidiCallback callback, void *userData );
|
||||
void cancelCallback( void );
|
||||
virtual void ignoreTypes( bool midiSysex, bool midiTime, bool midiSense );
|
||||
double getMessage( std::vector<unsigned char> *message );
|
||||
virtual double getMessage( std::vector<unsigned char> *message );
|
||||
virtual void setBufferSize( unsigned int size, unsigned int count );
|
||||
|
||||
// A MIDI structure used internally by the class to store incoming
|
||||
// messages. Each message represents one and only one MIDI message.
|
||||
@@ -576,11 +621,13 @@ class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
|
||||
RtMidiIn::RtMidiCallback userCallback;
|
||||
void *userData;
|
||||
bool continueSysex;
|
||||
unsigned int bufferSize;
|
||||
unsigned int bufferCount;
|
||||
|
||||
// Default constructor.
|
||||
RtMidiInData()
|
||||
: ignoreFlags(7), doInput(false), firstMessage(true), apiData(0), usingCallback(false),
|
||||
userCallback(0), userData(0), continueSysex(false) {}
|
||||
userCallback(0), userData(0), continueSysex(false), bufferSize(1024), bufferCount(4) {}
|
||||
};
|
||||
|
||||
protected:
|
||||
@@ -614,6 +661,7 @@ inline std::string RtMidiIn :: getPortName( unsigned int portNumber ) { return r
|
||||
inline void RtMidiIn :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ) { static_cast<MidiInApi *>(rtapi_)->ignoreTypes( midiSysex, midiTime, midiSense ); }
|
||||
inline double RtMidiIn :: getMessage( std::vector<unsigned char> *message ) { return static_cast<MidiInApi *>(rtapi_)->getMessage( message ); }
|
||||
inline void RtMidiIn :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); }
|
||||
inline void RtMidiIn :: setBufferSize( unsigned int size, unsigned int count ) { static_cast<MidiInApi *>(rtapi_)->setBufferSize(size, count); }
|
||||
|
||||
inline RtMidi::Api RtMidiOut :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
|
||||
inline void RtMidiOut :: openPort( unsigned int portNumber, const std::string &portName ) { rtapi_->openPort( portNumber, portName ); }
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace stk {
|
||||
that takes an StkFrames object for multi-channel and/or
|
||||
multi-frame data.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -33,14 +33,14 @@ class RtWvIn : public WvIn
|
||||
public:
|
||||
//! Default constructor.
|
||||
/*!
|
||||
The default \e device argument value (zero) will select the
|
||||
The default \e deviceIndex argument value (zero) will select the
|
||||
default input device on your system. The first device enumerated
|
||||
by the underlying audio API is specified with a value of one. The
|
||||
default buffer size of RT_BUFFER_SIZE is defined in Stk.h. An
|
||||
StkError will be thrown if an error occurs duing instantiation.
|
||||
*/
|
||||
RtWvIn( unsigned int nChannels = 1, StkFloat sampleRate = Stk::sampleRate(),
|
||||
int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 20 );
|
||||
int deviceIndex = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 20 );
|
||||
|
||||
//! Class destructor.
|
||||
~RtWvIn();
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace stk {
|
||||
that takes a reference to an StkFrames object for multi-channel
|
||||
and/or multi-frame data.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -33,14 +33,14 @@ class RtWvOut : public WvOut
|
||||
|
||||
//! Default constructor.
|
||||
/*!
|
||||
The default \e device argument value (zero) will select the
|
||||
The default \e deviceIndex argument value (zero) will select the
|
||||
default output device on your system. The first device enumerated
|
||||
by the underlying audio API is specified with a value of one. The
|
||||
default buffer size of RT_BUFFER_SIZE is defined in Stk.h. An
|
||||
StkError will be thrown if an error occurs duing instantiation.
|
||||
*/
|
||||
RtWvOut( unsigned int nChannels = 1, StkFloat sampleRate = Stk::sampleRate(),
|
||||
int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 20 );
|
||||
int deviceIndex = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 20 );
|
||||
|
||||
//! Class destructor.
|
||||
~RtWvOut();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
where <name> is the string used in the SKINI stream.
|
||||
|
||||
by Perry R. Cook, 1995--2019.
|
||||
by Perry R. Cook, 1995--2023.
|
||||
*/
|
||||
/*********************************************************/
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace stk {
|
||||
This instrument provides an ADSR envelope, a one-pole filter, and
|
||||
structures for an arbitrary number of attack and looped files.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Breath Pressure = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace stk {
|
||||
- Water Drops = 21
|
||||
- Tuned Bamboo Chimes = 22
|
||||
|
||||
by Perry R. Cook with updates by Gary Scavone, 1995--2019.
|
||||
by Perry R. Cook with updates by Gary Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
- Envelope Rate = 11
|
||||
- Gain = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace stk {
|
||||
|
||||
The "table" length, set in SineWave.h, is 2048 samples by default.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace stk {
|
||||
Within STK, it is used as an excitation source for other
|
||||
instruments.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
Stanford, bearing the names of Karplus and/or
|
||||
Strong.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
|
||||
\sa \ref skini
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
number of static functions for use with external socket
|
||||
descriptors.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
This class implements a spherical ball with
|
||||
radius, mass, position, and velocity parameters.
|
||||
|
||||
by Perry R. Cook, 1995--2019.
|
||||
by Perry R. Cook, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace stk {
|
||||
- String Sustain = 11
|
||||
- String Stretch = 1
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
//#include <cstdlib>
|
||||
|
||||
/*! \namespace stk
|
||||
@@ -40,7 +41,7 @@ namespace stk {
|
||||
STK WWW site: http://ccrma.stanford.edu/software/stk/
|
||||
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
Copyright (c) 1995--2019 Perry R. Cook and Gary P. Scavone
|
||||
Copyright (c) 1995--2023 Perry R. Cook and Gary P. Scavone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
@@ -82,7 +83,7 @@ typedef double StkFloat;
|
||||
be sub-classes to take care of more specific error conditions ... or
|
||||
not.
|
||||
*/
|
||||
class StkError
|
||||
class StkError : public std::exception
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
@@ -110,10 +111,10 @@ protected:
|
||||
public:
|
||||
//! The constructor.
|
||||
StkError(const std::string& message, Type type = StkError::UNSPECIFIED)
|
||||
: message_(message), type_(type) {}
|
||||
: std::exception(), message_(message), type_(type) {}
|
||||
|
||||
//! The destructor.
|
||||
virtual ~StkError(void) {};
|
||||
virtual ~StkError(void) throw() {};
|
||||
|
||||
//! Prints thrown error message to stderr.
|
||||
virtual void printMessage(void) { std::cerr << '\n' << message_ << "\n\n"; }
|
||||
@@ -126,6 +127,8 @@ public:
|
||||
|
||||
//! Returns the thrown error message as a C string.
|
||||
virtual const char *getMessageCString(void) { return message_.c_str(); }
|
||||
|
||||
virtual const char *what(void) const throw() { return message_.c_str(); }
|
||||
};
|
||||
|
||||
|
||||
@@ -268,7 +271,7 @@ protected:
|
||||
Possible future improvements in this class could include functions
|
||||
to convert to and return other data types.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -283,13 +286,13 @@ public:
|
||||
StkFrames( const StkFloat& value, unsigned int nFrames, unsigned int nChannels );
|
||||
|
||||
//! The destructor.
|
||||
~StkFrames();
|
||||
virtual ~StkFrames();
|
||||
|
||||
// A copy constructor.
|
||||
StkFrames( const StkFrames& f );
|
||||
|
||||
// Assignment operator that returns a reference to self.
|
||||
StkFrames& operator= ( const StkFrames& f );
|
||||
virtual StkFrames& operator= ( const StkFrames& f );
|
||||
|
||||
//! Subscript operator that returns a reference to element \c n of self.
|
||||
/*!
|
||||
@@ -321,7 +324,7 @@ public:
|
||||
self. No range checking is performed unless _STK_DEBUG_ is
|
||||
defined.
|
||||
*/
|
||||
void operator+= ( StkFrames& f );
|
||||
StkFrames& operator+= ( StkFrames& f );
|
||||
|
||||
//! Assignment by product operator into self.
|
||||
/*!
|
||||
@@ -329,7 +332,16 @@ public:
|
||||
self. No range checking is performed unless _STK_DEBUG_ is
|
||||
defined.
|
||||
*/
|
||||
void operator*= ( StkFrames& f );
|
||||
StkFrames& operator*= ( StkFrames& f );
|
||||
|
||||
//! Scaling operator (StkFrame * StkFloat).
|
||||
StkFrames operator* ( StkFloat v ) const;
|
||||
|
||||
//! Scaling operator (StkFloat * StkFrame)
|
||||
friend StkFrames operator*(StkFloat v, const StkFrames& f);
|
||||
|
||||
//! Scaling operator (inline).
|
||||
StkFrames& operator*= ( StkFloat v );
|
||||
|
||||
//! Channel / frame subscript operator that returns a reference.
|
||||
/*!
|
||||
@@ -372,7 +384,7 @@ public:
|
||||
size. Further, no new memory is allocated when the new size is
|
||||
smaller or equal to a previously allocated size.
|
||||
*/
|
||||
void resize( size_t nFrames, unsigned int nChannels = 1 );
|
||||
virtual void resize( size_t nFrames, unsigned int nChannels = 1 );
|
||||
|
||||
//! Resize self to represent the specified number of channels and frames and perform element initialization.
|
||||
/*!
|
||||
@@ -382,7 +394,7 @@ public:
|
||||
size. Further, no new memory is allocated when the new size is
|
||||
smaller or equal to a previously allocated size.
|
||||
*/
|
||||
void resize( size_t nFrames, unsigned int nChannels, StkFloat value );
|
||||
virtual void resize( size_t nFrames, unsigned int nChannels, StkFloat value );
|
||||
|
||||
//! Retrieves a single channel
|
||||
/*!
|
||||
@@ -420,7 +432,7 @@ public:
|
||||
*/
|
||||
StkFloat dataRate( void ) const { return dataRate_; };
|
||||
|
||||
private:
|
||||
protected:
|
||||
|
||||
StkFloat *data_;
|
||||
StkFloat dataRate_;
|
||||
@@ -508,7 +520,7 @@ inline StkFrames StkFrames::operator+(const StkFrames &f) const
|
||||
return sum;
|
||||
}
|
||||
|
||||
inline void StkFrames :: operator+= ( StkFrames& f )
|
||||
inline StkFrames& StkFrames :: operator+= ( StkFrames& f )
|
||||
{
|
||||
#if defined(_STK_DEBUG_)
|
||||
if ( f.frames() != nFrames_ || f.channels() != nChannels_ ) {
|
||||
@@ -522,9 +534,10 @@ inline void StkFrames :: operator+= ( StkFrames& f )
|
||||
StkFloat *dptr = data_;
|
||||
for ( unsigned int i=0; i<size_; i++ )
|
||||
*dptr++ += *fptr++;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline void StkFrames :: operator*= ( StkFrames& f )
|
||||
inline StkFrames& StkFrames :: operator*= ( StkFrames& f )
|
||||
{
|
||||
#if defined(_STK_DEBUG_)
|
||||
if ( f.frames() != nFrames_ || f.channels() != nChannels_ ) {
|
||||
@@ -538,8 +551,40 @@ inline void StkFrames :: operator*= ( StkFrames& f )
|
||||
StkFloat *dptr = data_;
|
||||
for ( unsigned int i=0; i<size_; i++ )
|
||||
*dptr++ *= *fptr++;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline StkFrames StkFrames::operator*(StkFloat v) const
|
||||
{
|
||||
StkFrames res((unsigned int)nFrames_, nChannels_);
|
||||
StkFloat *resPtr = &res[0];
|
||||
const StkFloat *dPtr = data_;
|
||||
for (unsigned int i = 0; i < size_; i++) {
|
||||
*resPtr++ = v * *dPtr++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
inline StkFrames operator*(StkFloat v, const StkFrames& f)
|
||||
{
|
||||
StkFrames res((unsigned int)f.nFrames_, f.nChannels_);
|
||||
StkFloat *resPtr = &res[0];
|
||||
StkFloat *dPtr = f.data_;
|
||||
for (unsigned int i = 0; i < f.size_; i++) {
|
||||
*resPtr++ = v * *dPtr++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
inline StkFrames& StkFrames :: operator*= ( StkFloat v )
|
||||
{
|
||||
StkFloat *dptr = data_;
|
||||
for ( unsigned int i=0; i<size_; i++ )
|
||||
*dptr++ *= v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// Here are a few other useful typedefs.
|
||||
typedef unsigned short UINT16;
|
||||
typedef unsigned int UINT32;
|
||||
@@ -577,7 +622,7 @@ const StkFloat ONE_OVER_128 = 0.0078125;
|
||||
#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) || defined(__WINDOWS_MM__)
|
||||
#define __OS_WINDOWS__
|
||||
#define __STK_REALTIME__
|
||||
#elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__) || defined(__UNIX_JACK__)
|
||||
#elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__) || defined(__UNIX_JACK__) || defined(__LINUX_PULSE__)
|
||||
#define __OS_LINUX__
|
||||
#define __STK_REALTIME__
|
||||
#elif defined(__IRIX_AL__)
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace stk {
|
||||
A non-interpolating delay line is typically used in fixed
|
||||
delay-length applications, such as for reverberation.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace stk {
|
||||
less than or equal to zero indicate a closed
|
||||
or lost connection or the occurence of an error.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2023.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user