mirror of
https://github.com/thestk/stk
synced 2026-01-12 04:21:52 +00:00
Compare commits
82 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11d1dc54f3 | ||
|
|
d6c67cc479 | ||
|
|
6ed16eb806 | ||
|
|
05230b11d5 | ||
|
|
3e103671d9 | ||
|
|
071280a311 | ||
|
|
15a2c89f89 | ||
|
|
889328c3c1 | ||
|
|
62416d7e3f | ||
|
|
9627701d04 | ||
|
|
9966f06757 | ||
|
|
56bcdc32ed | ||
|
|
2ddc79e3bd | ||
|
|
96b1a72186 | ||
|
|
2a6ada02a7 | ||
|
|
488301223a | ||
|
|
08f71c8fa9 | ||
|
|
e03aa486dd | ||
|
|
5dd605ecfd | ||
|
|
77a5cfa4aa | ||
|
|
77bdb45575 | ||
|
|
ff52b9f0b0 | ||
|
|
fe0f5d7f96 | ||
|
|
e1aa259517 | ||
|
|
95fcd14213 | ||
|
|
a5bef56e76 | ||
|
|
fb50d69e08 | ||
|
|
126ff9d9e1 | ||
|
|
83b75ed339 | ||
|
|
f0f6668f25 | ||
|
|
a506acc708 | ||
|
|
3e42e3db3f | ||
|
|
852bdec0c9 | ||
|
|
9d8673a24e | ||
|
|
57344a11a9 | ||
|
|
00da5562cd | ||
|
|
b02298a9f4 | ||
|
|
d1b4dd485b | ||
|
|
6d5a779879 | ||
|
|
7ea8b10c6a | ||
|
|
0e69055579 | ||
|
|
c2833d356a | ||
|
|
0f16f683c9 | ||
|
|
f3b1f35a8c | ||
|
|
262fe5a2d1 | ||
|
|
5e79513e5a | ||
|
|
f13866e696 | ||
|
|
9533f2bc66 | ||
|
|
8c0ad97a25 | ||
|
|
87461b1471 | ||
|
|
58fc744ea4 | ||
|
|
35f66c806e | ||
|
|
0a7c541cdc | ||
|
|
0e55d2d2b1 | ||
|
|
c1c314e7d6 | ||
|
|
84d947c750 | ||
|
|
05560b102d | ||
|
|
759fc187bc | ||
|
|
46be0d56c3 | ||
|
|
032e76da70 | ||
|
|
aae7f609cf | ||
|
|
d959a1167d | ||
|
|
c9f8c017bc | ||
|
|
6094f40399 | ||
|
|
a2fb59f476 | ||
|
|
f905623d10 | ||
|
|
b196c58c75 | ||
|
|
20b9411a5a | ||
|
|
bc3cfa8fb5 | ||
|
|
d1acfb07ed | ||
|
|
b5f046871b | ||
|
|
1de1f1e63d | ||
|
|
4ce317a5a7 | ||
|
|
2e8a0cdd50 | ||
|
|
5f9f7f6f08 | ||
|
|
a2be4bc721 | ||
|
|
2437623d67 | ||
|
|
0063a57dcb | ||
|
|
cc568a58c1 | ||
|
|
1799064d6f | ||
|
|
540d45dbbd | ||
|
|
222f81c1c1 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -146,7 +146,7 @@ config.log
|
||||
config.status
|
||||
configure
|
||||
projects/demo/Makefile
|
||||
projects/demo/demo
|
||||
projects/demo/stk-demo
|
||||
projects/demo/Release
|
||||
projects/demo/Debug
|
||||
projects/effects/Makefile
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
% The Synthesis ToolKit in C++ (STK)
|
||||
% Perry R. Cook and Gary P. Scavone
|
||||
% 1995--2014
|
||||
% 1995--2017
|
||||
|
||||
# The Synthesis ToolKit in C++ (STK)
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
|
||||
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.
|
||||
|
||||
@@ -30,7 +30,7 @@ Several options can be passed to configure, including:
|
||||
--disable-realtime = only compile generic non-realtime classes
|
||||
--enable-debug = enable various debug output
|
||||
--with-alsa = choose native ALSA API support (default, linux only)
|
||||
--with-oss = choose native OSS API support (linux only)
|
||||
--with-oss = choose native OSS API support (unixes only)
|
||||
--with-jack = choose native JACK server API support (linux and macintosh OS-X)
|
||||
--with-core = choose OS-X Core Audio API (macintosh OS-X only)
|
||||
--with-asio = choose ASIO API support (windows only)
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
Copyright (c) 1995--2014 Perry R. Cook and Gary P. Scavone
|
||||
Copyright (c) 1995--2017 Perry R. Cook and Gary P. Scavone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# The Synthesis ToolKit in C++ (STK)
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
|
||||
This distribution of the Synthesis ToolKit in C++ (STK) contains the following:
|
||||
|
||||
|
||||
1592
config/config.guess
vendored
1592
config/config.guess
vendored
File diff suppressed because it is too large
Load Diff
769
config/config.sub
vendored
769
config/config.sub
vendored
File diff suppressed because it is too large
Load Diff
74
configure.ac
74
configure.ac
@@ -1,5 +1,5 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(STK, 4.5.0, gary@music.mcgill.ca, stk)
|
||||
AC_INIT(STK, 4.6.0, gary@music.mcgill.ca, stk)
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
AC_CONFIG_SRCDIR(src/Stk.cpp)
|
||||
AC_CONFIG_FILES(Makefile src/Makefile projects/demo/Makefile projects/effects/Makefile projects/ragamatic/Makefile projects/examples/Makefile projects/examples/libMakefile projects/eguitar/Makefile)
|
||||
@@ -111,99 +111,103 @@ CXXFLAGS="$CXXFLAGS $cxxflag"
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
basesharedname="libstk-\$(RELEASE)"
|
||||
|
||||
AC_SUBST( sharedlib, ["libstk.so"] )
|
||||
AC_SUBST( sharedname, ["libstk.so.\$(RELEASE)"] )
|
||||
AC_SUBST( libflags, ["-shared -Wl,-soname,\$(SHAREDLIB).\$(MAJOR) -o \$(SHAREDLIB).\$(RELEASE)"] )
|
||||
AC_SUBST( sharedname, [${basesharedname}.so] )
|
||||
AC_SUBST( libflags, ["-shared -Wl,-soname,${basesharedname}.so -o $sharedname"] )
|
||||
case $host in
|
||||
*-apple*)
|
||||
AC_SUBST( sharedlib, ["libstk.dylib"] )
|
||||
AC_SUBST( sharedname, ["libstk.\$(RELEASE).dylib"] )
|
||||
AC_SUBST( libflags, ["-dynamiclib -o libstk.\$(RELEASE).dylib"] )
|
||||
AC_SUBST( sharedname, ["${basesharedname}.dylib"] )
|
||||
AC_SUBST( libflags, ["-dynamiclib -o ${basesharedname}.dylib"] )
|
||||
esac
|
||||
|
||||
if test $realtime = yes; then
|
||||
# Checks for package options and external software
|
||||
AC_MSG_CHECKING(for audio API)
|
||||
|
||||
AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (mac and linux only)])
|
||||
AS_IF([test "x$with_jack" == "xyes"], [
|
||||
api="$api -D__UNIX_JACK__"
|
||||
AC_MSG_RESULT(using JACK)
|
||||
AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))])
|
||||
|
||||
case $host in
|
||||
*-*-linux*)
|
||||
AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (mac and linux only)], [
|
||||
api="$api -D__UNIX_JACK__"
|
||||
AC_MSG_RESULT(using JACK)
|
||||
AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))
|
||||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!))], )
|
||||
|
||||
# Look for ALSA flag
|
||||
AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)], [
|
||||
AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)])
|
||||
AS_IF([test "x$with_alsa" == "xyes"], [
|
||||
api="$api -D__LINUX_ALSA__"
|
||||
AC_MSG_RESULT(using ALSA)
|
||||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))], )
|
||||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))])
|
||||
|
||||
# Look for OSS flag
|
||||
AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [
|
||||
AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (unixes only)])
|
||||
AS_IF([test "x$with_oss" == "xyes"], [
|
||||
api="$api -D__LINUX_OSS__ -D__LINUX_ALSA__"
|
||||
AC_MSG_RESULT(using OSS)
|
||||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(OSS support requires ALSA for RtMidi!))], )
|
||||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(OSS support requires ALSA for RtMidi!))])
|
||||
|
||||
# If no audio api flags specified, use ALSA
|
||||
if [test "$api" == "";] then
|
||||
AS_IF([test "$api" == ""], [
|
||||
AC_MSG_RESULT(using ALSA)
|
||||
AC_SUBST( api, [-D__LINUX_ALSA__] )
|
||||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
|
||||
fi
|
||||
])
|
||||
|
||||
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
|
||||
;;
|
||||
|
||||
*-apple*)
|
||||
AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (unix only)], [
|
||||
api="$api -D__UNIX_JACK__"
|
||||
AC_MSG_RESULT(using JACK)
|
||||
AC_CHECK_LIB(jack, jack_client_new, , AC_MSG_ERROR(JACK support requires the jack library!))], )
|
||||
|
||||
# Look for Core flag
|
||||
AC_ARG_WITH(core, [ --with-core = choose CoreAudio API support (mac only)], [
|
||||
AC_ARG_WITH(core, [ --with-core = choose CoreAudio API support (mac only)])
|
||||
AS_IF([test "x$with_core" == "xyes"], [
|
||||
api="$api -D__MACOSX_CORE__"
|
||||
AC_MSG_RESULT(using CoreAudio)
|
||||
AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [], [AC_MSG_ERROR(CoreAudio header files not found!)] )
|
||||
LIBS="$LIBS -framework CoreAudio -framework CoreFoundation -framework CoreMidi" ], )
|
||||
LIBS="$LIBS -framework CoreAudio -framework CoreFoundation -framework CoreMIDI" ])
|
||||
|
||||
# If no audio api flags specified, use CoreAudio
|
||||
if [test "$api" == ""; ] then
|
||||
AS_IF([test "$api" == ""], [
|
||||
AC_SUBST( api, [-D__MACOSX_CORE__] )
|
||||
AC_MSG_RESULT(using CoreAudio)
|
||||
AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
|
||||
[],
|
||||
[AC_MSG_ERROR(CoreAudio header files not found!)] )
|
||||
AC_SUBST( LIBS, ["-framework CoreAudio -framework CoreFoundation -framework CoreMidi"] )
|
||||
fi
|
||||
AC_SUBST( LIBS, ["-framework CoreAudio -framework CoreFoundation -framework CoreMIDI"] )
|
||||
])
|
||||
|
||||
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
|
||||
;;
|
||||
|
||||
*-mingw32*)
|
||||
AC_ARG_WITH(asio, [ --with-asio = choose ASIO API support (windoze only)], [
|
||||
AC_ARG_WITH(asio, [ --with-asio = choose ASIO API support (windoze only)])
|
||||
AS_IF([test "x$with_asio" == "xyes"], [
|
||||
api="$api -D__WINDOWS_ASIO__"
|
||||
AC_MSG_RESULT(using ASIO)
|
||||
AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] ) ], )
|
||||
AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] ) ])
|
||||
|
||||
# Look for DirectSound flag
|
||||
AC_ARG_WITH(ds, [ --with-ds = choose DirectSound API support (windoze only)], [
|
||||
AC_ARG_WITH(ds, [ --with-ds = choose DirectSound API support (windoze only)])
|
||||
AS_IF([test "x$with_ds" == "xyes"], [
|
||||
api="$api -D__WINDOWS_DS__"
|
||||
AC_MSG_RESULT(using DirectSound)
|
||||
LIBS="-ldsound $LIBS" ], )
|
||||
LIBS="-ldsound $LIBS" ])
|
||||
|
||||
# Look for WASAPI flag
|
||||
AC_ARG_WITH(wasapi, [ --with-wasapi = choose Windows Audio Session API support (windoze only)], [
|
||||
AC_ARG_WITH(wasapi, [ --with-wasapi = choose Windows Audio Session API support (windoze only)])
|
||||
AS_IF([test "x$with_wasapi" == "xyes"], [
|
||||
api="$api -D__WINDOWS_WASAPI__"
|
||||
AC_MSG_RESULT(using WASAPI)
|
||||
LIBS="-luuid -lksuser $LIBS" ], )
|
||||
LIBS="-luuid -lksuser $LIBS" ])
|
||||
|
||||
# If no audio api flags specified, use DirectSound
|
||||
if [test "$api" == "";] then
|
||||
AS_IF([test "$api" == ""], [
|
||||
AC_SUBST( api, [-D__WINDOWS_DS__] )
|
||||
AC_MSG_RESULT(using DirectSound)
|
||||
LIBS="-ldsound -lwinmm $LIBS"
|
||||
fi
|
||||
])
|
||||
|
||||
api="$api -D__WINDOWS_MM__"
|
||||
LIBS="-lole32 -lwinmm -lwsock32 $LIBS"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
|
||||
Please read the file README and INSTALL for more general STK information.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
|
||||
Please read the file README and INSTALL for more general STK information.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
|
||||
Please read the file README and INSTALL for more general STK information.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
|
||||
Please read the file README for more general STK information.
|
||||
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
|
||||
v.4.6.0 (31 August 2017)
|
||||
- see github site for complete details
|
||||
- various build system updates
|
||||
- fixes in FileWvIn / FileLoop for normalisation and scaling, as well as file opening
|
||||
- bug fix for MAT-files in FileWrite
|
||||
- bug fix in MidiFileIn.cpp for timing and time-code formats
|
||||
- updated versions of RtAudio and RtMidi
|
||||
|
||||
v4.5.1 (22 February 2017)
|
||||
- fix for FileWvIn / FileLoop classes to avoid keeping files open if not necessary
|
||||
- miscellaneous bug fixes, documented on GitHub site (github.com/thestk/stk)
|
||||
- update to play.cpp example to play mono files as stereo
|
||||
- bug fix in DelayL::setDelay() function
|
||||
- miscellanous build bug fixes
|
||||
|
||||
v4.5.0: (26 April 2014)
|
||||
- updated versions of RtAudio and RtMidi, with associated renaming of RtError class to either RtAudioError or RtMidiError and addition of WASAPI support in Windows
|
||||
|
||||
@@ -85,7 +85,7 @@ upon/from which to build and depart.
|
||||
the channel number is scanned as a long int. Channels could be socket
|
||||
numbers, machine IDs, serial numbers, or even unique tags for each
|
||||
event in a synthesis. Other fields might be used, as specified in the
|
||||
SKINI.tbl file. This is described in more detail later.
|
||||
SKINItbl.h file. This is described in more detail later.
|
||||
|
||||
Fields in a SKINI line are delimited by spaces, commas, or
|
||||
tabs. The SKINI parser only operates on a line at a time,
|
||||
@@ -109,9 +109,9 @@ upon/from which to build and depart.
|
||||
|
||||
All fields other than type, time, and channel are optional, and the
|
||||
types and useage of the additional fields is defined in the file
|
||||
SKINI.tbl.
|
||||
SKINItbl.h.
|
||||
|
||||
The other important file used by SKINI is SKINI.msg, which is a
|
||||
The other important file used by SKINI is SKINImsg.h, which is a
|
||||
set of #defines to make C code more readable, and to allow reasonably
|
||||
quick re-mapping of control numbers, etc.. All of these defined
|
||||
symbols are assigned integer values. For JAVA, the #defines could
|
||||
@@ -127,13 +127,13 @@ upon/from which to build and depart.
|
||||
receiving SKINI messages a line at a time, usually in real time,
|
||||
but not restricted to real time.
|
||||
|
||||
SKINI.msg should be included by anything wanting to use the
|
||||
SKINImsg.h should be included by anything wanting to use the
|
||||
Skini.cpp object. This is not mandatory, but use of the __SK_blah_
|
||||
symbols which are defined in the .msg file will help to ensure
|
||||
clarity and consistency when messages are added and changed.
|
||||
|
||||
SKINI.tbl is used only by the SKINI parser object (Skini.cpp).
|
||||
In the file SKINI.tbl, an array of structures is declared and
|
||||
SKINItbl.h is used only by the SKINI parser object (Skini.cpp).
|
||||
In the file SKINItbl.h, an array of structures is declared and
|
||||
assigned values which instruct the parser as to what the message
|
||||
types are, and what the fields mean for those message types.
|
||||
This table is compiled and linked into applications using SKINI, but
|
||||
@@ -195,7 +195,7 @@ upon/from which to build and depart.
|
||||
A -1 channel can be used as don't care, omni, or other functions
|
||||
depending on your needs and taste.
|
||||
|
||||
g) All remaining fields are specified in the SKINI.tbl file.
|
||||
g) All remaining fields are specified in the SKINItbl.h file.
|
||||
In general, there are maximum two more fields, which are either
|
||||
SK_INT (long), SK_DBL (double float), or SK_STR (string). The
|
||||
latter is the mechanism by which more arguments can be specified
|
||||
@@ -237,9 +237,9 @@ upon/from which to build and depart.
|
||||
NoteOff 0.000000 2 71 82
|
||||
NoteOff 0.000000 2 79 82
|
||||
|
||||
7) The SKINI.tbl File, How Messages are Parsed:
|
||||
7) The SKINItbl.h File, How Messages are Parsed:
|
||||
|
||||
The SKINI.tbl file contains an array of structures which
|
||||
The SKINItbl.h file contains an array of structures which
|
||||
are accessed by the parser object Skini.cpp. The struct is:
|
||||
|
||||
struct SKINISpec { char messageString[32];
|
||||
@@ -276,7 +276,7 @@ upon/from which to build and depart.
|
||||
something else stored in the SK_STR field, or
|
||||
as a new type of multi-line message.
|
||||
|
||||
Here's a couple of lines from the SKINI.tbl file
|
||||
Here's a couple of lines from the SKINItbl.h file
|
||||
|
||||
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
|
||||
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
|
||||
@@ -290,7 +290,7 @@ upon/from which to build and depart.
|
||||
The first three are basic MIDI messages. The first two would cause the
|
||||
parser, after recognizing a match of the string "NoteOff" or "NoteOn",
|
||||
to set the message type to 128 or 144 (__SK_NoteOff_ and __SK_NoteOn_
|
||||
are #defined in the file SKINI.msg to be the MIDI byte value, without
|
||||
are #defined in the file SKINImsg.h to be the MIDI byte value, without
|
||||
channel, of the actual MIDI messages for NoteOn and NoteOff). The parser
|
||||
would then set the time or delta time (this is always done and is
|
||||
therefore not described in the SKINI Message Struct). The next two
|
||||
|
||||
@@ -31,7 +31,7 @@ PROJECT_NAME = STK
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 4.5.0
|
||||
PROJECT_NUMBER = 4.6.0
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@@ -56,7 +56,7 @@ STK compiles with realtime support on the following flavors of the Unix operatin
|
||||
<TD>Macintosh OS X</TD>
|
||||
<TD>CoreAudio</TD>
|
||||
<TD>__MACOSX_CORE__</TD>
|
||||
<TD><TT>pthread, CoreAudio, CoreMidi, CoreFoundation</TT></TD>
|
||||
<TD><TT>pthread, CoreAudio, CoreMIDI, CoreFoundation</TT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
|
||||
@@ -1,322 +1,274 @@
|
||||
/*! \page download Download, Release Notes, and Bug Fixes
|
||||
|
||||
\section down Download Version 4.5.0 (26 April 2014):
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="http://ccrma.stanford.edu/software/stk/release/stk-4.5.0.tar.gz">Source distribution</A></LI>
|
||||
</UL>
|
||||
\section down Download Version 4.6.0 (31 August 2017):
|
||||
|
||||
- <A HREF="http://ccrma.stanford.edu/software/stk/release/stk-4.6.0.tar.gz">Source distribution</A>
|
||||
|
||||
\section notes Release Notes:
|
||||
\subsection v4dot6dot0 Version 4.6.0
|
||||
- see github site for complete details (github.com/thestk/stk)
|
||||
- various build system updates
|
||||
- fixes in FileWvIn / FileLoop for normalisation and scaling, as well as file opening
|
||||
- bug fix for MAT-files in FileWrite
|
||||
- bug fix in MidiFileIn.cpp for timing and time-code formats
|
||||
- updated versions of RtAudio and RtMidi
|
||||
|
||||
\subsection v4dot5dot1 Version 4.5.1
|
||||
- fix for FileWvIn / FileLoop classes to avoid keeping files open if not necessary
|
||||
- miscellaneous bug fixes, documented on GitHub site (github.com/thestk/stk)
|
||||
- update to play.cpp example to play mono files as stereo
|
||||
- bug fix in DelayL::setDelay() function
|
||||
- miscellanous build bug fixes
|
||||
|
||||
\subsection v4dot5dot0 Version 4.5.0
|
||||
|
||||
<ul>
|
||||
<li>Updated versions of RtAudio and RtMidi, with associated renaming of RtError class to either RtAudioError or RtMidiError</li>
|
||||
<li>New iOS project files (thanks to Ariel Elkin)</li>
|
||||
<li>Bug fix in FreeVerb that could cause crackling for stereo input</li>
|
||||
<li>Various bug fixes and updates to minimize compiler warnings</li>
|
||||
<li>ADSR fix for decay/release time calculations</li>
|
||||
<li>Various updates to build system</li>
|
||||
</ul>
|
||||
- Updated versions of RtAudio and RtMidi, with associated renaming of RtError class to either RtAudioError or RtMidiError
|
||||
- New iOS project files (thanks to Ariel Elkin)
|
||||
- Bug fix in FreeVerb that could cause crackling for stereo input
|
||||
- Various bug fixes and updates to minimize compiler warnings
|
||||
- ADSR fix for decay/release time calculations
|
||||
- Various updates to build system
|
||||
|
||||
\subsection v4dot4dot4 Version 4.4.4
|
||||
|
||||
<ul>
|
||||
<li>New FreeVerb class (thanks to Greg Burlet)</li>
|
||||
<li>New Guitar class</li>
|
||||
<li>New electric guitar project</li>
|
||||
<li>Updated versions of RtAudio and RtMidi</li>
|
||||
<li>Cleaned / revised Shakers class</li>
|
||||
<li>Bug fix in LentPitShift</li>
|
||||
<li>Bug fix in Echo constructor</li>
|
||||
<li>Bug fix in FileWvIn (file size when chunking)</li>
|
||||
<li>Bug fix in StkFrames copy constructor</li>
|
||||
</ul>
|
||||
- New FreeVerb class (thanks to Greg Burlet)
|
||||
- New Guitar class
|
||||
- New electric guitar project
|
||||
- Updated versions of RtAudio and RtMidi
|
||||
- Cleaned / revised Shakers class
|
||||
- Bug fix in LentPitShift
|
||||
- Bug fix in Echo constructor
|
||||
- Bug fix in FileWvIn (file size when chunking)
|
||||
- Bug fix in StkFrames copy constructor
|
||||
|
||||
\subsection v4dot4dot3 Version 4.4.3
|
||||
|
||||
<ul>
|
||||
<li>Changed SINT24 to be lower 3 bytes of 32-bit word.</li>
|
||||
<li>Bug fixes to vectorized tick functions in Effects classes.</li>
|
||||
<li>Updated versions of RtAudio and RtMidi.</li>
|
||||
<li>Bug fixes in ADSR and Envelope classes.</li>
|
||||
<li>Updates to the internal argument checking and reporting scheme.</li>
|
||||
<li>Updates to Bowed class (thanks to Esteban Maestre!).</li>
|
||||
<li>Fixes for 24-bit support in FileRead and FileWrite.</li>
|
||||
<li>Added WAVE_FORMAT_EXTENSIBLE support in FileWrite.</li>
|
||||
<li>Added sample rate variable reading and writing for MAT-files in FileRead and FileWrite.</li>
|
||||
</ul>
|
||||
- Changed SINT24 to be lower 3 bytes of 32-bit word.
|
||||
- Bug fixes to vectorized tick functions in Effects classes.
|
||||
- Updated versions of RtAudio and RtMidi.
|
||||
- Bug fixes in ADSR and Envelope classes.
|
||||
- Updates to the internal argument checking and reporting scheme.
|
||||
- Updates to Bowed class (thanks to Esteban Maestre!).
|
||||
- Fixes for 24-bit support in FileRead and FileWrite.
|
||||
- Added WAVE_FORMAT_EXTENSIBLE support in FileWrite.
|
||||
- Added sample rate variable reading and writing for MAT-files in FileRead and FileWrite.
|
||||
|
||||
\subsection v4dot4dot2 Version 4.4.2
|
||||
|
||||
<ul>
|
||||
<li>Added various header file includes for newer compilers.</li>
|
||||
<li>Updates to RtAudio and RtMidi.</li>
|
||||
<li>New LentPitShift class (thanks to Francois Germain).</li>
|
||||
<li>Bug fixes in Voicer class (thanks Richard Dobson!).</li>
|
||||
<li>Added Makefile.in to compile library and all projects, as well as clean and distclean.</li>
|
||||
</ul>
|
||||
- Added various header file includes for newer compilers.
|
||||
- Updates to RtAudio and RtMidi.
|
||||
- New LentPitShift class (thanks to Francois Germain).
|
||||
- Bug fixes in Voicer class (thanks Richard Dobson!).
|
||||
- Added Makefile.in to compile library and all projects, as well as clean and distclean.
|
||||
|
||||
\subsection v4dot4dot1 Version 4.4.1
|
||||
|
||||
<ul>
|
||||
<li>Added multi-channel/frame tick() virtual function to WvIn and WvOut abstract base classes (required update to RtWvOut class).</li>
|
||||
<li>Updated configure script to select g++ compiler by default.</li>
|
||||
<li>In demo.cpp: removed voicer grouping for messages, fixing polyphony when messages are on the same MIDI/SKINI channel.</li>
|
||||
<li>Updates to RtAudio and RtMidi.</li>
|
||||
</ul>
|
||||
- Added multi-channel/frame tick() virtual function to WvIn and WvOut abstract base classes (required update to RtWvOut class).
|
||||
- Updated configure script to select g++ compiler by default.
|
||||
- In demo.cpp: removed voicer grouping for messages, fixing polyphony when messages are on the same MIDI/SKINI channel.
|
||||
- Updates to RtAudio and RtMidi.
|
||||
|
||||
\subsection v4dot4dot0 Version 4.4.0
|
||||
|
||||
<ul>
|
||||
<li>All classes embedded in the "stk" namespace (except RtAudio, RtMidi, and RtError).</li>
|
||||
<li>Class WaveLoop renamed FileLoop.</li>
|
||||
<li>Significant efficiency improvements via code restructuring and inlining.</li>
|
||||
<li>Some class source (.cpp) files deleted as part of inlining (Generator, Filter, Function, WvIn, WvOut, Effect, Instrmnt, BowTable, ReedTable, JetTable, Vector3D).</li>
|
||||
<li>Updates to RtAudio and RtMidi.</li>
|
||||
<li>Previous "tickFrame()" functions renamed "tick" for more consistent API.</li>
|
||||
<li>More consistent and scalable approach to multichannel data and computations.</li>
|
||||
<li>Multichannel support added to Granulate class.</li>
|
||||
<li>Filter class made abstract. New Iir and Fir classes made for non-order-specific filtering.</li>
|
||||
<li>New TapDelay class.</li>
|
||||
<li>SubNoise class deleted (same as sub-sampled "ticking" of Noise class).</li>
|
||||
</ul>
|
||||
- All classes embedded in the "stk" namespace (except RtAudio, RtMidi, and RtError).
|
||||
- Class WaveLoop renamed FileLoop.
|
||||
- Significant efficiency improvements via code restructuring and inlining.
|
||||
- Some class source (.cpp) files deleted as part of inlining (Generator, Filter, Function, WvIn, WvOut, Effect, Instrmnt, BowTable, ReedTable, JetTable, Vector3D).
|
||||
- Updates to RtAudio and RtMidi.
|
||||
- Previous "tickFrame()" functions renamed "tick" for more consistent API.
|
||||
- More consistent and scalable approach to multichannel data and computations.
|
||||
- Multichannel support added to Granulate class.
|
||||
- Filter class made abstract. New Iir and Fir classes made for non-order-specific filtering.
|
||||
- New TapDelay class.
|
||||
- SubNoise class deleted (same as sub-sampled "ticking" of Noise class).
|
||||
|
||||
\subsection v4dot3dot1 Version 4.3.1
|
||||
|
||||
<ul>
|
||||
<li>Further headerless file support in FileRead.</li>
|
||||
<li>Bug fix in RtWvOut.cpp.</li>
|
||||
<li>Added configure support for MinGW.</li>
|
||||
<li>Updates to RtAudio and RtMidi for MinGW.</li>
|
||||
<li>Changes to channel assignment in demo.cpp.</li>
|
||||
</ul>
|
||||
- Further headerless file support in FileRead.
|
||||
- Bug fix in RtWvOut.cpp.
|
||||
- Added configure support for MinGW.
|
||||
- Updates to RtAudio and RtMidi for MinGW.
|
||||
- Changes to channel assignment in demo.cpp.
|
||||
|
||||
\subsection v4dot3dot0 Version 4.3.0
|
||||
|
||||
<ul>
|
||||
<li>An official MIT-like license.</li>
|
||||
<li>New functionality to automatically update class data when the STK sample rate changes (partly implemented).</li>
|
||||
<li>Updates for new RtAudio version 4.0.</li>
|
||||
<li>Removed RtDuplex class, users should use RtAudio directly with a callback function.</li>
|
||||
<li>Bug fix in interpolate() function in Stk.h for non-interleaved data.</li>
|
||||
<li>Fixes / improvements to the Granulate class.</li>
|
||||
<li>Fix in Whistle when doing animation.</li>
|
||||
<li>Fixes in BlitSquare for frequency, harmonics, and dc offset.</li>
|
||||
<li>Updates to Makefiles for non-realtime compile.</li>
|
||||
<li>Fix in demo.cpp for voice channel assignment.</li>
|
||||
<li>Updated versions of RtMidi and RtAudio.</li>
|
||||
<li>Updated ASIO files for MinGW compiler.</li>
|
||||
<li>New FAQ in documentation.</li>
|
||||
<li>MAT-file bug fix in FileRead class.</li>
|
||||
</ul>
|
||||
- An official MIT-like license.
|
||||
- New functionality to automatically update class data when the STK sample rate changes (partly implemented).
|
||||
- Updates for new RtAudio version 4.0.
|
||||
- Removed RtDuplex class, users should use RtAudio directly with a callback function.
|
||||
- Bug fix in interpolate() function in Stk.h for non-interleaved data.
|
||||
- Fixes / improvements to the Granulate class.
|
||||
- Fix in Whistle when doing animation.
|
||||
- Fixes in BlitSquare for frequency, harmonics, and dc offset.
|
||||
- Updates to Makefiles for non-realtime compile.
|
||||
- Fix in demo.cpp for voice channel assignment.
|
||||
- Updated versions of RtMidi and RtAudio.
|
||||
- Updated ASIO files for MinGW compiler.
|
||||
- New FAQ in documentation.
|
||||
- MAT-file bug fix in FileRead class.
|
||||
|
||||
\subsection v4dot2dot1 Version 4.2.1
|
||||
|
||||
<ul>
|
||||
<li>Greatly expanded StkFrames functionality (including interpolation and indexing by channel/frame).</li>
|
||||
<li>New Blit, BlitSaw, and BlitSquare bandlimited waveform classes (thanks to Robin Davies!).</li>
|
||||
<li>New Granulate granular synthesis class.</li>
|
||||
<li>Removed Table class ... all functionality (including interpolation) now in StkFrames and FileRead classes.</li>
|
||||
<li>Revised Socket class (now abstract) and added TcpServer, TcpClient, and UdpSocket subclasses.</li>
|
||||
<li>Added Stk::showWarnings() and Stk::printErrors() functions to dis/enable warning and error printouts.</li>
|
||||
<li>Extracted file I/O functionality to FileRead and FileWrite classes.</li>
|
||||
<li>Revised WvIn / WvOut class structure (WvIn / WvOut now abstract and file I/O functionality in new FileWvIn / FileWvOut subclasses).</li>
|
||||
<li>New SineWave class which calculates its own static table of variable length (no rawwave dependency).</li>
|
||||
<li>New sinewave.raw file of length 1024 samples (used to be 256).</li>
|
||||
<li>TcpWvIn and TcpWvOut renamed InetWvIn and InetWvOut, with added support for UDP sockets.</li>
|
||||
<li>Fixed bug in WvOut tickFrame( const StkFrames &frames ) function.</li>
|
||||
<li>Fixed bug in demo.cpp when writing output soundfiles without realtime output.</li>
|
||||
<li>Added "binary" open flag to MidiFileIn class for Windows.</li>
|
||||
<li>Fixed oversized MAT-file header in WvOut.cpp</li>
|
||||
<li>Fixed case statement bug in MidiFileIn.cpp for sysex.</li>
|
||||
<li>Added missing getDelay() function to DelayA.cpp.</li>
|
||||
<li>Fixed modDepth omission in Chorus.cpp.</li>
|
||||
<li>Fixed DC blocker initialization bug in Flute.cpp.</li>
|
||||
<li>Changed Filter class behavior so no default clearing of state when changing coefficients.</li>
|
||||
<li>Fixes to RtAudio, especially for Windows DirectSound and ASIO (thanks to Robin Davies).</li>
|
||||
</ul>
|
||||
- Greatly expanded StkFrames functionality (including interpolation and indexing by channel/frame).
|
||||
- New Blit, BlitSaw, and BlitSquare bandlimited waveform classes (thanks to Robin Davies!).
|
||||
- New Granulate granular synthesis class.
|
||||
- Removed Table class ... all functionality (including interpolation) now in StkFrames and FileRead classes.
|
||||
- Revised Socket class (now abstract) and added TcpServer, TcpClient, and UdpSocket subclasses.
|
||||
- Added Stk::showWarnings() and Stk::printErrors() functions to dis/enable warning and error printouts.
|
||||
- Extracted file I/O functionality to FileRead and FileWrite classes.
|
||||
- Revised WvIn / WvOut class structure (WvIn / WvOut now abstract and file I/O functionality in new FileWvIn / FileWvOut subclasses).
|
||||
- New SineWave class which calculates its own static table of variable length (no rawwave dependency).
|
||||
- New sinewave.raw file of length 1024 samples (used to be 256).
|
||||
- TcpWvIn and TcpWvOut renamed InetWvIn and InetWvOut, with added support for UDP sockets.
|
||||
- Fixed bug in WvOut tickFrame( const StkFrames &frames ) function.
|
||||
- Fixed bug in demo.cpp when writing output soundfiles without realtime output.
|
||||
- Added "binary" open flag to MidiFileIn class for Windows.
|
||||
- Fixed oversized MAT-file header in WvOut.cpp
|
||||
- Fixed case statement bug in MidiFileIn.cpp for sysex.
|
||||
- Added missing getDelay() function to DelayA.cpp.
|
||||
- Fixed modDepth omission in Chorus.cpp.
|
||||
- Fixed DC blocker initialization bug in Flute.cpp.
|
||||
- Changed Filter class behavior so no default clearing of state when changing coefficients.
|
||||
- Fixes to RtAudio, especially for Windows DirectSound and ASIO (thanks to Robin Davies).
|
||||
|
||||
\subsection v4dot2dot0 Version 4.2.0
|
||||
|
||||
<ul>
|
||||
<li>Simultaneous multiple audio APIs supported at compile time.</li>
|
||||
<li>Various changes to better conform to standard C++ programming practices.</li>
|
||||
<li>Fixed hidden overloaded virtual functions.</li>
|
||||
<li>New Asymp exponential envelope class.</li>
|
||||
<li><tt>MY_FLOAT</tt> type converted to <tt>StkFloat</tt> and changed throughout (use \c treesed utility to search/replace in old files).</li>
|
||||
<li>Most example programs rewritten to use an audio callback paradigm (which works better in OS-X).</li>
|
||||
<li>New StkFrames class for vectorized multichannel data and associated new tick() functions making use of StkFrames.</li>
|
||||
<li>New RtMidi class with MIDI output capabilities (API changes).</li>
|
||||
<li>New MidiFileIn class for reading MIDI files.</li>
|
||||
<li>Revised Filter classes to use std::vectors for coefficients (API changes).</li>
|
||||
<li>Revised Messager class (API changes).</li>
|
||||
<li>New abstract parent Effect class for various effects.</li>
|
||||
<li>New abstract parent Generator class for various signal sources.</li>
|
||||
<li>New abstract parent Function class for tables and various non-linear functions.</li>
|
||||
<li>Skini class completely rewritten (simplified) using the C++ STL (API changes).</li>
|
||||
<li>WvOut classes now clip to -1.0 to +1.0 and report out of range.</li>
|
||||
<li>New Mutex class.</li>
|
||||
<li>Turned Nagle algorithm off by default in Socket class.</li>
|
||||
<li>Error reporting standardized in all classes.</li>
|
||||
</ul>
|
||||
- Simultaneous multiple audio APIs supported at compile time.
|
||||
- Various changes to better conform to standard C++ programming practices.
|
||||
- Fixed hidden overloaded virtual functions.
|
||||
- New Asymp exponential envelope class.
|
||||
- <tt>MY_FLOAT</tt> type converted to <tt>StkFloat</tt> and changed throughout (use \c treesed utility to search/replace in old files).
|
||||
- Most example programs rewritten to use an audio callback paradigm (which works better in OS-X).
|
||||
- New StkFrames class for vectorized multichannel data and associated new tick() functions making use of StkFrames.
|
||||
- New RtMidi class with MIDI output capabilities (API changes).
|
||||
- New MidiFileIn class for reading MIDI files.
|
||||
- Revised Filter classes to use std::vectors for coefficients (API changes).
|
||||
- Revised Messager class (API changes).
|
||||
- New abstract parent Effect class for various effects.
|
||||
- New abstract parent Generator class for various signal sources.
|
||||
- New abstract parent Function class for tables and various non-linear functions.
|
||||
- Skini class completely rewritten (simplified) using the C++ STL (API changes).
|
||||
- WvOut classes now clip to -1.0 to +1.0 and report out of range.
|
||||
- New Mutex class.
|
||||
- Turned Nagle algorithm off by default in Socket class.
|
||||
- Error reporting standardized in all classes.
|
||||
|
||||
\subsection v4dot1dot3 Version 4.1.3
|
||||
|
||||
<ul>
|
||||
<li>Bug fix in RtAudio for Windows DirectSound output only support</li>
|
||||
</ul>
|
||||
- Bug fix in RtAudio for Windows DirectSound output only support
|
||||
|
||||
\subsection v4dot1dot2 Version 4.1.2
|
||||
|
||||
<UL>
|
||||
<li>Added Linux JACK support to RtAudio.</li>
|
||||
<li>Added optional doNormalize argument to WvIn to allow specification of data normalization or not.</li>
|
||||
<li>Added volume control to demo program and various tcl scripts.</li>
|
||||
<li>Added support for dynamic rawwavePath() setting.</li>
|
||||
<li>WaveLoop bug fix.</li>
|
||||
<li>Fixed bug in ADSR::setReleaseTime() method.</li>
|
||||
<li>Fixed missing initialization of apInput in non-default constructor of DelayA class.</li>
|
||||
<li>Added time seeding of random number generator to Noise constructor.</li>
|
||||
<li>Update to the contentsAt() method of Delay class.</li>
|
||||
<li>WAV file fixes (8-bit) in WvIn and WvOut classes.</li>
|
||||
<li>Configure script changes.</li>
|
||||
<li>Updated \<iostream\> include statements and appended "std::" as necessary throughout for compatibility with gcc 3.</li>
|
||||
</UL>
|
||||
- Added Linux JACK support to RtAudio.
|
||||
- Added optional doNormalize argument to WvIn to allow specification of data normalization or not.
|
||||
- Added volume control to demo program and various tcl scripts.
|
||||
- Added support for dynamic rawwavePath() setting.
|
||||
- WaveLoop bug fix.
|
||||
- Fixed bug in ADSR::setReleaseTime() method.
|
||||
- Fixed missing initialization of apInput in non-default constructor of DelayA class.
|
||||
- Added time seeding of random number generator to Noise constructor.
|
||||
- Update to the contentsAt() method of Delay class.
|
||||
- WAV file fixes (8-bit) in WvIn and WvOut classes.
|
||||
- Configure script changes.
|
||||
- Updated \<iostream\> include statements and appended "std::" as necessary throughout for compatibility with gcc 3.
|
||||
|
||||
\subsection v4dot1dot1 Version 4.1.1
|
||||
<ul>
|
||||
<li>Bug fix in RtAudio for Macintosh OS X and Windows ASIO duplex operation.</li>
|
||||
<li>Windows ASIO fix in Stk.h.</li>
|
||||
<li>Documentation updates.</li>
|
||||
<li>Expanded tutorial.</li>
|
||||
<li>Fixed RtDuplex omission in src Makefile.</li>
|
||||
</ul>
|
||||
- Bug fix in RtAudio for Macintosh OS X and Windows ASIO duplex operation.
|
||||
- Windows ASIO fix in Stk.h.
|
||||
- Documentation updates.
|
||||
- Expanded tutorial.
|
||||
- Fixed RtDuplex omission in src Makefile.
|
||||
|
||||
\subsection v4dot1 Version 4.1
|
||||
|
||||
<UL>
|
||||
<LI>Macintosh OS X support added.</LI>
|
||||
<LI>New Whistle class.</LI>
|
||||
<LI>Added Voicer, SingWave, and VoicForm classes.</LI>
|
||||
<LI>Improvements/fixes to the banded waveguide instruments.</LI>
|
||||
<LI>Demo program now uses Voicer, allowing polyphony.</LI>
|
||||
<LI>Demo tcl/tk scripts changed to use SKINI PitchChange instead of PitchBend.</LI>
|
||||
<LI>Demo program response to PitchBend modified to octave up/down.</LI>
|
||||
<LI>Several RtAudio fixes and improvements (OS X and Windows ASIO support added).</LI>
|
||||
<LI>Added nextOut() method to Delay classes.</LI>
|
||||
<LI>Documentation fixes for Reverb classes.</LI>
|
||||
<LI>RAWWAVE_PATH changed to include the "rawwave" directory.</LI>
|
||||
<LI>"configure" support added for unix systems.</LI>
|
||||
<LI>Multivoice flag (-n NUMBER) added as command line option to demo program.</LI>
|
||||
<LI>Sample rate flag added as command line option to example programs.</LI>
|
||||
<LI>Socket port number added as command line option to example programs.</LI>
|
||||
</UL>
|
||||
- Macintosh OS X support added.
|
||||
- New Whistle class.
|
||||
- Added Voicer, SingWave, and VoicForm classes.
|
||||
- Improvements/fixes to the banded waveguide instruments.
|
||||
- Demo program now uses Voicer, allowing polyphony.
|
||||
- Demo tcl/tk scripts changed to use SKINI PitchChange instead of PitchBend.
|
||||
- Demo program response to PitchBend modified to octave up/down.
|
||||
- Several RtAudio fixes and improvements (OS X and Windows ASIO support added).
|
||||
- Added nextOut() method to Delay classes.
|
||||
- Documentation fixes for Reverb classes.
|
||||
- RAWWAVE_PATH changed to include the "rawwave" directory.
|
||||
- "configure" support added for unix systems.
|
||||
- Multivoice flag (-n NUMBER) added as command line option to demo program.
|
||||
- Sample rate flag added as command line option to example programs.
|
||||
- Socket port number added as command line option to example programs.
|
||||
|
||||
\subsection v4 Version 4.0
|
||||
|
||||
<UL>
|
||||
<LI>New documentation and tutorial.</LI>
|
||||
<LI>Several new instruments, including Saxofony, BlowBotl, and StifKarp.</LI>
|
||||
<LI>New Stk base class, replacing Object class.</LI>
|
||||
<LI>New Filter class structure and methods.</LI>
|
||||
<LI>Extensive modifications to WvIn and WvOut class structures and methods.</LI>
|
||||
<LI>Looping functionality moved to WaveLoop (subclass of WvIn).</LI>
|
||||
<LI>Automatic file type detection in WvIn ... hosed WavWvIn, AifWvIn, RawWavIn, SndWavIn, and MatWvIn subclasses.</LI>
|
||||
<LI>New file type specifier argument in WvOut ... hosed WavWvOut, AifWvOut, RawWavOut, SndWavOut, and MatWvOut subclasses.</LI>
|
||||
<LI>Some simplifications of Messager class (was Controller).</LI>
|
||||
<LI>New independent RtAudio class.</LI>
|
||||
<LI>Extensive revisions in code and a significant number of API changes.</LI>
|
||||
</UL>
|
||||
- New documentation and tutorial.
|
||||
- Several new instruments, including Saxofony, BlowBotl, and StifKarp.
|
||||
- New Stk base class, replacing Object class.
|
||||
- New Filter class structure and methods.
|
||||
- Extensive modifications to WvIn and WvOut class structures and methods.
|
||||
- Looping functionality moved to WaveLoop (subclass of WvIn).
|
||||
- Automatic file type detection in WvIn ... hosed WavWvIn, AifWvIn, RawWavIn, SndWavIn, and MatWvIn subclasses.
|
||||
- New file type specifier argument in WvOut ... hosed WavWvOut, AifWvOut, RawWavOut, SndWavOut, and MatWvOut subclasses.
|
||||
- Some simplifications of Messager class (was Controller).
|
||||
- New independent RtAudio class.
|
||||
- Extensive revisions in code and a significant number of API changes.
|
||||
|
||||
\subsection v3dot2 Version 3.2
|
||||
|
||||
<UL>
|
||||
<LI>New input control handling class (Controller)</LI>
|
||||
<LI>Added AIFF file input/output support.</LI>
|
||||
<LI>New C++ error handling capabilities.</LI>
|
||||
<LI>New input/output internet streaming support (StrmWvIn/StrmWvOut).</LI>
|
||||
<LI>Added native ALSA support for linux.</LI>
|
||||
<LI>Added optional "device" argument to all "Rt" classes (audio and MIDI) and printout of devices when argument is invalid.</LI>
|
||||
<LI>WvIn classes rewritten to support very big files (incremental load from disk).</LI>
|
||||
<LI>Changed WvIn/WvOut classes to work with sample frame buffers.</LI>
|
||||
<LI>Fixed looping and negative rate calculations in WvIn classes.</LI>
|
||||
<LI>Fixed interpolation bug in RtWvIn.</LI>
|
||||
<LI>Windoze RtAudio code rewritten (thank Dave!).</LI>
|
||||
<LI>Simplified byte-swapping functions (in-place swapping).</LI>
|
||||
<LI>"Stereo-ized" RagaMatic.</LI>
|
||||
<LI>Miscellaneous renamings.</LI>
|
||||
<LI>Probably a bunch more fixes that I've long since forgotten about.</LI>
|
||||
</UL>
|
||||
- New input control handling class (Controller)
|
||||
- Added AIFF file input/output support.
|
||||
- New C++ error handling capabilities.
|
||||
- New input/output internet streaming support (StrmWvIn/StrmWvOut).
|
||||
- Added native ALSA support for linux.
|
||||
- Added optional "device" argument to all "Rt" classes (audio and MIDI) and printout of devices when argument is invalid.
|
||||
- WvIn classes rewritten to support very big files (incremental load from disk).
|
||||
- Changed WvIn/WvOut classes to work with sample frame buffers.
|
||||
- Fixed looping and negative rate calculations in WvIn classes.
|
||||
- Fixed interpolation bug in RtWvIn.
|
||||
- Windoze RtAudio code rewritten (thank Dave!).
|
||||
- Simplified byte-swapping functions (in-place swapping).
|
||||
- "Stereo-ized" RagaMatic.
|
||||
- Miscellaneous renamings.
|
||||
- Probably a bunch more fixes that I've long since forgotten about.
|
||||
|
||||
\subsection v3dot1 Version 3.1
|
||||
|
||||
<UL>
|
||||
<LI>New RagaMatic project ... very cool!!!</LI>
|
||||
<LI>Less clipping in the Shakers class.</LI>
|
||||
<LI>Added "microphone position" to Mandolin in STKdemo.</LI>
|
||||
<LI>Fixed MIDI system message exclusion under Irix.</LI>
|
||||
<LI>Added a few bitmaps for the Shaker instruments.</LI>
|
||||
<LI>Made destructors virtual for Reverb.h, WvIn.h and Simple.h.</LI>
|
||||
<LI>Fixed bug setting delay length in DLineA when value too big.</LI>
|
||||
<LI>Fixed bug in WinMM realtime code (RTSoundIO).</LI>
|
||||
<LI>Added tick() method to BowTabl, JetTabl, and ReedTabl (same as lookup).</LI>
|
||||
<LI>Switched to pthread API on SGI platforms.</LI>
|
||||
<LI>Added some defines to Object.h for random number generation, FPU overflow checking, etc....</LI>
|
||||
<LI>A few minor changes, some bug fixes ... can't remember all of them.</LI>
|
||||
</UL>
|
||||
- New RagaMatic project ... very cool!!!
|
||||
- Less clipping in the Shakers class.
|
||||
- Added "microphone position" to Mandolin in STKdemo.
|
||||
- Fixed MIDI system message exclusion under Irix.
|
||||
- Added a few bitmaps for the Shaker instruments.
|
||||
- Made destructors virtual for Reverb.h, WvIn.h and Simple.h.
|
||||
- Fixed bug setting delay length in DLineA when value too big.
|
||||
- Fixed bug in WinMM realtime code (RTSoundIO).
|
||||
- Added tick() method to BowTabl, JetTabl, and ReedTabl (same as lookup).
|
||||
- Switched to pthread API on SGI platforms.
|
||||
- Added some defines to Object.h for random number generation, FPU overflow checking, etc....
|
||||
- A few minor changes, some bug fixes ... can't remember all of them.
|
||||
|
||||
\subsection v3 Version 3.0
|
||||
|
||||
<UL>
|
||||
<LI>New #define flags for OS and realtime dependencies (this will probably cause problems for old personal STK code, but it was necessary to make future ports easier).</LI>
|
||||
<LI>Expanded and cleaned the Shakers class.</LI>
|
||||
<LI>New BowedBar algorithm/class.</LI>
|
||||
<LI>Fixed Linux MIDI input bug.</LI>
|
||||
<LI>Fixed MIDI status masking problem in Windows.</LI>
|
||||
<LI>OS type defines now in Makefile.</LI>
|
||||
<LI>New RAWWAVE_PATH define in Object.h.</LI>
|
||||
<LI>Syntmono project pulled out to separate directory and cleaned up.</LI>
|
||||
<LI>Socketing capabilities under Unix, as well as Windoze.</LI>
|
||||
<LI>Multiple simultaneous socket client connections to STK servers now possible.</LI>
|
||||
<LI>MD2SKINI now can merge MIDI and piped messages under Irix and Linux (for TCL->MD2SKINI->syntmono control).</LI>
|
||||
<LI>Defined INT16 and INT32 types and fixed various WvIn and WvOut classes.</LI>
|
||||
<LI>Updated MatWvIn and MatWvOut for new MAT-file documentation from Matlab.</LI>
|
||||
<LI>New demo Tcl/Tk GUI (TclDemo.tcl).</LI>
|
||||
<LI>Minor fixes to FM behavior.</LI>
|
||||
<LI>Added record/duplex capabilities to RTSoundIO (Linux, SGI, and Windoze).</LI>
|
||||
<LI>Fixed bugs in WavWvOut and MatWvOut header specifications.</LI>
|
||||
<LI>Added RawWvOut class.</LI>
|
||||
<LI>New WvIn class with RawWvIn, SndWvIn, WavWvIn, MatWvIn, and RTWvIn subclasses.</LI>
|
||||
<LI>Removed RawWave, RawShot, RawInterp, and RawLoop classes (supplanted by RawWvIn).</LI>
|
||||
<LI>Multi-channel data support in WvIn and WvOut classes using MY_MULTI data type (pointer to StkFloat) and the methods mtick() and mlastOutput().</LI>
|
||||
<LI>Now writing to primary buffer under Windoze when allowed by hardware.</LI>
|
||||
<LI>Cleaned up Object.h a bit.</LI>
|
||||
<LI>Pulled various utility and thread functions out of syntmono.cpp (to aid readability of the code).</LI>
|
||||
</UL>
|
||||
- New #define flags for OS and realtime dependencies (this will probably cause problems for old personal STK code, but it was necessary to make future ports easier).
|
||||
- Expanded and cleaned the Shakers class.
|
||||
- New BowedBar algorithm/class.
|
||||
- Fixed Linux MIDI input bug.
|
||||
- Fixed MIDI status masking problem in Windows.
|
||||
- OS type defines now in Makefile.
|
||||
- New RAWWAVE_PATH define in Object.h.
|
||||
- Syntmono project pulled out to separate directory and cleaned up.
|
||||
- Socketing capabilities under Unix, as well as Windoze.
|
||||
- Multiple simultaneous socket client connections to STK servers now possible.
|
||||
- MD2SKINI now can merge MIDI and piped messages under Irix and Linux (for TCL->MD2SKINI->syntmono control).
|
||||
- Defined INT16 and INT32 types and fixed various WvIn and WvOut classes.
|
||||
- Updated MatWvIn and MatWvOut for new MAT-file documentation from Matlab.
|
||||
- New demo Tcl/Tk GUI (TclDemo.tcl).
|
||||
- Minor fixes to FM behavior.
|
||||
- Added record/duplex capabilities to RTSoundIO (Linux, SGI, and Windoze).
|
||||
- Fixed bugs in WavWvOut and MatWvOut header specifications.
|
||||
- Added RawWvOut class.
|
||||
- New WvIn class with RawWvIn, SndWvIn, WavWvIn, MatWvIn, and RTWvIn subclasses.
|
||||
- Removed RawWave, RawShot, RawInterp, and RawLoop classes (supplanted by RawWvIn).
|
||||
- Multi-channel data support in WvIn and WvOut classes using MY_MULTI data type (pointer to StkFloat) and the methods mtick() and mlastOutput().
|
||||
- Now writing to primary buffer under Windoze when allowed by hardware.
|
||||
- Cleaned up Object.h a bit.
|
||||
- Pulled various utility and thread functions out of syntmono.cpp (to aid readability of the code).
|
||||
|
||||
\subsection v2dot02 Version 2.02
|
||||
|
||||
<UL>
|
||||
<LI>Created RawWave abstract class, with subclasses of RawLoop (looping rawwave oscillator), RawShot (non-looping, non-interpolating rawwave player ... used to be RawWvIn), and RawInterp (looping or non-looping, interpolating rawwave player ... used to be RawWave).</LI>
|
||||
<LI>Modified DrumSynt to correctly handle sample rates different than 22050 Hz.</LI>
|
||||
<LI>Modified syntmono parsing vs. tick routine so that some ticking occurs between each message. When multiple messages are waiting to be processed, the time between message updates is inversely proportional to the number of messages in the buffer.</LI>
|
||||
<LI>Fixed DirectSound playback bug in WinXX distribution. Sound was being played at 8-bit, 22 kHz in all cases. Playback is now 16-bit and dependent on SRATE.</LI>
|
||||
<LI>Fixed bug in MD2SKINI which prevented some NoteOff statements from being output.</LI>
|
||||
<LI>This distribution includes an example STK project, mus151, which demonstrates a means for keeping a user's personal projects separate from the main distribution. This is highly recommended, in order to simplify upgrades to future STK releases.</LI>
|
||||
</UL>
|
||||
- Created RawWave abstract class, with subclasses of RawLoop (looping rawwave oscillator), RawShot (non-looping, non-interpolating rawwave player ... used to be RawWvIn), and RawInterp (looping or non-looping, interpolating rawwave player ... used to be RawWave).
|
||||
- Modified DrumSynt to correctly handle sample rates different than 22050 Hz.
|
||||
- Modified syntmono parsing vs. tick routine so that some ticking occurs between each message. When multiple messages are waiting to be processed, the time between message updates is inversely proportional to the number of messages in the buffer.
|
||||
- Fixed DirectSound playback bug in WinXX distribution. Sound was being played at 8-bit, 22 kHz in all cases. Playback is now 16-bit and dependent on SRATE.
|
||||
- Fixed bug in MD2SKINI which prevented some NoteOff statements from being output.
|
||||
- This distribution includes an example STK project, mus151, which demonstrates a means for keeping a user's personal projects separate from the main distribution. This is highly recommended, in order to simplify upgrades to future STK releases.
|
||||
|
||||
\subsection v2 Version 2
|
||||
|
||||
<UL>
|
||||
<LI>Unification of the capabilities of STK across the various platforms. All of the previous SGI functionality has been ported to Linux and Windows, including realtime sound output and MIDI input.</LI>
|
||||
<LI>MIDI input (with optional time-stamping) supported on SGI, Linux (OSS device drivers only), and Windows operating systems. Time stamping under IRIX and Windows is quantized to milliseconds and under Linux to hundredths of a second.</LI>
|
||||
<LI>Various Sound Output Options - .wav, .snd, and .mat (Matlab MAT-file) soundfile outputs are supported on all operating systems. I hacked out the MAT-file structure, so you don't have to include any platform-specific libraries. Realtime sound output is provided as well, except under NeXTStep.</LI>
|
||||
<LI>Multiple Reverberator Implementations - Reverb subclasses of JCRev and NRev (popular reverberator implementations from CCRMA) have been written. Perry's original reverb implementation still exists as PRCRev. All reverberators now take a T60 initializer argument.</LI>
|
||||
<LI>MD2SKINI - A program which parses a MIDI input stream and spits out SKINI code. The output of MD2SKINI is typically piped into an STK instrument executable (eg. <tt>MD2SKINI | syntmono Clarinet -r -i</tt>). In addition, you can supply a filename argument to MD2SKINI and have it simultaneously record a SKINI score file for future reuse.</LI>
|
||||
<LI>Modifications to <I>Object.h</I> for OS_TYPE compilation dependencies. <I>Makefile</I> automatically determines OS_TYPE when invoked (if you have the GNU makefile utilities installed on your system).</LI>
|
||||
<LI>A single distribution for all platforms. The Unix and Windows versions have been merged into a single set of classes. Makefiles and Visual C++ workspace/project files are provided for compiling.</LI>
|
||||
</UL>
|
||||
- Unification of the capabilities of STK across the various platforms. All of the previous SGI functionality has been ported to Linux and Windows, including realtime sound output and MIDI input.
|
||||
- MIDI input (with optional time-stamping) supported on SGI, Linux (OSS device drivers only), and Windows operating systems. Time stamping under IRIX and Windows is quantized to milliseconds and under Linux to hundredths of a second.
|
||||
- Various Sound Output Options - .wav, .snd, and .mat (Matlab MAT-file) soundfile outputs are supported on all operating systems. I hacked out the MAT-file structure, so you don't have to include any platform-specific libraries. Realtime sound output is provided as well, except under NeXTStep.
|
||||
- Multiple Reverberator Implementations - Reverb subclasses of JCRev and NRev (popular reverberator implementations from CCRMA) have been written. Perry's original reverb implementation still exists as PRCRev. All reverberators now take a T60 initializer argument.
|
||||
- MD2SKINI - A program which parses a MIDI input stream and spits out SKINI code. The output of MD2SKINI is typically piped into an STK instrument executable (eg. <tt>MD2SKINI | syntmono Clarinet -r -i</tt>). In addition, you can supply a filename argument to MD2SKINI and have it simultaneously record a SKINI score file for future reuse.
|
||||
- Modifications to <I>Object.h</I> for OS_TYPE compilation dependencies. <I>Makefile</I> automatically determines OS_TYPE when invoked (if you have the GNU makefile utilities installed on your system).
|
||||
- A single distribution for all platforms. The Unix and Windows versions have been merged into a single set of classes. Makefiles and Visual C++ workspace/project files are provided for compiling.
|
||||
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ work with any standard C++ compiler.
|
||||
STK WWW site: http://ccrma.stanford.edu/software/stk/
|
||||
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
Copyright (c) 1995--2014 Perry R. Cook and Gary P. Scavone
|
||||
Copyright (c) 1995--2017 Perry R. Cook and Gary P. Scavone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<table>
|
||||
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
||||
<tr><td>©1995--2014 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
<tr><td>©1995--2017 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
</table>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
/*! \page tutorial Tutorial
|
||||
|
||||
The Synthesis ToolKit is a set of C++ classes. In order to go beyond the simple example programs we provide, it is necessary to know some basics about programming in C and C++. STK's "target audience" includes people who:
|
||||
<UL>
|
||||
<LI>want to create audio DSP and/or synthesis programs</LI>
|
||||
<LI>want to use our unit generators and input/output routines rather than code their own</LI>
|
||||
<LI>want to learn about synthesis and processing algorithms</LI>
|
||||
<LI>wish to teach real-time synthesis and processing and wish to use some of our classes and examples</LI>
|
||||
</UL>
|
||||
- want to create audio DSP and/or synthesis programs
|
||||
- want to use our unit generators and input/output routines rather than code their own
|
||||
- want to learn about synthesis and processing algorithms
|
||||
- wish to teach real-time synthesis and processing and wish to use some of our classes and examples
|
||||
|
||||
Most ToolKit programmers will likely end up writing a class or two for their own particular needs, but this task is typically simplified by making use of pre-existing STK classes (filters, oscillators, etc.).
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ The top level distribution contains the following directories:
|
||||
This release of STK comes with four separate "project" directories:
|
||||
|
||||
<OL>
|
||||
<LI> The <I><B>demo</B></I> project is used to demonstrate nearly all of the STK instruments. The <I><B>demo</B></I> program has been written to allow a variety of control input and sound data output options. Simple graphical user interfaces (GUIs) are also provided.<P></LI>
|
||||
<LI> The <I><B>demo</B></I> project is used to demonstrate nearly all of the STK instruments. The <I><B>stk-demo</B></I> program has been written to allow a variety of control input and sound data output options. Simple graphical user interfaces (GUIs) are also provided.<P></LI>
|
||||
|
||||
<LI> The <I><B>effects</B></I> project demonstrates realtime duplex mode (simultaneous audio input and output) operation, when available, as well as various delay-line based effects algorithms.<P></LI>
|
||||
|
||||
@@ -134,23 +134,23 @@ The <I><B>demo</B></I> project demonstrates the behavior of all the distributed
|
||||
|
||||
See the information above with respect to compiling STK for non-realtime use.
|
||||
|
||||
In non-realtime mode, it is assumed that input control messages are provided from a SKINI scorefile and that audio output is written to a soundfile (.snd, .wav, .aif, .mat, .raw). A number of SKINI scorefiles are provided in the <I>scores</I> directory of the <I><B>demo</B></I> project. Assuming a successful compilation of the <I><B>demo</B></I> program, typing:
|
||||
In non-realtime mode, it is assumed that input control messages are provided from a SKINI scorefile and that audio output is written to a soundfile (.snd, .wav, .aif, .mat, .raw). A number of SKINI scorefiles are provided in the <I>scores</I> directory of the <I><B>demo</B></I> project. Assuming a successful compilation of the <I><B>stk-demo</B></I> program, typing:
|
||||
|
||||
\code
|
||||
demo BeeThree -ow myfile.wav -if scores/bookert.ski
|
||||
stk-demo BeeThree -ow myfile.wav -if scores/bookert.ski
|
||||
\endcode
|
||||
|
||||
from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I> using the STK BeeThree instrument and write the resulting audio data to a WAV formatted soundfile called "myfile.wav" (note that you may need to append <TT>./</TT> to the program name if your default shell setup is not set to look in the current directory). Typing <TT>demo</TT> without any arguments will provide a full program usage description.
|
||||
from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I> using the STK BeeThree instrument and write the resulting audio data to a WAV formatted soundfile called "myfile.wav" (note that you may need to append <TT>./</TT> to the program name if your default shell setup is not set to look in the current directory). Typing <TT>stk-demo</TT> without any arguments will provide a full program usage description.
|
||||
|
||||
|
||||
\section rt Demo: Realtime Use
|
||||
|
||||
STK realtime audio and MIDI input/output and realtime SKINI control input via socketing support is provided for Linux, Mac OS-X, and Windows95/98/2000/XP operating systems. STK realtime SKINI control input via piping is possible under Linux, Mac OS X, and Windows2000/XP only.
|
||||
<P>
|
||||
Control input and audio output options are typically specified as command-line arguments to STK programs. For example, the <I><B>demo</B></I> program is invoked as:
|
||||
Control input and audio output options are typically specified as command-line arguments to STK programs. For example, the <I><B>stk-demo</B></I> program is invoked as:
|
||||
|
||||
\code
|
||||
demo instrument flags
|
||||
stk-demo instrument flags
|
||||
\endcode
|
||||
|
||||
where instruments include those described above and flags can be any or all of:
|
||||
@@ -167,13 +167,13 @@ where instruments include those described above and flags can be any or all of:
|
||||
</UL>
|
||||
The <i>-ip</i> flag must be used when piping realtime SKINI control data to an STK program. The <i>-im</i> flag must be used to read MIDI control input from your MIDI port. Note that you can use both input types simultaneously.
|
||||
|
||||
Assuming a successful compilation of the <I><B>demo</B></I> program, typing:
|
||||
Assuming a successful compilation of the <I><B>stk-demo</B></I> program, typing:
|
||||
|
||||
\code
|
||||
demo BeeThree -or -if scores/bookert.ski
|
||||
stk-demo BeeThree -or -if scores/bookert.ski
|
||||
\endcode
|
||||
|
||||
from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I> using the STK BeeThree instrument and stream the resulting audio data in realtime to the audio output channel of your computer. Typing <TT>demo</TT> without any arguments will provide a full program usage description.
|
||||
from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I> using the STK BeeThree instrument and stream the resulting audio data in realtime to the audio output channel of your computer. Typing <TT>stk-demo</TT> without any arguments will provide a full program usage description.
|
||||
|
||||
|
||||
\section tcl Realtime Control Input using Tcl/Tk Graphical User Interfaces:
|
||||
@@ -181,7 +181,7 @@ from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I>
|
||||
There are a number of <A HREF="http://dev.scriptics.com">Tcl/Tk</A> GUIs supplied with the STK projects. These scripts require Tcl/Tk version 8.0 or later, which can be downloaded for free over the WWW. On Unix and Windows2000/XP platforms, you can run the various executable scripts (e.g. StkDemo.bat) provided with each project to start everything up (you may need to symbolically link the wishXX executable to the name <I>wish</I>). The Physical.bat script just implements the following command-line sequence:
|
||||
|
||||
\code
|
||||
wish < tcl/Physical.tcl | demo Clarinet -or -ip
|
||||
wish < tcl/Physical.tcl | stk-demo Clarinet -or -ip
|
||||
\endcode
|
||||
|
||||
\section midi Realtime MIDI Control Input:
|
||||
@@ -189,17 +189,17 @@ wish < tcl/Physical.tcl | demo Clarinet -or -ip
|
||||
On all supported realtime platforms, you can direct realtime MIDI input to the STK Clarinet by typing:
|
||||
|
||||
\code
|
||||
demo Clarinet -or -im
|
||||
stk-demo Clarinet -or -im
|
||||
\endcode
|
||||
|
||||
This will attempt to use the default MIDI port for input. An optional MIDI port number can be specified after the <TT>-im</TT> flag. Valid MIDI ports are numbered from 0 (default) and higher. On Linux and Macintosh OS-X systems, it is possible to open a virtual MIDI input port (that other software applications can connect to) by specifying a port identifier of -1.
|
||||
|
||||
\section polyphony Polyphony:
|
||||
|
||||
The <I><B>demo</B></I> program supports an arbitrary number of voices via the <TT>-n NUMBER</TT> command-line flag and argument. For example, you can play eight BeeThree instruments with realtime output and control them from a MIDI device by typing:
|
||||
The <I><B>stk-demo</B></I> program supports an arbitrary number of voices via the <TT>-n NUMBER</TT> command-line flag and argument. For example, you can play eight BeeThree instruments with realtime output and control them from a MIDI device by typing:
|
||||
|
||||
\code
|
||||
demo BeeThree -n 8 -or -im
|
||||
stk-demo BeeThree -n 8 -or -im
|
||||
\endcode
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
STK: A ToolKit of Audio Synthesis Classes and Instruments in C++
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
|
||||
STK Classes - See the HTML documentation in the html directory for complete information.
|
||||
|
||||
@@ -173,7 +173,7 @@ effects.cpp Effects demonstration program
|
||||
ragamatic.cpp Nirvana just waiting to happen
|
||||
|
||||
Skini.cpp SKINI file/message parser object
|
||||
SKINI.msg #defines for often used and universal MIDI/SKINI symbols
|
||||
SKINI.tbl Table of SKINI messages
|
||||
SKINImsg.h #defines for often used and universal MIDI/SKINI symbols
|
||||
SKINItbl.h Table of SKINI messages
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
##Setup
|
||||
This file contains instructions for integrating the STK in Xcode projects and solutions to common integration issues.
|
||||
|
||||
## Setup
|
||||
|
||||
### If you have [Cocoapods](http://cocoapods.org/)
|
||||
|
||||
1. Add `pod 'STK', '~> 4.5'` to your Podfile.
|
||||
|
||||
1. Run `pod install`
|
||||
|
||||
### If you don't have Cocoapods
|
||||
|
||||
1. Clone or [download][download_link] the STK into your project's directory.
|
||||
|
||||
@@ -11,7 +21,7 @@
|
||||
![][header_search_paths_screenshot]
|
||||
|
||||
|
||||
##Usage
|
||||
## Usage
|
||||
|
||||
1. Import the STK classes in the source files you require.
|
||||
* E.g. `#import "SineWave.h"`
|
||||
@@ -22,9 +32,9 @@
|
||||
You can also look at the [iOS Demo project](..projects/demo/iOS%20Demo) for a sample usage.
|
||||
|
||||
|
||||
##Troubleshooting
|
||||
## Troubleshooting
|
||||
|
||||
###'FileName.h' file not found
|
||||
### 'FileName.h' file not found
|
||||
|
||||
If you get this error when `#import`ing an STK header, you have added the wrong header search path for the STK in your project's settings (see Step 4 in Setup)
|
||||
|
||||
@@ -36,11 +46,23 @@ If this problem doesn't go away:
|
||||
1. Move the STK directory within your project's directory.
|
||||
1. Follow step 1 from **Setup**, add `stk/include` to the *Header Search Paths*.
|
||||
|
||||
###FileRead::open: could not open or find file (../../rawwaves/filename.raw)!
|
||||
If that doesn't solve it:
|
||||
Install Cocoapods and use it to install the STK. It takes one minute and will make your life easier. Visit the [Cocoapods website](http://cocoapods.org/) for installation instructions.
|
||||
|
||||
If you use a class that makes use of raw waves (such as `Mandolin`, `Wurley`, or `Rhodey`) you need to copy the STK's raw wave files into your bundle. You'll know you need to if you get this runtime error:
|
||||
### FileRead::open: could not open or find file (../../rawwaves/filename.raw)!
|
||||
|
||||
If you use a class that makes use of raw waves (such as `Mandolin`, `Wurley`, or `Rhodey`) you need to make sure that the STK's raw wave files are copied into your bundle and that the STK knows where they are. You'll know you need to if you get this runtime error:
|
||||
`FileRead::open: could not open or find file (../../rawwaves/filename.raw)!`
|
||||
|
||||
#### If you're using Cocoapods
|
||||
|
||||
Add this code before using a class that needs the raw waves:
|
||||
```objective-c
|
||||
stk::Stk::setRawwavePath([[[NSBundle mainBundle] pathForResource:@"rawwaves" ofType:@"bundle"] UTF8String]);
|
||||
```
|
||||
|
||||
#### If you're not using Cocoapods
|
||||
|
||||
1. Open your project's settings, open the *Build Phases* tab.
|
||||
1. In the *Copy Bundle Resources*, drag and drop **rawwaves.bundle** (it's located in **STK.xcodeproj**'s **Helpers** folder).
|
||||
1. Then add this code before using a class that needs the raw waves:
|
||||
@@ -51,7 +73,7 @@ stk::Stk::setRawwavePath([[rawwaveBundle resourcePath] UTF8String]);
|
||||
```
|
||||
|
||||
|
||||
###rawwaves.bundle: No such file or directory
|
||||
### rawwaves.bundle: No such file or directory
|
||||
|
||||
This means that **rawwaves.bundle** hasn't been copied to the build folder, so you'll need to do it manually:
|
||||
|
||||
@@ -61,7 +83,7 @@ Select the rawwaves scheme:
|
||||
|
||||
Build it (⌘+B) then build your project's main scheme.
|
||||
|
||||
###Apple Mach-O Linker Error
|
||||
### Apple Mach-O Linker Error
|
||||
|
||||
This means that **STKLib.a** isn't being linked to your binary. Follow step 2 above in [Setup](#setup).
|
||||
|
||||
|
||||
@@ -202,8 +202,8 @@
|
||||
B08F60DE18BA9B1800C14A90 /* SingWave.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SingWave.h; path = ../include/SingWave.h; sourceTree = "<group>"; };
|
||||
B08F60DF18BA9B1800C14A90 /* Sitar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Sitar.h; sourceTree = "<group>"; };
|
||||
B08F60E018BA9B1800C14A90 /* Skini.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Skini.h; path = ../include/Skini.h; sourceTree = "<group>"; };
|
||||
B08F60E118BA9B1800C14A90 /* SKINI.msg */ = {isa = PBXFileReference; lastKnownFileType = text; name = SKINI.msg; path = ../include/SKINI.msg; sourceTree = "<group>"; };
|
||||
B08F60E218BA9B1800C14A90 /* SKINI.tbl */ = {isa = PBXFileReference; lastKnownFileType = text; name = SKINI.tbl; path = ../include/SKINI.tbl; sourceTree = "<group>"; };
|
||||
B08F60E118BA9B1800C14A90 /* SKINImsg.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SKINImsg.h; path = ../include/SKINImsg.h; sourceTree = "<group>"; };
|
||||
B08F60E218BA9B1800C14A90 /* SKINItbl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SKINItbl.h; path = ../include/SKINItbl.h; sourceTree = "<group>"; };
|
||||
B08F60E418BA9B1800C14A90 /* Sphere.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Sphere.h; path = ../include/Sphere.h; sourceTree = "<group>"; };
|
||||
B08F60E518BA9B1800C14A90 /* StifKarp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StifKarp.h; sourceTree = "<group>"; };
|
||||
B08F60E618BA9B1800C14A90 /* Stk.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Stk.h; path = ../include/Stk.h; sourceTree = "<group>"; };
|
||||
@@ -666,8 +666,8 @@
|
||||
children = (
|
||||
B08F60E018BA9B1800C14A90 /* Skini.h */,
|
||||
B08F617D18BA9B1800C14A90 /* Skini.cpp */,
|
||||
B08F60E118BA9B1800C14A90 /* SKINI.msg */,
|
||||
B08F60E218BA9B1800C14A90 /* SKINI.tbl */,
|
||||
B08F60E118BA9B1800C14A90 /* SKINImsg.h */,
|
||||
B08F60E218BA9B1800C14A90 /* SKINItbl.h */,
|
||||
);
|
||||
name = SKINI;
|
||||
path = ../src;
|
||||
@@ -726,7 +726,7 @@
|
||||
B08F608818BA9B0600C14A90 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0510;
|
||||
LastUpgradeCheck = 0720;
|
||||
};
|
||||
buildConfigurationList = B08F608B18BA9B0600C14A90 /* Build configuration list for PBXProject "STK" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -895,6 +895,7 @@
|
||||
B08F608C18BA9B0600C14A90 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_TESTABILITY = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
};
|
||||
name = Debug;
|
||||
|
||||
@@ -44,7 +44,13 @@
|
||||
float sample = brass->tick();
|
||||
NSLog(@"Brass sample: %f", sample);
|
||||
}
|
||||
|
||||
|
||||
//We're going to be making use of a class that needs
|
||||
//raw wave files, we need to tell the STK where
|
||||
//the files are:
|
||||
stk::Stk::setRawwavePath([[[NSBundle mainBundle] pathForResource:@"rawwaves" ofType:@"bundle"] UTF8String]);
|
||||
|
||||
|
||||
//Test Mandolin:
|
||||
stk::Mandolin *mandolin = new stk::Mandolin(400);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace stk {
|
||||
be non-negative. All time settings are in seconds and must be
|
||||
positive.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace stk {
|
||||
to \e keyOn and \e keyOff messages by ramping to
|
||||
1.0 on keyOn and to 0.0 on keyOff.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
Methods are provided for creating a resonance or notch in the
|
||||
frequency response while maintaining a constant filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Volume = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace stk {
|
||||
- Register State = 1
|
||||
- Breath Pressure = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace stk {
|
||||
(1986). The output is an instantaneous
|
||||
reflection coefficient value.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace stk {
|
||||
- Frequency = 101
|
||||
- Volume = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
Contributions by Esteban Maestre, 2011.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Volume = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace stk {
|
||||
This class implements a chorus effect. It takes a monophonic
|
||||
input signal and produces a stereo output signal.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Breath Pressure = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace stk {
|
||||
A non-interpolating delay line is typically used in fixed
|
||||
delay-length applications, such as for reverberation.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace stk {
|
||||
minimum delay possible in this implementation is limited to a
|
||||
value of 0.5.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace stk {
|
||||
delay setting. The use of higher order Lagrange interpolators can
|
||||
typically improve (minimize) this attenuation characteristic.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -133,6 +133,33 @@ inline StkFloat DelayL :: nextOut( void )
|
||||
return nextOutput_;
|
||||
}
|
||||
|
||||
inline void DelayL :: setDelay( StkFloat delay )
|
||||
{
|
||||
if ( delay + 1 > inputs_.size() ) { // The value is too big.
|
||||
oStream_ << "DelayL::setDelay: argument (" << delay << ") greater than maximum!";
|
||||
handleError( StkError::WARNING ); return;
|
||||
}
|
||||
|
||||
if (delay < 0 ) {
|
||||
oStream_ << "DelayL::setDelay: argument (" << delay << ") less than zero!";
|
||||
handleError( StkError::WARNING ); return;
|
||||
}
|
||||
|
||||
StkFloat outPointer = inPoint_ - delay; // read chases write
|
||||
delay_ = delay;
|
||||
|
||||
while ( outPointer < 0 )
|
||||
outPointer += inputs_.size(); // modulo maximum length
|
||||
|
||||
outPoint_ = (long) outPointer; // integer part
|
||||
|
||||
alpha_ = outPointer - outPoint_; // fractional part
|
||||
omAlpha_ = (StkFloat) 1.0 - alpha_;
|
||||
|
||||
if ( outPoint_ == inputs_.size() ) outPoint_ = 0;
|
||||
doNextOut_ = true;
|
||||
}
|
||||
|
||||
inline StkFloat DelayL :: tick( StkFloat input )
|
||||
{
|
||||
inputs_[inPoint_++] = input * gain_;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace stk {
|
||||
of simultaneous voices) via a #define in the
|
||||
Drummer.h.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace stk {
|
||||
|
||||
This class implements an echo effect.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace stk {
|
||||
subclasses. It is general enough to support both monophonic and
|
||||
polyphonic input/output classes.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace stk {
|
||||
specified \e rate. It also responds to simple \e keyOn and \e
|
||||
keyOff messages, ramping to 1.0 on keyOn and to 0.0 on keyOff.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace stk {
|
||||
the overloaded one that takes an StkFrames object for
|
||||
multi-channel and/or multi-frame data.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -31,7 +31,8 @@ class FileLoop : protected FileWvIn
|
||||
|
||||
//! Class constructor that opens a specified file.
|
||||
FileLoop( std::string fileName, bool raw = false, bool doNormalize = true,
|
||||
unsigned long chunkThreshold = 1000000, unsigned long chunkSize = 1024 );
|
||||
unsigned long chunkThreshold = 1000000, unsigned long chunkSize = 1024,
|
||||
bool doInt2FloatScaling = true );
|
||||
|
||||
//! Class destructor.
|
||||
~FileLoop( void );
|
||||
@@ -40,13 +41,14 @@ class FileLoop : protected FileWvIn
|
||||
/*!
|
||||
Data from a previously opened file will be overwritten by this
|
||||
function. An StkError will be thrown if the file is not found,
|
||||
its format is unknown, or a read error occurs. If the file data
|
||||
is to be loaded incrementally from disk and normalization is
|
||||
specified, a scaling will be applied with respect to fixed-point
|
||||
limits. If the data format is floating-point, no scaling is
|
||||
performed.
|
||||
its format is unknown, or a read error occurs. If the file length
|
||||
is less than the chunkThreshold limit and \e doNormalize is true,
|
||||
the file data will be normalized with respect to the maximum absolute
|
||||
value of the data. If the \e doInt2FloatScaling flag is true and the
|
||||
input data is fixed-point, a scaling will be applied with respect to
|
||||
the fixed-point limits.
|
||||
*/
|
||||
void openFile( std::string fileName, bool raw = false, bool doNormalize = true );
|
||||
void openFile( std::string fileName, bool raw = false, bool doNormalize = true, bool doInt2FloatScaling = true );
|
||||
|
||||
//! Close a file if one is open.
|
||||
void closeFile( void ) { FileWvIn::closeFile(); };
|
||||
@@ -95,7 +97,7 @@ class FileLoop : protected FileWvIn
|
||||
corresponds to file cycles per second. The frequency can be
|
||||
negative, in which case the loop is read in reverse order.
|
||||
*/
|
||||
void setFrequency( StkFloat frequency ) { this->setRate( file_.fileSize() * frequency / Stk::sampleRate() ); };
|
||||
void setFrequency( StkFloat frequency ) { this->setRate( fileSize_ * frequency / Stk::sampleRate() ); };
|
||||
|
||||
//! Increment the read pointer by \e time samples, modulo file size.
|
||||
void addTime( StkFloat time );
|
||||
@@ -140,17 +142,15 @@ class FileLoop : protected FileWvIn
|
||||
*/
|
||||
StkFloat tick( unsigned int channel = 0 );
|
||||
|
||||
//! Fill the StkFrames argument with computed frames and return the same reference.
|
||||
//! Fill the StkFrames object with computed sample frames, starting at the specified channel and return the same reference.
|
||||
/*!
|
||||
The number of channels in the StkFrames argument should equal
|
||||
the number of channels in the file data. However, this is only
|
||||
checked if _STK_DEBUG_ is defined during compilation, in which
|
||||
case an incompatibility will trigger an StkError exception. If no
|
||||
file data is loaded, the function does nothing (a warning will be
|
||||
issued if _STK_DEBUG_ is defined during compilation and
|
||||
Stk::showWarnings() has been set to \e true).
|
||||
The \c channel argument plus the number of output channels must
|
||||
be less than the number of channels in the StkFrames argument (the
|
||||
first channel is specified by 0). However, range checking is only
|
||||
performed if _STK_DEBUG_ is defined during compilation, in which
|
||||
case an out-of-range value will trigger an StkError exception.
|
||||
*/
|
||||
StkFrames& tick( StkFrames& frames );
|
||||
virtual StkFrames& tick( StkFrames& frames,unsigned int channel = 0 );
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace stk {
|
||||
such variable is found, the sample rate is
|
||||
assumed to be 44100 Hz.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace stk {
|
||||
type, the data type will automatically be modified. Compressed
|
||||
data types are not supported.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -29,13 +29,23 @@ namespace stk {
|
||||
chunkThreshold (in sample frames) will be read incrementally in
|
||||
chunks of \e chunkSize each (also in sample frames).
|
||||
|
||||
For file data read completely into local memory, the \e doNormalize
|
||||
flag can be used to normalize all values with respect to the maximum
|
||||
absolute value of the data.
|
||||
|
||||
If the file data format is fixed point, the flag \e doInt2FloatScaling
|
||||
can be used to control whether the values are scaled with respect to
|
||||
the corresponding fixed-point maximum. For example, if reading 16-bit
|
||||
signed integers, the input values will be scaled by 1 / 32768.0. This
|
||||
scaling will not happen for floating-point file data formats.
|
||||
|
||||
When the file end is reached, subsequent calls to the tick()
|
||||
functions return zeros and isFinished() returns \e true.
|
||||
|
||||
See the FileRead class for a description of the supported audio
|
||||
file formats.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -51,7 +61,8 @@ public:
|
||||
unknown, or a read error occurs.
|
||||
*/
|
||||
FileWvIn( std::string fileName, bool raw = false, bool doNormalize = true,
|
||||
unsigned long chunkThreshold = 1000000, unsigned long chunkSize = 1024 );
|
||||
unsigned long chunkThreshold = 1000000, unsigned long chunkSize = 1024,
|
||||
bool doInt2FloatScaling = true );
|
||||
|
||||
//! Class destructor.
|
||||
~FileWvIn( void );
|
||||
@@ -60,13 +71,14 @@ public:
|
||||
/*!
|
||||
Data from a previously opened file will be overwritten by this
|
||||
function. An StkError will be thrown if the file is not found,
|
||||
its format is unknown, or a read error occurs. If the file data
|
||||
is to be loaded incrementally from disk and normalization is
|
||||
specified, a scaling will be applied with respect to fixed-point
|
||||
limits. If the data format is floating-point, no scaling is
|
||||
performed.
|
||||
its format is unknown, or a read error occurs. If the file length
|
||||
is less than the chunkThreshold limit and \e doNormalize is true,
|
||||
the file data will be normalized with respect to the maximum absolute
|
||||
value of the data. If the \e doInt2FloatScaling flag is true and the
|
||||
input data is fixed-point, a scaling will be applied with respect to
|
||||
the fixed-point limits.
|
||||
*/
|
||||
virtual void openFile( std::string fileName, bool raw = false, bool doNormalize = true );
|
||||
virtual void openFile( std::string fileName, bool raw = false, bool doNormalize = true, bool doInt2FloatScaling = true );
|
||||
|
||||
//! Close a file if one is open.
|
||||
virtual void closeFile( void );
|
||||
@@ -89,7 +101,7 @@ public:
|
||||
virtual void normalize( StkFloat peak );
|
||||
|
||||
//! Return the file size in sample frames.
|
||||
virtual unsigned long getSize( void ) const { return file_.fileSize(); };
|
||||
virtual unsigned long getSize( void ) const { return fileSize_; };
|
||||
|
||||
//! Return the input file sample rate in Hz (not the data read rate).
|
||||
/*!
|
||||
@@ -150,16 +162,15 @@ public:
|
||||
*/
|
||||
virtual StkFloat tick( unsigned int channel = 0 );
|
||||
|
||||
//! Fill the StkFrames argument with computed frames and return the same reference.
|
||||
//! Fill the StkFrames object with computed sample frames, starting at the specified channel and return the same reference.
|
||||
/*!
|
||||
The number of channels in the StkFrames argument must equal
|
||||
the number of channels in the file data. However, this is only
|
||||
checked if _STK_DEBUG_ is defined during compilation, in which
|
||||
case an incompatibility will trigger an StkError exception. If no
|
||||
file data is loaded, the function does nothing (a warning will be
|
||||
issued if _STK_DEBUG_ is defined during compilation).
|
||||
The \c channel argument plus the number of input channels must
|
||||
be less than the number of channels in the StkFrames argument (the
|
||||
first channel is specified by 0). However, range checking is only
|
||||
performed if _STK_DEBUG_ is defined during compilation, in which
|
||||
case an out-of-range value will trigger an StkError exception.
|
||||
*/
|
||||
virtual StkFrames& tick( StkFrames& frames );
|
||||
virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
|
||||
|
||||
protected:
|
||||
|
||||
@@ -168,10 +179,11 @@ protected:
|
||||
FileRead file_;
|
||||
bool finished_;
|
||||
bool interpolate_;
|
||||
bool normalizing_;
|
||||
bool int2floatscaling_;
|
||||
bool chunking_;
|
||||
StkFloat time_;
|
||||
StkFloat rate_;
|
||||
unsigned long fileSize_;
|
||||
unsigned long chunkThreshold_;
|
||||
unsigned long chunkSize_;
|
||||
long chunkPointer_;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
Currently, FileWvOut is non-interpolating and the output rate is
|
||||
always Stk::sampleRate().
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace stk {
|
||||
filter subclasses. It is general enough to support both
|
||||
monophonic and polyphonic input/output classes.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace stk {
|
||||
This structure results in one extra multiply per computed sample,
|
||||
but allows easy control of the overall filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Breath Pressure = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
over time from one frequency setting to another. It provides
|
||||
methods for controlling the sweep rate and target frequency.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
implement tables or other types of input to output function
|
||||
mappings.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
generator sample-source subclasses. It is general enough to
|
||||
support both monophonic and polyphonic output classes.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace stk {
|
||||
This structure results in one extra multiply per computed sample,
|
||||
but allows easy control of the overall filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
data type for the incoming stream is signed 16-bit integers,
|
||||
though any of the defined StkFormats are permissible.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -96,17 +96,18 @@ public:
|
||||
*/
|
||||
StkFloat tick( unsigned int channel = 0 );
|
||||
|
||||
//! Fill the StkFrames argument with computed frames and return the same reference.
|
||||
//! Fill the StkFrames object with computed sample frames, starting at the specified channel and return the same reference.
|
||||
/*!
|
||||
The number of channels in the StkFrames argument must equal the
|
||||
number of channels specified in the listen() function. However,
|
||||
this is only checked if _STK_DEBUG_ is defined during compilation,
|
||||
in which case an incompatibility will trigger an StkError
|
||||
exception. If no connection exists, the function does
|
||||
The \c channel argument plus the number of channels specified
|
||||
in the listen() function must be less than the number of channels
|
||||
in the StkFrames argument (the first channel is specified by 0).
|
||||
However, this is only checked if _STK_DEBUG_ is defined during
|
||||
compilation, in which case an incompatibility will trigger an
|
||||
StkError exception. If no connection exists, the function does
|
||||
nothing (a warning will be issued if _STK_DEBUG_ is defined during
|
||||
compilation).
|
||||
*/
|
||||
StkFrames& tick( StkFrames& frames );
|
||||
StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
|
||||
|
||||
// Called by the thread routine to receive data via the socket connection
|
||||
// and fill the socket buffer. This is not intended for general use but
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
data type is signed 16-bit integers but any of the defined
|
||||
StkFormats are permissible.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace stk {
|
||||
This class provides a common interface for
|
||||
all STK instruments.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace stk {
|
||||
one-pole lowpass filters have been added inside
|
||||
the feedback comb filters.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace stk {
|
||||
Consult Fletcher and Rossing, Karjalainen,
|
||||
Cook, and others for more information.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
- String Detuning = 1
|
||||
- Microphone Position = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace stk {
|
||||
This class is primarily for use in STK example programs but it is
|
||||
generic enough to work in many other contexts.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace stk {
|
||||
(non-sweeping BiQuad filters), where N is set
|
||||
during instantiation.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
- Two Fixed = 7
|
||||
- Clump = 8
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace stk {
|
||||
modulations to give a nice, natural human
|
||||
modulation function.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Gain = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace stk {
|
||||
systems, the pthread library is used. Under
|
||||
Windows, critical sections are used.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace stk {
|
||||
another allpass in series, followed by two allpass filters in
|
||||
parallel with corresponding right and left outputs.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace stk {
|
||||
C rand() function. The quality of the rand()
|
||||
function varies from one OS to another.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
provided for setting the pole position along the real axis of the
|
||||
z-plane while maintaining a constant peak filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
provided for setting the zero position along the real axis of the
|
||||
z-plane while maintaining a constant filter gain.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace stk {
|
||||
allpass and comb delay filters. This class implements two series
|
||||
allpass units and two parallel comb filters.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
set of 32 static phoneme formant parameters
|
||||
and provide access to those values.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
This class implements a simple pitch shifter
|
||||
using delay lines.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace stk {
|
||||
Stanford, bearing the names of Karplus and/or
|
||||
Strong.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace stk {
|
||||
coefficient. Another method is provided to create a DC blocking
|
||||
filter.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace stk {
|
||||
Smith (1986), Hirschman, Cook, Scavone, and
|
||||
others for more information.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace stk {
|
||||
- Zero Radii = 1
|
||||
- Envelope Gain = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace stk {
|
||||
type who should worry about this (making
|
||||
money) worry away.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
RtAudio WWW site: http://www.music.mcgill.ca/~gary/rtaudio/
|
||||
|
||||
RtAudio: realtime audio i/o C++ classes
|
||||
Copyright (c) 2001-2014 Gary P. Scavone
|
||||
Copyright (c) 2001-2017 Gary P. Scavone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
@@ -45,11 +45,11 @@
|
||||
#ifndef __RTAUDIO_H
|
||||
#define __RTAUDIO_H
|
||||
|
||||
#define RTAUDIO_VERSION "4.1.1"
|
||||
#define RTAUDIO_VERSION "5.0.0"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
|
||||
/*! \typedef typedef unsigned long RtAudioFormat;
|
||||
@@ -86,6 +86,7 @@ static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/mi
|
||||
- \e RTAUDIO_MINIMIZE_LATENCY: Attempt to set stream parameters for lowest possible latency.
|
||||
- \e RTAUDIO_HOG_DEVICE: Attempt grab device for exclusive use.
|
||||
- \e RTAUDIO_ALSA_USE_DEFAULT: Use the "default" PCM device (ALSA only).
|
||||
- \e RTAUDIO_JACK_DONT_CONNECT: Do not automatically connect ports (JACK only).
|
||||
|
||||
By default, RtAudio streams pass and receive audio data from the
|
||||
client in an interleaved format. By passing the
|
||||
@@ -117,6 +118,9 @@ static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/mi
|
||||
If the RTAUDIO_ALSA_USE_DEFAULT flag is set, RtAudio will attempt to
|
||||
open the "default" PCM device when using the ALSA API. Note that this
|
||||
will override any specified input or output device id.
|
||||
|
||||
If the RTAUDIO_JACK_DONT_CONNECT flag is set, RtAudio will not attempt
|
||||
to automatically connect the ports of the client to the audio device.
|
||||
*/
|
||||
typedef unsigned int RtAudioStreamFlags;
|
||||
static const RtAudioStreamFlags RTAUDIO_NONINTERLEAVED = 0x1; // Use non-interleaved buffers (default = interleaved).
|
||||
@@ -124,6 +128,7 @@ static const RtAudioStreamFlags RTAUDIO_MINIMIZE_LATENCY = 0x2; // Attempt to s
|
||||
static const RtAudioStreamFlags RTAUDIO_HOG_DEVICE = 0x4; // Attempt grab device and prevent use by others.
|
||||
static const RtAudioStreamFlags RTAUDIO_SCHEDULE_REALTIME = 0x8; // Try to select realtime scheduling for callback thread.
|
||||
static const RtAudioStreamFlags RTAUDIO_ALSA_USE_DEFAULT = 0x10; // Use the "default" PCM device (ALSA only).
|
||||
static const RtAudioStreamFlags RTAUDIO_JACK_DONT_CONNECT = 0x20; // Do not automatically connect ports (JACK only).
|
||||
|
||||
/*! \typedef typedef unsigned long RtAudioStreamStatus;
|
||||
\brief RtAudio stream status (over- or underflow) flags.
|
||||
@@ -195,7 +200,7 @@ typedef int (*RtAudioCallback)( void *outputBuffer, void *inputBuffer,
|
||||
*/
|
||||
/************************************************************************/
|
||||
|
||||
class RtAudioError : public std::exception
|
||||
class RtAudioError : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
//! Defined RtAudioError types.
|
||||
@@ -214,25 +219,22 @@ class RtAudioError : public std::exception
|
||||
};
|
||||
|
||||
//! The constructor.
|
||||
RtAudioError( const std::string& message, Type type = RtAudioError::UNSPECIFIED ) throw() : message_(message), type_(type) {}
|
||||
|
||||
//! The destructor.
|
||||
virtual ~RtAudioError( void ) throw() {}
|
||||
RtAudioError( const std::string& message,
|
||||
Type type = RtAudioError::UNSPECIFIED )
|
||||
: std::runtime_error(message), type_(type) {}
|
||||
|
||||
//! Prints thrown error message to stderr.
|
||||
virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; }
|
||||
virtual void printMessage( void ) const
|
||||
{ std::cerr << '\n' << what() << "\n\n"; }
|
||||
|
||||
//! Returns the thrown error message type.
|
||||
virtual const Type& getType(void) const throw() { return type_; }
|
||||
virtual const Type& getType(void) const { return type_; }
|
||||
|
||||
//! Returns the thrown error message string.
|
||||
virtual const std::string& getMessage(void) const throw() { return message_; }
|
||||
|
||||
//! Returns the thrown error message as a c-style string.
|
||||
virtual const char* what( void ) const throw() { return message_.c_str(); }
|
||||
virtual const std::string getMessage(void) const
|
||||
{ return std::string(what()); }
|
||||
|
||||
protected:
|
||||
std::string message_;
|
||||
Type type_;
|
||||
};
|
||||
|
||||
@@ -286,12 +288,13 @@ class RtAudio
|
||||
bool isDefaultOutput; /*!< true if this is the default output device. */
|
||||
bool isDefaultInput; /*!< true if this is the default input device. */
|
||||
std::vector<unsigned int> sampleRates; /*!< Supported sample rates (queried from list of standard rates). */
|
||||
unsigned int preferredSampleRate; /*!< Preferred sample rate, eg. for WASAPI the system sample rate. */
|
||||
RtAudioFormat nativeFormats; /*!< Bit mask of supported data formats. */
|
||||
|
||||
// Default constructor.
|
||||
DeviceInfo()
|
||||
:probed(false), outputChannels(0), inputChannels(0), duplexChannels(0),
|
||||
isDefaultOutput(false), isDefaultInput(false), nativeFormats(0) {}
|
||||
isDefaultOutput(false), isDefaultInput(false), preferredSampleRate(0), nativeFormats(0) {}
|
||||
};
|
||||
|
||||
//! The structure for specifying input or ouput stream parameters.
|
||||
@@ -374,7 +377,7 @@ class RtAudio
|
||||
};
|
||||
|
||||
//! A static function to determine the current RtAudio version.
|
||||
static std::string getVersion( void ) throw();
|
||||
static std::string getVersion( void );
|
||||
|
||||
//! A static function to determine the available compiled audio APIs.
|
||||
/*!
|
||||
@@ -382,7 +385,7 @@ class RtAudio
|
||||
the enumerated list values. Note that there can be more than one
|
||||
API compiled for certain operating systems.
|
||||
*/
|
||||
static void getCompiledApi( std::vector<RtAudio::Api> &apis ) throw();
|
||||
static void getCompiledApi( std::vector<RtAudio::Api> &apis );
|
||||
|
||||
//! The class constructor.
|
||||
/*!
|
||||
@@ -400,10 +403,10 @@ class RtAudio
|
||||
If a stream is running or open, it will be stopped and closed
|
||||
automatically.
|
||||
*/
|
||||
~RtAudio() throw();
|
||||
~RtAudio();
|
||||
|
||||
//! Returns the audio API specifier for the current instance of RtAudio.
|
||||
RtAudio::Api getCurrentApi( void ) throw();
|
||||
RtAudio::Api getCurrentApi( void );
|
||||
|
||||
//! A public function that queries for the number of audio devices available.
|
||||
/*!
|
||||
@@ -411,7 +414,7 @@ class RtAudio
|
||||
is called, thus supporting devices connected \e after instantiation. If
|
||||
a system error occurs during processing, a warning will be issued.
|
||||
*/
|
||||
unsigned int getDeviceCount( void ) throw();
|
||||
unsigned int getDeviceCount( void );
|
||||
|
||||
//! Return an RtAudio::DeviceInfo structure for a specified device number.
|
||||
/*!
|
||||
@@ -434,7 +437,7 @@ class RtAudio
|
||||
client's responsibility to verify that a device is available
|
||||
before attempting to open a stream.
|
||||
*/
|
||||
unsigned int getDefaultOutputDevice( void ) throw();
|
||||
unsigned int getDefaultOutputDevice( void );
|
||||
|
||||
//! A function that returns the index of the default input device.
|
||||
/*!
|
||||
@@ -444,7 +447,7 @@ class RtAudio
|
||||
client's responsibility to verify that a device is available
|
||||
before attempting to open a stream.
|
||||
*/
|
||||
unsigned int getDefaultInputDevice( void ) throw();
|
||||
unsigned int getDefaultInputDevice( void );
|
||||
|
||||
//! A public function for opening a stream with the specified parameters.
|
||||
/*!
|
||||
@@ -497,7 +500,7 @@ class RtAudio
|
||||
If a stream is not open, this function issues a warning and
|
||||
returns (no exception is thrown).
|
||||
*/
|
||||
void closeStream( void ) throw();
|
||||
void closeStream( void );
|
||||
|
||||
//! A function that starts a stream.
|
||||
/*!
|
||||
@@ -527,10 +530,10 @@ class RtAudio
|
||||
void abortStream( void );
|
||||
|
||||
//! Returns true if a stream is open and false if not.
|
||||
bool isStreamOpen( void ) const throw();
|
||||
bool isStreamOpen( void ) const;
|
||||
|
||||
//! Returns true if the stream is running and false if it is stopped or not open.
|
||||
bool isStreamRunning( void ) const throw();
|
||||
bool isStreamRunning( void ) const;
|
||||
|
||||
//! Returns the number of elapsed seconds since the stream was started.
|
||||
/*!
|
||||
@@ -564,7 +567,7 @@ class RtAudio
|
||||
unsigned int getStreamSampleRate( void );
|
||||
|
||||
//! Specify whether warning messages should be printed to stderr.
|
||||
void showWarnings( bool value = true ) throw();
|
||||
void showWarnings( bool value = true );
|
||||
|
||||
protected:
|
||||
|
||||
@@ -615,7 +618,7 @@ struct CallbackInfo {
|
||||
|
||||
// Default constructor.
|
||||
CallbackInfo()
|
||||
:object(0), callback(0), userData(0), errorCallback(0), apiInfo(0), isRunning(false), doRealtime(false) {}
|
||||
:object(0), callback(0), userData(0), errorCallback(0), apiInfo(0), isRunning(false), doRealtime(false), priority(0) {}
|
||||
};
|
||||
|
||||
// **************************************************************** //
|
||||
@@ -823,22 +826,22 @@ protected:
|
||||
//
|
||||
// **************************************************************** //
|
||||
|
||||
inline RtAudio::Api RtAudio :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
|
||||
inline unsigned int RtAudio :: getDeviceCount( void ) throw() { return rtapi_->getDeviceCount(); }
|
||||
inline RtAudio::Api RtAudio :: getCurrentApi( void ) { return rtapi_->getCurrentApi(); }
|
||||
inline unsigned int RtAudio :: getDeviceCount( void ) { return rtapi_->getDeviceCount(); }
|
||||
inline RtAudio::DeviceInfo RtAudio :: getDeviceInfo( unsigned int device ) { return rtapi_->getDeviceInfo( device ); }
|
||||
inline unsigned int RtAudio :: getDefaultInputDevice( void ) throw() { return rtapi_->getDefaultInputDevice(); }
|
||||
inline unsigned int RtAudio :: getDefaultOutputDevice( void ) throw() { return rtapi_->getDefaultOutputDevice(); }
|
||||
inline void RtAudio :: closeStream( void ) throw() { return rtapi_->closeStream(); }
|
||||
inline unsigned int RtAudio :: getDefaultInputDevice( void ) { return rtapi_->getDefaultInputDevice(); }
|
||||
inline unsigned int RtAudio :: getDefaultOutputDevice( void ) { return rtapi_->getDefaultOutputDevice(); }
|
||||
inline void RtAudio :: closeStream( void ) { return rtapi_->closeStream(); }
|
||||
inline void RtAudio :: startStream( void ) { return rtapi_->startStream(); }
|
||||
inline void RtAudio :: stopStream( void ) { return rtapi_->stopStream(); }
|
||||
inline void RtAudio :: abortStream( void ) { return rtapi_->abortStream(); }
|
||||
inline bool RtAudio :: isStreamOpen( void ) const throw() { return rtapi_->isStreamOpen(); }
|
||||
inline bool RtAudio :: isStreamRunning( void ) const throw() { return rtapi_->isStreamRunning(); }
|
||||
inline bool RtAudio :: isStreamOpen( void ) const { return rtapi_->isStreamOpen(); }
|
||||
inline bool RtAudio :: isStreamRunning( void ) const { return rtapi_->isStreamRunning(); }
|
||||
inline long RtAudio :: getStreamLatency( void ) { return rtapi_->getStreamLatency(); }
|
||||
inline unsigned int RtAudio :: getStreamSampleRate( void ) { return rtapi_->getStreamSampleRate(); }
|
||||
inline double RtAudio :: getStreamTime( void ) { return rtapi_->getStreamTime(); }
|
||||
inline void RtAudio :: setStreamTime( double time ) { return rtapi_->setStreamTime( time ); }
|
||||
inline void RtAudio :: showWarnings( bool value ) throw() { rtapi_->showWarnings( value ); }
|
||||
inline void RtAudio :: showWarnings( bool value ) { rtapi_->showWarnings( value ); }
|
||||
|
||||
// RtApi Subclass prototypes.
|
||||
|
||||
@@ -911,6 +914,8 @@ public:
|
||||
unsigned int firstChannel, unsigned int sampleRate,
|
||||
RtAudioFormat format, unsigned int *bufferSize,
|
||||
RtAudio::StreamOptions *options );
|
||||
|
||||
bool shouldAutoconnect_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
173
include/RtMidi.h
173
include/RtMidi.h
@@ -8,7 +8,7 @@
|
||||
RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/
|
||||
|
||||
RtMidi: realtime MIDI i/o C++ classes
|
||||
Copyright (c) 2003-2014 Gary P. Scavone
|
||||
Copyright (c) 2003-2017 Gary P. Scavone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
@@ -43,7 +43,7 @@
|
||||
#ifndef RTMIDI_H
|
||||
#define RTMIDI_H
|
||||
|
||||
#define RTMIDI_VERSION "2.1.0"
|
||||
#define RTMIDI_VERSION "3.0.0"
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
@@ -109,7 +109,7 @@ class RtMidiError : public std::exception
|
||||
Note that class behaviour is undefined after a critical error (not
|
||||
a warning) is reported.
|
||||
*/
|
||||
typedef void (*RtMidiErrorCallback)( RtMidiError::Type type, const std::string &errorText );
|
||||
typedef void (*RtMidiErrorCallback)( RtMidiError::Type type, const std::string &errorText, void *userData );
|
||||
|
||||
class MidiApi;
|
||||
|
||||
@@ -139,10 +139,10 @@ class RtMidi
|
||||
static void getCompiledApi( std::vector<RtMidi::Api> &apis ) throw();
|
||||
|
||||
//! Pure virtual openPort() function.
|
||||
virtual void openPort( unsigned int portNumber = 0, const std::string portName = std::string( "RtMidi" ) ) = 0;
|
||||
virtual void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi" ) ) = 0;
|
||||
|
||||
//! Pure virtual openVirtualPort() function.
|
||||
virtual void openVirtualPort( const std::string portName = std::string( "RtMidi" ) ) = 0;
|
||||
virtual void openVirtualPort( const std::string &portName = std::string( "RtMidi" ) ) = 0;
|
||||
|
||||
//! Pure virtual getPortCount() function.
|
||||
virtual unsigned int getPortCount() = 0;
|
||||
@@ -154,6 +154,10 @@ class RtMidi
|
||||
virtual void closePort( void ) = 0;
|
||||
|
||||
//! Returns true if a port is open and false if not.
|
||||
/*!
|
||||
Note that this only applies to connections made with the openPort()
|
||||
function, not to virtual ports.
|
||||
*/
|
||||
virtual bool isPortOpen( void ) const = 0;
|
||||
|
||||
//! Set an error callback function to be invoked when an error has occured.
|
||||
@@ -161,7 +165,7 @@ class RtMidi
|
||||
The callback function will be called whenever an error has occured. It is best
|
||||
to set the error callback function before opening a port.
|
||||
*/
|
||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL ) = 0;
|
||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 ) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -185,7 +189,7 @@ class RtMidi
|
||||
possible to open a virtual input port to which other MIDI software
|
||||
clients can connect.
|
||||
|
||||
by Gary P. Scavone, 2003-2014.
|
||||
by Gary P. Scavone, 2003-2017.
|
||||
*/
|
||||
/**********************************************************************/
|
||||
|
||||
@@ -229,7 +233,7 @@ class RtMidiIn : public RtMidi
|
||||
\param queueSizeLimit An optional size of the MIDI input queue can be specified.
|
||||
*/
|
||||
RtMidiIn( RtMidi::Api api=UNSPECIFIED,
|
||||
const std::string clientName = std::string( "RtMidi Input Client"),
|
||||
const std::string& clientName = "RtMidi Input Client",
|
||||
unsigned int queueSizeLimit = 100 );
|
||||
|
||||
//! If a MIDI connection is still open, it will be closed by the destructor.
|
||||
@@ -244,7 +248,7 @@ class RtMidiIn : public RtMidi
|
||||
Otherwise, the default or first port found is opened.
|
||||
\param portName An optional name for the application port that is used to connect to portId can be specified.
|
||||
*/
|
||||
void openPort( unsigned int portNumber = 0, const std::string portName = std::string( "RtMidi Input" ) );
|
||||
void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi Input" ) );
|
||||
|
||||
//! Create a virtual input port, with optional name, to allow software connections (OS X, JACK and ALSA only).
|
||||
/*!
|
||||
@@ -256,7 +260,7 @@ class RtMidiIn : public RtMidi
|
||||
\param portName An optional name for the application port that is
|
||||
used to connect to portId can be specified.
|
||||
*/
|
||||
void openVirtualPort( const std::string portName = std::string( "RtMidi Input" ) );
|
||||
void openVirtualPort( const std::string &portName = std::string( "RtMidi Input" ) );
|
||||
|
||||
//! Set a callback function to be invoked for incoming MIDI messages.
|
||||
/*!
|
||||
@@ -282,6 +286,10 @@ class RtMidiIn : public RtMidi
|
||||
void closePort( void );
|
||||
|
||||
//! Returns true if a port is open and false if not.
|
||||
/*!
|
||||
Note that this only applies to connections made with the openPort()
|
||||
function, not to virtual ports.
|
||||
*/
|
||||
virtual bool isPortOpen() const;
|
||||
|
||||
//! Return the number of available MIDI input ports.
|
||||
@@ -293,7 +301,8 @@ class RtMidiIn : public RtMidi
|
||||
//! Return a string identifier for the specified MIDI input port number.
|
||||
/*!
|
||||
\return The name of the port with the given Id is returned.
|
||||
\retval An empty string is returned if an invalid port specifier is provided.
|
||||
\retval An empty string is returned if an invalid port specifier
|
||||
is provided. User code should assume a UTF-8 encoding.
|
||||
*/
|
||||
std::string getPortName( unsigned int portNumber = 0 );
|
||||
|
||||
@@ -322,10 +331,10 @@ class RtMidiIn : public RtMidi
|
||||
The callback function will be called whenever an error has occured. It is best
|
||||
to set the error callback function before opening a port.
|
||||
*/
|
||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL );
|
||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 );
|
||||
|
||||
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 );
|
||||
|
||||
};
|
||||
|
||||
@@ -341,7 +350,7 @@ class RtMidiIn : public RtMidi
|
||||
OS-X, Linux ALSA and JACK MIDI APIs, it is also possible to open a
|
||||
virtual port to which other MIDI software clients can connect.
|
||||
|
||||
by Gary P. Scavone, 2003-2014.
|
||||
by Gary P. Scavone, 2003-2017.
|
||||
*/
|
||||
/**********************************************************************/
|
||||
|
||||
@@ -358,7 +367,7 @@ class RtMidiOut : public RtMidi
|
||||
JACK (OS-X).
|
||||
*/
|
||||
RtMidiOut( RtMidi::Api api=UNSPECIFIED,
|
||||
const std::string clientName = std::string( "RtMidi Output Client") );
|
||||
const std::string& clientName = "RtMidi Output Client" );
|
||||
|
||||
//! The destructor closes any open MIDI connections.
|
||||
~RtMidiOut( void ) throw();
|
||||
@@ -373,12 +382,16 @@ class RtMidiOut : public RtMidi
|
||||
exception is thrown if an error occurs while attempting to make
|
||||
the port connection.
|
||||
*/
|
||||
void openPort( unsigned int portNumber = 0, const std::string portName = std::string( "RtMidi Output" ) );
|
||||
void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi Output" ) );
|
||||
|
||||
//! Close an open MIDI connection (if one exists).
|
||||
void closePort( void );
|
||||
|
||||
//! Returns true if a port is open and false if not.
|
||||
/*!
|
||||
Note that this only applies to connections made with the openPort()
|
||||
function, not to virtual ports.
|
||||
*/
|
||||
virtual bool isPortOpen() const;
|
||||
|
||||
//! Create a virtual output port, with optional name, to allow software connections (OS X, JACK and ALSA only).
|
||||
@@ -390,14 +403,16 @@ class RtMidiOut : public RtMidi
|
||||
An exception is thrown if an error occurs while attempting to
|
||||
create the virtual port.
|
||||
*/
|
||||
void openVirtualPort( const std::string portName = std::string( "RtMidi Output" ) );
|
||||
void openVirtualPort( const std::string &portName = std::string( "RtMidi Output" ) );
|
||||
|
||||
//! Return the number of available MIDI output ports.
|
||||
unsigned int getPortCount( void );
|
||||
|
||||
//! Return a string identifier for the specified MIDI port type and number.
|
||||
/*!
|
||||
An empty string is returned if an invalid port specifier is provided.
|
||||
\return The name of the port with the given Id is returned.
|
||||
\retval An empty string is returned if an invalid port specifier
|
||||
is provided. User code should assume a UTF-8 encoding.
|
||||
*/
|
||||
std::string getPortName( unsigned int portNumber = 0 );
|
||||
|
||||
@@ -406,17 +421,27 @@ class RtMidiOut : public RtMidi
|
||||
An exception is thrown if an error occurs during output or an
|
||||
output connection was not previously established.
|
||||
*/
|
||||
void sendMessage( std::vector<unsigned char> *message );
|
||||
void sendMessage( const std::vector<unsigned char> *message );
|
||||
|
||||
//! Immediately send a single message out an open MIDI output port.
|
||||
/*!
|
||||
An exception is thrown if an error occurs during output or an
|
||||
output connection was not previously established.
|
||||
|
||||
\param message A pointer to the MIDI message as raw bytes
|
||||
\param size Length of the MIDI message in bytes
|
||||
*/
|
||||
void sendMessage( const unsigned char *message, size_t size );
|
||||
|
||||
//! Set an error callback function to be invoked when an error has occured.
|
||||
/*!
|
||||
The callback function will be called whenever an error has occured. It is best
|
||||
to set the error callback function before opening a port.
|
||||
*/
|
||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL );
|
||||
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 );
|
||||
|
||||
protected:
|
||||
void openMidiApi( RtMidi::Api api, const std::string clientName );
|
||||
void openMidiApi( RtMidi::Api api, const std::string &clientName );
|
||||
};
|
||||
|
||||
|
||||
@@ -440,15 +465,15 @@ class MidiApi
|
||||
MidiApi();
|
||||
virtual ~MidiApi();
|
||||
virtual RtMidi::Api getCurrentApi( void ) = 0;
|
||||
virtual void openPort( unsigned int portNumber, const std::string portName ) = 0;
|
||||
virtual void openVirtualPort( const std::string portName ) = 0;
|
||||
virtual void openPort( unsigned int portNumber, const std::string &portName ) = 0;
|
||||
virtual void openVirtualPort( const std::string &portName ) = 0;
|
||||
virtual void closePort( void ) = 0;
|
||||
|
||||
virtual unsigned int getPortCount( void ) = 0;
|
||||
virtual std::string getPortName( unsigned int portNumber ) = 0;
|
||||
|
||||
inline bool isPortOpen() const { return connected_; }
|
||||
void setErrorCallback( RtMidiErrorCallback errorCallback );
|
||||
void setErrorCallback( RtMidiErrorCallback errorCallback, void *userData );
|
||||
|
||||
//! A basic error reporting function for RtMidi classes.
|
||||
void error( RtMidiError::Type type, std::string errorString );
|
||||
@@ -460,6 +485,8 @@ protected:
|
||||
bool connected_;
|
||||
std::string errorString_;
|
||||
RtMidiErrorCallback errorCallback_;
|
||||
bool firstErrorOccurred_;
|
||||
void *errorCallbackUserData_;
|
||||
};
|
||||
|
||||
class MidiInApi : public MidiApi
|
||||
@@ -477,6 +504,8 @@ class MidiInApi : public MidiApi
|
||||
// messages. Each message represents one and only one MIDI message.
|
||||
struct MidiMessage {
|
||||
std::vector<unsigned char> bytes;
|
||||
|
||||
//! Time in seconds elapsed since the previous message
|
||||
double timeStamp;
|
||||
|
||||
// Default constructor.
|
||||
@@ -487,13 +516,16 @@ class MidiInApi : public MidiApi
|
||||
struct MidiQueue {
|
||||
unsigned int front;
|
||||
unsigned int back;
|
||||
unsigned int size;
|
||||
unsigned int ringSize;
|
||||
MidiMessage *ring;
|
||||
|
||||
// Default constructor.
|
||||
MidiQueue()
|
||||
:front(0), back(0), size(0), ringSize(0) {}
|
||||
:front(0), back(0), ringSize(0), ring(0) {}
|
||||
bool push(const MidiMessage&);
|
||||
bool pop(std::vector<unsigned char>*, double*);
|
||||
unsigned int size(unsigned int *back=0,
|
||||
unsigned int *front=0);
|
||||
};
|
||||
|
||||
// The RtMidiInData structure is used to pass private class data to
|
||||
@@ -527,7 +559,7 @@ class MidiOutApi : public MidiApi
|
||||
|
||||
MidiOutApi( void );
|
||||
virtual ~MidiOutApi( void );
|
||||
virtual void sendMessage( std::vector<unsigned char> *message ) = 0;
|
||||
virtual void sendMessage( const unsigned char *message, size_t size ) = 0;
|
||||
};
|
||||
|
||||
// **************************************************************** //
|
||||
@@ -537,8 +569,8 @@ class MidiOutApi : public MidiApi
|
||||
// **************************************************************** //
|
||||
|
||||
inline RtMidi::Api RtMidiIn :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
|
||||
inline void RtMidiIn :: openPort( unsigned int portNumber, const std::string portName ) { rtapi_->openPort( portNumber, portName ); }
|
||||
inline void RtMidiIn :: openVirtualPort( const std::string portName ) { rtapi_->openVirtualPort( portName ); }
|
||||
inline void RtMidiIn :: openPort( unsigned int portNumber, const std::string &portName ) { rtapi_->openPort( portNumber, portName ); }
|
||||
inline void RtMidiIn :: openVirtualPort( const std::string &portName ) { rtapi_->openVirtualPort( portName ); }
|
||||
inline void RtMidiIn :: closePort( void ) { rtapi_->closePort(); }
|
||||
inline bool RtMidiIn :: isPortOpen() const { return rtapi_->isPortOpen(); }
|
||||
inline void RtMidiIn :: setCallback( RtMidiCallback callback, void *userData ) { ((MidiInApi *)rtapi_)->setCallback( callback, userData ); }
|
||||
@@ -547,17 +579,18 @@ inline unsigned int RtMidiIn :: getPortCount( void ) { return rtapi_->getPortCou
|
||||
inline std::string RtMidiIn :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); }
|
||||
inline void RtMidiIn :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ) { ((MidiInApi *)rtapi_)->ignoreTypes( midiSysex, midiTime, midiSense ); }
|
||||
inline double RtMidiIn :: getMessage( std::vector<unsigned char> *message ) { return ((MidiInApi *)rtapi_)->getMessage( message ); }
|
||||
inline void RtMidiIn :: setErrorCallback( RtMidiErrorCallback errorCallback ) { rtapi_->setErrorCallback(errorCallback); }
|
||||
inline void RtMidiIn :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); }
|
||||
|
||||
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 :: openVirtualPort( const std::string portName ) { rtapi_->openVirtualPort( portName ); }
|
||||
inline void RtMidiOut :: openPort( unsigned int portNumber, const std::string &portName ) { rtapi_->openPort( portNumber, portName ); }
|
||||
inline void RtMidiOut :: openVirtualPort( const std::string &portName ) { rtapi_->openVirtualPort( portName ); }
|
||||
inline void RtMidiOut :: closePort( void ) { rtapi_->closePort(); }
|
||||
inline bool RtMidiOut :: isPortOpen() const { return rtapi_->isPortOpen(); }
|
||||
inline unsigned int RtMidiOut :: getPortCount( void ) { return rtapi_->getPortCount(); }
|
||||
inline std::string RtMidiOut :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); }
|
||||
inline void RtMidiOut :: sendMessage( std::vector<unsigned char> *message ) { ((MidiOutApi *)rtapi_)->sendMessage( message ); }
|
||||
inline void RtMidiOut :: setErrorCallback( RtMidiErrorCallback errorCallback ) { rtapi_->setErrorCallback(errorCallback); }
|
||||
inline void RtMidiOut :: sendMessage( const std::vector<unsigned char> *message ) { ((MidiOutApi *)rtapi_)->sendMessage( &message->at(0), message->size() ); }
|
||||
inline void RtMidiOut :: sendMessage( const unsigned char *message, size_t size ) { ((MidiOutApi *)rtapi_)->sendMessage( message, size ); }
|
||||
inline void RtMidiOut :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); }
|
||||
|
||||
// **************************************************************** //
|
||||
//
|
||||
@@ -574,11 +607,11 @@ inline void RtMidiOut :: setErrorCallback( RtMidiErrorCallback errorCallback ) {
|
||||
class MidiInCore: public MidiInApi
|
||||
{
|
||||
public:
|
||||
MidiInCore( const std::string clientName, unsigned int queueSizeLimit );
|
||||
MidiInCore( const std::string &clientName, unsigned int queueSizeLimit );
|
||||
~MidiInCore( void );
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::MACOSX_CORE; };
|
||||
void openPort( unsigned int portNumber, const std::string portName );
|
||||
void openVirtualPort( const std::string portName );
|
||||
void openPort( unsigned int portNumber, const std::string &portName );
|
||||
void openVirtualPort( const std::string &portName );
|
||||
void closePort( void );
|
||||
unsigned int getPortCount( void );
|
||||
std::string getPortName( unsigned int portNumber );
|
||||
@@ -590,15 +623,15 @@ class MidiInCore: public MidiInApi
|
||||
class MidiOutCore: public MidiOutApi
|
||||
{
|
||||
public:
|
||||
MidiOutCore( const std::string clientName );
|
||||
MidiOutCore( const std::string &clientName );
|
||||
~MidiOutCore( void );
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::MACOSX_CORE; };
|
||||
void openPort( unsigned int portNumber, const std::string portName );
|
||||
void openVirtualPort( const std::string portName );
|
||||
void openPort( unsigned int portNumber, const std::string &portName );
|
||||
void openVirtualPort( const std::string &portName );
|
||||
void closePort( void );
|
||||
unsigned int getPortCount( void );
|
||||
std::string getPortName( unsigned int portNumber );
|
||||
void sendMessage( std::vector<unsigned char> *message );
|
||||
void sendMessage( const unsigned char *message, size_t size );
|
||||
|
||||
protected:
|
||||
void initialize( const std::string& clientName );
|
||||
@@ -611,11 +644,11 @@ class MidiOutCore: public MidiOutApi
|
||||
class MidiInJack: public MidiInApi
|
||||
{
|
||||
public:
|
||||
MidiInJack( const std::string clientName, unsigned int queueSizeLimit );
|
||||
MidiInJack( const std::string &clientName, unsigned int queueSizeLimit );
|
||||
~MidiInJack( void );
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::UNIX_JACK; };
|
||||
void openPort( unsigned int portNumber, const std::string portName );
|
||||
void openVirtualPort( const std::string portName );
|
||||
void openPort( unsigned int portNumber, const std::string &portName );
|
||||
void openVirtualPort( const std::string &portName );
|
||||
void closePort( void );
|
||||
unsigned int getPortCount( void );
|
||||
std::string getPortName( unsigned int portNumber );
|
||||
@@ -630,15 +663,15 @@ class MidiInJack: public MidiInApi
|
||||
class MidiOutJack: public MidiOutApi
|
||||
{
|
||||
public:
|
||||
MidiOutJack( const std::string clientName );
|
||||
MidiOutJack( const std::string &clientName );
|
||||
~MidiOutJack( void );
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::UNIX_JACK; };
|
||||
void openPort( unsigned int portNumber, const std::string portName );
|
||||
void openVirtualPort( const std::string portName );
|
||||
void openPort( unsigned int portNumber, const std::string &portName );
|
||||
void openVirtualPort( const std::string &portName );
|
||||
void closePort( void );
|
||||
unsigned int getPortCount( void );
|
||||
std::string getPortName( unsigned int portNumber );
|
||||
void sendMessage( std::vector<unsigned char> *message );
|
||||
void sendMessage( const unsigned char *message, size_t size );
|
||||
|
||||
protected:
|
||||
std::string clientName;
|
||||
@@ -654,11 +687,11 @@ class MidiOutJack: public MidiOutApi
|
||||
class MidiInAlsa: public MidiInApi
|
||||
{
|
||||
public:
|
||||
MidiInAlsa( const std::string clientName, unsigned int queueSizeLimit );
|
||||
MidiInAlsa( const std::string &clientName, unsigned int queueSizeLimit );
|
||||
~MidiInAlsa( void );
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::LINUX_ALSA; };
|
||||
void openPort( unsigned int portNumber, const std::string portName );
|
||||
void openVirtualPort( const std::string portName );
|
||||
void openPort( unsigned int portNumber, const std::string &portName );
|
||||
void openVirtualPort( const std::string &portName );
|
||||
void closePort( void );
|
||||
unsigned int getPortCount( void );
|
||||
std::string getPortName( unsigned int portNumber );
|
||||
@@ -670,15 +703,15 @@ class MidiInAlsa: public MidiInApi
|
||||
class MidiOutAlsa: public MidiOutApi
|
||||
{
|
||||
public:
|
||||
MidiOutAlsa( const std::string clientName );
|
||||
MidiOutAlsa( const std::string &clientName );
|
||||
~MidiOutAlsa( void );
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::LINUX_ALSA; };
|
||||
void openPort( unsigned int portNumber, const std::string portName );
|
||||
void openVirtualPort( const std::string portName );
|
||||
void openPort( unsigned int portNumber, const std::string &portName );
|
||||
void openVirtualPort( const std::string &portName );
|
||||
void closePort( void );
|
||||
unsigned int getPortCount( void );
|
||||
std::string getPortName( unsigned int portNumber );
|
||||
void sendMessage( std::vector<unsigned char> *message );
|
||||
void sendMessage( const unsigned char *message, size_t size );
|
||||
|
||||
protected:
|
||||
void initialize( const std::string& clientName );
|
||||
@@ -691,11 +724,11 @@ class MidiOutAlsa: public MidiOutApi
|
||||
class MidiInWinMM: public MidiInApi
|
||||
{
|
||||
public:
|
||||
MidiInWinMM( const std::string clientName, unsigned int queueSizeLimit );
|
||||
MidiInWinMM( const std::string &clientName, unsigned int queueSizeLimit );
|
||||
~MidiInWinMM( void );
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::WINDOWS_MM; };
|
||||
void openPort( unsigned int portNumber, const std::string portName );
|
||||
void openVirtualPort( const std::string portName );
|
||||
void openPort( unsigned int portNumber, const std::string &portName );
|
||||
void openVirtualPort( const std::string &portName );
|
||||
void closePort( void );
|
||||
unsigned int getPortCount( void );
|
||||
std::string getPortName( unsigned int portNumber );
|
||||
@@ -707,15 +740,15 @@ class MidiInWinMM: public MidiInApi
|
||||
class MidiOutWinMM: public MidiOutApi
|
||||
{
|
||||
public:
|
||||
MidiOutWinMM( const std::string clientName );
|
||||
MidiOutWinMM( const std::string &clientName );
|
||||
~MidiOutWinMM( void );
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::WINDOWS_MM; };
|
||||
void openPort( unsigned int portNumber, const std::string portName );
|
||||
void openVirtualPort( const std::string portName );
|
||||
void openPort( unsigned int portNumber, const std::string &portName );
|
||||
void openVirtualPort( const std::string &portName );
|
||||
void closePort( void );
|
||||
unsigned int getPortCount( void );
|
||||
std::string getPortName( unsigned int portNumber );
|
||||
void sendMessage( std::vector<unsigned char> *message );
|
||||
void sendMessage( const unsigned char *message, size_t size );
|
||||
|
||||
protected:
|
||||
void initialize( const std::string& clientName );
|
||||
@@ -728,13 +761,13 @@ class MidiOutWinMM: public MidiOutApi
|
||||
class MidiInDummy: public MidiInApi
|
||||
{
|
||||
public:
|
||||
MidiInDummy( const std::string /*clientName*/, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) { errorString_ = "MidiInDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); }
|
||||
MidiInDummy( const std::string &/*clientName*/, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) { errorString_ = "MidiInDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); }
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; }
|
||||
void openPort( unsigned int /*portNumber*/, const std::string /*portName*/ ) {}
|
||||
void openVirtualPort( const std::string /*portName*/ ) {}
|
||||
void openPort( unsigned int /*portNumber*/, const std::string &/*portName*/ ) {}
|
||||
void openVirtualPort( const std::string &/*portName*/ ) {}
|
||||
void closePort( void ) {}
|
||||
unsigned int getPortCount( void ) { return 0; }
|
||||
std::string getPortName( unsigned int portNumber ) { return ""; }
|
||||
std::string getPortName( unsigned int /*portNumber*/ ) { return ""; }
|
||||
|
||||
protected:
|
||||
void initialize( const std::string& /*clientName*/ ) {}
|
||||
@@ -743,14 +776,14 @@ class MidiInDummy: public MidiInApi
|
||||
class MidiOutDummy: public MidiOutApi
|
||||
{
|
||||
public:
|
||||
MidiOutDummy( const std::string /*clientName*/ ) { errorString_ = "MidiOutDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); }
|
||||
MidiOutDummy( const std::string &/*clientName*/ ) { errorString_ = "MidiOutDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); }
|
||||
RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; }
|
||||
void openPort( unsigned int /*portNumber*/, const std::string /*portName*/ ) {}
|
||||
void openVirtualPort( const std::string /*portName*/ ) {}
|
||||
void openPort( unsigned int /*portNumber*/, const std::string &/*portName*/ ) {}
|
||||
void openVirtualPort( const std::string &/*portName*/ ) {}
|
||||
void closePort( void ) {}
|
||||
unsigned int getPortCount( void ) { return 0; }
|
||||
std::string getPortName( unsigned int /*portNumber*/ ) { return ""; }
|
||||
void sendMessage( std::vector<unsigned char> * /*message*/ ) {}
|
||||
void sendMessage( const unsigned char * /*message*/, size_t /*size*/ ) {}
|
||||
|
||||
protected:
|
||||
void initialize( const std::string& /*clientName*/ ) {}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace stk {
|
||||
that takes an StkFrames object for multi-channel and/or
|
||||
multi-frame data.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -83,15 +83,16 @@ public:
|
||||
*/
|
||||
StkFloat tick( unsigned int channel = 0 );
|
||||
|
||||
//! Fill the StkFrames argument with computed frames and return the same reference.
|
||||
//! Fill the StkFrames object with computed sample frames, starting at the specified channel and return the same reference.
|
||||
/*!
|
||||
If the device is "stopped", it is "started". The number of
|
||||
channels in the StkFrames argument must equal the number of
|
||||
channels specified during instantiation. However, this is only
|
||||
checked if _STK_DEBUG_ is defined during compilation, in which
|
||||
case an incompatibility will trigger an StkError exception.
|
||||
If the device is "stopped", it is "started". The \c channel
|
||||
argument plus the number of input channels must be less than the
|
||||
number of channels in the StkFrames argument (the first channel is
|
||||
specified by 0). However, range checking is only performed if
|
||||
_STK_DEBUG_ is defined during compilation, in which case an
|
||||
out-of-range value will trigger an StkError exception.
|
||||
*/
|
||||
StkFrames& tick( StkFrames& frames );
|
||||
StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
|
||||
|
||||
// This function is not intended for general use but must be
|
||||
// public for access from the audio callback function.
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace stk {
|
||||
that takes a reference to an StkFrames object for multi-channel
|
||||
and/or multi-frame data.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
where <name> is the string used in the SKINI stream.
|
||||
|
||||
by Perry R. Cook, 1995--2014.
|
||||
by Perry R. Cook, 1995--2017.
|
||||
*/
|
||||
/*********************************************************/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
#include "SKINI.msg"
|
||||
#include "SKINImsg.h"
|
||||
|
||||
namespace stk {
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace stk {
|
||||
This instrument provides an ADSR envelope, a one-pole filter, and
|
||||
structures for an arbitrary number of attack and looped files.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace stk {
|
||||
- Vibrato Gain = 1
|
||||
- Breath Pressure = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace stk {
|
||||
- Water Drops = 21
|
||||
- Tuned Bamboo Chimes = 22
|
||||
|
||||
by Perry R. Cook with updates by Gary Scavone, 1995--2014.
|
||||
by Perry R. Cook with updates by Gary Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
- Envelope Rate = 11
|
||||
- Gain = 128
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace stk {
|
||||
|
||||
The "table" length, set in SineWave.h, is 2048 samples by default.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace stk {
|
||||
Within STK, it is used as an excitation source for other
|
||||
instruments.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace stk {
|
||||
Stanford, bearing the names of Karplus and/or
|
||||
Strong.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
|
||||
\sa \ref skini
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -41,7 +41,7 @@ class Skini : public Stk
|
||||
|
||||
//! A message structure to store and pass parsed SKINI messages.
|
||||
struct Message {
|
||||
long type; /*!< The message type, as defined in SKINI.msg. */
|
||||
long type; /*!< The message type, as defined in SKINImsg.h. */
|
||||
long channel; /*!< The message channel (not limited to 16!). */
|
||||
StkFloat time; /*!< The message time stamp in seconds (delta or absolute). */
|
||||
std::vector<StkFloat> floatValues; /*!< The message values read as floats (values are type-specific). */
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace stk {
|
||||
number of static functions for use with external socket
|
||||
descriptors.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace stk {
|
||||
This class implements a spherical ball with
|
||||
radius, mass, position, and velocity parameters.
|
||||
|
||||
by Perry R. Cook, 1995--2014.
|
||||
by Perry R. Cook, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
//! Get the relative position of the given point to the sphere as a 3D vector.
|
||||
Vector3D* getRelativePosition( Vector3D *position );
|
||||
|
||||
//! Set the velcoity of the sphere as a 3D vector.
|
||||
//! Set the velocity of the sphere as a 3D vector.
|
||||
StkFloat getVelocity( Vector3D* velocity );
|
||||
|
||||
//! Returns the distance from the sphere boundary to the given position (< 0 if inside).
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace stk {
|
||||
- String Sustain = 11
|
||||
- String Stretch = 1
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace stk {
|
||||
STK WWW site: http://ccrma.stanford.edu/software/stk/
|
||||
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
Copyright (c) 1995--2014 Perry R. Cook and Gary P. Scavone
|
||||
Copyright (c) 1995--2017 Perry R. Cook and Gary P. Scavone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
@@ -171,7 +171,10 @@ public:
|
||||
class basis.
|
||||
*/
|
||||
void ignoreSampleRateChange( bool ignore = true ) { ignoreSampleRateChange_ = ignore; };
|
||||
|
||||
|
||||
//! Static method that frees memory from alertList_.
|
||||
static void clear_alertList(){std::vector<Stk *>().swap(alertList_);};
|
||||
|
||||
//! Static method that returns the current rawwave path.
|
||||
static std::string rawwavePath(void) { return rawwavepath_; }
|
||||
|
||||
@@ -265,7 +268,7 @@ protected:
|
||||
Possible future improvements in this class could include functions
|
||||
to convert to and return other data types.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2014.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995--2017.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -303,6 +306,14 @@ public:
|
||||
checking is performed unless _STK_DEBUG_ is defined.
|
||||
*/
|
||||
StkFloat operator[] ( size_t n ) const;
|
||||
|
||||
//! Sum operator
|
||||
/*!
|
||||
The dimensions of the argument are expected to be the same as
|
||||
self. No range checking is performed unless _STK_DEBUG_ is
|
||||
defined.
|
||||
*/
|
||||
StkFrames operator+(const StkFrames &frames) const;
|
||||
|
||||
//! Assignment by sum operator into self.
|
||||
/*!
|
||||
@@ -373,6 +384,22 @@ public:
|
||||
*/
|
||||
void resize( size_t nFrames, unsigned int nChannels, StkFloat value );
|
||||
|
||||
//! Retrieves a single channel
|
||||
/*!
|
||||
Copies the specified \c channel into \c destinationFrames's \c destinationChannel. \c destinationChannel must be between 0 and destination.channels() - 1 and
|
||||
\c channel must be between 0 and channels() - 1. destination.frames() must be >= frames().
|
||||
No range checking is performed unless _STK_DEBUG_ is defined.
|
||||
*/
|
||||
StkFrames& getChannel(unsigned int channel,StkFrames& destinationFrames, unsigned int destinationChannel) const;
|
||||
|
||||
//! Sets a single channel
|
||||
/*!
|
||||
Copies the \c sourceChannel of \c sourceFrames into the \c channel of self.
|
||||
SourceFrames.frames() must be equal to frames().
|
||||
No range checking is performed unless _STK_DEBUG_ is defined.
|
||||
*/
|
||||
void setChannel(unsigned int channel,const StkFrames &sourceFrames,unsigned int sourceChannel);
|
||||
|
||||
//! Return the number of channels represented by the data.
|
||||
unsigned int channels( void ) const { return nChannels_; };
|
||||
|
||||
@@ -461,6 +488,25 @@ inline StkFloat StkFrames :: operator() ( size_t frame, unsigned int channel ) c
|
||||
|
||||
return data_[ frame * nChannels_ + channel ];
|
||||
}
|
||||
|
||||
inline StkFrames StkFrames::operator+(const StkFrames &f) const
|
||||
{
|
||||
#if defined(_STK_DEBUG_)
|
||||
if ( f.frames() != nFrames_ || f.channels() != nChannels_ ) {
|
||||
std::ostringstream error;
|
||||
error << "StkFrames::operator+: frames argument must be of equal dimensions!";
|
||||
Stk::handleError( error.str(), StkError::MEMORY_ACCESS );
|
||||
}
|
||||
#endif
|
||||
StkFrames sum((unsigned int)nFrames_,nChannels_);
|
||||
StkFloat *sumPtr = &sum[0];
|
||||
const StkFloat *fptr = f.data_;
|
||||
const StkFloat *dPtr = data_;
|
||||
for (unsigned int i = 0; i < size_; i++) {
|
||||
*sumPtr++ = *fptr++ + *dPtr++;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
inline void StkFrames :: operator+= ( StkFrames& f )
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user