mirror of
https://github.com/thestk/stk
synced 2026-01-20 07:51:53 +00:00
Compare commits
25 Commits
revert-110
...
4.6.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3ce5f4d04 | ||
|
|
d4750edc66 | ||
|
|
6a6a9cdfbe | ||
|
|
dec667bab5 | ||
|
|
1fd900263b | ||
|
|
67d573b169 | ||
|
|
500d2972f9 | ||
|
|
ee7a1a31f8 | ||
|
|
feb123c9b8 | ||
|
|
509c6cf9e9 | ||
|
|
e5454b85c7 | ||
|
|
f0a22c463d | ||
|
|
ba6ea9f5db | ||
|
|
f00e38611c | ||
|
|
367893bf50 | ||
|
|
a6266131cb | ||
|
|
1fec6e0157 | ||
|
|
d308c8aeb7 | ||
|
|
deddcbaa3e | ||
|
|
76127ffc6c | ||
|
|
d77b093a9d | ||
|
|
c7d37545d3 | ||
|
|
15a1359671 | ||
|
|
51f9676229 | ||
|
|
700ff2c459 |
138
CMakeLists.txt
Normal file
138
CMakeLists.txt
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.1) ##TODO: which version is better
|
||||||
|
|
||||||
|
project(STK VERSION 4.6.1)
|
||||||
|
|
||||||
|
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})
|
||||||
|
|
||||||
|
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__")
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
||||||
|
#========================================#
|
||||||
|
#========== Build the Library ===========#
|
||||||
|
#========================================#
|
||||||
|
if(BUILD_STATIC)
|
||||||
|
add_library(stk STATIC ${STK_SRC} )
|
||||||
|
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
|
||||||
|
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()
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# The Synthesis ToolKit in C++ (STK)
|
# 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-2021.
|
||||||
|
|
||||||
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.
|
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.
|
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.
|
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)
|
The Synthesis ToolKit in C++ (STK)
|
||||||
|
|
||||||
Copyright (c) 1995-2019 Perry R. Cook and Gary P. Scavone
|
Copyright (c) 1995-2021 Perry R. Cook and Gary P. Scavone
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# The Synthesis ToolKit in C++ (STK)
|
# 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--2021.
|
||||||
|
|
||||||
This distribution of the Synthesis ToolKit in C++ (STK) contains the following:
|
This distribution of the Synthesis ToolKit in C++ (STK) contains the following:
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
Pod::Spec.new do |spec|
|
Pod::Spec.new do |spec|
|
||||||
spec.name = 'STK'
|
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.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.homepage = 'https://ccrma.stanford.edu/software/stk/'
|
||||||
spec.source = { :git => 'https://github.com/thestk/stk.git', :tag => spec.version }
|
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)
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
AC_INIT(STK, 4.6.1, gary@music.mcgill.ca, stk)
|
AC_INIT(STK, 4.6.2, gary.scavone@mcgill.ca, stk)
|
||||||
AC_CONFIG_AUX_DIR(config)
|
AC_CONFIG_AUX_DIR(config)
|
||||||
AC_CONFIG_SRCDIR(src/Stk.cpp)
|
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)
|
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.
|
# Fill GXX with something before test.
|
||||||
AC_SUBST( GXX, ["no"] )
|
AC_SUBST( GXX, ["no"] )
|
||||||
|
|
||||||
|
# standards version
|
||||||
|
m4_include([m4/ax_cxx_compile_stdcxx.m4])
|
||||||
|
AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AC_PROG_CXX(g++ CC c++ cxx)
|
AC_PROG_CXX(g++ CC c++ cxx)
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
@@ -120,7 +124,7 @@ case $host in
|
|||||||
*-apple*)
|
*-apple*)
|
||||||
AC_SUBST( sharedlib, ["libstk.dylib"] )
|
AC_SUBST( sharedlib, ["libstk.dylib"] )
|
||||||
AC_SUBST( sharedname, ["${basesharedname}.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
|
esac
|
||||||
|
|
||||||
if test $realtime = yes; then
|
if test $realtime = yes; then
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The Synthesis ToolKit in C++ (STK)
|
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--2021.
|
||||||
|
|
||||||
Please read the file README and INSTALL for more general STK information.
|
Please read the file README and INSTALL for more general STK information.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The Synthesis ToolKit in C++ (STK)
|
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--2021.
|
||||||
|
|
||||||
Please read the file README and INSTALL for more general STK information.
|
Please read the file README and INSTALL for more general STK information.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The Synthesis ToolKit in C++ (STK)
|
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--2021.
|
||||||
|
|
||||||
Please read the file README and INSTALL for more general STK information.
|
Please read the file README and INSTALL for more general STK information.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The Synthesis ToolKit in C++ (STK)
|
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--2021.
|
||||||
|
|
||||||
Please read the file README.md for more general STK information.
|
Please read the file README.md for more general STK information.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
The Synthesis ToolKit in C++ (STK)
|
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--2021.
|
||||||
|
|
||||||
|
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)
|
v.4.6.1 (18 April 2019)
|
||||||
- see github site for complete details (github.com/thestk/stk)
|
- see github site for complete details (github.com/thestk/stk)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ PROJECT_NAME = STK
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 4.6.1
|
PROJECT_NUMBER = 4.6.2
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewer
|
# for a project that appears at the top of each page and should give viewer
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
/*! \page download Download and Release Notes
|
/*! \page download Download and Release Notes
|
||||||
|
|
||||||
\section down Download Version 4.6.1 (18 April 2019):
|
\section down Download Version 4.6.2 (17 November 2021):
|
||||||
|
|
||||||
- <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-4.6.2.tar.gz">Source distribution</A>
|
||||||
|
|
||||||
\section notes Release Notes:
|
\section notes Release Notes:
|
||||||
|
\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
|
\subsection v4dot6dot1 Version 4.6.1
|
||||||
- see github site for complete details (github.com/thestk/stk)
|
- see github site for complete details (github.com/thestk/stk)
|
||||||
- various documentation updates
|
- various documentation updates
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ STK GitHub site: https://github.com/thestk/stk
|
|||||||
STK WWW site: http://ccrma.stanford.edu/software/stk/
|
STK WWW site: http://ccrma.stanford.edu/software/stk/
|
||||||
|
|
||||||
The Synthesis ToolKit in C++ (STK)
|
The Synthesis ToolKit in C++ (STK)
|
||||||
Copyright (c) 1995--2019 Perry R. Cook and Gary P. Scavone
|
Copyright (c) 1995--2021 Perry R. Cook and Gary P. Scavone
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
<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--2021 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</BODY>
|
</BODY>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
STK: A ToolKit of Audio Synthesis Classes and Instruments in C++
|
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--2021.
|
||||||
|
|
||||||
STK Classes - See the HTML documentation in the html directory for complete information.
|
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
|
be non-negative. All time settings are in seconds and must be
|
||||||
positive.
|
positive.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace stk {
|
|||||||
to \e keyOn and \e keyOff messages by ramping to
|
to \e keyOn and \e keyOff messages by ramping to
|
||||||
1.0 on keyOn and to 0.0 on keyOff.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace stk {
|
|||||||
type who should worry about this (making
|
type who should worry about this (making
|
||||||
money) worry away.
|
money) worry away.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace stk {
|
|||||||
Methods are provided for creating a resonance or notch in the
|
Methods are provided for creating a resonance or notch in the
|
||||||
frequency response while maintaining a constant filter gain.
|
frequency response 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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace stk {
|
|||||||
- Vibrato Gain = 1
|
- Vibrato Gain = 1
|
||||||
- Volume = 128
|
- Volume = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace stk {
|
|||||||
- Register State = 1
|
- Register State = 1
|
||||||
- Breath Pressure = 128
|
- Breath Pressure = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace stk {
|
|||||||
(1986). The output is an instantaneous
|
(1986). The output is an instantaneous
|
||||||
reflection coefficient value.
|
reflection coefficient value.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace stk {
|
|||||||
- Frequency = 101
|
- Frequency = 101
|
||||||
- Volume = 128
|
- Volume = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
Contributions by Esteban Maestre, 2011.
|
Contributions by Esteban Maestre, 2011.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace stk {
|
|||||||
- Vibrato Gain = 1
|
- Vibrato Gain = 1
|
||||||
- Volume = 128
|
- Volume = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace stk {
|
|||||||
This class implements a chorus effect. It takes a monophonic
|
This class implements a chorus effect. It takes a monophonic
|
||||||
input signal and produces a stereo output signal.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace stk {
|
|||||||
- Vibrato Gain = 1
|
- Vibrato Gain = 1
|
||||||
- Breath Pressure = 128
|
- Breath Pressure = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace stk {
|
|||||||
A non-interpolating delay line is typically used in fixed
|
A non-interpolating delay line is typically used in fixed
|
||||||
delay-length applications, such as for reverberation.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace stk {
|
|||||||
minimum delay possible in this implementation is limited to a
|
minimum delay possible in this implementation is limited to a
|
||||||
value of 0.5.
|
value of 0.5.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace stk {
|
|||||||
delay setting. The use of higher order Lagrange interpolators can
|
delay setting. The use of higher order Lagrange interpolators can
|
||||||
typically improve (minimize) this attenuation characteristic.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace stk {
|
|||||||
of simultaneous voices) via a #define in the
|
of simultaneous voices) via a #define in the
|
||||||
Drummer.h.
|
Drummer.h.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace stk {
|
|||||||
|
|
||||||
This class implements an echo effect.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace stk {
|
|||||||
subclasses. It is general enough to support both monophonic and
|
subclasses. It is general enough to support both monophonic and
|
||||||
polyphonic input/output classes.
|
polyphonic input/output classes.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace stk {
|
|||||||
keyOff messages, ramping to a specified target (default = 1.0) on
|
keyOff messages, ramping to a specified target (default = 1.0) on
|
||||||
keyOn and to a specified target (default = 0.0) on keyOff.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace stk {
|
|||||||
type who should worry about this (making
|
type who should worry about this (making
|
||||||
money) worry away.
|
money) worry away.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace stk {
|
|||||||
type who should worry about this (making
|
type who should worry about this (making
|
||||||
money) worry away.
|
money) worry away.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace stk {
|
|||||||
the overloaded one that takes an StkFrames object for
|
the overloaded one that takes an StkFrames object for
|
||||||
multi-channel and/or multi-frame data.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace stk {
|
|||||||
such variable is found, the sample rate is
|
such variable is found, the sample rate is
|
||||||
assumed to be 44100 Hz.
|
assumed to be 44100 Hz.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace stk {
|
|||||||
type, the data type will automatically be modified. Compressed
|
type, the data type will automatically be modified. Compressed
|
||||||
data types are not supported.
|
data types are not supported.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace stk {
|
|||||||
See the FileRead class for a description of the supported audio
|
See the FileRead class for a description of the supported audio
|
||||||
file formats.
|
file formats.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace stk {
|
|||||||
Currently, FileWvOut is non-interpolating and the output rate is
|
Currently, FileWvOut is non-interpolating and the output rate is
|
||||||
always Stk::sampleRate().
|
always Stk::sampleRate().
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace stk {
|
|||||||
filter subclasses. It is general enough to support both
|
filter subclasses. It is general enough to support both
|
||||||
monophonic and polyphonic input/output classes.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace stk {
|
|||||||
This structure results in one extra multiply per computed sample,
|
This structure results in one extra multiply per computed sample,
|
||||||
but allows easy control of the overall filter gain.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace stk {
|
|||||||
- Vibrato Gain = 1
|
- Vibrato Gain = 1
|
||||||
- Breath Pressure = 128
|
- Breath Pressure = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace stk {
|
|||||||
over time from one frequency setting to another. It provides
|
over time from one frequency setting to another. It provides
|
||||||
methods for controlling the sweep rate and target frequency.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace stk {
|
|||||||
implement tables or other types of input to output function
|
implement tables or other types of input to output function
|
||||||
mappings.
|
mappings.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace stk {
|
|||||||
generator sample-source subclasses. It is general enough to
|
generator sample-source subclasses. It is general enough to
|
||||||
support both monophonic and polyphonic output classes.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace stk {
|
|||||||
Chris Rolfe and Damian Keller, though there are likely to be a
|
Chris Rolfe and Damian Keller, though there are likely to be a
|
||||||
number of differences in the actual implementation.
|
number of differences in the actual implementation.
|
||||||
|
|
||||||
by Gary Scavone, 2005--2019.
|
by Gary Scavone, 2005--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace stk {
|
|||||||
type who should worry about this (making
|
type who should worry about this (making
|
||||||
money) worry away.
|
money) worry away.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace stk {
|
|||||||
This structure results in one extra multiply per computed sample,
|
This structure results in one extra multiply per computed sample,
|
||||||
but allows easy control of the overall filter gain.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace stk {
|
|||||||
data type for the incoming stream is signed 16-bit integers,
|
data type for the incoming stream is signed 16-bit integers,
|
||||||
though any of the defined StkFormats are permissible.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace stk {
|
|||||||
data type is signed 16-bit integers but any of the defined
|
data type is signed 16-bit integers but any of the defined
|
||||||
StkFormats are permissible.
|
StkFormats are permissible.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace stk {
|
|||||||
This class provides a common interface for
|
This class provides a common interface for
|
||||||
all STK instruments.
|
all STK instruments.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace stk {
|
|||||||
one-pole lowpass filters have been added inside
|
one-pole lowpass filters have been added inside
|
||||||
the feedback comb filters.
|
the feedback comb filters.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace stk {
|
|||||||
Consult Fletcher and Rossing, Karjalainen,
|
Consult Fletcher and Rossing, Karjalainen,
|
||||||
Cook, and others for more information.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ inline void LentPitShift::process()
|
|||||||
dpt[delay_] = dt[delay_] * delay_ / cumDt[delay_];
|
dpt[delay_] = dt[delay_] * delay_ / cumDt[delay_];
|
||||||
|
|
||||||
// Look for a minimum
|
// 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
|
// Check if the minimum is under the threshold
|
||||||
if ( dpt[delay_-1] < threshold_ ){
|
if ( dpt[delay_-1] < threshold_ ){
|
||||||
lastPeriod_ = delay_-1;
|
lastPeriod_ = delay_-1;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace stk {
|
|||||||
- String Detuning = 1
|
- String Detuning = 1
|
||||||
- Microphone Position = 128
|
- Microphone Position = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace stk {
|
|||||||
This class is primarily for use in STK example programs but it is
|
This class is primarily for use in STK example programs but it is
|
||||||
generic enough to work in many other contexts.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace stk {
|
|||||||
Tempo changes are internally tracked by the class and reflected in
|
Tempo changes are internally tracked by the class and reflected in
|
||||||
the values returned by the function getTickSeconds().
|
the values returned by the function getTickSeconds().
|
||||||
|
|
||||||
by Gary P. Scavone, 2003--2019.
|
by Gary P. Scavone, 2003--2021.
|
||||||
*/
|
*/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace stk {
|
|||||||
(non-sweeping BiQuad filters), where N is set
|
(non-sweeping BiQuad filters), where N is set
|
||||||
during instantiation.
|
during instantiation.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace stk {
|
|||||||
- Two Fixed = 7
|
- Two Fixed = 7
|
||||||
- Clump = 8
|
- Clump = 8
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace stk {
|
|||||||
modulations to give a nice, natural human
|
modulations to give a nice, natural human
|
||||||
modulation function.
|
modulation function.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace stk {
|
|||||||
- Vibrato Gain = 1
|
- Vibrato Gain = 1
|
||||||
- Gain = 128
|
- Gain = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace stk {
|
|||||||
systems, the pthread library is used. Under
|
systems, the pthread library is used. Under
|
||||||
Windows, critical sections are used.
|
Windows, critical sections are used.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace stk {
|
|||||||
another allpass in series, followed by two allpass filters in
|
another allpass in series, followed by two allpass filters in
|
||||||
parallel with corresponding right and left outputs.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace stk {
|
|||||||
C rand() function. The quality of the rand()
|
C rand() function. The quality of the rand()
|
||||||
function varies from one OS to another.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace stk {
|
|||||||
provided for setting the pole position along the real axis of the
|
provided for setting the pole position along the real axis of the
|
||||||
z-plane while maintaining a constant peak filter gain.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace stk {
|
|||||||
provided for setting the zero position along the real axis of the
|
provided for setting the zero position along the real axis of the
|
||||||
z-plane while maintaining a constant filter gain.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace stk {
|
|||||||
allpass and comb delay filters. This class implements two series
|
allpass and comb delay filters. This class implements two series
|
||||||
allpass units and two parallel comb filters.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace stk {
|
|||||||
type who should worry about this (making
|
type who should worry about this (making
|
||||||
money) worry away.
|
money) worry away.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace stk {
|
|||||||
set of 32 static phoneme formant parameters
|
set of 32 static phoneme formant parameters
|
||||||
and provide access to those values.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace stk {
|
|||||||
This class implements a simple pitch shifter
|
This class implements a simple pitch shifter
|
||||||
using delay lines.
|
using delay lines.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace stk {
|
|||||||
Stanford, bearing the names of Karplus and/or
|
Stanford, bearing the names of Karplus and/or
|
||||||
Strong.
|
Strong.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace stk {
|
|||||||
coefficient. Another method is provided to create a DC blocking
|
coefficient. Another method is provided to create a DC blocking
|
||||||
filter.
|
filter.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace stk {
|
|||||||
- Breath Pressure = 128
|
- Breath Pressure = 128
|
||||||
|
|
||||||
by Mathias Bredholt, McGill University.
|
by Mathias Bredholt, McGill University.
|
||||||
Formatted for STK by Gary Scavone, 2019.
|
Formatted for STK by Gary Scavone, 2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace stk {
|
|||||||
Smith (1986), Hirschman, Cook, Scavone, and
|
Smith (1986), Hirschman, Cook, Scavone, and
|
||||||
others for more information.
|
others for more information.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace stk {
|
|||||||
- Zero Radii = 1
|
- Zero Radii = 1
|
||||||
- Envelope Gain = 128
|
- Envelope Gain = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace stk {
|
|||||||
type who should worry about this (making
|
type who should worry about this (making
|
||||||
money) worry away.
|
money) worry away.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
RtAudio WWW site: http://www.music.mcgill.ca/~gary/rtaudio/
|
RtAudio WWW site: http://www.music.mcgill.ca/~gary/rtaudio/
|
||||||
|
|
||||||
RtAudio: realtime audio i/o C++ classes
|
RtAudio: realtime audio i/o C++ classes
|
||||||
Copyright (c) 2001-2019 Gary P. Scavone
|
Copyright (c) 2001-2021 Gary P. Scavone
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
Permission is hereby granted, free of charge, to any person
|
||||||
obtaining a copy of this software and associated documentation files
|
obtaining a copy of this software and associated documentation files
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
#ifndef __RTAUDIO_H
|
#ifndef __RTAUDIO_H
|
||||||
#define __RTAUDIO_H
|
#define __RTAUDIO_H
|
||||||
|
|
||||||
#define RTAUDIO_VERSION "5.1.0"
|
#define RTAUDIO_VERSION "5.2.0"
|
||||||
|
|
||||||
#if defined _WIN32 || defined __CYGWIN__
|
#if defined _WIN32 || defined __CYGWIN__
|
||||||
#if defined(RTAUDIO_EXPORT)
|
#if defined(RTAUDIO_EXPORT)
|
||||||
@@ -226,12 +226,12 @@ class RTAUDIO_DLL_PUBLIC RtAudioError : public std::runtime_error
|
|||||||
UNSPECIFIED, /*!< The default, unspecified error type. */
|
UNSPECIFIED, /*!< The default, unspecified error type. */
|
||||||
NO_DEVICES_FOUND, /*!< No devices found on system. */
|
NO_DEVICES_FOUND, /*!< No devices found on system. */
|
||||||
INVALID_DEVICE, /*!< An invalid device ID was specified. */
|
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_PARAMETER, /*!< An invalid parameter was specified to a function. */
|
||||||
INVALID_USE, /*!< The function was called incorrectly. */
|
INVALID_USE, /*!< The function was called incorrectly. */
|
||||||
DRIVER_ERROR, /*!< A system driver error occured. */
|
DRIVER_ERROR, /*!< A system driver error occurred. */
|
||||||
SYSTEM_ERROR, /*!< A system error occured. */
|
SYSTEM_ERROR, /*!< A system error occurred. */
|
||||||
THREAD_ERROR /*!< A thread error occured. */
|
THREAD_ERROR /*!< A thread error occurred. */
|
||||||
};
|
};
|
||||||
|
|
||||||
//! The constructor.
|
//! The constructor.
|
||||||
@@ -299,30 +299,21 @@ class RTAUDIO_DLL_PUBLIC RtAudio
|
|||||||
struct DeviceInfo {
|
struct DeviceInfo {
|
||||||
bool probed; /*!< true if the device capabilities were successfully probed. */
|
bool probed; /*!< true if the device capabilities were successfully probed. */
|
||||||
std::string name; /*!< Character string device identifier. */
|
std::string name; /*!< Character string device identifier. */
|
||||||
unsigned int outputChannels; /*!< Maximum output channels supported by device. */
|
unsigned int outputChannels{}; /*!< Maximum output channels supported by device. */
|
||||||
unsigned int inputChannels; /*!< Maximum input channels supported by device. */
|
unsigned int inputChannels{}; /*!< Maximum input channels supported by device. */
|
||||||
unsigned int duplexChannels; /*!< Maximum simultaneous input/output channels supported by device. */
|
unsigned int duplexChannels{}; /*!< Maximum simultaneous input/output channels supported by device. */
|
||||||
bool isDefaultOutput; /*!< true if this is the default output device. */
|
bool isDefaultOutput{false}; /*!< true if this is the default output device. */
|
||||||
bool isDefaultInput; /*!< true if this is the default input device. */
|
bool isDefaultInput{false}; /*!< true if this is the default input device. */
|
||||||
std::vector<unsigned int> sampleRates; /*!< Supported sample rates (queried from list of standard rates). */
|
std::vector<unsigned int> sampleRates; /*!< Supported sample rates (queried from list of standard rates). */
|
||||||
unsigned int preferredSampleRate; /*!< Preferred sample rate, e.g. for WASAPI the system sample rate. */
|
unsigned int preferredSampleRate{}; /*!< Preferred sample rate, e.g. for WASAPI the system sample rate. */
|
||||||
RtAudioFormat nativeFormats; /*!< Bit mask of supported data formats. */
|
RtAudioFormat nativeFormats{}; /*!< Bit mask of supported data formats. */
|
||||||
|
|
||||||
// Default constructor.
|
|
||||||
DeviceInfo()
|
|
||||||
:probed(false), outputChannels(0), inputChannels(0), duplexChannels(0),
|
|
||||||
isDefaultOutput(false), isDefaultInput(false), preferredSampleRate(0), nativeFormats(0) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! The structure for specifying input or ouput stream parameters.
|
//! The structure for specifying input or output stream parameters.
|
||||||
struct StreamParameters {
|
struct StreamParameters {
|
||||||
unsigned int deviceId; /*!< Device index (0 to getDeviceCount() - 1). */
|
unsigned int deviceId{}; /*!< Device index (0 to getDeviceCount() - 1). */
|
||||||
unsigned int nChannels; /*!< Number of channels. */
|
unsigned int nChannels{}; /*!< Number of channels. */
|
||||||
unsigned int firstChannel; /*!< First channel index on device (default = 0). */
|
unsigned int firstChannel{}; /*!< First channel index on device (default = 0). */
|
||||||
|
|
||||||
// Default constructor.
|
|
||||||
StreamParameters()
|
|
||||||
: deviceId(0), nChannels(0), firstChannel(0) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! The structure for specifying stream options.
|
//! The structure for specifying stream options.
|
||||||
@@ -383,14 +374,10 @@ class RTAUDIO_DLL_PUBLIC RtAudio
|
|||||||
RtAudio with Jack, each instance must have a unique client name.
|
RtAudio with Jack, each instance must have a unique client name.
|
||||||
*/
|
*/
|
||||||
struct StreamOptions {
|
struct StreamOptions {
|
||||||
RtAudioStreamFlags flags; /*!< A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE, RTAUDIO_ALSA_USE_DEFAULT). */
|
RtAudioStreamFlags flags{}; /*!< A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE, RTAUDIO_ALSA_USE_DEFAULT). */
|
||||||
unsigned int numberOfBuffers; /*!< Number of stream buffers. */
|
unsigned int numberOfBuffers{}; /*!< Number of stream buffers. */
|
||||||
std::string streamName; /*!< A stream name (currently used only in Jack). */
|
std::string streamName; /*!< A stream name (currently used only in Jack). */
|
||||||
int priority; /*!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). */
|
int priority{}; /*!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). */
|
||||||
|
|
||||||
// Default constructor.
|
|
||||||
StreamOptions()
|
|
||||||
: flags(0), numberOfBuffers(0), priority(0) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! A static function to determine the current RtAudio version.
|
//! A static function to determine the current RtAudio version.
|
||||||
@@ -527,7 +514,7 @@ class RTAUDIO_DLL_PUBLIC RtAudio
|
|||||||
lowest allowable value is used. The actual value used is
|
lowest allowable value is used. The actual value used is
|
||||||
returned via the structure argument. The parameter is API dependent.
|
returned via the structure argument. The parameter is API dependent.
|
||||||
\param errorCallback A client-defined function that will be invoked
|
\param errorCallback A client-defined function that will be invoked
|
||||||
when an error has occured.
|
when an error has occurred.
|
||||||
*/
|
*/
|
||||||
void openStream( RtAudio::StreamParameters *outputParameters,
|
void openStream( RtAudio::StreamParameters *outputParameters,
|
||||||
RtAudio::StreamParameters *inputParameters,
|
RtAudio::StreamParameters *inputParameters,
|
||||||
@@ -616,7 +603,7 @@ class RTAUDIO_DLL_PUBLIC RtAudio
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Operating system dependent thread functionality.
|
// Operating system dependent thread functionality.
|
||||||
#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) || defined(__WINDOWS_WASAPI__)
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
|
||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
@@ -628,18 +615,22 @@ class RTAUDIO_DLL_PUBLIC RtAudio
|
|||||||
typedef uintptr_t ThreadHandle;
|
typedef uintptr_t ThreadHandle;
|
||||||
typedef CRITICAL_SECTION StreamMutex;
|
typedef CRITICAL_SECTION StreamMutex;
|
||||||
|
|
||||||
#elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)
|
#else
|
||||||
|
|
||||||
// Using pthread library for various flavors of unix.
|
// Using pthread library for various flavors of unix.
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
typedef pthread_t ThreadHandle;
|
typedef pthread_t ThreadHandle;
|
||||||
typedef pthread_mutex_t StreamMutex;
|
typedef pthread_mutex_t StreamMutex;
|
||||||
|
|
||||||
#else // Setup for "dummy" behavior
|
#endif
|
||||||
|
|
||||||
|
// Setup for "dummy" behavior if no apis specified.
|
||||||
|
#if !(defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) || defined(__WINDOWS_WASAPI__) \
|
||||||
|
|| defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) \
|
||||||
|
|| defined(__LINUX_OSS__) || defined(__MACOSX_CORE__))
|
||||||
|
|
||||||
#define __RTAUDIO_DUMMY__
|
#define __RTAUDIO_DUMMY__
|
||||||
typedef int ThreadHandle;
|
|
||||||
typedef int StreamMutex;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -647,19 +638,15 @@ class RTAUDIO_DLL_PUBLIC RtAudio
|
|||||||
// between the private RtAudio stream structure and global callback
|
// between the private RtAudio stream structure and global callback
|
||||||
// handling functions.
|
// handling functions.
|
||||||
struct CallbackInfo {
|
struct CallbackInfo {
|
||||||
void *object; // Used as a "this" pointer.
|
void *object{}; // Used as a "this" pointer.
|
||||||
ThreadHandle thread;
|
ThreadHandle thread{};
|
||||||
void *callback;
|
void *callback{};
|
||||||
void *userData;
|
void *userData{};
|
||||||
void *errorCallback;
|
void *errorCallback{};
|
||||||
void *apiInfo; // void pointer for API specific callback information
|
void *apiInfo{}; // void pointer for API specific callback information
|
||||||
bool isRunning;
|
bool isRunning{false};
|
||||||
bool doRealtime;
|
bool doRealtime{false};
|
||||||
int priority;
|
int priority{};
|
||||||
|
|
||||||
// Default constructor.
|
|
||||||
CallbackInfo()
|
|
||||||
:object(0), callback(0), userData(0), errorCallback(0), apiInfo(0), isRunning(false), doRealtime(false), priority(0) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// **************************************************************** //
|
// **************************************************************** //
|
||||||
@@ -686,9 +673,9 @@ class S24 {
|
|||||||
S24() {}
|
S24() {}
|
||||||
|
|
||||||
S24& operator = ( const int& i ) {
|
S24& operator = ( const int& i ) {
|
||||||
c3[0] = (i & 0x000000ff);
|
c3[0] = (unsigned char)(i & 0x000000ff);
|
||||||
c3[1] = (i & 0x0000ff00) >> 8;
|
c3[1] = (unsigned char)((i & 0x0000ff00) >> 8);
|
||||||
c3[2] = (i & 0x00ff0000) >> 16;
|
c3[2] = (unsigned char)((i & 0x00ff0000) >> 16);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,20 +882,20 @@ public:
|
|||||||
|
|
||||||
RtApiCore();
|
RtApiCore();
|
||||||
~RtApiCore();
|
~RtApiCore();
|
||||||
RtAudio::Api getCurrentApi( void ) { return RtAudio::MACOSX_CORE; }
|
RtAudio::Api getCurrentApi( void ) override { return RtAudio::MACOSX_CORE; }
|
||||||
unsigned int getDeviceCount( void );
|
unsigned int getDeviceCount( void ) override;
|
||||||
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
|
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
|
||||||
unsigned int getDefaultOutputDevice( void );
|
unsigned int getDefaultOutputDevice( void ) override;
|
||||||
unsigned int getDefaultInputDevice( void );
|
unsigned int getDefaultInputDevice( void ) override;
|
||||||
void closeStream( void );
|
void closeStream( void ) override;
|
||||||
void startStream( void );
|
void startStream( void ) override;
|
||||||
void stopStream( void );
|
void stopStream( void ) override;
|
||||||
void abortStream( void );
|
void abortStream( void ) override;
|
||||||
|
|
||||||
// This function is intended for internal use only. It must be
|
// This function is intended for internal use only. It must be
|
||||||
// public because it is called by the internal callback handler,
|
// public because it is called by the internal callback handler,
|
||||||
// which is not a member of RtAudio. External use of this function
|
// which is not a member of RtAudio. External use of this function
|
||||||
// will most likely produce highly undesireable results!
|
// will most likely produce highly undesirable results!
|
||||||
bool callbackEvent( AudioDeviceID deviceId,
|
bool callbackEvent( AudioDeviceID deviceId,
|
||||||
const AudioBufferList *inBufferList,
|
const AudioBufferList *inBufferList,
|
||||||
const AudioBufferList *outBufferList );
|
const AudioBufferList *outBufferList );
|
||||||
@@ -918,7 +905,7 @@ public:
|
|||||||
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
||||||
unsigned int firstChannel, unsigned int sampleRate,
|
unsigned int firstChannel, unsigned int sampleRate,
|
||||||
RtAudioFormat format, unsigned int *bufferSize,
|
RtAudioFormat format, unsigned int *bufferSize,
|
||||||
RtAudio::StreamOptions *options );
|
RtAudio::StreamOptions *options ) override;
|
||||||
static const char* getErrorCode( OSStatus code );
|
static const char* getErrorCode( OSStatus code );
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -932,18 +919,18 @@ public:
|
|||||||
|
|
||||||
RtApiJack();
|
RtApiJack();
|
||||||
~RtApiJack();
|
~RtApiJack();
|
||||||
RtAudio::Api getCurrentApi( void ) { return RtAudio::UNIX_JACK; }
|
RtAudio::Api getCurrentApi( void ) override { return RtAudio::UNIX_JACK; }
|
||||||
unsigned int getDeviceCount( void );
|
unsigned int getDeviceCount( void ) override;
|
||||||
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
|
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
|
||||||
void closeStream( void );
|
void closeStream( void ) override;
|
||||||
void startStream( void );
|
void startStream( void ) override;
|
||||||
void stopStream( void );
|
void stopStream( void ) override;
|
||||||
void abortStream( void );
|
void abortStream( void ) override;
|
||||||
|
|
||||||
// This function is intended for internal use only. It must be
|
// This function is intended for internal use only. It must be
|
||||||
// public because it is called by the internal callback handler,
|
// public because it is called by the internal callback handler,
|
||||||
// which is not a member of RtAudio. External use of this function
|
// which is not a member of RtAudio. External use of this function
|
||||||
// will most likely produce highly undesireable results!
|
// will most likely produce highly undesirable results!
|
||||||
bool callbackEvent( unsigned long nframes );
|
bool callbackEvent( unsigned long nframes );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -951,7 +938,7 @@ public:
|
|||||||
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
||||||
unsigned int firstChannel, unsigned int sampleRate,
|
unsigned int firstChannel, unsigned int sampleRate,
|
||||||
RtAudioFormat format, unsigned int *bufferSize,
|
RtAudioFormat format, unsigned int *bufferSize,
|
||||||
RtAudio::StreamOptions *options );
|
RtAudio::StreamOptions *options ) override;
|
||||||
|
|
||||||
bool shouldAutoconnect_;
|
bool shouldAutoconnect_;
|
||||||
};
|
};
|
||||||
@@ -966,18 +953,20 @@ public:
|
|||||||
|
|
||||||
RtApiAsio();
|
RtApiAsio();
|
||||||
~RtApiAsio();
|
~RtApiAsio();
|
||||||
RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_ASIO; }
|
RtAudio::Api getCurrentApi( void ) override { return RtAudio::WINDOWS_ASIO; }
|
||||||
unsigned int getDeviceCount( void );
|
unsigned int getDeviceCount( void ) override;
|
||||||
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
|
unsigned int getDefaultOutputDevice( void ) override;
|
||||||
void closeStream( void );
|
unsigned int getDefaultInputDevice( void ) override;
|
||||||
void startStream( void );
|
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
|
||||||
void stopStream( void );
|
void closeStream( void ) override;
|
||||||
void abortStream( void );
|
void startStream( void ) override;
|
||||||
|
void stopStream( void ) override;
|
||||||
|
void abortStream( void ) override;
|
||||||
|
|
||||||
// This function is intended for internal use only. It must be
|
// This function is intended for internal use only. It must be
|
||||||
// public because it is called by the internal callback handler,
|
// public because it is called by the internal callback handler,
|
||||||
// which is not a member of RtAudio. External use of this function
|
// which is not a member of RtAudio. External use of this function
|
||||||
// will most likely produce highly undesireable results!
|
// will most likely produce highly undesirable results!
|
||||||
bool callbackEvent( long bufferIndex );
|
bool callbackEvent( long bufferIndex );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -988,7 +977,7 @@ public:
|
|||||||
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
||||||
unsigned int firstChannel, unsigned int sampleRate,
|
unsigned int firstChannel, unsigned int sampleRate,
|
||||||
RtAudioFormat format, unsigned int *bufferSize,
|
RtAudioFormat format, unsigned int *bufferSize,
|
||||||
RtAudio::StreamOptions *options );
|
RtAudio::StreamOptions *options ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1001,20 +990,20 @@ public:
|
|||||||
|
|
||||||
RtApiDs();
|
RtApiDs();
|
||||||
~RtApiDs();
|
~RtApiDs();
|
||||||
RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_DS; }
|
RtAudio::Api getCurrentApi( void ) override { return RtAudio::WINDOWS_DS; }
|
||||||
unsigned int getDeviceCount( void );
|
unsigned int getDeviceCount( void ) override;
|
||||||
unsigned int getDefaultOutputDevice( void );
|
unsigned int getDefaultOutputDevice( void ) override;
|
||||||
unsigned int getDefaultInputDevice( void );
|
unsigned int getDefaultInputDevice( void ) override;
|
||||||
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
|
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
|
||||||
void closeStream( void );
|
void closeStream( void ) override;
|
||||||
void startStream( void );
|
void startStream( void ) override;
|
||||||
void stopStream( void );
|
void stopStream( void ) override;
|
||||||
void abortStream( void );
|
void abortStream( void ) override;
|
||||||
|
|
||||||
// This function is intended for internal use only. It must be
|
// This function is intended for internal use only. It must be
|
||||||
// public because it is called by the internal callback handler,
|
// public because it is called by the internal callback handler,
|
||||||
// which is not a member of RtAudio. External use of this function
|
// which is not a member of RtAudio. External use of this function
|
||||||
// will most likely produce highly undesireable results!
|
// will most likely produce highly undesirable results!
|
||||||
void callbackEvent( void );
|
void callbackEvent( void );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -1026,7 +1015,7 @@ public:
|
|||||||
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
||||||
unsigned int firstChannel, unsigned int sampleRate,
|
unsigned int firstChannel, unsigned int sampleRate,
|
||||||
RtAudioFormat format, unsigned int *bufferSize,
|
RtAudioFormat format, unsigned int *bufferSize,
|
||||||
RtAudio::StreamOptions *options );
|
RtAudio::StreamOptions *options ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1041,15 +1030,13 @@ public:
|
|||||||
RtApiWasapi();
|
RtApiWasapi();
|
||||||
virtual ~RtApiWasapi();
|
virtual ~RtApiWasapi();
|
||||||
|
|
||||||
RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_WASAPI; }
|
RtAudio::Api getCurrentApi( void ) override { return RtAudio::WINDOWS_WASAPI; }
|
||||||
unsigned int getDeviceCount( void );
|
unsigned int getDeviceCount( void ) override;
|
||||||
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
|
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
|
||||||
unsigned int getDefaultOutputDevice( void );
|
void closeStream( void ) override;
|
||||||
unsigned int getDefaultInputDevice( void );
|
void startStream( void ) override;
|
||||||
void closeStream( void );
|
void stopStream( void ) override;
|
||||||
void startStream( void );
|
void abortStream( void ) override;
|
||||||
void stopStream( void );
|
|
||||||
void abortStream( void );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool coInitialized_;
|
bool coInitialized_;
|
||||||
@@ -1058,7 +1045,7 @@ private:
|
|||||||
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
||||||
unsigned int firstChannel, unsigned int sampleRate,
|
unsigned int firstChannel, unsigned int sampleRate,
|
||||||
RtAudioFormat format, unsigned int* bufferSize,
|
RtAudioFormat format, unsigned int* bufferSize,
|
||||||
RtAudio::StreamOptions* options );
|
RtAudio::StreamOptions* options ) override;
|
||||||
|
|
||||||
static DWORD WINAPI runWasapiThread( void* wasapiPtr );
|
static DWORD WINAPI runWasapiThread( void* wasapiPtr );
|
||||||
static DWORD WINAPI stopWasapiThread( void* wasapiPtr );
|
static DWORD WINAPI stopWasapiThread( void* wasapiPtr );
|
||||||
@@ -1076,18 +1063,18 @@ public:
|
|||||||
|
|
||||||
RtApiAlsa();
|
RtApiAlsa();
|
||||||
~RtApiAlsa();
|
~RtApiAlsa();
|
||||||
RtAudio::Api getCurrentApi() { return RtAudio::LINUX_ALSA; }
|
RtAudio::Api getCurrentApi() override { return RtAudio::LINUX_ALSA; }
|
||||||
unsigned int getDeviceCount( void );
|
unsigned int getDeviceCount( void ) override;
|
||||||
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
|
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
|
||||||
void closeStream( void );
|
void closeStream( void ) override;
|
||||||
void startStream( void );
|
void startStream( void ) override;
|
||||||
void stopStream( void );
|
void stopStream( void ) override;
|
||||||
void abortStream( void );
|
void abortStream( void ) override;
|
||||||
|
|
||||||
// This function is intended for internal use only. It must be
|
// This function is intended for internal use only. It must be
|
||||||
// public because it is called by the internal callback handler,
|
// public because it is called by the internal callback handler,
|
||||||
// which is not a member of RtAudio. External use of this function
|
// which is not a member of RtAudio. External use of this function
|
||||||
// will most likely produce highly undesireable results!
|
// will most likely produce highly undesirable results!
|
||||||
void callbackEvent( void );
|
void callbackEvent( void );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -1097,7 +1084,7 @@ public:
|
|||||||
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
||||||
unsigned int firstChannel, unsigned int sampleRate,
|
unsigned int firstChannel, unsigned int sampleRate,
|
||||||
RtAudioFormat format, unsigned int *bufferSize,
|
RtAudioFormat format, unsigned int *bufferSize,
|
||||||
RtAudio::StreamOptions *options );
|
RtAudio::StreamOptions *options ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1108,28 +1095,27 @@ class RtApiPulse: public RtApi
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~RtApiPulse();
|
~RtApiPulse();
|
||||||
RtAudio::Api getCurrentApi() { return RtAudio::LINUX_PULSE; }
|
RtAudio::Api getCurrentApi() override { return RtAudio::LINUX_PULSE; }
|
||||||
unsigned int getDeviceCount( void );
|
unsigned int getDeviceCount( void ) override;
|
||||||
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
|
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
|
||||||
void closeStream( void );
|
void closeStream( void ) override;
|
||||||
void startStream( void );
|
void startStream( void ) override;
|
||||||
void stopStream( void );
|
void stopStream( void ) override;
|
||||||
void abortStream( void );
|
void abortStream( void ) override;
|
||||||
|
|
||||||
// This function is intended for internal use only. It must be
|
// This function is intended for internal use only. It must be
|
||||||
// public because it is called by the internal callback handler,
|
// public because it is called by the internal callback handler,
|
||||||
// which is not a member of RtAudio. External use of this function
|
// which is not a member of RtAudio. External use of this function
|
||||||
// will most likely produce highly undesireable results!
|
// will most likely produce highly undesirable results!
|
||||||
void callbackEvent( void );
|
void callbackEvent( void );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::vector<RtAudio::DeviceInfo> devices_;
|
void collectDeviceInfo( void );
|
||||||
void saveDeviceInfo( void );
|
|
||||||
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
||||||
unsigned int firstChannel, unsigned int sampleRate,
|
unsigned int firstChannel, unsigned int sampleRate,
|
||||||
RtAudioFormat format, unsigned int *bufferSize,
|
RtAudioFormat format, unsigned int *bufferSize,
|
||||||
RtAudio::StreamOptions *options );
|
RtAudio::StreamOptions *options ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1142,18 +1128,18 @@ public:
|
|||||||
|
|
||||||
RtApiOss();
|
RtApiOss();
|
||||||
~RtApiOss();
|
~RtApiOss();
|
||||||
RtAudio::Api getCurrentApi() { return RtAudio::LINUX_OSS; }
|
RtAudio::Api getCurrentApi() override { return RtAudio::LINUX_OSS; }
|
||||||
unsigned int getDeviceCount( void );
|
unsigned int getDeviceCount( void ) override;
|
||||||
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
|
RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) override;
|
||||||
void closeStream( void );
|
void closeStream( void ) override;
|
||||||
void startStream( void );
|
void startStream( void ) override;
|
||||||
void stopStream( void );
|
void stopStream( void ) override;
|
||||||
void abortStream( void );
|
void abortStream( void ) override;
|
||||||
|
|
||||||
// This function is intended for internal use only. It must be
|
// This function is intended for internal use only. It must be
|
||||||
// public because it is called by the internal callback handler,
|
// public because it is called by the internal callback handler,
|
||||||
// which is not a member of RtAudio. External use of this function
|
// which is not a member of RtAudio. External use of this function
|
||||||
// will most likely produce highly undesireable results!
|
// will most likely produce highly undesirable results!
|
||||||
void callbackEvent( void );
|
void callbackEvent( void );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -1161,7 +1147,7 @@ public:
|
|||||||
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
|
||||||
unsigned int firstChannel, unsigned int sampleRate,
|
unsigned int firstChannel, unsigned int sampleRate,
|
||||||
RtAudioFormat format, unsigned int *bufferSize,
|
RtAudioFormat format, unsigned int *bufferSize,
|
||||||
RtAudio::StreamOptions *options );
|
RtAudio::StreamOptions *options ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1173,20 +1159,20 @@ class RtApiDummy: public RtApi
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( RtAudioError::WARNING ); }
|
RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( RtAudioError::WARNING ); }
|
||||||
RtAudio::Api getCurrentApi( void ) { return RtAudio::RTAUDIO_DUMMY; }
|
RtAudio::Api getCurrentApi( void ) override { return RtAudio::RTAUDIO_DUMMY; }
|
||||||
unsigned int getDeviceCount( void ) { return 0; }
|
unsigned int getDeviceCount( void ) override { return 0; }
|
||||||
RtAudio::DeviceInfo getDeviceInfo( unsigned int /*device*/ ) { RtAudio::DeviceInfo info; return info; }
|
RtAudio::DeviceInfo getDeviceInfo( unsigned int /*device*/ ) override { RtAudio::DeviceInfo info; return info; }
|
||||||
void closeStream( void ) {}
|
void closeStream( void ) override {}
|
||||||
void startStream( void ) {}
|
void startStream( void ) override {}
|
||||||
void stopStream( void ) {}
|
void stopStream( void ) override {}
|
||||||
void abortStream( void ) {}
|
void abortStream( void ) override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool probeDeviceOpen( unsigned int /*device*/, StreamMode /*mode*/, unsigned int /*channels*/,
|
bool probeDeviceOpen( unsigned int /*device*/, StreamMode /*mode*/, unsigned int /*channels*/,
|
||||||
unsigned int /*firstChannel*/, unsigned int /*sampleRate*/,
|
unsigned int /*firstChannel*/, unsigned int /*sampleRate*/,
|
||||||
RtAudioFormat /*format*/, unsigned int * /*bufferSize*/,
|
RtAudioFormat /*format*/, unsigned int * /*bufferSize*/,
|
||||||
RtAudio::StreamOptions * /*options*/ ) { return false; }
|
RtAudio::StreamOptions * /*options*/ ) override { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
RtMidi WWW site: http://www.music.mcgill.ca/~gary/rtmidi/
|
RtMidi WWW site: http://www.music.mcgill.ca/~gary/rtmidi/
|
||||||
|
|
||||||
RtMidi: realtime MIDI i/o C++ classes
|
RtMidi: realtime MIDI i/o C++ classes
|
||||||
Copyright (c) 2003-2019 Gary P. Scavone
|
Copyright (c) 2003-2021 Gary P. Scavone
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
Permission is hereby granted, free of charge, to any person
|
||||||
obtaining a copy of this software and associated documentation files
|
obtaining a copy of this software and associated documentation files
|
||||||
@@ -58,13 +58,14 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define RTMIDI_VERSION "4.0.0"
|
#define RTMIDI_VERSION "5.0.0"
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/*! \class RtMidiError
|
/*! \class RtMidiError
|
||||||
\brief Exception handling class for RtMidi.
|
\brief Exception handling class for RtMidi.
|
||||||
@@ -132,6 +133,8 @@ class MidiApi;
|
|||||||
class RTMIDI_DLL_PUBLIC RtMidi
|
class RTMIDI_DLL_PUBLIC RtMidi
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
RtMidi(RtMidi&& other) noexcept;
|
||||||
//! MIDI API specifier arguments.
|
//! MIDI API specifier arguments.
|
||||||
enum Api {
|
enum Api {
|
||||||
UNSPECIFIED, /*!< Search for a working compiled API. */
|
UNSPECIFIED, /*!< Search for a working compiled API. */
|
||||||
@@ -140,6 +143,7 @@ class RTMIDI_DLL_PUBLIC RtMidi
|
|||||||
UNIX_JACK, /*!< The JACK Low-Latency MIDI Server API. */
|
UNIX_JACK, /*!< The JACK Low-Latency MIDI Server API. */
|
||||||
WINDOWS_MM, /*!< The Microsoft Multimedia MIDI API. */
|
WINDOWS_MM, /*!< The Microsoft Multimedia MIDI API. */
|
||||||
RTMIDI_DUMMY, /*!< A compilable but non-functional API. */
|
RTMIDI_DUMMY, /*!< A compilable but non-functional API. */
|
||||||
|
WEB_MIDI_API, /*!< W3C Web MIDI API. */
|
||||||
NUM_APIS /*!< Number of values in this enum. */
|
NUM_APIS /*!< Number of values in this enum. */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -213,6 +217,10 @@ class RTMIDI_DLL_PUBLIC RtMidi
|
|||||||
RtMidi();
|
RtMidi();
|
||||||
virtual ~RtMidi();
|
virtual ~RtMidi();
|
||||||
MidiApi *rtapi_;
|
MidiApi *rtapi_;
|
||||||
|
|
||||||
|
/* Make the class non-copyable */
|
||||||
|
RtMidi(RtMidi& other) = delete;
|
||||||
|
RtMidi& operator=(RtMidi& other) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
@@ -248,7 +256,6 @@ class RTMIDI_DLL_PUBLIC RtMidi
|
|||||||
class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
|
class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! User callback function type definition.
|
//! User callback function type definition.
|
||||||
typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData );
|
typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData );
|
||||||
|
|
||||||
@@ -274,6 +281,8 @@ class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
|
|||||||
const std::string& clientName = "RtMidi Input Client",
|
const std::string& clientName = "RtMidi Input Client",
|
||||||
unsigned int queueSizeLimit = 100 );
|
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.
|
//! If a MIDI connection is still open, it will be closed by the destructor.
|
||||||
~RtMidiIn ( void ) throw();
|
~RtMidiIn ( void ) throw();
|
||||||
|
|
||||||
@@ -371,6 +380,19 @@ class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
|
|||||||
*/
|
*/
|
||||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 );
|
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:
|
protected:
|
||||||
void openMidiApi( RtMidi::Api api, const std::string &clientName, unsigned int queueSizeLimit );
|
void openMidiApi( RtMidi::Api api, const std::string &clientName, unsigned int queueSizeLimit );
|
||||||
};
|
};
|
||||||
@@ -403,6 +425,8 @@ class RTMIDI_DLL_PUBLIC RtMidiOut : public RtMidi
|
|||||||
RtMidiOut( RtMidi::Api api=UNSPECIFIED,
|
RtMidiOut( RtMidi::Api api=UNSPECIFIED,
|
||||||
const std::string& clientName = "RtMidi Output Client" );
|
const std::string& clientName = "RtMidi Output Client" );
|
||||||
|
|
||||||
|
RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
|
||||||
|
|
||||||
//! The destructor closes any open MIDI connections.
|
//! The destructor closes any open MIDI connections.
|
||||||
~RtMidiOut( void ) throw();
|
~RtMidiOut( void ) throw();
|
||||||
|
|
||||||
@@ -523,6 +547,7 @@ protected:
|
|||||||
RtMidiErrorCallback errorCallback_;
|
RtMidiErrorCallback errorCallback_;
|
||||||
bool firstErrorOccurred_;
|
bool firstErrorOccurred_;
|
||||||
void *errorCallbackUserData_;
|
void *errorCallbackUserData_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
|
class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
|
||||||
@@ -535,6 +560,7 @@ class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
|
|||||||
void cancelCallback( void );
|
void cancelCallback( void );
|
||||||
virtual void ignoreTypes( bool midiSysex, bool midiTime, bool midiSense );
|
virtual void ignoreTypes( bool midiSysex, bool midiTime, bool midiSense );
|
||||||
double getMessage( std::vector<unsigned char> *message );
|
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
|
// A MIDI structure used internally by the class to store incoming
|
||||||
// messages. Each message represents one and only one MIDI message.
|
// messages. Each message represents one and only one MIDI message.
|
||||||
@@ -576,11 +602,13 @@ class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
|
|||||||
RtMidiIn::RtMidiCallback userCallback;
|
RtMidiIn::RtMidiCallback userCallback;
|
||||||
void *userData;
|
void *userData;
|
||||||
bool continueSysex;
|
bool continueSysex;
|
||||||
|
unsigned int bufferSize;
|
||||||
|
unsigned int bufferCount;
|
||||||
|
|
||||||
// Default constructor.
|
// Default constructor.
|
||||||
RtMidiInData()
|
RtMidiInData()
|
||||||
: ignoreFlags(7), doInput(false), firstMessage(true), apiData(0), usingCallback(false),
|
: 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:
|
protected:
|
||||||
@@ -614,6 +642,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 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 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 :: 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 RtMidi::Api RtMidiOut :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
|
||||||
inline void RtMidiOut :: openPort( unsigned int portNumber, const std::string &portName ) { rtapi_->openPort( portNumber, portName ); }
|
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
|
that takes an StkFrames object for multi-channel and/or
|
||||||
multi-frame data.
|
multi-frame data.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace stk {
|
|||||||
that takes a reference to an StkFrames object for multi-channel
|
that takes a reference to an StkFrames object for multi-channel
|
||||||
and/or multi-frame data.
|
and/or multi-frame data.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
where <name> is the string used in the SKINI stream.
|
where <name> is the string used in the SKINI stream.
|
||||||
|
|
||||||
by Perry R. Cook, 1995--2019.
|
by Perry R. Cook, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace stk {
|
|||||||
This instrument provides an ADSR envelope, a one-pole filter, and
|
This instrument provides an ADSR envelope, a one-pole filter, and
|
||||||
structures for an arbitrary number of attack and looped files.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace stk {
|
|||||||
- Vibrato Gain = 1
|
- Vibrato Gain = 1
|
||||||
- Breath Pressure = 128
|
- Breath Pressure = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace stk {
|
|||||||
- Water Drops = 21
|
- Water Drops = 21
|
||||||
- Tuned Bamboo Chimes = 22
|
- 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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace stk {
|
|||||||
- Envelope Rate = 11
|
- Envelope Rate = 11
|
||||||
- Gain = 128
|
- Gain = 128
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace stk {
|
|||||||
|
|
||||||
The "table" length, set in SineWave.h, is 2048 samples by default.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace stk {
|
|||||||
Within STK, it is used as an excitation source for other
|
Within STK, it is used as an excitation source for other
|
||||||
instruments.
|
instruments.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace stk {
|
|||||||
Stanford, bearing the names of Karplus and/or
|
Stanford, bearing the names of Karplus and/or
|
||||||
Strong.
|
Strong.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace stk {
|
|||||||
|
|
||||||
\sa \ref skini
|
\sa \ref skini
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace stk {
|
|||||||
number of static functions for use with external socket
|
number of static functions for use with external socket
|
||||||
descriptors.
|
descriptors.
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace stk {
|
|||||||
This class implements a spherical ball with
|
This class implements a spherical ball with
|
||||||
radius, mass, position, and velocity parameters.
|
radius, mass, position, and velocity parameters.
|
||||||
|
|
||||||
by Perry R. Cook, 1995--2019.
|
by Perry R. Cook, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace stk {
|
|||||||
- String Sustain = 11
|
- String Sustain = 11
|
||||||
- String Stretch = 1
|
- String Stretch = 1
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace stk {
|
|||||||
STK WWW site: http://ccrma.stanford.edu/software/stk/
|
STK WWW site: http://ccrma.stanford.edu/software/stk/
|
||||||
|
|
||||||
The Synthesis ToolKit in C++ (STK)
|
The Synthesis ToolKit in C++ (STK)
|
||||||
Copyright (c) 1995--2019 Perry R. Cook and Gary P. Scavone
|
Copyright (c) 1995--2021 Perry R. Cook and Gary P. Scavone
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
Permission is hereby granted, free of charge, to any person
|
||||||
obtaining a copy of this software and associated documentation files
|
obtaining a copy of this software and associated documentation files
|
||||||
@@ -271,7 +271,7 @@ protected:
|
|||||||
Possible future improvements in this class could include functions
|
Possible future improvements in this class could include functions
|
||||||
to convert to and return other data types.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
@@ -285,17 +285,14 @@ public:
|
|||||||
//! Overloaded constructor that initializes the frame data to the specified size with \c value.
|
//! Overloaded constructor that initializes the frame data to the specified size with \c value.
|
||||||
StkFrames( const StkFloat& value, unsigned int nFrames, unsigned int nChannels );
|
StkFrames( const StkFloat& value, unsigned int nFrames, unsigned int nChannels );
|
||||||
|
|
||||||
//! Overloaded constructor that wraps the provided pointer to \c data.
|
|
||||||
StkFrames( StkFloat* data, unsigned int nFrames, unsigned int nChannels = 1 );
|
|
||||||
|
|
||||||
//! The destructor.
|
//! The destructor.
|
||||||
~StkFrames();
|
virtual ~StkFrames();
|
||||||
|
|
||||||
// A copy constructor.
|
// A copy constructor.
|
||||||
StkFrames( const StkFrames& f );
|
StkFrames( const StkFrames& f );
|
||||||
|
|
||||||
// Assignment operator that returns a reference to self.
|
// 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.
|
//! Subscript operator that returns a reference to element \c n of self.
|
||||||
/*!
|
/*!
|
||||||
@@ -387,7 +384,7 @@ public:
|
|||||||
size. Further, no new memory is allocated when the new size is
|
size. Further, no new memory is allocated when the new size is
|
||||||
smaller or equal to a previously allocated size.
|
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.
|
//! Resize self to represent the specified number of channels and frames and perform element initialization.
|
||||||
/*!
|
/*!
|
||||||
@@ -397,7 +394,7 @@ public:
|
|||||||
size. Further, no new memory is allocated when the new size is
|
size. Further, no new memory is allocated when the new size is
|
||||||
smaller or equal to a previously allocated size.
|
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
|
//! Retrieves a single channel
|
||||||
/*!
|
/*!
|
||||||
@@ -435,7 +432,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
StkFloat dataRate( void ) const { return dataRate_; };
|
StkFloat dataRate( void ) const { return dataRate_; };
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
|
|
||||||
StkFloat *data_;
|
StkFloat *data_;
|
||||||
StkFloat dataRate_;
|
StkFloat dataRate_;
|
||||||
@@ -443,7 +440,6 @@ private:
|
|||||||
unsigned int nChannels_;
|
unsigned int nChannels_;
|
||||||
size_t size_;
|
size_t size_;
|
||||||
size_t bufferSize_;
|
size_t bufferSize_;
|
||||||
bool ownData_;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace stk {
|
|||||||
A non-interpolating delay line is typically used in fixed
|
A non-interpolating delay line is typically used in fixed
|
||||||
delay-length applications, such as for reverberation.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace stk {
|
|||||||
less than or equal to zero indicate a closed
|
less than or equal to zero indicate a closed
|
||||||
or lost connection or the occurence of an error.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace stk {
|
|||||||
less than or equal to zero indicate a closed
|
less than or equal to zero indicate a closed
|
||||||
or lost connection or the occurence of an error.
|
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--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace stk {
|
|||||||
|
|
||||||
THREAD_RETURN THREAD_TYPE thread_function(void *ptr)
|
THREAD_RETURN THREAD_TYPE thread_function(void *ptr)
|
||||||
|
|
||||||
by Perry R. Cook and Gary P. Scavone, 1995--2019.
|
by Perry R. Cook and Gary P. Scavone, 1995--2021.
|
||||||
*/
|
*/
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user