Merge 4.1 into releases

This commit is contained in:
Stephen Sinclair
2013-09-29 23:34:55 +02:00
279 changed files with 36223 additions and 25364 deletions

40
INSTALL Normal file
View File

@@ -0,0 +1,40 @@
The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
The Synthesis ToolKit in C++ can be used in a variety of ways, depending on your particular needs. Some people just 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.
To configure and compile (on Unix systems):
1. Unpack the STK distribution (tar -xzf stk-4.x.tar.gz).
2. From within the directory containing this file, run configure:
./configure
3. From within each project directory, type "make".
4. To compile a library of objects, type "make" from within the src directory.
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 (linux only)
--enable-midiator = enable native MS-124W MIDI support (linux only)
Typing "./configure --help" will display all the available options. In addition, it is possible to specify the RAWWAVES and INCLUDE paths to configure as (ex. to set to /home/gary/rawwaves and /home/gary/include):
./configure RAWWAVE_PATH="/home/gary/rawwaves/"
./configure INCLUDE_PATH="/home/gary/include/"
The ending "/" is required for the RAWWAVES path. The default behavior will set a relative path that works for the project files included with the distribution (assuming they are not moved).
If you wish to use a different compiler than that selected by configure, specify that compiler in the command line (ex. to use CC):
./configure CXX=CC
In addition, a linux RPM is available from the STK WWW site (http://www-ccrma.stanford.edu/software/stk/).
For Windows Users:
An STK distribution is available which contains precompiled executables. In addition, Visual C++ project files are included for each of the example STK projects.

232
README
View File

@@ -1,115 +1,117 @@
The Synthesis ToolKit in C++ (STK) The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002. By Perry R. Cook and Gary P. Scavone, 1995-2002.
This distribution of the Synthesis ToolKit in C++ (STK) contains the following: This distribution of the Synthesis ToolKit in C++ (STK) contains the following:
include: STK class header files include: STK class header files
src: STK class source files src: STK class source files
rawwaves: STK audio files (1-channel, 16-bit, big-endian) rawwaves: STK audio files (1-channel, 16-bit, big-endian)
doc: STK documentation doc: STK documentation
projects: example STK programs projects: example STK programs
Please read the Legal and Ethical notes near the bottom of this document. Please read the Legal and Ethical notes near the bottom of this document.
For compiling and installing STK, see the INSTALL file in this directory.
OVERVIEW:
The Synthesis ToolKit in C++ (STK) is a set of audio signal processing and synthesis classes and algorithms written in C++. You can use these classes to create programs that make sounds with a variety of synthesis techniques. This is not a terribly novel concept, except that the Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (no libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler. OVERVIEW:
The Synthesis ToolKit is free for non-commercial use. The only parts of the Synthesis ToolKit that are platform-dependent concern real-time audio and MIDI input and output, and that is taken care of with a few special classes. The interface for MIDI input and the simple <A HREF="http://dev.scriptics.com">Tcl/Tk</A> graphical user interfaces (GUIs) provided is the same, so it's easy to experiment in real time using either the GUIs or MIDI. The Synthesis ToolKit can generate simultaneous SND (AU), WAV, AIFF, and MAT-file output soundfile formats (as well as realtime sound output), so you can view your results using one of a large variety of sound/signal analysis tools already available (e.g. <A HREF="http://www-ccrma.stanford.edu/software/snd/">Snd</A>, Cool Edit, Matlab). The Synthesis ToolKit in C++ (STK) is a set of audio signal processing and synthesis classes and algorithms written in C++. You can use these classes to create programs that make sounds with a variety of synthesis techniques. This is not a terribly novel concept, except that the Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (no unusual libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, Macintosh OS X, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler.
The Synthesis Toolkit is not one particular program. Rather, it is a set of C++ classes that you can use to create your own programs. A few example applications are provided to demonstrate some of the ways to use the classes. If you have specific needs, you will probably have to either modify the example programs or write a new program altogether. Further, the example programs don't have a fancy GUI wrapper. If you feel the need to have a "drag and drop" graphical patching GUI, you probably don't want to use the ToolKit. Spending hundreds of hours making platform-dependent graphics code would go against one of the fundamental design goals of the ToolKit - platform independence. The Synthesis ToolKit is free for non-commercial use. The only parts of the Synthesis ToolKit that are platform-dependent concern real-time audio and MIDI input and output, and that is taken care of with a few special classes. The interface for MIDI input and the simple Tcl/Tk graphical user interfaces (GUIs) provided is the same, so it's easy to experiment in real time using either the GUIs or MIDI. The Synthesis ToolKit can generate simultaneous SND (AU), WAV, AIFF, and MAT-file output soundfile formats (as well as realtime sound output), so you can view your results using one of a large variety of sound/signal analysis tools already available (e.g. Snd, Cool Edit, Matlab).
For those instances where a simple GUI with sliders and buttons is helpful, we use <A HREF="http://dev.scriptics.com">Tcl/Tk</A> (which is freely distributed for all the supported ToolKit platforms). A number of Tcl/Tk GUI scripts are distributed with the ToolKit release. For control, the Synthesis Toolkit uses raw MIDI (on supported platforms), and SKINI (Synthesis ToolKit Instrument Network Interface, a MIDI-like text message synthesis control format). The Synthesis Toolkit is not one particular program. Rather, it is a set of C++ classes that you can use to create your own programs. A few example applications are provided to demonstrate some of the ways to use the classes. If you have specific needs, you will probably have to either modify the example programs or write a new program altogether. Further, the example programs don't have a fancy GUI wrapper. If you feel the need to have a "drag and drop" graphical patching GUI, you probably don't want to use the ToolKit. Spending hundreds of hours making platform-dependent graphics code would go against one of the fundamental design goals of the ToolKit - platform independence.
For those instances where a simple GUI with sliders and buttons is helpful, we use Tcl/Tk (http://dev.scriptics.com) which is freely distributed for all the supported ToolKit platforms. A number of Tcl/Tk GUI scripts are distributed with the ToolKit release. For control, the Synthesis Toolkit uses raw MIDI (on supported platforms), and SKINI (Synthesis ToolKit Instrument Network Interface, a MIDI-like text message synthesis control format).
SYSTEM REQUIREMENTS:
See the individual README's (eg. README-linux) for platform specific information and system requirements. In general, you will use either the provided Makefiles (Unix platforms) or the VC++ workspace files to compile the example programs. To use the Tcl/Tk GUIs, you will need Tcl/Tk version 8.0 or higher. SYSTEM REQUIREMENTS:
See the individual README's (eg. README-linux) in the /doc directory for platform specific information and system requirements. In general, you will use the configure script to create Makefiles on unix platforms or the VC++ workspace files to compile the example programs. To use the Tcl/Tk GUIs, you will need Tcl/Tk version 8.0 or higher.
WHAT'S NEW:
STK has undergone several key revisions, changes, and additions since its last release. Despite being available in one form or another since 1996, we still consider STK to be alpha software. Thus, backward compatability has not been a priority. Please read the Release Notes to see what has changed since the last release. WHAT'S NEW:
The control message handling scheme has been simplified greatly through the use of the Messager class. It is now possible to have access to simultaneous piped, socketed, and/or MIDI input control messages. In most cases, this should eliminate the use of the Md2Skini program. Despite being available in one form or another since 1996, we still consider STK to be alpha software. Thus, backward compatability has not been a priority. Please read the Release Notes to see what has changed since the last release.
Realtime audio input capabilities were added to STK with release 3.0, though the behavior of such is very hardware dependent. Under Linux and Irix, audio input and output are possible with very low latency. Using the Windoze DirectSound API, minimum dependable output sound latency seems to be around 20 milliseconds or so, while input sound latency is on the order of a hundred milliseconds or more! The control message handling scheme has been simplified greatly through the use of the Messager class. It is now possible to have access to simultaneous piped, socketed, and/or MIDI input control messages. In most cases, this should eliminate the use of the Md2Skini program.
As mentioned above, it is possible to record the audio ouput of an STK program to .snd, .wav, .raw, .aif, and .mat (Matlab MAT-file) output file types. Though somewhat obsolete, the program Md2Skini can be used to write SKINI scorefiles from realtime MIDI input. Finally, STK should compile with non-realtime functionality on any platform with a generic C++ compiler. Realtime audio input capabilities were added to STK with release 3.0, though the behavior of such is very hardware dependent. Under Linux and Irix, audio input and output are possible with very low latency. Using the Windoze DirectSound API, minimum dependable output sound latency seems to be around 20 milliseconds or so, while input sound latency is on the order of a hundred milliseconds or more!
For those who wish to make a library from the core STK classes, there is a Makefile in the src directory that will accomplish that (Linux and SGI only). As mentioned above, it is possible to record the audio ouput of an STK program to .snd, .wav, .raw, .aif, and .mat (Matlab MAT-file) output file types. Though somewhat obsolete, the program Md2Skini can be used to write SKINI scorefiles from realtime MIDI input. Finally, STK should compile with non-realtime functionality on any platform with a generic C++ compiler.
For those who wish to make a library from the core STK classes, the configure script generates a Makefile in the src directory that will accomplish that (Linux, SGI, and Macintosh OS X only).
DISCLAIMER:
You probably already guessed this, but just to be sure, we don't guarantee anything works. :-) It's free ... what do you expect? If you find a bug, please let us know and we'll try to correct it. You can also make suggestions, but again, no guarantees. Send email to prc@cs.princeton.edu and gary@ccrma.stanford.edu. DISCLAIMER:
You probably already guessed this, but just to be sure, we don't guarantee anything works. :-) It's free ... what do you expect? If you find a bug, please let us know and we'll try to correct it. You can also make suggestions, but again, no guarantees. Send email to prc@cs.princeton.edu and gary@ccrma.stanford.edu.
LEGAL AND ETHICAL:
This software was designed and created to be made publicly available for free, primarily for academic purposes, so if you use it, pass it on with this documentation, and for free. LEGAL AND ETHICAL:
If you make a million dollars with it, give us some. If you make compositions with it, put us in the program notes. This software was designed and created to be made publicly available for free, primarily for academic purposes, so if you use it, pass it on with this documentation, and for free.
Some of the concepts are covered by various patents, some known to us and likely others which are unknown. Many of the ones known to us are administered by the Stanford Office of Technology and Licensing. If you make a million dollars with it, give us some. If you make compositions with it, put us in the program notes.
The good news is that large hunks of the techniques used here are public domain. To avoid subtle legal issues, we'll not state what's freely useable here, but we'll try to note within the various classes where certain things are likely to be protected by patents. Some of the concepts are covered by various patents, some known to us and likely others which are unknown. Many of the ones known to us are administered by the Stanford Office of Technology and Licensing.
The good news is that large hunks of the techniques used here are public domain. To avoid subtle legal issues, we'll not state what's freely useable here, but we'll try to note within the various classes where certain things are likely to be protected by patents.
FURTHER READING:
For complete documentation on this ToolKit, the classes, etc., see the doc directory of the distribution or surf to http://www-ccrma.stanford.edu/software/stk/. Also check the platform specific README's for specific system requirements. FURTHER READING:
For complete documentation on this ToolKit, the classes, etc., see the doc directory of the distribution or surf to http://www-ccrma.stanford.edu/software/stk/. Also check the platform specific README's for specific system requirements.
PERRY'S NOTES FROM THE ORIGINAL DISTRIBUTION:
This whole world was created with no particular hardware in mind. These examples are intended to be tutorial in nature, as a platform for the continuation of my research, and as a possible starting point for a software synthesis system. The basic motivation was to create the necessary unit generators to do the synthesis, processing, and control that I want to do and teach about. Little thought for optimization was given (see Object.cpp), and therefore improvements, especially speed enhancements, should be possible with these classes. It was written with some basic concepts in mind about how to let compilers optimize. PERRY'S NOTES FROM THE ORIGINAL DISTRIBUTION:
Your question at this point might be, "But Perry, with CMix, CMusic, CSound, CShells, CMonkeys, etc. already cluttering the landscape, why a new set of stupid C functions for music synthesis and processing?" The answers lie below. This whole world was created with no particular hardware in mind. These examples are intended to be tutorial in nature, as a platform for the continuation of my research, and as a possible starting point for a software synthesis system. The basic motivation was to create the necessary unit generators to do the synthesis, processing, and control that I want to do and teach about. Little thought for optimization was given (see Object.cpp), and therefore improvements, especially speed enhancements, should be possible with these classes. It was written with some basic concepts in mind about how to let compilers optimize.
1) I needed to port many of the things I've done Your question at this point might be, "But Perry, with CMix, CMusic, CSound, CShells, CMonkeys, etc. already cluttering the landscape, why a new set of stupid C functions for music synthesis and processing?" The answers lie below.
into something which is generic enough to port
further to different machines. 1) I needed to port many of the things I've done
into something which is generic enough to port
2) I really plan to document this stuff, so that further to different machines.
you don't have to be me to figure out what's
going on. (I'll probably be sorry I said this 2) I really plan to document this stuff, so that
in a couple of years, when even I can't figure you don't have to be me to figure out what's
out what I was thinking.) going on. (I'll probably be sorry I said this
in a couple of years, when even I can't figure
3) The classic difficulties most people have in out what I was thinking.)
trying to implement physical models are:
3) The classic difficulties most people have in
A) They have trouble understanding the papers, trying to implement physical models are:
and/or in turning the theory into practice.
A) They have trouble understanding the papers,
B) The Physical Model instruments are a pain to get and/or in turning the theory into practice.
to oscillate, and coming up with stable and
meaningful parameter values is required to B) The Physical Model instruments are a pain to get
get the models to work at all. to oscillate, and coming up with stable and
meaningful parameter values is required to
This set of C++ unit generators and instruments get the models to work at all.
might help to diminish the scores of emails I
get asking what to do with those block diagrams This set of C++ unit generators and instruments
I put in my papers. might help to diminish the scores of emails I
get asking what to do with those block diagrams
4) I wanted to try some new stuff with modal synthesis, I put in my papers.
and implement some classic FM patches as well.
4) I wanted to try some new stuff with modal synthesis,
5) I wanted to reimplement, and newly implement and implement some classic FM patches as well.
more of the intelligent and physical performer
models I've talked about in some of my papers. 5) I wanted to reimplement, and newly implement
But I wanted to do it in a portable way, and in more of the intelligent and physical performer
such a way that I can hook up modules quickly. models I've talked about in some of my papers.
I also wanted to make these instruments connectable But I wanted to do it in a portable way, and in
to such player objects, so folks like Brad Garton such a way that I can hook up modules quickly.
who really think a lot about the players can connect I also wanted to make these instruments connectable
them to my instruments, a lot about which I think. to such player objects, so folks like Brad Garton
who really think a lot about the players can connect
6) More rationalizations to follow . . . them to my instruments, a lot about which I think.
6) More rationalizations to follow . . .

1371
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1362
config.sub vendored Normal file

File diff suppressed because it is too large Load Diff

100
configure.ac Normal file
View File

@@ -0,0 +1,100 @@
# Process this file with autoconf to produce a configure script.
AC_INIT(STK, 4.1, gary@ccrma.stanford.edu, stk)
AC_CONFIG_SRCDIR(src/Stk.cpp)
AC_CONFIG_FILES(src/Makefile projects/demo/Makefile projects/effects/Makefile projects/ragamatic/Makefile projects/examples/Makefile)
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX(CC g++ c++ cxx)
AC_PROG_CXX
AC_PROG_RANLIB
# Checks for libraries.
AC_CHECK_LIB(stdc++, printf, , AC_MSG_ERROR(Stk requires the C++ library!) )
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h termio.h unistd.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_C_BIGENDIAN
AC_EGREP_CPP(yes,
[#ifndef WORDS_BIGENDIAN
yes
#endif
], [AC_SUBST( byte_order, [-D__LITTLE_ENDIAN__] )] )
AC_MSG_CHECKING(for RAWWAVE_PATH argument)
AC_SUBST( rawwaves, $RAWWAVE_PATH )
AC_MSG_RESULT($RAWWAVE_PATH)
AC_MSG_CHECKING(for INCLUDE_PATH argument)
AC_SUBST( include, $INCLUDE_PATH )
AC_MSG_RESULT($INCLUDE_PATH)
# Check for realtime support disable
AC_MSG_CHECKING(whether to compile realtime support)
AC_ARG_ENABLE(realtime, [ --disable-realtime = only compile generic non-realtime classes], [AC_SUBST( realtime, [no] ) AC_SUBST( sound_api, [] )], [AC_SUBST( realtime, [yes] ) ] )
AC_MSG_RESULT($realtime)
if test $realtime = yes; then
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(realtime support requires the pthread library!))
AC_CHECK_FUNCS(gettimeofday select socket)
fi
# Check for debug
AC_MSG_CHECKING(whether to compile debug version)
AC_ARG_ENABLE(debug,
[ --enable-debug = enable various debug output],
[AC_SUBST( debug, [-D_STK_DEBUG_] ) AC_SUBST( cflags, [-g] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)],
[AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])
# Check compiler and use -Wall if gnu.
if test $GXX = "yes" ; then
AC_SUBST( warn, [-Wall] )
fi
if test $realtime = yes; then
# Checks for package options and external software
AC_CANONICAL_HOST
AC_MSG_CHECKING(for audio API)
case $host in
*-*-linux*)
AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_ALSA__] ) AC_MSG_RESULT(using ALSA) ], [AC_SUBST( sound_api, [-D__LINUX_OSS__] ) AC_MSG_RESULT(using OSS)])
if test $sound_api = -D__LINUX_ALSA__; then
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
fi
AC_ARG_ENABLE(midiator, [ --enable-midiator = enable native MS-124W MIDI support (linux only)], [AC_SUBST( midiator, [-D__MIDIATOR__] )], [AC_SUBST( midiator, [] )])
;;
*-sgi*)
AC_SUBST( sound_api, [-D__IRIX_AL__] )
AC_MSG_RESULT(using IRIX AL)
AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR(IRIX audio support requires the audio library!) )
AC_CHECK_LIB(md, mdOpenInPort, , AC_MSG_ERROR(IRIX MIDI support requires the md library!) )
;;
*-apple*)
# Check for CoreAudio and CoreMIDI framework
AC_CHECK_HEADERS(CoreAudio/CoreAudio.h CoreMIDI/CoreMIDI.h CoreServices/CoreServices.h,
[AC_SUBST( sound_api, [-D__MACOSX_CORE__] )],
[AC_MSG_ERROR(CoreAudio and/or CoreMIDI header files not found!)] )
AC_SUBST( frameworks, ["-framework CoreAudio -framework CoreMIDI -framework CoreFoundation"] )
;;
*)
# Default case for unknown realtime systems.
AC_MSG_ERROR(Unknown system type for realtime support ... try --disable-realtime argument!)
;;
esac
fi
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNCS(strstr)
AC_OUTPUT

View File

@@ -1,155 +1,167 @@
STK: A ToolKit of Audio Synthesis Classes and Instruments in C++ STK: A ToolKit of Audio Synthesis Classes and Instruments in C++
By Perry R. Cook and Gary P. Scavone, 1995-2002. By Perry R. Cook and Gary P. Scavone, 1995-2002.
STK Classes - See the HTML documentation in the html directory for complete information. STK Classes - See the HTML documentation in the html directory for complete information.
.- Envelope - ADSR .- Envelope - ADSR
| |
|- Noise - SubNoise |- Noise - SubNoise
| |
|- Table |- Table
| |
|- WvIn - (WaveLoop, RtWvIn, TcpWvIn) |- WvIn - (WaveLoop, RtWvIn, TcpWvIn)
| |
|- WvOut - (RtWvOut, TcpWvOut) |- WvOut - (RtWvOut, TcpWvOut)
| |
|- Filter - (OnePole, OneZero, Delay, TwoPole, TwoZero, PoleZero, Biquad) |- Filter - (OnePole, OneZero, Delay, TwoPole, TwoZero, PoleZero, Biquad)
| | | | | |
| DelayL FormSwep | DelayL FormSwep
| DelayA | DelayA
| |
|- Echo, Chorus, PitShift |- Echo, Chorus, PitShift
| |
|- RtAudio, RtMidi, Socket, Thread |- RtAudio, RtMidi, Socket, Thread
Stk -| Stk -|
|- Reverb - (PRCRev, JCRev, NRev) |- Reverb - (PRCRev, JCRev, NRev)
| |
|- Modulate |- Modulate
| |
|- Messager |- SingWave
| |
|- SKINI |- Voicer
| |
|- ReedTabl, JetTabl, BowTabl |- Messager
| |
| .- FM - (HevyMetl, PercFlut, Rhodey, Wurley, TubeBell, BeeThree, FMVoices) |- SKINI
| | |
| |- Modal - ModalBar |- ReedTabl, JetTabl, BowTabl
| | |
| |- Sampler - Moog | .- FM - (HevyMetl, PercFlut, Rhodey, Wurley, TubeBell, BeeThree, FMVoices)
| | | |
| |- Resonate | |- Modal - ModalBar
| | | |
| |- PluckedTwo - Mandolin | |- VoicForm
.- Instrmnt -| | |
|- Drummer | |- Sampler - Moog
| | |
|- Clarinet, BlowHole, Saxofony, Flute, Brass, BlowBotl, Bowed, Plucked, StifKarp, Sitar | |- Resonate
| | |
|- Shakers | |- PluckedTwo - Mandolin
| .- Instrmnt -|
|- BandedWG |- Drummer
| |
.- Mesh2D |- Clarinet, BlowHole, Saxofony, Flute, Brass, BlowBotl, Bowed, Plucked, StifKarp, Sitar
|
|- Shakers
*********** UNIT GENERATORS ************** |
|- BandedWG
Master Class: Stk.cpp Sample rate, byte-swapping, error handling functionality |
|- Mesh2D
Sources: Envelope.cpp Linearly Goes to Target by Rate |
ADSR.cpp ADSR Flavor of Envelope .- Whistle
Noise.cpp Random Number Generator
SubNoise.cpp Random Numbers each N samples
Table.cpp Lookup Table (assumes given data in big-endian format) *********** UNIT GENERATORS **************
WvIn.cpp Data Input Class (interpolating) for RAW, WAV, SND (AU), AIFF, MAT-file files
WaveLoop.cpp Wavetable looping (subclass of WvIn) Master Class: Stk.cpp Sample rate, byte-swapping, error handling functionality
RtWvIn.cpp Realtime Audio Input Class (subclass of WvIn)
TcpWvIn.cpp Audio Streaming (socket server) Input Class (subclass of WvIn) Sources: Envelope.cpp Linearly Goes to Target by Rate
ADSR.cpp ADSR Flavor of Envelope
Sinks: WvOut.cpp Output Master Class for RAW, WAV, SND (AU), AIFF, MAT-file files Noise.cpp Random Number Generator
RtWvOut.cpp Realtime Output Class (subclass of WvOut) SubNoise.cpp Random Numbers each N samples
TcpWvOut.cpp Audio Streaming (socket client) Output Class (subclass of WvOut) Table.cpp Lookup Table (assumes given data in big-endian format)
WvIn.cpp Data Input Class (interpolating) for RAW, WAV, SND (AU), AIFF, MAT-file files
Duplex: RtDuplex.cpp Synchronous Realtime Audio Input/Output Class WaveLoop.cpp Wavetable looping (subclass of WvIn)
RtWvIn.cpp Realtime Audio Input Class (subclass of WvIn)
Filters: Filter.cpp Filter Master Class TcpWvIn.cpp Audio Streaming (socket server) Input Class (subclass of WvIn)
OneZero.cpp One Zero Filter
OnePole.cpp One Pole Filter Sinks: WvOut.cpp Output Master Class for RAW, WAV, SND (AU), AIFF, MAT-file files
PoleZero.cpp One Pole/One Zero Filter RtWvOut.cpp Realtime Output Class (subclass of WvOut)
TwoZero.cpp Two Zero Filter TcpWvOut.cpp Audio Streaming (socket client) Output Class (subclass of WvOut)
TwoPole.cpp Two Pole Filter
BiQuad.cpp Two Pole/Two Zero Filter Duplex: RtDuplex.cpp Synchronous Realtime Audio Input/Output Class
FormSwep.cpp Sweepable BiQuad Filter (goes to target by rate)
Delay.cpp Non-Interpolating Delay Line Class Filters: Filter.cpp Filter Master Class
DelayL.cpp Linearly Interpolating Delay Line (subclass of Delay) OneZero.cpp One Zero Filter
DelayA.cpp Allpass Interpolating Delay Line (subclass of Delay) OnePole.cpp One Pole Filter
PoleZero.cpp One Pole/One Zero Filter
Non-Linear: JetTabl.cpp Cubic Jet Non-Linearity TwoZero.cpp Two Zero Filter
BowTabl.cpp x^(-3) Bow Non-Linearity TwoPole.cpp Two Pole Filter
ReedTabl.cpp One Breakpoint Saturating Reed Non-Linearity BiQuad.cpp Two Pole/Two Zero Filter
FormSwep.cpp Sweepable BiQuad Filter (goes to target by rate)
Derived: Modulate.cpp Periodic and Random Vibrato: RawWvIn, SubNoise, OnePole Delay.cpp Non-Interpolating Delay Line Class
DelayL.cpp Linearly Interpolating Delay Line (subclass of Delay)
DelayA.cpp Allpass Interpolating Delay Line (subclass of Delay)
********** INSTRUMENTS AND ALGORITHMS **************
Non-Linear: JetTabl.cpp Cubic Jet Non-Linearity
Each Class will be listed either with all the unit generators it uses, BowTabl.cpp x^(-3) Bow Non-Linearity
or the <<Algorithm>> of which it is a flavor. All inherit from Instrmnt, ReedTabl.cpp One Breakpoint Saturating Reed Non-Linearity
which inherits from Stk.
Derived: Modulate.cpp Periodic and Random Vibrato: RawWvIn, SubNoise, OnePole
Simple.cpp Simple Instrument Pulse oscillator + resonant filtered noise SingWave.cpp Looping wave table with randomness: Modulate, WaveLoop, Envelope
Plucked.cpp Basic Plucked String DelayA, OneZero, OnePole, Noise
StifKarp.cpp Plucked String with Stiffness DelayA, DelayL, OneZero, BiQuad, Noise
PluckTwo.cpp Not So Basic Pluck DelayL, DlineA, OneZero ********** INSTRUMENTS AND ALGORITHMS **************
Mandolin.cpp Commuted Mandolin <<flavor of PluckTwo>>
Bowed.cpp So So Bowed String DelayL, BowTabl, OnePole, BiQuad, WaveLoop, ADSR Each Class will be listed either with all the unit generators it uses,
Brass.cpp Not So Bad Brass Instrument DelayA, BiQuad, PoleZero, ADSR, WaveLoop or the <<Algorithm>> of which it is a flavor. All inherit from Instrmnt,
Clarinet.cpp Pretty Good Clarinet DelayL, ReedTabl, OneZero, Envelope, Noise, WaveLoop which inherits from Stk.
BlowHole.cpp Clarinet w/ Tone & Vent Holes DelayL, ReedTabl, OneZero, Envelope, Noise, WaveLoop, PoleZero
Saxofony.cpp A Faux Saxophone DelayL, ReedTabl, OneZero, Envelope, Noise, WaveLoop Simple.cpp Simple Instrument Pulse oscillator + resonant filtered noise
Flute.cpp Pretty Good Flute JetTabl, DelayL, OnePole, PoleZero, Noise, ADSR, WaveLoop Plucked.cpp Basic Plucked String DelayA, OneZero, OnePole, Noise
BlowBotl.cpp Blown Bottle JetTabl, BiQuad, PoleZero, Noise, ADSR, WaveLoop StifKarp.cpp Plucked String with Stiffness DelayA, DelayL, OneZero, BiQuad, Noise
BandedWG.cpp Banded Waveguide Meta-Object Delay, BowTabl, ADSR, BiQuad PluckTwo.cpp Not So Basic Pluck DelayL, DlineA, OneZero
Modal.cpp N Resonances Envelope, WaveLoop, BiQuad, OnePole Mandolin.cpp Commuted Mandolin <<flavor of PluckTwo>>
ModalBar.cpp Various presets 4 Resonance Models Bowed.cpp So So Bowed String DelayL, BowTabl, OnePole, BiQuad, WaveLoop, ADSR
FM.cpp N Operator FM Master ADSR, WaveLoop, TwoZero Brass.cpp Not So Bad Brass Instrument DelayA, BiQuad, PoleZero, ADSR, WaveLoop
HevyMetl.cpp Distorted FM Synthesizer 3 Cascade with FB Modulator Clarinet.cpp Pretty Good Clarinet DelayL, ReedTabl, OneZero, Envelope, Noise, WaveLoop
PercFlut.cpp Percussive Flute 3 Cascade Operators BlowHole.cpp Clarinet w/ Tone & Vent Holes DelayL, ReedTabl, OneZero, Envelope, Noise, WaveLoop, PoleZero
Rhodey.cpp Rhodes-Like Electric Piano 2 Parallel Simple FMs Saxofony.cpp A Faux Saxophone DelayL, ReedTabl, OneZero, Envelope, Noise, WaveLoop
Wurley.cpp Wurlitzer Electric Piano 2 Parallel Simple FMs Flute.cpp Pretty Good Flute JetTabl, DelayL, OnePole, PoleZero, Noise, ADSR, WaveLoop
TubeBell.cpp Classic FM Bell 2 Parallel Simple FMs BlowBotl.cpp Blown Bottle JetTabl, BiQuad, PoleZero, Noise, ADSR, WaveLoop
FMVoices.cpp 3 Formant FM Voice 3 Carriers Share 1 Modulator BandedWG.cpp Banded Waveguide Meta-Object Delay, BowTabl, ADSR, BiQuad
BeeThree.cpp Cheezy Additive Organ 4 Oscillators Additive Modal.cpp N Resonances Envelope, WaveLoop, BiQuad, OnePole
Sampler.cpp Sampling Synthesizer 5 each ADSR, WvIn, WaveLoop, OnePole ModalBar.cpp Various presets 4 Resonance Models
Moog.cpp Swept Filter Sampler with Swept Filter FM.cpp N Operator FM Master ADSR, WaveLoop, TwoZero
Resonate.cpp Filtered Noise ADSR, BiQuad, Noise HevyMetl.cpp Distorted FM Synthesizer 3 Cascade with FB Modulator
Drummer.cpp Drum Synthesizer Bunch of WvIns, and OnePole PercFlut.cpp Percussive Flute 3 Cascade Operators
Shakers.cpp PhISM statistical model for shakers and real-world sound effects Rhodey.cpp Rhodes-Like Electric Piano 2 Parallel Simple FMs
Mesh2D.cpp Two-dimensional, rectilinear digital waveguide mesh. Wurley.cpp Wurlitzer Electric Piano 2 Parallel Simple FMs
TubeBell.cpp Classic FM Bell 2 Parallel Simple FMs
Reverb.cpp Reverberator Effects Processor Master Class for reverberators FMVoices.cpp 3 Formant FM Voice 3 Carriers Share 1 Modulator
JCRev.cpp Chowning Reverberator 3 series allpass units, 4 parallel combs, 2 stereo delays VoicForm.cpp 4 Formant Voice Synthesis FormSwep, SingWave, OnePole, OneZero, Envelope, Noise
NRev.cpp Another famous CCRMA Reverb 8 allpass, 6 parallel comb filters BeeThree.cpp Cheezy Additive Organ 4 Oscillators Additive
PRCRev.cpp Dirt Cheap Reverb by Cook 2 allpass, 2 comb filters Sampler.cpp Sampling Synthesizer 5 each ADSR, WvIn, WaveLoop, OnePole
Flanger.cpp Flanger Effects Processor DelayL, WaveLoop Moog.cpp Swept Filter Sampler with Swept Filter
Chorus.cpp Chorus Effects Processor DelayL, WaveLoop Resonate.cpp Filtered Noise ADSR, BiQuad, Noise
PitShift.cpp Cheap Pitch Shifter DelayL Drummer.cpp Drum Synthesizer Bunch of WvIns, and OnePole
Shakers.cpp PhISM statistical model for shakers and real-world sound effects
Mesh2D.cpp Two-dimensional, rectilinear digital waveguide mesh.
*********** OTHER SUPPORT CLASSES AND FILES ************** Whistle.cpp Hybrid physical/spectral model of a police whistle.
RtAudio.cpp Multi-OS/API audio I/O routines Reverb.cpp Reverberator Effects Processor Master Class for reverberators
RtMidi.cpp Multi-OS/API MIDI I/O routines JCRev.cpp Chowning Reverberator 3 series allpass units, 4 parallel combs, 2 stereo delays
Messager.cpp Pipe, socket, and MIDI control message handling NRev.cpp Another famous CCRMA Reverb 8 allpass, 6 parallel comb filters
PRCRev.cpp Dirt Cheap Reverb by Cook 2 allpass, 2 comb filters
demo.cpp Demonstration program for most synthesis algorithms Flanger.cpp Flanger Effects Processor DelayL, WaveLoop
effects.cpp Effects demonstration program Chorus.cpp Chorus Effects Processor DelayL, WaveLoop
ragamatic.cpp Nirvana just waiting to happen PitShift.cpp Cheap Pitch Shifter DelayL
SKINI.cpp SKINI file/message parser object
SKINI.msg #defines for often used and universal MIDI/SKINI symbols *********** OTHER SUPPORT CLASSES AND FILES **************
SKINI.tbl Table of SKINI messages
RtAudio.cpp Multi-OS/API audio I/O routines
RtMidi.cpp Multi-OS/API MIDI I/O routines
Messager.cpp Pipe, socket, and MIDI control message handling
Voicer.cpp Multi-instrument voice manager
demo.cpp Demonstration program for most synthesis algorithms
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

View File

@@ -1,26 +1,26 @@
The Synthesis ToolKit in C++ (STK) The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002. By Perry R. Cook and Gary P. Scavone, 1995-2002.
Please read the file README for more general STK information. Please read the file README and INSTALL for more general STK information.
Realtime support for Linux is currently using either the Open Sound System (OSS) or the Advanced Linux Sound Architecture (ALSA) sound and MIDI APIs. The free version of OSS works as well (and in some cases better than the commercial OSS version ... such as with my Maestro 2e chipset). In general, the ALSA drivers also seem to perform well. You can read more about ALSA at http://www.alsa-project.org/. ALSA is open source and holds great promise for audio under Linux. The API is selected during compilation using either the __LINUX_ALSA__ or __LINUX_OSS__ definitions. Realtime support for Linux is currently using either the Open Sound System (OSS) or the Advanced Linux Sound Architecture (ALSA) sound and MIDI APIs. The free version of OSS works as well (and in some cases better than the commercial OSS version ... such as with my Maestro 2e chipset). In general, the ALSA drivers also seem to perform well. You can read more about ALSA at http://www.alsa-project.org/. ALSA is open source and holds great promise for audio under Linux. The API is selected during compilation using either the __LINUX_ALSA__ or __LINUX_OSS__ definitions.
STK should compile without much trouble under Linux ... afterall, it is primarily developed on Linux platforms. Since all Linux distributions typically include the GNU makefile utilities, you should be able to use the default Makefile. Typing "make" will initiate the compilation process. STK should compile without much trouble under Linux ... afterall, it is primarily developed on Linux platforms. Since all Linux distributions typically include the GNU makefile utilities, you should be able to use the default Makefile. Typing "make" will initiate the compilation process.
MIDIATOR SERIAL PORT MIDI SUPPORT: MIDIATOR SERIAL PORT MIDI SUPPORT:
STK now has special support for the MIDIator serial port MIDI interface. This is of primary interest to us laptop users, whose computers usually don't have a gameport. If you want to buy one of these devices, make sure you get the MS-124w model (www.midiator.com). For it to work in STK, you must provide the __MIDIATOR__ definition during compilation (in addition to either __LINUX_ALSA__ or __LINUX_OSS__). STK now has special support for the MIDIator serial port MIDI interface. This is of primary interest to us laptop users, whose computers usually don't have a gameport. If you want to buy one of these devices, make sure you get the MS-124w model (www.midiator.com). For it to work in STK, you must provide the __MIDIATOR__ definition during compilation (in addition to either __LINUX_ALSA__ or __LINUX_OSS__).
There are a few things that need to be done on your system to get the MIDIator working. Assuming you wish to attach the MIDIator to serial port 0, add the following lines to your bootup sequence in /etc/rc.d/rc.local: There are a few things that need to be done on your system to get the MIDIator working. Assuming you wish to attach the MIDIator to serial port 0, add the following lines to your bootup sequence in /etc/rc.d/rc.local:
setserial /dev/ttyS0 baud_base 57600 setserial /dev/ttyS0 baud_base 57600
setserial /dev/ttyS0 divisor 1 setserial /dev/ttyS0 divisor 1
You may need to specify the full path to the setserial function, depending on how your PATH variable is set up. Also, you may need to modify the permissions of /dev/ttyS0 (chmod a+rwx). And finally, the MIDIator should be set for "single addresssed" mode (the S/A switch on S and the A/B switch on A), which puts identical output on all 4 MIDI output ports. It is possible to use the MIDIator in a "multi-port" mode, though I'm not currently supporting that in STK. You may need to specify the full path to the setserial function, depending on how your PATH variable is set up. Also, you may need to modify the permissions of /dev/ttyS0 (chmod a+rwx). And finally, the MIDIator should be set for "single addresssed" mode (the S/A switch on S and the A/B switch on A), which puts identical output on all 4 MIDI output ports. It is possible to use the MIDIator in a "multi-port" mode, though I'm not currently supporting that in STK.
NOTE REGARDING PTHREADS: NOTE REGARDING PTHREADS:
There haven't been any problems with threads since the old days of RedHat Linux 5.0. STK uses the MIT pthreads API. There haven't been any problems with threads since the old days of RedHat Linux 5.0. STK uses the MIT pthreads API.

24
doc/README-MacOSX.txt Normal file
View File

@@ -0,0 +1,24 @@
The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
Please read the file README and INSTALL for more general STK information.
Realtime support for Macintosh OS X uses the CoreAudio HAL API and is specified during compilation using the __MACOSX_CORE__ preprocessor definition.
It is necessary to download the OS X developer kit in order to compile STK. STK was successfully tested on OS X version 10.1.
The internal Macintosh audio hardware typically supports a sample rate of 44100 Hz only. Therefore, it is necessary to either specify this rate as a command-line option to the STK example programs or to change the default sample rate inside the Stk.h file before compilation.
There is a potential conflict between the STK Delay class and a Delay() function declared in OSUtils.h (which is included via <CoreServices/CoreServices.h>). In general, this conflict can be avoided via the use of a namespace (an explicit Delay::Delay declaration), though this made the Windows Visual C++ compiler barf. If you use STK classes within a project that includes the OSUtils.h file, you will likely need to make changes in STK classes that use the Delay class.
Tcl/Tk on OS X:
The tcl/tk interpreter does not ship by default with OS X, but must be downloaded from the internet. Once installed, it is suggested that a link be made to the executable from a standard search path (/usr/bin/wish). In any event, it will not be possible to use the supplied startup scripts in the demo directory (i.e. StkDemo.bat) because the tcl/tk script startup sequence is slightly different than for all the other systems. Assuming you have made the link mentioned above, the STK demo program and tcl/tk script can be started by typing:
wish tcl/Demo.tcl | demo Clarinet -or -ip
Initial tests have shown somewhat poor response between changes made in the tcl/tk script and the resulting audio updates.
At this point, it is not recommended to connect by socket from a tcl/tk script to an STK program because tcl/tk does not appear to properly close the socket connection and the STK program is left hanging.

View File

@@ -1,9 +1,7 @@
The Synthesis ToolKit in C++ (STK) The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002. By Perry R. Cook and Gary P. Scavone, 1995-2002.
Please read the file README for more general STK information. Please read the file README and INSTALL for more general STK information.
Please read the file README.txt for more general STK information. STK has always worked under NeXTStep without realtime audio or MIDI support. In general, STK should compile in this way using any generic C++ compiler. C++ exception handling was added to STK with release 3.2. We managed to get a version of gcc compiled for NeXTStep that can deal with C++ exceptions.
STK has always worked under NeXTStep without realtime audio or MIDI support. In general, STK should compile in this way using any generic C++ compiler. C++ exception handling was added to STK with release 3.2. We managed to get a version of gcc compiled for NeXTStep that can deal with C++ exceptions.

View File

@@ -1,13 +1,13 @@
The Synthesis ToolKit in C++ (STK) The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002. By Perry R. Cook and Gary P. Scavone, 1995-2002.
Please read the file README for more general STK information. Please read the file README and INSTALL for more general STK information.
When using the Makefiles provided, first try invoking "gmake" (for GNU make). If that doesn't work, try to download the GNU Makefile utilities from the Internet and use STK's default Makefile. If this is not possible, try using Makefile.sgi (make -f Makefile.sgi). The project Makefiles are created by configure. If you have trouble running "make", try invoking "gmake" (for GNU make). If that doesn't work, try to download the GNU Makefile utilities from the Internet.
Another issue that has crept up with this release is proper compiler support for C++ error handling. If you experience problems, you probably don't have a recent version of the C++ compiler. Otherwise, STK should compile and run on SGI platforms without any problems. Release 4.0 of STK is confirmed to compile without difficulty using CC version 7.30. Another issue that has crept up with this release is proper compiler support for C++ error handling. If you experience problems, you probably don't have a recent version of the C++ compiler. Otherwise, STK should compile and run on SGI platforms without any problems. Release 4.0 of STK is confirmed to compile (with various warnings) using CC version 7.30.
NOTE REGARDING PTHREADS: NOTE REGARDING PTHREADS:
Since release 3.1, STK has used the pthread API under Irix. It appears that pthread functionality is standard on SGI, so this change shouldn't cause any problems. If I'm wrong, let me know! Since release 3.1, STK has used the pthread API under Irix. It appears that pthread functionality is standard on SGI, so this change shouldn't cause any problems. If I'm wrong, let me know!

View File

@@ -1,73 +1,74 @@
The Synthesis ToolKit in C++ (STK) The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002. By Perry R. Cook and Gary P. Scavone, 1995-2002.
Please read the file README for more general STK information. Please read the file README for more general STK information.
DirectX and WindowsNT Issues: DirectX and WindowsNT Issues:
----------------------------- -----------------------------
STK is currently distributed with Visual C++ 6.0 project and workspace files. It has been tested using both Visual C++ 6.0 and Visual C++ .NET. STK is currently distributed with Visual C++ 6.0 project and workspace files. It has been tested using both Visual C++ 6.0 and Visual C++ .NET.
IMPORTANT VC++ NOTE: When compiling "release" versions of STK programs, link to the release multithreaded library. When compiling "debug" versions, link to the debug multithreaded library. Compiler errors will result otherwise. Also, the Microsoft folk are up to their old habits of trying to change standards. The .NET compiler will complain about cerr for some reason. IMPORTANT VC++ NOTE: When compiling "release" versions of STK programs, link to the release multithreaded library. When compiling "debug" versions, link to the debug multithreaded library. Compiler errors will result otherwise. Also, the Microsoft folk are up to their old habits of trying to change standards. The .NET compiler will complain about cerr for some reason.
The STK realtime sound input capabilities under Windoze are only supported using the DirectSoundCapture API. The latency is pretty horrendous, but what do you expect? Also, there is a chance you don't have DirectSoundCapture support on your computer. If not, you should download the DirectX 6.0 (or higher) runtime libraries from Microsoft's WWW site (http://www.microsoft.com/directx/download.asp) in order to run the pre-compiled STK executables for Windoze. The last time I checked, there was no DirectSoundCapture support for WindowsNT ... you'll have to switch to Windows 2000 or XP. I stopped supporting the WinMM audio output code with release 3.2. Both the DirectSound and Steinberg ASIO audio APIs are supported for realtime audio input/output. The Visual C++ project files included with this distribution are configured to use the DirectSound API. In order to use the ASIO API, it is necessary to change the preprocessor definition from __WINDOWS_DS__ to __WINDOWS_ASIO__, as well as include all the files in the /src/asio/ directory (i.e. asio.h, asio.cpp, ...). If you have a good quality soundcard and a native ASIO driver (not emulated), you are likely to get much better input/output response using that.
Realtime sound output under Windoze is supported using the DirectSound (dsound.lib) API. All new versions of WindowsXX come with the DirectSound library, but early versions did not. If you have trouble running the distributed executables, then you probably don't have DirectSound installed on your system. You can download the necessary DirectSound stuff from Microsoft's WWW pages (http://www.microsoft.com/directx/download.asp). When using the DirectSound API for audio input, latency is typically pretty horrendous (should we be surprised?). Also, there is a slight chance you don't have DirectSoundCapture support on your computer. If not, you should download the DirectX 6.0 (or higher) runtime libraries from Microsoft's WWW site (http://www.microsoft.com/directx/download.asp) in order to run the pre-compiled STK executables for Windoze. The last time I checked, there was no DirectSoundCapture support for WindowsNT ... you'll have to switch to Windows 2000 or XP or use an ASIO driver. I stopped supporting the WinMM audio output code with release 3.2.
Realtime MIDI input is supported using the winmm.lib API. Realtime MIDI input is supported using the winmm.lib API.
Visual C++ 6.0 workspaces have been created for the various STK projects. Everything has already been configured for you. The intermediate .obj files will be written to either the "release" or "debug" directories, but the executable files will be written to the main project directories (where they need to be for proper execution). If you should somehow lose or hose the VC++ workspace file for a project, then you will have to do a LOT of configuring to recreate it ... it's probably easier just to download the distribution again from our WWW sites. Anyway, for your benefit and mine, here is a list of things that need to be added to the various "Project Settings": Visual C++ 6.0 workspaces have been created for the various STK projects. Everything has already been configured for you. The intermediate .obj files will be written to either the "Release" or "Debug" directories, but the executable files will be written to the main project directories (where they need to be for proper execution). If you should somehow lose or hose the VC++ workspace file for a project, then you will have to do a LOT of configuring to recreate it ... it's probably easier just to download the distribution again from our WWW sites. Anyway, for your benefit and mine, here is a list of things that need to be added to the various "Project Settings":
1. Under General: Set "Output files:" to <blank> (this will put the executable in the main project directory. 1. Under General: Set "Output files:" to <blank> (this will put the executable in the main project directory.
2. Under C/C++ > Code Generation: Set "Use run-time library:" to Multithreaded (use "debug" versions for the debug configuration). 2. Under C/C++ > Code Generation: Set "Use run-time library:" to Multithreaded (use "debug" versions for the debug configuration).
3. Under Link > General: Add winmm.lib, dsound.lib, and Wsock32.lib to the end of the Object/library modules list. 3. Under Link > General: Add winmm.lib, dsound.lib, and Wsock32.lib to the end of the Object/library modules list.
4. Under C/C++ > Preprocessor: Add "../../include" directory to the "extra include" field. 4. Under C/C++ > Preprocessor: Add "../../include" directory to the "extra include" field.
5. Under C/C++ > Preprocessor: Add "__WINDOWS_DS__" to the definitions field. 5. Under C/C++ > Preprocessor: Add "__WINDOWS_DS__" to the definitions field.
6. Add all the necessary files to the project. 6. Add all the necessary files to the project.
Remember that items 1-5 above need to be done for each project and for each configuration. There might be an easy way to make global changes, but I couldn't figure it out. Remember that items 1-5 above need to be done for each project and for each configuration. There might be an easy way to make global changes, but I couldn't figure it out.
To use the Tcl/Tk GUIs, you will have to install Tcl/Tk. I got version 8.0 and it works very well (and installed easily). The distribution is available on the WWW and is free. To use the Tcl/Tk GUIs, you will have to install Tcl/Tk. I got version 8.0 and it works very well (and installed easily). The distribution is available on the WWW and is free.
In order for socketing to work, it is necessary to have the TCP protocol installed on your computer. This can be done from the "Network" control panel. In order for socketing to work, it is necessary to have the TCP protocol installed on your computer. This can be done from the "Network" control panel.
Finally, to use it all - Finally, to use it all -
PLAY SKINI SCOREFILES IN REALTIME: WINDOWS XP/2000:
demo Clarinet -or < scores/streetsf.ski There is a big advantage in using Windows XP/2000 over 95/98 with STK in that piping works, just as under unix. Also, the scheduler in 2000/XP seems to be much better, so socketed messages don't get clumped together like they do in Windows 95/98. Simply fire up a script file (ex. StkDemo.bat) by either double-clicking on it or typing it within a shell.
USE TCL/TK GUIs FOR REALTIME CONTROL: WINDOWS 95/98:
1. Open a DOS console window and start syntmono (eg. demo Clarinet -or -is). PLAY SKINI SCOREFILES IN REALTIME:
2. Double click on a Tcl/Tk file in TCLSpecs (eg. TCLPhys.tcl) from the Windows Explorer to start the GUI. Select the "communications" menu item and "Socket" and make the connection. demo Clarinet -or < scores/streetsf.ski
3. Start moving the sliders to control the instrument. USE TCL/TK GUIs FOR REALTIME CONTROL:
1. Open a DOS console window and start syntmono (eg. demo Clarinet -or -is).
USE REALTIME MIDI INPUT FOR CONTROL:
2. Double click on a Tcl/Tk file in the tcl/ subdirectory of the demo directory (eg. Demo.tcl) from the Windows Explorer to start the GUI. Select the "communications" menu item and "Socket" and make the connection.
1. Open a DOS console window and start syntmono with MIDI input (eg. demo Clarinet -or -im).
3. Start moving the sliders to control the instrument.
This assumes you already have MIDI setup correctly for your computer.
USE REALTIME MIDI INPUT FOR CONTROL:
WINDOWS 2000/XP:
1. Open a DOS console window and start syntmono with MIDI input (eg. demo Clarinet -or -im).
There is a big advantage in using Windows 2000/XP over 95/98 with STK in that piping works, just as under unix. Also, the scheduler in 2000/XP seems to be much better, so socketed messages don't get clumped together like they do in Windows 95/98. The script files (ex. Demo) can be renamed with .bat extensions, allowing them to work in the same way as in unix systems.
This assumes you already have MIDI setup correctly for your computer.
WINDOWS NT ONLY:
WINDOWS NT ONLY:
Realtime piping seems to work under WindowsNT in much the same way as on Unix platforms. Thus, it is possible to pipe realtime control data to syntmono under WindowsNT as well.
Realtime piping seems to work under WindowsNT in much the same way as on Unix platforms. Thus, it is possible to pipe realtime control data to syntmono under WindowsNT as well. Note, however, that the DirectSoundCapture API does not exist for WindowsNT, so it is necessary to use an ASIO audio driver and the STK ASIO support.

View File

@@ -1,101 +1,118 @@
The Synthesis ToolKit in C++ (STK) The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002. By Perry R. Cook and Gary P. Scavone, 1995-2002.
v4.0: (April 2002) v4.1: (8 October 2002)
- new documentation and tutorial - Macintosh OS X support added
- several new instruments, including Saxofony, BlowBotl, and StifKarp - new Whistle class
- new Stk base class, replacing Object class - added Voicer, SingWave, and VoicForm classes
- new Filter class structure and methods - improvements/fixes to the banded waveguide instruments
- extensive modifications to WvIn and WvOut class structures and methods - demo program now uses Voicer, allowing polyphony
- looping functionality moved to WaveLoop (subclass of WvIn) - demo tcl/tk scripts changed to use SKINI PitchChange instead of PitchBend
- automatic file type detection in WvIn ... hosed WavWvIn, AifWvIn, RawWavIn, SndWavIn, and MatWvIn subclasses - demo program response to PitchBend modified to octave up/down
- new file type specifier argument in WvOut ... hosed WavWvOut, AifWvOut, RawWavOut, SndWavOut, and MatWvOut subclasses - several RtAudio fixes and improvements (OS X and Windows ASIO support added)
- some simplifications of Messager class (was Controller) - added nextOut() method to Delay classes
- new independent RtAudio class - documentation fixes for Reverb classes
- extensive revisions in code and a significant number of API changes - RAWWAVE_PATH changed to include the "rawwave" directory
- "configure" support added for unix systems
v3.2: (13 November 2000) - multivoice flag (-n NUMBER) added as command line option to demo program
- new control handling class (Controller) - sample rate flag added as command line option to all example programs
- added AIFF file input/output support - socket port number added as command line option to all example programs
- stklib.a Makefile in src directory
- added C++ error handling capabilities v4.0: (April 2002)
- added input/output internet streaming support (StrmWvIn/StrmWvOut) - new documentation and tutorial
- added native ALSA support for linux - several new instruments, including Saxofony, BlowBotl, and StifKarp
- added optional "device" argument to all "Rt" classes (audio and MIDI) and printout of devices when argument is invalid - new Stk base class, replacing Object class
- WvIn classes rewritten to support very big files (incremental load from disk) - new Filter class structure and methods
- changed WvIn/WvOut classes to work with sample frame buffers - extensive modifications to WvIn and WvOut class structures and methods
- fixed looping and negative rate calculations in WvIn classes - looping functionality moved to WaveLoop (subclass of WvIn)
- fixed interpolation bug in RtWvIn - automatic file type detection in WvIn ... hosed WavWvIn, AifWvIn, RawWavIn, SndWavIn, and MatWvIn subclasses
- windoze RtAudio code rewritten (thanks Dave!) - new file type specifier argument in WvOut ... hosed WavWvOut, AifWvOut, RawWavOut, SndWavOut, and MatWvOut subclasses
- simplified byte-swapping functions (in-place swapping) - some simplifications of Messager class (was Controller)
- new FIR filter class (thanks Julius!) - new independent RtAudio class
- "stereo-ized" RagaMatic - extensive revisions in code and a significant number of API changes
- probably a bunch more fixes that I've long since forgotten about
v3.2: (13 November 2000)
- new control handling class (Controller)
v3.1: (13 March 2000) - added AIFF file input/output support
- new RagaMatic project!!! - stklib.a Makefile in src directory
- added "microphone position" to Mandolin in STKdemo - added C++ error handling capabilities
- fixed MIDI system message exclusion under Irix - added input/output internet streaming support (StrmWvIn/StrmWvOut)
- added a few bitmaps for the Shaker instruments - added native ALSA support for linux
- made destructors virtual for Reverb.h, WvIn.h and Simple.h - added optional "device" argument to all "Rt" classes (audio and MIDI) and printout of devices when argument is invalid
- fixed bug setting delay length in DLineA when value too big - WvIn classes rewritten to support very big files (incremental load from disk)
- fixed bug in WinMM realtime code (RTSoundIO) - changed WvIn/WvOut classes to work with sample frame buffers
- added tick() method to BowTabl, JetTabl, and ReedTabl (same as lookup) - fixed looping and negative rate calculations in WvIn classes
- switched to pthread API on SGI platforms - fixed interpolation bug in RtWvIn
- added some defines to Object.h for random number generation, FPU overflow checking, etc... - windoze RtAudio code rewritten (thanks Dave!)
- a lot of minor changes, some bug fixes ... can't remember all of them - simplified byte-swapping functions (in-place swapping)
- new FIR filter class (thanks Julius!)
- "stereo-ized" RagaMatic
v3.0: (10 October 1999) - probably a bunch more fixes that I've long since forgotten about
- new #define flags for OS and realtime dependencies (this will probably cause problems for most everyone, but it was necessary to make future ports easier)
- fixed Linux MIDI input bug
- fixed MIDI status masking problem in Windows v3.1: (13 March 2000)
- OS type defines now in Makefile - new RagaMatic project!!!
- new RAWWAVE_PATH define in Object.h - added "microphone position" to Mandolin in STKdemo
- syntmono pulled out to separate directory and cleaned up - fixed MIDI system message exclusion under Irix
- socketing capabilities under Unix, as well as Windoze - added a few bitmaps for the Shaker instruments
- multiple simultaneous socket client connections to STK servers now possible - made destructors virtual for Reverb.h, WvIn.h and Simple.h
- MD2SKINI now can merge MIDI and piped messages under Irix and Linux (for TCL->MD2SKINI->syntmono control) - fixed bug setting delay length in DLineA when value too big
- defined INT16 and INT32 types and fixed various WvIn and WvOut classes - fixed bug in WinMM realtime code (RTSoundIO)
- updated MatWvIn and MatWvOut for new MAT-file documentation from Matlab - added tick() method to BowTabl, JetTabl, and ReedTabl (same as lookup)
- new demo GUI - switched to pthread API on SGI platforms
- minor fixes to FM behavior - added some defines to Object.h for random number generation, FPU overflow checking, etc...
- added record/duplex capabilities to RTSoundIO (Linux, SGI, and Windoze) - a lot of minor changes, some bug fixes ... can't remember all of them
- fixed bugs in WavWvOut and MatWvOut header specifications
- added RawWvOut class
- new WvIn class with RawWvIn, SndWvIn, WavWvIn, MatWvIn, and RTWvIn subclasses v3.0: (10 October 1999)
- removed RawWave, RawShot, RawInterp, and RawLoop classes (supplanted by RawWvIn) - new #define flags for OS and realtime dependencies (this will probably cause problems for most everyone, but it was necessary to make future ports easier)
- multi-channel data support in WvIn and WvOut classes using MY_MULTI data type (pointer to MY_FLOAT) and the methods mtick() and mlastOutput() - fixed Linux MIDI input bug
- now writing to primary buffer under Windoze when allowed by hardware - fixed MIDI status masking problem in Windows
- cleaned up Object.h a bit - OS type defines now in Makefile
- pulled various utility and thread functions out of syntmono.cpp (to aid readability of the code) - new RAWWAVE_PATH define in Object.h
- syntmono pulled out to separate directory and cleaned up
- socketing capabilities under Unix, as well as Windoze
v2.02: (16 November 1998) - multiple simultaneous socket client connections to STK servers now possible
- 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). - MD2SKINI now can merge MIDI and piped messages under Irix and Linux (for TCL->MD2SKINI->syntmono control)
- modified DrumSynt to correctly handle sample rates different than 22050 Hz. - defined INT16 and INT32 types and fixed various WvIn and WvOut classes
- 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. - updated MatWvIn and MatWvOut for new MAT-file documentation from Matlab
- fixed DirectSound playback bug in Win distribution. Sound was being played at 8-bit, 22 kHz in all cases. Playback is now 16-bit and dependent on SRATE. - new demo GUI
- fixed bug in MD2SKINI which prevented some NoteOff statements from being output. - minor fixes to FM behavior
- added record/duplex capabilities to RTSoundIO (Linux, SGI, and Windoze)
- fixed bugs in WavWvOut and MatWvOut header specifications
v2.01: (27 July 1998) - added RawWvOut class
- Corrected extraneous ^M line return characters that were incompatible with SGI. - 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 MY_FLOAT) and the methods mtick() and mlastOutput()
v2.0: (20 July 1998) - now writing to primary buffer under Windoze when allowed by hardware
- The first true release by Gary, with unified capabilities across SGI, Linux, and Win platforms. See WWW pages (http://www-ccrma.stanford.edu/CCRMA/Software/STK/) for more info. - cleaned up Object.h a bit
- pulled various utility and thread functions out of syntmono.cpp (to aid readability of the code)
v1.1:
- More linux support and other changes that happened so long ago that I can't remember anymore. Never officially released. v2.02: (16 November 1998)
- 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.
v1.0: - 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.
- Linux support added with the help of Tim Stilson. Never officially released. - fixed DirectSound playback bug in Win 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.
v0.8:
v2.01: (27 July 1998)
- Corrected extraneous ^M line return characters that were incompatible with SGI.
v2.0: (20 July 1998)
- The first true release by Gary, with unified capabilities across SGI, Linux, and Win platforms. See WWW pages (http://www-ccrma.stanford.edu/CCRMA/Software/STK/) for more info.
v1.1:
- More linux support and other changes that happened so long ago that I can't remember anymore. Never officially released.
v1.0:
- Linux support added with the help of Tim Stilson. Never officially released.
v0.8:
- One of (if not THE) original distributions for SGI, NeXTStep, and basic Win support. I think this came out in 1996. - One of (if not THE) original distributions for SGI, NeXTStep, and basic Win support. I think this came out in 1996.

View File

@@ -1,391 +1,391 @@
This describes the latest (version 1.1) implementation of SKINI. This describes the latest (version 1.1) implementation of SKINI.
Synthesis toolKit Instrument Network Interface Synthesis toolKit Instrument Network Interface
for the Synthesis Toolkit in C++ by Perry R. Cook. for the Synthesis Toolkit in C++ by Perry R. Cook.
********************************* *********************************
* Too good to be true? * * Too good to be true? *
* Have control and read it too? * * Have control and read it too? *
* A SKINI Haiku. * * A SKINI Haiku. *
********************************* *********************************
Profound thanks to Dan Trueman, Brad Garton, and Profound thanks to Dan Trueman, Brad Garton, and
Gary Scavone for input on this revision. Thanks Gary Scavone for input on this revision. Thanks
also to MIDI, the NeXT MusicKit, ZIPI and all also to MIDI, the NeXT MusicKit, ZIPI and all
the creators and modifiers of these for good bases the creators and modifiers of these for good bases
upon/from which to build and depart. upon/from which to build and depart.
1) MIDI Compatibility 1) MIDI Compatibility
SKINI was designed to be MIDI compatible wherever possible, SKINI was designed to be MIDI compatible wherever possible,
and extend MIDI in incremental, then maybe profound ways. and extend MIDI in incremental, then maybe profound ways.
Differences from MIDI, and motivations, include: Differences from MIDI, and motivations, include:
Text-based messages are used, with meaningful names Text-based messages are used, with meaningful names
wherever possible. This allows any language or system wherever possible. This allows any language or system
capable of formatted printing to generate SKINI. capable of formatted printing to generate SKINI.
Similarly, any system capable of reading in a string Similarly, any system capable of reading in a string
and turning delimited fields into strings, floats, and turning delimited fields into strings, floats,
and ints can consume SKINI for control. More importantly, and ints can consume SKINI for control. More importantly,
humans can actually read, and even write if they want, humans can actually read, and even write if they want,
SKINI files and streams. Use an editor and search/ SKINI files and streams. Use an editor and search/
replace or macros to change a channel or control number. replace or macros to change a channel or control number.
Load a SKINI score into a spread sheet to apply Load a SKINI score into a spread sheet to apply
transformations to time, control parameters, MIDI transformations to time, control parameters, MIDI
velocities, etc. Put a monkey on a special typewriter velocities, etc. Put a monkey on a special typewriter
and get your next great work. Life's too short to debug and get your next great work. Life's too short to debug
bit/nybble packed variable length mumble messages. Disk bit/nybble packed variable length mumble messages. Disk
space gets cheaper, available bandwidth increases, music space gets cheaper, available bandwidth increases, music
takes up so little space and bandwidth compared to video takes up so little space and bandwidth compared to video
and grapics. Live a little. and grapics. Live a little.
Floating point numbers are used wherever possible. Floating point numbers are used wherever possible.
Note Numbers, Velocities, Controller Values, and Note Numbers, Velocities, Controller Values, and
Delta and Absolute Times are all represented and Delta and Absolute Times are all represented and
scanned as ASCII double-precision floats. MIDI byte scanned as ASCII double-precision floats. MIDI byte
values are preserved, so that incoming MIDI bytes values are preserved, so that incoming MIDI bytes
from an interface can be put directly into SKINI from an interface can be put directly into SKINI
messages. 60.0 or 60 is middle C, 127.0 or 127 is messages. 60.0 or 60 is middle C, 127.0 or 127 is
maximum velocity etc. But, unlike MIDI, 60.5 can maximum velocity etc. But, unlike MIDI, 60.5 can
cause a 50cent sharp middle C to be played. As with cause a 50cent sharp middle C to be played. As with
MIDI byte values like velocity, use of the integer and MIDI byte values like velocity, use of the integer and
SKINI-added fractional parts is up to the implementor SKINI-added fractional parts is up to the implementor
of the algorithm being controlled by SKINI messages. of the algorithm being controlled by SKINI messages.
But the extra precision is there to be used or ignored. But the extra precision is there to be used or ignored.
2) WHY SKINI? 2) WHY SKINI?
SKINI was designed to be extensable and hackable for a number SKINI was designed to be extensable and hackable for a number
of applications: imbedded synthesis in a game or VR simulation, of applications: imbedded synthesis in a game or VR simulation,
scoring and mixing tasks, real-time and non-real time applications scoring and mixing tasks, real-time and non-real time applications
which could benefit from controllable sound synthesis, which could benefit from controllable sound synthesis,
JAVA controlled synthesis, or eventually maybe JAVA synthesis, JAVA controlled synthesis, or eventually maybe JAVA synthesis,
etc. SKINI is not intended to be "the mother of scorefiles," etc. SKINI is not intended to be "the mother of scorefiles,"
but since the entire system is based on text representations but since the entire system is based on text representations
of names, floats, and ints, converters from one scorefile of names, floats, and ints, converters from one scorefile
language to SKINI, or back, should be easily created. language to SKINI, or back, should be easily created.
I am basically a bottom-up designer with an awareness of top- I am basically a bottom-up designer with an awareness of top-
down design ideas, so SKINI above all reflects the needs of my down design ideas, so SKINI above all reflects the needs of my
particular research and creative projects as they have arisen and particular research and creative projects as they have arisen and
developed. SKINI 1.1 represents a profound advance beyond developed. SKINI 1.1 represents a profound advance beyond
versions 0.8 and 0.9 (the first versions), future SKINI's might versions 0.8 and 0.9 (the first versions), future SKINI's might
reflect some changes. Compatibility with prior scorefiles reflect some changes. Compatibility with prior scorefiles
will be attempted, but there aren't that many scorefiles out will be attempted, but there aren't that many scorefiles out
there yet. there yet.
3) SKINI MESSAGES 3) SKINI MESSAGES
A basic SKINI message is a line of text. There are only three A basic SKINI message is a line of text. There are only three
required fields, the message type (an ASCII name), the time (either required fields, the message type (an ASCII name), the time (either
delta or absolute), and the channel number. Don't freak out and delta or absolute), and the channel number. Don't freak out and
think that this is MIDI channel 0-15 (which is supported), because think that this is MIDI channel 0-15 (which is supported), because
the channel number is scanned as a long int. Channels could be socket the channel number is scanned as a long int. Channels could be socket
numbers, machine IDs, serial numbers, or even unique tags for each numbers, machine IDs, serial numbers, or even unique tags for each
event in a synthesis. Other fields might be used, as specified in the event in a synthesis. Other fields might be used, as specified in the
SKINI.tbl file. This is described in more detail later. SKINI.tbl file. This is described in more detail later.
Fields in a SKINI line are delimited by spaces, commas, or Fields in a SKINI line are delimited by spaces, commas, or
tabs. The SKINI parser only operates on a line at a time, tabs. The SKINI parser only operates on a line at a time,
so a newline means the message is over. Multiple messages are so a newline means the message is over. Multiple messages are
NOT allowed directly on a single line (by use of the ; for NOT allowed directly on a single line (by use of the ; for
example in C). This could be supported, but it isn't in example in C). This could be supported, but it isn't in
version 1.1. version 1.1.
Message types include standard MIDI types like NoteOn, NoteOff, Message types include standard MIDI types like NoteOn, NoteOff,
ControlChange, etc. MIDI extension message types (messages ControlChange, etc. MIDI extension message types (messages
which look better than MIDI but actually get turned into which look better than MIDI but actually get turned into
MIDI-like messages) include LipTension, StringDamping, etc. MIDI-like messages) include LipTension, StringDamping, etc.
NonMIDI message types include SetPath (sets a path for file NonMIDI message types include SetPath (sets a path for file
use later), and OpenReadFile (for streaming, mixing, and applying use later), and OpenReadFile (for streaming, mixing, and applying
effects to soundfiles along with synthesis, for example). effects to soundfiles along with synthesis, for example).
Other non-MIDI message types include Trilling, HammerOn, etc. (these Other non-MIDI message types include Trilling, HammerOn, etc. (these
translate to gestures, behaviors, and contexts for use by translate to gestures, behaviors, and contexts for use by
intellegent players and instruments using SKINI). Where possible intellegent players and instruments using SKINI). Where possible
I will still use these as MIDI extension messages, so foot I will still use these as MIDI extension messages, so foot
switches, etc. can be used to control them in real time. switches, etc. can be used to control them in real time.
All fields other than type, time, and channel are optional, and the All fields other than type, time, and channel are optional, and the
types and useage of the additional fields is defined in the file types and useage of the additional fields is defined in the file
SKINI.tbl. SKINI.tbl.
The other important file used by SKINI is SKINI.msg, which is a The other important file used by SKINI is SKINI.msg, which is a
set of #defines to make C code more readable, and to allow reasonably set of #defines to make C code more readable, and to allow reasonably
quick re-mapping of control numbers, etc.. All of these defined quick re-mapping of control numbers, etc.. All of these defined
symbols are assigned integer values. For JAVA, the #defines could symbols are assigned integer values. For JAVA, the #defines could
be replaced by declaration and assignment statements, preserving be replaced by declaration and assignment statements, preserving
the look and behavior of the rest of the code. the look and behavior of the rest of the code.
4) C Files Used To Implement SKINI 4) C Files Used To Implement SKINI
SKINI.cpp is an object which can either open a SKINI file, and SKINI.cpp is an object which can either open a SKINI file, and
successively read and parse lines of text as SKINI strings, or successively read and parse lines of text as SKINI strings, or
accept strings from another object and parse them. The latter accept strings from another object and parse them. The latter
functionality would be used by a socket, pipe, or other connection functionality would be used by a socket, pipe, or other connection
receiving SKINI messages a line at a time, usually in real time, receiving SKINI messages a line at a time, usually in real time,
but not restricted to real time. but not restricted to real time.
SKINI.msg should be included by anything wanting to use the SKINI.msg should be included by anything wanting to use the
SKINI.cpp object. This is not mandatory, but use of the __SK_blah_ 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 symbols which are defined in the .msg file will help to ensure
clarity and consistency when messages are added and changed. clarity and consistency when messages are added and changed.
SKINI.tbl is used only by the SKINI parser object (SKINI.cpp). SKINI.tbl is used only by the SKINI parser object (SKINI.cpp).
In the file SKINI.tbl, an array of structures is declared and In the file SKINI.tbl, an array of structures is declared and
assigned values which instruct the parser as to what the message assigned values which instruct the parser as to what the message
types are, and what the fields mean for those message types. types are, and what the fields mean for those message types.
This table is compiled and linked into applications using SKINI, but This table is compiled and linked into applications using SKINI, but
could be dynamically loaded and changed in a future version of could be dynamically loaded and changed in a future version of
SKINI. SKINI.
5) SKINI Messages and the SKINI Parser: 5) SKINI Messages and the SKINI Parser:
The parser isn't all that smart, but neither am I. Here are the The parser isn't all that smart, but neither am I. Here are the
basic rules governing a valid SKINI message: basic rules governing a valid SKINI message:
a) If the first (non-delimiter (see c)) character in a SKINI a) If the first (non-delimiter (see c)) character in a SKINI
string is '/' that line is treated as a comment and echoed string is '/' that line is treated as a comment and echoed
to stdout. to stdout.
b) If there are no characters on a line, that line is treated b) If there are no characters on a line, that line is treated
as blank and echoed to stdout. Tabs and spaces are treated as blank and echoed to stdout. Tabs and spaces are treated
as non-characters. as non-characters.
c) Spaces, commas, and tabs delimit the fields in a SKINI c) Spaces, commas, and tabs delimit the fields in a SKINI
message line. (We might allow for multiple messages per message line. (We might allow for multiple messages per
line later using the semicolon, but probably not. A series line later using the semicolon, but probably not. A series
of lines with deltaTimes of 0.0 denotes simultaneous events. of lines with deltaTimes of 0.0 denotes simultaneous events.
For read-ability, multiple messages per line doesn't help much, For read-ability, multiple messages per line doesn't help much,
so it's unlikely to be supported later). so it's unlikely to be supported later).
d) The first field must be a SKINI message name. (like NoteOn). d) The first field must be a SKINI message name. (like NoteOn).
These might become case-insensitive in future versions, so don't These might become case-insensitive in future versions, so don't
plan on exciting clever overloading of names (like noTeOn being plan on exciting clever overloading of names (like noTeOn being
different from NoTeON). There can be a number of leading different from NoTeON). There can be a number of leading
spaces or tabs, but don't exceed 32 or so. spaces or tabs, but don't exceed 32 or so.
e) The second field must be a time specification in seconds. e) The second field must be a time specification in seconds.
A time field can be either delta-time (most common and the only one A time field can be either delta-time (most common and the only one
supported in version 0.8), or absolute time. Absolute time supported in version 0.8), or absolute time. Absolute time
messages have an '=' appended to the beginning of the floating messages have an '=' appended to the beginning of the floating
point number with no space. So 0.10000 means delta time of point number with no space. So 0.10000 means delta time of
100 ms, while =0.10000 means absolute time of 100 ms. Absolute 100 ms, while =0.10000 means absolute time of 100 ms. Absolute
time messages make most sense in score files, but could also be time messages make most sense in score files, but could also be
used for (loose) synchronization in a real-time context. Real used for (loose) synchronization in a real-time context. Real
time messages should be time-ordered AND time-correct. That is, time messages should be time-ordered AND time-correct. That is,
if you've sent 100 total delta-time messages of 1.0 seconds, and if you've sent 100 total delta-time messages of 1.0 seconds, and
then send an absolute time message of =90.0 seconds, or if you then send an absolute time message of =90.0 seconds, or if you
send two absolute time messages of =100.0 and =90.0 in that send two absolute time messages of =100.0 and =90.0 in that
order, things will get really fouled up. The SKINI parser order, things will get really fouled up. The SKINI parser
doesn't know about time, however. The WvOut device is the doesn't know about time, however. The WvOut device is the
master time keeper in the Synthesis Toolkit, so it should be master time keeper in the Synthesis Toolkit, so it should be
queried to see if absolute time messages are making sense. queried to see if absolute time messages are making sense.
There's an example of how to do that later in this document. There's an example of how to do that later in this document.
Absolute times are returned by the parser as negative numbers Absolute times are returned by the parser as negative numbers
(since negative deltaTimes are not allowed). (since negative deltaTimes are not allowed).
f) The third field must be an integer channel number. Don't go f) The third field must be an integer channel number. Don't go
crazy and think that this is just MIDI channel 0-15 (which is crazy and think that this is just MIDI channel 0-15 (which is
supported). The channel number is scanned as a long int. Channels supported). The channel number is scanned as a long int. Channels
0-15 are in general to be treated as MIDI channels. After that 0-15 are in general to be treated as MIDI channels. After that
it's wide open. Channels could be socket numbers, machine IDs, it's wide open. Channels could be socket numbers, machine IDs,
serial numbers, or even unique tags for each event in a synthesis. serial numbers, or even unique tags for each event in a synthesis.
A -1 channel can be used as don't care, omni, or other functions A -1 channel can be used as don't care, omni, or other functions
depending on your needs and taste. 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 SKINI.tbl file.
In general, there are maximum two more fields, which are either In general, there are maximum two more fields, which are either
SK_INT (long), SK_DBL (double float), or SK_STR (string). The SK_INT (long), SK_DBL (double float), or SK_STR (string). The
latter is the mechanism by which more arguments can be specified latter is the mechanism by which more arguments can be specified
on the line, but the object using SKINI must take that string on the line, but the object using SKINI must take that string
apart (retrived by using getRemainderString()) and scan it. apart (retrived by using getRemainderString()) and scan it.
Any excess fields are stashed in remainderString. Any excess fields are stashed in remainderString.
6) A Short SKINI File: 6) A Short SKINI File:
/* Howdy!!! Welcome to SKINI, by P. Cook 1999 /* Howdy!!! Welcome to SKINI, by P. Cook 1999
NoteOn 0.000082 2 55 82 NoteOn 0.000082 2 55 82
NoteOff 1.000000 2 55 0 NoteOff 1.000000 2 55 0
NoteOn 0.000082 2 69 82 NoteOn 0.000082 2 69 82
StringDetune 0.100000 2 10 StringDetune 0.100000 2 10
StringDetune 0.100000 2 30 StringDetune 0.100000 2 30
StringDetune 0.100000 2 50 StringDetune 0.100000 2 50
NoteOn 0.000000 2 69 82 NoteOn 0.000000 2 69 82
StringDetune 0.100000 2 40 StringDetune 0.100000 2 40
StringDetune 0.100000 2 22 StringDetune 0.100000 2 22
StringDetune 0.100000 2 12 StringDetune 0.100000 2 12
// //
StringDamping 0.000100 2 0.0 StringDamping 0.000100 2 0.0
NoteOn 0.000082 2 55 82 NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82 NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82 NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82 NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82 NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82 NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82 NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82 NoteOff 0.000000 2 79 82
StringDamping =4.000000 2 0.0 StringDamping =4.000000 2 0.0
NoteOn 0.000082 2 55 82 NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82 NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82 NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82 NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82 NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82 NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82 NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82 NoteOff 0.000000 2 79 82
7) The SKINI.tbl File, How Messages are Parsed: 7) The SKINI.tbl File, How Messages are Parsed:
The SKINI.tbl file contains an array of structures which The SKINI.tbl file contains an array of structures which
are accessed by the parser object SKINI.cpp. The struct is: are accessed by the parser object SKINI.cpp. The struct is:
struct SKINISpec { char messageString[32]; struct SKINISpec { char messageString[32];
long type; long type;
long data2; long data2;
long data3; long data3;
}; };
so an assignment of one of these structs looks like: so an assignment of one of these structs looks like:
MessageStr$ ,type, data2, data3, MessageStr$ ,type, data2, data3,
type is the message type sent back from the SKINI line parser. type is the message type sent back from the SKINI line parser.
data<n> is either data<n> is either
NOPE : field not used, specifically, there aren't going NOPE : field not used, specifically, there aren't going
to be any more fields on this line. So if there to be any more fields on this line. So if there
is is NOPE in data2, data3 won't even be checked is is NOPE in data2, data3 won't even be checked
SK_INT : byte (actually scanned as 32 bit signed long int) SK_INT : byte (actually scanned as 32 bit signed long int)
If it's a MIDI data field which is required to If it's a MIDI data field which is required to
be an integer, like a controller number, it's be an integer, like a controller number, it's
0-127. Otherwise) get creative with SK_INTs 0-127. Otherwise) get creative with SK_INTs
SK_DBL : double precision floating point. SKINI uses these SK_DBL : double precision floating point. SKINI uses these
in the MIDI context for note numbers with micro in the MIDI context for note numbers with micro
tuning, velocities, controller values, etc. tuning, velocities, controller values, etc.
SK_STR : only valid in final field. This allows (nearly) SK_STR : only valid in final field. This allows (nearly)
arbitrary message types to be supported by simply arbitrary message types to be supported by simply
scanning the string to EndOfLine and then passing scanning the string to EndOfLine and then passing
it to a more intellegent handler. For example, it to a more intellegent handler. For example,
MIDI SYSEX (system exclusive) messages of up to MIDI SYSEX (system exclusive) messages of up to
256 bytes can be read as space-delimited integers 256 bytes can be read as space-delimited integers
into the 1K SK_STR buffer. Longer bulk dumps, into the 1K SK_STR buffer. Longer bulk dumps,
soundfiles, etc. should be handled as a new soundfiles, etc. should be handled as a new
message type pointing to a FileName, Socket, or message type pointing to a FileName, Socket, or
something else stored in the SK_STR field, or something else stored in the SK_STR field, or
as a new type of multi-line message. 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 SKINI.tbl file
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL}, {"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL}, {"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
{"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL}, {"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
{"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL}, {"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL},
{"StringDamping" , __SK_ControlChange_, __SK_StringDamping_, SK_DBL}, {"StringDamping" , __SK_ControlChange_, __SK_StringDamping_, SK_DBL},
{"StringDetune" , __SK_ControlChange_, __SK_StringDetune_, SK_DBL}, {"StringDetune" , __SK_ControlChange_, __SK_StringDetune_, SK_DBL},
The first three are basic MIDI messages. The first two would cause the The first three are basic MIDI messages. The first two would cause the
parser, after recognizing a match of the string "NoteOff" or "NoteOn", 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_ 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 SKINI.msg to be the MIDI byte value, without
channel, of the actual MIDI messages for NoteOn and NoteOff). The parser 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 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 therefore not described in the SKINI Message Struct). The next two
fields would be scanned as double-precision floats and assigned to fields would be scanned as double-precision floats and assigned to
the byteTwo and byteThree variables of the SKINI parser. The remainder the byteTwo and byteThree variables of the SKINI parser. The remainder
of the line is stashed in the remainderString variable. of the line is stashed in the remainderString variable.
The ControlChange spec is basically the same as NoteOn and NoteOff, but The ControlChange spec is basically the same as NoteOn and NoteOff, but
the second data byte is set to an integer (for checking later as to the second data byte is set to an integer (for checking later as to
what MIDI control is being changed). what MIDI control is being changed).
The Volume spec is a MIDI Extension message, which behaves like a The Volume spec is a MIDI Extension message, which behaves like a
ControlChange message with the controller number set explicitly to ControlChange message with the controller number set explicitly to
the value for MIDI Volume (7). Thus the following two lines would the value for MIDI Volume (7). Thus the following two lines would
accomplish the same changing of MIDI volume on channel 2: accomplish the same changing of MIDI volume on channel 2:
ControlChange 0.000000 2 7 64.1 ControlChange 0.000000 2 7 64.1
Volume 0.000000 2 64.1 Volume 0.000000 2 64.1
I like the 2nd line better, thus my motivation for SKINI in the first I like the 2nd line better, thus my motivation for SKINI in the first
place. place.
The StringDamping and StringDetune messages behave the same as The StringDamping and StringDetune messages behave the same as
the Volume message, but use Control Numbers which aren't specifically the Volume message, but use Control Numbers which aren't specifically
nailed-down in MIDI. Note that these Control Numbers are carried nailed-down in MIDI. Note that these Control Numbers are carried
around as long ints, so we're not limited to 0-127. If, however, around as long ints, so we're not limited to 0-127. If, however,
you want to use a MIDI controller to play an instrument, using you want to use a MIDI controller to play an instrument, using
controller numbers in the 0-127 range might make sense. controller numbers in the 0-127 range might make sense.
8) Objects using SKINI 8) Objects using SKINI
Here's a simple example of code which uses the SKINI object Here's a simple example of code which uses the SKINI object
to read a SKINI file and control a single instrument. to read a SKINI file and control a single instrument.
instrument = new Mandolin(50.0); instrument = new Mandolin(50.0);
score = new SKINI(argv[1]); score = new SKINI(argv[1]);
while(score->getType() > 0) { while(score->getType() > 0) {
tempDouble = score->getDelta(); tempDouble = score->getDelta();
if (tempDouble < 0) { if (tempDouble < 0) {
tempDouble = - tempDouble; tempDouble = - tempDouble;
tempDouble = tempDouble - output.getTime(); tempDouble = tempDouble - output.getTime();
if (tempDouble < 0) { if (tempDouble < 0) {
printf("Bad News Here!!! Backward Absolute Time Required.\n"); printf("Bad News Here!!! Backward Absolute Time Required.\n");
tempDouble = 0.0; tempDouble = 0.0;
} }
} }
tempLong = (long) (tempDouble * Stk::sampleRate()); tempLong = (long) (tempDouble * Stk::sampleRate());
for (i=0;i<tempLong;i++) { for (i=0;i<tempLong;i++) {
output.tick(instrument->tick()); output.tick(instrument->tick());
} }
tempDouble3 = score->getByteThree(); tempDouble3 = score->getByteThree();
if (score->getType()== __SK_NoteOn_ ) { if (score->getType()== __SK_NoteOn_ ) {
tempDouble3 *= NORM_MIDI; tempDouble3 *= NORM_MIDI;
if (score->getByteThree() == 0) { if (score->getByteThree() == 0) {
tempDouble3 = 0.5; tempDouble3 = 0.5;
instrument->noteOff(tempDouble3); instrument->noteOff(tempDouble3);
} }
else { else {
tempLong = (int) score->getByteTwo(); tempLong = (int) score->getByteTwo();
tempDouble2 = Midi2Pitch[tempLong]; tempDouble2 = Midi2Pitch[tempLong];
instrument->noteOn(tempDouble2,tempDouble3); instrument->noteOn(tempDouble2,tempDouble3);
} }
} }
else if (score->getType() == __SK_NoteOff_) { else if (score->getType() == __SK_NoteOff_) {
tempDouble3 *= NORM_MIDI; tempDouble3 *= NORM_MIDI;
instrument->noteOff(tempDouble3); instrument->noteOff(tempDouble3);
} }
else if (score->getType() == __SK_ControlChange_) { else if (score->getType() == __SK_ControlChange_) {
tempLong = score->getByteTwoInt(); tempLong = score->getByteTwoInt();
instrument->controlChange(tempLong,temp3.0); instrument->controlChange(tempLong,temp3.0);
} }
score->nextMessage(); score->nextMessage();
} }
When the score (SKINI object) object is created from the When the score (SKINI object) object is created from the
filename in argv[1], the first valid command line is read filename in argv[1], the first valid command line is read
from the file and parsed. from the file and parsed.
The score->getType() retrieves the messageType. If this is The score->getType() retrieves the messageType. If this is
-1, there are no more valid messages in the file and the -1, there are no more valid messages in the file and the
synthesis loop terminates. Otherwise, the message type is synthesis loop terminates. Otherwise, the message type is
returned. returned.
getDelta() retrieves the deltaTime until the current message getDelta() retrieves the deltaTime until the current message
should occur. If this is greater than 0, synthesis occurs should occur. If this is greater than 0, synthesis occurs
until the deltaTime has elapsed. If deltaTime is less than until the deltaTime has elapsed. If deltaTime is less than
zero, the time is interpreted as absolute time and the output zero, the time is interpreted as absolute time and the output
device is queried as to what time it is now. That is used to device is queried as to what time it is now. That is used to
form a deltaTime, and if it's positive we synthesize. If form a deltaTime, and if it's positive we synthesize. If
it's negative, we print an error and pretend this never it's negative, we print an error and pretend this never
happened and we hang around hoping to eventually catch up. happened and we hang around hoping to eventually catch up.
The rest of the code sorts out message types NoteOn, NoteOff The rest of the code sorts out message types NoteOn, NoteOff
(including NoteOn with velocity 0), and ControlChange. The (including NoteOn with velocity 0), and ControlChange. The
code implicitly takes into account the integer type of the code implicitly takes into account the integer type of the
control number, but all other data is treated as double float. control number, but all other data is treated as double float.
The last line reads and parses the next message in the file. The last line reads and parses the next message in the file.

View File

@@ -1,155 +1,155 @@
# Doxyfile 1.2.6 # Doxyfile 1.2.6
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# General configuration options # General configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
PROJECT_NAME = STK PROJECT_NAME = STK
PROJECT_NUMBER = PROJECT_NUMBER =
OUTPUT_DIRECTORY = . OUTPUT_DIRECTORY = .
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
EXTRACT_ALL = NO EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO EXTRACT_PRIVATE = NO
EXTRACT_STATIC = YES EXTRACT_STATIC = YES
HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES HIDE_UNDOC_CLASSES = YES
BRIEF_MEMBER_DESC = YES BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO ALWAYS_DETAILED_SEC = NO
FULL_PATH_NAMES = NO FULL_PATH_NAMES = NO
STRIP_FROM_PATH = STRIP_FROM_PATH =
INTERNAL_DOCS = NO INTERNAL_DOCS = NO
CLASS_DIAGRAMS = YES CLASS_DIAGRAMS = YES
SOURCE_BROWSER = NO SOURCE_BROWSER = NO
INLINE_SOURCES = NO INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = NO JAVADOC_AUTOBRIEF = NO
INHERIT_DOCS = YES INHERIT_DOCS = YES
INLINE_INFO = YES INLINE_INFO = YES
SORT_MEMBER_DOCS = NO SORT_MEMBER_DOCS = NO
DISTRIBUTE_GROUP_DOC = NO DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8 TAB_SIZE = 8
ENABLED_SECTIONS = ENABLED_SECTIONS =
GENERATE_TODOLIST = YES GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES GENERATE_BUGLIST = YES
ALIASES = ALIASES =
MAX_INITIALIZER_LINES = 30 MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_FOR_C = NO
SHOW_USED_FILES = YES SHOW_USED_FILES = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to warning and progress messages # configuration options related to warning and progress messages
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
QUIET = NO QUIET = NO
WARNINGS = YES WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT = "$file:$line: $text" WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE = WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = index.txt information.txt classes.txt download.txt usage.txt maillist.txt system.txt tutorial.txt skini.txt ../../include/ INPUT = . ../../include
FILE_PATTERNS = *.h FILE_PATTERNS = *.txt *.h
RECURSIVE = NO RECURSIVE = YES
EXCLUDE = EXCLUDE =
EXCLUDE_PATTERNS = EXCLUDE_PATTERNS =
EXAMPLE_PATH = EXAMPLE_PATH =
EXAMPLE_PATTERNS = EXAMPLE_PATTERNS =
IMAGE_PATH = IMAGE_PATH =
INPUT_FILTER = INPUT_FILTER =
FILTER_SOURCE_FILES = NO FILTER_SOURCE_FILES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the alphabetical class index # configuration options related to the alphabetical class index
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5 COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX = IGNORE_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the HTML output # configuration options related to the HTML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_HTML = YES GENERATE_HTML = YES
HTML_OUTPUT = ../html HTML_OUTPUT = ../html
HTML_HEADER = header.html HTML_HEADER = header.html
HTML_FOOTER = footer.html HTML_FOOTER = footer.html
HTML_STYLESHEET = HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO GENERATE_HTMLHELP = NO
GENERATE_CHI = NO GENERATE_CHI = NO
BINARY_TOC = NO BINARY_TOC = NO
TOC_EXPAND = NO TOC_EXPAND = NO
DISABLE_INDEX = YES DISABLE_INDEX = YES
ENUM_VALUES_PER_LINE = 4 ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250 TREEVIEW_WIDTH = 250
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the LaTeX output # configuration options related to the LaTeX output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_LATEX = YES GENERATE_LATEX = YES
LATEX_OUTPUT = latex LATEX_OUTPUT = latex
COMPACT_LATEX = NO COMPACT_LATEX = NO
PAPER_TYPE = letter PAPER_TYPE = letter
EXTRA_PACKAGES = EXTRA_PACKAGES =
LATEX_HEADER = header.tex LATEX_HEADER = header.tex
PDF_HYPERLINKS = YES PDF_HYPERLINKS = YES
USE_PDFLATEX = YES USE_PDFLATEX = YES
LATEX_BATCHMODE = NO LATEX_BATCHMODE = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the RTF output # configuration options related to the RTF output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_RTF = NO GENERATE_RTF = NO
RTF_OUTPUT = rtf RTF_OUTPUT = rtf
COMPACT_RTF = NO COMPACT_RTF = NO
RTF_HYPERLINKS = NO RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE = RTF_STYLESHEET_FILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the man page output # configuration options related to the man page output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_MAN = NO GENERATE_MAN = NO
MAN_OUTPUT = man MAN_OUTPUT = man
MAN_EXTENSION = .3 MAN_EXTENSION = .3
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the preprocessor # Configuration options related to the preprocessor
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES SEARCH_INCLUDES = YES
INCLUDE_PATH = INCLUDE_PATH =
INCLUDE_FILE_PATTERNS = INCLUDE_FILE_PATTERNS =
PREDEFINED = PREDEFINED =
EXPAND_AS_DEFINED = EXPAND_AS_DEFINED =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::addtions related to external references # Configuration::addtions related to external references
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
TAGFILES = TAGFILES =
GENERATE_TAGFILE = GENERATE_TAGFILE =
ALLEXTERNALS = NO ALLEXTERNALS = NO
PERL_PATH = /usr/bin/perl PERL_PATH = /usr/bin/perl
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
HAVE_DOT = NO HAVE_DOT = NO
CLASS_GRAPH = YES CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES COLLABORATION_GRAPH = YES
INCLUDE_GRAPH = YES INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES GRAPHICAL_HIERARCHY = YES
DOT_PATH = DOT_PATH =
MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES GENERATE_LEGEND = YES
DOT_CLEANUP = YES DOT_CLEANUP = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::addtions related to the search engine # Configuration::addtions related to the search engine
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
SEARCHENGINE = NO SEARCHENGINE = NO
CGI_NAME = search.cgi CGI_NAME = search.cgi
CGI_URL = CGI_URL =
DOC_URL = DOC_URL =
DOC_ABSPATH = DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/ BIN_ABSPATH = /usr/local/bin/
EXT_DOC_PATHS = EXT_DOC_PATHS =

View File

@@ -1,10 +1,10 @@
/*! \page classes Class Documentation /*! \page classes Class Documentation
<UL> <UL>
<LI><a class="qindex" href="hierarchy.html">Class Hierarchy</a></LI> <LI><a class="qindex" href="hierarchy.html">Class Hierarchy</a></LI>
<LI><a class="qindex" href="annotated.html">Class/Enum List</a></LI> <LI><a class="qindex" href="annotated.html">Class/Enum List</a></LI>
<LI><a class="qindex" href="files.html">File List</a></LI> <LI><a class="qindex" href="files.html">File List</a></LI>
<LI><a class="qindex" href="functions.html">Compound Members</a></LI> <LI><a class="qindex" href="functions.html">Compound Members</a></LI>
</UL> </UL>
*/ */

View File

@@ -1,115 +1,138 @@
/*! \page download Download and Release Notes /*! \page download Download and Release Notes
<B>Version 4.0, 30 April 2002</B><P> <B>Version 4.1, 8 October 2002</B><P>
<A HREF="Release/stk-4.0.tar.gz">STK Version 4.0: Source distribution</A> (1.64 MB tar/gzipped)<BR> <A HREF="http://www-ccrma.stanford.edu/software/stk/release/stk-4.1.tar.gz">STK Version 4.1: Source distribution</A> (1.2 MB tar/gzipped)<BR>
<A HREF="Release/stk-4.0.binaries.tar.gz">STK Version 4.0: Source distribution with precompiled windows binaries</A> (2.26 MB tar/gzipped)<BR> <A HREF="http://www-ccrma.stanford.edu/software/stk/release/stk-4.1.binaries.tar.gz">STK Version 4.1: Source distribution with precompiled windows binaries</A> (1.7 MB tar/gzipped)<BR>
<P> <A HREF="http://www-ccrma.stanford.edu/software/stk/release/stk-4.1-1.i386.rpm">STK Version 4.1: Linux RPM using ALSA API</A> (1.2 MB)<BR>
<A HREF="http://www-ccrma.stanford.edu/software/stk/release/stkmanual.pdf">STK Manual (PDF)</A> (1.2 MB) Note: HTML version in /doc/html/ directory of distribution<BR>
\section notes Release Notes: <P>
\subsection v4 Version 4.0 \section notes Release Notes:
<UL> \subsection v4dot1 Version 4.1
<LI>New documentation and tutorial.</LI>
<LI>Several new instruments, including Saxofony, BlowBotl, and StifKarp.</LI> <UL>
<LI>New Stk base class, replacing Object class.</LI> <LI>Macintosh OS X support added.</LI>
<LI>New Filter class structure and methods.</LI> <LI>New Whistle class.</LI>
<LI>Extensive modifications to WvIn and WvOut class structures and methods.</LI> <LI>Added Voicer, SingWave, and VoicForm classes.</LI>
<LI>Looping functionality moved to WaveLoop (subclass of WvIn).</LI> <LI>Improvements/fixes to the banded waveguide instruments.</LI>
<LI>Automatic file type detection in WvIn ... hosed WavWvIn, AifWvIn, RawWavIn, SndWavIn, and MatWvIn subclasses.</LI> <LI>Demo program now uses Voicer, allowing polyphony.</LI>
<LI>New file type specifier argument in WvOut ... hosed WavWvOut, AifWvOut, RawWavOut, SndWavOut, and MatWvOut subclasses.</LI> <LI>Demo tcl/tk scripts changed to use SKINI PitchChange instead of PitchBend.</LI>
<LI>Some simplifications of Messager class (was Controller).</LI> <LI>Demo program response to PitchBend modified to octave up/down.</LI>
<LI>New independent RtAudio class.</LI> <LI>Several RtAudio fixes and improvements (OS X and Windows ASIO support added).</LI>
<LI>Extensive revisions in code and a significant number of API changes.</LI> <LI>Added nextOut() method to Delay classes.</LI>
</UL> <LI>Documentation fixes for Reverb classes.</LI>
<LI>RAWWAVE_PATH changed to include the "rawwave" directory.</LI>
\subsection v3dot2 Version 3.2 <LI>"configure" support added for unix systems.</LI>
<LI>Multivoice flag (-n NUMBER) added as command line option to demo program.</LI>
<UL> <LI>Sample rate flag added as command line option to example programs.</LI>
<LI>New input control handling class (Controller)</LI> <LI>Socket port number added as command line option to example programs.</LI>
<LI>Added AIFF file input/output support.</LI>
<LI>New C++ error handling capabilities.</LI> </UL>
<LI>New input/output internet streaming support (StrmWvIn/StrmWvOut).</LI>
<LI>Added native ALSA support for linux.</LI> \subsection v4 Version 4.0
<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> <UL>
<LI>Changed WvIn/WvOut classes to work with sample frame buffers.</LI> <LI>New documentation and tutorial.</LI>
<LI>Fixed looping and negative rate calculations in WvIn classes.</LI> <LI>Several new instruments, including Saxofony, BlowBotl, and StifKarp.</LI>
<LI>Fixed interpolation bug in RtWvIn.</LI> <LI>New Stk base class, replacing Object class.</LI>
<LI>Windoze RtAudio code rewritten (thank Dave!).</LI> <LI>New Filter class structure and methods.</LI>
<LI>Simplified byte-swapping functions (in-place swapping).</LI> <LI>Extensive modifications to WvIn and WvOut class structures and methods.</LI>
<LI>"Stereo-ized" RagaMatic.</LI> <LI>Looping functionality moved to WaveLoop (subclass of WvIn).</LI>
<LI>Miscellaneous renamings.</LI> <LI>Automatic file type detection in WvIn ... hosed WavWvIn, AifWvIn, RawWavIn, SndWavIn, and MatWvIn subclasses.</LI>
<LI>Probably a bunch more fixes that I've long since forgotten about.</LI> <LI>New file type specifier argument in WvOut ... hosed WavWvOut, AifWvOut, RawWavOut, SndWavOut, and MatWvOut subclasses.</LI>
</UL> <LI>Some simplifications of Messager class (was Controller).</LI>
<LI>New independent RtAudio class.</LI>
\subsection v3dot1 Version 3.1 <LI>Extensive revisions in code and a significant number of API changes.</LI>
</UL>
<UL>
<LI>New RagaMatic project ... very cool!!!</LI> \subsection v3dot2 Version 3.2
<LI>Less clipping in the Shakers class.</LI>
<LI>Added "microphone position" to Mandolin in STKdemo.</LI> <UL>
<LI>Fixed MIDI system message exclusion under Irix.</LI> <LI>New input control handling class (Controller)</LI>
<LI>Added a few bitmaps for the Shaker instruments.</LI> <LI>Added AIFF file input/output support.</LI>
<LI>Made destructors virtual for Reverb.h, WvIn.h and Simple.h.</LI> <LI>New C++ error handling capabilities.</LI>
<LI>Fixed bug setting delay length in DLineA when value too big.</LI> <LI>New input/output internet streaming support (StrmWvIn/StrmWvOut).</LI>
<LI>Fixed bug in WinMM realtime code (RTSoundIO).</LI> <LI>Added native ALSA support for linux.</LI>
<LI>Added tick() method to BowTabl, JetTabl, and ReedTabl (same as lookup).</LI> <LI>Added optional "device" argument to all "Rt" classes (audio and MIDI) and printout of devices when argument is invalid.</LI>
<LI>Switched to pthread API on SGI platforms.</LI> <LI>WvIn classes rewritten to support very big files (incremental load from disk).</LI>
<LI>Added some defines to Object.h for random number generation, FPU overflow checking, etc....</LI> <LI>Changed WvIn/WvOut classes to work with sample frame buffers.</LI>
<LI>A few minor changes, some bug fixes ... can't remember all of them.</LI> <LI>Fixed looping and negative rate calculations in WvIn classes.</LI>
</UL> <LI>Fixed interpolation bug in RtWvIn.</LI>
<LI>Windoze RtAudio code rewritten (thank Dave!).</LI>
\subsection v3 Version 3.0 <LI>Simplified byte-swapping functions (in-place swapping).</LI>
<LI>"Stereo-ized" RagaMatic.</LI>
<UL> <LI>Miscellaneous renamings.</LI>
<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>Probably a bunch more fixes that I've long since forgotten about.</LI>
<LI>Expanded and cleaned the Shakers class.</LI> </UL>
<LI>New BowedBar algorithm/class.</LI>
<LI>Fixed Linux MIDI input bug.</LI> \subsection v3dot1 Version 3.1
<LI>Fixed MIDI status masking problem in Windows.</LI>
<LI>OS type defines now in Makefile.</LI> <UL>
<LI>New RAWWAVE_PATH define in Object.h.</LI> <LI>New RagaMatic project ... very cool!!!</LI>
<LI>Syntmono project pulled out to separate directory and cleaned up.</LI> <LI>Less clipping in the Shakers class.</LI>
<LI>Socketing capabilities under Unix, as well as Windoze.</LI> <LI>Added "microphone position" to Mandolin in STKdemo.</LI>
<LI>Multiple simultaneous socket client connections to STK servers now possible.</LI> <LI>Fixed MIDI system message exclusion under Irix.</LI>
<LI>MD2SKINI now can merge MIDI and piped messages under Irix and Linux (for TCL->MD2SKINI->syntmono control).</LI> <LI>Added a few bitmaps for the Shaker instruments.</LI>
<LI>Defined INT16 and INT32 types and fixed various WvIn and WvOut classes.</LI> <LI>Made destructors virtual for Reverb.h, WvIn.h and Simple.h.</LI>
<LI>Updated MatWvIn and MatWvOut for new MAT-file documentation from Matlab.</LI> <LI>Fixed bug setting delay length in DLineA when value too big.</LI>
<LI>New demo Tcl/Tk GUI (TclDemo.tcl).</LI> <LI>Fixed bug in WinMM realtime code (RTSoundIO).</LI>
<LI>Minor fixes to FM behavior.</LI> <LI>Added tick() method to BowTabl, JetTabl, and ReedTabl (same as lookup).</LI>
<LI>Added record/duplex capabilities to RTSoundIO (Linux, SGI, and Windoze).</LI> <LI>Switched to pthread API on SGI platforms.</LI>
<LI>Fixed bugs in WavWvOut and MatWvOut header specifications.</LI> <LI>Added some defines to Object.h for random number generation, FPU overflow checking, etc....</LI>
<LI>Added RawWvOut class.</LI> <LI>A few minor changes, some bug fixes ... can't remember all of them.</LI>
<LI>New WvIn class with RawWvIn, SndWvIn, WavWvIn, MatWvIn, and RTWvIn subclasses.</LI> </UL>
<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 MY_FLOAT) and the methods mtick() and mlastOutput().</LI> \subsection v3 Version 3.0
<LI>Now writing to primary buffer under Windoze when allowed by hardware.</LI>
<LI>Cleaned up Object.h a bit.</LI> <UL>
<LI>Pulled various utility and thread functions out of syntmono.cpp (to aid readability of the code).</LI> <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>
</UL> <LI>Expanded and cleaned the Shakers class.</LI>
<LI>New BowedBar algorithm/class.</LI>
\subsection v2dot02 Version 2.02 <LI>Fixed Linux MIDI input bug.</LI>
<LI>Fixed MIDI status masking problem in Windows.</LI>
<UL> <LI>OS type defines now in Makefile.</LI>
<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>New RAWWAVE_PATH define in Object.h.</LI>
<LI>Modified DrumSynt to correctly handle sample rates different than 22050 Hz.</LI> <LI>Syntmono project pulled out to separate directory and cleaned up.</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>Socketing capabilities under Unix, as well as Windoze.</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>Multiple simultaneous socket client connections to STK servers now possible.</LI>
<LI>Fixed bug in MD2SKINI which prevented some NoteOff statements from being output.</LI> <LI>MD2SKINI now can merge MIDI and piped messages under Irix and Linux (for TCL->MD2SKINI->syntmono control).</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> <LI>Defined INT16 and INT32 types and fixed various WvIn and WvOut classes.</LI>
</UL> <LI>Updated MatWvIn and MatWvOut for new MAT-file documentation from Matlab.</LI>
<LI>New demo Tcl/Tk GUI (TclDemo.tcl).</LI>
\subsection v2 Version 2 <LI>Minor fixes to FM behavior.</LI>
<LI>Added record/duplex capabilities to RTSoundIO (Linux, SGI, and Windoze).</LI>
<UL> <LI>Fixed bugs in WavWvOut and MatWvOut header specifications.</LI>
<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>Added RawWvOut class.</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>New WvIn class with RawWvIn, SndWvIn, WavWvIn, MatWvIn, and RTWvIn subclasses.</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>Removed RawWave, RawShot, RawInterp, and RawLoop classes (supplanted by RawWvIn).</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>Multi-channel data support in WvIn and WvOut classes using MY_MULTI data type (pointer to MY_FLOAT) and the methods mtick() and mlastOutput().</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. <FONT FACE="Geneva">MD2SKINI | syntmono Clarinet -r -i</FONT>). In addition, you can supply a filename argument to MD2SKINI and have it simultaneously record a SKINI score file for future reuse. <LI>Now writing to primary buffer under Windoze when allowed by hardware.</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>Cleaned up Object.h a bit.</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>Pulled various utility and thread functions out of syntmono.cpp (to aid readability of the code).</LI>
</UL> </UL>
*/ \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>
\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. <FONT FACE="Geneva">MD2SKINI | syntmono Clarinet -r -i</FONT>). In addition, you can supply a filename argument to MD2SKINI and have it simultaneously record a SKINI score file for future reuse.
<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>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.
</UL>
*/

View File

@@ -1,9 +1,9 @@
<HR> <HR>
<table> <table>
<tr><td><A HREF="http://www-ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr> <tr><td><A HREF="http://www-ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
<tr><td>&copy;1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr> <tr><td>&copy;1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table> </table>
</BODY> </BODY>
</HTML> </HTML>

View File

@@ -1,10 +1,10 @@
<HTML> <HTML>
<HEAD> <HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE> <TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> <LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD> </HEAD>
<BODY BGCOLOR="#FFFFFF"> <BODY BGCOLOR="#FFFFFF">
<CENTER> <CENTER>
<img src="princeton.gif"> &nbsp; <img src="ccrma.gif"><P> <img src="princeton.gif"> &nbsp; <img src="ccrma.gif"><P>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER> <a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="links.html">Links</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR> <HR>

View File

@@ -1,15 +1,16 @@
/*! \mainpage <I>The Synthesis ToolKit in C++ (STK)</I> /*! \mainpage <I>The Synthesis ToolKit in C++ (STK)</I>
<BODY BGCOLOR="white"> <BODY BGCOLOR="white">
The <B>Synthesis ToolKit in C++ (STK)</B> is a set of audio signal processing and synthesis classes and algorithms written in C++. You can use these classes to create programs that make sounds with a variety of synthesis techniques. This is not a terribly novel concept, except that the Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (no libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler. The <B>Synthesis ToolKit in C++ (STK)</B> is a set of audio signal processing and synthesis classes and algorithms written in C++. You can use these classes to create programs that make sounds with a variety of synthesis techniques. This is not a terribly novel concept, except that the Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (no libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler.
- \ref information - \ref information
- \ref classes - \ref classes
- \ref download - \ref download
- \ref usage - \ref usage
- \ref maillist - \ref maillist
- \ref system - \ref system
- \ref tutorial - \ref links
- \ref tutorial
*/
*/

View File

@@ -1,50 +1,50 @@
/*! \page information General Information /*! \page information General Information
<H3>References</H3> <H3>References</H3>
<UL> <UL>
<LI><A HREF="Papers/stkicmc99.pdf">ICMC99 Paper</A></LI> <LI><A HREF="Papers/stkicmc99.pdf">ICMC99 Paper</A></LI>
<BR> <BR>
A somewhat recent paper by Perry and Gary about the Synthesis ToolKit in C++. A somewhat recent paper by Perry and Gary about the Synthesis ToolKit in C++.
<P> <P>
<LI><A HREF="Papers/STKsiggraph96.pdf">SIGGRAPH96 Paper</A></LI> <LI><A HREF="Papers/STKsiggraph96.pdf">SIGGRAPH96 Paper</A></LI>
<BR> <BR>
A not-so-recent paper by Perry about the Synthesis ToolKit in C++. A not-so-recent paper by Perry about the Synthesis ToolKit in C++.
<P> <P>
<LI><A HREF="http://www.cs.princeton.edu/~prc/NewWork.html#STK">Perry's STK Web Page</A></LI> <LI><A HREF="http://www.cs.princeton.edu/~prc/NewWork.html#STK">Perry's STK Web Page</A></LI>
<BR> <BR>
This is a link to Perry Cook's STK Web page. He has information about the \ref skini, the protocol used to control STK instruments, as well as a lot of other cool stuff. This is a link to Perry Cook's STK Web page. He has information about the \ref skini, the protocol used to control STK instruments, as well as a lot of other cool stuff.
</UL> </UL>
<H4>What is the <I>Synthesis ToolKit</I>?</H4> <H4>What is the <I>Synthesis ToolKit</I>?</H4>
The Synthesis ToolKit in C++ (STK) is a set of audio signal processing and synthesis classes and algorithms written in C++. You can use these classes to create programs that make sounds with a variety of synthesis techniques. This is not a terribly novel concept, except that the Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (no libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler. The Synthesis ToolKit in C++ (STK) is a set of audio signal processing and synthesis classes and algorithms written in C++. You can use these classes to create programs that make sounds with a variety of synthesis techniques. This is not a terribly novel concept, except that the Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (no unusual libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, Macintosh OS X, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler.
The Synthesis ToolKit is free for non-commercial use. The only parts of the Synthesis ToolKit that are platform-dependent concern real-time audio and MIDI input and output, and that is taken care of with a few special classes. The interface for MIDI input and the simple <A HREF="http://dev.scriptics.com">Tcl/Tk</A> graphical user interfaces (GUIs) provided is the same, so it's easy to experiment in real time using either the GUIs or MIDI. The Synthesis ToolKit can generate simultaneous SND (AU), WAV, AIFF, and MAT-file output soundfile formats (as well as realtime sound output), so you can view your results using one of a large variety of sound/signal analysis tools already available (e.g. <A HREF="http://www-ccrma.stanford.edu/software/snd/">Snd</A>, Cool Edit, Matlab). The Synthesis ToolKit is free for non-commercial use. The only parts of the Synthesis ToolKit that are platform-dependent concern real-time audio and MIDI input and output, and that is taken care of with a few special classes. The interface for MIDI input and the simple <A HREF="http://dev.scriptics.com">Tcl/Tk</A> graphical user interfaces (GUIs) provided is the same, so it's easy to experiment in real time using either the GUIs or MIDI. The Synthesis ToolKit can generate simultaneous SND (AU), WAV, AIFF, and MAT-file output soundfile formats (as well as realtime sound output), so you can view your results using one of a large variety of sound/signal analysis tools already available (e.g. <A HREF="http://www-ccrma.stanford.edu/software/snd/">Snd</A>, Cool Edit, Matlab).
<H4>What the <I>Synthesis ToolKit</I> is not.</H4> <H4>What the <I>Synthesis ToolKit</I> is not.</H4>
The Synthesis Toolkit is not one particular program. Rather, it is a set of C++ classes that you can use to create your own programs. A few example applications are provided to demonstrate some of the ways to use the classes. If you have specific needs, you will probably have to either modify the example programs or write a new program altogether. Further, the example programs don't have a fancy GUI wrapper. If you feel the need to have a "drag and drop" graphical patching GUI, you probably don't want to use the ToolKit. Spending hundreds of hours making platform-dependent graphics code would go against one of the fundamental design goals of the ToolKit - platform independence. The Synthesis Toolkit is not one particular program. Rather, it is a set of C++ classes that you can use to create your own programs. A few example applications are provided to demonstrate some of the ways to use the classes. If you have specific needs, you will probably have to either modify the example programs or write a new program altogether. Further, the example programs don't have a fancy GUI wrapper. If you feel the need to have a "drag and drop" graphical patching GUI, you probably don't want to use the ToolKit. Spending hundreds of hours making platform-dependent graphics code would go against one of the fundamental design goals of the ToolKit - platform independence.
For those instances where a simple GUI with sliders and buttons is helpful, we use <A HREF="http://dev.scriptics.com">Tcl/Tk</A> (which is freely distributed for all the supported ToolKit platforms). A number of Tcl/Tk GUI scripts are distributed with the ToolKit release. For control, the Synthesis Toolkit uses raw MIDI (on supported platforms), and SKINI (Synthesis ToolKit Instrument Network Interface, a MIDI-like text message synthesis control format). For those instances where a simple GUI with sliders and buttons is helpful, we use <A HREF="http://dev.scriptics.com">Tcl/Tk</A> (which is freely distributed for all the supported ToolKit platforms). A number of Tcl/Tk GUI scripts are distributed with the ToolKit release. For control, the Synthesis Toolkit uses raw MIDI (on supported platforms), and SKINI (Synthesis ToolKit Instrument Network Interface, a MIDI-like text message synthesis control format).
<H4>A brief history of the <I>Synthesis ToolKit in C++.</I></H4> <H4>A brief history of the <I>Synthesis ToolKit in C++.</I></H4>
Perry Cook began developing a pre-cursor to the Synthesis ToolKit (also called STK) under NeXTStep at the Center for Computer Research in Music and Acoustics (CCRMA) at Stanford University in the early-1990s. With his move to Princeton University in 1996, he ported everything to C++ on SGI hardware, added real-time capabilities, and greatly expanded the synthesis techniques available. With the help of Bill Putnam, Perry also made a port of STK to Windows95. Gary Scavone began using STK extensively in the summer of 1997 and completed a full port of STK to Linux early in 1998. He finished the fully compatable Windows port (using Direct Sound API) in June 1998. Numerous improvements and extensions have been made since then. Perry Cook began developing a pre-cursor to the Synthesis ToolKit (also called STK) under NeXTStep at the Center for Computer Research in Music and Acoustics (CCRMA) at Stanford University in the early-1990s. With his move to Princeton University in 1996, he ported everything to C++ on SGI hardware, added real-time capabilities, and greatly expanded the synthesis techniques available. With the help of Bill Putnam, Perry also made a port of STK to Windows95. Gary Scavone began using STK extensively in the summer of 1997 and completed a full port of STK to Linux early in 1998. He finished the fully compatable Windows port (using Direct Sound API) in June 1998. Numerous improvements and extensions have been made since then.
The Toolkit has been distributed continuously since 1996 via the <A HREF="http://www.music.princeton.edu/psk">Princeton Sound Kitchen</A>, <A HREF="http://www.cs.princeton.edu/~prc">Perry Cook's home page</A> at Princeton, <A HREF="http://www-ccrma.stanford.edu/~gary/">Gary Scavone's home page</A> at Stanford's Center for Computer Research in Music and Acoustics (CCRMA), and the <A HREF="http://www-ccrma.stanford.edu/software/stk">Synthesis ToolKit home page</A>. The ToolKit has been in included in various collections of software. Much of it has also been ported to MAX/MSP on Macintosh computers by Dan Trueman and Luke Dubois of Columbia University, and is distributed as <A HREF="http://music.columbia.edu/PeRColate">PeRColate</A>. Help on real-time sound and MIDI has been provided by Tim Stilson, Bill Putnam, and Gabriel Maldonado. The Toolkit has been distributed continuously since 1996 via the <A HREF="http://www.music.princeton.edu/psk">Princeton Sound Kitchen</A>, <A HREF="http://www.cs.princeton.edu/~prc">Perry Cook's home page</A> at Princeton, <A HREF="http://www-ccrma.stanford.edu/~gary/">Gary Scavone's home page</A> at Stanford's Center for Computer Research in Music and Acoustics (CCRMA), and the <A HREF="http://www-ccrma.stanford.edu/software/stk">Synthesis ToolKit home page</A>. The ToolKit has been in included in various collections of software. Much of it has also been ported to MAX/MSP on Macintosh computers by Dan Trueman and Luke Dubois of Columbia University, and is distributed as <A HREF="http://music.columbia.edu/PeRColate">PeRColate</A>. Help on real-time sound and MIDI has been provided by Tim Stilson, Bill Putnam, and Gabriel Maldonado.
<H4>Legal and Ethical Notes</H4> <H4>Legal and Ethical Notes</H4>
This software was designed and created to be made publicly available for free, primarily for academic purposes, so if you use it, pass it on with this documentation, and for free. If you make a million dollars with it, give us some. If you make compositions with it, put us in the program notes. This software was designed and created to be made publicly available for free, primarily for academic purposes, so if you use it, pass it on with this documentation, and for free. If you make a million dollars with it, give us some. If you make compositions with it, put us in the program notes.
<P> <P>
Some of the concepts are covered by various patents, some known to us and likely others which are unknown. Many of the ones known to us are administered by the Stanford Office of Technology and Licensing. The good news is that large hunks of the techniques used here are public domain. To avoid subtle legal issues, we will not state what's freely useable here, but we will try to note within the various classes where certain things are likely to be protected by patents. Some of the concepts are covered by various patents, some known to us and likely others which are unknown. Many of the ones known to us are administered by the Stanford Office of Technology and Licensing. The good news is that large hunks of the techniques used here are public domain. To avoid subtle legal issues, we will not state what's freely useable here, but we will try to note within the various classes where certain things are likely to be protected by patents.
<H4>Disclaimer</H4> <H4>Disclaimer</H4>
STK is free and we do not guarantee anything. We've been hacking on this code for a while now and most of it seems to work pretty well. But, there surely are some bugs floating around. Sometimes things work fine on one computer platform but not so fine on another. FPU overflows and underflows cause <I>very</I> weird behavior which also depends on the particular CPU and OS. Let us know about bugs you find and we'll do our best to correct them. STK is free and we do not guarantee anything. We've been hacking on this code for a while now and most of it seems to work pretty well. But, there surely are some bugs floating around. Sometimes things work fine on one computer platform but not so fine on another. FPU overflows and underflows cause <I>very</I> weird behavior which also depends on the particular CPU and OS. Let us know about bugs you find and we'll do our best to correct them.
*/ */

11
doc/doxygen/links.txt Normal file
View File

@@ -0,0 +1,11 @@
/*! \page links Miscellaneous Links
- <A HREF="http://www-ccrma.stanford.edu/~gary/rtaudio/">The RtAudio WWW site</A>
- <A HREF="http://kern.humdrum.net/">Kern Scores: A Library of Electronic Musical Scores</A> (with automatic conversion to SKINI format)
- <A HREF="http://www.music.columbia.edu/PeRColate/">PeRColate: A Port of STK for Max/MSP</A>
- <A HREF="http://mathmorphs.swiki.net/32/">A Partial Port of STK to Squeak</A>
*/

View File

@@ -1,12 +1,12 @@
/*! \page maillist The Mail List /*! \page maillist The Mail List
An <A HREF="mailto:stk-request@ccrma.stanford.edu">STK</A> mailing list has been set up to facilitate communication among STK users. Subscribing to this list is your best way of keeping on top of new releases, bug fixes, and various user developments. An <A HREF="mailto:stk-request@ccrma.stanford.edu">STK</A> mailing list has been set up to facilitate communication among STK users. Subscribing to this list is your best way of keeping on top of new releases, bug fixes, and various user developments.
<P> <P>
To join send a message to <A HREF="mailto:stk-request@ccrma.stanford.edu">&lt;stk-request@ccrma.stanford.edu&gt;</A> To join send a message to <A HREF="mailto:stk-request@ccrma.stanford.edu">&lt;stk-request@ccrma.stanford.edu&gt;</A>
with the contents: <TT>subscribe</TT> with the contents: <TT>subscribe</TT>
<P> <P>
To be removed from the list send a message to <A HREF="mailto:stk-request@ccrma.stanford.edu">&lt;stk-request@ccrma.stanford.edu&gt;</A> To be removed from the list send a message to <A HREF="mailto:stk-request@ccrma.stanford.edu">&lt;stk-request@ccrma.stanford.edu&gt;</A>
with the contents: <TT>unsubscribe</TT> with the contents: <TT>unsubscribe</TT>
*/ */

View File

@@ -1,218 +1,218 @@
/*! \page skini Synthesis toolKit Instrument Network Interface (SKINI) /*! \page skini Synthesis toolKit Instrument Network Interface (SKINI)
This describes the latest (version 1.1) implementation of SKINI for the Synthesis Toolkit in C++ (STK) by Perry R. Cook. This describes the latest (version 1.1) implementation of SKINI for the Synthesis Toolkit in C++ (STK) by Perry R. Cook.
\code \code
Too good to be true? Too good to be true?
Have control and read it too? Have control and read it too?
A SKINI haiku. A SKINI haiku.
\endcode \endcode
Profound thanks to Dan Trueman, Brad Garton, and Gary Scavone for input on this revision. Thanks also to MIDI, the NeXT MusicKit, ZIPI and all the creators and modifiers of these for good bases upon/from which to build and depart. Profound thanks to Dan Trueman, Brad Garton, and Gary Scavone for input on this revision. Thanks also to MIDI, the NeXT MusicKit, ZIPI and all the creators and modifiers of these for good bases upon/from which to build and depart.
\section compatibility MIDI Compatibility \section compatibility MIDI Compatibility
SKINI was designed to be MIDI compatible wherever possible, and extend MIDI in incremental, then maybe profound ways. SKINI was designed to be MIDI compatible wherever possible, and extend MIDI in incremental, then maybe profound ways.
Differences from MIDI, and motivations, include: Differences from MIDI, and motivations, include:
- Text-based messages are used, with meaningful names wherever possible. This allows any language or system capable of formatted printing to generate SKINI. Similarly, any system capable of reading in a string and turning delimited fields into strings, floats, and ints can consume SKINI for control. More importantly, humans can actually read, and even write if they want, SKINI files and streams. Use an editor and search/replace or macros to change a channel or control number. Load a SKINI score into a spread sheet to apply transformations to time, control parameters, MIDI velocities, etc. Put a monkey on a special typewriter and get your next great work. Life's too short to debug bit/nybble packed variable length mumble messages. Disk space gets cheaper, available bandwidth increases, music takes up so little space and bandwidth compared to video and grapics. Live a little. - Text-based messages are used, with meaningful names wherever possible. This allows any language or system capable of formatted printing to generate SKINI. Similarly, any system capable of reading in a string and turning delimited fields into strings, floats, and ints can consume SKINI for control. More importantly, humans can actually read, and even write if they want, SKINI files and streams. Use an editor and search/replace or macros to change a channel or control number. Load a SKINI score into a spread sheet to apply transformations to time, control parameters, MIDI velocities, etc. Put a monkey on a special typewriter and get your next great work. Life's too short to debug bit/nybble packed variable length mumble messages. Disk space gets cheaper, available bandwidth increases, music takes up so little space and bandwidth compared to video and grapics. Live a little.
- Floating point numbers are used wherever possible. Note Numbers, Velocities, Controller Values, and Delta and Absolute Times are all represented and scanned as ASCII double-precision floats. MIDI byte values are preserved, so that incoming MIDI bytes from an interface can be put directly into SKINI messages. 60.0 or 60 is middle C, 127.0 or 127 is maximum velocity etc. But, unlike MIDI, 60.5 can cause a 50cent sharp middle C to be played. As with MIDI byte values like velocity, use of the integer and SKINI-added fractional parts is up to the implementor of the algorithm being controlled by SKINI messages. But the extra precision is there to be used or ignored. - Floating point numbers are used wherever possible. Note Numbers, Velocities, Controller Values, and Delta and Absolute Times are all represented and scanned as ASCII double-precision floats. MIDI byte values are preserved, so that incoming MIDI bytes from an interface can be put directly into SKINI messages. 60.0 or 60 is middle C, 127.0 or 127 is maximum velocity etc. But, unlike MIDI, 60.5 can cause a 50cent sharp middle C to be played. As with MIDI byte values like velocity, use of the integer and SKINI-added fractional parts is up to the implementor of the algorithm being controlled by SKINI messages. But the extra precision is there to be used or ignored.
\section why Why SKINI? \section why Why SKINI?
SKINI was designed to be extensable and hackable for a number of applications: imbedded synthesis in a game or VR simulation, scoring and mixing tasks, real-time and non-real time applications which could benefit from controllable sound synthesis, JAVA controlled synthesis, or eventually maybe JAVA synthesis, etc. SKINI is not intended to be "the mother of scorefiles," but since the entire system is based on text representations of names, floats, and ints, converters from one scorefile language to SKINI, or back, should be easily created. SKINI was designed to be extensable and hackable for a number of applications: imbedded synthesis in a game or VR simulation, scoring and mixing tasks, real-time and non-real time applications which could benefit from controllable sound synthesis, JAVA controlled synthesis, or eventually maybe JAVA synthesis, etc. SKINI is not intended to be "the mother of scorefiles," but since the entire system is based on text representations of names, floats, and ints, converters from one scorefile language to SKINI, or back, should be easily created.
I am basically a bottom-up designer with an awareness of top-down design ideas, so SKINI above all reflects the needs of my particular research and creative projects as they have arisen and developed. SKINI 1.1 represents a profound advance beyond versions 0.8 and 0.9 (the first versions), future SKINI's might reflect some changes. Compatibility with prior scorefiles will be attempted, but there aren't that many scorefiles out there yet. I am basically a bottom-up designer with an awareness of top-down design ideas, so SKINI above all reflects the needs of my particular research and creative projects as they have arisen and developed. SKINI 1.1 represents a profound advance beyond versions 0.8 and 0.9 (the first versions), future SKINI's might reflect some changes. Compatibility with prior scorefiles will be attempted, but there aren't that many scorefiles out there yet.
\section messages SKINI Messages \section messages SKINI Messages
A basic SKINI message is a line of text. There are only three required fields, the message type (an ASCII name), the time (either delta or absolute), and the channel number. Don't freak out and think that this is MIDI channel 0-15 (which is supported), because 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. A basic SKINI message is a line of text. There are only three required fields, the message type (an ASCII name), the time (either delta or absolute), and the channel number. Don't freak out and think that this is MIDI channel 0-15 (which is supported), because 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.
Fields in a SKINI line are delimited by spaces, commas, or tabs. The SKINI parser only operates on a line at a time, so a newline means the message is over. Multiple messages are NOT allowed directly on a single line (by use of the ; for example in C). This could be supported, but it isn't in version 1.1. Fields in a SKINI line are delimited by spaces, commas, or tabs. The SKINI parser only operates on a line at a time, so a newline means the message is over. Multiple messages are NOT allowed directly on a single line (by use of the ; for example in C). This could be supported, but it isn't in version 1.1.
Message types include standard MIDI types like NoteOn, NoteOff, ControlChange, etc. MIDI extension message types (messages which look better than MIDI but actually get turned into MIDI-like messages) include LipTension, StringDamping, etc. Non-MIDI message types include SetPath (sets a path for file use later), and OpenReadFile (for streaming, mixing, and applying effects to soundfiles along with synthesis, for example). Other non-MIDI message types include Trilling, HammerOn, etc. (these translate to gestures, behaviors, and contexts for use by intellegent players and instruments using SKINI). Where possible I will still use these as MIDI extension messages, so foot switches, etc. can be used to control them in real time. Message types include standard MIDI types like NoteOn, NoteOff, ControlChange, etc. MIDI extension message types (messages which look better than MIDI but actually get turned into MIDI-like messages) include LipTension, StringDamping, etc. Non-MIDI message types include SetPath (sets a path for file use later), and OpenReadFile (for streaming, mixing, and applying effects to soundfiles along with synthesis, for example). Other non-MIDI message types include Trilling, HammerOn, etc. (these translate to gestures, behaviors, and contexts for use by intellegent players and instruments using SKINI). Where possible I will still use these as MIDI extension messages, so foot switches, etc. can be used to control them in real time.
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. 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.
The other important file used by SKINI is SKINI.msg, 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 be replaced by declaration and assignment statements, preserving the look and behavior of the rest of the code. The other important file used by SKINI is SKINI.msg, 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 be replaced by declaration and assignment statements, preserving the look and behavior of the rest of the code.
\section cfiles C Files Used To Implement SKINI \section cfiles C Files Used To Implement SKINI
SKINI.cpp is an object which can either open a SKINI file, and successively read and parse lines of text as SKINI strings, or accept strings from another object and parse them. The latter functionality would be used by a socket, pipe, or other connection receiving SKINI messages a line at a time, usually in real time, but not restricted to real time. SKINI.cpp is an object which can either open a SKINI file, and successively read and parse lines of text as SKINI strings, or accept strings from another object and parse them. The latter functionality would be used by a socket, pipe, or other connection 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 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.msg 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 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 could be dynamically loaded and changed in a future version of SKINI. SKINI.tbl is used only by the SKINI parser object (SKINI.cpp). In the file SKINI.tbl, 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 could be dynamically loaded and changed in a future version of SKINI.
\section parser SKINI Messages and the SKINI Parser: \section parser SKINI Messages and the SKINI Parser:
The parser isn't all that smart, but neither am I. Here are the basic rules governing a valid SKINI message: The parser isn't all that smart, but neither am I. Here are the basic rules governing a valid SKINI message:
- If the first (non-delimiter ... see below) character in a SKINI string is '/' that line is treated as a comment and echoed to stdout. - If the first (non-delimiter ... see below) character in a SKINI string is '/' that line is treated as a comment and echoed to stdout.
- If there are no characters on a line, that line is treated as blank and echoed to stdout. Tabs and spaces are treated as non-characters. - If there are no characters on a line, that line is treated as blank and echoed to stdout. Tabs and spaces are treated as non-characters.
- Spaces, commas, and tabs delimit the fields in a SKINI message line. (We might allow for multiple messages per line later using the semicolon, but probably not. A series of lines with deltaTimes of 0.0 denotes simultaneous events. For read-ability, multiple messages per line doesn't help much, so it's unlikely to be supported later). - Spaces, commas, and tabs delimit the fields in a SKINI message line. (We might allow for multiple messages per line later using the semicolon, but probably not. A series of lines with deltaTimes of 0.0 denotes simultaneous events. For read-ability, multiple messages per line doesn't help much, so it's unlikely to be supported later).
- The first field must be a SKINI message name (like NoteOn). These might become case-insensitive in future versions, so don't plan on exciting clever overloading of names (like noTeOn being different from NoTeON). There can be a number of leading spaces or tabs, but don't exceed 32 or so. - The first field must be a SKINI message name (like NoteOn). These might become case-insensitive in future versions, so don't plan on exciting clever overloading of names (like noTeOn being different from NoTeON). There can be a number of leading spaces or tabs, but don't exceed 32 or so.
- The second field must be a time specification in seconds. A time field can be either delta-time (most common and the only one supported in version 0.8), or absolute time. Absolute time messages have an '=' appended to the beginning of the floating point number with no space. So 0.10000 means delta time of 100 ms, while =0.10000 means absolute time of 100 ms. Absolute time messages make most sense in score files, but could also be used for (loose) synchronization in a real-time context. Real-time messages should be time-ordered AND time-correct. That is, if you've sent 100 total delta-time messages of 1.0 seconds, and then send an absolute time message of =90.0 seconds, or if you send two absolute time messages of =100.0 and =90.0 in that order, things will get really fouled up. The SKINI parser doesn't know about time, however. The WvOut device is the master time keeper in the Synthesis Toolkit, so it should be queried to see if absolute time messages are making sense. There's an example of how to do that later in this document. Absolute times are returned by the parser as negative numbers (since negative deltaTimes are not allowed). - The second field must be a time specification in seconds. A time field can be either delta-time (most common and the only one supported in version 0.8), or absolute time. Absolute time messages have an '=' appended to the beginning of the floating point number with no space. So 0.10000 means delta time of 100 ms, while =0.10000 means absolute time of 100 ms. Absolute time messages make most sense in score files, but could also be used for (loose) synchronization in a real-time context. Real-time messages should be time-ordered AND time-correct. That is, if you've sent 100 total delta-time messages of 1.0 seconds, and then send an absolute time message of =90.0 seconds, or if you send two absolute time messages of =100.0 and =90.0 in that order, things will get really fouled up. The SKINI parser doesn't know about time, however. The WvOut device is the master time keeper in the Synthesis Toolkit, so it should be queried to see if absolute time messages are making sense. There's an example of how to do that later in this document. Absolute times are returned by the parser as negative numbers (since negative deltaTimes are not allowed).
- The third field must be an integer channel number. Don't go crazy and think that this is just MIDI channel 0-15 (which is supported). The channel number is scanned as a long int. Channels 0-15 are in general to be treated as MIDI channels. After that it's wide open. Channels could be socket numbers, machine IDs, serial numbers, or even unique tags for each event in a synthesis. A -1 channel can be used as don't care, omni, or other functions depending on your needs and taste. - The third field must be an integer channel number. Don't go crazy and think that this is just MIDI channel 0-15 (which is supported). The channel number is scanned as a long int. Channels 0-15 are in general to be treated as MIDI channels. After that it's wide open. Channels could be socket numbers, machine IDs, serial numbers, or even unique tags for each event in a synthesis. A -1 channel can be used as don't care, omni, or other functions depending on your needs and taste.
- All remaining fields are specified in the SKINI.tbl 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 on the line, but the object using SKINI must take that string apart (retrived by using getRemainderString()) and scan it. Any excess fields are stashed in remainderString. - All remaining fields are specified in the SKINI.tbl 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 on the line, but the object using SKINI must take that string apart (retrived by using getRemainderString()) and scan it. Any excess fields are stashed in remainderString.
\section file A Short SKINI File: \section file A Short SKINI File:
\code \code
/* Howdy!!! Welcome to SKINI, by P. Cook 1999 /* Howdy!!! Welcome to SKINI, by P. Cook 1999
NoteOn 0.000082 2 55 82 NoteOn 0.000082 2 55 82
NoteOff 1.000000 2 55 0 NoteOff 1.000000 2 55 0
NoteOn 0.000082 2 69 82 NoteOn 0.000082 2 69 82
StringDetune 0.100000 2 10 StringDetune 0.100000 2 10
StringDetune 0.100000 2 30 StringDetune 0.100000 2 30
StringDetune 0.100000 2 50 StringDetune 0.100000 2 50
NoteOn 0.000000 2 69 82 NoteOn 0.000000 2 69 82
StringDetune 0.100000 2 40 StringDetune 0.100000 2 40
StringDetune 0.100000 2 22 StringDetune 0.100000 2 22
StringDetune 0.100000 2 12 StringDetune 0.100000 2 12
// //
StringDamping 0.000100 2 0.0 StringDamping 0.000100 2 0.0
NoteOn 0.000082 2 55 82 NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82 NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82 NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82 NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82 NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82 NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82 NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82 NoteOff 0.000000 2 79 82
StringDamping =4.000000 2 0.0 StringDamping =4.000000 2 0.0
NoteOn 0.000082 2 55 82 NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82 NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82 NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82 NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82 NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82 NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82 NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82 NoteOff 0.000000 2 79 82
\endcode \endcode
\section table The SKINI.tbl File and Message Parsing: \section table The SKINI.tbl File and Message Parsing:
The SKINI.tbl file contains an array of structures which are accessed by the parser object SKINI.cpp. The struct is: The SKINI.tbl file contains an array of structures which are accessed by the parser object SKINI.cpp. The struct is:
\code \code
struct SKINISpec { struct SKINISpec {
char messageString[32]; char messageString[32];
long type; long type;
long data2; long data2;
long data3; long data3;
}; };
\endcode \endcode
so an assignment of one of these structs looks like: so an assignment of one of these structs looks like:
\code \code
MessageStr$ ,type, data2, data3, MessageStr$ ,type, data2, data3,
\endcode \endcode
<TT>type</TT> is the message type sent back from the SKINI line parser. <TT>type</TT> is the message type sent back from the SKINI line parser.
<TT>data<n></TT> is either: <TT>data<n></TT> is either:
- NOPE : field not used, specifically, there aren't going to be any more fields on this line. So if there is is NOPE in data2, data3 won't even be checked. - NOPE : field not used, specifically, there aren't going to be any more fields on this line. So if there is is NOPE in data2, data3 won't even be checked.
- SK_INT : byte (actually scanned as 32 bit signed long int). If it's a MIDI data field which is required to be an integer, like a controller number, it's 0-127. Otherwise, get creative with SK_INTs. - SK_INT : byte (actually scanned as 32 bit signed long int). If it's a MIDI data field which is required to be an integer, like a controller number, it's 0-127. Otherwise, get creative with SK_INTs.
- SK_DBL : double precision floating point. SKINI uses these in the MIDI context for note numbers with micro tuning, velocities, controller values, etc. - SK_DBL : double precision floating point. SKINI uses these in the MIDI context for note numbers with micro tuning, velocities, controller values, etc.
- SK_STR : only valid in final field. This allows (nearly) arbitrary message types to be supported by simply scanning the string to EndOfLine and then passing it to a more intellegent handler. For example, MIDI SYSEX (system exclusive) messages of up to 256 bytes can be read as space-delimited integers into the 1K SK_STR buffer. Longer bulk dumps, soundfiles, etc. should be handled as a new message type pointing to a FileName, Socket, or something else stored in the SK_STR field, or as a new type of multi-line message. - SK_STR : only valid in final field. This allows (nearly) arbitrary message types to be supported by simply scanning the string to EndOfLine and then passing it to a more intellegent handler. For example, MIDI SYSEX (system exclusive) messages of up to 256 bytes can be read as space-delimited integers into the 1K SK_STR buffer. Longer bulk dumps, soundfiles, etc. should be handled as a new message type pointing to a FileName, Socket, or 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 SKINI.tbl file
\code \code
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL}, {"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL}, {"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
{"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL}, {"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
{"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL}, {"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL},
{"StringDamping" , __SK_ControlChange_, __SK_StringDamping_, SK_DBL}, {"StringDamping" , __SK_ControlChange_, __SK_StringDamping_, SK_DBL},
{"StringDetune" , __SK_ControlChange_, __SK_StringDetune_, SK_DBL}, {"StringDetune" , __SK_ControlChange_, __SK_StringDetune_, SK_DBL},
\endcode \endcode
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 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 fields would be scanned as double-precision floats and assigned to the byteTwo and byteThree variables of the SKINI parser. The remainder of the line is stashed in the remainderString variable. 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 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 fields would be scanned as double-precision floats and assigned to the byteTwo and byteThree variables of the SKINI parser. The remainder of the line is stashed in the remainderString variable.
The ControlChange spec is basically the same as NoteOn and NoteOff, but the second data byte is set to an integer (for checking later as to what MIDI control is being changed). The ControlChange spec is basically the same as NoteOn and NoteOff, but the second data byte is set to an integer (for checking later as to what MIDI control is being changed).
The Volume spec is a MIDI Extension message, which behaves like a ControlChange message with the controller number set explicitly to the value for MIDI Volume (7). Thus the following two lines would accomplish the same changing of MIDI volume on channel 2: The Volume spec is a MIDI Extension message, which behaves like a ControlChange message with the controller number set explicitly to the value for MIDI Volume (7). Thus the following two lines would accomplish the same changing of MIDI volume on channel 2:
\code \code
ControlChange 0.000000 2 7 64.1 ControlChange 0.000000 2 7 64.1
Volume 0.000000 2 64.1 Volume 0.000000 2 64.1
\endcode \endcode
I like the 2nd line better, thus my motivation for SKINI in the first place. I like the 2nd line better, thus my motivation for SKINI in the first place.
The StringDamping and StringDetune messages behave the same as the Volume message, but use Control Numbers which aren't specifically nailed-down in MIDI. Note that these Control Numbers are carried around as long ints, so we're not limited to 0-127. If, however, you want to use a MIDI controller to play an instrument, using controller numbers in the 0-127 range might make sense. The StringDamping and StringDetune messages behave the same as the Volume message, but use Control Numbers which aren't specifically nailed-down in MIDI. Note that these Control Numbers are carried around as long ints, so we're not limited to 0-127. If, however, you want to use a MIDI controller to play an instrument, using controller numbers in the 0-127 range might make sense.
\section using Using SKINI: \section using Using SKINI:
Here's a simple example of code which uses the SKINI object to read a SKINI file and control a single instrument. Here's a simple example of code which uses the SKINI object to read a SKINI file and control a single instrument.
\code \code
instrument = new Mandolin(50.0); instrument = new Mandolin(50.0);
score = new SKINI(argv[1]); score = new SKINI(argv[1]);
while(score->getType() > 0) { while(score->getType() > 0) {
tempDouble = score->getDelta(); tempDouble = score->getDelta();
if (tempDouble < 0) { if (tempDouble < 0) {
tempDouble = - tempDouble; tempDouble = - tempDouble;
tempDouble = tempDouble - output.getTime(); tempDouble = tempDouble - output.getTime();
if (tempDouble < 0) { if (tempDouble < 0) {
printf("Bad News Here!!! Backward Absolute Time Required.\n"); printf("Bad News Here!!! Backward Absolute Time Required.\n");
tempDouble = 0.0; tempDouble = 0.0;
} }
} }
tempLong = (long) (tempDouble * Stk::sampleRate()); tempLong = (long) (tempDouble * Stk::sampleRate());
for (i=0;i<tempLong;i++) { for (i=0;i<tempLong;i++) {
output.tick(instrument->tick()); output.tick(instrument->tick());
} }
tempDouble3 = score->getByteThree(); tempDouble3 = score->getByteThree();
if (score->getType()== __SK_NoteOn_ ) { if (score->getType()== __SK_NoteOn_ ) {
tempDouble3 *= NORM_MIDI; tempDouble3 *= NORM_MIDI;
if (score->getByteThree() == 0) { if (score->getByteThree() == 0) {
tempDouble3 = 0.5; tempDouble3 = 0.5;
instrument->noteOff(tempDouble3); instrument->noteOff(tempDouble3);
} }
else { else {
tempLong = (int) score->getByteTwo(); tempLong = (int) score->getByteTwo();
tempDouble2 = Midi2Pitch[tempLong]; tempDouble2 = Midi2Pitch[tempLong];
instrument->noteOn(tempDouble2,tempDouble3); instrument->noteOn(tempDouble2,tempDouble3);
} }
} }
else if (score->getType() == __SK_NoteOff_) { else if (score->getType() == __SK_NoteOff_) {
tempDouble3 *= NORM_MIDI; tempDouble3 *= NORM_MIDI;
instrument->noteOff(tempDouble3); instrument->noteOff(tempDouble3);
} }
else if (score->getType() == __SK_ControlChange_) { else if (score->getType() == __SK_ControlChange_) {
tempLong = score->getByteTwoInt(); tempLong = score->getByteTwoInt();
instrument->controlChange(tempLong,temp3.0); instrument->controlChange(tempLong,temp3.0);
} }
score->nextMessage(); score->nextMessage();
} }
\endcode \endcode
When the score (SKINI object) object is created from the filename in argv[1], the first valid command line is read from the file and parsed. When the score (SKINI object) object is created from the filename in argv[1], the first valid command line is read from the file and parsed.
The score->getType() retrieves the messageType. If this is -1, there are no more valid messages in the file and the synthesis loop terminates. Otherwise, the message type is returned. The score->getType() retrieves the messageType. If this is -1, there are no more valid messages in the file and the synthesis loop terminates. Otherwise, the message type is returned.
getDelta() retrieves the deltaTime until the current message should occur. If this is greater than 0, synthesis occurs until the deltaTime has elapsed. If deltaTime is less than zero, the time is interpreted as absolute time and the output device is queried as to what time it is now. That is used to form a deltaTime, and if it's positive we synthesize. If it's negative, we print an error and pretend this never happened and we hang around hoping to eventually catch up. getDelta() retrieves the deltaTime until the current message should occur. If this is greater than 0, synthesis occurs until the deltaTime has elapsed. If deltaTime is less than zero, the time is interpreted as absolute time and the output device is queried as to what time it is now. That is used to form a deltaTime, and if it's positive we synthesize. If it's negative, we print an error and pretend this never happened and we hang around hoping to eventually catch up.
The rest of the code sorts out message types NoteOn, NoteOff (including NoteOn with velocity 0), and ControlChange. The code implicitly takes into account the integer type of the control number, but all other data is treated as double float. The rest of the code sorts out message types NoteOn, NoteOff (including NoteOn with velocity 0), and ControlChange. The code implicitly takes into account the integer type of the control number, but all other data is treated as double float.
The last line reads and parses the next message in the file. The last line reads and parses the next message in the file.
*/ */

View File

@@ -1,29 +1,43 @@
/*! \page system System Requirements /*! \page system System Requirements
<B>General</B> <B>General:</B>
<UL> <UL>
<LI>A MIDI interface to use MIDI input controls. (NOTE: This may be built into the soundcard on your computer.)</LI> <LI>A MIDI interface to use MIDI input controls. (NOTE: This may be built into the soundcard on your computer.)</LI>
<LI><A HREF="http://dev.scriptics.com">Tcl/Tk</A> version 8.0 or higher to use the simple Tcl/Tk GUIs provided with the STK distribution (available free over the WWW for all supported realtime platforms).</LI> <LI><A HREF="http://dev.scriptics.com">Tcl/Tk</A> version 8.0 or higher to use the simple Tcl/Tk GUIs provided with the STK distribution (available free over the WWW for all supported realtime platforms).</LI>
</UL> </UL>
<B>Linux (specific)</B>
<UL> <B>Linux (specific):</B>
<LI>A soundcard to use realtime audio input/output capabilities. In order to use the <I><B>effects</B></I> project, the soundcard and drivers must support full duplex mode.</LI> <UL>
<LI><A HREF="http://www.opensound.com">OSS</A> or <A HREF="http://www.alsa-project.org/">ALSA</A> device drivers for realtime sound output and MIDI input.</LI> <LI>A soundcard to use realtime audio input/output capabilities. In order to use the <I><B>effects</B></I> project, the soundcard and drivers must support full duplex mode.</LI>
</UL> <LI><A HREF="http://www.opensound.com">OSS</A> or <A HREF="http://www.alsa-project.org/">ALSA</A> device drivers for realtime sound output and MIDI input.</LI>
</UL>
<B>Windows95/98/2000/XP (specific)</B>
<UL> <B>Macintosh OS X (specific):</B>
<LI>A soundcard to use realtime audio input/output capabilities. In order to use the <I><B>effects</B></I> project, the soundcard and drivers must support full duplex mode.</LI> <UL>
<LI><A HREF="http://www.microsoft.com/directx/">DirectX</A> 5.0 (or higher) runtime libraries to use the precompiled binaries.</LI> <LI>A C++ compiler does not ship by default with OS X. It is necessary to download the Developer Kit from the Apple WWW site in order to compile STK.</LI>
<LI>Visual C++ 6.0 for compiling (though a precompiled distribution is available).</LI> <LI>The tcl/tk interpreter does not ship by default with OS X, but must be downloaded from the internet. Once installed, it is suggested that a link be made to the executable from a standard search path (/usr/bin/wish). In any event, it will not be possible to use the supplied startup scripts in the demo directory (i.e. StkDemo.bat) because the tcl/tk script startup sequence is slightly different than for all the other systems. Assuming you have made the link mentioned above, the STK demo program and tcl/tk script can be started by typing:
<LI>For compiling the source (if not already in your system): <UL><LI><A HREF="Misc/dsound.h">dsound.h</A> header file (DirectX 6.1) - put somewhere in your header search path</LI><LI><A HREF="Misc/dsound.lib">dsound.lib</A> library file (DirectX 6.1) - put somewhere in your library search path</LI></UL></LI>
</UL> \code
wish tcl/Demo.tcl | demo Clarinet -or -ip
<B>WindowsNT (specific)</B> \endcode
<UL>
<LI>STK is no longer supported under WindowsNT because DirectX support for NT is minimal. Unless DirectX 5.0 or higher becomes available for NT, STK won't work.</LI> Initial tests have shown somewhat poor response between changes made in the tcl/tk script and the resulting audio updates.</LI>
</UL>
</UL>
<P>
<B>Windows95/98/2000/XP (specific):</B>
<UL>
<LI>A soundcard to use realtime audio input/output capabilities. In order to use the <I><B>effects</B></I> project, the soundcard and drivers must support full duplex mode.</LI>
<LI><A HREF="http://www.microsoft.com/directx/">DirectX</A> 5.0 (or higher) runtime libraries to use the precompiled binaries.</LI>
<LI>Visual C++ 6.0 for compiling (though a precompiled distribution is available).</LI>
<LI>For compiling the source (if not already in your system): <UL><LI><A HREF="Misc/dsound.h">dsound.h</A> header file (DirectX 6.1) - put somewhere in your header search path</LI><LI><A HREF="Misc/dsound.lib">dsound.lib</A> library file (DirectX 6.1) - put somewhere in your library search path</LI></UL></LI>
</UL>
<B>WindowsNT (specific):</B>
<UL>
<LI>DirectX support for NT is inadequate, so it is not possible to use STK under WindowsNT with realtime DirectX support. It may be possible to use STK under WindowsNT with realtime ASIO support, though this has not been tested.</LI>
</UL>
<P>
*/ */

View File

@@ -1,149 +1,156 @@
/*! \page tutorial Tutorial /*! \page tutorial Tutorial
- \ref intro - \ref intro
- \ref start - \ref start
- \ref compile - \ref compile
- \ref rtvsnonrt - \ref rtvsnonrt
\section intro Introduction \section intro Introduction
First and foremost, the Synthesis ToolKit is a set of C++ classes. That means you need to know some basics about programming in C++ to make use of STK (beyond the example programs we provide). STK's "target audience" is people who: First and foremost, the Synthesis ToolKit is a set of C++ classes. That means you need to know some basics about programming in C++ to make use of STK (beyond the example programs we provide). STK's "target audience" is people who:
<UL> <UL>
<LI>already know how to program in C and C++</LI> <LI>already know how to program in C and C++</LI>
<LI>want to create audio DSP and/or synthesis programs</LI> <LI>want to create audio DSP and/or synthesis programs</LI>
<LI>want to save some time by using our unit generators and input/output routines</LI> <LI>want to save some time by using our unit generators and input/output routines</LI>
<LI>know C, but want to learn about synthesis and processing algorithms</LI> <LI>know C, but 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> <LI>wish to teach real-time synthesis and processing, and wish to use some of our classes and examples</LI>
</UL> </UL>
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.). 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.).
\section start Getting Started \section start Getting Started
We'll begin our introduction to the Synthesis ToolKit with a simple sine-wave oscillator program. STK doesn't provide a specific oscillator for sine waves. Instead, it provides a generic waveform oscillator class, WaveLoop, which can load a variety of common file types. In this example, we load a sine "table" from an STK RAW file. The class RtWvOut will send "realtime" samples to the audio output hardware on your computer. We'll begin our introduction to the Synthesis ToolKit with a simple sine-wave oscillator program. STK doesn't provide a specific oscillator for sine waves. Instead, it provides a generic waveform oscillator class, WaveLoop, which can load a variety of common file types. In this example, we load a sine "table" from an STK RAW file. The class RtWvOut will send "realtime" samples to the audio output hardware on your computer.
\code \code
// sineosc.cpp // sineosc.cpp
#include "WaveLoop.h" #include "WaveLoop.h"
#include "RtWvOut.h" #include "RtWvOut.h"
int main() int main()
{ {
// Set the global sample rate before creating class instances. // Set the global sample rate before creating class instances.
Stk::setSampleRate( 44100.0 ); Stk::setSampleRate( 44100.0 );
// Define and load the sine wave file // Define and load the sine wave file
WaveLoop *input = new WaveLoop("sinewave.raw", TRUE); WaveLoop *input = new WaveLoop("sinewave.raw", TRUE);
input->setFrequency(440.0); input->setFrequency(440.0);
// Define and open the default realtime output device for one-channel playback // Define and open the default realtime output device for one-channel playback
RtWvOut *output = new RtWvOut(1); RtWvOut *output = new RtWvOut(1);
// Play the oscillator for 40000 samples // Play the oscillator for 40000 samples
for (int i=0; i<40000; i++) { for (int i=0; i<40000; i++) {
output->tick( input->tick() ); output->tick( input->tick() );
} }
// Clean up // Clean up
delete input; delete input;
delete output; delete output;
return 0; return 0;
} }
\endcode \endcode
WaveLoop is a subclass of WvIn, which supports WAV, SND (AU), AIFF, MAT-file (Matlab), and RAW file formats with 8-, 16-, and 32-bit integer and 32- and 64-bit floating-point data types. WvIn provides interpolating, read once ("oneshot") functionality, as well as methods for setting the read rate and read position. WaveLoop is a subclass of WvIn, which supports WAV, SND (AU), AIFF, MAT-file (Matlab), and RAW file formats with 8-, 16-, and 32-bit integer and 32- and 64-bit floating-point data types. WvIn provides interpolating, read once ("oneshot") functionality, as well as methods for setting the read rate and read position.
Nearly all STK classes implement tick() methods which take and/or return sample values. Within the tick() method, the fundamental sample calculations are performed for a given class. Most STK classes consume/generate a single sample per operation and their tick() method takes/returns each sample "by value". In addition, every class implementing a tick() method also provides an overloaded tick() function taking pointer and size arguments which can be used for vectorized computations. Nearly all STK classes implement tick() methods which take and/or return sample values. Within the tick() method, the fundamental sample calculations are performed for a given class. Most STK classes consume/generate a single sample per operation and their tick() method takes/returns each sample "by value". In addition, every class implementing a tick() method also provides an overloaded tick() function taking pointer and size arguments which can be used for vectorized computations.
The WvIn and WvOut classes support multi-channel sample frames. To distinguish single-sample frame operations from multi-channel frame operations, these classes also implement tickFrame() functions. When a tick() method is called for multi-channel data, frame averages are returned or the input sample is distributed across all channels of a sample frame. The WvIn and WvOut classes support multi-channel sample frames. To distinguish single-sample frame operations from multi-channel frame operations, these classes also implement tickFrame() functions. When a tick() method is called for multi-channel data, frame averages are returned or the input sample is distributed across all channels of a sample frame.
Nearly all STK classes inherit from the Stk base class. Stk provides a static sample rate which is queried by subclasses as needed. Because many classes use the current sample rate value during instantiation, it is important that the desired value be set at the beginning of a program. The default STK sample rate is 22050 Hz. Nearly all STK classes inherit from the Stk base class. Stk provides a static sample rate which is queried by subclasses as needed. Because many classes use the current sample rate value during instantiation, it is important that the desired value be set at the beginning of a program. The default STK sample rate is 22050 Hz.
Another primary concept that is somewhat obscurred in this example concerns the data format in which sample values are passed and received. Audio and control signals throughout STK use a floating-point data type, the exact precision of which can be controlled via the MY_FLOAT \#define statement in Stk.h. Thus, the ToolKit can use any normalization scheme desired. The base instruments and algorithms are implemented with a general audio sample dynamic maximum of +/-1.0, and the WvIn and WvOut classes and subclasses scale appropriately for DAC or soundfile input and output. Another primary concept that is somewhat obscurred in this example concerns the data format in which sample values are passed and received. Audio and control signals throughout STK use a floating-point data type, the exact precision of which can be controlled via the MY_FLOAT \#define statement in Stk.h. Thus, the ToolKit can use any normalization scheme desired. The base instruments and algorithms are implemented with a general audio sample dynamic maximum of +/-1.0, and the WvIn and WvOut classes and subclasses scale appropriately for DAC or soundfile input and output.
Finally, STK has some basic C++ error handling functionality built in. Classes which access files and/or hardware are most prone to runtime errors. To properly "catch" such errors, the above example should be rewritten as shown below. Finally, STK has some basic C++ error handling functionality built in. Classes which access files and/or hardware are most prone to runtime errors. To properly "catch" such errors, the above example should be rewritten as shown below.
\code \code
// sineosc.cpp // sineosc.cpp
#include "WaveLoop.h" #include "WaveLoop.h"
#include "RtWvOut.h" #include "RtWvOut.h"
int main() int main()
{ {
// Set the global sample rate before creating class instances. // Set the global sample rate before creating class instances.
Stk::setSampleRate( 44100.0 ); Stk::setSampleRate( 44100.0 );
WaveLoop *input = 0; WaveLoop *input = 0;
RtWvOut *output = 0; RtWvOut *output = 0;
try { try {
// Define and load the sine wave file // Define and load the sine wave file
input = new WaveLoop( "sinewave.raw", TRUE ); input = new WaveLoop( "sinewave.raw", TRUE );
// Define and open the default realtime output device for one-channel playback // Define and open the default realtime output device for one-channel playback
output = new RtWvOut(1); output = new RtWvOut(1);
} }
catch (StkError &) { catch (StkError &) {
goto cleanup; goto cleanup;
} }
input->setFrequency(440.0); input->setFrequency(440.0);
// Play the oscillator for 40000 samples // Play the oscillator for 40000 samples
for (int i=0; i<40000; i++) { for (int i=0; i<40000; i++) {
try { try {
output->tick(input->tick()); output->tick(input->tick());
} }
catch (StkError &) { catch (StkError &) {
goto cleanup; goto cleanup;
} }
} }
cleanup: cleanup:
delete input; delete input;
delete output; delete output;
return 0; return 0;
} }
\endcode \endcode
In this particular case, we simply exit the program if an error occurs (an error message is automatically printed to stderr). A more refined program might attempt to recover from or fix a particular problem and, if successful, continue processing. In this particular case, we simply exit the program if an error occurs (an error message is automatically printed to stderr). A more refined program might attempt to recover from or fix a particular problem and, if successful, continue processing.
\section compile Compiling \section compile Compiling
\subsection compileLinux Linux \subsection compileLinux Linux
In general, you will probably want to use a <TT>Makefile</TT> for your STK programs and projects. For this particular program, however, the following will suffice (on a linux system): In general, you will probably want to use a <TT>Makefile</TT> for your STK programs and projects. For this particular program, however, the following will suffice (on a linux system):
\code \code
g++ -Wall -D__LINUX_OSS__ -D__LITTLE_ENDIAN__ -o sineosc Stk.cpp WvIn.cpp WaveLoop.cpp WvOut.cpp RtWvOut.cpp RtAudio.cpp sineosc.cpp -lpthread g++ -Wall -D__LINUX_OSS__ -D__LITTLE_ENDIAN__ -o sineosc Stk.cpp WvIn.cpp WaveLoop.cpp WvOut.cpp RtWvOut.cpp RtAudio.cpp sineosc.cpp -lpthread
\endcode \endcode
This assumes you've set up a directory that includes the files <TT>sineosc.cpp</TT>, the rawwave file <TT>sinewave.raw</TT>, and the header and source files for the classes Stk, WvIn, WaveLoop, WvOut, RtWvOut, and RtAudio. There are other, more convenient, means for structuring projects that will be discussed later. This assumes you've set up a directory that includes the files <TT>sineosc.cpp</TT>, the rawwave file <TT>sinewave.raw</TT>, and the header and source files for the classes Stk, WvIn, WaveLoop, WvOut, RtWvOut, and RtAudio. There are other, more convenient, means for structuring projects that will be discussed later.
Most linux systems currently come installed with the OSS audio hardware drivers. If your system instead has ALSA audio drivers installed and you wish to make use of native ALSA API calls, a link to the ALSA library must be specified in the above compile statement (<TT>-lasound</TT>) and the preprocessor definition should instead be <TT>__LINUX_ALSA__</TT>. Most linux systems currently come installed with the OSS audio hardware drivers. If your system instead has ALSA audio drivers installed and you wish to make use of native ALSA API calls, a link to the ALSA library must be specified in the above compile statement (<TT>-lasound</TT>) and the preprocessor definition should instead be <TT>__LINUX_ALSA__</TT>.
\subsection compileIrix Irix \subsection compileIrix Irix
The irix (SGI) and linux operating systems are both flavors of unix and thus behave similarly. Making the same assumptions as in the linux case, the following compile statement should work: The irix (SGI) and linux operating systems are both flavors of unix and thus behave similarly. Making the same assumptions as in the linux case, the following compile statement should work:
\code \code
CC -Wall -D__IRIX_AL__ -o sineosc Stk.cpp WvIn.cpp WaveLoop.cpp WvOut.cpp RtWvOut.cpp RtAudio.cpp sineosc.cpp -lpthread CC -Wall -D__IRIX_AL__ -o sineosc Stk.cpp WvIn.cpp WaveLoop.cpp WvOut.cpp RtWvOut.cpp RtAudio.cpp sineosc.cpp -lpthread
\endcode \endcode
\subsection compileWin Windows \subsection compileOSX Macintosh OS X
I have personally only worked with Visual C++ when compiling programs under windoze. I'll assume you've become familiar with Visual C+ and don't need a tutorial on its particular idiosyncrasies. In creating the VC++ project, add the Stk, WvIn, WaveLoop, WvOut, RtWvOut, and RtAudio class files, as well as the <TT>sineosc.cpp</TT> and <TT>sinewave.raw</TT> files. You will also need to link to the DirectSound library (<TT>dsound.lib</TT>), select the multithreaded library, and provide the <TT>__WINDOWS_DS__</TT> and <TT>__LITTLE_ENDIAN__</TT> preprocessor definitions. The Macintosh OS X operating systems is another flavor of unix and thus behaves similarly. Making the same assumptions as in the linux case, the following compile statement should work:
\code
CC -Wall -D__MACOSX_CORE__ -o sineosc Stk.cpp WvIn.cpp WaveLoop.cpp WvOut.cpp RtWvOut.cpp RtAudio.cpp sineosc.cpp -lpthread -framework CoreAudio
\section rtvsnonrt "Realtime" vs. "Non-Realtime" \endcode
Most of the Synthesis ToolKit classes are platform independent. That means that they should compile on any reasonably current C++ compiler. The functionality needed for realtime audio and MIDI input/output, as well as realtime control message acquistion, is inherently platform and operating-system (OS) <I>dependent</I>. STK classes which require specific platform/OS support include RtAudio, RtWvOut, RtWvIn, RtDuplex, RtMidi, TcpWvIn, TcpWvOut, Socket, and Thread. These classes currently can only be compiled on Linux, Irix, and Windows (except Windows NT) systems using the <TT>__LINUX_OSS__</TT>, <TT>__LINUX_ALSA__</TT>, <TT>__IRIX_AL__</TT>, or <TT>__WINDOWS_DS__</TT> preprocessor definitions. \subsection compileWin Windows
Without the "realtime" classes, it is still possible to read SKINI scorefiles for control input and to read and write to/from a variety of audio file formats (WAV, SND, AIFF, MAT-file, and RAW). If compiling for a "little-endian" host processor, the <TT>__LITTLE_ENDIAN__</TT> preprocessor definition should be provided. I have personally only worked with Visual C++ when compiling programs under windoze. I'll assume you've become familiar with Visual C+ and don't need a tutorial on its particular idiosyncrasies. In creating the VC++ project, add the Stk, WvIn, WaveLoop, WvOut, RtWvOut, and RtAudio class files, as well as the <TT>sineosc.cpp</TT> and <TT>sinewave.raw</TT> files. You will also need to link to the DirectSound library (<TT>dsound.lib</TT>), select the multithreaded library, and provide the <TT>__WINDOWS_DS__</TT> and <TT>__LITTLE_ENDIAN__</TT> preprocessor definitions.
\section continued To Be Continued ...
\section rtvsnonrt "Realtime" vs. "Non-Realtime"
*/
Most of the Synthesis ToolKit classes are platform independent. That means that they should compile on any reasonably current C++ compiler. The functionality needed for realtime audio and MIDI input/output, as well as realtime control message acquistion, is inherently platform and operating-system (OS) <I>dependent</I>. STK classes which require specific platform/OS support include RtAudio, RtWvOut, RtWvIn, RtDuplex, RtMidi, TcpWvIn, TcpWvOut, Socket, and Thread. These classes currently can only be compiled on Linux, Irix, Macintosh OS X, and Windows (except Windows NT) systems using the <TT>__LINUX_OSS__</TT>, <TT>__LINUX_ALSA__</TT>, <TT>__IRIX_AL__</TT>, <TT>__MACOSX_CORE__</TT>, or <TT>__WINDOWS_DS__</TT> preprocessor definitions.
Without the "realtime" classes, it is still possible to read SKINI scorefiles for control input and to read and write to/from a variety of audio file formats (WAV, SND, AIFF, MAT-file, and RAW). If compiling for a "little-endian" host processor, the <TT>__LITTLE_ENDIAN__</TT> preprocessor definition should be provided.
\section continued To Be Continued ...
*/

View File

@@ -1,183 +1,221 @@
/*! \page usage Usage Documentation /*! \page usage Usage Documentation
- \ref directory - \ref directory
- \ref compiling - \ref compiling
- \ref control - \ref control
- \ref instruments - \ref instruments
- \ref nort - \ref nort
- \ref rt - \ref rt
- \ref tcl - \ref tcl
- \ref midi - \ref midi
- \ref polyphony
<HR>
<HR>
\section directory Directory Structure:
\section directory Directory Structure:
The top level distribution contains the following directories:
The top level distribution contains the following directories:
<UL>
<LI> The <I><B>src</B></I> directory contains the source .cpp files for almost all the STK unit generator and algorithm classes.</LI><P> <UL>
<LI> The <I><B>src</B></I> directory contains the source .cpp files for all the STK unit generator and algorithm classes.</LI><P>
<LI> The <I><B>include</B></I> directory contains the header files for almost all the STK unit generator and algorithm classes.</LI><P>
<LI> The <I><B>include</B></I> directory contains the header files for all the STK unit generator and algorithm classes.</LI><P>
<LI> The <I><B>rawwaves</B></I> directory contains various raw, monophonic, 16-bit, big-endian soundfiles used with the STK classes.</LI><P>
<LI> The <I><B>rawwaves</B></I> directory contains various raw, monophonic, 16-bit, big-endian soundfiles used with the STK classes.</LI><P>
<LI> The <I><B>doc</B></I> directory contains documentation about STK.</LI><P>
<LI> The <I><B>doc</B></I> directory contains documentation about STK.</LI><P>
<LI> The <I><B>projects</B></I> directory contains various demo and example STK programs.</LI><P>
</UL> <LI> The <I><B>projects</B></I> directory contains various demo and example STK programs.</LI><P>
</UL>
This release of STK comes with four separate "project" 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> <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>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>
<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>
<LI> The <I><B>ragamatic</B></I> project is just cool. Fire it up and be enlightened.<P></LI>
<LI> The <I><B>ragamatic</B></I> project is just cool. Fire it up and be enlightened.<P></LI>
<LI> The <I><B>examples</B></I> project contains several simple programs which demonstrate audio input/output, as well as the use of the audio internet streaming classes.</LI>
</OL> <LI> The <I><B>examples</B></I> project contains several simple programs which demonstrate audio input/output, as well as the use of the audio internet streaming classes.</LI>
</OL>
\section compiling Compiling:
\section compiling Compiling:
<UL>
<LI><B>Generic (non-realtime):</B> Most STK classes are operating system <I>independent</I> and can be compiled using any current C++ compiler. STK assumes big-endian host byte order by default, so if your system is little-endian (i.e. Intel processor), you must provide the <TT>__LITTLE_ENDIAN__</TT> preprocessor definition to your compiler. The <I><B>demo</B></I> project will compile without realtime support, allowing the use of SKINI scorefiles for input control and output to a variety of soundfile formats. The following classes <I>cannot</I> be used without realtime support: RtAudio, RtWvIn, RtWvOut, RtDuplex, RtMidi, Socket, Thread, TcpWvIn, TcpWvOut. Because of this, it is not possible to compile the <I><B>effects</B></I>, <I><B>ragamatic</B></I>, and most of the <I><B>examples</B></I> projects for non-realtime use.</LI> <UL>
<LI><B>Windows95/98/2000/XP:</B> Realtime support is available using either DirectSound or ASIO audio drivers. For DirectSound support, use the <TT>__WINDOWS_DS__</TT> preprocessor definition and link with the <TT>dsound.lib</TT>, <TT>winmm.lib</TT>, and <TT>Wsock32.lib</TT> libraries. For ASIO support, use the <TT>__WINDOWS_ASIO__</TT> preprocessor definition, include all the files in the <TT>src/asio/</TT> directory (i.e. <TT>asio.h,cpp</TT>, <TT>asiodrivers.h,cpp</TT>, ...), and link with the <TT>winmm.lib</TT>, and <TT>Wsock32.lib</TT> libraries. In addition, the <TT>__LITTLE_ENDIAN__</TT> preprocessor definition is necessary for all Windows systems. A distribution of the release is available with precompiled binaries (using DirectSound) for all the projects. In order for these binaries to function properly, your system must have the DirectX 5.0 (or higher) runtime libraries installed (available from <A HREF="http://www.microsoft.com/directx/">Microsoft</A>). Further, the <I><B>effects</B></I> project requires that your soundcard and drivers provide full duplex mode capabilities. Visual C++ 6.0 project files are provided in each project directory as well should you wish to compile your own binaries. It is important to link with the non-debug libraries when compiling "release" program versions and debug libraries when compiling "debug" program versions.</LI>
<LI><B>Linux:</B> Realtime support is enabled with either the <TT>__LINUX_OSS__</TT> or <TT>__LINUX_ALSA__</TT> preprocessor definitions, which are used to select the underlying audio/MIDI system API. Realtime programs must also link with the <TT>pthread</TT> library. When using the ALSA API, it is also necessary to link with the <TT>asound</TT> library. In addition, the <TT>__LITTLE_ENDIAN__</TT> preprocessor definition is necessary if compiling on a little-endian system. Assuming your system has the <A HREF="http://gnu.cetcol.net.co/">GNU</A> Makefile utilities installed, typing <TT>make</TT> within a particular project directory will initiate the compilation process. The <TT>Makefile</TT> will have to be modified to change the default audio/MIDI system API and for big-endian processors. Special support exists under Linux for the MIDIator serial MIDI device, enabled using the __MIDIATOR__ preprocessor definition (together with either the __LINUX_ALSA__ or __LINUX_OSS__ definitions). See the README-Linux file for further system configuration information.</LI>
<LI><B>WindowsNT:</B> DirectX support for NT is inadequate, so it is not possible to use STK under WindowsNT with realtime DirectX support. It may be possible to use STK under WindowsNT with realtime ASIO support, though this has not been tested.</LI>
<LI><B>SGI:</B> Realtime support is enabled with the <TT>__IRIX_AL__</TT> preprocessor definition and linkage with the <TT>audio</TT>, <TT>md</TT>, and <TT>pthread</TT> libraries. If your system has the <A HREF="http://gnu.cetcol.net.co/">GNU</A> Makefile utilities installed, typing <TT>make</TT> (or <TT>gmake</TT>) within a particular project directory will initiate the compilation process. If your system does not have the GNU Makefile utilities, you should first try to download and install them. If this is not possible, a generic Makefile is provided with the <I><B>demo</B></I> project (Makefile.sgi). It can be invoked by typing <TT>make -f Makefile.sgi</TT> within that project directory. STK 4.0 is confirmed to compile using CC version 7.30. There may be problems with old compiler versions.</LI>
<LI><B>Unix Systems:</B> A GNU <TT>configure</TT> shell script is included in the distribution for unix-based systems. From the top-level distribution directory, type <TT>'./configure'</TT> and the script will create <TT>Makefiles</TT> in each project directory specific to the characteristics of the host computer. Then from within any given project directory (example <TT>demo</TT>), type <TT>'make'</TT> to compile the project. In addition, an STK library can be compiled from within the <TT>src</TT> directory.
<LI><B>Windows95/98/2000/XP:</B> Realtime support is enabled with the <TT>__WINDOWS_DS__</TT> preprocessor definition and linkage with the <TT>dsound.lib</TT>, <TT>winmm.lib</TT>, and <TT>Wsock32.lib</TT> libraries. In addition, the <TT>__LITTLE_ENDIAN__</TT> preprocessor definition is necessary for all Windows systems. A distribution of the release is available with precompiled binaries for all the projects. In order for these binaries to function properly, your system must have the DirectX 5.0 (or higher) runtime libraries installed (available from <A HREF="http://www.microsoft.com/directx/">Microsoft</A>). Further, the <I><B>effects</B></I> project requires that your soundcard and drivers provide full duplex mode capabilities. Visual C++ 6.0 project file are provided in each project directory as well should you wish to compile your own binaries. It is important to link with the non-debug libraries when compiling "release" program versions and debug libraries when compiling "debug" program versions.</LI>
Several options can be supplied to the <TT>configure</TT> script to customize the build behavior:
<LI><B>WindowsNT:</B> I've given up trying to make things work under NT. You'll have to switch to Windows 2000 (which does seem to work).</LI> <UL>
</UL> <LI><TT>--disable-realtime</TT> to only compile generic non-realtime classes</LI>
<LI><TT>--enable-debug</TT> to enable various debug output</LI>
<LI><TT>--enable-midiator</TT> to enable native MS-124W MIDI support (linux only)</LI>
\section control Control Data: <LI><TT>--with-alsa</TT> to choose native ALSA API support (linux only)</LI>
</UL>
All STK programs in this distribution take input control data in the form of <A HREF="skini.html">SKINI</A> or MIDI messages only. The Messager class unifies the various means of acquiring control data under a single, easy to use set of functions. The way that SKINI messages can be sent to the programs is dependent upon the operating system in use, as well as whether the program is running in realtime or not. In general, it is possible to: <P>
In addition, it is possible to specify the location of the STK rawwaves and the STK include path as follows:
<OL> \code
<LI>Redirect or pipe SKINI scorefiles to an executable.</LI> ./configure RAWWAVE_PATH="/home/gary/rawwaves/"
<LI>Pipe realtime SKINI input messages to an executable (not possible under Windows95/98).</LI> ./configure INCLUDE_PATH="/home/gary/include/"
<LI>Socket realtime SKINI input messages to an executable.</LI> \endcode
<LI>Acquire realtime MIDI messages from a MIDI port on your computer.</LI>
</OL> For novice STK users, the default configuration should be adequate.
</UL>
<A HREF="http://dev.scriptics.com">Tcl/Tk</A> graphical user interfaces (GUI) are provided with this distribution which can generate realtime SKINI messages. Note that the Messager class allows multiple simultaneous socket client connections, together with MIDI and/or piped input. The <I><B>Md2Skini</B></I> program (in the <I><B>demo</B></I> directory) is mostly obsolete but can be used to create SKINI scorefiles from realtime MIDI input.
For those who wish to create their own system-specific <TT>Makefiles</TT>:
<UL>
\section instruments Demo: STK Instruments <LI><B>Linux:</B> Realtime support is enabled with either the <TT>__LINUX_OSS__</TT> or <TT>__LINUX_ALSA__</TT> preprocessor definitions, which are used to select the underlying audio/MIDI system API. Realtime programs must also link with the <TT>pthread</TT> library. When using the ALSA API, it is also necessary to link with the <TT>asound</TT> library. In addition, the <TT>__LITTLE_ENDIAN__</TT> preprocessor definition is necessary if compiling on a little-endian system. Special support exists under Linux for the MIDIator serial MIDI device, enabled using the <TT>__MIDIATOR__</TT> preprocessor definition (together with either the <TT>__LINUX_ALSA__</TT> or <TT>__LINUX_OSS__</TT> definitions). See the README-Linux file for further system configuration information.</LI>
The <I><B>demo</B></I> project demonstrates the behavior of all the distributed STK instruments. The instruments available with this release include: <LI><B>Macintosh OS X:</B> Realtime support is enabled with the <TT>__MACOSX_CORE__</TT> preprocessor definitions, which incorporates the CoreAudio audio/MIDI API. Realtime programs must also link with the <TT>pthread</TT> library and the <TT>CoreAudio</TT>, <TT>CoreMIDI</TT>, and <TT>CoreFoundation</TT> frameworks. See the README-MacOSX file for further system configuration information.</LI>
<UL>
<LI>Clarinet: Pretty good physical model of the clarinet</LI> <LI><B>SGI:</B> Realtime support is enabled with the <TT>__IRIX_AL__</TT> preprocessor definition and linkage with the <TT>audio</TT>, <TT>md</TT>, and <TT>pthread</TT> libraries. STK 4.0 (and higher) is confirmed to compile using CC version 7.30. There may be problems with old compiler versions.</LI>
<LI>BlowHole: A clarinet physical model with one tonehole and one register vent</LI>
<LI>Saxofony: A psuedo-conical bore reed instrument which sometimes sounds like a saxophone</LI> <LI><B>Generic (non-realtime):</B> Most STK classes are operating system <I>independent</I> and can be compiled using any current C++ compiler. STK assumes big-endian host byte order by default, so if your system is little-endian (i.e. Intel processor), you must provide the <TT>__LITTLE_ENDIAN__</TT> preprocessor definition to your compiler. The <I><B>demo</B></I> project will compile without realtime support, allowing the use of SKINI scorefiles for input control and output to a variety of soundfile formats. The following classes <I>cannot</I> be used without realtime support: RtAudio, RtWvIn, RtWvOut, RtDuplex, RtMidi, Socket, Thread, TcpWvIn, TcpWvOut. Because of this, it is not possible to compile the <I><B>effects</B></I>, <I><B>ragamatic</B></I>, and most of the <I><B>examples</B></I> projects for non-realtime use.</LI>
<LI>Flute: Pretty good physical model of the flute</LI> </UL>
<LI>Brass: Not so bad physical model of a brass instrument</LI>
<LI>BlowBotl: A basic helmholtz resonator and air jet model</LI>
<LI>Bowed: Not hideous physical model of a bowed string instrument</LI> \section control Control Data:
<LI>Plucked: Yer basic plucked string physical model</LI>
<LI>StifKarp: A simple plucked, stiff string physical model</LI> All STK programs in this distribution take input control data in the form of <A HREF="skini.html">SKINI</A> or MIDI messages only. The Messager class unifies the various means of acquiring control data under a single, easy to use set of functions. The way that SKINI messages can be sent to the programs is dependent upon the operating system in use, as well as whether the program is running in realtime or not. In general, it is possible to:
<LI>Sitar: A simple sitar/plucked string physical model</LI>
<LI>Mandolin: Two-string mandolin physical model</LI> <OL>
<LI>Rhodey: Rhodes-like electric piano FM synthesis model</LI> <LI>Redirect or pipe SKINI scorefiles to an executable.</LI>
<LI>Wurley: Wurlitzer-like electric piano FM synthesis model</LI> <LI>Pipe realtime SKINI input messages to an executable (not possible under Windows95/98).</LI>
<LI>TubeBell: FM synthesis model</LI> <LI>Socket realtime SKINI input messages to an executable.</LI>
<LI>HevyMetl: Distorted synthesizer FM synthesis model</LI> <LI>Acquire realtime MIDI messages from a MIDI port on your computer.</LI>
<LI>PercFlut: Percussive flute-like FM synthesis model</LI> </OL>
<LI>BeeThree: Cheezy organ FM synthesis model</LI>
<LI>Moog: Swept filter sampler</LI> <A HREF="http://dev.scriptics.com">Tcl/Tk</A> graphical user interfaces (GUI) are provided with this distribution which can generate realtime SKINI messages. Note that the Messager class allows multiple simultaneous socket client connections, together with MIDI and/or piped input. The <I><B>Md2Skini</B></I> program (in the <I><B>demo</B></I> directory) is mostly obsolete but can be used to create SKINI scorefiles from realtime MIDI input.
<LI>FMVoices: Three-formant FM voice synthesis</LI>
<LI>Resonate: Noise through a BiQuad filter</LI>
<LI>Drummer: Sampling synthesis</LI> \section instruments Demo: STK Instruments
<LI>BandedWG: Banded waveguide meta-object for bowed bars, tibetan bowls, etc.</LI>
<LI>Shakers: Various stochastic event models of shaker instruments</LI> The <I><B>demo</B></I> project demonstrates the behavior of all the distributed STK instruments. The instruments available with this release include:
<LI>ModalBar: Various four-resonance presets (marimba, vibraphone, etc...)</LI> <UL>
<LI>Mesh2D: Two-dimensional, rectilinear digital waveguide mesh</LI> <LI>Clarinet: Pretty good physical model of the clarinet</LI>
</UL> <LI>BlowHole: A clarinet physical model with one tonehole and one register vent</LI>
<LI>Saxofony: A psuedo-conical bore reed instrument which sometimes sounds like a saxophone</LI>
\section nort Demo: Non-Realtime Use <LI>Flute: Pretty good physical model of the flute</LI>
<LI>Brass: Not so bad physical model of a brass instrument</LI>
See the information above with respect to compiling STK for non-realtime use. <LI>BlowBotl: A basic helmholtz resonator and air jet model</LI>
<LI>Bowed: Not hideous physical model of a bowed string instrument</LI>
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: <LI>Plucked: Yer basic plucked string physical model</LI>
<LI>StifKarp: A simple plucked, stiff string physical model</LI>
\code <LI>Sitar: A simple sitar/plucked string physical model</LI>
cat scores/bookert.ski | demo BeeThree -w myfile.wav <LI>Mandolin: Two-string mandolin physical model</LI>
\endcode <LI>Rhodey: Rhodes-like electric piano FM synthesis model</LI>
<LI>Wurley: Wurlitzer-like electric piano FM synthesis model</LI>
or (on WindowsXX and/or Unix) <LI>TubeBell: FM synthesis model</LI>
<LI>HevyMetl: Distorted synthesizer FM synthesis model</LI>
\code <LI>PercFlut: Percussive flute-like FM synthesis model</LI>
demo BeeThree -w myfile.wav < scores\bookert.ski <LI>BeeThree: Cheezy organ FM synthesis model</LI>
\endcode <LI>Moog: Swept filter sampler</LI>
<LI>FMVoices: Three-formant FM voice synthesis</LI>
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". Typing <TT>demo</TT> without any arguments will provide a full program usage description. <LI>VoicForm: Four-formant resonance filter voice synthesis</LI>
<LI>Resonate: Noise through a BiQuad filter</LI>
<LI>Drummer: Sampling synthesis</LI>
\section rt Demo: Realtime Use <LI>BandedWG: Banded waveguide meta-object for bowed bars, tibetan bowls, etc.</LI>
<LI>Shakers: Various stochastic event models of shaker instruments</LI>
STK realtime audio and MIDI input/output and realtime SKINI control input via socketing support is provided for Linux, SGI, and Windows95/98/2000/XP operating systems. STK realtime SKINI control input via piping is possible under Linux, SGI, and Windows2000/XP only. <LI>ModalBar: Various four-resonance presets (marimba, vibraphone, etc...)</LI>
<P> <LI>Mesh2D: Two-dimensional, rectilinear digital waveguide mesh</LI>
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: <LI>Whistle: Hybrid physical/spectral model of a police whistle</LI>
</UL>
\code
demo instrument flags \section nort Demo: Non-Realtime Use
\endcode
See the information above with respect to compiling STK for non-realtime use.
where instruments include those described above and flags can be any or all of:
<UL> 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:
<LI><I>-or</I> for realtime audio output,</LI>
<LI><I>-ow <file name></I> for WAV soundfile output,</LI> \code
<LI><I>-os <file name></I> for SND (AU) soundfile output,</LI> cat scores/bookert.ski | demo BeeThree -ow myfile.wav
<LI><I>-om <file name></I> for MAT-file output,</LI> \endcode
<LI><I>-ip</I> or <I>-is</I> for realtime SKINI control input via piping or socketing, respectively,</LI>
<LI><I>-im <file name></I> for MIDI control input</LI> or (on WindowsXX and/or Unix)
</UL>
The <-ip> and <-is> flags must be used when piping or socketing realtime SKINI control data to an STK program. The <-im> flag must be used to read MIDI control input from your MIDI port. Note that you can use all three input types simultaneously. \code
demo BeeThree -ow myfile.wav < scores\bookert.ski
Assuming a successful compilation of the <I><B>demo</B></I> program, typing: \endcode
\code 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". Typing <TT>demo</TT> without any arguments will provide a full program usage description.
cat scores/bookert.ski | demo BeeThree -or
\endcode
\section rt Demo: Realtime Use
or (on WindowsXX and/or Unix)
STK realtime audio and MIDI input/output and realtime SKINI control input via socketing support is provided for Linux, SGI, Mac OS X, and Windows95/98/2000/XP operating systems. STK realtime SKINI control input via piping is possible under Linux, SGI, Mac OS X, and Windows2000/XP only.
\code <P>
demo BeeThree -or < scores\bookert.ski 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:
\endcode
\code
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. demo instrument flags
\endcode
\section tcl Realtime Control Input using Tcl/Tk Graphical User Interfaces: where instruments include those described above and flags can be any or all of:
<UL>
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 wish80 executable to the name <I>wish</I>). The PhysicalDemo script just implements the following command-line sequence: <LI><I>-or</I> for realtime audio output,</LI>
<LI><I>-ow <file name></I> for WAV soundfile output,</LI>
\code <LI><I>-os <file name></I> for SND (AU) soundfile output,</LI>
wish < tcl/Physical.tcl | demo Clarinet -or -ip <LI><I>-om <file name></I> for MAT-file output,</LI>
\endcode <LI><I>-ip</I> for realtime SKINI control input via piping,</LI>
<LI><I>-is <port></I> > for realtime SKINI control input via socketing (with an optional port number),</LI>
On WindowsXX and Unix platforms, the following operations are necessary to establish a socket connection between the Tcl/Tk GUI and the STK program: <LI><I>-im <file name></I> for MIDI control input</LI>
<OL> <LI><I>-s RATE</I> to specify a sample rate</LI>
<LI>Open a DOS shell and start the STK program with the <I>-is</I> flag (ex. <I><B>demo Clarinet -or -is</B></I>).</LI> <LI><I>-n NUMBER</I> to specify multivoice polyphony</LI>
<LI>Open the Tcl/Tk GUI (e.g. tcl/Physical.tcl) by double-clicking on it, or type <TT>wish < tcl/Physical.tcl</TT> in another DOS shell.</LI> </UL>
<LI>Establish the socket connection by selecting <I>Socket</I> under the Communications menu item in the Tcl/Tk GUI.</LI> The <-ip> and <-is> flags must be used when piping or socketing realtime SKINI control data to an STK program. The <-im> flag must be used to read MIDI control input from your MIDI port. Note that you can use all three input types simultaneously.
</OL>
Assuming a successful compilation of the <I><B>demo</B></I> program, typing:
Note that it is possible to specify a hostname when establishing the socket connection from the socket client. Thus, the STK socket server program and the Tcl/Tk GUI need not necessarily reside on the same computer.
\code
cat scores/bookert.ski | demo BeeThree -or
\section midi Realtime MIDI Control Input: \endcode
On all supported realtime platforms, you can direct realtime MIDI input to the STK Clarinet by typing: or (on WindowsXX and/or Unix)
\code \code
demo Clarinet -or -im demo BeeThree -or < scores\bookert.ski
\endcode \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.
\section tcl Realtime Control Input using Tcl/Tk Graphical User Interfaces:
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
\endcode
On WindowsXX and Unix platforms, the following operations are necessary to establish a socket connection between the Tcl/Tk GUI and the STK program:
<OL>
<LI>Open a DOS shell and start the STK program with the <I>-is</I> flag (ex. <I><B>demo Clarinet -or -is</B></I>).</LI>
<LI>Open the Tcl/Tk GUI (e.g. tcl/Physical.tcl) by double-clicking on it, or type <TT>wish < tcl/Physical.tcl</TT> in another DOS shell.</LI>
<LI>Establish the socket connection by selecting <I>Socket</I> under the Communications menu item in the Tcl/Tk GUI.</LI>
</OL>
Note that it is possible to specify a hostname when establishing the socket connection from the socket client. Thus, the STK socket server program and the Tcl/Tk GUI need not necessarily reside on the same computer.
\section midi Realtime MIDI Control Input:
On all supported realtime platforms, you can direct realtime MIDI input to the STK Clarinet by typing:
\code
demo Clarinet -or -im
\endcode
\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:
\code
demo BeeThree -n 8 -or -im
\endcode
*/

View File

@@ -1,88 +1,88 @@
/***************************************************/ /***************************************************/
/*! \class ADSR /*! \class ADSR
\brief STK ADSR envelope class. \brief STK ADSR envelope class.
This Envelope subclass implements a This Envelope subclass implements a
traditional ADSR (Attack, Decay, traditional ADSR (Attack, Decay,
Sustain, Release) envelope. It Sustain, Release) envelope. It
responds to simple keyOn and keyOff responds to simple keyOn and keyOff
messages, keeping track of its state. messages, keeping track of its state.
The \e state = ADSR::DONE after the The \e state = ADSR::DONE after the
envelope value reaches 0.0 in the envelope value reaches 0.0 in the
ADSR::RELEASE state. ADSR::RELEASE state.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__ADSR_H) #if !defined(__ADSR_H)
#define __ADSR_H #define __ADSR_H
#include "Envelope.h" #include "Envelope.h"
class ADSR : public Envelope class ADSR : public Envelope
{ {
public: public:
//! Envelope states. //! Envelope states.
enum { ATTACK, DECAY, SUSTAIN, RELEASE, DONE }; enum { ATTACK, DECAY, SUSTAIN, RELEASE, DONE };
//! Default constructor. //! Default constructor.
ADSR(void); ADSR(void);
//! Class destructor. //! Class destructor.
~ADSR(void); ~ADSR(void);
//! Set target = 1, state = \e ADSR::ATTACK. //! Set target = 1, state = \e ADSR::ATTACK.
void keyOn(void); void keyOn(void);
//! Set target = 0, state = \e ADSR::RELEASE. //! Set target = 0, state = \e ADSR::RELEASE.
void keyOff(void); void keyOff(void);
//! Set the attack rate. //! Set the attack rate.
void setAttackRate(MY_FLOAT aRate); void setAttackRate(MY_FLOAT aRate);
//! Set the decay rate. //! Set the decay rate.
void setDecayRate(MY_FLOAT aRate); void setDecayRate(MY_FLOAT aRate);
//! Set the sustain level. //! Set the sustain level.
void setSustainLevel(MY_FLOAT aLevel); void setSustainLevel(MY_FLOAT aLevel);
//! Set the release rate. //! Set the release rate.
void setReleaseRate(MY_FLOAT aRate); void setReleaseRate(MY_FLOAT aRate);
//! Set the attack rate based on a time duration. //! Set the attack rate based on a time duration.
void setAttackTime(MY_FLOAT aTime); void setAttackTime(MY_FLOAT aTime);
//! Set the decay rate based on a time duration. //! Set the decay rate based on a time duration.
void setDecayTime(MY_FLOAT aTime); void setDecayTime(MY_FLOAT aTime);
//! Set the release rate based on a time duration. //! Set the release rate based on a time duration.
void setReleaseTime(MY_FLOAT aTime); void setReleaseTime(MY_FLOAT aTime);
//! Set sustain level and attack, decay, and release state rates based on time durations. //! Set sustain level and attack, decay, and release state rates based on time durations.
void setAllTimes(MY_FLOAT aTime, MY_FLOAT dTime, MY_FLOAT sLevel, MY_FLOAT rTime); void setAllTimes(MY_FLOAT aTime, MY_FLOAT dTime, MY_FLOAT sLevel, MY_FLOAT rTime);
//! Set the target value. //! Set the target value.
void setTarget(MY_FLOAT aTarget); void setTarget(MY_FLOAT aTarget);
//! Return the current envelope \e state (ATTACK, DECAY, SUSTAIN, RELEASE, DONE). //! Return the current envelope \e state (ATTACK, DECAY, SUSTAIN, RELEASE, DONE).
int getState(void) const; int getState(void) const;
//! Set to state = ADSR::SUSTAIN with current and target values of \e aValue. //! Set to state = ADSR::SUSTAIN with current and target values of \e aValue.
void setValue(MY_FLOAT aValue); void setValue(MY_FLOAT aValue);
//! Return one envelope output value. //! Return one envelope output value.
MY_FLOAT tick(void); MY_FLOAT tick(void);
//! Return \e vectorSize envelope outputs in \e vector. //! Return \e vectorSize envelope outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected: protected:
MY_FLOAT attackRate; MY_FLOAT attackRate;
MY_FLOAT decayRate; MY_FLOAT decayRate;
MY_FLOAT sustainLevel; MY_FLOAT sustainLevel;
MY_FLOAT releaseRate; MY_FLOAT releaseRate;
}; };
#endif #endif

View File

@@ -32,10 +32,10 @@
#if !defined(__BANDEDWG_H) #if !defined(__BANDEDWG_H)
#define __BANDEDWG_H #define __BANDEDWG_H
#define MAX_BANDED_MODES 17 #define MAX_BANDED_MODES 20
#include "Instrmnt.h" #include "Instrmnt.h"
#include "Delay.h" #include "DelayL.h"
#include "BowTabl.h" #include "BowTabl.h"
#include "ADSR.h" #include "ADSR.h"
#include "BiQuad.h" #include "BiQuad.h"
@@ -91,16 +91,20 @@ class BandedWG : public Instrmnt
BowTabl *bowTabl; BowTabl *bowTabl;
ADSR *adsr; ADSR *adsr;
BiQuad *bandpass; BiQuad *bandpass;
Delay *delay; DelayL *delay;
MY_FLOAT maxVelocity; MY_FLOAT maxVelocity;
MY_FLOAT modes[MAX_BANDED_MODES]; MY_FLOAT modes[MAX_BANDED_MODES];
MY_FLOAT freakency; MY_FLOAT freakency;
MY_FLOAT baseGain; MY_FLOAT baseGain;
MY_FLOAT gains[MAX_BANDED_MODES]; MY_FLOAT gains[MAX_BANDED_MODES];
MY_FLOAT basegains[MAX_BANDED_MODES];
MY_FLOAT excitation[MAX_BANDED_MODES];
MY_FLOAT integrationConstant; MY_FLOAT integrationConstant;
MY_FLOAT velocityInput;
MY_FLOAT bowVelocity; MY_FLOAT bowVelocity;
MY_FLOAT bowTarget; MY_FLOAT bowTarget;
MY_FLOAT bowPosition; MY_FLOAT bowPosition;
MY_FLOAT strikeAmp;
int strikePosition; int strikePosition;
}; };

View File

@@ -1,100 +1,100 @@
/***************************************************/ /***************************************************/
/*! \class BiQuad /*! \class BiQuad
\brief STK biquad (two-pole, two-zero) filter class. \brief STK biquad (two-pole, two-zero) filter class.
This protected Filter subclass implements a This protected Filter subclass implements a
two-pole, two-zero digital filter. A method two-pole, two-zero digital filter. A method
is provided for creating a resonance in the is provided for creating a resonance in the
frequency response while maintaining a constant frequency response while maintaining a constant
filter gain. filter gain.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__BIQUAD_H) #if !defined(__BIQUAD_H)
#define __BIQUAD_H #define __BIQUAD_H
#include "Filter.h" #include "Filter.h"
class BiQuad : protected Filter class BiQuad : protected Filter
{ {
public: public:
//! Default constructor creates a second-order pass-through filter. //! Default constructor creates a second-order pass-through filter.
BiQuad(); BiQuad();
//! Class destructor. //! Class destructor.
virtual ~BiQuad(); virtual ~BiQuad();
//! Clears all internal states of the filter. //! Clears all internal states of the filter.
void clear(void); void clear(void);
//! Set the b[0] coefficient value. //! Set the b[0] coefficient value.
void setB0(MY_FLOAT b0); void setB0(MY_FLOAT b0);
//! Set the b[1] coefficient value. //! Set the b[1] coefficient value.
void setB1(MY_FLOAT b1); void setB1(MY_FLOAT b1);
//! Set the b[2] coefficient value. //! Set the b[2] coefficient value.
void setB2(MY_FLOAT b2); void setB2(MY_FLOAT b2);
//! Set the a[1] coefficient value. //! Set the a[1] coefficient value.
void setA1(MY_FLOAT a1); void setA1(MY_FLOAT a1);
//! Set the a[2] coefficient value. //! Set the a[2] coefficient value.
void setA2(MY_FLOAT a2); void setA2(MY_FLOAT a2);
//! Sets the filter coefficients for a resonance at \e frequency (in Hz). //! Sets the filter coefficients for a resonance at \e frequency (in Hz).
/*! /*!
This method determines the filter coefficients corresponding to This method determines the filter coefficients corresponding to
two complex-conjugate poles with the given \e frequency (in Hz) two complex-conjugate poles with the given \e frequency (in Hz)
and \e radius from the z-plane origin. If \e normalize is true, and \e radius from the z-plane origin. If \e normalize is true,
the filter zeros are placed at z = 1, z = -1, and the coefficients the filter zeros are placed at z = 1, z = -1, and the coefficients
are then normalized to produce a constant unity peak gain are then normalized to produce a constant unity peak gain
(independent of the filter \e gain parameter). The resulting (independent of the filter \e gain parameter). The resulting
filter frequency response has a resonance at the given \e filter frequency response has a resonance at the given \e
frequency. The closer the poles are to the unit-circle (\e radius frequency. The closer the poles are to the unit-circle (\e radius
close to one), the narrower the resulting resonance width. close to one), the narrower the resulting resonance width.
*/ */
void setResonance(MY_FLOAT frequency, MY_FLOAT radius, bool normalize = FALSE); void setResonance(MY_FLOAT frequency, MY_FLOAT radius, bool normalize = FALSE);
//! Set the filter coefficients for a notch at \e frequency (in Hz). //! Set the filter coefficients for a notch at \e frequency (in Hz).
/*! /*!
This method determines the filter coefficients corresponding to This method determines the filter coefficients corresponding to
two complex-conjugate zeros with the given \e frequency (in Hz) two complex-conjugate zeros with the given \e frequency (in Hz)
and \e radius from the z-plane origin. No filter normalization and \e radius from the z-plane origin. No filter normalization
is attempted. is attempted.
*/ */
void setNotch(MY_FLOAT frequency, MY_FLOAT radius); void setNotch(MY_FLOAT frequency, MY_FLOAT radius);
//! Sets the filter zeroes for equal resonance gain. //! Sets the filter zeroes for equal resonance gain.
/*! /*!
When using the filter as a resonator, zeroes places at z = 1, z When using the filter as a resonator, zeroes places at z = 1, z
= -1 will result in a constant gain at resonance of 1 / (1 - R), = -1 will result in a constant gain at resonance of 1 / (1 - R),
where R is the pole radius setting. where R is the pole radius setting.
*/ */
void setEqualGainZeroes(); void setEqualGainZeroes();
//! Set the filter gain. //! Set the filter gain.
/*! /*!
The gain is applied at the filter input and does not affect the The gain is applied at the filter input and does not affect the
coefficient values. The default gain value is 1.0. coefficient values. The default gain value is 1.0.
*/ */
void setGain(MY_FLOAT theGain); void setGain(MY_FLOAT theGain);
//! Return the current filter gain. //! Return the current filter gain.
MY_FLOAT getGain(void) const; MY_FLOAT getGain(void) const;
//! Return the last computed output value. //! Return the last computed output value.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Input one sample to the filter and return one output. //! Input one sample to the filter and return one output.
MY_FLOAT tick(MY_FLOAT sample); MY_FLOAT tick(MY_FLOAT sample);
//! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector. //! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
}; };
#endif #endif

View File

@@ -1,77 +1,77 @@
/***************************************************/ /***************************************************/
/*! \class BlowBotl /*! \class BlowBotl
\brief STK blown bottle instrument class. \brief STK blown bottle instrument class.
This class implements a helmholtz resonator This class implements a helmholtz resonator
(biquad filter) with a polynomial jet (biquad filter) with a polynomial jet
excitation (a la Cook). excitation (a la Cook).
Control Change Numbers: Control Change Numbers:
- Noise Gain = 4 - Noise Gain = 4
- Vibrato Frequency = 11 - Vibrato Frequency = 11
- Vibrato Gain = 1 - Vibrato Gain = 1
- Volume = 128 - Volume = 128
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__BOTTLE_H) #if !defined(__BOTTLE_H)
#define __BOTTLE_H #define __BOTTLE_H
#include "Instrmnt.h" #include "Instrmnt.h"
#include "JetTabl.h" #include "JetTabl.h"
#include "BiQuad.h" #include "BiQuad.h"
#include "PoleZero.h" #include "PoleZero.h"
#include "Noise.h" #include "Noise.h"
#include "ADSR.h" #include "ADSR.h"
#include "WaveLoop.h" #include "WaveLoop.h"
class BlowBotl : public Instrmnt class BlowBotl : public Instrmnt
{ {
public: public:
//! Class constructor. //! Class constructor.
BlowBotl(); BlowBotl();
//! Class destructor. //! Class destructor.
~BlowBotl(); ~BlowBotl();
//! Reset and clear all internal state. //! Reset and clear all internal state.
void clear(); void clear();
//! Set instrument parameters for a particular frequency. //! Set instrument parameters for a particular frequency.
void setFrequency(MY_FLOAT frequency); void setFrequency(MY_FLOAT frequency);
//! Apply breath velocity to instrument with given amplitude and rate of increase. //! Apply breath velocity to instrument with given amplitude and rate of increase.
void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate); void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate);
//! Decrease breath velocity with given rate of decrease. //! Decrease breath velocity with given rate of decrease.
void stopBlowing(MY_FLOAT rate); void stopBlowing(MY_FLOAT rate);
//! Start a note with the given frequency and amplitude. //! Start a note with the given frequency and amplitude.
void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude);
//! Stop a note with the given amplitude (speed of decay). //! Stop a note with the given amplitude (speed of decay).
void noteOff(MY_FLOAT amplitude); void noteOff(MY_FLOAT amplitude);
//! Compute one output sample. //! Compute one output sample.
MY_FLOAT tick(); MY_FLOAT tick();
//! Perform the control change specified by \e number and \e value (0.0 - 128.0). //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
void controlChange(int number, MY_FLOAT value); void controlChange(int number, MY_FLOAT value);
protected: protected:
JetTabl *jetTable; JetTabl *jetTable;
BiQuad *resonator; BiQuad *resonator;
PoleZero *dcBlock; PoleZero *dcBlock;
Noise *noise; Noise *noise;
ADSR *adsr; ADSR *adsr;
WaveLoop *vibrato; WaveLoop *vibrato;
MY_FLOAT maxPressure; MY_FLOAT maxPressure;
MY_FLOAT noiseGain; MY_FLOAT noiseGain;
MY_FLOAT vibratoGain; MY_FLOAT vibratoGain;
MY_FLOAT outputGain; MY_FLOAT outputGain;
}; };
#endif #endif

View File

@@ -1,62 +1,62 @@
/***************************************************/ /***************************************************/
/*! \class BowTabl /*! \class BowTabl
\brief STK bowed string table class. \brief STK bowed string table class.
This class implements a simple bowed string This class implements a simple bowed string
non-linear function, as described by Smith (1986). non-linear function, as described by Smith (1986).
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__BOWTABL_H) #if !defined(__BOWTABL_H)
#define __BOWTABL_H #define __BOWTABL_H
#include "Stk.h" #include "Stk.h"
class BowTabl : public Stk class BowTabl : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
BowTabl(); BowTabl();
//! Class destructor. //! Class destructor.
~BowTabl(); ~BowTabl();
//! Set the table offset value. //! Set the table offset value.
/*! /*!
The table offset is a bias which controls the The table offset is a bias which controls the
symmetry of the friction. If you want the symmetry of the friction. If you want the
friction to vary with direction, use a non-zero friction to vary with direction, use a non-zero
value for the offset. The default value is zero. value for the offset. The default value is zero.
*/ */
void setOffset(MY_FLOAT aValue); void setOffset(MY_FLOAT aValue);
//! Set the table slope value. //! Set the table slope value.
/*! /*!
The table slope controls the width of the friction The table slope controls the width of the friction
pulse, which is related to bow force. pulse, which is related to bow force.
*/ */
void setSlope(MY_FLOAT aValue); void setSlope(MY_FLOAT aValue);
//! Return the last output value. //! Return the last output value.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Return the function value for \e input. //! Return the function value for \e input.
/*! /*!
The function input represents differential The function input represents differential
string-to-bow velocity. string-to-bow velocity.
*/ */
MY_FLOAT tick(const MY_FLOAT input); MY_FLOAT tick(const MY_FLOAT input);
//! Take \e vectorSize inputs and return the corresponding function values in \e vector. //! Take \e vectorSize inputs and return the corresponding function values in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected: protected:
MY_FLOAT offSet; MY_FLOAT offSet;
MY_FLOAT slope; MY_FLOAT slope;
MY_FLOAT lastOutput; MY_FLOAT lastOutput;
}; };
#endif #endif

View File

@@ -1,83 +1,83 @@
/***************************************************/ /***************************************************/
/*! \class Clarinet /*! \class Clarinet
\brief STK clarinet physical model class. \brief STK clarinet physical model class.
This class implements a simple clarinet This class implements a simple clarinet
physical model, as discussed by Smith (1986), physical model, as discussed by Smith (1986),
McIntyre, Schumacher, Woodhouse (1983), and McIntyre, Schumacher, Woodhouse (1983), and
others. others.
This is a digital waveguide model, making its This is a digital waveguide model, making its
use possibly subject to patents held by Stanford use possibly subject to patents held by Stanford
University, Yamaha, and others. University, Yamaha, and others.
Control Change Numbers: Control Change Numbers:
- Reed Stiffness = 2 - Reed Stiffness = 2
- Noise Gain = 4 - Noise Gain = 4
- Vibrato Frequency = 11 - Vibrato Frequency = 11
- Vibrato Gain = 1 - Vibrato Gain = 1
- Breath Pressure = 128 - Breath Pressure = 128
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__CLARINET_H) #if !defined(__CLARINET_H)
#define __CLARINET_H #define __CLARINET_H
#include "Instrmnt.h" #include "Instrmnt.h"
#include "DelayL.h" #include "DelayL.h"
#include "ReedTabl.h" #include "ReedTabl.h"
#include "OneZero.h" #include "OneZero.h"
#include "Envelope.h" #include "Envelope.h"
#include "Noise.h" #include "Noise.h"
#include "WaveLoop.h" #include "WaveLoop.h"
class Clarinet : public Instrmnt class Clarinet : public Instrmnt
{ {
public: public:
//! Class constructor, taking the lowest desired playing frequency. //! Class constructor, taking the lowest desired playing frequency.
Clarinet(MY_FLOAT lowestFrequency); Clarinet(MY_FLOAT lowestFrequency);
//! Class destructor. //! Class destructor.
~Clarinet(); ~Clarinet();
//! Reset and clear all internal state. //! Reset and clear all internal state.
void clear(); void clear();
//! Set instrument parameters for a particular frequency. //! Set instrument parameters for a particular frequency.
void setFrequency(MY_FLOAT frequency); void setFrequency(MY_FLOAT frequency);
//! Apply breath pressure to instrument with given amplitude and rate of increase. //! Apply breath pressure to instrument with given amplitude and rate of increase.
void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate); void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate);
//! Decrease breath pressure with given rate of decrease. //! Decrease breath pressure with given rate of decrease.
void stopBlowing(MY_FLOAT rate); void stopBlowing(MY_FLOAT rate);
//! Start a note with the given frequency and amplitude. //! Start a note with the given frequency and amplitude.
void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude);
//! Stop a note with the given amplitude (speed of decay). //! Stop a note with the given amplitude (speed of decay).
void noteOff(MY_FLOAT amplitude); void noteOff(MY_FLOAT amplitude);
//! Compute one output sample. //! Compute one output sample.
MY_FLOAT tick(); MY_FLOAT tick();
//! Perform the control change specified by \e number and \e value (0.0 - 128.0). //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
void controlChange(int number, MY_FLOAT value); void controlChange(int number, MY_FLOAT value);
protected: protected:
DelayL *delayLine; DelayL *delayLine;
ReedTabl *reedTable; ReedTabl *reedTable;
OneZero *filter; OneZero *filter;
Envelope *envelope; Envelope *envelope;
Noise *noise; Noise *noise;
WaveLoop *vibrato; WaveLoop *vibrato;
long length; long length;
MY_FLOAT outputGain; MY_FLOAT outputGain;
MY_FLOAT noiseGain; MY_FLOAT noiseGain;
MY_FLOAT vibratoGain; MY_FLOAT vibratoGain;
}; };
#endif #endif

View File

@@ -1,77 +1,83 @@
/***************************************************/ /***************************************************/
/*! \class Delay /*! \class Delay
\brief STK non-interpolating delay line class. \brief STK non-interpolating delay line class.
This protected Filter subclass implements This protected Filter subclass implements
a non-interpolating digital delay-line. a non-interpolating digital delay-line.
A fixed maximum length of 4095 and a delay A fixed maximum length of 4095 and a delay
of zero is set using the default constructor. of zero is set using the default constructor.
Alternatively, the delay and maximum length Alternatively, the delay and maximum length
can be set during instantiation with an can be set during instantiation with an
overloaded constructor. overloaded constructor.
A non-interpolating delay line is typically A non-interpolating delay line is typically
used in fixed delay-length applications, such used in fixed delay-length applications, such
as for reverberation. as for reverberation.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__DELAY_H) #if !defined(__DELAY_H)
#define __DELAY_H #define __DELAY_H
#include "Filter.h" #include "Filter.h"
class Delay : protected Filter class Delay : protected Filter
{ {
public: public:
//! Default constructor creates a delay-line with maximum length of 4095 samples and zero delay. //! Default constructor creates a delay-line with maximum length of 4095 samples and zero delay.
Delay(); Delay();
//! Overloaded constructor which specifies the current and maximum delay-line lengths. //! Overloaded constructor which specifies the current and maximum delay-line lengths.
Delay(long theDelay, long maxDelay); Delay(long theDelay, long maxDelay);
//! Class destructor. //! Class destructor.
virtual ~Delay(); virtual ~Delay();
//! Clears the internal state of the delay line. //! Clears the internal state of the delay line.
void clear(); void clear();
//! Set the delay-line length. //! Set the delay-line length.
/*! /*!
The valid range for \e theDelay is from 0 to the maximum delay-line length. The valid range for \e theDelay is from 0 to the maximum delay-line length.
*/ */
void setDelay(long theDelay); void setDelay(long theDelay);
//! Return the current delay-line length. //! Return the current delay-line length.
long getDelay(void) const; long getDelay(void) const;
//! Calculate and return the signal energy in the delay-line. //! Calculate and return the signal energy in the delay-line.
MY_FLOAT energy(void) const; MY_FLOAT energy(void) const;
//! Return the value at \e tapDelay samples from the delay-line input. //! Return the value at \e tapDelay samples from the delay-line input.
/*! /*!
The valid range for \e tapDelay is 1 to the delay-line length. The valid range for \e tapDelay is 1 to the delay-line length.
*/ */
MY_FLOAT contentsAt(long tapDelay) const; MY_FLOAT contentsAt(long tapDelay) const;
//! Return the last computed output value. //! Return the last computed output value.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Input one sample to the delay-line and return one output. //! Return the value which will be output by the next call to tick().
virtual MY_FLOAT tick(MY_FLOAT sample); /*!
This method is valid only for delay settings greater than zero!
//! Input \e vectorSize samples to the delay-line and return an equal number of outputs in \e vector. */
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); virtual MY_FLOAT nextOut(void) const;
protected: //! Input one sample to the delay-line and return one output.
long inPoint; virtual MY_FLOAT tick(MY_FLOAT sample);
long outPoint;
long length; //! Input \e vectorSize samples to the delay-line and return an equal number of outputs in \e vector.
MY_FLOAT delay; virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
};
protected:
#endif long inPoint;
long outPoint;
long length;
MY_FLOAT delay;
};
#endif

View File

@@ -1,65 +1,73 @@
/***************************************************/ /***************************************************/
/*! \class DelayA /*! \class DelayA
\brief STK allpass interpolating delay line class. \brief STK allpass interpolating delay line class.
This Delay subclass implements a fractional- This Delay subclass implements a fractional-
length digital delay-line using a first-order length digital delay-line using a first-order
allpass filter. A fixed maximum length allpass filter. A fixed maximum length
of 4095 and a delay of 0.5 is set using the of 4095 and a delay of 0.5 is set using the
default constructor. Alternatively, the default constructor. Alternatively, the
delay and maximum length can be set during delay and maximum length can be set during
instantiation with an overloaded constructor. instantiation with an overloaded constructor.
An allpass filter has unity magnitude gain but An allpass filter has unity magnitude gain but
variable phase delay properties, making it useful variable phase delay properties, making it useful
in achieving fractional delays without affecting in achieving fractional delays without affecting
a signal's frequency magnitude response. In a signal's frequency magnitude response. In
order to achieve a maximally flat phase delay order to achieve a maximally flat phase delay
response, the minimum delay possible in this response, the minimum delay possible in this
implementation is limited to a value of 0.5. implementation is limited to a value of 0.5.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__DelayA_h) #if !defined(__DelayA_h)
#define __DelayA_h #define __DelayA_h
#include "Delay.h" #include "Delay.h"
class DelayA : public Delay class DelayA : public Delay
{ {
public: public:
//! Default constructor creates a delay-line with maximum length of 4095 samples and zero delay. //! Default constructor creates a delay-line with maximum length of 4095 samples and zero delay.
DelayA(); DelayA();
//! Overloaded constructor which specifies the current and maximum delay-line lengths. //! Overloaded constructor which specifies the current and maximum delay-line lengths.
DelayA(MY_FLOAT theDelay, long maxDelay); DelayA(MY_FLOAT theDelay, long maxDelay);
//! Class destructor. //! Class destructor.
~DelayA(); ~DelayA();
//! Clears the internal state of the delay line. //! Clears the internal state of the delay line.
void clear(); void clear();
//! Set the delay-line length //! Set the delay-line length
/*! /*!
The valid range for \e theDelay is from 0.5 to the maximum delay-line length. The valid range for \e theDelay is from 0.5 to the maximum delay-line length.
*/ */
void setDelay(MY_FLOAT theDelay); void setDelay(MY_FLOAT theDelay);
//! Return the current delay-line length. //! Return the current delay-line length.
MY_FLOAT getDelay(void); MY_FLOAT getDelay(void);
//! Input one sample to the delay-line and return one output. //! Return the value which will be output by the next call to tick().
MY_FLOAT tick(MY_FLOAT sample); /*!
This method is valid only for delay settings greater than zero!
protected: */
MY_FLOAT alpha; MY_FLOAT nextOut(void);
MY_FLOAT coeff;
MY_FLOAT apInput; //! Input one sample to the delay-line and return one output.
}; MY_FLOAT tick(MY_FLOAT sample);
#endif protected:
MY_FLOAT alpha;
MY_FLOAT coeff;
MY_FLOAT apInput;
MY_FLOAT nextOutput;
bool doNextOut;
};
#endif

View File

@@ -1,61 +1,69 @@
/***************************************************/ /***************************************************/
/*! \class DelayL /*! \class DelayL
\brief STK linear interpolating delay line class. \brief STK linear interpolating delay line class.
This Delay subclass implements a fractional- This Delay subclass implements a fractional-
length digital delay-line using first-order length digital delay-line using first-order
linear interpolation. A fixed maximum length linear interpolation. A fixed maximum length
of 4095 and a delay of zero is set using the of 4095 and a delay of zero is set using the
default constructor. Alternatively, the default constructor. Alternatively, the
delay and maximum length can be set during delay and maximum length can be set during
instantiation with an overloaded constructor. instantiation with an overloaded constructor.
Linear interpolation is an efficient technique Linear interpolation is an efficient technique
for achieving fractional delay lengths, though for achieving fractional delay lengths, though
it does introduce high-frequency signal it does introduce high-frequency signal
attenuation to varying degrees depending on the attenuation to varying degrees depending on the
fractional delay setting. The use of higher fractional delay setting. The use of higher
order Lagrange interpolators can typically order Lagrange interpolators can typically
improve (minimize) this attenuation characteristic. improve (minimize) this attenuation characteristic.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__DELAYL_H) #if !defined(__DELAYL_H)
#define __DELAYL_H #define __DELAYL_H
#include "Delay.h" #include "Delay.h"
class DelayL : public Delay class DelayL : public Delay
{ {
public: public:
//! Default constructor creates a delay-line with maximum length of 4095 samples and zero delay. //! Default constructor creates a delay-line with maximum length of 4095 samples and zero delay.
DelayL(); DelayL();
//! Overloaded constructor which specifies the current and maximum delay-line lengths. //! Overloaded constructor which specifies the current and maximum delay-line lengths.
DelayL(MY_FLOAT theDelay, long maxDelay); DelayL(MY_FLOAT theDelay, long maxDelay);
//! Class destructor. //! Class destructor.
~DelayL(); ~DelayL();
//! Set the delay-line length. //! Set the delay-line length.
/*! /*!
The valid range for \e theDelay is from 0 to the maximum delay-line length. The valid range for \e theDelay is from 0 to the maximum delay-line length.
*/ */
void setDelay(MY_FLOAT theDelay); void setDelay(MY_FLOAT theDelay);
//! Return the current delay-line length. //! Return the current delay-line length.
MY_FLOAT getDelay(void) const; MY_FLOAT getDelay(void) const;
//! Input one sample to the delay-line and return one output. //! Return the value which will be output by the next call to tick().
MY_FLOAT tick(MY_FLOAT sample); /*!
This method is valid only for delay settings greater than zero!
protected: */
MY_FLOAT alpha; MY_FLOAT nextOut(void);
MY_FLOAT omAlpha;
}; //! Input one sample to the delay-line and return one output.
MY_FLOAT tick(MY_FLOAT sample);
#endif
protected:
MY_FLOAT alpha;
MY_FLOAT omAlpha;
MY_FLOAT nextOutput;
bool doNextOut;
};
#endif

View File

@@ -1,68 +1,68 @@
/***************************************************/ /***************************************************/
/*! \class Envelope /*! \class Envelope
\brief STK envelope base class. \brief STK envelope base class.
This class implements a simple envelope This class implements a simple envelope
generator which is capable of ramping to generator which is capable of ramping to
a target value by a specified \e rate. a target value by a specified \e rate.
It also responds to simple \e keyOn and It also responds to simple \e keyOn and
\e keyOff messages, ramping to 1.0 on \e keyOff messages, ramping to 1.0 on
keyOn and to 0.0 on keyOff. keyOn and to 0.0 on keyOff.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__ENVELOPE_H) #if !defined(__ENVELOPE_H)
#define __ENVELOPE_H #define __ENVELOPE_H
#include "Stk.h" #include "Stk.h"
class Envelope : public Stk class Envelope : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
Envelope(void); Envelope(void);
//! Class destructor. //! Class destructor.
virtual ~Envelope(void); virtual ~Envelope(void);
//! Set target = 1. //! Set target = 1.
virtual void keyOn(void); virtual void keyOn(void);
//! Set target = 0. //! Set target = 0.
virtual void keyOff(void); virtual void keyOff(void);
//! Set the \e rate. //! Set the \e rate.
void setRate(MY_FLOAT aRate); void setRate(MY_FLOAT aRate);
//! Set the \e rate based on a time duration. //! Set the \e rate based on a time duration.
void setTime(MY_FLOAT aTime); void setTime(MY_FLOAT aTime);
//! Set the target value. //! Set the target value.
virtual void setTarget(MY_FLOAT aTarget); virtual void setTarget(MY_FLOAT aTarget);
//! Set current and target values to \e aValue. //! Set current and target values to \e aValue.
virtual void setValue(MY_FLOAT aValue); virtual void setValue(MY_FLOAT aValue);
//! Return the current envelope \e state (0 = at target, 1 otherwise). //! Return the current envelope \e state (0 = at target, 1 otherwise).
virtual int getState(void) const; virtual int getState(void) const;
//! Return one envelope output value. //! Return one envelope output value.
virtual MY_FLOAT tick(void); virtual MY_FLOAT tick(void);
//! Return \e vectorSize envelope outputs in \e vector. //! Return \e vectorSize envelope outputs in \e vector.
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Return the last computed output value. //! Return the last computed output value.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
protected: protected:
MY_FLOAT value; MY_FLOAT value;
MY_FLOAT target; MY_FLOAT target;
MY_FLOAT rate; MY_FLOAT rate;
int state; int state;
}; };
#endif #endif

View File

@@ -1,112 +1,112 @@
/***************************************************/ /***************************************************/
/*! \class Filter /*! \class Filter
\brief STK filter class. \brief STK filter class.
This class implements a generic structure which This class implements a generic structure which
can be used to create a wide range of filters. can be used to create a wide range of filters.
It can function independently or be subclassed It can function independently or be subclassed
to provide more specific controls based on a to provide more specific controls based on a
particular filter type. particular filter type.
In particular, this class implements the standard In particular, this class implements the standard
difference equation: difference equation:
a[0]*y[n] = b[0]*x[n] + ... + b[nb]*x[n-nb] - a[0]*y[n] = b[0]*x[n] + ... + b[nb]*x[n-nb] -
a[1]*y[n-1] - ... - a[na]*y[n-na] a[1]*y[n-1] - ... - a[na]*y[n-na]
If a[0] is not equal to 1, the filter coeffcients If a[0] is not equal to 1, the filter coeffcients
are normalized by a[0]. are normalized by a[0].
The \e gain parameter is applied at the filter The \e gain parameter is applied at the filter
input and does not affect the coefficient values. input and does not affect the coefficient values.
The default gain value is 1.0. This structure The default gain value is 1.0. This structure
results in one extra multiply per computed sample, results in one extra multiply per computed sample,
but allows easy control of the overall filter gain. but allows easy control of the overall filter gain.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__FILTER_H) #if !defined(__FILTER_H)
#define __FILTER_H #define __FILTER_H
#include "Stk.h" #include "Stk.h"
class Filter : public Stk class Filter : public Stk
{ {
public: public:
//! Default constructor creates a zero-order pass-through "filter". //! Default constructor creates a zero-order pass-through "filter".
Filter(void); Filter(void);
//! Overloaded constructor which takes filter coefficients. //! Overloaded constructor which takes filter coefficients.
/*! /*!
An StkError can be thrown if either \e nb or \e na is less than An StkError can be thrown if either \e nb or \e na is less than
one, or if the a[0] coefficient is equal to zero. one, or if the a[0] coefficient is equal to zero.
*/ */
Filter(int nb, MY_FLOAT *bCoefficients, int na, MY_FLOAT *aCoefficients); Filter(int nb, MY_FLOAT *bCoefficients, int na, MY_FLOAT *aCoefficients);
//! Class destructor. //! Class destructor.
virtual ~Filter(void); virtual ~Filter(void);
//! Clears all internal states of the filter. //! Clears all internal states of the filter.
void clear(void); void clear(void);
//! Set filter coefficients. //! Set filter coefficients.
/*! /*!
An StkError can be thrown if either \e nb or \e na is less than An StkError can be thrown if either \e nb or \e na is less than
one, or if the a[0] coefficient is equal to zero. If a[0] is not one, or if the a[0] coefficient is equal to zero. If a[0] is not
equal to 1, the filter coeffcients are normalized by a[0]. equal to 1, the filter coeffcients are normalized by a[0].
*/ */
void setCoefficients(int nb, MY_FLOAT *bCoefficients, int na, MY_FLOAT *aCoefficients); void setCoefficients(int nb, MY_FLOAT *bCoefficients, int na, MY_FLOAT *aCoefficients);
//! Set numerator coefficients. //! Set numerator coefficients.
/*! /*!
An StkError can be thrown if \e nb is less than one. Any An StkError can be thrown if \e nb is less than one. Any
previously set denominator coefficients are left unaffected. previously set denominator coefficients are left unaffected.
Note that the default constructor sets the single denominator Note that the default constructor sets the single denominator
coefficient a[0] to 1.0. coefficient a[0] to 1.0.
*/ */
void setNumerator(int nb, MY_FLOAT *bCoefficients); void setNumerator(int nb, MY_FLOAT *bCoefficients);
//! Set denominator coefficients. //! Set denominator coefficients.
/*! /*!
An StkError can be thrown if \e na is less than one or if the An StkError can be thrown if \e na is less than one or if the
a[0] coefficient is equal to zero. Previously set numerator a[0] coefficient is equal to zero. Previously set numerator
coefficients are unaffected unless a[0] is not equal to 1, in coefficients are unaffected unless a[0] is not equal to 1, in
which case all coeffcients are normalized by a[0]. Note that the which case all coeffcients are normalized by a[0]. Note that the
default constructor sets the single numerator coefficient b[0] default constructor sets the single numerator coefficient b[0]
to 1.0. to 1.0.
*/ */
void setDenominator(int na, MY_FLOAT *aCoefficients); void setDenominator(int na, MY_FLOAT *aCoefficients);
//! Set the filter gain. //! Set the filter gain.
/*! /*!
The gain is applied at the filter input and does not affect the The gain is applied at the filter input and does not affect the
coefficient values. The default gain value is 1.0. coefficient values. The default gain value is 1.0.
*/ */
virtual void setGain(MY_FLOAT theGain); virtual void setGain(MY_FLOAT theGain);
//! Return the current filter gain. //! Return the current filter gain.
virtual MY_FLOAT getGain(void) const; virtual MY_FLOAT getGain(void) const;
//! Return the last computed output value. //! Return the last computed output value.
virtual MY_FLOAT lastOut(void) const; virtual MY_FLOAT lastOut(void) const;
//! Input one sample to the filter and return one output. //! Input one sample to the filter and return one output.
virtual MY_FLOAT tick(MY_FLOAT sample); virtual MY_FLOAT tick(MY_FLOAT sample);
//! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector. //! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector.
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected: protected:
MY_FLOAT gain; MY_FLOAT gain;
int nB; int nB;
int nA; int nA;
MY_FLOAT *b; MY_FLOAT *b;
MY_FLOAT *a; MY_FLOAT *a;
MY_FLOAT *outputs; MY_FLOAT *outputs;
MY_FLOAT *inputs; MY_FLOAT *inputs;
}; };
#endif #endif

View File

@@ -1,93 +1,93 @@
/***************************************************/ /***************************************************/
/*! \class FormSwep /*! \class FormSwep
\brief STK sweepable formant filter class. \brief STK sweepable formant filter class.
This public BiQuad filter subclass implements This public BiQuad filter subclass implements
a formant (resonance) which can be "swept" a formant (resonance) which can be "swept"
over time from one frequency setting to another. over time from one frequency setting to another.
It provides methods for controlling the sweep It provides methods for controlling the sweep
rate and target frequency. rate and target frequency.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__FORMSWEP_H) #if !defined(__FORMSWEP_H)
#define __FORMSWEP_H #define __FORMSWEP_H
#include "BiQuad.h" #include "BiQuad.h"
class FormSwep : public BiQuad class FormSwep : public BiQuad
{ {
public: public:
//! Default constructor creates a second-order pass-through filter. //! Default constructor creates a second-order pass-through filter.
FormSwep(); FormSwep();
//! Class destructor. //! Class destructor.
~FormSwep(); ~FormSwep();
//! Sets the filter coefficients for a resonance at \e frequency (in Hz). //! Sets the filter coefficients for a resonance at \e frequency (in Hz).
/*! /*!
This method determines the filter coefficients corresponding to This method determines the filter coefficients corresponding to
two complex-conjugate poles with the given \e frequency (in Hz) two complex-conjugate poles with the given \e frequency (in Hz)
and \e radius from the z-plane origin. The filter zeros are and \e radius from the z-plane origin. The filter zeros are
placed at z = 1, z = -1, and the coefficients are then normalized to placed at z = 1, z = -1, and the coefficients are then normalized to
produce a constant unity gain (independent of the filter \e gain produce a constant unity gain (independent of the filter \e gain
parameter). The resulting filter frequency response has a parameter). The resulting filter frequency response has a
resonance at the given \e frequency. The closer the poles are to resonance at the given \e frequency. The closer the poles are to
the unit-circle (\e radius close to one), the narrower the the unit-circle (\e radius close to one), the narrower the
resulting resonance width. resulting resonance width.
*/ */
void setResonance(MY_FLOAT aFrequency, MY_FLOAT aRadius); void setResonance(MY_FLOAT aFrequency, MY_FLOAT aRadius);
//! Set both the current and target resonance parameters. //! Set both the current and target resonance parameters.
void setStates(MY_FLOAT aFrequency, MY_FLOAT aRadius, MY_FLOAT aGain = 1.0); void setStates(MY_FLOAT aFrequency, MY_FLOAT aRadius, MY_FLOAT aGain = 1.0);
//! Set target resonance parameters. //! Set target resonance parameters.
void setTargets(MY_FLOAT aFrequency, MY_FLOAT aRadius, MY_FLOAT aGain = 1.0); void setTargets(MY_FLOAT aFrequency, MY_FLOAT aRadius, MY_FLOAT aGain = 1.0);
//! Set the sweep rate (between 0.0 - 1.0). //! Set the sweep rate (between 0.0 - 1.0).
/*! /*!
The formant parameters are varied in increments of the The formant parameters are varied in increments of the
sweep rate between their current and target values. sweep rate between their current and target values.
A sweep rate of 1.0 will produce an immediate change in A sweep rate of 1.0 will produce an immediate change in
resonance parameters from their current values to the resonance parameters from their current values to the
target values. A sweep rate of 0.0 will produce no target values. A sweep rate of 0.0 will produce no
change in resonance parameters. change in resonance parameters.
*/ */
void setSweepRate(MY_FLOAT aRate); void setSweepRate(MY_FLOAT aRate);
//! Set the sweep rate in terms of a time value in seconds. //! Set the sweep rate in terms of a time value in seconds.
/*! /*!
This method adjusts the sweep rate based on a This method adjusts the sweep rate based on a
given time for the formant parameters to reach given time for the formant parameters to reach
their target values. their target values.
*/ */
void setSweepTime(MY_FLOAT aTime); void setSweepTime(MY_FLOAT aTime);
//! Input one sample to the filter and return one output. //! Input one sample to the filter and return one output.
MY_FLOAT tick(MY_FLOAT sample); MY_FLOAT tick(MY_FLOAT sample);
//! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector. //! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected: protected:
bool dirty; bool dirty;
MY_FLOAT frequency; MY_FLOAT frequency;
MY_FLOAT radius; MY_FLOAT radius;
MY_FLOAT startFrequency; MY_FLOAT startFrequency;
MY_FLOAT startRadius; MY_FLOAT startRadius;
MY_FLOAT startGain; MY_FLOAT startGain;
MY_FLOAT targetFrequency; MY_FLOAT targetFrequency;
MY_FLOAT targetRadius; MY_FLOAT targetRadius;
MY_FLOAT targetGain; MY_FLOAT targetGain;
MY_FLOAT deltaFrequency; MY_FLOAT deltaFrequency;
MY_FLOAT deltaRadius; MY_FLOAT deltaRadius;
MY_FLOAT deltaGain; MY_FLOAT deltaGain;
MY_FLOAT sweepState; MY_FLOAT sweepState;
MY_FLOAT sweepRate; MY_FLOAT sweepRate;
}; };
#endif #endif

View File

@@ -1,53 +1,53 @@
/***************************************************/ /***************************************************/
/*! \class Instrmnt /*! \class Instrmnt
\brief STK instrument abstract base class. \brief STK instrument abstract base class.
This class provides a common interface for This class provides a common interface for
all STK instruments. all STK instruments.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__INSTRMNT_H) #if !defined(__INSTRMNT_H)
#define __INSTRMNT_H #define __INSTRMNT_H
#include "Stk.h" #include "Stk.h"
#include <iostream.h> #include <iostream.h>
class Instrmnt : public Stk class Instrmnt : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
Instrmnt(); Instrmnt();
//! Class destructor. //! Class destructor.
virtual ~Instrmnt(); virtual ~Instrmnt();
//! Start a note with the given frequency and amplitude. //! Start a note with the given frequency and amplitude.
virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude) = 0; virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude) = 0;
//! Stop a note with the given amplitude (speed of decay). //! Stop a note with the given amplitude (speed of decay).
virtual void noteOff(MY_FLOAT amplitude) = 0; virtual void noteOff(MY_FLOAT amplitude) = 0;
//! Set instrument parameters for a particular frequency. //! Set instrument parameters for a particular frequency.
virtual void setFrequency(MY_FLOAT frequency); virtual void setFrequency(MY_FLOAT frequency);
//! Return the last output value. //! Return the last output value.
MY_FLOAT lastOut() const; MY_FLOAT lastOut() const;
//! Compute one output sample. //! Compute one output sample.
virtual MY_FLOAT tick() = 0; virtual MY_FLOAT tick() = 0;
//! Computer \e vectorSize outputs and return them in \e vector. //! Computer \e vectorSize outputs and return them in \e vector.
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Perform the control change specified by \e number and \e value (0.0 - 128.0). //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
virtual void controlChange(int number, MY_FLOAT value); virtual void controlChange(int number, MY_FLOAT value);
protected: protected:
MY_FLOAT lastOutput; MY_FLOAT lastOutput;
}; };
#endif #endif

View File

@@ -23,10 +23,10 @@
class JCRev : public Reverb class JCRev : public Reverb
{ {
public: public:
// Class constructor taking a T60 decay time argument. //! Class constructor taking a T60 decay time argument.
JCRev(MY_FLOAT T60); JCRev(MY_FLOAT T60);
// Class destructor. //! Class destructor.
~JCRev(); ~JCRev();
//! Reset and clear all internal state. //! Reset and clear all internal state.

View File

@@ -1,44 +1,44 @@
/***************************************************/ /***************************************************/
/*! \class JetTabl /*! \class JetTabl
\brief STK jet table class. \brief STK jet table class.
This class implements a flue jet non-linear This class implements a flue jet non-linear
function, computed by a polynomial calculation. function, computed by a polynomial calculation.
Contrary to the name, this is not a "table". Contrary to the name, this is not a "table".
Consult Fletcher and Rossing, Karjalainen, Consult Fletcher and Rossing, Karjalainen,
Cook, and others for more information. Cook, and others for more information.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__JETTABL_H) #if !defined(__JETTABL_H)
#define __JETTABL_H #define __JETTABL_H
#include "Stk.h" #include "Stk.h"
class JetTabl : public Stk class JetTabl : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
JetTabl(); JetTabl();
//! Class destructor. //! Class destructor.
~JetTabl(); ~JetTabl();
//! Return the last output value. //! Return the last output value.
MY_FLOAT lastOut() const; MY_FLOAT lastOut() const;
//! Return the function value for \e input. //! Return the function value for \e input.
MY_FLOAT tick(MY_FLOAT input); MY_FLOAT tick(MY_FLOAT input);
//! Take \e vectorSize inputs and return the corresponding function values in \e vector. //! Take \e vectorSize inputs and return the corresponding function values in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected: protected:
MY_FLOAT lastOutput; MY_FLOAT lastOutput;
}; };
#endif #endif

View File

@@ -1,147 +1,147 @@
/***************************************************/ /***************************************************/
/*! \class Messager /*! \class Messager
\brief STK input control message parser. \brief STK input control message parser.
This class reads and parses control messages This class reads and parses control messages
from a variety of sources, such as a MIDI from a variety of sources, such as a MIDI
port, scorefile, socket connection, or pipe. port, scorefile, socket connection, or pipe.
MIDI messages are retrieved using the RtMidi MIDI messages are retrieved using the RtMidi
class. All other input sources (scorefile, class. All other input sources (scorefile,
socket, or pipe) are assumed to provide SKINI socket, or pipe) are assumed to provide SKINI
formatted messages. formatted messages.
For each call to nextMessage(), the active For each call to nextMessage(), the active
input sources are queried to see if a new input sources are queried to see if a new
control message is available. control message is available.
This class is primarily for use in STK main() This class is primarily for use in STK main()
event loops. event loops.
One of the original goals in creating this One of the original goals in creating this
class was to simplify the message acquisition class was to simplify the message acquisition
process by removing all threads. If the process by removing all threads. If the
windoze select() function behaved just like windoze select() function behaved just like
the unix one, that would have been possible. the unix one, that would have been possible.
Since it does not (it can't be used to poll Since it does not (it can't be used to poll
STDIN), I am using a thread to acquire STDIN), I am using a thread to acquire
messages from STDIN, which sends these messages from STDIN, which sends these
messages via a socket connection to the messages via a socket connection to the
message socket server. Perhaps in the future, message socket server. Perhaps in the future,
it will be possible to simplify things. it will be possible to simplify things.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__MESSAGER_H) #if !defined(__MESSAGER_H)
#define __MESSSAGER_H #define __MESSSAGER_H
#include "Stk.h" #include "Stk.h"
#include "SKINI.h" #include "SKINI.h"
#define MESSAGE_LENGTH 128 #define MESSAGE_LENGTH 128
#define MAX_MESSAGES 25 #define MAX_MESSAGES 25
#define STK_MIDI 0x0001
#if defined(__STK_REALTIME__) #define STK_PIPE 0x0002
#define STK_SOCKET 0x0004
#include "Thread.h"
#include "Socket.h" #if defined(__STK_REALTIME__)
#include "RtMidi.h"
#include "Thread.h"
#define STK_MIDI 0x0001 #include "Socket.h"
#define STK_PIPE 0x0002 #include "RtMidi.h"
#define STK_SOCKET 0x0004
extern "C" THREAD_RETURN THREAD_TYPE stdinHandler(void * ptr);
extern "C" THREAD_RETURN THREAD_TYPE stdinHandler(void * ptr);
#if (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__))
#if (defined(__OS_IRIX__) || defined(__OS_LINUX__)) #include <sys/types.h>
#include <sys/types.h> #include <sys/time.h>
#include <sys/time.h> #endif
#endif
#endif // __STK_REALTIME__
#endif // __STK_REALTIME__
class Messager : public Stk
class Messager : public Stk {
{ public:
public: //! Constructor performs initialization based on an input mask and an optional socket port.
//! Constructor performs initialization based on an input mask. /*!
/*! The default constructor is set to read input from a SKINI
The default constructor is set to read input from a SKINI scorefile. The flags STK_MIDI, STK_PIPE, and STK_SOCKET can be
scorefile. The flags STK_MIDI, STK_PIPE, and STK_SOCKET can be OR'ed together in any combination for multiple "realtime" input
OR'ed together in any combination for multiple "realtime" input source parsing. An optional socket port number can be specified
source parsing. For realtime input types, an StkError can be for use when the STK_SOCKET flag is set. For realtime input
thrown during instantiation. types, an StkError can be thrown during instantiation.
*/ */
Messager(int inputMask = 0); Messager(int inputMask = 0, int port = 2001);
//! Class destructor. //! Class destructor.
~Messager(); ~Messager();
//! Check for a new input message and return the message type. //! Check for a new input message and return the message type.
/*! /*!
Return type values greater than zero represent valid messages. Return type values greater than zero represent valid messages.
If an input scorefile has been completely read or all realtime If an input scorefile has been completely read or all realtime
input sources have closed, a negative value is returned. If the input sources have closed, a negative value is returned. If the
return type is zero, no valid messages are present. return type is zero, no valid messages are present.
*/ */
long nextMessage(void); long nextMessage(void);
//! Set the delta time (in samples) returned between valid realtime messages. This setting has no affect for scorefile messages. //! Set the delta time (in samples) returned between valid realtime messages. This setting has no affect for scorefile messages.
void setRtDelta(long nSamples); void setRtDelta(long nSamples);
//! Return the current message "delta time" in samples. //! Return the current message "delta time" in samples.
long getDelta(void) const; long getDelta(void) const;
//! Return the current message type. //! Return the current message type.
long getType() const; long getType() const;
//! Return the byte two value for the current message. //! Return the byte two value for the current message.
MY_FLOAT getByteTwo() const; MY_FLOAT getByteTwo() const;
//! Return the byte three value for the current message. //! Return the byte three value for the current message.
MY_FLOAT getByteThree() const; MY_FLOAT getByteThree() const;
//! Return the channel number for the current message. //! Return the channel number for the current message.
long getChannel() const; long getChannel() const;
protected: protected:
SKINI *skini; SKINI *skini;
long type; long type;
long channel; long channel;
MY_FLOAT byte2; MY_FLOAT byte2;
MY_FLOAT byte3; MY_FLOAT byte3;
int sources; int sources;
long delta; long delta;
long rtDelta; long rtDelta;
char message[MAX_MESSAGES][MESSAGE_LENGTH]; char message[MAX_MESSAGES][MESSAGE_LENGTH];
unsigned int messageIndex; unsigned int messageIndex;
int nMessages; int nMessages;
#if defined(__STK_REALTIME__) #if defined(__STK_REALTIME__)
// Check MIDI source for new messages. // Check MIDI source for new messages.
bool midiMessage(void); bool midiMessage(void);
// Check socket sources for new messages. // Check socket sources for new messages.
bool socketMessage(void); bool socketMessage(void);
// Receive and parse socket data. // Receive and parse socket data.
bool readSocket(int fd); bool readSocket(int fd);
RtMidi *midi; RtMidi *midi;
Thread *thread; Thread *thread;
Socket *soket; Socket *soket;
unsigned int nSockets; unsigned int nSockets;
fd_set mask; fd_set mask;
int maxfd; int maxfd;
int pipefd; int pipefd;
int fd[16]; int fd[16];
char error[256]; char error[256];
#endif // __STK_REALTIME__ #endif // __STK_REALTIME__
}; };
#endif // defined(__MESSAGER_H) #endif // defined(__MESSAGER_H)

View File

@@ -49,7 +49,7 @@ class Modulate : public Stk
MY_FLOAT lastOut() const; MY_FLOAT lastOut() const;
protected: protected:
WaveLoop *vibrato; WaveLoop *vibrato;
SubNoise *noise; SubNoise *noise;
OnePole *filter; OnePole *filter;
MY_FLOAT vibratoGain; MY_FLOAT vibratoGain;

View File

@@ -25,10 +25,10 @@
class NRev : public Reverb class NRev : public Reverb
{ {
public: public:
// Class constructor taking a T60 decay time argument. //! Class constructor taking a T60 decay time argument.
NRev(MY_FLOAT T60); NRev(MY_FLOAT T60);
// Class destructor. //! Class destructor.
~NRev(); ~NRev();
//! Reset and clear all internal state. //! Reset and clear all internal state.

View File

@@ -1,43 +1,43 @@
/***************************************************/ /***************************************************/
/*! \class Noise /*! \class Noise
\brief STK noise generator. \brief STK noise generator.
Generic random number generation using the Generic random number generation using the
C rand() function. The quality of the rand() C rand() function. The quality of the rand()
function varies from one OS to another. function varies from one OS to another.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__NOISE_H) #if !defined(__NOISE_H)
#define __NOISE_H #define __NOISE_H
#include "Stk.h" #include "Stk.h"
class Noise : public Stk class Noise : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
Noise(); Noise();
//! Class destructor. //! Class destructor.
virtual ~Noise(); virtual ~Noise();
//! Return a random number between -1.0 and 1.0 using rand(). //! Return a random number between -1.0 and 1.0 using rand().
virtual MY_FLOAT tick(); virtual MY_FLOAT tick();
//! Return \e vectorSize random numbers between -1.0 and 1.0 in \e vector. //! Return \e vectorSize random numbers between -1.0 and 1.0 in \e vector.
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Return the last computed value. //! Return the last computed value.
MY_FLOAT lastOut() const; MY_FLOAT lastOut() const;
protected: protected:
MY_FLOAT lastOutput; MY_FLOAT lastOutput;
}; };
#endif #endif

View File

@@ -1,72 +1,72 @@
/***************************************************/ /***************************************************/
/*! \class OnePole /*! \class OnePole
\brief STK one-pole filter class. \brief STK one-pole filter class.
This protected Filter subclass implements This protected Filter subclass implements
a one-pole digital filter. A method is a one-pole digital filter. A method is
provided for setting the pole position along provided for setting the pole position along
the real axis of the z-plane while maintaining the real axis of the z-plane while maintaining
a constant peak filter gain. a constant peak filter gain.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__ONEPOLE_H) #if !defined(__ONEPOLE_H)
#define __ONEPOLE_H #define __ONEPOLE_H
#include "Filter.h" #include "Filter.h"
class OnePole : protected Filter class OnePole : protected Filter
{ {
public: public:
//! Default constructor creates a first-order low-pass filter. //! Default constructor creates a first-order low-pass filter.
OnePole(); OnePole();
//! Overloaded constructor which sets the pole position during instantiation. //! Overloaded constructor which sets the pole position during instantiation.
OnePole(MY_FLOAT thePole); OnePole(MY_FLOAT thePole);
//! Class destructor. //! Class destructor.
~OnePole(); ~OnePole();
//! Clears the internal state of the filter. //! Clears the internal state of the filter.
void clear(void); void clear(void);
//! Set the b[0] coefficient value. //! Set the b[0] coefficient value.
void setB0(MY_FLOAT b0); void setB0(MY_FLOAT b0);
//! Set the a[1] coefficient value. //! Set the a[1] coefficient value.
void setA1(MY_FLOAT a1); void setA1(MY_FLOAT a1);
//! Set the pole position in the z-plane. //! Set the pole position in the z-plane.
/*! /*!
This method sets the pole position along the real-axis of the This method sets the pole position along the real-axis of the
z-plane and normalizes the coefficients for a maximum gain of one. z-plane and normalizes the coefficients for a maximum gain of one.
A positive pole value produces a low-pass filter, while a negative A positive pole value produces a low-pass filter, while a negative
pole value produces a high-pass filter. This method does not pole value produces a high-pass filter. This method does not
affect the filter \e gain value. affect the filter \e gain value.
*/ */
void setPole(MY_FLOAT thePole); void setPole(MY_FLOAT thePole);
//! Set the filter gain. //! Set the filter gain.
/*! /*!
The gain is applied at the filter input and does not affect the The gain is applied at the filter input and does not affect the
coefficient values. The default gain value is 1.0. coefficient values. The default gain value is 1.0.
*/ */
void setGain(MY_FLOAT theGain); void setGain(MY_FLOAT theGain);
//! Return the current filter gain. //! Return the current filter gain.
MY_FLOAT getGain(void) const; MY_FLOAT getGain(void) const;
//! Return the last computed output value. //! Return the last computed output value.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Input one sample to the filter and return one output. //! Input one sample to the filter and return one output.
MY_FLOAT tick(MY_FLOAT sample); MY_FLOAT tick(MY_FLOAT sample);
//! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector. //! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
}; };
#endif #endif

View File

@@ -1,72 +1,72 @@
/***************************************************/ /***************************************************/
/*! \class OneZero /*! \class OneZero
\brief STK one-zero filter class. \brief STK one-zero filter class.
This protected Filter subclass implements This protected Filter subclass implements
a one-zero digital filter. A method is a one-zero digital filter. A method is
provided for setting the zero position provided for setting the zero position
along the real axis of the z-plane while along the real axis of the z-plane while
maintaining a constant filter gain. maintaining a constant filter gain.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__ONEZERO_H) #if !defined(__ONEZERO_H)
#define __ONEZERO_H #define __ONEZERO_H
#include "Filter.h" #include "Filter.h"
class OneZero : protected Filter class OneZero : protected Filter
{ {
public: public:
//! Default constructor creates a first-order low-pass filter. //! Default constructor creates a first-order low-pass filter.
OneZero(); OneZero();
//! Overloaded constructor which sets the zero position during instantiation. //! Overloaded constructor which sets the zero position during instantiation.
OneZero(MY_FLOAT theZero); OneZero(MY_FLOAT theZero);
//! Class destructor. //! Class destructor.
~OneZero(); ~OneZero();
//! Clears the internal state of the filter. //! Clears the internal state of the filter.
void clear(void); void clear(void);
//! Set the b[0] coefficient value. //! Set the b[0] coefficient value.
void setB0(MY_FLOAT b0); void setB0(MY_FLOAT b0);
//! Set the b[1] coefficient value. //! Set the b[1] coefficient value.
void setB1(MY_FLOAT b1); void setB1(MY_FLOAT b1);
//! Set the zero position in the z-plane. //! Set the zero position in the z-plane.
/*! /*!
This method sets the zero position along the real-axis of the This method sets the zero position along the real-axis of the
z-plane and normalizes the coefficients for a maximum gain of one. z-plane and normalizes the coefficients for a maximum gain of one.
A positive zero value produces a high-pass filter, while a A positive zero value produces a high-pass filter, while a
negative zero value produces a low-pass filter. This method does negative zero value produces a low-pass filter. This method does
not affect the filter \e gain value. not affect the filter \e gain value.
*/ */
void setZero(MY_FLOAT theZero); void setZero(MY_FLOAT theZero);
//! Set the filter gain. //! Set the filter gain.
/*! /*!
The gain is applied at the filter input and does not affect the The gain is applied at the filter input and does not affect the
coefficient values. The default gain value is 1.0. coefficient values. The default gain value is 1.0.
*/ */
void setGain(MY_FLOAT theGain); void setGain(MY_FLOAT theGain);
//! Return the current filter gain. //! Return the current filter gain.
MY_FLOAT getGain(void) const; MY_FLOAT getGain(void) const;
//! Return the last computed output value. //! Return the last computed output value.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Input one sample to the filter and return one output. //! Input one sample to the filter and return one output.
MY_FLOAT tick(MY_FLOAT sample); MY_FLOAT tick(MY_FLOAT sample);
//! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector. //! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
}; };
#endif #endif

View File

@@ -22,11 +22,11 @@
class PRCRev : public Reverb class PRCRev : public Reverb
{ {
public: public:
// Class constructor taking a T60 decay time argument. //! Class constructor taking a T60 decay time argument.
PRCRev(MY_FLOAT T60); PRCRev(MY_FLOAT T60);
// Class destructor. //! Class destructor.
~PRCRev(); ~PRCRev();
//! Reset and clear all internal state. //! Reset and clear all internal state.
@@ -35,11 +35,11 @@ class PRCRev : public Reverb
//! Compute one output sample. //! Compute one output sample.
MY_FLOAT tick(MY_FLOAT input); MY_FLOAT tick(MY_FLOAT input);
protected: protected:
Delay *allpassDelays[2]; Delay *allpassDelays[2];
Delay *combDelays[2]; Delay *combDelays[2];
MY_FLOAT allpassCoefficient; MY_FLOAT allpassCoefficient;
MY_FLOAT combCoefficient[2]; MY_FLOAT combCoefficient[2];
}; };

51
include/Phonemes.h Normal file
View File

@@ -0,0 +1,51 @@
/***************************************************/
/*! \class Phonemes
\brief STK phonemes table.
This class does nothing other than declare a
set of 32 static phoneme formant parameters
and provide access to those values.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__PHONEMES_H)
#define __PHONEMES_H
#include "Stk.h"
class Phonemes
{
public:
Phonemes(void);
~Phonemes(void);
//! Returns the phoneme name for the given index (0-31).
static const char *name( unsigned int index );
//! Returns the voiced component gain for the given phoneme index (0-31).
static MY_FLOAT voiceGain( unsigned int index );
//! Returns the unvoiced component gain for the given phoneme index (0-31).
static MY_FLOAT noiseGain( unsigned int index );
//! Returns the formant frequency for the given phoneme index (0-31) and partial (0-3).
static MY_FLOAT formantFrequency( unsigned int index, unsigned int partial );
//! Returns the formant radius for the given phoneme index (0-31) and partial (0-3).
static MY_FLOAT formantRadius( unsigned int index, unsigned int partial );
//! Returns the formant gain for the given phoneme index (0-31) and partial (0-3).
static MY_FLOAT formantGain( unsigned int index, unsigned int partial );
private:
static const char phonemeNames[][4];
static const MY_FLOAT phonemeGains[][2];
static const MY_FLOAT phonemeParameters[][4][3];
};
#endif

View File

@@ -43,7 +43,7 @@ class PitShift : public Stk
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected: protected:
Delay *delayLine[2]; DelayL *delayLine[2];
MY_FLOAT lastOutput; MY_FLOAT lastOutput;
MY_FLOAT delay[2]; MY_FLOAT delay[2];
MY_FLOAT env[2]; MY_FLOAT env[2];

View File

@@ -1,70 +1,70 @@
/***************************************************/ /***************************************************/
/*! \class ReedTabl /*! \class ReedTabl
\brief STK reed table class. \brief STK reed table class.
This class implements a simple one breakpoint, This class implements a simple one breakpoint,
non-linear reed function, as described by non-linear reed function, as described by
Smith (1986). This function is based on a Smith (1986). This function is based on a
memoryless non-linear spring model of the reed memoryless non-linear spring model of the reed
(the reed mass is ignored) which saturates when (the reed mass is ignored) which saturates when
the reed collides with the mouthpiece facing. the reed collides with the mouthpiece facing.
See McIntyre, Schumacher, & Woodhouse (1983), See McIntyre, Schumacher, & Woodhouse (1983),
Smith (1986), Hirschman, Cook, Scavone, and Smith (1986), Hirschman, Cook, Scavone, and
others for more information. others for more information.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__REEDTABL_H) #if !defined(__REEDTABL_H)
#define __REEDTABL_H #define __REEDTABL_H
#include "Stk.h" #include "Stk.h"
class ReedTabl : public Stk class ReedTabl : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
ReedTabl(); ReedTabl();
//! Class destructor. //! Class destructor.
~ReedTabl(); ~ReedTabl();
//! Set the table offset value. //! Set the table offset value.
/*! /*!
The table offset roughly corresponds to the size The table offset roughly corresponds to the size
of the initial reed tip opening (a greater offset of the initial reed tip opening (a greater offset
represents a smaller opening). represents a smaller opening).
*/ */
void setOffset(MY_FLOAT aValue); void setOffset(MY_FLOAT aValue);
//! Set the table slope value. //! Set the table slope value.
/*! /*!
The table slope roughly corresponds to the reed The table slope roughly corresponds to the reed
stiffness (a greater slope represents a harder stiffness (a greater slope represents a harder
reed). reed).
*/ */
void setSlope(MY_FLOAT aValue); void setSlope(MY_FLOAT aValue);
//! Return the last output value. //! Return the last output value.
MY_FLOAT lastOut() const; MY_FLOAT lastOut() const;
//! Return the function value for \e input. //! Return the function value for \e input.
/*! /*!
The function input represents the differential The function input represents the differential
pressure across the reeds. pressure across the reeds.
*/ */
MY_FLOAT tick(MY_FLOAT input); MY_FLOAT tick(MY_FLOAT input);
//! Take \e vectorSize inputs and return the corresponding function values in \e vector. //! Take \e vectorSize inputs and return the corresponding function values in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected: protected:
MY_FLOAT offSet; MY_FLOAT offSet;
MY_FLOAT slope; MY_FLOAT slope;
MY_FLOAT lastOutput; MY_FLOAT lastOutput;
}; };
#endif #endif

View File

@@ -1,434 +1,525 @@
/******************************************/ /************************************************************************/
/* /*! \class RtAudio
RtAudio - realtime sound I/O C++ class \brief Realtime audio i/o C++ class.
by Gary P. Scavone, 2001-2002.
*/ RtAudio provides a common API (Application Programming Interface)
/******************************************/ for realtime audio input/output across Linux (native ALSA and
OSS), SGI, Macintosh OS X (CoreAudio), and Windows (DirectSound
#if !defined(__RTAUDIO_H) and ASIO) operating systems.
#define __RTAUDIO_H
RtAudio WWW site: http://www-ccrma.stanford.edu/~gary/rtaudio/
#include <map>
RtAudio: a realtime audio i/o C++ class
#if defined(__LINUX_ALSA__) Copyright (c) 2001-2002 Gary P. Scavone
#include <alsa/asoundlib.h>
#include <pthread.h> Permission is hereby granted, free of charge, to any person
#include <unistd.h> obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
#define THREAD_TYPE including without limitation the rights to use, copy, modify, merge,
typedef snd_pcm_t *AUDIO_HANDLE; publish, distribute, sublicense, and/or sell copies of the Software,
typedef int DEVICE_ID; and to permit persons to whom the Software is furnished to do so,
typedef pthread_t THREAD_HANDLE; subject to the following conditions:
typedef pthread_mutex_t MUTEX;
The above copyright notice and this permission notice shall be
#elif defined(__LINUX_OSS__) included in all copies or substantial portions of the Software.
#include <pthread.h>
#include <unistd.h> Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
#define THREAD_TYPE they can be incorporated into the canonical version.
typedef int AUDIO_HANDLE;
typedef int DEVICE_ID; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
typedef pthread_t THREAD_HANDLE; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
typedef pthread_mutex_t MUTEX; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
#elif defined(__WINDOWS_DS__) ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
#include <windows.h> CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
#include <process.h> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// The following struct is used to hold the extra variables /************************************************************************/
// specific to the DirectSound implementation.
typedef struct { #if !defined(__RTAUDIO_H)
void * object; #define __RTAUDIO_H
void * buffer;
UINT bufferPointer; #include <map>
} AUDIO_HANDLE;
#if defined(__LINUX_ALSA__)
#define THREAD_TYPE __stdcall #include <alsa/asoundlib.h>
typedef LPGUID DEVICE_ID; #include <pthread.h>
typedef unsigned long THREAD_HANDLE; #include <unistd.h>
typedef CRITICAL_SECTION MUTEX;
typedef snd_pcm_t *AUDIO_HANDLE;
#elif defined(__IRIX_AL__) typedef int DEVICE_ID;
#include <dmedia/audio.h> typedef pthread_t THREAD_HANDLE;
#include <pthread.h> typedef pthread_mutex_t MUTEX;
#include <unistd.h>
#elif defined(__LINUX_OSS__)
#define THREAD_TYPE #include <pthread.h>
typedef ALport AUDIO_HANDLE; #include <unistd.h>
typedef int DEVICE_ID;
typedef pthread_t THREAD_HANDLE; typedef int AUDIO_HANDLE;
typedef pthread_mutex_t MUTEX; typedef int DEVICE_ID;
typedef pthread_t THREAD_HANDLE;
#endif typedef pthread_mutex_t MUTEX;
#elif defined(__WINDOWS_DS__)
// *************************************************** // #include <windows.h>
// #include <process.h>
// RtError class declaration.
// // The following struct is used to hold the extra variables
// *************************************************** // // specific to the DirectSound implementation.
typedef struct {
class RtError void * object;
{ void * buffer;
public: UINT bufferPointer;
enum TYPE { } AUDIO_HANDLE;
WARNING,
DEBUG_WARNING, typedef LPGUID DEVICE_ID;
UNSPECIFIED, typedef unsigned long THREAD_HANDLE;
NO_DEVICES_FOUND, typedef CRITICAL_SECTION MUTEX;
INVALID_DEVICE,
INVALID_STREAM, #elif defined(__WINDOWS_ASIO__)
MEMORY_ERROR, #include <windows.h>
INVALID_PARAMETER, #include <process.h>
DRIVER_ERROR,
SYSTEM_ERROR, typedef int AUDIO_HANDLE;
THREAD_ERROR typedef int DEVICE_ID;
}; typedef unsigned long THREAD_HANDLE;
typedef CRITICAL_SECTION MUTEX;
protected:
char error_message[256]; #elif defined(__IRIX_AL__)
TYPE type; #include <dmedia/audio.h>
#include <pthread.h>
public: #include <unistd.h>
//! The constructor.
RtError(const char *p, TYPE tipe = RtError::UNSPECIFIED); typedef ALport AUDIO_HANDLE;
typedef long DEVICE_ID;
//! The destructor. typedef pthread_t THREAD_HANDLE;
virtual ~RtError(void); typedef pthread_mutex_t MUTEX;
//! Prints "thrown" error message to stdout. #elif defined(__MACOSX_CORE__)
virtual void printMessage(void);
#include <CoreAudio/AudioHardware.h>
//! Returns the "thrown" error message TYPE. #include <pthread.h>
virtual const TYPE& getType(void) { return type; }
typedef unsigned int AUDIO_HANDLE;
//! Returns the "thrown" error message string. typedef AudioDeviceID DEVICE_ID;
virtual const char *getMessage(void) { return error_message; } typedef pthread_t THREAD_HANDLE;
}; typedef pthread_mutex_t MUTEX;
#endif
// *************************************************** //
//
// RtAudio class declaration. /************************************************************************/
// /*! \class RtError
// *************************************************** // \brief Exception handling class for RtAudio.
class RtAudio The RtError class is quite simple but it does allow errors to be
{ "caught" by RtError::TYPE. Almost all RtAudio methods can "throw"
public: an RtError, most typically if an invalid stream identifier is
supplied to a method or a driver error occurs. There are a number
// Support for signed integers and floats. Audio data fed to/from of cases within RtAudio where warning messages may be displayed
// the tickStream() routine is assumed to ALWAYS be in host but an exception is not thrown. There is a private RtAudio method,
// byte order. The internal routines will automatically take care of error(), which can be modified to globally control how these
// any necessary byte-swapping between the host format and the messages are handled and reported.
// soundcard. Thus, endian-ness is not a concern in the following */
// format definitions. /************************************************************************/
typedef unsigned long RTAUDIO_FORMAT;
static const RTAUDIO_FORMAT RTAUDIO_SINT8; class RtError
static const RTAUDIO_FORMAT RTAUDIO_SINT16; {
static const RTAUDIO_FORMAT RTAUDIO_SINT24; /*!< Upper 3 bytes of 32-bit integer. */ public:
static const RTAUDIO_FORMAT RTAUDIO_SINT32; //! Defined RtError types.
static const RTAUDIO_FORMAT RTAUDIO_FLOAT32; /*!< Normalized between plus/minus 1.0. */ enum TYPE {
static const RTAUDIO_FORMAT RTAUDIO_FLOAT64; /*!< Normalized between plus/minus 1.0. */ WARNING,
DEBUG_WARNING,
//static const int MAX_SAMPLE_RATES = 14; UNSPECIFIED,
enum { MAX_SAMPLE_RATES = 14 }; NO_DEVICES_FOUND,
INVALID_DEVICE,
typedef int (*RTAUDIO_CALLBACK)(char *buffer, int bufferSize, void *userData); INVALID_STREAM,
MEMORY_ERROR,
typedef struct { INVALID_PARAMETER,
char name[128]; DRIVER_ERROR,
DEVICE_ID id[2]; /*!< No value reported by getDeviceInfo(). */ SYSTEM_ERROR,
bool probed; /*!< true if the device capabilities were successfully probed. */ THREAD_ERROR
int maxOutputChannels; };
int maxInputChannels;
int maxDuplexChannels; protected:
int minOutputChannels; char error_message[256];
int minInputChannels; TYPE type;
int minDuplexChannels;
bool hasDuplexSupport; /*!< true if device supports duplex mode. */ public:
int nSampleRates; /*!< Number of discrete rates or -1 if range supported. */ //! The constructor.
int sampleRates[MAX_SAMPLE_RATES]; /*!< Supported rates or (min, max) if range. */ RtError(const char *p, TYPE tipe = RtError::UNSPECIFIED);
RTAUDIO_FORMAT nativeFormats; /*!< Bit mask of supported data formats. */
} RTAUDIO_DEVICE; //! The destructor.
virtual ~RtError(void);
//! The default constructor.
/*! //! Prints "thrown" error message to stdout.
Probes the system to make sure at least one audio virtual void printMessage(void);
input/output device is available and determines
the api-specific identifier for each device found. //! Returns the "thrown" error message TYPE.
An RtError error can be thrown if no devices are virtual const TYPE& getType(void) { return type; }
found or if a memory allocation error occurs.
*/ //! Returns the "thrown" error message string.
RtAudio(); virtual const char *getMessage(void) { return error_message; }
};
//! A constructor which can be used to open a stream during instantiation.
/*!
The specified output and/or input device identifiers correspond // This public structure type is used to pass callback information
to those enumerated via the getDeviceInfo() method. If device = // between the private RtAudio stream structure and global callback
0, the default or first available devices meeting the given // handling functions.
parameters is selected. If an output or input channel value is typedef struct {
zero, the corresponding device value is ignored. When a stream is void *object; // Used as a "this" pointer.
successfully opened, its identifier is returned via the "streamId" int streamId;
pointer. An RtError can be thrown if no devices are found DEVICE_ID device[2];
for the given parameters, if a memory allocation error occurs, or THREAD_HANDLE thread;
if a driver error occurs. \sa openStream() void *callback;
*/ void *buffers;
RtAudio(int *streamId, unsigned long waitTime;
int outputDevice, int outputChannels, bool blockTick;
int inputDevice, int inputChannels, bool stopStream;
RTAUDIO_FORMAT format, int sampleRate, bool usingCallback;
int *bufferSize, int numberOfBuffers); void *userData;
} CALLBACK_INFO;
//! The destructor.
/*!
Stops and closes any open streams and devices and deallocates // *************************************************** //
buffer and structure memory. //
*/ // RtAudio class declaration.
~RtAudio(); //
// *************************************************** //
//! A public method for opening a stream with the specified parameters.
/*! class RtAudio
If successful, the opened stream ID is returned. Otherwise, an {
RtError is thrown. public:
\param outputDevice: If equal to 0, the default or first device // Support for signed integers and floats. Audio data fed to/from
found meeting the given parameters is opened. Otherwise, the // the tickStream() routine is assumed to ALWAYS be in host
device number should correspond to one of those enumerated via // byte order. The internal routines will automatically take care of
the getDeviceInfo() method. // any necessary byte-swapping between the host format and the
\param outputChannels: The desired number of output channels. If // soundcard. Thus, endian-ness is not a concern in the following
equal to zero, the outputDevice identifier is ignored. // format definitions.
\param inputDevice: If equal to 0, the default or first device typedef unsigned long RTAUDIO_FORMAT;
found meeting the given parameters is opened. Otherwise, the static const RTAUDIO_FORMAT RTAUDIO_SINT8; /*!< 8-bit signed integer. */
device number should correspond to one of those enumerated via static const RTAUDIO_FORMAT RTAUDIO_SINT16; /*!< 16-bit signed integer. */
the getDeviceInfo() method. static const RTAUDIO_FORMAT RTAUDIO_SINT24; /*!< Upper 3 bytes of 32-bit signed integer. */
\param inputChannels: The desired number of input channels. If static const RTAUDIO_FORMAT RTAUDIO_SINT32; /*!< 32-bit signed integer. */
equal to zero, the inputDevice identifier is ignored. static const RTAUDIO_FORMAT RTAUDIO_FLOAT32; /*!< Normalized between plus/minus 1.0. */
\param format: An RTAUDIO_FORMAT specifying the desired sample data format. static const RTAUDIO_FORMAT RTAUDIO_FLOAT64; /*!< Normalized between plus/minus 1.0. */
\param sampleRate: The desired sample rate (sample frames per second).
\param *bufferSize: A pointer value indicating the desired internal buffer //static const int MAX_SAMPLE_RATES = 14;
size in sample frames. The actual value used by the device is enum { MAX_SAMPLE_RATES = 14 };
returned via the same pointer. A value of zero can be specified,
in which case the lowest allowable value is determined. typedef int (*RTAUDIO_CALLBACK)(char *buffer, int bufferSize, void *userData);
\param numberOfBuffers: A value which can be used to help control device
latency. More buffers typically result in more robust performance, //! The public device information structure for passing queried values.
though at a cost of greater latency. A value of zero can be typedef struct {
specified, in which case the lowest allowable value is used. char name[128]; /*!< Character string device identifier. */
*/ DEVICE_ID id[2]; /* No value reported by getDeviceInfo(). */
int openStream(int outputDevice, int outputChannels, bool probed; /*!< true if the device capabilities were successfully probed. */
int inputDevice, int inputChannels, int maxOutputChannels; /*!< Maximum output channels supported by device. */
RTAUDIO_FORMAT format, int sampleRate, int maxInputChannels; /*!< Maximum input channels supported by device. */
int *bufferSize, int numberOfBuffers); int maxDuplexChannels; /*!< Maximum simultaneous input/output channels supported by device. */
int minOutputChannels; /*!< Minimum output channels supported by device. */
//! A public method which sets a user-defined callback function for a given stream. int minInputChannels; /*!< Minimum input channels supported by device. */
/*! int minDuplexChannels; /*!< Minimum simultaneous input/output channels supported by device. */
This method assigns a callback function to a specific, bool hasDuplexSupport; /*!< true if device supports duplex mode. */
previously opened stream for non-blocking stream functionality. A bool isDefault; /*!< true if this is the default output or input device. */
separate process is initiated, though the user function is called int nSampleRates; /*!< Number of discrete rates or -1 if range supported. */
only when the stream is "running" (between calls to the int sampleRates[MAX_SAMPLE_RATES]; /*!< Supported rates or (min, max) if range. */
startStream() and stopStream() methods, respectively). The RTAUDIO_FORMAT nativeFormats; /*!< Bit mask of supported data formats. */
callback process remains active for the duration of the stream and } RTAUDIO_DEVICE;
is automatically shutdown when the stream is closed (via the
closeStream() method or by object destruction). The callback //! The default constructor.
process can also be shutdown and the user function de-referenced /*!
through an explicit call to the cancelStreamCallback() method. Probes the system to make sure at least one audio input/output
Note that a single stream can use only blocking or callback device is available and determines the api-specific identifier for
functionality at the same time, though it is possible to alternate each device found. An RtError error can be thrown if no devices
modes on the same stream through the use of the are found or if a memory allocation error occurs.
setStreamCallback() and cancelStreamCallback() methods (the */
blocking tickStream() method can be used before a callback is set RtAudio();
and/or after a callback is cancelled). An RtError will be
thrown for an invalid device argument. //! A constructor which can be used to open a stream during instantiation.
*/ /*!
void setStreamCallback(int streamId, RTAUDIO_CALLBACK callback, void *userData); The specified output and/or input device identifiers correspond
to those enumerated via the getDeviceInfo() method. If device =
//! A public method which cancels a callback process and function for a given stream. 0, the default or first available devices meeting the given
/*! parameters is selected. If an output or input channel value is
This method shuts down a callback process and de-references the zero, the corresponding device value is ignored. When a stream is
user function for a specific stream. Callback functionality can successfully opened, its identifier is returned via the "streamId"
subsequently be restarted on the stream via the pointer. An RtError can be thrown if no devices are found
setStreamCallback() method. An RtError will be thrown for an for the given parameters, if a memory allocation error occurs, or
invalid device argument. if a driver error occurs. \sa openStream()
*/ */
void cancelStreamCallback(int streamId); RtAudio(int *streamId,
int outputDevice, int outputChannels,
//! A public method which returns the number of audio devices found. int inputDevice, int inputChannels,
int getDeviceCount(void); RTAUDIO_FORMAT format, int sampleRate,
int *bufferSize, int numberOfBuffers);
//! Fill a user-supplied RTAUDIO_DEVICE structure for a specified device.
/*! //! The destructor.
Any device between 0 and getDeviceCount()-1 is valid. If a /*!
device is busy or otherwise unavailable, the structure member Stops and closes any open streams and devices and deallocates
"probed" has a value of "false". The system default input and buffer and structure memory.
output devices are referenced by device identifier = 0. On */
systems which allow dynamic default device settings, the default ~RtAudio();
devices are not identified by name (specific device enumerations
are assigned device identifiers > 0). An RtError will be //! A public method for opening a stream with the specified parameters.
thrown for an invalid device argument. /*!
*/ If successful, the opened stream ID is returned. Otherwise, an
void getDeviceInfo(int device, RTAUDIO_DEVICE *info); RtError is thrown.
//! A public method which returns a pointer to the buffer for an open stream. \param outputDevice: If equal to 0, the default or first device
/*! found meeting the given parameters is opened. Otherwise, the
The user should fill and/or read the buffer data in interleaved format device number should correspond to one of those enumerated via
and then call the tickStream() method. An RtError will be the getDeviceInfo() method.
thrown for an invalid stream identifier. \param outputChannels: The desired number of output channels. If
*/ equal to zero, the outputDevice identifier is ignored.
char * const getStreamBuffer(int streamId); \param inputDevice: If equal to 0, the default or first device
found meeting the given parameters is opened. Otherwise, the
//! Public method used to trigger processing of input/output data for a stream. device number should correspond to one of those enumerated via
/*! the getDeviceInfo() method.
This method blocks until all buffer data is read/written. An \param inputChannels: The desired number of input channels. If
RtError will be thrown for an invalid stream identifier or if equal to zero, the inputDevice identifier is ignored.
a driver error occurs. \param format: An RTAUDIO_FORMAT specifying the desired sample data format.
*/ \param sampleRate: The desired sample rate (sample frames per second).
void tickStream(int streamId); \param *bufferSize: A pointer value indicating the desired internal buffer
size in sample frames. The actual value used by the device is
//! Public method which closes a stream and frees any associated buffers. returned via the same pointer. A value of zero can be specified,
/*! in which case the lowest allowable value is determined.
If an invalid stream identifier is specified, this method \param numberOfBuffers: A value which can be used to help control device
issues a warning and returns (an RtError is not thrown). latency. More buffers typically result in more robust performance,
*/ though at a cost of greater latency. A value of zero can be
void closeStream(int streamId); specified, in which case the lowest allowable value is used.
*/
//! Public method which starts a stream. int openStream(int outputDevice, int outputChannels,
/*! int inputDevice, int inputChannels,
An RtError will be thrown for an invalid stream identifier RTAUDIO_FORMAT format, int sampleRate,
or if a driver error occurs. int *bufferSize, int numberOfBuffers);
*/
void startStream(int streamId); //! A public method which sets a user-defined callback function for a given stream.
/*!
//! Stop a stream, allowing any samples remaining in the queue to be played out and/or read in. This method assigns a callback function to a specific,
/*! previously opened stream for non-blocking stream functionality. A
An RtError will be thrown for an invalid stream identifier separate process is initiated, though the user function is called
or if a driver error occurs. only when the stream is "running" (between calls to the
*/ startStream() and stopStream() methods, respectively). The
void stopStream(int streamId); callback process remains active for the duration of the stream and
is automatically shutdown when the stream is closed (via the
//! Stop a stream, discarding any samples remaining in the input/output queue. closeStream() method or by object destruction). The callback
/*! process can also be shutdown and the user function de-referenced
An RtError will be thrown for an invalid stream identifier through an explicit call to the cancelStreamCallback() method.
or if a driver error occurs. Note that a single stream can use only blocking or callback
*/ functionality at the same time, though it is possible to alternate
void abortStream(int streamId); modes on the same stream through the use of the
setStreamCallback() and cancelStreamCallback() methods (the
//! Queries a stream to determine whether a call to the tickStream() method will block. blocking tickStream() method can be used before a callback is set
/*! and/or after a callback is cancelled). An RtError will be thrown
A return value of 0 indicates that the stream will NOT block. A positive for an invalid device argument.
return value indicates the number of sample frames that cannot yet be */
processed without blocking. void setStreamCallback(int streamId, RTAUDIO_CALLBACK callback, void *userData);
*/
int streamWillBlock(int streamId); //! A public method which cancels a callback process and function for a given stream.
/*!
protected: This method shuts down a callback process and de-references the
user function for a specific stream. Callback functionality can
private: subsequently be restarted on the stream via the
setStreamCallback() method. An RtError will be thrown for an
static const unsigned int SAMPLE_RATES[MAX_SAMPLE_RATES]; invalid device argument.
*/
enum { FAILURE, SUCCESS }; void cancelStreamCallback(int streamId);
enum STREAM_MODE { //! A public method which returns the number of audio devices found.
PLAYBACK, int getDeviceCount(void);
RECORD,
DUPLEX, //! Fill a user-supplied RTAUDIO_DEVICE structure for a specified device number.
UNINITIALIZED = -75 /*!
}; Any device integer between 1 and getDeviceCount() is valid. If
a device is busy or otherwise unavailable, the structure member
enum STREAM_STATE { "probed" will have a value of "false" and all other members are
STREAM_STOPPED, undefined. If the specified device is the current default input
STREAM_RUNNING or output device, the "isDefault" member will have a value of
}; "true". An RtError will be thrown for an invalid device argument.
*/
typedef struct { void getDeviceInfo(int device, RTAUDIO_DEVICE *info);
int device[2]; // Playback and record, respectively.
STREAM_MODE mode; // PLAYBACK, RECORD, or DUPLEX. //! A public method which returns a pointer to the buffer for an open stream.
AUDIO_HANDLE handle[2]; // Playback and record handles, respectively. /*!
STREAM_STATE state; // STOPPED or RUNNING The user should fill and/or read the buffer data in interleaved format
char *userBuffer; and then call the tickStream() method. An RtError will be
char *deviceBuffer; thrown for an invalid stream identifier.
bool doConvertBuffer[2]; // Playback and record, respectively. */
bool deInterleave[2]; // Playback and record, respectively. char * const getStreamBuffer(int streamId);
bool doByteSwap[2]; // Playback and record, respectively.
int sampleRate; //! Public method used to trigger processing of input/output data for a stream.
int bufferSize; /*!
int nBuffers; This method blocks until all buffer data is read/written. An
int nUserChannels[2]; // Playback and record, respectively. RtError will be thrown for an invalid stream identifier or if
int nDeviceChannels[2]; // Playback and record channels, respectively. a driver error occurs.
RTAUDIO_FORMAT userFormat; */
RTAUDIO_FORMAT deviceFormat[2]; // Playback and record, respectively. void tickStream(int streamId);
bool usingCallback;
THREAD_HANDLE thread; //! Public method which closes a stream and frees any associated buffers.
MUTEX mutex; /*!
RTAUDIO_CALLBACK callback; If an invalid stream identifier is specified, this method
void *userData; issues a warning and returns (an RtError is not thrown).
} RTAUDIO_STREAM; */
void closeStream(int streamId);
typedef signed short INT16;
typedef signed int INT32; //! Public method which starts a stream.
typedef float FLOAT32; /*!
typedef double FLOAT64; An RtError will be thrown for an invalid stream identifier
or if a driver error occurs.
char message[256]; */
int nDevices; void startStream(int streamId);
RTAUDIO_DEVICE *devices;
//! Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.
std::map<int, void *> streams; /*!
An RtError will be thrown for an invalid stream identifier
//! Private error method to allow global control over error handling. or if a driver error occurs.
void error(RtError::TYPE type); */
void stopStream(int streamId);
/*!
Private method to count the system audio devices, allocate the //! Stop a stream, discarding any samples remaining in the input/output queue.
RTAUDIO_DEVICE structures, and probe the device capabilities. /*!
*/ An RtError will be thrown for an invalid stream identifier
void initialize(void); or if a driver error occurs.
*/
//! Private method to clear an RTAUDIO_DEVICE structure. void abortStream(int streamId);
void clearDeviceInfo(RTAUDIO_DEVICE *info);
//! Queries a stream to determine whether a call to the tickStream() method will block.
/*! /*!
Private method which attempts to fill an RTAUDIO_DEVICE A return value of 0 indicates that the stream will NOT block. A positive
structure for a given device. If an error is encountered during return value indicates the number of sample frames that cannot yet be
the probe, a "warning" message is reported and the value of processed without blocking.
"probed" remains false (no exception is thrown). A successful */
probe is indicated by probed = true. int streamWillBlock(int streamId);
*/
void probeDeviceInfo(RTAUDIO_DEVICE *info); #if (defined(__MACOSX_CORE__) || defined(__WINDOWS_ASIO__))
// This function is intended for internal use only. It must be
/*! // public because it is called by the internal callback handler,
Private method which attempts to open a device with the given parameters. // which is not a member of RtAudio. External use of this function
If an error is encountered during the probe, a "warning" message is // will most likely produce highly undesireable results!
reported and FAILURE is returned (no exception is thrown). A void callbackEvent(int streamId, DEVICE_ID deviceId, void *inData, void *outData);
successful probe is indicated by a return value of SUCCESS. #endif
*/
bool probeDeviceOpen(int device, RTAUDIO_STREAM *stream, protected:
STREAM_MODE mode, int channels,
int sampleRate, RTAUDIO_FORMAT format, private:
int *bufferSize, int numberOfBuffers);
static const unsigned int SAMPLE_RATES[MAX_SAMPLE_RATES];
/*!
Private common method used to check validity of a user-passed enum { FAILURE, SUCCESS };
stream ID. When the ID is valid, this method returns a pointer to
an RTAUDIO_STREAM structure (in the form of a void pointer). enum STREAM_MODE {
Otherwise, an "invalid identifier" exception is thrown. OUTPUT,
*/ INPUT,
void *verifyStream(int streamId); DUPLEX,
UNINITIALIZED = -75
/*! };
Private method used to perform format, channel number, and/or interleaving
conversions between the user and device buffers. enum STREAM_STATE {
*/ STREAM_STOPPED,
void convertStreamBuffer(RTAUDIO_STREAM *stream, STREAM_MODE mode); STREAM_RUNNING
};
//! Private method used to perform byte-swapping on buffers.
void byteSwapBuffer(char *buffer, int samples, RTAUDIO_FORMAT format); typedef struct {
int device[2]; // Playback and record, respectively.
//! Private method which returns the number of bytes for a given format. STREAM_MODE mode; // OUTPUT, INPUT, or DUPLEX.
int formatBytes(RTAUDIO_FORMAT format); AUDIO_HANDLE handle[2]; // Playback and record handles, respectively.
}; STREAM_STATE state; // STOPPED or RUNNING
char *userBuffer;
// Uncomment the following definition to have extra information spewed to stderr. char *deviceBuffer;
//#define RTAUDIO_DEBUG bool doConvertBuffer[2]; // Playback and record, respectively.
bool deInterleave[2]; // Playback and record, respectively.
#endif bool doByteSwap[2]; // Playback and record, respectively.
int sampleRate;
int bufferSize;
int nBuffers;
int nUserChannels[2]; // Playback and record, respectively.
int nDeviceChannels[2]; // Playback and record channels, respectively.
RTAUDIO_FORMAT userFormat;
RTAUDIO_FORMAT deviceFormat[2]; // Playback and record, respectively.
MUTEX mutex;
CALLBACK_INFO callbackInfo;
} RTAUDIO_STREAM;
typedef signed short INT16;
typedef signed int INT32;
typedef float FLOAT32;
typedef double FLOAT64;
char message[256];
int nDevices;
RTAUDIO_DEVICE *devices;
std::map<int, void *> streams;
//! Private error method to allow global control over error handling.
void error(RtError::TYPE type);
/*!
Private method to count the system audio devices, allocate the
RTAUDIO_DEVICE structures, and probe the device capabilities.
*/
void initialize(void);
/*!
Private method which returns the index in the devices array to
the default input device.
*/
int getDefaultInputDevice(void);
/*!
Private method which returns the index in the devices array to
the default output device.
*/
int getDefaultOutputDevice(void);
//! Private method to clear an RTAUDIO_DEVICE structure.
void clearDeviceInfo(RTAUDIO_DEVICE *info);
/*!
Private method which attempts to fill an RTAUDIO_DEVICE
structure for a given device. If an error is encountered during
the probe, a "warning" message is reported and the value of
"probed" remains false (no exception is thrown). A successful
probe is indicated by probed = true.
*/
void probeDeviceInfo(RTAUDIO_DEVICE *info);
/*!
Private method which attempts to open a device with the given parameters.
If an error is encountered during the probe, a "warning" message is
reported and FAILURE is returned (no exception is thrown). A
successful probe is indicated by a return value of SUCCESS.
*/
bool probeDeviceOpen(int device, RTAUDIO_STREAM *stream,
STREAM_MODE mode, int channels,
int sampleRate, RTAUDIO_FORMAT format,
int *bufferSize, int numberOfBuffers);
/*!
Private common method used to check validity of a user-passed
stream ID. When the ID is valid, this method returns a pointer to
an RTAUDIO_STREAM structure (in the form of a void pointer).
Otherwise, an "invalid identifier" exception is thrown.
*/
void *verifyStream(int streamId);
/*!
Private method used to perform format, channel number, and/or interleaving
conversions between the user and device buffers.
*/
void convertStreamBuffer(RTAUDIO_STREAM *stream, STREAM_MODE mode);
//! Private method used to perform byte-swapping on buffers.
void byteSwapBuffer(char *buffer, int samples, RTAUDIO_FORMAT format);
//! Private method which returns the number of bytes for a given format.
int formatBytes(RTAUDIO_FORMAT format);
};
// Define the following flag to have extra information spewed to stderr.
//#define __RTAUDIO_DEBUG__
#endif

View File

@@ -1,99 +1,99 @@
/***************************************************/ /***************************************************/
/*! \class RtDuplex /*! \class RtDuplex
\brief STK realtime audio input/output class. \brief STK realtime audio input/output class.
This class provides a simplified interface to This class provides a simplified interface to
RtAudio for realtime audio input/output. It RtAudio for realtime audio input/output. It
is also possible to achieve duplex operation is also possible to achieve duplex operation
using separate RtWvIn and RtWvOut classes, but using separate RtWvIn and RtWvOut classes, but
this class ensures better input/output this class ensures better input/output
syncronization. syncronization.
RtDuplex supports multi-channel data in RtDuplex supports multi-channel data in
interleaved format. It is important to interleaved format. It is important to
distinguish the tick() methods, which output distinguish the tick() methods, which output
single samples to all channels in a sample frame single samples to all channels in a sample frame
and return samples produced by averaging across and return samples produced by averaging across
sample frames, from the tickFrame() methods, which sample frames, from the tickFrame() methods, which
take/return pointers to multi-channel sample frames. take/return pointers to multi-channel sample frames.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__RTDUPLEX_H) #if !defined(__RTDUPLEX_H)
#define __RTDUPLEX_H #define __RTDUPLEX_H
#include "Stk.h" #include "Stk.h"
#include "RtAudio.h" #include "RtAudio.h"
class RtDuplex : public Stk class RtDuplex : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
/*! /*!
The \e device argument is passed to RtAudio during The \e device argument is passed to RtAudio during
instantiation. The default value (zero) will select the default instantiation. The default value (zero) will select the default
device on your system or the first device found meeting the device on your system or the first device found meeting the
specified parameters. On systems with multiple specified parameters. On systems with multiple
soundcards/devices, values greater than zero can be specified in soundcards/devices, values greater than zero can be specified in
accordance with the order that the devices are enumerated by the accordance with the order that the devices are enumerated by the
underlying audio API. The default buffer size of RT_BUFFER_SIZE underlying audio API. The default buffer size of RT_BUFFER_SIZE
is defined in Stk.h. An StkError will be thrown if an error is defined in Stk.h. An StkError will be thrown if an error
occurs duing instantiation. occurs duing instantiation.
*/ */
RtDuplex(int nChannels = 1, MY_FLOAT sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 2); RtDuplex(int nChannels = 1, MY_FLOAT sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 2);
//! Class destructor. //! Class destructor.
~RtDuplex(); ~RtDuplex();
//! Start the audio input/output stream. //! Start the audio input/output stream.
/*! /*!
The stream is started automatically, if necessary, when a tick() or tickFrame method is called. The stream is started automatically, if necessary, when a tick() or tickFrame method is called.
*/ */
void start(void); void start(void);
//! Stop the audio input/output stream. //! Stop the audio input/output stream.
/*! /*!
It may be necessary to use this method to avoid audio overflow/underflow problems if you wish to temporarily stop the audio stream. It may be necessary to use this method to avoid audio overflow/underflow problems if you wish to temporarily stop the audio stream.
*/ */
void stop(void); void stop(void);
//! Return the average across the last output sample frame. //! Return the average across the last output sample frame.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Output a single sample to all channels in a sample frame and return the average across one new input sample frame of data. //! Output a single sample to all channels in a sample frame and return the average across one new input sample frame of data.
/*! /*!
An StkError will be thrown if an error occurs during input/output. An StkError will be thrown if an error occurs during input/output.
*/ */
MY_FLOAT tick(const MY_FLOAT sample); MY_FLOAT tick(const MY_FLOAT sample);
//! Output each sample in \vector to all channels per frame and return averaged input sample frames of new data in \e vector. //! Output each sample in \vector to all channels per frame and return averaged input sample frames of new data in \e vector.
/*! /*!
An StkError will be thrown if an error occurs during input/output. An StkError will be thrown if an error occurs during input/output.
*/ */
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Return a pointer to the last output sample frame. //! Return a pointer to the last output sample frame.
const MY_FLOAT *lastFrame(void) const; const MY_FLOAT *lastFrame(void) const;
//! Output sample \e frames from \e frameVector and return new input frames in \e frameVector. //! Output sample \e frames from \e frameVector and return new input frames in \e frameVector.
/*! /*!
An StkError will be thrown if an error occurs during input/output. An StkError will be thrown if an error occurs during input/output.
*/ */
MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames = 1); MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames = 1);
protected: protected:
RtAudio *audio; RtAudio *audio;
MY_FLOAT *data; MY_FLOAT *data;
MY_FLOAT *lastOutput; MY_FLOAT *lastOutput;
int bufferSize; int bufferSize;
bool stopped; bool stopped;
int stream; int stream;
long counter; long counter;
unsigned int channels; unsigned int channels;
}; };
#endif #endif

View File

@@ -1,80 +1,80 @@
/***************************************************/ /***************************************************/
/*! \class RtMidi /*! \class RtMidi
\brief STK realtime MIDI class. \brief STK realtime MIDI class.
At the moment, this object only handles MIDI At the moment, this object only handles MIDI
input, though MIDI output code can go here input, though MIDI output code can go here
when someone decides they need it (and writes when someone decides they need it (and writes
it). it).
This object opens a MIDI input device and This object opens a MIDI input device and
parses MIDI messages into a MIDI buffer. Time parses MIDI messages into a MIDI buffer. Time
stamp info is converted to a delta-time stamp info is converted to a delta-time
value. MIDI data is stored as MY_FLOAT to value. MIDI data is stored as MY_FLOAT to
conform with SKINI. System exclusive messages conform with SKINI. System exclusive messages
are currently ignored. are currently ignored.
An optional argument to the constructor can be An optional argument to the constructor can be
used to specify a device or card. When no used to specify a device or card. When no
argument is given, a default device is opened. argument is given, a default device is opened.
If a device argument fails, a list of available If a device argument fails, a list of available
devices is printed to allow selection by the user. devices is printed to allow selection by the user.
This code is based in part on work of Perry This code is based in part on work of Perry
Cook (SGI), Paul Leonard (Linux), the Cook (SGI), Paul Leonard (Linux), the
RoseGarden team (Linux), and Bill Putnam RoseGarden team (Linux), and Bill Putnam
(Windows). (Windows).
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__RTMIDI_H) #if !defined(__RTMIDI_H)
#define __RTMIDI_H #define __RTMIDI_H
#include "Stk.h" #include "Stk.h"
class RtMidi : public Stk class RtMidi : public Stk
{ {
public: public:
//! Default constructor with optional device argument. //! Default constructor with optional device argument.
RtMidi(int device = 0); RtMidi(int device = 0);
//! Class destructor. //! Class destructor.
~RtMidi(); ~RtMidi();
//! Print out the current message values. //! Print out the current message values.
void printMessage(void) const; void printMessage(void) const;
//! Check for and parse a new MIDI message in the queue, returning its type. //! Check for and parse a new MIDI message in the queue, returning its type.
/*! /*!
If a new message is found, the return value is greater than zero. If a new message is found, the return value is greater than zero.
*/ */
int nextMessage(void); int nextMessage(void);
//! Return the current message type. //! Return the current message type.
int getType() const; int getType() const;
//! Return the current message channel value. //! Return the current message channel value.
int getChannel() const; int getChannel() const;
//! Return the current message byte two value. //! Return the current message byte two value.
MY_FLOAT getByteTwo() const; MY_FLOAT getByteTwo() const;
//! Return the current message byte three value. //! Return the current message byte three value.
MY_FLOAT getByteThree() const; MY_FLOAT getByteThree() const;
//! Return the current message delta time value in seconds. //! Return the current message delta time value in seconds.
MY_FLOAT getDeltaTime() const; MY_FLOAT getDeltaTime() const;
protected: protected:
int messageType; int messageType;
int channel; int channel;
float byteTwo; float byteTwo;
float byteThree; float byteThree;
MY_FLOAT deltaTime; MY_FLOAT deltaTime;
int readIndex; int readIndex;
}; };
#endif #endif

View File

@@ -1,100 +1,100 @@
/***************************************************/ /***************************************************/
/*! \class RtWvIn /*! \class RtWvIn
\brief STK realtime audio input class. \brief STK realtime audio input class.
This class provides a simplified interface to This class provides a simplified interface to
RtAudio for realtime audio input. It is a RtAudio for realtime audio input. It is a
protected subclass of WvIn. protected subclass of WvIn.
RtWvIn supports multi-channel data in RtWvIn supports multi-channel data in
interleaved format. It is important to interleaved format. It is important to
distinguish the tick() methods, which return distinguish the tick() methods, which return
samples produced by averaging across sample samples produced by averaging across sample
frames, from the tickFrame() methods, which frames, from the tickFrame() methods, which
return pointers to multi-channel sample frames. return pointers to multi-channel sample frames.
For single-channel data, these methods return For single-channel data, these methods return
equivalent values. equivalent values.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__RTWVIN_H) #if !defined(__RTWVIN_H)
#define __RTWVIN_H #define __RTWVIN_H
#include "Stk.h" #include "Stk.h"
#include "WvIn.h" #include "WvIn.h"
#include "RtAudio.h" #include "RtAudio.h"
class RtWvIn : protected WvIn class RtWvIn : protected WvIn
{ {
public: public:
//! Default constructor. //! Default constructor.
/*! /*!
The \e device argument is passed to RtAudio during The \e device argument is passed to RtAudio during
instantiation. The default value (zero) will select the default instantiation. The default value (zero) will select the default
device on your system or the first device found meeting the device on your system or the first device found meeting the
specified parameters. On systems with multiple specified parameters. On systems with multiple
soundcards/devices, values greater than zero can be specified in soundcards/devices, values greater than zero can be specified in
accordance with the order that the devices are enumerated by the accordance with the order that the devices are enumerated by the
underlying audio API. The default buffer size of RT_BUFFER_SIZE underlying audio API. The default buffer size of RT_BUFFER_SIZE
is defined in Stk.h. An StkError will be thrown if an error is defined in Stk.h. An StkError will be thrown if an error
occurs duing instantiation. occurs duing instantiation.
*/ */
RtWvIn(int nChannels = 1, MY_FLOAT sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 2); RtWvIn(int nChannels = 1, MY_FLOAT sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 2);
//! Class destructor. //! Class destructor.
~RtWvIn(); ~RtWvIn();
//! Start the audio input stream. //! Start the audio input stream.
/*! /*!
The stream is started automatically, if necessary, when a tick() or tickFrame method is called. The stream is started automatically, if necessary, when a tick() or tickFrame method is called.
*/ */
void start(void); void start(void);
//! Stop the audio input stream. //! Stop the audio input stream.
/*! /*!
It may be necessary to use this method to avoid audio underflow problems if you wish to temporarily stop audio input. It may be necessary to use this method to avoid audio underflow problems if you wish to temporarily stop audio input.
*/ */
void stop(void); void stop(void);
//! Return the average across the last output sample frame. //! Return the average across the last output sample frame.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Read out the average across one sample frame of data. //! Read out the average across one sample frame of data.
/*! /*!
An StkError will be thrown if an error occurs during input. An StkError will be thrown if an error occurs during input.
*/ */
MY_FLOAT tick(void); MY_FLOAT tick(void);
//! Read out vectorSize averaged sample frames of data in \e vector. //! Read out vectorSize averaged sample frames of data in \e vector.
/*! /*!
An StkError will be thrown if an error occurs during input. An StkError will be thrown if an error occurs during input.
*/ */
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Return a pointer to the last output sample frame. //! Return a pointer to the last output sample frame.
const MY_FLOAT *lastFrame(void) const; const MY_FLOAT *lastFrame(void) const;
//! Return a pointer to the next sample frame of data. //! Return a pointer to the next sample frame of data.
/*! /*!
An StkError will be thrown if an error occurs during input. An StkError will be thrown if an error occurs during input.
*/ */
const MY_FLOAT *tickFrame(void); const MY_FLOAT *tickFrame(void);
//! Read out sample \e frames of data to \e frameVector. //! Read out sample \e frames of data to \e frameVector.
/*! /*!
An StkError will be thrown if an error occurs during input. An StkError will be thrown if an error occurs during input.
*/ */
MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames); MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames);
protected: protected:
RtAudio *audio; RtAudio *audio;
bool stopped; bool stopped;
int stream; int stream;
long counter; long counter;
}; };
#endif #endif

View File

@@ -1,92 +1,92 @@
/***************************************************/ /***************************************************/
/*! \class RtWvOut /*! \class RtWvOut
\brief STK realtime audio output class. \brief STK realtime audio output class.
This class provides a simplified interface to This class provides a simplified interface to
RtAudio for realtime audio output. It is a RtAudio for realtime audio output. It is a
protected subclass of WvOut. protected subclass of WvOut.
RtWvOut supports multi-channel data in RtWvOut supports multi-channel data in
interleaved format. It is important to interleaved format. It is important to
distinguish the tick() methods, which output distinguish the tick() methods, which output
single samples to all channels in a sample single samples to all channels in a sample
frame, from the tickFrame() method, which frame, from the tickFrame() method, which
takes a pointer to multi-channel sample takes a pointer to multi-channel sample
frame data. frame data.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__RTWVOUT_H) #if !defined(__RTWVOUT_H)
#define __RTWVOUT_H #define __RTWVOUT_H
#include "WvOut.h" #include "WvOut.h"
#include "RtAudio.h" #include "RtAudio.h"
class RtWvOut : protected WvOut class RtWvOut : protected WvOut
{ {
public: public:
//! Default constructor. //! Default constructor.
/*! /*!
The \e device argument is passed to RtAudio during The \e device argument is passed to RtAudio during
instantiation. The default value (zero) will select the default instantiation. The default value (zero) will select the default
device on your system or the first device found meeting the device on your system or the first device found meeting the
specified parameters. On systems with multiple specified parameters. On systems with multiple
soundcards/devices, values greater than zero can be specified in soundcards/devices, values greater than zero can be specified in
accordance with the order that the devices are enumerated by the accordance with the order that the devices are enumerated by the
underlying audio API. The default buffer size of RT_BUFFER_SIZE underlying audio API. The default buffer size of RT_BUFFER_SIZE
is defined in Stk.h. An StkError will be thrown if an error is defined in Stk.h. An StkError will be thrown if an error
occurs duing instantiation. occurs duing instantiation.
*/ */
RtWvOut(unsigned int nChannels = 1, MY_FLOAT sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 4 ); RtWvOut(unsigned int nChannels = 1, MY_FLOAT sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 4 );
//! Class destructor. //! Class destructor.
~RtWvOut(); ~RtWvOut();
//! Start the audio output stream. //! Start the audio output stream.
/*! /*!
The stream is started automatically, if necessary, when a tick() or tickFrame method is called. The stream is started automatically, if necessary, when a tick() or tickFrame method is called.
*/ */
void start(void); void start(void);
//! Stop the audio output stream. //! Stop the audio output stream.
/*! /*!
It may be necessary to use this method to avoid undesireable audio buffer cycling if you wish to temporarily stop audio output. It may be necessary to use this method to avoid undesireable audio buffer cycling if you wish to temporarily stop audio output.
*/ */
void stop(void); void stop(void);
//! Return the number of sample frames output. //! Return the number of sample frames output.
unsigned long getFrames( void ) const; unsigned long getFrames( void ) const;
//! Return the number of seconds of data output. //! Return the number of seconds of data output.
MY_FLOAT getTime( void ) const; MY_FLOAT getTime( void ) const;
//! Output a single sample to all channels in a sample frame. //! Output a single sample to all channels in a sample frame.
/*! /*!
An StkError will be thrown if an error occurs during output. An StkError will be thrown if an error occurs during output.
*/ */
void tick(const MY_FLOAT sample); void tick(const MY_FLOAT sample);
//! Output each sample in \e vector to all channels in \e vectorSize sample frames. //! Output each sample in \e vector to all channels in \e vectorSize sample frames.
/*! /*!
An StkError will be thrown if an error occurs during output. An StkError will be thrown if an error occurs during output.
*/ */
void tick(const MY_FLOAT *vector, unsigned int vectorSize); void tick(const MY_FLOAT *vector, unsigned int vectorSize);
//! Output the \e frameVector of sample frames of the given length. //! Output the \e frameVector of sample frames of the given length.
/*! /*!
An StkError will be thrown if an error occurs during output. An StkError will be thrown if an error occurs during output.
*/ */
void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1); void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1);
protected: protected:
RtAudio *audio; RtAudio *audio;
bool stopped; bool stopped;
int stream; int stream;
int bufferSize; int bufferSize;
}; };
#endif // defined(__RTWVOUT_H) #endif // defined(__RTWVOUT_H)

View File

@@ -1,127 +1,127 @@
/***************************************************/ /***************************************************/
/*! \class SKINI /*! \class SKINI
\brief STK SKINI parsing class \brief STK SKINI parsing class
This class parses SKINI formatted text This class parses SKINI formatted text
messages. It can be used to parse individual messages. It can be used to parse individual
messages or it can be passed an entire file. messages or it can be passed an entire file.
The file specification is Perry's and his The file specification is Perry's and his
alone, but it's all text so it shouldn't be to alone, but it's all text so it shouldn't be to
hard to figure out. hard to figure out.
SKINI (Synthesis toolKit Instrument Network SKINI (Synthesis toolKit Instrument Network
Interface) is like MIDI, but allows for Interface) is like MIDI, but allows for
floating-point control changes, note numbers, floating-point control changes, note numbers,
etc. The following example causes a sharp etc. The following example causes a sharp
middle C to be played with a velocity of 111.132: middle C to be played with a velocity of 111.132:
\code \code
noteOn 60.01 111.13 noteOn 60.01 111.13
\endcode \endcode
\sa \ref skini \sa \ref skini
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__SKINI_H) #if !defined(__SKINI_H)
#define __SKINI_H #define __SKINI_H
#include "Stk.h" #include "Stk.h"
#include <stdio.h> #include <stdio.h>
class SKINI : public Stk class SKINI : public Stk
{ {
public: public:
//! Default constructor used for parsing messages received externally. //! Default constructor used for parsing messages received externally.
SKINI(); SKINI();
//! Overloaded constructor taking a SKINI formatted scorefile. //! Overloaded constructor taking a SKINI formatted scorefile.
SKINI(char *fileName); SKINI(char *fileName);
//! Class destructor //! Class destructor
~SKINI(); ~SKINI();
//! Attempt to parse the given string, returning the message type. //! Attempt to parse the given string, returning the message type.
/*! /*!
A type value equal to zero indicates an invalid message. A type value equal to zero indicates an invalid message.
*/ */
long parseThis(char* aString); long parseThis(char* aString);
//! Parse the next message (if a file is loaded) and return the message type. //! Parse the next message (if a file is loaded) and return the message type.
/*! /*!
A negative value is returned when the file end is reached. A negative value is returned when the file end is reached.
*/ */
long nextMessage(); long nextMessage();
//! Return the current message type. //! Return the current message type.
long getType() const; long getType() const;
//! Return the current message channel value. //! Return the current message channel value.
long getChannel() const; long getChannel() const;
//! Return the current message delta time value (in seconds). //! Return the current message delta time value (in seconds).
MY_FLOAT getDelta() const; MY_FLOAT getDelta() const;
//! Return the current message byte two value. //! Return the current message byte two value.
MY_FLOAT getByteTwo() const; MY_FLOAT getByteTwo() const;
//! Return the current message byte three value. //! Return the current message byte three value.
MY_FLOAT getByteThree() const; MY_FLOAT getByteThree() const;
//! Return the current message byte two value (integer). //! Return the current message byte two value (integer).
long getByteTwoInt() const; long getByteTwoInt() const;
//! Return the current message byte three value (integer). //! Return the current message byte three value (integer).
long getByteThreeInt() const; long getByteThreeInt() const;
//! Return remainder string after parsing. //! Return remainder string after parsing.
const char* getRemainderString(); const char* getRemainderString();
//! Return the message type as a string. //! Return the message type as a string.
const char* getMessageTypeString(); const char* getMessageTypeString();
//! Return the SKINI type string for the given type value. //! Return the SKINI type string for the given type value.
const char* whatsThisType(long type); const char* whatsThisType(long type);
//! Return the SKINI controller string for the given controller number. //! Return the SKINI controller string for the given controller number.
const char* whatsThisController(long number); const char* whatsThisController(long number);
protected: protected:
FILE *myFile; FILE *myFile;
long messageType; long messageType;
char msgTypeString[64]; char msgTypeString[64];
long channel; long channel;
MY_FLOAT deltaTime; MY_FLOAT deltaTime;
MY_FLOAT byteTwo; MY_FLOAT byteTwo;
MY_FLOAT byteThree; MY_FLOAT byteThree;
long byteTwoInt; long byteTwoInt;
long byteThreeInt; long byteThreeInt;
char remainderString[1024]; char remainderString[1024];
char whatString[1024]; char whatString[1024];
}; };
static const double Midi2Pitch[129] = { static const double Midi2Pitch[129] = {
8.18,8.66,9.18,9.72,10.30,10.91,11.56,12.25, 8.18,8.66,9.18,9.72,10.30,10.91,11.56,12.25,
12.98,13.75,14.57,15.43,16.35,17.32,18.35,19.45, 12.98,13.75,14.57,15.43,16.35,17.32,18.35,19.45,
20.60,21.83,23.12,24.50,25.96,27.50,29.14,30.87, 20.60,21.83,23.12,24.50,25.96,27.50,29.14,30.87,
32.70,34.65,36.71,38.89,41.20,43.65,46.25,49.00, 32.70,34.65,36.71,38.89,41.20,43.65,46.25,49.00,
51.91,55.00,58.27,61.74,65.41,69.30,73.42,77.78, 51.91,55.00,58.27,61.74,65.41,69.30,73.42,77.78,
82.41,87.31,92.50,98.00,103.83,110.00,116.54,123.47, 82.41,87.31,92.50,98.00,103.83,110.00,116.54,123.47,
130.81,138.59,146.83,155.56,164.81,174.61,185.00,196.00, 130.81,138.59,146.83,155.56,164.81,174.61,185.00,196.00,
207.65,220.00,233.08,246.94,261.63,277.18,293.66,311.13, 207.65,220.00,233.08,246.94,261.63,277.18,293.66,311.13,
329.63,349.23,369.99,392.00,415.30,440.00,466.16,493.88, 329.63,349.23,369.99,392.00,415.30,440.00,466.16,493.88,
523.25,554.37,587.33,622.25,659.26,698.46,739.99,783.99, 523.25,554.37,587.33,622.25,659.26,698.46,739.99,783.99,
830.61,880.00,932.33,987.77,1046.50,1108.73,1174.66,1244.51, 830.61,880.00,932.33,987.77,1046.50,1108.73,1174.66,1244.51,
1318.51,1396.91,1479.98,1567.98,1661.22,1760.00,1864.66,1975.53, 1318.51,1396.91,1479.98,1567.98,1661.22,1760.00,1864.66,1975.53,
2093.00,2217.46,2349.32,2489.02,2637.02,2793.83,2959.96,3135.96, 2093.00,2217.46,2349.32,2489.02,2637.02,2793.83,2959.96,3135.96,
3322.44,3520.00,3729.31,3951.07,4186.01,4434.92,4698.64,4978.03, 3322.44,3520.00,3729.31,3951.07,4186.01,4434.92,4698.64,4978.03,
5274.04,5587.65,5919.91,6271.93,6644.88,7040.00,7458.62,7902.13, 5274.04,5587.65,5919.91,6271.93,6644.88,7040.00,7458.62,7902.13,
8372.02,8869.84,9397.27,9956.06,10548.08,11175.30,11839.82,12543.85, 8372.02,8869.84,9397.27,9956.06,10548.08,11175.30,11839.82,12543.85,
13289.75}; 13289.75};
#endif #endif

View File

@@ -1,123 +1,124 @@
/*********************************************************/ /*********************************************************/
/* /*
Definition of SKINI Message Types and Special Symbols Definition of SKINI Message Types and Special Symbols
Synthesis toolKit Instrument Network Interface Synthesis toolKit Instrument Network Interface
These symbols should have the form __SK_<name>_ These symbols should have the form __SK_<name>_
Where <name> is the string used in the SKINI stream. Where <name> is the string used in the SKINI stream.
by Perry R. Cook, 1995 - 2002. by Perry R. Cook, 1995 - 2002.
*/ */
/*********************************************************/ /*********************************************************/
/***** MIDI COMPATIBLE MESSAGES *****/ /***** MIDI COMPATIBLE MESSAGES *****/
/***** Status Bytes Have Channel=0 **/ /***** Status Bytes Have Channel=0 **/
#define NOPE -32767 #define NOPE -32767
#define YEP 1 #define YEP 1
#define SK_DBL -32766 #define SK_DBL -32766
#define SK_INT -32765 #define SK_INT -32765
#define SK_STR -32764 #define SK_STR -32764
#define __SK_NoteOff_ 128 #define __SK_NoteOff_ 128
#define __SK_NoteOn_ 144 #define __SK_NoteOn_ 144
#define __SK_PolyPressure_ 160 #define __SK_PolyPressure_ 160
#define __SK_ControlChange_ 176 #define __SK_ControlChange_ 176
#define __SK_ProgramChange_ 192 #define __SK_ProgramChange_ 192
#define __SK_AfterTouch_ 208 #define __SK_AfterTouch_ 208
#define __SK_ChannelPressure_ __SK_AfterTouch_ #define __SK_ChannelPressure_ __SK_AfterTouch_
#define __SK_PitchWheel_ 224 #define __SK_PitchWheel_ 224
#define __SK_PitchBend_ __SK_PitchWheel_ #define __SK_PitchBend_ __SK_PitchWheel_
#define __SK_PitchChange_ 249
#define __SK_Clock_ 248
#define __SK_SongStart_ 250 #define __SK_Clock_ 248
#define __SK_Continue_ 251 #define __SK_SongStart_ 250
#define __SK_SongStop_ 252 #define __SK_Continue_ 251
#define __SK_ActiveSensing_ 254 #define __SK_SongStop_ 252
#define __SK_SystemReset_ 255 #define __SK_ActiveSensing_ 254
#define __SK_SystemReset_ 255
#define __SK_Volume_ 7
#define __SK_ModWheel_ 1 #define __SK_Volume_ 7
#define __SK_Modulation_ __SK_ModWheel_ #define __SK_ModWheel_ 1
#define __SK_Breath_ 2 #define __SK_Modulation_ __SK_ModWheel_
#define __SK_FootControl_ 4 #define __SK_Breath_ 2
#define __SK_Portamento_ 65 #define __SK_FootControl_ 4
#define __SK_Balance_ 8 #define __SK_Portamento_ 65
#define __SK_Pan_ 10 #define __SK_Balance_ 8
#define __SK_Sustain_ 64 #define __SK_Pan_ 10
#define __SK_Damper_ __SK_Sustain_ #define __SK_Sustain_ 64
#define __SK_Expression_ 11 #define __SK_Damper_ __SK_Sustain_
#define __SK_Expression_ 11
#define __SK_AfterTouch_Cont_ 128
#define __SK_ModFrequency_ __SK_Expression_ #define __SK_AfterTouch_Cont_ 128
#define __SK_ModFrequency_ __SK_Expression_
#define __SK_ProphesyRibbon_ 16
#define __SK_ProphesyWheelUp_ 2 #define __SK_ProphesyRibbon_ 16
#define __SK_ProphesyWheelDown_ 3 #define __SK_ProphesyWheelUp_ 2
#define __SK_ProphesyPedal_ 18 #define __SK_ProphesyWheelDown_ 3
#define __SK_ProphesyKnob1_ 21 #define __SK_ProphesyPedal_ 18
#define __SK_ProphesyKnob2_ 22 #define __SK_ProphesyKnob1_ 21
#define __SK_ProphesyKnob2_ 22
/*** Instrument Family Specific ***/
/*** Instrument Family Specific ***/
#define __SK_NoiseLevel_ __SK_FootControl_
#define __SK_NoiseLevel_ __SK_FootControl_
#define __SK_PickPosition_ __SK_FootControl_
#define __SK_StringDamping_ __SK_Expression_ #define __SK_PickPosition_ __SK_FootControl_
#define __SK_StringDetune_ __SK_ModWheel_ #define __SK_StringDamping_ __SK_Expression_
#define __SK_BodySize_ __SK_Breath_ #define __SK_StringDetune_ __SK_ModWheel_
#define __SK_BowPressure_ __SK_Breath_ #define __SK_BodySize_ __SK_Breath_
#define __SK_BowPosition_ __SK_PickPosition_ #define __SK_BowPressure_ __SK_Breath_
#define __SK_BowBeta_ __SK_BowPosition_ #define __SK_BowPosition_ __SK_PickPosition_
#define __SK_BowBeta_ __SK_BowPosition_
#define __SK_ReedStiffness_ __SK_Breath_
#define __SK_ReedRestPos_ __SK_FootControl_ #define __SK_ReedStiffness_ __SK_Breath_
#define __SK_ReedRestPos_ __SK_FootControl_
#define __SK_FluteEmbouchure_ __SK_Breath_
#define __SK_JetDelay_ __SK_FluteEmbouchure_ #define __SK_FluteEmbouchure_ __SK_Breath_
#define __SK_JetDelay_ __SK_FluteEmbouchure_
#define __SK_LipTension_ __SK_Breath_
#define __SK_SlideLength_ __SK_FootControl_ #define __SK_LipTension_ __SK_Breath_
#define __SK_SlideLength_ __SK_FootControl_
#define __SK_StrikePosition_ __SK_PickPosition_
#define __SK_StickHardness_ __SK_Breath_ #define __SK_StrikePosition_ __SK_PickPosition_
#define __SK_StickHardness_ __SK_Breath_
#define __SK_TrillDepth_ 1051
#define __SK_TrillSpeed_ 1052 #define __SK_TrillDepth_ 1051
#define __SK_StrumSpeed_ __SK_TrillSpeed_ #define __SK_TrillSpeed_ 1052
#define __SK_RollSpeed_ __SK_TrillSpeed_ #define __SK_StrumSpeed_ __SK_TrillSpeed_
#define __SK_RollSpeed_ __SK_TrillSpeed_
#define __SK_FilterQ_ __SK_Breath_
#define __SK_FilterFreq_ 1062 #define __SK_FilterQ_ __SK_Breath_
#define __SK_FilterSweepRate_ __SK_FootControl_ #define __SK_FilterFreq_ 1062
#define __SK_FilterSweepRate_ __SK_FootControl_
#define __SK_ShakerInst_ 1071
#define __SK_ShakerEnergy_ __SK_Breath_ #define __SK_ShakerInst_ 1071
#define __SK_ShakerDamping_ __SK_ModFrequency_ #define __SK_ShakerEnergy_ __SK_Breath_
#define __SK_ShakerNumObjects_ __SK_FootControl_ #define __SK_ShakerDamping_ __SK_ModFrequency_
#define __SK_ShakerNumObjects_ __SK_FootControl_
#define __SK_Strumming_ 1090
#define __SK_NotStrumming_ 1091 #define __SK_Strumming_ 1090
#define __SK_Trilling_ 1092 #define __SK_NotStrumming_ 1091
#define __SK_NotTrilling_ 1093 #define __SK_Trilling_ 1092
#define __SK_Rolling_ __SK_Strumming_ #define __SK_NotTrilling_ 1093
#define __SK_NotRolling_ __SK_NotStrumming_ #define __SK_Rolling_ __SK_Strumming_
#define __SK_NotRolling_ __SK_NotStrumming_
#define __SK_PlayerSkill_ 2001
#define __SK_Chord_ 2002 #define __SK_PlayerSkill_ 2001
#define __SK_ChordOff_ 2003 #define __SK_Chord_ 2002
#define __SK_ChordOff_ 2003
#define __SK_SINGER_FilePath_ 3000
#define __SK_SINGER_Frequency_ 3001 #define __SK_SINGER_FilePath_ 3000
#define __SK_SINGER_NoteName_ 3002 #define __SK_SINGER_Frequency_ 3001
#define __SK_SINGER_Shape_ 3003 #define __SK_SINGER_NoteName_ 3002
#define __SK_SINGER_Glot_ 3004 #define __SK_SINGER_Shape_ 3003
#define __SK_SINGER_VoicedUnVoiced_ 3005 #define __SK_SINGER_Glot_ 3004
#define __SK_SINGER_Synthesize_ 3006 #define __SK_SINGER_VoicedUnVoiced_ 3005
#define __SK_SINGER_Silence_ 3007 #define __SK_SINGER_Synthesize_ 3006
#define __SK_SINGER_VibratoAmt_ __SK_ModWheel_ #define __SK_SINGER_Silence_ 3007
#define __SK_SINGER_RndVibAmt_ 3008 #define __SK_SINGER_VibratoAmt_ __SK_ModWheel_
#define __SK_SINGER_VibFreq_ __SK_Expression_ #define __SK_SINGER_RndVibAmt_ 3008
#define __SK_SINGER_VibFreq_ __SK_Expression_

View File

@@ -1,130 +1,131 @@
#include "SKINI.msg" #include "SKINI.msg"
#define __SK_MaxMsgTypes_ 128 #define __SK_MaxMsgTypes_ 128
struct SKINISpec { char messageString[32]; struct SKINISpec { char messageString[32];
long type; long type;
long data2; long data2;
long data3; long data3;
}; };
/* SEE COMMENT BLOCK AT BOTTOM FOR FIELDS AND USES */ /* SEE COMMENT BLOCK AT BOTTOM FOR FIELDS AND USES */
/* MessageString ,type, ch?, data2 , data3 */ /* MessageString ,type, ch?, data2 , data3 */
struct SKINISpec skini_msgs[__SK_MaxMsgTypes_] = struct SKINISpec skini_msgs[__SK_MaxMsgTypes_] =
{ {
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL}, {"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL}, {"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
{"PolyPressure" , __SK_PolyPressure_, SK_DBL, SK_DBL}, {"PolyPressure" , __SK_PolyPressure_, SK_DBL, SK_DBL},
{"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL}, {"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
{"ProgramChange" , __SK_ProgramChange_, SK_DBL, SK_DBL}, {"ProgramChange" , __SK_ProgramChange_, SK_DBL, SK_DBL},
{"AfterTouch" , __SK_AfterTouch_, SK_DBL, NOPE}, {"AfterTouch" , __SK_AfterTouch_, SK_DBL, NOPE},
{"ChannelPressure" ,__SK_ChannelPressure_, SK_DBL, NOPE}, {"ChannelPressure" ,__SK_ChannelPressure_, SK_DBL, NOPE},
{"PitchWheel" , __SK_PitchWheel_, SK_DBL, NOPE}, {"PitchWheel" , __SK_PitchWheel_, SK_DBL, NOPE},
{"PitchBend" , __SK_PitchBend_, SK_DBL, NOPE}, {"PitchBend" , __SK_PitchBend_, SK_DBL, NOPE},
{"PitchChange" , __SK_PitchChange_, SK_DBL, NOPE},
{"Clock" , __SK_Clock_, NOPE, NOPE},
{"Undefined" , 249, NOPE, NOPE}, {"Clock" , __SK_Clock_, NOPE, NOPE},
{"SongStart" , __SK_SongStart_, NOPE, NOPE}, {"Undefined" , 249, NOPE, NOPE},
{"Continue" , __SK_Continue_, NOPE, NOPE}, {"SongStart" , __SK_SongStart_, NOPE, NOPE},
{"SongStop" , __SK_SongStop_, NOPE, NOPE}, {"Continue" , __SK_Continue_, NOPE, NOPE},
{"Undefined" , 253, NOPE, NOPE}, {"SongStop" , __SK_SongStop_, NOPE, NOPE},
{"ActiveSensing" , __SK_ActiveSensing_, NOPE, NOPE}, {"Undefined" , 253, NOPE, NOPE},
{"SystemReset" , __SK_SystemReset_, NOPE, NOPE}, {"ActiveSensing" , __SK_ActiveSensing_, NOPE, NOPE},
{"SystemReset" , __SK_SystemReset_, NOPE, NOPE},
{"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL},
{"ModWheel" , __SK_ControlChange_, __SK_ModWheel_ , SK_DBL}, {"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL},
{"Modulation" , __SK_ControlChange_, __SK_Modulation_ , SK_DBL}, {"ModWheel" , __SK_ControlChange_, __SK_ModWheel_ , SK_DBL},
{"Breath" , __SK_ControlChange_, __SK_Breath_ , SK_DBL}, {"Modulation" , __SK_ControlChange_, __SK_Modulation_ , SK_DBL},
{"FootControl" , __SK_ControlChange_, __SK_FootControl_ , SK_DBL}, {"Breath" , __SK_ControlChange_, __SK_Breath_ , SK_DBL},
{"Portamento" , __SK_ControlChange_, __SK_Portamento_ , SK_DBL}, {"FootControl" , __SK_ControlChange_, __SK_FootControl_ , SK_DBL},
{"Balance" , __SK_ControlChange_, __SK_Balance_ , SK_DBL}, {"Portamento" , __SK_ControlChange_, __SK_Portamento_ , SK_DBL},
{"Pan" , __SK_ControlChange_, __SK_Pan_ , SK_DBL}, {"Balance" , __SK_ControlChange_, __SK_Balance_ , SK_DBL},
{"Sustain" , __SK_ControlChange_, __SK_Sustain_ , SK_DBL}, {"Pan" , __SK_ControlChange_, __SK_Pan_ , SK_DBL},
{"Damper" , __SK_ControlChange_, __SK_Damper_ , SK_DBL}, {"Sustain" , __SK_ControlChange_, __SK_Sustain_ , SK_DBL},
{"Expression" , __SK_ControlChange_, __SK_Expression_ , SK_DBL}, {"Damper" , __SK_ControlChange_, __SK_Damper_ , SK_DBL},
{"Expression" , __SK_ControlChange_, __SK_Expression_ , SK_DBL},
{"NoiseLevel" , __SK_ControlChange_, __SK_NoiseLevel_ , SK_DBL},
{"PickPosition" , __SK_ControlChange_, __SK_PickPosition_ , SK_DBL}, {"NoiseLevel" , __SK_ControlChange_, __SK_NoiseLevel_ , SK_DBL},
{"StringDamping" , __SK_ControlChange_, __SK_StringDamping_ , SK_DBL}, {"PickPosition" , __SK_ControlChange_, __SK_PickPosition_ , SK_DBL},
{"StringDetune" , __SK_ControlChange_, __SK_StringDetune_ , SK_DBL}, {"StringDamping" , __SK_ControlChange_, __SK_StringDamping_ , SK_DBL},
{"BodySize" , __SK_ControlChange_, __SK_BodySize_ , SK_DBL}, {"StringDetune" , __SK_ControlChange_, __SK_StringDetune_ , SK_DBL},
{"BowPressure" , __SK_ControlChange_, __SK_BowPressure_ , SK_DBL}, {"BodySize" , __SK_ControlChange_, __SK_BodySize_ , SK_DBL},
{"BowPosition" , __SK_ControlChange_, __SK_BowPosition_ , SK_DBL}, {"BowPressure" , __SK_ControlChange_, __SK_BowPressure_ , SK_DBL},
{"BowBeta" , __SK_ControlChange_, __SK_BowBeta_ , SK_DBL}, {"BowPosition" , __SK_ControlChange_, __SK_BowPosition_ , SK_DBL},
{"BowBeta" , __SK_ControlChange_, __SK_BowBeta_ , SK_DBL},
{"ReedStiffness" , __SK_ControlChange_, __SK_ReedStiffness_ , SK_DBL},
{"ReedRestPos" , __SK_ControlChange_, __SK_ReedRestPos_ , SK_DBL}, {"ReedStiffness" , __SK_ControlChange_, __SK_ReedStiffness_ , SK_DBL},
{"FluteEmbouchure" , __SK_ControlChange_, __SK_FluteEmbouchure_, SK_DBL}, {"ReedRestPos" , __SK_ControlChange_, __SK_ReedRestPos_ , SK_DBL},
{"LipTension" , __SK_ControlChange_, __SK_LipTension_ , SK_DBL}, {"FluteEmbouchure" , __SK_ControlChange_, __SK_FluteEmbouchure_, SK_DBL},
{"StrikePosition" , __SK_ControlChange_, __SK_StrikePosition_, SK_DBL}, {"LipTension" , __SK_ControlChange_, __SK_LipTension_ , SK_DBL},
{"StickHardness" , __SK_ControlChange_, __SK_StickHardness_ , SK_DBL}, {"StrikePosition" , __SK_ControlChange_, __SK_StrikePosition_, SK_DBL},
{"StickHardness" , __SK_ControlChange_, __SK_StickHardness_ , SK_DBL},
{"TrillDepth" , __SK_ControlChange_, __SK_TrillDepth_ , SK_DBL},
{"TrillSpeed" , __SK_ControlChange_, __SK_TrillSpeed_ , SK_DBL}, {"TrillDepth" , __SK_ControlChange_, __SK_TrillDepth_ , SK_DBL},
{"TrillSpeed" , __SK_ControlChange_, __SK_TrillSpeed_ , SK_DBL},
{"Strumming" , __SK_ControlChange_, __SK_Strumming_ , 127 },
{"NotStrumming" , __SK_ControlChange_, __SK_Strumming_ , 0 }, {"Strumming" , __SK_ControlChange_, __SK_Strumming_ , 127 },
{"NotStrumming" , __SK_ControlChange_, __SK_Strumming_ , 0 },
{"PlayerSkill" , __SK_ControlChange_, __SK_PlayerSkill_ , SK_DBL},
{"PlayerSkill" , __SK_ControlChange_, __SK_PlayerSkill_ , SK_DBL},
{"Chord" , __SK_Chord_ , SK_DBL , SK_STR },
{"ChordOff" , __SK_ChordOff_ , SK_DBL , NOPE }, {"Chord" , __SK_Chord_ , SK_DBL , SK_STR },
{"ChordOff" , __SK_ChordOff_ , SK_DBL , NOPE },
{"ShakerInst" , __SK_ControlChange_, __SK_ShakerInst_ , SK_DBL},
{"Maraca" , __SK_ControlChange_, __SK_ShakerInst_ , 0 }, {"ShakerInst" , __SK_ControlChange_, __SK_ShakerInst_ , SK_DBL},
{"Sekere" , __SK_ControlChange_, __SK_ShakerInst_ , 1 }, {"Maraca" , __SK_ControlChange_, __SK_ShakerInst_ , 0 },
{"Cabasa" , __SK_ControlChange_, __SK_ShakerInst_ , 2 }, {"Sekere" , __SK_ControlChange_, __SK_ShakerInst_ , 1 },
{"Bamboo" , __SK_ControlChange_, __SK_ShakerInst_ , 3 }, {"Cabasa" , __SK_ControlChange_, __SK_ShakerInst_ , 2 },
{"Waterdrp" , __SK_ControlChange_, __SK_ShakerInst_ , 4 }, {"Bamboo" , __SK_ControlChange_, __SK_ShakerInst_ , 3 },
{"Tambourn" , __SK_ControlChange_, __SK_ShakerInst_ , 5 }, {"Waterdrp" , __SK_ControlChange_, __SK_ShakerInst_ , 4 },
{"Sleighbl" , __SK_ControlChange_, __SK_ShakerInst_ , 6 }, {"Tambourn" , __SK_ControlChange_, __SK_ShakerInst_ , 5 },
{"Guiro" , __SK_ControlChange_, __SK_ShakerInst_ , 7 }, {"Sleighbl" , __SK_ControlChange_, __SK_ShakerInst_ , 6 },
{"Guiro" , __SK_ControlChange_, __SK_ShakerInst_ , 7 },
{"OpenFile" , 256, SK_STR , NOPE},
{"SetPath" , 257, SK_STR , NOPE}, {"OpenFile" , 256, SK_STR , NOPE},
{"SetPath" , 257, SK_STR , NOPE},
{"FilePath" , __SK_SINGER_FilePath_, SK_STR , NOPE},
{"Frequency" , __SK_SINGER_Frequency_, SK_STR , NOPE}, {"FilePath" , __SK_SINGER_FilePath_, SK_STR , NOPE},
{"NoteName" , __SK_SINGER_NoteName_, SK_STR , NOPE}, {"Frequency" , __SK_SINGER_Frequency_, SK_STR , NOPE},
{"VocalShape" , __SK_SINGER_Shape_ , SK_STR , NOPE}, {"NoteName" , __SK_SINGER_NoteName_, SK_STR , NOPE},
{"Glottis" , __SK_SINGER_Glot_ , SK_STR , NOPE}, {"VocalShape" , __SK_SINGER_Shape_ , SK_STR , NOPE},
{"VoicedUnVoiced" , __SK_SINGER_VoicedUnVoiced_, SK_DBL , SK_STR}, {"Glottis" , __SK_SINGER_Glot_ , SK_STR , NOPE},
{"Synthesize" , __SK_SINGER_Synthesize_, SK_STR , NOPE}, {"VoicedUnVoiced" , __SK_SINGER_VoicedUnVoiced_, SK_DBL , SK_STR},
{"Silence" , __SK_SINGER_Silence_, SK_STR , NOPE}, {"Synthesize" , __SK_SINGER_Synthesize_, SK_STR , NOPE},
{"VibratoAmt" , __SK_ControlChange_ ,__SK_SINGER_VibratoAmt_,SK_DBL}, {"Silence" , __SK_SINGER_Silence_, SK_STR , NOPE},
{"RndVibAmt" , __SK_SINGER_RndVibAmt_ ,SK_STR, NOPE}, {"VibratoAmt" , __SK_ControlChange_ ,__SK_SINGER_VibratoAmt_,SK_DBL},
{"VibFreq" , __SK_ControlChange_ ,__SK_SINGER_VibFreq_ ,SK_DBL} {"RndVibAmt" , __SK_SINGER_RndVibAmt_ ,SK_STR, NOPE},
}; {"VibFreq" , __SK_ControlChange_ ,__SK_SINGER_VibFreq_ ,SK_DBL}
};
/** FORMAT: *************************************************************/
/* */ /** FORMAT: *************************************************************/
/* MessageStr$ ,type, data2, data3, */ /* */
/* */ /* MessageStr$ ,type, data2, data3, */
/* type is the message type sent back from the SKINI line parser. */ /* */
/* data<n> is either */ /* type is the message type sent back from the SKINI line parser. */
/* NOPE : field not used, specifically, there aren't going */ /* data<n> is either */
/* to be any more fields on this line. So if there */ /* NOPE : field not used, specifically, there aren't going */
/* is is NOPE in data2, data3 won't even be checked */ /* to be any more fields on this line. So if there */
/* SK_INT : byte (actually scanned as 32 bit signed integer) */ /* is is NOPE in data2, data3 won't even be checked */
/* If it's a MIDI data field which is required to */ /* SK_INT : byte (actually scanned as 32 bit signed integer) */
/* be an integer, like a controller number, it's */ /* If it's a MIDI data field which is required to */
/* 0-127. Otherwise) get creative with SK_INTs */ /* be an integer, like a controller number, it's */
/* SK_DBL : double precision floating point. SKINI uses these */ /* 0-127. Otherwise) get creative with SK_INTs */
/* in the MIDI context for note numbers with micro */ /* SK_DBL : double precision floating point. SKINI uses these */
/* tuning, velocities, controller values, etc. */ /* in the MIDI context for note numbers with micro */
/* SK_STR : only valid in final field. This allows (nearly) */ /* tuning, velocities, controller values, etc. */
/* arbitrary message types to be supported by simply */ /* SK_STR : only valid in final field. This allows (nearly) */
/* scanning the string to EndOfLine and then passing */ /* arbitrary message types to be supported by simply */
/* it to a more intellegent handler. For example, */ /* scanning the string to EndOfLine and then passing */
/* MIDI SYSEX (system exclusive) messages of up to */ /* it to a more intellegent handler. For example, */
/* 256bytes can be read as space-delimited integers */ /* MIDI SYSEX (system exclusive) messages of up to */
/* into the 1K SK_STR buffer. Longer bulk dumps, */ /* 256bytes can be read as space-delimited integers */
/* soundfiles, etc. should be handled as a new */ /* into the 1K SK_STR buffer. Longer bulk dumps, */
/* message type pointing to a FileName stored in the */ /* soundfiles, etc. should be handled as a new */
/* SK_STR field, or as a new type of multi-line */ /* message type pointing to a FileName stored in the */
/* message. */ /* SK_STR field, or as a new type of multi-line */
/* */ /* message. */
/*************************************************************************/ /* */
/*************************************************************************/

90
include/SingWave.h Normal file
View File

@@ -0,0 +1,90 @@
/***************************************************/
/*! \class SingWave
\brief STK "singing" looped soundfile class.
This class contains all that is needed to make
a pitched musical sound, like a simple voice
or violin. In general, it will not be used
alone because of munchkinification effects
from pitch shifting. It will be used as an
excitation source for other instruments.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__SINGWAVE_H)
#define __SINGWAVE_H
#include "WaveLoop.h"
#include "Modulate.h"
#include "Envelope.h"
class SingWave : public Stk
{
public:
//! Class constructor taking filename argument.
/*!
An StkError will be thrown if the file is not found, its format is
unknown, or a read error occurs.
*/
SingWave(const char *fileName, bool raw=FALSE);
//! Class destructor.
~SingWave();
//! Reset file to beginning.
void reset();
//! Normalize the file to a maximum of +-1.0.
void normalize();
//! Normalize the file to a maximum of \e +- peak.
void normalize(MY_FLOAT peak);
//! Set instrument parameters for a particular frequency.
void setFrequency(MY_FLOAT frequency);
//! Set the vibrato frequency in Hz.
void setVibratoRate(MY_FLOAT aRate);
//! Set the vibrato gain.
void setVibratoGain(MY_FLOAT gain);
//! Set the random-ness amount.
void setRandomGain(MY_FLOAT gain);
//! Set the sweep rate.
void setSweepRate(MY_FLOAT aRate);
//! Set the gain rate.
void setGainRate(MY_FLOAT aRate);
//! Set the gain target value.
void setGainTarget(MY_FLOAT target);
//! Start a note.
void noteOn();
//! Stop a note.
void noteOff();
//! Return the last output value.
MY_FLOAT lastOut();
//! Compute one output sample.
MY_FLOAT tick();
protected:
WaveLoop *wave;
Modulate *modulator;
Envelope *envelope;
Envelope *pitchEnvelope;
MY_FLOAT rate;
MY_FLOAT sweepRate;
MY_FLOAT lastOutput;
};
#endif

View File

@@ -1,103 +1,103 @@
/***************************************************/ /***************************************************/
/*! \class Socket /*! \class Socket
\brief STK TCP socket client/server class. \brief STK TCP socket client/server class.
This class provides a uniform cross-platform This class provides a uniform cross-platform
TCP socket client or socket server interface. TCP socket client or socket server interface.
Methods are provided for reading or writing Methods are provided for reading or writing
data buffers to/from connections. This class data buffers to/from connections. This class
also provides a number of static functions for also provides a number of static functions for
use with external socket descriptors. use with external socket descriptors.
The user is responsible for checking the values The user is responsible for checking the values
returned by the read/write methods. Values returned by the read/write methods. Values
less than or equal to zero indicate a closed less than or equal to zero indicate a closed
or lost connection or the occurence of an error. or lost connection or the occurence of an error.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__SOCKET_H) #if !defined(__SOCKET_H)
#define __SOCKET_H #define __SOCKET_H
#include "Stk.h" #include "Stk.h"
class Socket : public Stk class Socket : public Stk
{ {
public: public:
//! Default constructor which creates a local socket server on port 2006 (or the specified port number). //! Default constructor which creates a local socket server on port 2006 (or the specified port number).
/*! /*!
An StkError will be thrown if a socket error occurs during instantiation. An StkError will be thrown if a socket error occurs during instantiation.
*/ */
Socket( int port = 2006 ); Socket( int port = 2006 );
//! Class constructor which creates a socket client connection to the specified host and port. //! Class constructor which creates a socket client connection to the specified host and port.
/*! /*!
An StkError will be thrown if a socket error occurs during instantiation. An StkError will be thrown if a socket error occurs during instantiation.
*/ */
Socket( int port, const char *hostname ); Socket( int port, const char *hostname );
//! The class destructor closes the socket instance, breaking any existing connections. //! The class destructor closes the socket instance, breaking any existing connections.
~Socket(); ~Socket();
//! Connect a socket client to the specified host and port and returns the resulting socket descriptor. //! Connect a socket client to the specified host and port and returns the resulting socket descriptor.
/*! /*!
This method is valid for socket clients only. If it is called for This method is valid for socket clients only. If it is called for
a socket server, -1 is returned. If the socket client is already a socket server, -1 is returned. If the socket client is already
connected, that connection is terminated and a new connection is connected, that connection is terminated and a new connection is
attempted. Server connections are made using the accept() method. attempted. Server connections are made using the accept() method.
An StkError will be thrown if a socket error occurs during An StkError will be thrown if a socket error occurs during
instantiation. \sa accept instantiation. \sa accept
*/ */
int connect( int port, const char *hostname = "localhost" ); int connect( int port, const char *hostname = "localhost" );
//! Close this socket. //! Close this socket.
void close( void ); void close( void );
//! Return the server/client socket descriptor. //! Return the server/client socket descriptor.
int socket( void ) const; int socket( void ) const;
//! Return the server/client port number. //! Return the server/client port number.
int port( void ) const; int port( void ) const;
//! If this is a socket server, extract the first pending connection request from the queue and create a new connection, returning the descriptor for the accepted socket. //! If this is a socket server, extract the first pending connection request from the queue and create a new connection, returning the descriptor for the accepted socket.
/*! /*!
If no connection requests are pending and the socket has not If no connection requests are pending and the socket has not
been set non-blocking, this function will block until a connection been set non-blocking, this function will block until a connection
is present. If an error occurs or this is a socket client, -1 is is present. If an error occurs or this is a socket client, -1 is
returned. returned.
*/ */
int accept( void ); int accept( void );
//! If enable = false, the socket is set to non-blocking mode. When first created, sockets are by default in blocking mode. //! If enable = false, the socket is set to non-blocking mode. When first created, sockets are by default in blocking mode.
static void setBlocking( int socket, bool enable ); static void setBlocking( int socket, bool enable );
//! Close the socket with the given descriptor. //! Close the socket with the given descriptor.
static void close( int socket ); static void close( int socket );
//! Returns TRUE is the socket descriptor is valid. //! Returns TRUE is the socket descriptor is valid.
static bool isValid( int socket ); static bool isValid( int socket );
//! Write a buffer over the socket connection. Returns the number of bytes written or -1 if an error occurs. //! Write a buffer over the socket connection. Returns the number of bytes written or -1 if an error occurs.
int writeBuffer(const void *buffer, long bufferSize, int flags = 0); int writeBuffer(const void *buffer, long bufferSize, int flags = 0);
//! Write a buffer via the specified socket. Returns the number of bytes written or -1 if an error occurs. //! Write a buffer via the specified socket. Returns the number of bytes written or -1 if an error occurs.
static int writeBuffer(int socket, const void *buffer, long bufferSize, int flags ); static int writeBuffer(int socket, const void *buffer, long bufferSize, int flags );
//! Read a buffer from the socket connection, up to length \e bufferSize. Returns the number of bytes read or -1 if an error occurs. //! Read a buffer from the socket connection, up to length \e bufferSize. Returns the number of bytes read or -1 if an error occurs.
int readBuffer(void *buffer, long bufferSize, int flags = 0); int readBuffer(void *buffer, long bufferSize, int flags = 0);
//! Read a buffer via the specified socket. Returns the number of bytes read or -1 if an error occurs. //! Read a buffer via the specified socket. Returns the number of bytes read or -1 if an error occurs.
static int readBuffer(int socket, void *buffer, long bufferSize, int flags ); static int readBuffer(int socket, void *buffer, long bufferSize, int flags );
protected: protected:
char msg[256]; char msg[256];
int soket; int soket;
int poort; int poort;
bool server; bool server;
}; };
#endif // defined(__SOCKET_H) #endif // defined(__SOCKET_H)

70
include/Sphere.h Normal file
View File

@@ -0,0 +1,70 @@
/***************************************************/
/*! \class Sphere
\brief STK sphere class.
This class implements a spherical ball with
radius, mass, position, and velocity parameters.
by Perry R. Cook, 1995 - 2002.
*/
/***************************************************/
#if !defined(__SPHERE_H)
#define __SPHERE_H
#include "Vector3D.h"
class Sphere
{
public:
//! Constructor taking an initial radius value.
Sphere(double initRadius);
//! Class destructor.
~Sphere();
//! Set the 3D center position of the sphere.
void setPosition(double anX, double aY, double aZ);
//! Set the 3D velocity of the sphere.
void setVelocity(double anX, double aY, double aZ);
//! Set the radius of the sphere.
void setRadius(double aRadius);
//! Set the mass of the sphere.
void setMass(double aMass);
//! Get the current position of the sphere as a 3D vector.
Vector3D* getPosition();
//! Get the relative position of the given point to the sphere as a 3D vector.
Vector3D* getRelativePosition(Vector3D *aPosition);
//! Set the velcoity of the sphere as a 3D vector.
double getVelocity(Vector3D* aVelocity);
//! Returns the distance from the sphere boundary to the given position (< 0 if inside).
double isInside(Vector3D *aPosition);
//! Get the current sphere radius.
double getRadius();
//! Get the current sphere mass.
double getMass();
//! Increase the current sphere velocity by the given 3D components.
void addVelocity(double anX, double aY, double aZ);
//! Move the sphere for the given time increment.
void tick(double timeIncrement);
private:
Vector3D *myPosition;
Vector3D *myVelocity;
Vector3D workingVector;
double myRadius;
double myMass;
};
#endif

View File

@@ -1,168 +1,174 @@
/***************************************************/ /***************************************************/
/*! \class Stk /*! \class Stk
\brief STK base class \brief STK base class
Nearly all STK classes inherit from this class. Nearly all STK classes inherit from this class.
The global sample rate can be queried and The global sample rate can be queried and
modified via Stk. In addition, this class modified via Stk. In addition, this class
provides error handling and byte-swapping provides error handling and byte-swapping
functions. functions.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__STK_H) #if !defined(__STK_H)
#define __STK_H #define __STK_H
// Most data in STK is passed and calculated with the following // Most data in STK is passed and calculated with the following
// user-definable floating-point type. You can change this to "float" // user-definable floating-point type. You can change this to "float"
// if you prefer or perhaps a "long double" in the future. // if you prefer or perhaps a "long double" in the future.
typedef double MY_FLOAT; typedef double MY_FLOAT;
//! STK error handling class. //! STK error handling class.
/*! /*!
This is a fairly abstract exception handling class. There could This is a fairly abstract exception handling class. There could
be sub-classes to take care of more specific error conditions ... or be sub-classes to take care of more specific error conditions ... or
not. not.
*/ */
class StkError class StkError
{ {
public: public:
enum TYPE { enum TYPE {
WARNING, WARNING,
DEBUG_WARNING, DEBUG_WARNING,
FUNCTION_ARGUMENT, FUNCTION_ARGUMENT,
FILE_NOT_FOUND, FILE_NOT_FOUND,
FILE_UNKNOWN_FORMAT, FILE_UNKNOWN_FORMAT,
FILE_ERROR, FILE_ERROR,
PROCESS_THREAD, PROCESS_THREAD,
PROCESS_SOCKET, PROCESS_SOCKET,
PROCESS_SOCKET_IPADDR, PROCESS_SOCKET_IPADDR,
AUDIO_SYSTEM, AUDIO_SYSTEM,
MIDI_SYSTEM, MIDI_SYSTEM,
UNSPECIFIED UNSPECIFIED
}; };
protected: protected:
char message[256]; char message[256];
TYPE type; TYPE type;
public: public:
//! The constructor. //! The constructor.
StkError(const char *p, TYPE tipe = StkError::UNSPECIFIED); StkError(const char *p, TYPE tipe = StkError::UNSPECIFIED);
//! The destructor. //! The destructor.
virtual ~StkError(void); virtual ~StkError(void);
//! Prints "thrown" error message to stdout. //! Prints "thrown" error message to stdout.
virtual void printMessage(void); virtual void printMessage(void);
//! Returns the "thrown" error message TYPE. //! Returns the "thrown" error message TYPE.
virtual const TYPE& getType(void) { return type; } virtual const TYPE& getType(void) { return type; }
//! Returns the "thrown" error message string. //! Returns the "thrown" error message string.
virtual const char *getMessage(void) const { return message; } virtual const char *getMessage(void) const { return message; }
}; };
class Stk class Stk
{ {
public: public:
typedef unsigned long STK_FORMAT; typedef unsigned long STK_FORMAT;
static const STK_FORMAT STK_SINT8; /*!< -128 to +127 */ static const STK_FORMAT STK_SINT8; /*!< -128 to +127 */
static const STK_FORMAT STK_SINT16; /*!< -32768 to +32767 */ static const STK_FORMAT STK_SINT16; /*!< -32768 to +32767 */
static const STK_FORMAT STK_SINT32; /*!< -2147483648 to +2147483647. */ static const STK_FORMAT STK_SINT32; /*!< -2147483648 to +2147483647. */
static const STK_FORMAT STK_FLOAT32; /*!< Normalized between plus/minus 1.0. */ static const STK_FORMAT STK_FLOAT32; /*!< Normalized between plus/minus 1.0. */
static const STK_FORMAT STK_FLOAT64; /*!< Normalized between plus/minus 1.0. */ static const STK_FORMAT STK_FLOAT64; /*!< Normalized between plus/minus 1.0. */
//! Static method which returns the current STK sample rate. //! Static method which returns the current STK sample rate.
static MY_FLOAT sampleRate(void); static MY_FLOAT sampleRate(void);
//! Static method which sets the STK sample rate. //! Static method which sets the STK sample rate.
/*! /*!
The sample rate set using this method is queried by all STK The sample rate set using this method is queried by all STK
classes which depend on its value. It is initialized to the classes which depend on its value. It is initialized to the
default SRATE set in Stk.h. Many STK classes use the sample rate default SRATE set in Stk.h. Many STK classes use the sample rate
during instantiation. Therefore, if you wish to use a rate which during instantiation. Therefore, if you wish to use a rate which
is different from the default rate, it is imperative that it be is different from the default rate, it is imperative that it be
set \e BEFORE STK objects are instantiated. set \e BEFORE STK objects are instantiated.
*/ */
static void setSampleRate(MY_FLOAT newRate); static void setSampleRate(MY_FLOAT newRate);
//! Static method which byte-swaps a 16-bit data type. //! Static method which byte-swaps a 16-bit data type.
static void swap16(unsigned char *ptr); static void swap16(unsigned char *ptr);
//! Static method which byte-swaps a 32-bit data type. //! Static method which byte-swaps a 32-bit data type.
static void swap32(unsigned char *ptr); static void swap32(unsigned char *ptr);
//! Static method which byte-swaps a 64-bit data type. //! Static method which byte-swaps a 64-bit data type.
static void swap64(unsigned char *ptr); static void swap64(unsigned char *ptr);
//! Static cross-platform method to sleep for a number of milliseconds. //! Static cross-platform method to sleep for a number of milliseconds.
static void sleep(unsigned long milliseconds); static void sleep(unsigned long milliseconds);
private: private:
static MY_FLOAT srate; static MY_FLOAT srate;
protected: protected:
//! Default constructor. //! Default constructor.
Stk(void); Stk(void);
//! Class destructor. //! Class destructor.
virtual ~Stk(void); virtual ~Stk(void);
//! Function for error reporting and handling. //! Function for error reporting and handling.
static void handleError( const char *message, StkError::TYPE type ); static void handleError( const char *message, StkError::TYPE type );
}; };
// Here are a few other useful typedefs. // Here are a few other useful typedefs.
typedef signed short SINT16; typedef signed short SINT16;
typedef signed int SINT32; typedef signed int SINT32;
typedef float FLOAT32; typedef float FLOAT32;
typedef double FLOAT64; typedef double FLOAT64;
// Boolean values // Boolean values
#define FALSE 0 #define FALSE 0
#define TRUE 1 #define TRUE 1
// The default sampling rate. // The default sampling rate.
#define SRATE (MY_FLOAT) 22050.0 #define SRATE (MY_FLOAT) 22050.0
// Real-time audio input and output buffer size. If clicks are // Real-time audio input and output buffer size. If clicks are
// occuring in the input and/or output sound stream, a larger buffer // occuring in the input and/or output sound stream, a larger buffer
// size may help. Larger buffer sizes, however, produce more latency. // size may help. Larger buffer sizes, however, produce more latency.
#define RT_BUFFER_SIZE 512 #define RT_BUFFER_SIZE 512
// The RAWWAVE_PATH definition is concatenated to the beginning of all // The RAWWAVE_PATH definition is concatenated to the beginning of all
// references to rawwave files in the various STK core classes // references to rawwave files in the various STK core classes
// (ex. Clarinet.cpp). If you wish to move the rawwaves directory to // (ex. Clarinet.cpp). If you wish to move the rawwaves directory to
// a different location in your file system, you will need to set this // a different location in your file system, you will need to set this
// path definition appropriately. The current definition is a // path definition appropriately. The current definition is a
// relative reference that will work "out of the box" for the STK // relative reference that will work for the programs in the STK
// distribution. // projects directory. The path can also be specified to configure and
#define RAWWAVE_PATH "../../" // set via the Makefiles.
#if !defined(RAWWAVE_PATH)
#define PI (MY_FLOAT) 3.14159265359 #define RAWWAVE_PATH "../../rawwaves/"
#define TWO_PI (MY_FLOAT) (MY_FLOAT) (2 * PI) #endif
#define ONE_OVER_128 (MY_FLOAT) 0.0078125 #define PI (MY_FLOAT) 3.14159265359
#define TWO_PI (MY_FLOAT) (MY_FLOAT) (2 * PI)
#if defined(__WINDOWS_DS__)
#define __OS_WINDOWS__ #define ONE_OVER_128 (MY_FLOAT) 0.0078125
#define __STK_REALTIME__
#elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__) #if defined(__WINDOWS_DS__)
#define __OS_LINUX__ #define __OS_WINDOWS__
#define __STK_REALTIME__ #define __STK_REALTIME__
#elif defined(__IRIX_AL__) #elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__)
#define __OS_IRIX__ #define __OS_LINUX__
#define __STK_REALTIME__ #define __STK_REALTIME__
#endif #elif defined(__IRIX_AL__)
#define __OS_IRIX__
//#define _STK_DEBUG_ #define __STK_REALTIME__
#elif defined(__MACOSX_CORE__)
#endif #define __OS_MACOSX__
#define __STK_REALTIME__
#endif
//#define _STK_DEBUG_
#endif

View File

@@ -1,43 +1,43 @@
/***************************************************/ /***************************************************/
/*! \class SubNoise /*! \class SubNoise
\brief STK sub-sampled noise generator. \brief STK sub-sampled noise generator.
Generates a new random number every "rate" ticks Generates a new random number every "rate" ticks
using the C rand() function. The quality of the using the C rand() function. The quality of the
rand() function varies from one OS to another. rand() function varies from one OS to another.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__SUBNOISE_H) #if !defined(__SUBNOISE_H)
#define __SUBNOISE_H #define __SUBNOISE_H
#include "Noise.h" #include "Noise.h"
class SubNoise : public Noise class SubNoise : public Noise
{ {
public: public:
//! Default constructor sets sub-sample rate to 16. //! Default constructor sets sub-sample rate to 16.
SubNoise(int subRate = 16); SubNoise(int subRate = 16);
//! Class destructor. //! Class destructor.
~SubNoise(); ~SubNoise();
//! Return the current sub-sampling rate. //! Return the current sub-sampling rate.
int subRate(void) const; int subRate(void) const;
//! Set the sub-sampling rate. //! Set the sub-sampling rate.
void setRate(int subRate); void setRate(int subRate);
//! Return a sub-sampled random number between -1.0 and 1.0. //! Return a sub-sampled random number between -1.0 and 1.0.
MY_FLOAT tick(); MY_FLOAT tick();
protected: protected:
int counter; int counter;
int rate; int rate;
}; };
#endif #endif

View File

@@ -1,54 +1,54 @@
/***************************************************/ /***************************************************/
/*! \class Table /*! \class Table
\brief STK table lookup class. \brief STK table lookup class.
This class loads a table of floating-point This class loads a table of floating-point
doubles, which are assumed to be in big-endian doubles, which are assumed to be in big-endian
format. Linear interpolation is performed for format. Linear interpolation is performed for
fractional lookup indexes. fractional lookup indexes.
An StkError will be thrown if the table file An StkError will be thrown if the table file
is not found. is not found.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__TABLE_H) #if !defined(__TABLE_H)
#define __TABLE_H #define __TABLE_H
#include "Stk.h" #include "Stk.h"
class Table : public Stk class Table : public Stk
{ {
public: public:
//! Constructor loads the data from \e fileName. //! Constructor loads the data from \e fileName.
Table(char *fileName); Table(char *fileName);
//! Class destructor. //! Class destructor.
~Table(); ~Table();
//! Return the number of elements in the table. //! Return the number of elements in the table.
long getLength() const; long getLength() const;
//! Return the last output value. //! Return the last output value.
MY_FLOAT lastOut() const; MY_FLOAT lastOut() const;
//! Return the table value at position \e index. //! Return the table value at position \e index.
/*! /*!
Linear interpolation is performed if \e index is Linear interpolation is performed if \e index is
fractional. fractional.
*/ */
MY_FLOAT tick(MY_FLOAT index); MY_FLOAT tick(MY_FLOAT index);
//! Take \e vectorSize index positions and return the corresponding table values in \e vector. //! Take \e vectorSize index positions and return the corresponding table values in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected: protected:
long length; long length;
MY_FLOAT *data; MY_FLOAT *data;
MY_FLOAT lastOutput; MY_FLOAT lastOutput;
}; };
#endif // defined(__TABLE_H) #endif // defined(__TABLE_H)

View File

@@ -1,113 +1,113 @@
/***************************************************/ /***************************************************/
/*! \class TcpWvIn /*! \class TcpWvIn
\brief STK internet streaming input class. \brief STK internet streaming input class.
This protected Wvin subclass can read streamed This protected Wvin subclass can read streamed
data over a network via a TCP socket connection. data over a network via a TCP socket connection.
The data is assumed in big-endian, or network, The data is assumed in big-endian, or network,
byte order. byte order.
TcpWvIn supports multi-channel data in TcpWvIn supports multi-channel data in
interleaved format. It is important to interleaved format. It is important to
distinguish the tick() methods, which return distinguish the tick() methods, which return
samples produced by averaging across sample samples produced by averaging across sample
frames, from the tickFrame() methods, which frames, from the tickFrame() methods, which
return pointers to multi-channel sample frames. return pointers to multi-channel sample frames.
For single-channel data, these methods return For single-channel data, these methods return
equivalent values. equivalent values.
This class starts a socket server, which waits This class starts a socket server, which waits
for a single remote connection. The default for a single remote connection. The default
data type for the incoming stream is signed data type for the incoming stream is signed
16-bit integers, though any of the defined 16-bit integers, though any of the defined
STK_FORMATs are permissible. STK_FORMATs are permissible.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__TCPWVIN_H) #if !defined(__TCPWVIN_H)
#define __TCPWVIN_H #define __TCPWVIN_H
#include "WvIn.h" #include "WvIn.h"
#include "Socket.h" #include "Socket.h"
#include "Thread.h" #include "Thread.h"
typedef struct { typedef struct {
bool finished; bool finished;
void *object; void *object;
} thread_info; } thread_info;
class TcpWvIn : protected WvIn class TcpWvIn : protected WvIn
{ {
public: public:
//! Default constructor starts a socket server. If not specified, the server is associated with port 2006. //! Default constructor starts a socket server. If not specified, the server is associated with port 2006.
/*! /*!
An StkError will be thrown if an error occurs while initializing the input thread or starting the socket server. An StkError will be thrown if an error occurs while initializing the input thread or starting the socket server.
*/ */
TcpWvIn( int port = 2006 ); TcpWvIn( int port = 2006 );
//! Class destructor. //! Class destructor.
~TcpWvIn(); ~TcpWvIn();
//! Listen for a (new) connection with specified data channels and format. //! Listen for a (new) connection with specified data channels and format.
/*! /*!
An StkError will be thrown a socket error or an invalid function argument. An StkError will be thrown a socket error or an invalid function argument.
*/ */
void listen(unsigned int nChannels = 1, Stk::STK_FORMAT format = STK_SINT16); void listen(unsigned int nChannels = 1, Stk::STK_FORMAT format = STK_SINT16);
//! Returns TRUE is an input connection exists or input data remains in the queue. //! Returns TRUE is an input connection exists or input data remains in the queue.
/*! /*!
This method will not return FALSE after an input connection has been closed until This method will not return FALSE after an input connection has been closed until
all buffered input data has been read out. all buffered input data has been read out.
*/ */
bool isConnected(void); bool isConnected(void);
//! Return the average across the last output sample frame. //! Return the average across the last output sample frame.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Read out the average across one sample frame of data. //! Read out the average across one sample frame of data.
MY_FLOAT tick(void); MY_FLOAT tick(void);
//! Read out vectorSize averaged sample frames of data in \e vector. //! Read out vectorSize averaged sample frames of data in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Return a pointer to the last output sample frame. //! Return a pointer to the last output sample frame.
const MY_FLOAT *lastFrame(void) const; const MY_FLOAT *lastFrame(void) const;
//! Return a pointer to the next sample frame of data. //! Return a pointer to the next sample frame of data.
const MY_FLOAT *tickFrame(void); const MY_FLOAT *tickFrame(void);
//! Read out sample \e frames of data to \e frameVector. //! Read out sample \e frames of data to \e frameVector.
MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames); MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames);
// Called by the thread routine to receive data via the socket connection // 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 // and fill the socket buffer. This is not intended for general use but
// had to be made public for access from the thread. // had to be made public for access from the thread.
void receive(void); void receive(void);
protected: protected:
// Initialize class variables. // Initialize class variables.
void init( int port ); void init( int port );
// Read buffered socket data into the data buffer ... will block if none available. // Read buffered socket data into the data buffer ... will block if none available.
int readData( void ); int readData( void );
Socket *soket; Socket *soket;
Thread *thread; Thread *thread;
Mutex mutex; Mutex mutex;
char *buffer; char *buffer;
long bufferBytes; long bufferBytes;
long bytesFilled; long bytesFilled;
long writePoint; long writePoint;
long readPoint; long readPoint;
long counter; long counter;
int dataSize; int dataSize;
bool connected; bool connected;
int fd; int fd;
thread_info threadInfo; thread_info threadInfo;
}; };
#endif #endif

View File

@@ -1,93 +1,93 @@
/***************************************************/ /***************************************************/
/*! \class TcpWvOut /*! \class TcpWvOut
\brief STK internet streaming output class. \brief STK internet streaming output class.
This protected WvOut subclass can stream This protected WvOut subclass can stream
data over a network via a TCP socket connection. data over a network via a TCP socket connection.
The data is converted to big-endian byte order, The data is converted to big-endian byte order,
if necessary, before being transmitted. if necessary, before being transmitted.
TcpWvOut supports multi-channel data in TcpWvOut supports multi-channel data in
interleaved format. It is important to interleaved format. It is important to
distinguish the tick() methods, which output distinguish the tick() methods, which output
single samples to all channels in a sample single samples to all channels in a sample
frame, from the tickFrame() method, which frame, from the tickFrame() method, which
takes a pointer to multi-channel sample takes a pointer to multi-channel sample
frame data. frame data.
This class connects to a socket server, the This class connects to a socket server, the
port and IP address of which must be specified port and IP address of which must be specified
as constructor arguments. The default data as constructor arguments. The default data
type is signed 16-bit integers but any of the type is signed 16-bit integers but any of the
defined STK_FORMATs are permissible. defined STK_FORMATs are permissible.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__TCPWVOUT_H) #if !defined(__TCPWVOUT_H)
#define __TCPWVOUT_H #define __TCPWVOUT_H
#include "WvOut.h" #include "WvOut.h"
#include "Socket.h" #include "Socket.h"
class TcpWvOut : protected WvOut class TcpWvOut : protected WvOut
{ {
public: public:
//! Default constructor ... the socket is not instantiated. //! Default constructor ... the socket is not instantiated.
TcpWvOut(); TcpWvOut();
//! Overloaded constructor which opens a network connection during instantiation. //! Overloaded constructor which opens a network connection during instantiation.
/*! /*!
An StkError is thrown if a socket error occurs or an invalid argument is specified. An StkError is thrown if a socket error occurs or an invalid argument is specified.
*/ */
TcpWvOut(int port, const char *hostname = "localhost", unsigned int nChannels = 1, Stk::STK_FORMAT format = STK_SINT16); TcpWvOut(int port, const char *hostname = "localhost", unsigned int nChannels = 1, Stk::STK_FORMAT format = STK_SINT16);
//! Class destructor. //! Class destructor.
~TcpWvOut(); ~TcpWvOut();
//! Connect to the specified host and port and prepare to stream \e nChannels of data in the given data format. //! Connect to the specified host and port and prepare to stream \e nChannels of data in the given data format.
/*! /*!
An StkError is thrown if a socket error occurs or an invalid argument is specified. An StkError is thrown if a socket error occurs or an invalid argument is specified.
*/ */
void connect(int port, const char *hostname = "localhost", unsigned int nChannels = 1, Stk::STK_FORMAT format = STK_SINT16); void connect(int port, const char *hostname = "localhost", unsigned int nChannels = 1, Stk::STK_FORMAT format = STK_SINT16);
//! If a connection is open, write out remaining samples in the queue and then disconnect. //! If a connection is open, write out remaining samples in the queue and then disconnect.
void disconnect(void); void disconnect(void);
//! Return the number of sample frames output. //! Return the number of sample frames output.
unsigned long getFrames( void ) const; unsigned long getFrames( void ) const;
//! Return the number of seconds of data output. //! Return the number of seconds of data output.
MY_FLOAT getTime( void ) const; MY_FLOAT getTime( void ) const;
//! Output a single sample to all channels in a sample frame. //! Output a single sample to all channels in a sample frame.
/*! /*!
An StkError is thrown if a socket write error occurs. An StkError is thrown if a socket write error occurs.
*/ */
void tick(MY_FLOAT sample); void tick(MY_FLOAT sample);
//! Output each sample in \e vector to all channels in \e vectorSize sample frames. //! Output each sample in \e vector to all channels in \e vectorSize sample frames.
/*! /*!
An StkError is thrown if a socket write error occurs. An StkError is thrown if a socket write error occurs.
*/ */
void tick(const MY_FLOAT *vector, unsigned int vectorSize); void tick(const MY_FLOAT *vector, unsigned int vectorSize);
//! Output the \e frameVector of sample frames of the given length. //! Output the \e frameVector of sample frames of the given length.
/*! /*!
An StkError is thrown if a socket write error occurs. An StkError is thrown if a socket write error occurs.
*/ */
void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1); void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1);
protected: protected:
// Write a buffer of length \e frames via the socket connection. // Write a buffer of length \e frames via the socket connection.
void writeData( long frames ); void writeData( long frames );
char msg[256]; char msg[256];
char *buffer; char *buffer;
Socket *soket; Socket *soket;
int dataSize; int dataSize;
}; };
#endif // defined(__TCPWVOUT_H) #endif // defined(__TCPWVOUT_H)

View File

@@ -1,95 +1,95 @@
/***************************************************/ /***************************************************/
/*! \class Thread /*! \class Thread
\brief STK thread class. \brief STK thread class.
This class provides a uniform interface for This class provides a uniform interface for
cross-platform threads. On unix systems, cross-platform threads. On unix systems,
the pthread library is used. Under Windows, the pthread library is used. Under Windows,
the C runtime threadex functions are used. the C runtime threadex functions are used.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__THREAD_H) #if !defined(__THREAD_H)
#define __THREAD_H #define __THREAD_H
#include "Stk.h" #include "Stk.h"
#if (defined(__OS_IRIX__) || defined(__OS_LINUX__)) #if (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__))
#include <pthread.h> #include <pthread.h>
#define THREAD_TYPE #define THREAD_TYPE
typedef pthread_t THREAD_HANDLE; typedef pthread_t THREAD_HANDLE;
typedef void * THREAD_RETURN; typedef void * THREAD_RETURN;
typedef void * (*THREAD_FUNCTION)(void *); typedef void * (*THREAD_FUNCTION)(void *);
typedef pthread_mutex_t MUTEX; typedef pthread_mutex_t MUTEX;
#elif defined(__OS_WINDOWS__) #elif defined(__OS_WINDOWS__)
#include <windows.h> #include <windows.h>
#include <process.h> #include <process.h>
#define THREAD_TYPE __stdcall #define THREAD_TYPE __stdcall
typedef unsigned long THREAD_HANDLE; typedef unsigned long THREAD_HANDLE;
typedef unsigned THREAD_RETURN; typedef unsigned THREAD_RETURN;
typedef unsigned (__stdcall *THREAD_FUNCTION)(void *); typedef unsigned (__stdcall *THREAD_FUNCTION)(void *);
typedef CRITICAL_SECTION MUTEX; typedef CRITICAL_SECTION MUTEX;
#endif #endif
class Thread : public Stk class Thread : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
Thread(); Thread();
//! The class destructor waits indefinitely for the thread to end before returning. //! The class destructor waits indefinitely for the thread to end before returning.
~Thread(); ~Thread();
//! Begin execution of the thread \e routine. Upon success, TRUE is returned. //! Begin execution of the thread \e routine. Upon success, TRUE is returned.
/*! /*!
The thread routine can be passed an argument via \e ptr. If The thread routine can be passed an argument via \e ptr. If
the thread cannot be created, the return value is FALSE. the thread cannot be created, the return value is FALSE.
*/ */
bool start( THREAD_FUNCTION routine, void * ptr = NULL ); bool start( THREAD_FUNCTION routine, void * ptr = NULL );
//! Wait the specified number of milliseconds for the thread to terminate. Return TRUE on success. //! Wait the specified number of milliseconds for the thread to terminate. Return TRUE on success.
/*! /*!
If the specified time value is negative, the function will If the specified time value is negative, the function will
block indefinitely. Otherwise, the function will block up to a block indefinitely. Otherwise, the function will block up to a
maximum of the specified time. A return value of FALSE indicates maximum of the specified time. A return value of FALSE indicates
the thread did not terminate within the specified time limit. the thread did not terminate within the specified time limit.
*/ */
bool wait( long milliseconds = -1 ); bool wait( long milliseconds = -1 );
//! Test for a thread cancellation request. //! Test for a thread cancellation request.
static void test(void); static void test(void);
protected: protected:
THREAD_HANDLE thread; THREAD_HANDLE thread;
}; };
class Mutex : public Stk class Mutex : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
Mutex(); Mutex();
//! Class destructor. //! Class destructor.
~Mutex(); ~Mutex();
//! Lock the mutex. //! Lock the mutex.
void lock(void); void lock(void);
//! Unlock the mutex. //! Unlock the mutex.
void unlock(void); void unlock(void);
protected: protected:
MUTEX mutex; MUTEX mutex;
}; };
#endif // defined(__THREAD_H) #endif // defined(__THREAD_H)

View File

@@ -1,78 +1,78 @@
/***************************************************/ /***************************************************/
/*! \class TwoPole /*! \class TwoPole
\brief STK two-pole filter class. \brief STK two-pole filter class.
This protected Filter subclass implements This protected Filter subclass implements
a two-pole digital filter. A method is a two-pole digital filter. A method is
provided for creating a resonance in the provided for creating a resonance in the
frequency response while maintaining a nearly frequency response while maintaining a nearly
constant filter gain. constant filter gain.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__TWOPOLE_H) #if !defined(__TWOPOLE_H)
#define __TWOPOLE_H #define __TWOPOLE_H
#include "Filter.h" #include "Filter.h"
class TwoPole : protected Filter class TwoPole : protected Filter
{ {
public: public:
//! Default constructor creates a second-order pass-through filter. //! Default constructor creates a second-order pass-through filter.
TwoPole(); TwoPole();
//! Class destructor. //! Class destructor.
~TwoPole(); ~TwoPole();
//! Clears the internal states of the filter. //! Clears the internal states of the filter.
void clear(void); void clear(void);
//! Set the b[0] coefficient value. //! Set the b[0] coefficient value.
void setB0(MY_FLOAT b0); void setB0(MY_FLOAT b0);
//! Set the a[1] coefficient value. //! Set the a[1] coefficient value.
void setA1(MY_FLOAT a1); void setA1(MY_FLOAT a1);
//! Set the a[2] coefficient value. //! Set the a[2] coefficient value.
void setA2(MY_FLOAT a2); void setA2(MY_FLOAT a2);
//! Sets the filter coefficients for a resonance at \e frequency (in Hz). //! Sets the filter coefficients for a resonance at \e frequency (in Hz).
/*! /*!
This method determines the filter coefficients corresponding to This method determines the filter coefficients corresponding to
two complex-conjugate poles with the given \e frequency (in Hz) two complex-conjugate poles with the given \e frequency (in Hz)
and \e radius from the z-plane origin. If \e normalize is true, and \e radius from the z-plane origin. If \e normalize is true,
the coefficients are then normalized to produce unity gain at \e the coefficients are then normalized to produce unity gain at \e
frequency (the actual maximum filter gain tends to be slightly frequency (the actual maximum filter gain tends to be slightly
greater than unity when \e radius is not close to one). The greater than unity when \e radius is not close to one). The
resulting filter frequency response has a resonance at the given resulting filter frequency response has a resonance at the given
\e frequency. The closer the poles are to the unit-circle (\e \e frequency. The closer the poles are to the unit-circle (\e
radius close to one), the narrower the resulting resonance width. radius close to one), the narrower the resulting resonance width.
An unstable filter will result for \e radius >= 1.0. For a better An unstable filter will result for \e radius >= 1.0. For a better
resonance filter, use a BiQuad filter. \sa BiQuad filter class resonance filter, use a BiQuad filter. \sa BiQuad filter class
*/ */
void setResonance(MY_FLOAT frequency, MY_FLOAT radius, bool normalize = FALSE); void setResonance(MY_FLOAT frequency, MY_FLOAT radius, bool normalize = FALSE);
//! Set the filter gain. //! Set the filter gain.
/*! /*!
The gain is applied at the filter input and does not affect the The gain is applied at the filter input and does not affect the
coefficient values. The default gain value is 1.0. coefficient values. The default gain value is 1.0.
*/ */
void setGain(MY_FLOAT theGain); void setGain(MY_FLOAT theGain);
//! Return the current filter gain. //! Return the current filter gain.
MY_FLOAT getGain(void) const; MY_FLOAT getGain(void) const;
//! Return the last computed output value. //! Return the last computed output value.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Input one sample to the filter and return one output. //! Input one sample to the filter and return one output.
MY_FLOAT tick(MY_FLOAT sample); MY_FLOAT tick(MY_FLOAT sample);
//! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector. //! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
}; };
#endif #endif

View File

@@ -1,74 +1,74 @@
/***************************************************/ /***************************************************/
/*! \class TwoZero /*! \class TwoZero
\brief STK two-zero filter class. \brief STK two-zero filter class.
This protected Filter subclass implements This protected Filter subclass implements
a two-zero digital filter. A method is a two-zero digital filter. A method is
provided for creating a "notch" in the provided for creating a "notch" in the
frequency response while maintaining a frequency response while maintaining a
constant filter gain. constant filter gain.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__TWOZERO_H) #if !defined(__TWOZERO_H)
#define __TWOZERO_H #define __TWOZERO_H
#include "Filter.h" #include "Filter.h"
class TwoZero : protected Filter class TwoZero : protected Filter
{ {
public: public:
//! Default constructor creates a second-order pass-through filter. //! Default constructor creates a second-order pass-through filter.
TwoZero(); TwoZero();
//! Class destructor. //! Class destructor.
~TwoZero(); ~TwoZero();
//! Clears the internal states of the filter. //! Clears the internal states of the filter.
void clear(void); void clear(void);
//! Set the b[0] coefficient value. //! Set the b[0] coefficient value.
void setB0(MY_FLOAT b0); void setB0(MY_FLOAT b0);
//! Set the b[1] coefficient value. //! Set the b[1] coefficient value.
void setB1(MY_FLOAT b1); void setB1(MY_FLOAT b1);
//! Set the b[2] coefficient value. //! Set the b[2] coefficient value.
void setB2(MY_FLOAT b2); void setB2(MY_FLOAT b2);
//! Sets the filter coefficients for a "notch" at \e frequency (in Hz). //! Sets the filter coefficients for a "notch" at \e frequency (in Hz).
/*! /*!
This method determines the filter coefficients corresponding to This method determines the filter coefficients corresponding to
two complex-conjugate zeros with the given \e frequency (in Hz) two complex-conjugate zeros with the given \e frequency (in Hz)
and \e radius from the z-plane origin. The coefficients are then and \e radius from the z-plane origin. The coefficients are then
normalized to produce a maximum filter gain of one (independent of normalized to produce a maximum filter gain of one (independent of
the filter \e gain parameter). The resulting filter frequency the filter \e gain parameter). The resulting filter frequency
response has a "notch" or anti-resonance at the given \e response has a "notch" or anti-resonance at the given \e
frequency. The closer the zeros are to the unit-circle (\e radius frequency. The closer the zeros are to the unit-circle (\e radius
close to or equal to one), the narrower the resulting notch width. close to or equal to one), the narrower the resulting notch width.
*/ */
void setNotch(MY_FLOAT frequency, MY_FLOAT radius); void setNotch(MY_FLOAT frequency, MY_FLOAT radius);
//! Set the filter gain. //! Set the filter gain.
/*! /*!
The gain is applied at the filter input and does not affect the The gain is applied at the filter input and does not affect the
coefficient values. The default gain value is 1.0. coefficient values. The default gain value is 1.0.
*/ */
void setGain(MY_FLOAT theGain); void setGain(MY_FLOAT theGain);
//! Return the current filter gain. //! Return the current filter gain.
MY_FLOAT getGain(void) const; MY_FLOAT getGain(void) const;
//! Return the last computed output value. //! Return the last computed output value.
MY_FLOAT lastOut(void) const; MY_FLOAT lastOut(void) const;
//! Input one sample to the filter and return one output. //! Input one sample to the filter and return one output.
MY_FLOAT tick(MY_FLOAT sample); MY_FLOAT tick(MY_FLOAT sample);
//! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector. //! Input \e vectorSize samples to the filter and return an equal number of outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
}; };
#endif #endif

53
include/Vector3D.h Normal file
View File

@@ -0,0 +1,53 @@
/***************************************************/
/*! \class Vector3D
\brief STK 3D vector class.
This class implements a three-dimensional vector.
by Perry R. Cook, 1995 - 2002.
*/
/***************************************************/
#if !defined(__VECTOR3D_H)
#define __VECTOR3D_H
class Vector3D {
public:
//! Default constructor taking optional initial X, Y, and Z values.
Vector3D(double initX=0.0, double initY=0.0, double initZ=0.0);
//! Class destructor.
~Vector3D();
//! Get the current X value.
double getX();
//! Get the current Y value.
double getY();
//! Get the current Z value.
double getZ();
//! Calculate the vector length.
double getLength();
//! Set the X, Y, and Z values simultaniously.
void setXYZ(double anX, double aY, double aZ);
//! Set the X value.
void setX(double aval);
//! Set the Y value.
void setY(double aval);
//! Set the Z value.
void setZ(double aval);
protected:
double myX;
double myY;
double myZ;
};
#endif

97
include/VoicForm.h Normal file
View File

@@ -0,0 +1,97 @@
/***************************************************/
/*! \class VoicForm
\brief Four formant synthesis instrument.
This instrument contains an excitation singing
wavetable (looping wave with random and
periodic vibrato, smoothing on frequency,
etc.), excitation noise, and four sweepable
complex resonances.
Measured formant data is included, and enough
data is there to support either parallel or
cascade synthesis. In the floating point case
cascade synthesis is the most natural so
that's what you'll find here.
Control Change Numbers:
- Voiced/Unvoiced Mix = 2
- Vowel/Phoneme Selection = 4
- Vibrato Frequency = 11
- Vibrato Gain = 1
- Loudness (Spectral Tilt) = 128
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__VOICFORM_H)
#define __VOICFORM_H
#include "Instrmnt.h"
#include "Envelope.h"
#include "Noise.h"
#include "SingWave.h"
#include "FormSwep.h"
#include "OnePole.h"
#include "OneZero.h"
class VoicForm : public Instrmnt
{
public:
//! Class constructor, taking the lowest desired playing frequency.
VoicForm();
//! Class destructor.
~VoicForm();
//! Reset and clear all internal state.
void clear();
//! Set instrument parameters for a particular frequency.
void setFrequency(MY_FLOAT frequency);
//! Set instrument parameters for the given phoneme. Returns FALSE if phoneme not found.
bool setPhoneme(const char* phoneme);
//! Set the voiced component gain.
void setVoiced(MY_FLOAT vGain);
//! Set the unvoiced component gain.
void setUnVoiced(MY_FLOAT nGain);
//! Set the sweep rate for a particular formant filter (0-3).
void setFilterSweepRate(int whichOne, MY_FLOAT rate);
//! Set voiced component pitch sweep rate.
void setPitchSweepRate(MY_FLOAT rate);
//! Start the voice.
void speak();
//! Stop the voice.
void quiet();
//! Start a note with the given frequency and amplitude.
void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude);
//! Stop a note with the given amplitude (speed of decay).
void noteOff(MY_FLOAT amplitude);
//! Compute one output sample.
MY_FLOAT tick();
//! Perform the control change specified by \e number and \e value (0.0 - 128.0).
void controlChange(int number, MY_FLOAT value);
protected:
SingWave *voiced;
Noise *noise;
Envelope *noiseEnv;
FormSwep *filters[4];
OnePole *onepole;
OneZero *onezero;
};
#endif

141
include/Voicer.h Normal file
View File

@@ -0,0 +1,141 @@
/***************************************************/
/*! \class Voicer
\brief STK voice manager class.
This class can be used to manage a group of
STK instrument classes. Individual voices can
be controlled via unique note tags.
Instrument groups can be controlled by channel
number.
A previously constructed STK instrument class
is linked with a voice manager using the
addInstrument() function. An optional channel
number argument can be specified to the
addInstrument() function as well (default
channel = 0). The voice manager does not
delete any instrument instances ... it is the
responsibility of the user to allocate and
deallocate all instruments.
The tick() function returns the mix of all
sounding voices. Each noteOn returns a unique
tag (credits to the NeXT MusicKit), so you can
send control changes to specific voices within
an ensemble. Alternately, control changes can
be sent to all voices on a given channel.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__VOICER_H)
#define __VOICER_H
#include "Stk.h"
#include "Instrmnt.h"
class Voicer : public Stk
{
public:
//! Class constructor taking the maximum number of instruments to control and an optional note decay time (in seconds).
Voicer( int maxInstruments, MY_FLOAT decayTime=0.2 );
//! Class destructor.
~Voicer();
//! Add an instrument with an optional channel number to the voice manager.
/*!
A set of instruments can be grouped by channel number and
controlled via the functions which take a channel number argument.
*/
void addInstrument( Instrmnt *instrument, int channel=0 );
//! Remove the given instrument pointer from the voice manager's control.
/*!
It is important that any instruments which are to be deleted by
the user while the voice manager is running be first removed from
the manager's control via this function!!
*/
void removeInstrument( Instrmnt *instrument );
//! Initiate a noteOn event with the given note number and amplitude and return a unique note tag.
/*!
Send the noteOn message to the first available unused voice.
If all voices are sounding, the oldest voice is interrupted and
sent the noteOn message. If the optional channel argument is
non-zero, only voices on that channel are used. If no voices are
found for a specified non-zero channel value, the function returns
-1. The amplitude value should be in the range 0.0 - 128.0.
*/
long noteOn( MY_FLOAT noteNumber, MY_FLOAT amplitude, int channel=0 );
//! Send a noteOff to all voices having the given noteNumber and optional channel (default channel = 0).
/*!
The amplitude value should be in the range 0.0 - 128.0.
*/
void noteOff( MY_FLOAT noteNumber, MY_FLOAT amplitude, int channel=0 );
//! Send a noteOff to the voice with the given note tag.
/*!
The amplitude value should be in the range 0.0 - 128.0.
*/
void noteOff( long tag, MY_FLOAT amplitude );
//! Send a frequency update message to all voices assigned to the optional channel argument (default channel = 0).
/*!
The \e noteNumber argument corresponds to a MIDI note number, though it is a floating-point value and can range beyond the normal 0-127 range.
*/
void setFrequency( MY_FLOAT noteNumber, int channel=0 );
//! Send a frequency update message to the voice with the given note tag.
/*!
The \e noteNumber argument corresponds to a MIDI note number, though it is a floating-point value and can range beyond the normal 0-127 range.
*/
void setFrequency( long tag, MY_FLOAT noteNumber );
//! Send a pitchBend message to all voices assigned to the optional channel argument (default channel = 0).
void pitchBend( MY_FLOAT value, int channel=0 );
//! Send a pitchBend message to the voice with the given note tag.
void pitchBend( long tag, MY_FLOAT value );
//! Send a controlChange to all instruments assigned to the optional channel argument (default channel = 0).
void controlChange( int number, MY_FLOAT value, int channel=0 );
//! Send a controlChange to the voice with the given note tag.
void controlChange( long tag, int number, MY_FLOAT value );
//! Send a noteOff message to all existing voices.
void silence( void );
//! Mix the output for all sounding voices.
MY_FLOAT tick();
//! Computer \e vectorSize output mixes and return them in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Return the last output value.
MY_FLOAT lastOut() const;
protected:
typedef struct {
Instrmnt *instrument;
long tag;
MY_FLOAT noteNumber;
MY_FLOAT frequency;
int sounding;
int channel;
} Voice;
int nVoices;
int maxVoices;
Voice *voices;
long tags;
int muteTime;
MY_FLOAT lastOutput;
};
#endif

View File

@@ -1,76 +1,76 @@
/***************************************************/ /***************************************************/
/*! \class WaveLoop /*! \class WaveLoop
\brief STK waveform oscillator class. \brief STK waveform oscillator class.
This class inherits from WvIn and provides This class inherits from WvIn and provides
audio file looping functionality. audio file looping functionality.
WaveLoop supports multi-channel data in WaveLoop supports multi-channel data in
interleaved format. It is important to interleaved format. It is important to
distinguish the tick() methods, which return distinguish the tick() methods, which return
samples produced by averaging across sample samples produced by averaging across sample
frames, from the tickFrame() methods, which frames, from the tickFrame() methods, which
return pointers to multi-channel sample frames. return pointers to multi-channel sample frames.
For single-channel data, these methods return For single-channel data, these methods return
equivalent values. equivalent values.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__WAVELOOP_H) #if !defined(__WAVELOOP_H)
#define __WAVELOOP_H #define __WAVELOOP_H
#include "WvIn.h" #include "WvIn.h"
#include <stdio.h> #include <stdio.h>
class WaveLoop : public WvIn class WaveLoop : public WvIn
{ {
public: public:
//! Class constructor. //! Class constructor.
WaveLoop( const char *fileName, bool raw = FALSE ); WaveLoop( const char *fileName, bool raw = FALSE );
//! Class destructor. //! Class destructor.
virtual ~WaveLoop(); virtual ~WaveLoop();
//! Set the data interpolation rate based on a looping frequency. //! Set the data interpolation rate based on a looping frequency.
/*! /*!
This function determines the interpolation rate based on the file This function determines the interpolation rate based on the file
size and the current Stk::sampleRate. The \e aFrequency value size and the current Stk::sampleRate. The \e aFrequency value
corresponds to file cycles per second. The frequency can be corresponds to file cycles per second. The frequency can be
negative, in which case the loop is read in reverse order. negative, in which case the loop is read in reverse order.
*/ */
void setFrequency(MY_FLOAT aFrequency); void setFrequency(MY_FLOAT aFrequency);
//! Increment the read pointer by \e aTime samples, modulo file size. //! Increment the read pointer by \e aTime samples, modulo file size.
void addTime(MY_FLOAT aTime); void addTime(MY_FLOAT aTime);
//! Increment current read pointer by \e anAngle, relative to a looping frequency. //! Increment current read pointer by \e anAngle, relative to a looping frequency.
/*! /*!
This function increments the read pointer based on the file This function increments the read pointer based on the file
size and the current Stk::sampleRate. The \e anAngle value size and the current Stk::sampleRate. The \e anAngle value
is a multiple of file size. is a multiple of file size.
*/ */
void addPhase(MY_FLOAT anAngle); void addPhase(MY_FLOAT anAngle);
//! Add a phase offset to the current read pointer. //! Add a phase offset to the current read pointer.
/*! /*!
This function determines a time offset based on the file This function determines a time offset based on the file
size and the current Stk::sampleRate. The \e anAngle value size and the current Stk::sampleRate. The \e anAngle value
is a multiple of file size. is a multiple of file size.
*/ */
void addPhaseOffset(MY_FLOAT anAngle); void addPhaseOffset(MY_FLOAT anAngle);
//! Return a pointer to the next sample frame of data. //! Return a pointer to the next sample frame of data.
const MY_FLOAT *tickFrame(void); const MY_FLOAT *tickFrame(void);
protected: protected:
// Read file data. // Read file data.
void readData(unsigned long index); void readData(unsigned long index);
MY_FLOAT phaseOffset; MY_FLOAT phaseOffset;
}; };
#endif // defined(__WAVELOOP_H) #endif // defined(__WAVELOOP_H)

85
include/Whistle.h Normal file
View File

@@ -0,0 +1,85 @@
/***************************************************/
/*! \class Whistle
\brief STK police/referee whistle instrument class.
This class implements a hybrid physical/spectral
model of a police whistle (a la Cook).
Control Change Numbers:
- Noise Gain = 4
- Fipple Modulation Frequency = 11
- Fipple Modulation Gain = 1
- Blowing Frequency Modulation = 2
- Volume = 128
by Perry R. Cook 1996 - 2002.
*/
/***************************************************/
#if !defined(__WHISTLE_H)
#define __WHISTLE_H
#include "Instrmnt.h"
#include "Sphere.h"
#include "Vector3D.h"
#include "Noise.h"
#include "WaveLoop.h"
#include "OnePole.h"
#include "Envelope.h"
class Whistle : public Instrmnt
{
public:
//! Class constructor.
Whistle();
//! Class destructor.
~Whistle();
//! Reset and clear all internal state.
void clear();
//! Set instrument parameters for a particular frequency.
void setFrequency(MY_FLOAT frequency);
//! Apply breath velocity to instrument with given amplitude and rate of increase.
void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate);
//! Decrease breath velocity with given rate of decrease.
void stopBlowing(MY_FLOAT rate);
//! Start a note with the given frequency and amplitude.
void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude);
//! Stop a note with the given amplitude (speed of decay).
void noteOff(MY_FLOAT amplitude);
//! Compute one output sample.
MY_FLOAT tick();
//! Perform the control change specified by \e number and \e value (0.0 - 128.0).
void controlChange(int number, MY_FLOAT value);
protected:
Vector3D *tempVectorP;
Vector3D *tempVector;
OnePole onepole;
Noise noise;
Envelope envelope;
Sphere *can; // Declare a Spherical "can".
Sphere *pea, *bumper; // One spherical "pea", and a spherical "bumper".
WaveLoop *sine;
MY_FLOAT baseFrequency;
MY_FLOAT maxPressure;
MY_FLOAT noiseGain;
MY_FLOAT fippleFreqMod;
MY_FLOAT fippleGainMod;
MY_FLOAT blowFreqMod;
MY_FLOAT tickSize;
MY_FLOAT canLoss;
int subSample, subSampCount;
};
#endif

View File

@@ -1,207 +1,207 @@
/***************************************************/ /***************************************************/
/*! \class WvIn /*! \class WvIn
\brief STK audio data input base class. \brief STK audio data input base class.
This class provides input support for various This class provides input support for various
audio file formats. It also serves as a base audio file formats. It also serves as a base
class for "realtime" streaming subclasses. class for "realtime" streaming subclasses.
WvIn loads the contents of an audio file for WvIn loads the contents of an audio file for
subsequent output. Linear interpolation is subsequent output. Linear interpolation is
used for fractional "read rates". used for fractional "read rates".
WvIn supports multi-channel data in interleaved WvIn supports multi-channel data in interleaved
format. It is important to distinguish the format. It is important to distinguish the
tick() methods, which return samples produced tick() methods, which return samples produced
by averaging across sample frames, from the by averaging across sample frames, from the
tickFrame() methods, which return pointers to tickFrame() methods, which return pointers to
multi-channel sample frames. For single-channel multi-channel sample frames. For single-channel
data, these methods return equivalent values. data, these methods return equivalent values.
Small files are completely read into local memory Small files are completely read into local memory
during instantiation. Large files are read during instantiation. Large files are read
incrementally from disk. The file size threshold incrementally from disk. The file size threshold
and the increment size values are defined in and the increment size values are defined in
WvIn.h. WvIn.h.
WvIn currently supports WAV, AIFF, SND (AU), WvIn currently supports WAV, AIFF, SND (AU),
MAT-file (Matlab), and STK RAW file formats. MAT-file (Matlab), and STK RAW file formats.
Signed integer (8-, 16-, and 32-bit) and floating- Signed integer (8-, 16-, and 32-bit) and floating-
point (32- and 64-bit) data types are supported. point (32- and 64-bit) data types are supported.
Uncompressed data types are not supported. If Uncompressed data types are not supported. If
using MAT-files, data should be saved in an array using MAT-files, data should be saved in an array
with each data channel filling a matrix row. with each data channel filling a matrix row.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__WVIN_H) #if !defined(__WVIN_H)
#define __WVIN_H #define __WVIN_H
// Files larger than CHUNK_THRESHOLD will be copied into memory // Files larger than CHUNK_THRESHOLD will be copied into memory
// in CHUNK_SIZE increments, rather than completely loaded into // in CHUNK_SIZE increments, rather than completely loaded into
// a buffer at once. // a buffer at once.
#define CHUNK_THRESHOLD 5000000 // 5 Mb #define CHUNK_THRESHOLD 5000000 // 5 Mb
#define CHUNK_SIZE 1024 // sample frames #define CHUNK_SIZE 1024 // sample frames
#include "Stk.h" #include "Stk.h"
#include <stdio.h> #include <stdio.h>
class WvIn : public Stk class WvIn : public Stk
{ {
public: public:
//! Default constructor. //! Default constructor.
WvIn(); WvIn();
//! Overloaded constructor for file input. //! Overloaded constructor for file input.
/*! /*!
An StkError will be thrown if the file is not found, its format is An StkError will be thrown if the file is not found, its format is
unknown, or a read error occurs. unknown, or a read error occurs.
*/ */
WvIn( const char *fileName, bool raw = FALSE ); WvIn( const char *fileName, bool raw = FALSE );
//! Class destructor. //! Class destructor.
virtual ~WvIn(); virtual ~WvIn();
//! Open the specified file and load its data. //! Open the specified file and load its data.
/*! /*!
An StkError will be thrown if the file is not found, its format is An StkError will be thrown if the file is not found, its format is
unknown, or a read error occurs. unknown, or a read error occurs.
*/ */
void openFile( const char *fileName, bool raw = FALSE ); void openFile( const char *fileName, bool raw = FALSE );
//! If a file is open, close it. //! If a file is open, close it.
void closeFile(void); void closeFile(void);
//! Clear outputs and reset time (file pointer) to zero. //! Clear outputs and reset time (file pointer) to zero.
void reset(void); void reset(void);
//! Normalize data to a maximum of +-1.0. //! Normalize data to a maximum of +-1.0.
/*! /*!
For large, incrementally loaded files with integer data types, For large, incrementally loaded files with integer data types,
normalization is computed relative to the data type maximum. normalization is computed relative to the data type maximum.
No normalization is performed for incrementally loaded files No normalization is performed for incrementally loaded files
with floating-point data types. with floating-point data types.
*/ */
void normalize(void); void normalize(void);
//! Normalize data to a maximum of \e +-peak. //! Normalize data to a maximum of \e +-peak.
/*! /*!
For large, incrementally loaded files with integer data types, For large, incrementally loaded files with integer data types,
normalization is computed relative to the data type maximum normalization is computed relative to the data type maximum
(\e peak/maximum). For incrementally loaded files with floating- (\e peak/maximum). For incrementally loaded files with floating-
point data types, direct scaling by \e peak is performed. point data types, direct scaling by \e peak is performed.
*/ */
void normalize(MY_FLOAT peak); void normalize(MY_FLOAT peak);
//! Return the file size in sample frames. //! Return the file size in sample frames.
unsigned long getSize(void) const; unsigned long getSize(void) const;
//! Return the number of audio channels in the file. //! Return the number of audio channels in the file.
unsigned int getChannels(void) const; unsigned int getChannels(void) const;
//! Return the input file sample rate in Hz (not the data read rate). //! Return the input file sample rate in Hz (not the data read rate).
/*! /*!
WAV, SND, and AIF formatted files specify a sample rate in WAV, SND, and AIF formatted files specify a sample rate in
their headers. STK RAW files have a sample rate of 22050 Hz their headers. STK RAW files have a sample rate of 22050 Hz
by definition. MAT-files are assumed to have a rate of 44100 Hz. by definition. MAT-files are assumed to have a rate of 44100 Hz.
*/ */
MY_FLOAT getFileRate(void) const; MY_FLOAT getFileRate(void) const;
//! Query whether reading is complete. //! Query whether reading is complete.
bool isFinished(void) const; bool isFinished(void) const;
//! Set the data read rate in samples. The rate can be negative. //! Set the data read rate in samples. The rate can be negative.
/*! /*!
If the rate value is negative, the data is read in reverse order. If the rate value is negative, the data is read in reverse order.
*/ */
void setRate(MY_FLOAT aRate); void setRate(MY_FLOAT aRate);
//! Increment the read pointer by \e aTime samples. //! Increment the read pointer by \e aTime samples.
virtual void addTime(MY_FLOAT aTime); virtual void addTime(MY_FLOAT aTime);
//! Turn linear interpolation on/off. //! Turn linear interpolation on/off.
/*! /*!
Interpolation is automatically off when the read rate is Interpolation is automatically off when the read rate is
an integer value. If interpolation is turned off for a an integer value. If interpolation is turned off for a
fractional rate, the time index is truncated to an integer fractional rate, the time index is truncated to an integer
value. value.
*/ */
void setInterpolate(bool doInterpolate); void setInterpolate(bool doInterpolate);
//! Return the average across the last output sample frame. //! Return the average across the last output sample frame.
virtual MY_FLOAT lastOut(void) const; virtual MY_FLOAT lastOut(void) const;
//! Read out the average across one sample frame of data. //! Read out the average across one sample frame of data.
/*! /*!
An StkError will be thrown if a file is read incrementally and a read error occurs. An StkError will be thrown if a file is read incrementally and a read error occurs.
*/ */
virtual MY_FLOAT tick(void); virtual MY_FLOAT tick(void);
//! Read out vectorSize averaged sample frames of data in \e vector. //! Read out vectorSize averaged sample frames of data in \e vector.
/*! /*!
An StkError will be thrown if a file is read incrementally and a read error occurs. An StkError will be thrown if a file is read incrementally and a read error occurs.
*/ */
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Return a pointer to the last output sample frame. //! Return a pointer to the last output sample frame.
virtual const MY_FLOAT *lastFrame(void) const; virtual const MY_FLOAT *lastFrame(void) const;
//! Return a pointer to the next sample frame of data. //! Return a pointer to the next sample frame of data.
/*! /*!
An StkError will be thrown if a file is read incrementally and a read error occurs. An StkError will be thrown if a file is read incrementally and a read error occurs.
*/ */
virtual const MY_FLOAT *tickFrame(void); virtual const MY_FLOAT *tickFrame(void);
//! Read out sample \e frames of data to \e frameVector. //! Read out sample \e frames of data to \e frameVector.
/*! /*!
An StkError will be thrown if a file is read incrementally and a read error occurs. An StkError will be thrown if a file is read incrementally and a read error occurs.
*/ */
virtual MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames); virtual MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames);
protected: protected:
// Initialize class variables. // Initialize class variables.
void init( void ); void init( void );
// Read file data. // Read file data.
virtual void readData(unsigned long index); virtual void readData(unsigned long index);
// Get STK RAW file information. // Get STK RAW file information.
bool getRawInfo( const char *fileName ); bool getRawInfo( const char *fileName );
// Get WAV file header information. // Get WAV file header information.
bool getWavInfo( const char *fileName ); bool getWavInfo( const char *fileName );
// Get SND (AU) file header information. // Get SND (AU) file header information.
bool getSndInfo( const char *fileName ); bool getSndInfo( const char *fileName );
// Get AIFF file header information. // Get AIFF file header information.
bool getAifInfo( const char *fileName ); bool getAifInfo( const char *fileName );
// Get MAT-file header information. // Get MAT-file header information.
bool getMatInfo( const char *fileName ); bool getMatInfo( const char *fileName );
char msg[256]; char msg[256];
FILE *fd; FILE *fd;
MY_FLOAT *data; MY_FLOAT *data;
MY_FLOAT *lastOutput; MY_FLOAT *lastOutput;
bool chunking; bool chunking;
bool finished; bool finished;
bool interpolate; bool interpolate;
bool byteswap; bool byteswap;
unsigned long fileSize; unsigned long fileSize;
unsigned long bufferSize; unsigned long bufferSize;
unsigned long dataOffset; unsigned long dataOffset;
unsigned int channels; unsigned int channels;
long chunkPointer; long chunkPointer;
STK_FORMAT dataType; STK_FORMAT dataType;
MY_FLOAT fileRate; MY_FLOAT fileRate;
MY_FLOAT gain; MY_FLOAT gain;
MY_FLOAT time; MY_FLOAT time;
MY_FLOAT rate; MY_FLOAT rate;
}; };
#endif // defined(__WVIN_H) #endif // defined(__WVIN_H)

View File

@@ -1,149 +1,149 @@
/***************************************************/ /***************************************************/
/*! \class WvOut /*! \class WvOut
\brief STK audio data output base class. \brief STK audio data output base class.
This class provides output support for various This class provides output support for various
audio file formats. It also serves as a base audio file formats. It also serves as a base
class for "realtime" streaming subclasses. class for "realtime" streaming subclasses.
WvOut writes samples to an audio file. It WvOut writes samples to an audio file. It
supports multi-channel data in interleaved supports multi-channel data in interleaved
format. It is important to distinguish the format. It is important to distinguish the
tick() methods, which output single samples tick() methods, which output single samples
to all channels in a sample frame, from the to all channels in a sample frame, from the
tickFrame() method, which takes a pointer tickFrame() method, which takes a pointer
to multi-channel sample frame data. to multi-channel sample frame data.
WvOut currently supports WAV, AIFF, AIFC, SND WvOut currently supports WAV, AIFF, AIFC, SND
(AU), MAT-file (Matlab), and STK RAW file (AU), MAT-file (Matlab), and STK RAW file
formats. Signed integer (8-, 16-, and 32-bit) formats. Signed integer (8-, 16-, and 32-bit)
and floating- point (32- and 64-bit) data types and floating- point (32- and 64-bit) data types
are supported. STK RAW files use 16-bit are supported. STK RAW files use 16-bit
integers by definition. MAT-files will always integers by definition. MAT-files will always
be written as 64-bit floats. If a data type be written as 64-bit floats. If a data type
specification does not match the specified file specification does not match the specified file
type, the data type will automatically be type, the data type will automatically be
modified. Uncompressed data types are not modified. Uncompressed data types are not
supported. supported.
Currently, WvOut is non-interpolating and the Currently, WvOut is non-interpolating and the
output rate is always Stk::sampleRate(). output rate is always Stk::sampleRate().
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#if !defined(__WVOUT_H) #if !defined(__WVOUT_H)
#define __WVOUT_H #define __WVOUT_H
#include "Stk.h" #include "Stk.h"
#include <stdio.h> #include <stdio.h>
#define BUFFER_SIZE 1024 // sample frames #define BUFFER_SIZE 1024 // sample frames
class WvOut : public Stk class WvOut : public Stk
{ {
public: public:
typedef unsigned long FILE_TYPE; typedef unsigned long FILE_TYPE;
static const FILE_TYPE WVOUT_RAW; /*!< STK RAW file type. */ static const FILE_TYPE WVOUT_RAW; /*!< STK RAW file type. */
static const FILE_TYPE WVOUT_WAV; /*!< WAV file type. */ static const FILE_TYPE WVOUT_WAV; /*!< WAV file type. */
static const FILE_TYPE WVOUT_SND; /*!< SND (AU) file type. */ static const FILE_TYPE WVOUT_SND; /*!< SND (AU) file type. */
static const FILE_TYPE WVOUT_AIF; /*!< AIFF file type. */ static const FILE_TYPE WVOUT_AIF; /*!< AIFF file type. */
static const FILE_TYPE WVOUT_MAT; /*!< Matlab MAT-file type. */ static const FILE_TYPE WVOUT_MAT; /*!< Matlab MAT-file type. */
//! Default constructor. //! Default constructor.
WvOut(); WvOut();
//! Overloaded constructor used to specify a file name, type, and data format with this object. //! Overloaded constructor used to specify a file name, type, and data format with this object.
/*! /*!
An StkError is thrown for invalid argument values or if an error occurs when initializing the output file. An StkError is thrown for invalid argument values or if an error occurs when initializing the output file.
*/ */
WvOut( const char *fileName, unsigned int nChannels = 1, FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 ); WvOut( const char *fileName, unsigned int nChannels = 1, FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 );
//! Class destructor. //! Class destructor.
virtual ~WvOut(); virtual ~WvOut();
//! Create a file of the specified type and name and output samples to it in the given data format. //! Create a file of the specified type and name and output samples to it in the given data format.
/*! /*!
An StkError is thrown for invalid argument values or if an error occurs when initializing the output file. An StkError is thrown for invalid argument values or if an error occurs when initializing the output file.
*/ */
void openFile( const char *fileName, unsigned int nChannels = 1, void openFile( const char *fileName, unsigned int nChannels = 1,
WvOut::FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 ); WvOut::FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 );
//! If a file is open, write out samples in the queue and then close it. //! If a file is open, write out samples in the queue and then close it.
void closeFile( void ); void closeFile( void );
//! Return the number of sample frames output. //! Return the number of sample frames output.
unsigned long getFrames( void ) const; unsigned long getFrames( void ) const;
//! Return the number of seconds of data output. //! Return the number of seconds of data output.
MY_FLOAT getTime( void ) const; MY_FLOAT getTime( void ) const;
//! Output a single sample to all channels in a sample frame. //! Output a single sample to all channels in a sample frame.
/*! /*!
An StkError is thrown if a file read error occurs. An StkError is thrown if a file read error occurs.
*/ */
virtual void tick(const MY_FLOAT sample); virtual void tick(const MY_FLOAT sample);
//! Output each sample in \e vector to all channels in \e vectorSize sample frames. //! Output each sample in \e vector to all channels in \e vectorSize sample frames.
/*! /*!
An StkError is thrown if a file read error occurs. An StkError is thrown if a file read error occurs.
*/ */
virtual void tick(const MY_FLOAT *vector, unsigned int vectorSize); virtual void tick(const MY_FLOAT *vector, unsigned int vectorSize);
//! Output the \e frameVector of sample frames of the given length. //! Output the \e frameVector of sample frames of the given length.
/*! /*!
An StkError is thrown if a file read error occurs. An StkError is thrown if a file read error occurs.
*/ */
virtual void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1); virtual void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1);
protected: protected:
// Initialize class variables. // Initialize class variables.
void init( void ); void init( void );
// Write data to output file; // Write data to output file;
virtual void writeData( unsigned long frames ); virtual void writeData( unsigned long frames );
// Write STK RAW file header. // Write STK RAW file header.
bool setRawFile( const char *fileName ); bool setRawFile( const char *fileName );
// Write WAV file header. // Write WAV file header.
bool setWavFile( const char *fileName ); bool setWavFile( const char *fileName );
// Close WAV file, updating the header. // Close WAV file, updating the header.
void closeWavFile( void ); void closeWavFile( void );
// Write SND (AU) file header. // Write SND (AU) file header.
bool setSndFile( const char *fileName ); bool setSndFile( const char *fileName );
// Close SND file, updating the header. // Close SND file, updating the header.
void closeSndFile( void ); void closeSndFile( void );
// Write AIFF file header. // Write AIFF file header.
bool setAifFile( const char *fileName ); bool setAifFile( const char *fileName );
// Close AIFF file, updating the header. // Close AIFF file, updating the header.
void closeAifFile( void ); void closeAifFile( void );
// Write MAT-file header. // Write MAT-file header.
bool setMatFile( const char *fileName ); bool setMatFile( const char *fileName );
// Close MAT-file, updating the header. // Close MAT-file, updating the header.
void closeMatFile( void ); void closeMatFile( void );
char msg[256]; char msg[256];
FILE *fd; FILE *fd;
MY_FLOAT *data; MY_FLOAT *data;
FILE_TYPE fileType; FILE_TYPE fileType;
STK_FORMAT dataType; STK_FORMAT dataType;
bool byteswap; bool byteswap;
unsigned int channels; unsigned int channels;
unsigned long counter; unsigned long counter;
unsigned long totalCount; unsigned long totalCount;
}; };
#endif // defined(__WVOUT_H) #endif // defined(__WVOUT_H)

View File

@@ -1,189 +0,0 @@
double phonGains[32][2] =
{{1.0,0.0}, // eee
{1.0,0.0}, // ihh
{1.0,0.0}, // ehh
{1.0,0.0}, // aaa
{1.0,0.0}, // ahh
{1.0,0.0}, // aww
{1.0,0.0}, // ohh
{1.0,0.0}, // uhh
{1.0,0.0}, // uuu
{1.0,0.0}, // ooo
{1.0,0.0}, // rrr
{1.0,0.0}, // lll
{1.0,0.0}, // mmm
{1.0,0.0}, // nnn
{1.0,0.0}, // nng
{1.0,0.0}, // ngg
{0.0,1.0}, // fff
{0.0,1.0}, // sss
{0.0,1.0}, // thh
{0.0,1.0}, // shh
{0.0,1.0}, // xxx
{0.0,0.1}, // hee
{0.0,0.1}, // hoo
{0.0,0.1}, // hah
{1.0,0.1}, // bbb
{1.0,0.1}, // ddd
{1.0,0.1}, // jjj
{1.0,0.1}, // ggg
{1.0,1.0}, // vvv
{1.0,1.0}, // zzz
{1.0,1.0}, // thz
{1.0,1.0} // zhh
};
double phonParams[32][4][3] =
{{ { 273,0.996, 0}, // eee (beet)
{2086,0.945, -16},
{2754,0.979, -12},
{3270,0.440, -17}},
{ { 385,0.987, 10}, // ihh (bit)
{2056,0.930, -20},
{2587,0.890, -20},
{3150,0.400, -20}},
{ { 515,0.977, 10}, // ehh (bet)
{1805,0.810, -10},
{2526,0.875, -10},
{3103,0.400, -13}},
{ { 773,0.950, 10}, // aaa (bat)
{1676,0.830, -6},
{2380,0.880, -20},
{3027,0.600, -20}},
{ { 770,0.950, 0}, // ahh (father)
{1153,0.970, -9},
{2450,0.780, -29},
{3140,0.800, -39}},
{ { 637,0.910, 0}, // aww (bought)
{ 895,0.900, -3},
{2556,0.950, -17},
{3070,0.910, -20}},
{ { 637,0.910, 0}, // ohh (bone) NOTE:: same as aww (bought)
{ 895,0.900, -3},
{2556,0.950, -17},
{3070,0.910, -20}},
{ { 561,0.965, 0}, // uhh (but)
{1084,0.930, -10},
{2541,0.930, -15},
{3345,0.900, -20}},
{ { 515,0.976, 0}, // uuu (foot)
{1031,0.950, -3},
{2572,0.960, -11},
{3345,0.960, -20}},
{ { 349,0.986, -10}, // ooo (boot)
{ 918,0.940, -20},
{2350,0.960, -27},
{2731,0.950, -33}},
{ { 394,0.959, -10}, // rrr (bird)
{1297,0.780, -16},
{1441,0.980, -16},
{2754,0.950, -40}},
{ { 462,0.990, +5}, // lll (lull)
{1200,0.640, -10},
{2500,0.200, -20},
{3000,0.100, -30}},
{ { 265,0.987, -10}, // mmm (mom)
{1176,0.940, -22},
{2352,0.970, -20},
{3277,0.940, -31}},
{ { 204,0.980, -10}, // nnn (nun)
{1570,0.940, -15},
{2481,0.980, -12},
{3133,0.800, -30}},
{ { 204,0.980, -10}, // nng (sang) NOTE:: same as nnn
{1570,0.940, -15},
{2481,0.980, -12},
{3133,0.800, -30}},
{ { 204,0.980, -10}, // ngg (bong) NOTE:: same as nnn
{1570,0.940, -15},
{2481,0.980, -12},
{3133,0.800, -30}},
{ {1000,0.300, 0}, // fff
{2800,0.860, -10},
{7425,0.740, 0},
{8140,0.860, 0}},
{ {0,0.000, 0}, // sss
{2000,0.700, -15},
{5257,0.750, -3},
{7171,0.840, 0}},
{ { 100,0.900, 0}, // thh
{4000,0.500, -20},
{5500,0.500, -15},
{8000,0.400, -20}},
{ {2693,0.940, 0}, // shh
{4000,0.720, -10},
{6123,0.870, -10},
{7755,0.750, -18}},
{ {1000,0.300, -10}, // xxx NOTE:: Not Really Done Yet
{2800,0.860, -10},
{7425,0.740, 0},
{8140,0.860, 0}},
{ { 273,0.996, -40}, // hee (beet) (noisy eee)
{2086,0.945, -16},
{2754,0.979, -12},
{3270,0.440, -17}},
{ { 349,0.986, -40}, // hoo (boot) (noisy ooo)
{ 918,0.940, -10},
{2350,0.960, -17},
{2731,0.950, -23}},
{ { 770,0.950, -40}, // hah (father) (noisy ahh)
{1153,0.970, -3},
{2450,0.780, -20},
{3140,0.800, -32}},
{ {2000,0.700, -20}, // bbb NOTE:: Not Really Done Yet
{5257,0.750, -15},
{7171,0.840, -3},
{9000,0.900, 0}},
{ { 100,0.900, 0}, // ddd NOTE:: Not Really Done Yet
{4000,0.500, -20},
{5500,0.500, -15},
{8000,0.400, -20}},
{ {2693,0.940, 0}, // jjj NOTE:: Not Really Done Yet
{4000,0.720, -10},
{6123,0.870, -10},
{7755,0.750, -18}},
{ {2693,0.940, 0}, // ggg NOTE:: Not Really Done Yet
{4000,0.720, -10},
{6123,0.870, -10},
{7755,0.750, -18}},
{ {2000,0.700, -20}, // vvv NOTE:: Not Really Done Yet
{5257,0.750, -15},
{7171,0.840, -3},
{9000,0.900, 0}},
{ { 100,0.900, 0}, // zzz NOTE:: Not Really Done Yet
{4000,0.500, -20},
{5500,0.500, -15},
{8000,0.400, -20}},
{ {2693,0.940, 0}, // thz NOTE:: Not Really Done Yet
{4000,0.720, -10},
{6123,0.870, -10},
{7755,0.750, -18}},
{ {2693,0.940, 0}, // zhh NOTE:: Not Really Done Yet
{4000,0.720, -10},
{6123,0.870, -10},
{7755,0.750, -18}}
};
char phonemes[32][4] =
{"eee","ihh","ehh","aaa",
"ahh","aww","ohh","uhh",
"uuu","ooo","rrr","lll",
"mmm","nnn","nng","ngg",
"fff","sss","thh","shh",
"xxx","hee","hoo","hah",
"bbb","ddd","jjj","ggg",
"vvv","zzz","thz","zhh"};

0
install.sh Normal file
View File

View File

View File

@@ -1,73 +0,0 @@
# STK Makefile - Global version for Unix systems which have GNU
# Makefile utilities installed. If this Makefile does not work on
# your system, try using the platform specific Makefiles (.sgi,
# .next, and .linux).
OS = $(shell uname)
# The following definition indicates the relative location of
# the STK src directory.
STK_SRC = ../../src/
OBJECTS = Stk.o Envelope.o ADSR.o Noise.o WvIn.o WaveLoop.o WvOut.o \
Filter.o OneZero.o OnePole.o PoleZero.o TwoZero.o \
BiQuad.o Delay.o DelayL.o DelayA.o Reverb.o PRCRev.o \
FormSwep.o ReedTabl.o JetTabl.o BowTabl.o \
Instrmnt.o Clarinet.o BlowHole.o Saxofony.o Flute.o Brass.o BlowBotl.o \
Bowed.o Plucked.o StifKarp.o Sitar.o PluckTwo.o Mandolin.o Mesh2D.o \
FM.o Rhodey.o Wurley.o TubeBell.o HevyMetl.o PercFlut.o BeeThree.o FMVoices.o \
Sampler.o Moog.o Simple.o Drummer.o BandedWG.o Shakers.o \
Modal.o ModalBar.o Resonate.o \
\
Messager.o SKINI.o utilities.o
RT_OBJECTS = RtMidi.o RtWvOut.o RtAudio.o Thread.o Socket.o
INCLUDE = -I../../include
RM = /bin/rm
INSTR = demo
ifeq ($(OS),NEXTSTEP) # These are for NeXT
# CC = cc -arch m68k -arch i386 -Wall -D__OS_NeXT_
CC = g++ -bm68k-next-nextstep3 -bi386-next-nextstep3 -Wall -fhandle-exceptions
endif
ifeq ($(OS),IRIX) # These are for SGI
CC = CC -D__IRIX_AL__ # -g -fullwarn -D__SGI_CC__ -O2
OBJECTS += $(RT_OBJECTS)
LIBRARY = -laudio -lmd -lm -lpthread
endif
ifeq ($(OS),Linux) # These are for Linux
OBJECTS += $(RT_OBJECTS)
CC = g++ -O3 -Wall -D__LITTLE_ENDIAN__ -D__LINUX_OSS__ #-g
LIBRARY = -lpthread -lm #-lasound
endif
%.o : $(STK_SRC)%.cpp
$(CC) $(INCLUDE) -c $(<) -o $@
all: $(INSTR)
demo: demo.cpp $(OBJECTS)
$(CC) $(INCLUDE) -o demo demo.cpp $(OBJECTS) $(LIBRARY)
Md2Skini: Md2Skini.cpp Stk.o RtMidi.o Thread.o Socket.o
$(CC) -o Md2Skini Md2Skini.cpp Stk.o RtMidi.o Thread.o Socket.o $(LIBRARY) $(INCLUDE)
clean :
rm *.o
rm $(INSTR)
cleanIns :
rm $(INSTR)
strip :
strip $(INSTR)
# Project specific objects:
utilities.o: utilities.cpp
$(CC) $(INCLUDE) -c utilities.cpp

76
projects/demo/Makefile.in Normal file
View File

@@ -0,0 +1,76 @@
### STK demo Makefile - for various flavors of unix
PROGRAMS = demo
RM = /bin/rm
SRC_PATH = ../../src
OBJECT_PATH = @object_path@
vpath %.o $(OBJECT_PATH)
OBJECTS = Stk.o Noise.o SubNoise.o Envelope.o ADSR.o \
WvIn.o WaveLoop.o WvOut.o \
Filter.o OneZero.o OnePole.o PoleZero.o TwoZero.o \
BiQuad.o FormSwep.o Delay.o DelayL.o DelayA.o \
ReedTabl.o JetTabl.o BowTabl.o \
Reverb.o PRCRev.o \
Modulate.o SingWave.o Voicer.o \
Vector3D.o Sphere.o \
\
Instrmnt.o Clarinet.o BlowHole.o Saxofony.o Flute.o Brass.o BlowBotl.o \
Bowed.o Plucked.o StifKarp.o Sitar.o PluckTwo.o Mandolin.o Mesh2D.o \
FM.o Rhodey.o Wurley.o TubeBell.o HevyMetl.o PercFlut.o BeeThree.o FMVoices.o \
Sampler.o Moog.o Simple.o Drummer.o Shakers.o \
Modal.o ModalBar.o BandedWG.o Resonate.o VoicForm.o Phonemes.o Whistle.o \
\
Messager.o SKINI.o utilities.o
INCLUDE = @include@
ifeq ($(strip $(INCLUDE)), )
INCLUDE = ../../include
endif
vpath %.h $(INCLUDE)
CC = @CXX@
DEFS = @byte_order@
DEFS += @debug@
CFLAGS = @cflags@
CFLAGS += @warn@ -I$(INCLUDE)
LIBRARY = @LIBS@
LIBRARY += @frameworks@
REALTIME = @realtime@
ifeq ($(REALTIME),yes)
OBJECTS += RtMidi.o RtAudio.o RtWvOut.o Thread.o Socket.o
DEFS += @sound_api@
DEFS += @midiator@
endif
RAWWAVES = @rawwaves@
ifeq ($(strip $(RAWWAVES)), )
RAWWAVES = ../../rawwaves/
endif
DEFS += -DRAWWAVE_PATH=\"$(RAWWAVES)\"
%.o : $(SRC_PATH)/%.cpp
$(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@
all : $(PROGRAMS)
demo: demo.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o demo demo.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
Md2Skini: Md2Skini.cpp Stk.o RtMidi.o Thread.o Socket.o
$(CC) $(CFLAGS) $(DEFS) -o Md2Skini Md2Skini.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/RtMidi.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/Socket.o $(LIBRARY)
$(OBJECTS) : Stk.h
clean :
-rm $(OBJECT_PATH)/*.o
-rm $(PROGRAMS)
strip :
strip $(PROGRAMS)
# Project specific objects:
utilities.o: utilities.cpp
$(CC) $(CFLAGS) $(DEFS) -c utilities.cpp -o $(OBJECT_PATH)/$@

View File

@@ -1,309 +1,309 @@
/***************************************************/ /***************************************************/
/* /*
Simple realtime MIDI to SKINI parser. Simple realtime MIDI to SKINI parser.
This object takes MIDI from the input stream This object takes MIDI from the input stream
(via the RtMidi class), parses it, and turns it (via the RtMidi class), parses it, and turns it
into SKINI messages. into SKINI messages.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002. by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/ */
/***************************************************/ /***************************************************/
#include "RtMidi.h" #include "RtMidi.h"
#include "Thread.h" #include "Thread.h"
#include "Socket.h" #include "Socket.h"
#include "SKINI.msg" #include "SKINI.msg"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
// Exit thread declaration. // Exit thread declaration.
extern "C" THREAD_RETURN THREAD_TYPE stdinMonitor(void * ptr); extern "C" THREAD_RETURN THREAD_TYPE stdinMonitor(void * ptr);
void usage(void) { void usage(void) {
printf("\nuseage: Md2Skini <flag(s)>\n\n"); printf("\nuseage: Md2Skini <flag(s)>\n\n");
printf(" With no arguments, Md2Skini converts MIDI input to SKINI\n"); printf(" With no arguments, Md2Skini converts MIDI input to SKINI\n");
printf(" format and sends the output directly to stdout.\n"); printf(" format and sends the output directly to stdout.\n");
printf(" With flag = -s <hostname>, the output is sent over a socket\n"); printf(" With flag = -s <hostname>, the output is sent over a socket\n");
printf(" connection (port 2001) to the optional hostname (default = localhost).\n"); printf(" connection (port 2001) to the optional hostname (default = localhost).\n");
printf(" With flag = -f <filename>, the output stream is simultaneously\n"); printf(" With flag = -f <filename>, the output stream is simultaneously\n");
printf(" written to the file specified by the optional <filename>\n"); printf(" written to the file specified by the optional <filename>\n");
printf(" (default = test.ski).\n\n"); printf(" (default = test.ski).\n\n");
exit(0); exit(0);
} }
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
bool done = false, firstMessage = true, writeFile = false, useSocket = false; bool done = false, firstMessage = true, writeFile = false, useSocket = false;
FILE *file = NULL; FILE *file = NULL;
char fileName[256]; char fileName[256];
char hostName[128]; char hostName[128];
RtMidi *rtmidi = 0; RtMidi *rtmidi = 0;
Socket *soket = 0; Socket *soket = 0;
Thread *thread = 0; Thread *thread = 0;
if ( argc>5 ) { if ( argc>5 ) {
usage(); usage();
} }
// Parse the command-line arguments. // Parse the command-line arguments.
int i = 1; int i = 1;
while (i < argc) { while (i < argc) {
if (argv[i][0] == '-') { if (argv[i][0] == '-') {
switch(argv[i][1]) { switch(argv[i][1]) {
case 's': case 's':
if ((i+1 < argc) && argv[i+1][0] != '-') { if ((i+1 < argc) && argv[i+1][0] != '-') {
i++; i++;
strncpy(hostName, argv[i], 128); strncpy(hostName, argv[i], 128);
} }
else strcpy(hostName, "localhost"); else strcpy(hostName, "localhost");
useSocket = true; useSocket = true;
break; break;
case 'f': case 'f':
if ((i+1 < argc) && argv[i+1][0] != '-') { if ((i+1 < argc) && argv[i+1][0] != '-') {
i++; i++;
strncpy(fileName, argv[i], 252); strncpy(fileName, argv[i], 252);
if ( strstr(fileName,".ski") == NULL ) strcat(fileName, ".ski"); if ( strstr(fileName,".ski") == NULL ) strcat(fileName, ".ski");
} }
else strcpy(fileName, "test.ski"); else strcpy(fileName, "test.ski");
file = fopen(fileName,"wb"); file = fopen(fileName,"wb");
writeFile = true; writeFile = true;
break; break;
default: default:
usage(); usage();
break; break;
} }
} }
else usage(); else usage();
i++; i++;
} }
MY_FLOAT dt=0.0; MY_FLOAT dt=0.0;
try { try {
rtmidi = new RtMidi(); rtmidi = new RtMidi();
} }
catch (StkError &) { catch (StkError &) {
exit(0); exit(0);
} }
// If using sockets, setup the client socket // If using sockets, setup the client socket
if (useSocket) { if (useSocket) {
try { try {
soket = new Socket( 2001, hostName ); soket = new Socket( 2001, hostName );
} }
catch (StkError &) { catch (StkError &) {
exit(0); exit(0);
} }
} }
// Start the "exit" thread. // Start the "exit" thread.
thread = new Thread(); thread = new Thread();
if ( !thread->start( (THREAD_FUNCTION)&stdinMonitor, (void *) &done ) ) { if ( !thread->start( (THREAD_FUNCTION)&stdinMonitor, (void *) &done ) ) {
fprintf(stderr, "Unable to create exit thread ... aborting.\n"); fprintf(stderr, "Unable to create exit thread ... aborting.\n");
goto cleanup; goto cleanup;
} }
// Write SKINI messages to buffer 's'. This is the easiest way to // Write SKINI messages to buffer 's'. This is the easiest way to
// allow this single executable to work for both socketing and // allow this single executable to work for both socketing and
// printf's to stdout. // printf's to stdout.
char s[128]; char s[128];
int channel, j; int channel, j;
MY_FLOAT byte2, byte3; MY_FLOAT byte2, byte3;
while ( !done ) { while ( !done ) {
if (rtmidi->nextMessage() > 0) { if (rtmidi->nextMessage() > 0) {
byte3 = rtmidi->getByteThree(); byte3 = rtmidi->getByteThree();
byte2 = rtmidi->getByteTwo(); byte2 = rtmidi->getByteTwo();
channel = rtmidi->getChannel(); channel = rtmidi->getChannel();
if (writeFile) dt = rtmidi->getDeltaTime(); if (writeFile) dt = rtmidi->getDeltaTime();
if (firstMessage) { // first MIDI message time stamp is meaningless if (firstMessage) { // first MIDI message time stamp is meaningless
dt = 0.0; dt = 0.0;
firstMessage = false; firstMessage = false;
} }
switch(rtmidi->getType()) { switch(rtmidi->getType()) {
case __SK_NoteOn_: case __SK_NoteOn_:
if (byte3 < 1.0) { if (byte3 < 1.0) {
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,64.0); sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,64.0);
if (writeFile) { if (writeFile) {
fprintf(file,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,64.0); fprintf(file,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,64.0);
} }
} else { } else {
sprintf(s,"NoteOn\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3); sprintf(s,"NoteOn\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"NoteOn\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3); fprintf(file,"NoteOn\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
} }
} }
break; break;
case __SK_NoteOff_: case __SK_NoteOff_:
if (byte3 < 2.0) byte3 = 64.0; if (byte3 < 2.0) byte3 = 64.0;
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3); sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3); fprintf(file,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
} }
break; break;
case __SK_PolyPressure_: case __SK_PolyPressure_:
sprintf(s,"PolyPressure\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3); sprintf(s,"PolyPressure\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"PolyPressure\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3); fprintf(file,"PolyPressure\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
} }
break; break;
case __SK_ControlChange_: case __SK_ControlChange_:
j = (int) byte2; j = (int) byte2;
switch(j) { switch(j) {
case __SK_Volume_: case __SK_Volume_:
sprintf(s,"Volume\t%.3f %d %.1f\n",0.0,channel,byte3); sprintf(s,"Volume\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"Volume\t%.3f %d %.1f\n",dt,channel,byte3); fprintf(file,"Volume\t%.3f %d %.1f\n",dt,channel,byte3);
} }
break; break;
case __SK_ModWheel_: case __SK_ModWheel_:
sprintf(s,"ModWheel\t%.3f %d %.1f\n",0.0,channel,byte3); sprintf(s,"ModWheel\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"ModWheel\t%.3f %d %.1f\n",dt,channel,byte3); fprintf(file,"ModWheel\t%.3f %d %.1f\n",dt,channel,byte3);
} }
break; break;
case __SK_Breath_: case __SK_Breath_:
sprintf(s,"Breath\t\t%.3f %d %.1f\n",0.0,channel,byte3); sprintf(s,"Breath\t\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"Breath\t\t%.3f %d %.1f\n",dt,channel,byte3); fprintf(file,"Breath\t\t%.3f %d %.1f\n",dt,channel,byte3);
} }
break; break;
case __SK_FootControl_: case __SK_FootControl_:
sprintf(s,"FootControl\t%.3f %d %.1f\n",0.0,channel,byte3); sprintf(s,"FootControl\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"FootControl\t%.3f %d %.1f\n",dt,channel,byte3); fprintf(file,"FootControl\t%.3f %d %.1f\n",dt,channel,byte3);
} }
break; break;
case __SK_Portamento_: case __SK_Portamento_:
sprintf(s,"Portamento\t%.3f %d %.1f\n",0.0,channel,byte3); sprintf(s,"Portamento\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"Portamento\t%.3f %d %.1f\n",dt,channel,byte3); fprintf(file,"Portamento\t%.3f %d %.1f\n",dt,channel,byte3);
} }
break; break;
case __SK_Balance_: case __SK_Balance_:
sprintf(s,"Balance\t%.3f %d %.1f\n",0.0,channel,byte3); sprintf(s,"Balance\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"Balance\t%.3f %d %.1f\n",dt,channel,byte3); fprintf(file,"Balance\t%.3f %d %.1f\n",dt,channel,byte3);
} }
break; break;
case __SK_Pan_: case __SK_Pan_:
sprintf(s,"Pan\t\t%.3f %d %.1f\n",0.0,channel,byte3); sprintf(s,"Pan\t\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"Pan\t\t%.3f %d %.1f\n",dt,channel,byte3); fprintf(file,"Pan\t\t%.3f %d %.1f\n",dt,channel,byte3);
} }
break; break;
case __SK_Sustain_: case __SK_Sustain_:
sprintf(s,"Sustain\t%.3f %d %.1f\n",0.0,channel,byte3); sprintf(s,"Sustain\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"Sustain\t%.3f %d %.1f\n",dt,channel,byte3); fprintf(file,"Sustain\t%.3f %d %.1f\n",dt,channel,byte3);
} }
break; break;
case __SK_Expression_: case __SK_Expression_:
sprintf(s,"Expression\t%.3f %d %.1f\n",0.0,channel,byte3); sprintf(s,"Expression\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"Expression\t%.3f %d %.1f\n",dt,channel,byte3); fprintf(file,"Expression\t%.3f %d %.1f\n",dt,channel,byte3);
} }
break; break;
default: default:
sprintf(s,"ControlChange\t%.3f %d %d %.1f\n",0.0,channel,j,byte3); sprintf(s,"ControlChange\t%.3f %d %d %.1f\n",0.0,channel,j,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"ControlChange\t%.3f %d %d %.1f\n",dt,channel,j,byte3); fprintf(file,"ControlChange\t%.3f %d %d %.1f\n",dt,channel,j,byte3);
} }
break; break;
} }
break; break;
case __SK_ProgramChange_: case __SK_ProgramChange_:
j = (int) byte2; j = (int) byte2;
sprintf(s,"ProgramChange\t%.3f %d %d\n",0.0,channel,j); sprintf(s,"ProgramChange\t%.3f %d %d\n",0.0,channel,j);
if (writeFile) { if (writeFile) {
fprintf(file,"ProgramChange\t%.3f %d %d\n",dt,channel,j); fprintf(file,"ProgramChange\t%.3f %d %d\n",dt,channel,j);
} }
break; break;
case __SK_ChannelPressure_: case __SK_ChannelPressure_:
sprintf(s,"ChannelPressure\t%.3f %d %.1f\n",0.0,channel,byte2); sprintf(s,"ChannelPressure\t%.3f %d %.1f\n",0.0,channel,byte2);
if (writeFile) { if (writeFile) {
fprintf(file,"ChannelPressure\t%.3f %d %.1f\n",dt,channel,byte2); fprintf(file,"ChannelPressure\t%.3f %d %.1f\n",dt,channel,byte2);
} }
break; break;
case __SK_PitchBend_: case __SK_PitchBend_:
sprintf(s,"PitchBend\t%.3f %d %f\n",0.0,channel,byte2); sprintf(s,"PitchBend\t%.3f %d %f\n",0.0,channel,byte2);
if (writeFile) { if (writeFile) {
fprintf(file,"PitchBend\t%.3f %d %f\n",dt,channel,byte2); fprintf(file,"PitchBend\t%.3f %d %f\n",dt,channel,byte2);
} }
break; break;
default: default:
sprintf(s,"// Unknown\t%.3f %d %f %f\n",0.0,channel,byte2,byte3); sprintf(s,"// Unknown\t%.3f %d %f %f\n",0.0,channel,byte2,byte3);
if (writeFile) { if (writeFile) {
fprintf(file,"// Unknown\t\t%.3f %d %f %f\n",dt,channel,byte2,byte3); fprintf(file,"// Unknown\t\t%.3f %d %f %f\n",dt,channel,byte2,byte3);
} }
break; break;
} }
if (useSocket) { if (useSocket) {
if ( soket->writeBuffer( s, strlen(s), 0 ) < 0 ) { if ( soket->writeBuffer( s, strlen(s), 0 ) < 0 ) {
fprintf(stderr,"Socket connection failed ... aborting.\n"); fprintf(stderr,"Socket connection failed ... aborting.\n");
goto cleanup; goto cleanup;
} }
} }
else { else {
printf("%s", s); printf("%s", s);
fflush(stdout); fflush(stdout);
} }
memset(s, 0, sizeof(s)); memset(s, 0, sizeof(s));
} else { } else {
// Sleep for 10 milliseconds // Sleep for 10 milliseconds
Stk::sleep( 10 ); Stk::sleep( 10 );
} }
} }
sprintf(s, "Exiting Md2Skini process ... bye!\n"); sprintf(s, "Exiting Md2Skini process ... bye!\n");
if (useSocket) if (useSocket)
soket->writeBuffer( s, strlen(s), 0 ); soket->writeBuffer( s, strlen(s), 0 );
else { else {
printf("%s", s); printf("%s", s);
fflush(stdout); fflush(stdout);
} }
if (writeFile) { if (writeFile) {
printf("Wrote SKINI output to file %s.\n", fileName); printf("Wrote SKINI output to file %s.\n", fileName);
fclose(file); fclose(file);
} }
cleanup: cleanup:
done = true; done = true;
delete rtmidi; delete rtmidi;
delete soket; delete soket;
delete thread; delete thread;
return 0; return 0;
} }
THREAD_RETURN THREAD_TYPE stdinMonitor(void * ptr) THREAD_RETURN THREAD_TYPE stdinMonitor(void * ptr)
{ {
bool *done = (bool *) ptr; bool *done = (bool *) ptr;
char inputString[128]; char inputString[128];
printf("Type 'Exit<cr>' to quit.\n"); printf("Type 'Exit<cr>' to quit.\n");
while ( !*done ) { while ( !*done ) {
fgets(inputString, 128, stdin); fgets(inputString, 128, stdin);
if (inputString[3] == 't' && inputString[1] == 'x' if (inputString[3] == 't' && inputString[1] == 'x'
&& inputString[2] == 'i' && inputString[0] == 'E') { && inputString[2] == 'i' && inputString[0] == 'E') {
*done = true; *done = true;
} }
else { else {
printf(inputString); printf(inputString);
fflush(stdout); fflush(stdout);
} }
} }
return 0; return 0;
} }

View File

1
projects/demo/Voice.bat Executable file
View File

@@ -0,0 +1 @@
wish < tcl/Voice.tcl | demo FMVoices -or -ip

View File

@@ -1,33 +1,38 @@
// demo.cpp // demo.cpp
// //
// An STK program for monophonic voice playback and control. // An example STK program for voice playback and control.
#include "SKINI.msg" #include "SKINI.msg"
#include "Messager.h"
#include "WvOut.h" #include "WvOut.h"
#include "Instrmnt.h" #include "Instrmnt.h"
#include "PRCRev.h" #include "PRCRev.h"
#include "Voicer.h"
// Miscellaneous command-line parsing and instrument allocation // Miscellaneous command-line parsing and instrument allocation
// functions are defined in utilites.cpp ... specific to this program. // functions are defined in utilites.cpp ... specific to this program.
#include "utilities.h" #include "utilities.h"
#include <stdlib.h> #include <stdlib.h>
#include <signal.h>
#include <math.h> #include <math.h>
#include <iostream.h> #include <iostream.h>
bool done;
static void finish(int ignore){ done = true; }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
bool done; Instrmnt **instrument = 0;
Instrmnt *instrument = 0;
Messager *messager = 0;
WvOut **output = 0; WvOut **output = 0;
Messager *messager = 0;
Reverb *reverb = 0; Reverb *reverb = 0;
MY_FLOAT pitch = 220.0; Voicer *voicer = 0;
int i, nVoices = 1;
MY_FLOAT t60 = 1.0; // in seconds MY_FLOAT t60 = 1.0; // in seconds
// If you want to change the default sample rate (set in Stk.h), do // If you want to change the default sample rate (set in Stk.h), do
// it before instantiating any objects!! // it before instantiating any objects! If the sample rate is
// specified in the command line, it will override this setting.
Stk::setSampleRate( 22050.0 ); Stk::setSampleRate( 22050.0 );
// Check the command-line arguments for errors and to determine // Check the command-line arguments for errors and to determine
@@ -35,15 +40,28 @@ int main(int argc, char *argv[])
int nOutputs = checkArgs(argc, argv); int nOutputs = checkArgs(argc, argv);
output = (WvOut **) calloc(nOutputs, sizeof(WvOut *)); output = (WvOut **) calloc(nOutputs, sizeof(WvOut *));
// Instantiate the instrument from the command-line argument. // Instantiate the instrument(s) type from the command-line argument
int voice = voiceByName(argv[1], &instrument); // (in utilities.cpp).
if ( voice < 0 ) usage(argv[0]); nVoices = countVoices(argc, argv);
instrument = (Instrmnt **) calloc(nVoices, sizeof(Instrmnt *));
int voice = voiceByName(argv[1], &instrument[0]);
if ( voice < 0 ) {
free( output );
free( instrument );
usage(argv[0]);
}
// If there was no error allocating the first voice, we should be fine for more.
for ( i=1; i<nVoices; i++ )
voiceByName(argv[1], &instrument[i]);
// Parse the command-line flags, instantiate WvOut objects, and instantiate voicer = (Voicer *) new Voicer(nVoices);
// the input message controller (in utilities.cpp). for ( i=0; i<nVoices; i++ )
voicer->addInstrument( instrument[i] );
// Parse the command-line flags, instantiate WvOut objects, and
// instantiate the input message controller (in utilities.cpp).
try { try {
int controlMask = parseArgs(argc, argv, output); parseArgs(argc, argv, output, &messager);
messager = new Messager( controlMask );
} }
catch (StkError &) { catch (StkError &) {
goto cleanup; goto cleanup;
@@ -52,10 +70,13 @@ int main(int argc, char *argv[])
reverb = new PRCRev( t60 ); reverb = new PRCRev( t60 );
reverb->setEffectMix(0.2); reverb->setEffectMix(0.2);
// Install an interrupt handler function.
(void) signal(SIGINT, finish);
// The runtime loop begins here: // The runtime loop begins here:
done = FALSE; done = FALSE;
int nTicks, type, j, i; int nTicks, type, j;
MY_FLOAT temp, byte2, byte3, sample; MY_FLOAT byte2, byte3, sample;
while (!done) { while (!done) {
// Look for new messages and return a delta time (in samples). // Look for new messages and return a delta time (in samples).
@@ -64,9 +85,8 @@ int main(int argc, char *argv[])
done = TRUE; done = TRUE;
nTicks = messager->getDelta(); nTicks = messager->getDelta();
for ( i=0; i<nTicks; i++ ) { for ( i=0; i<nTicks; i++ ) {
sample = reverb->tick( instrument->tick() ); sample = reverb->tick( voicer->tick() );
for ( j=0; j<nOutputs; j++ ) output[j]->tick(sample); for ( j=0; j<nOutputs; j++ ) output[j]->tick(sample);
} }
@@ -79,51 +99,50 @@ int main(int argc, char *argv[])
case __SK_NoteOn_: case __SK_NoteOn_:
if (byte3 == 0.0) // velocity is zero ... really a NoteOff if (byte3 == 0.0) // velocity is zero ... really a NoteOff
instrument->noteOff( 0.5 ); voicer->noteOff( byte2, 64.0 );
else { // a NoteOn else // a NoteOn
if ( byte2 < 0.0 || byte2 > 128.0 ) continue; voicer->noteOn( byte2, byte3 );
pitch = Midi2Pitch[(unsigned int) byte2];
instrument->noteOn(pitch, byte3 * ONE_OVER_128);
}
break; break;
case __SK_NoteOff_: case __SK_NoteOff_:
instrument->noteOff(byte3 * ONE_OVER_128); voicer->noteOff( byte2, byte3 );
break; break;
case __SK_ControlChange_: case __SK_ControlChange_:
if (byte2 == 44.0) if (byte2 == 44.0)
reverb->setEffectMix(byte3 * ONE_OVER_128); reverb->setEffectMix(byte3 * ONE_OVER_128);
else else
instrument->controlChange( (int)byte2, byte3 ); voicer->controlChange( (int) byte2, byte3 );
break; break;
case __SK_AfterTouch_: case __SK_AfterTouch_:
instrument->controlChange( 128, byte2 ); voicer->controlChange( 128, byte2 );
break;
case __SK_PitchChange_:
voicer->setFrequency( byte2 );
break; break;
case __SK_PitchBend_: case __SK_PitchBend_:
if ( byte2 < 0.0 || byte2 > 128.0 ) continue; voicer->pitchBend( byte2 );
temp = byte2 - (int)byte2; // floating-point remainder
pitch = Midi2Pitch[(unsigned int)byte2] * pow(2.0, temp/12.0);
instrument->setFrequency(pitch);
break; break;
case __SK_ProgramChange_: case __SK_ProgramChange_:
if (voice != (int)byte2) { if ( voice != (int) byte2 ) {
instrument->noteOff(1.0); voicer->silence();
// Let the instrument settle a bit. // Let the instrument(s) settle a bit.
for (i=0; i<4096; i++) { for ( i=0; i<4096; i++ ) {
sample = reverb->tick( instrument->tick() ); sample = reverb->tick( voicer->tick() );
for ( j=0; j<nOutputs; j++ ) output[j]->tick(sample); for ( j=0; j<nOutputs; j++ ) output[j]->tick(sample);
} }
delete instrument; for ( i=0; i<nVoices; i++ ) {
voice = voiceByNumber( (int)byte2, &instrument ); voicer->removeInstrument( instrument[i] );
if ( voice < 0 ) { delete instrument[i];
// Default instrument = 0 voice = voiceByNumber( (int)byte2, &instrument[i] );
voice = voiceByNumber( 0, &instrument ); if ( voice < 0 )
voice = voiceByNumber( 0, &instrument[i] );
voicer->addInstrument( instrument[i] );
} }
instrument->noteOn(pitch, 0.2);
} }
} }
} }
@@ -132,7 +151,7 @@ int main(int argc, char *argv[])
// Let the reverb settle a bit. // Let the reverb settle a bit.
nTicks = (long) (t60 * Stk::sampleRate()); nTicks = (long) (t60 * Stk::sampleRate());
for ( i=0; i<nTicks; i++) { for ( i=0; i<nTicks; i++) {
sample = reverb->tick( instrument->tick() ); sample = reverb->tick( voicer->tick() );
for ( j=0; j<nOutputs; j++ ) output[j]->tick(sample); for ( j=0; j<nOutputs; j++ ) output[j]->tick(sample);
} }
@@ -142,8 +161,14 @@ int main(int argc, char *argv[])
free(output); free(output);
delete messager; delete messager;
delete instrument; delete reverb;
delete voicer;
cout << "\ndemo finished ... goodbye.\n" << endl; for ( i=0; i<nVoices; i++ ) delete instrument[i];
free(instrument);
cout << "\nStk demo finished ... goodbye.\n" << endl;
return 0; return 0;
} }

View File

@@ -207,6 +207,10 @@ SOURCE=..\..\src\ModalBar.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\src\Modulate.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Moog.cpp SOURCE=..\..\src\Moog.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -231,6 +235,10 @@ SOURCE=..\..\src\PercFlut.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\src\Phonemes.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Plucked.cpp SOURCE=..\..\src\Plucked.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -299,6 +307,10 @@ SOURCE=..\..\src\Simple.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\src\SingWave.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Sitar.cpp SOURCE=..\..\src\Sitar.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -311,6 +323,10 @@ SOURCE=..\..\src\Socket.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\src\Sphere.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StifKarp.cpp SOURCE=..\..\src\StifKarp.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -319,6 +335,10 @@ SOURCE=..\..\src\Stk.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\src\SubNoise.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Thread.cpp SOURCE=..\..\src\Thread.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -339,10 +359,26 @@ SOURCE=.\utilities.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\src\Vector3D.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Voicer.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\VoicForm.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp SOURCE=..\..\src\WaveLoop.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\src\Whistle.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Wurley.cpp SOURCE=..\..\src\Wurley.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -475,6 +511,10 @@ SOURCE=..\..\include\ModalBar.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\include\Modulate.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Moog.h SOURCE=..\..\include\Moog.h
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -499,6 +539,10 @@ SOURCE=..\..\include\PercFlut.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\include\Phonemes.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Plucked.h SOURCE=..\..\include\Plucked.h
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -567,6 +611,10 @@ SOURCE=..\..\include\Simple.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\include\SingWave.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Sitar.h SOURCE=..\..\include\Sitar.h
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -579,6 +627,10 @@ SOURCE=..\..\include\Socket.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\include\Sphere.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StifKarp.h SOURCE=..\..\include\StifKarp.h
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -611,10 +663,22 @@ SOURCE=.\utilities.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\include\Vector3D.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Voicer.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h SOURCE=..\..\include\WaveLoop.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\include\Whistle.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Wurley.h SOURCE=..\..\include\Wurley.h
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@@ -1,20 +1,20 @@
Suggested Score/Instrument Pairings: Suggested Score/Instrument Pairings:
BeeThree bookert.ski, organs.ski BeeThree bookert.ski, organs.ski
Rhodey doogie.ski Rhodey doogie.ski
Mandolin duelingb.ski Mandolin duelingb.ski
Bowed fiddle.ski Bowed fiddle.ski
PercFlut misacrio.ski PercFlut misacrio.ski
AgogoBel morazbel.ski AgogoBel morazbel.ski
Brass pictures.ski Brass pictures.ski
Wurley nriderson.ski Wurley nriderson.ski
Flute simplgft.ski Flute simplgft.ski
Clarinet simplgft.ski Clarinet simplgft.ski
Marimba spain.ski Marimba spain.ski
Vibraphn spain.ski Vibraphn spain.ski
HeavyMtl streetsf.ski HeavyMtl streetsf.ski
Moog1 thecars.ski Moog1 thecars.ski
TubeBell tubebell.ski TubeBell tubebell.ski
FMVoices lacrymos.ski, vocaliz.ski FMVoices lacrymos.ski, vocaliz.ski
VoicForm lacrymos.ski, vocaliz.ski VoicForm lacrymos.ski, vocaliz.ski

File diff suppressed because it is too large Load Diff

View File

@@ -1,90 +1,90 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoteOn 0.000000 1 60 114.299997 NoteOn 0.000000 1 60 114.299997
NoteOff 0.380000 1 60 63.500000 NoteOff 0.380000 1 60 63.500000
NoteOn 0.020000 1 60 101.600002 NoteOn 0.020000 1 60 101.600002
NoteOff 0.100000 1 60 63.500000 NoteOff 0.100000 1 60 63.500000
NoteOn 0.100000 1 48 63.500000 NoteOn 0.100000 1 48 63.500000
NoteOff 0.200000 1 48 63.500000 NoteOff 0.200000 1 48 63.500000
NoteOn 0.200000 1 48 88.899998 NoteOn 0.200000 1 48 88.899998
NoteOff 0.190023 1 48 63.500000 NoteOff 0.190023 1 48 63.500000
NoteOn 0.010023 1 51 101.600002 NoteOn 0.010023 1 51 101.600002
NoteOff 0.570023 1 51 63.500000 NoteOff 0.570023 1 51 63.500000
NoteOn 0.030023 1 53 88.899998 NoteOn 0.030023 1 53 88.899998
NoteOff 0.570023 1 53 63.500000 NoteOff 0.570023 1 53 63.500000
NoteOn 0.030023 1 48 38.100002 NoteOn 0.030023 1 48 38.100002
NoteOff 0.300000 1 48 63.500000 NoteOff 0.300000 1 48 63.500000
NoteOn 0.300000 1 67 101.600002 NoteOn 0.300000 1 67 101.600002
NoteOff 0.570023 1 67 63.500000 NoteOff 0.570023 1 67 63.500000
NoteOn 0.030023 1 66 76.200003 NoteOn 0.030023 1 66 76.200003
NoteOff 0.190023 1 66 63.500000 NoteOff 0.190023 1 66 63.500000
NoteOn 0.010023 1 65 63.500000 NoteOn 0.010023 1 65 63.500000
NoteOff 0.190023 1 65 63.500000 NoteOff 0.190023 1 65 63.500000
NoteOn 0.010023 1 63 50.800001 NoteOn 0.010023 1 63 50.800001
NoteOff 0.190023 1 63 63.500000 NoteOff 0.190023 1 63 63.500000
NoteOn 0.010023 1 60 76.200003 NoteOn 0.010023 1 60 76.200003
NoteOff 0.380000 1 60 63.500000 NoteOff 0.380000 1 60 63.500000
NoteOn 0.020000 1 58 50.800001 NoteOn 0.020000 1 58 50.800001
NoteOff 0.190023 1 58 63.500000 NoteOff 0.190023 1 58 63.500000
NoteOn 0.010023 1 48 114.299997 NoteOn 0.010023 1 48 114.299997
NoteOff 0.380000 1 48 63.500000 NoteOff 0.380000 1 48 63.500000
NoteOn 0.020000 1 48 101.600002 NoteOn 0.020000 1 48 101.600002
NoteOff 0.100000 1 48 63.500000 NoteOff 0.100000 1 48 63.500000
NoteOn 0.100000 1 36 63.500000 NoteOn 0.100000 1 36 63.500000
NoteOff 0.200000 1 36 63.500000 NoteOff 0.200000 1 36 63.500000
NoteOn 0.200000 1 36 88.899998 NoteOn 0.200000 1 36 88.899998
NoteOff 0.190023 1 36 63.500000 NoteOff 0.190023 1 36 63.500000
NoteOn 0.010023 1 39 101.600002 NoteOn 0.010023 1 39 101.600002
NoteOff 0.570023 1 39 63.500000 NoteOff 0.570023 1 39 63.500000
NoteOn 0.030023 1 41 88.899998 NoteOn 0.030023 1 41 88.899998
NoteOff 0.570023 1 41 63.500000 NoteOff 0.570023 1 41 63.500000
NoteOn 0.030023 1 84 127.000000 NoteOn 0.030023 1 84 127.000000
NoteOff 0.475011 1 84 63.500000 NoteOff 0.475011 1 84 63.500000
NoteOn 0.025034 1 83 120.649998 NoteOn 0.025034 1 83 120.649998
NoteOff 0.066531 1 83 63.500000 NoteOff 0.066531 1 83 63.500000
NoteOn 0.003537 1 82 114.299997 NoteOn 0.003537 1 82 114.299997
NoteOff 0.057007 1 82 63.500000 NoteOff 0.057007 1 82 63.500000
NoteOn 0.003039 1 81 107.950003 NoteOn 0.003039 1 81 107.950003
NoteOff 0.047528 1 81 63.500000 NoteOff 0.047528 1 81 63.500000
NoteOn 0.002540 1 80 101.600002 NoteOn 0.002540 1 80 101.600002
NoteOff 0.047528 1 80 63.500000 NoteOff 0.047528 1 80 63.500000
NoteOn 0.002540 1 78 95.250000 NoteOn 0.002540 1 78 95.250000
NoteOff 0.038005 1 78 63.500000 NoteOff 0.038005 1 78 63.500000
NoteOn 0.002041 1 78 88.899998 NoteOn 0.002041 1 78 88.899998
NoteOff 0.028526 1 78 63.500000 NoteOff 0.028526 1 78 63.500000
NoteOn 0.001542 1 77 82.549997 NoteOn 0.001542 1 77 82.549997
NoteOff 0.019002 1 77 63.500000 NoteOff 0.019002 1 77 63.500000
NoteOn 0.001043 1 76 76.200003 NoteOn 0.001043 1 76 76.200003
NoteOff 0.019002 1 76 63.500000 NoteOff 0.019002 1 76 63.500000
NoteOn 0.001043 1 75 69.850002 NoteOn 0.001043 1 75 69.850002
NoteOff 0.019002 1 75 63.500000 NoteOff 0.019002 1 75 63.500000
NoteOn 0.001043 1 74 63.500000 NoteOn 0.001043 1 74 63.500000
NoteOff 0.019002 1 74 63.500000 NoteOff 0.019002 1 74 63.500000
NoteOn 0.001043 1 73 63.500000 NoteOn 0.001043 1 73 63.500000
NoteOff 0.028526 1 73 63.500000 NoteOff 0.028526 1 73 63.500000
NoteOn 0.001542 1 72 63.500000 NoteOn 0.001542 1 72 63.500000
NoteOff 0.019002 1 72 63.500000 NoteOff 0.019002 1 72 63.500000
NoteOn 0.001043 1 71 57.149998 NoteOn 0.001043 1 71 57.149998
NoteOff 0.028526 1 71 63.500000 NoteOff 0.028526 1 71 63.500000
NoteOn 0.001542 1 70 50.800001 NoteOn 0.001542 1 70 50.800001
NoteOff 0.038005 1 70 63.500000 NoteOff 0.038005 1 70 63.500000
NoteOn 0.002041 1 69 44.449999 NoteOn 0.002041 1 69 44.449999
NoteOff 0.047528 1 69 63.500000 NoteOff 0.047528 1 69 63.500000
NoteOn 0.002540 1 68 38.100002 NoteOn 0.002540 1 68 38.100002
NoteOff 0.057007 1 68 63.500000 NoteOff 0.057007 1 68 63.500000
NoteOn 0.003039 1 67 31.750000 NoteOn 0.003039 1 67 31.750000
NoteOff 0.057007 1 67 63.500000 NoteOff 0.057007 1 67 63.500000
NoteOn 0.003039 1 66 25.400000 NoteOn 0.003039 1 66 25.400000
NoteOff 0.057007 1 66 63.500000 NoteOff 0.057007 1 66 63.500000
NoteOn 0.003039 1 65 31.750000 NoteOn 0.003039 1 65 31.750000
NoteOff 0.066531 1 65 63.500000 NoteOff 0.066531 1 65 63.500000
NoteOn 0.003537 1 64 25.400000 NoteOn 0.003537 1 64 25.400000
NoteOff 0.076009 1 64 63.500000 NoteOff 0.076009 1 64 63.500000
NoteOn 0.004036 1 63 19.050001 NoteOn 0.004036 1 63 19.050001
NoteOff 0.085533 1 63 63.500000 NoteOff 0.085533 1 63 63.500000
NoteOn 0.004535 1 62 31.750000 NoteOn 0.004535 1 62 31.750000
NoteOff 0.095011 1 62 63.500000 NoteOff 0.095011 1 62 63.500000
NoteOn 0.005034 1 61 44.449999 NoteOn 0.005034 1 61 44.449999
NoteOff 0.104535 1 61 63.500000 NoteOff 0.104535 1 61 63.500000
ControlChange 0.005533 1 1 127.000000 ControlChange 0.005533 1 1 127.000000
NoteOn 0.000000 1 60 63.500000 NoteOn 0.000000 1 60 63.500000
NoteOff 1.500000 1 60 63.500000 NoteOff 1.500000 1 60 63.500000

View File

@@ -1,112 +1,112 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
StringDamping 0.0 2 127 StringDamping 0.0 2 127
Chord 0.0 2 100 G Chord 0.0 2 100 G
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 G Chord 0.2 2 100 G
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 C Chord 0.2 2 100 C
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 C Chord 0.2 2 100 C
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 G Chord 0.2 2 100 G
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 G Chord 0.2 2 100 G
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 D Chord 0.2 2 100 D
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 D Chord 0.2 2 100 D
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 G Chord 0.2 2 100 G
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 G Chord 0.2 2 100 G
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 C Chord 0.2 2 100 C
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 C Chord 0.2 2 100 C
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 G Chord 0.2 2 100 G
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 D Chord 0.2 2 100 D
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 G Chord 0.2 2 100 G
StringDamping 0.2 2 32 StringDamping 0.2 2 32
StringDamping 0.0 2 127 StringDamping 0.0 2 127
ChordOff 0.0 2 100 ChordOff 0.0 2 100
Chord 0.2 2 100 G Chord 0.2 2 100 G
StringDamping 0.1 2 32 StringDamping 0.1 2 32
ChordOff 0.1 2 100 ChordOff 0.1 2 100
StringDamping 0.0 2 120 StringDamping 0.0 2 120
Strumming 0.0 2 127 Strumming 0.0 2 127
NoteOn 0.1 2 55 60 NoteOn 0.1 2 55 60
NoteOff 0.7 2 55 60 NoteOff 0.7 2 55 60
NoteOn 0.0 2 60 60 NoteOn 0.0 2 60 60
NoteOff 0.4 2 60 60 NoteOff 0.4 2 60 60
NoteOn 0.0 2 62 60 NoteOn 0.0 2 62 60
NoteOff 0.2 2 62 60 NoteOff 0.2 2 62 60
NoteOn 0.0 2 60 60 NoteOn 0.0 2 60 60
NoteOff 0.2 2 60 60 NoteOff 0.2 2 60 60
NoteOn 0.0 2 59 60 NoteOn 0.0 2 59 60
NoteOff 0.4 2 59 60 NoteOff 0.4 2 59 60
NoteOn 0.0 2 57 60 NoteOn 0.0 2 57 60
NoteOff 0.2 2 57 60 NoteOff 0.2 2 57 60
NoteOn 0.0 2 55 60 NoteOn 0.0 2 55 60
NoteOff 0.2 2 55 60 NoteOff 0.2 2 55 60
NoteOn 0.0 2 62 60 NoteOn 0.0 2 62 60
NoteOff 0.8 2 62 60 NoteOff 0.8 2 62 60
NoteOn 0.1 2 67 100 NoteOn 0.1 2 67 100
NoteOff 0.7 2 67 100 NoteOff 0.7 2 67 100
NoteOn 0.0 2 72 100 NoteOn 0.0 2 72 100
NoteOff 0.4 2 72 100 NoteOff 0.4 2 72 100
NoteOn 0.0 2 74 100 NoteOn 0.0 2 74 100
NoteOff 0.2 2 74 100 NoteOff 0.2 2 74 100
NoteOn 0.0 2 72 100 NoteOn 0.0 2 72 100
NoteOff 0.2 2 72 100 NoteOff 0.2 2 72 100
NotStrumming 0.0 2 0 NotStrumming 0.0 2 0
NoteOn 0.0 2 71 100 NoteOn 0.0 2 71 100
NoteOff 0.1 2 71 100 NoteOff 0.1 2 71 100
NoteOn 0.0 2 76 100 NoteOn 0.0 2 76 100
NoteOff 0.1 2 76 100 NoteOff 0.1 2 76 100
NoteOn 0.0 2 74 100 NoteOn 0.0 2 74 100
NoteOff 0.1 2 74 100 NoteOff 0.1 2 74 100
NoteOn 0.0 2 70 100 NoteOn 0.0 2 70 100
NoteOff 0.1 2 70 100 NoteOff 0.1 2 70 100
NoteOn 0.0 2 69 100 NoteOn 0.0 2 69 100
NoteOff 0.1 2 69 100 NoteOff 0.1 2 69 100
NoteOn 0.0 2 67 100 NoteOn 0.0 2 67 100
NoteOff 0.1 2 67 100 NoteOff 0.1 2 67 100
NoteOn 0.0 2 64 100 NoteOn 0.0 2 64 100
NoteOff 0.1 2 64 100 NoteOff 0.1 2 64 100
NoteOn 0.0 2 62 100 NoteOn 0.0 2 62 100
NoteOff 0.1 2 62 100 NoteOff 0.1 2 62 100
Chord 0.0 2 64 G Chord 0.0 2 64 G
ChordOff 2.0 2 64 ChordOff 2.0 2 64

View File

@@ -1,32 +1,32 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoteOn 0.000000 1 72 88.899998 NoteOn 0.000000 1 72 88.899998
NoteOff 0.400000 1 72 63.500000 NoteOff 0.400000 1 72 63.500000
NoteOn 0.000000 1 71 101.600002 NoteOn 0.000000 1 71 101.600002
NoteOff 0.400000 1 71 63.500000 NoteOff 0.400000 1 71 63.500000
NoteOn 0.000000 1 69 63.500000 NoteOn 0.000000 1 69 63.500000
NoteOff 0.320000 1 69 63.500000 NoteOff 0.320000 1 69 63.500000
NoteOn 0.080000 1 71 101.600002 NoteOn 0.080000 1 71 101.600002
NoteOff 1.200000 1 71 63.500000 NoteOff 1.200000 1 71 63.500000
NoteOn 0.000000 1 67 76.200003 NoteOn 0.000000 1 67 76.200003
NoteOff 0.320000 1 67 63.500000 NoteOff 0.320000 1 67 63.500000
NoteOn 0.080000 1 64 38.100002 NoteOn 0.080000 1 64 38.100002
NoteOff 0.320000 1 64 63.500000 NoteOff 0.320000 1 64 63.500000
NoteOn 0.080000 1 67 101.600002 NoteOn 0.080000 1 67 101.600002
NoteOff 0.800000 1 67 63.500000 NoteOff 0.800000 1 67 63.500000
NoteOn 0.000000 1 69 127.000000 NoteOn 0.000000 1 69 127.000000
NoteOff 0.320000 1 69 63.500000 NoteOff 0.320000 1 69 63.500000
NoteOn 0.080000 1 69 76.200003 NoteOn 0.080000 1 69 76.200003
NoteOff 2.000000 1 69 63.500000 NoteOff 2.000000 1 69 63.500000
NoteOn 0.000000 1 60 114.299997 NoteOn 0.000000 1 60 114.299997
NoteOff 0.400000 1 60 63.500000 NoteOff 0.400000 1 60 63.500000
NoteOn 0.000000 1 62 63.500000 NoteOn 0.000000 1 62 63.500000
NoteOff 0.400000 1 62 63.500000 NoteOff 0.400000 1 62 63.500000
NoteOn 0.000000 1 64 63.500000 NoteOn 0.000000 1 64 63.500000
NoteOff 0.400000 1 64 63.500000 NoteOff 0.400000 1 64 63.500000
NoteOn 0.000000 1 62 88.899998 NoteOn 0.000000 1 62 88.899998
NoteOff 1.200000 1 62 63.500000 NoteOff 1.200000 1 62 63.500000
NoteOn 0.000000 1 60 38.100002 NoteOn 0.000000 1 60 38.100002
NoteOff 0.480000 1 60 63.500000 NoteOff 0.480000 1 60 63.500000
NoteOn 0.120000 1 60 127.000000 NoteOn 0.120000 1 60 127.000000
ControlChange 0.000000 1 1 127.000000 ControlChange 0.000000 1 1 127.000000
NoteOff 2.000000 1 60 63.500000 NoteOff 2.000000 1 60 63.500000

View File

@@ -1,128 +1,128 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoteOn 0.000000 1 36 127.000000 NoteOn 0.000000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000 NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000 NoteOn 0.000000 1 42 127.000000
NoteOn 0.400000 1 38 127.000000 NoteOn 0.400000 1 38 127.000000
NoteOn 0.300000 1 36 127.000000 NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000 NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.000000 1 36 127.000000 NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 42 127.000000 NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 49 127.000000 NoteOn 0.200000 1 49 127.000000
NoteOn 0.200000 1 38 127.000000 NoteOn 0.200000 1 38 127.000000
NoteOn 0.300000 1 36 127.000000 NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000 NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000 NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000 NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000 NoteOn 0.000000 1 42 127.000000
NoteOn 0.400000 1 38 127.000000 NoteOn 0.400000 1 38 127.000000
NoteOn 0.300000 1 36 127.000000 NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000 NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000 NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 60.000000 NoteOn 0.100000 1 36 60.000000
NoteOn 0.200000 1 38 80.000000 NoteOn 0.200000 1 38 80.000000
NoteOn 0.200000 1 38 90.000000 NoteOn 0.200000 1 38 90.000000
NoteOn 0.100000 1 38 100.000000 NoteOn 0.100000 1 38 100.000000
NoteOn 0.100000 1 38 105.000000 NoteOn 0.100000 1 38 105.000000
NoteOn 0.100000 1 38 110.000000 NoteOn 0.100000 1 38 110.000000
NoteOn 0.100000 1 50 127.000000 NoteOn 0.100000 1 50 127.000000
NoteOn 0.100000 1 50 127.000000 NoteOn 0.100000 1 50 127.000000
NoteOn 0.100000 1 50 127.000000 NoteOn 0.100000 1 50 127.000000
NoteOn 0.100000 1 50 127.000000 NoteOn 0.100000 1 50 127.000000
NoteOn 0.100000 1 45 127.000000 NoteOn 0.100000 1 45 127.000000
NoteOn 0.100000 1 45 127.000000 NoteOn 0.100000 1 45 127.000000
NoteOn 0.100000 1 41 127.000000 NoteOn 0.100000 1 41 127.000000
NoteOn 0.100000 1 41 127.000000 NoteOn 0.100000 1 41 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000 NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000 NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 56 127.000000 NoteOn 0.200000 1 56 127.000000
NoteOn 0.200000 1 38 127.000000 NoteOn 0.200000 1 38 127.000000
NoteOn 0.000000 1 56 127.000000 NoteOn 0.000000 1 56 127.000000
NoteOn 0.300000 1 36 127.000000 NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000 NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 54 127.000000 NoteOn 0.100000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000 NoteOn 0.000000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000 NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000 NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.000000 1 54 127.000000 NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000 NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000 NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 56 127.000000 NoteOn 0.200000 1 56 127.000000
NoteOn 0.200000 1 38 127.000000 NoteOn 0.200000 1 38 127.000000
NoteOn 0.000000 1 56 127.000000 NoteOn 0.000000 1 56 127.000000
NoteOn 0.300000 1 36 127.000000 NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000 NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 54 127.000000 NoteOn 0.100000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000 NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000 NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.000000 1 54 127.000000 NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000 NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000 NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 56 127.000000 NoteOn 0.200000 1 56 127.000000
NoteOn 0.200000 1 38 127.000000 NoteOn 0.200000 1 38 127.000000
NoteOn 0.000000 1 56 127.000000 NoteOn 0.000000 1 56 127.000000
NoteOn 0.300000 1 36 127.000000 NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000 NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000 NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 54 127.000000 NoteOn 0.100000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000 NoteOn 0.000000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000 NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000 NoteOn 0.100000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000 NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 32 127.000000 NoteOn 0.100000 1 32 127.000000
NoteOn 0.200000 1 32 127.000000 NoteOn 0.200000 1 32 127.000000
NoteOn 0.200000 1 32 127.000000 NoteOn 0.200000 1 32 127.000000
NoteOn 0.300000 1 32 127.000000 NoteOn 0.300000 1 32 127.000000
NoteOn 0.200000 1 32 127.000000 NoteOn 0.200000 1 32 127.000000
NoteOn 0.200000 1 32 127.000000 NoteOn 0.200000 1 32 127.000000
NoteOn 0.100000 1 52 127.000000 NoteOn 0.100000 1 52 127.000000
NoteOn 0.100000 1 32 127.000000 NoteOn 0.100000 1 32 127.000000
NoteOn 0.100000 1 32 127.000000 NoteOn 0.100000 1 32 127.000000
NoteOn 0.100000 1 32 127.000000 NoteOn 0.100000 1 32 127.000000
NoteOn 0.100000 1 32 127.000000 NoteOn 0.100000 1 32 127.000000
NoteOn 0.000000 1 46 127.000000 NoteOn 0.000000 1 46 127.000000
NoteOn 0.000000 1 49 127.000000 NoteOn 0.000000 1 49 127.000000
NoteOff 1.000000 1 49 127.000000 NoteOff 1.000000 1 49 127.000000

View File

@@ -1,24 +1,24 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoteOn 0.000000 1 57 50.800001 NoteOn 0.000000 1 57 50.800001
NoteOn 0.100000 1 57 50.800001 NoteOn 0.100000 1 57 50.800001
NoteOn 0.100000 1 57 127.000000 NoteOn 0.100000 1 57 127.000000
NoteOn 0.200000 1 59 63.500000 NoteOn 0.200000 1 59 63.500000
NoteOff 0.100000 1 59 63.500000 NoteOff 0.100000 1 59 63.500000
NoteOn 0.100000 1 61 127.000000 NoteOn 0.100000 1 61 127.000000
NoteOff 0.100000 1 61 63.500000 NoteOff 0.100000 1 61 63.500000
NoteOn 0.100000 1 62 127.000000 NoteOn 0.100000 1 62 127.000000
NoteOff 0.100000 1 62 63.500000 NoteOff 0.100000 1 62 63.500000
NoteOn 0.100000 1 64 114.299997 NoteOn 0.100000 1 64 114.299997
NoteOn 0.200000 1 62 63.500000 NoteOn 0.200000 1 62 63.500000
NoteOff 0.100000 1 62 63.500000 NoteOff 0.100000 1 62 63.500000
NoteOn 0.100000 1 61 127.000000 NoteOn 0.100000 1 61 127.000000
NoteOn 0.400000 1 69 127.000000 NoteOn 0.400000 1 69 127.000000
NoteOn 0.200000 1 69 12.700000 NoteOn 0.200000 1 69 12.700000
NoteOff 0.049977 1 69 63.500000 NoteOff 0.049977 1 69 63.500000
NoteOn 0.049977 1 73 63.500000 NoteOn 0.049977 1 73 63.500000
NoteOff 0.049977 1 73 63.500000 NoteOff 0.049977 1 73 63.500000
NoteOn 0.049977 1 71 63.500000 NoteOn 0.049977 1 71 63.500000
NoteOff 0.100000 1 71 63.500000 NoteOff 0.100000 1 71 63.500000
NoteOn 0.100000 1 85 127.000000 NoteOn 0.100000 1 85 127.000000
NoteOn 0.200000 1 45 50.800001 NoteOn 0.200000 1 45 50.800001
NoteOff 0.400000 1 45 63.500000 NoteOff 0.400000 1 45 63.500000

View File

@@ -1,111 +1,111 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoteOn 0.000000 1 60 127.000000 NoteOn 0.000000 1 60 127.000000
NoteOff 0.118776 1 60 63.500000 NoteOff 0.118776 1 60 63.500000
NoteOn 0.006259 1 59 127.000000 NoteOn 0.006259 1 59 127.000000
NoteOff 0.118776 1 59 63.500000 NoteOff 0.118776 1 59 63.500000
NoteOn 0.006259 1 60 127.000000 NoteOn 0.006259 1 60 127.000000
NoteOff 0.118776 1 60 63.500000 NoteOff 0.118776 1 60 63.500000
NoteOn 0.006259 1 62 127.000000 NoteOn 0.006259 1 62 127.000000
NoteOff 0.118776 1 62 63.500000 NoteOff 0.118776 1 62 63.500000
NoteOn 0.006259 1 63 127.000000 NoteOn 0.006259 1 63 127.000000
NoteOff 0.237506 1 63 63.500000 NoteOff 0.237506 1 63 63.500000
NoteOn 0.012517 1 63 127.000000 NoteOn 0.012517 1 63 127.000000
NoteOff 0.062494 1 63 63.500000 NoteOff 0.062494 1 63 63.500000
NoteOn 0.062494 1 65 127.000000 NoteOn 0.062494 1 65 127.000000
NoteOff 0.062494 1 65 63.500000 NoteOff 0.062494 1 65 63.500000
NoteOn 0.062494 1 67 127.000000 NoteOn 0.062494 1 67 127.000000
NoteOff 0.237506 1 67 63.500000 NoteOff 0.237506 1 67 63.500000
NoteOn 0.012517 1 67 127.000000 NoteOn 0.012517 1 67 127.000000
NoteOff 0.118776 1 67 63.500000 NoteOff 0.118776 1 67 63.500000
NoteOn 0.006259 1 68 127.000000 NoteOn 0.006259 1 68 127.000000
NoteOff 0.118776 1 68 63.500000 NoteOff 0.118776 1 68 63.500000
NoteOn 0.006259 1 67 127.000000 NoteOn 0.006259 1 67 127.000000
NoteOff 0.062494 1 67 63.500000 NoteOff 0.062494 1 67 63.500000
NoteOn 0.062494 1 63 127.000000 NoteOn 0.062494 1 63 127.000000
NoteOff 0.062494 1 63 63.500000 NoteOff 0.062494 1 63 63.500000
NoteOn 0.062494 1 60 127.000000 NoteOn 0.062494 1 60 127.000000
NoteOff 0.237506 1 60 63.500000 NoteOff 0.237506 1 60 63.500000
NoteOn 0.012517 1 70 127.000000 NoteOn 0.012517 1 70 127.000000
NoteOff 0.118776 1 70 63.500000 NoteOff 0.118776 1 70 63.500000
NoteOn 0.006259 1 69 127.000000 NoteOn 0.006259 1 69 127.000000
NoteOff 0.118776 1 69 63.500000 NoteOff 0.118776 1 69 63.500000
NoteOn 0.006259 1 70 127.000000 NoteOn 0.006259 1 70 127.000000
NoteOff 0.118776 1 70 63.500000 NoteOff 0.118776 1 70 63.500000
NoteOn 0.006259 1 72 127.000000 NoteOn 0.006259 1 72 127.000000
NoteOff 0.118776 1 72 63.500000 NoteOff 0.118776 1 72 63.500000
NoteOn 0.006259 1 74 127.000000 NoteOn 0.006259 1 74 127.000000
NoteOff 0.118776 1 74 63.500000 NoteOff 0.118776 1 74 63.500000
NoteOn 0.006259 1 72 127.000000 NoteOn 0.006259 1 72 127.000000
NoteOff 0.062494 1 72 63.500000 NoteOff 0.062494 1 72 63.500000
NoteOn 0.062494 1 74 127.000000 NoteOn 0.062494 1 74 127.000000
NoteOff 0.062494 1 74 63.500000 NoteOff 0.062494 1 74 63.500000
NoteOn 0.062494 1 75 127.000000 NoteOn 0.062494 1 75 127.000000
NoteOff 0.062494 1 75 63.500000 NoteOff 0.062494 1 75 63.500000
NoteOn 0.062494 1 77 127.000000 NoteOn 0.062494 1 77 127.000000
NoteOff 0.118776 1 77 63.500000 NoteOff 0.118776 1 77 63.500000
NoteOn 0.006259 1 79 127.000000 NoteOn 0.006259 1 79 127.000000
NoteOff 0.118776 1 79 63.500000 NoteOff 0.118776 1 79 63.500000
NoteOn 0.006259 1 77 127.000000 NoteOn 0.006259 1 77 127.000000
NoteOff 0.118776 1 77 63.500000 NoteOff 0.118776 1 77 63.500000
NoteOn 0.006259 1 74 127.000000 NoteOn 0.006259 1 74 127.000000
NoteOff 0.062494 1 74 63.500000 NoteOff 0.062494 1 74 63.500000
NoteOn 0.062494 1 70 127.000000 NoteOn 0.062494 1 70 127.000000
NoteOff 0.475011 1 70 63.500000 NoteOff 0.475011 1 70 63.500000
NoteOn 0.025034 1 72 127.000000 NoteOn 0.025034 1 72 127.000000
NoteOff 0.118776 1 72 63.500000 NoteOff 0.118776 1 72 63.500000
NoteOn 0.006259 1 75 127.000000 NoteOn 0.006259 1 75 127.000000
NoteOff 0.118776 1 75 63.500000 NoteOff 0.118776 1 75 63.500000
NoteOn 0.006259 1 79 127.000000 NoteOn 0.006259 1 79 127.000000
NoteOff 0.062494 1 79 63.500000 NoteOff 0.062494 1 79 63.500000
NoteOn 0.062494 1 72 127.000000 NoteOn 0.062494 1 72 127.000000
NoteOff 0.062494 1 72 63.500000 NoteOff 0.062494 1 72 63.500000
NoteOn 0.062494 1 70 127.000000 NoteOn 0.062494 1 70 127.000000
NoteOff 0.118776 1 70 63.500000 NoteOff 0.118776 1 70 63.500000
NoteOn 0.006259 1 74 127.000000 NoteOn 0.006259 1 74 127.000000
NoteOff 0.062494 1 74 63.500000 NoteOff 0.062494 1 74 63.500000
NoteOn 0.062494 1 77 127.000000 NoteOn 0.062494 1 77 127.000000
NoteOff 0.062494 1 77 63.500000 NoteOff 0.062494 1 77 63.500000
NoteOn 0.062494 1 70 127.000000 NoteOn 0.062494 1 70 127.000000
NoteOff 0.062494 1 70 63.500000 NoteOff 0.062494 1 70 63.500000
NoteOn 0.062494 1 68 127.000000 NoteOn 0.062494 1 68 127.000000
NoteOff 0.118776 1 68 63.500000 NoteOff 0.118776 1 68 63.500000
NoteOn 0.006259 1 72 127.000000 NoteOn 0.006259 1 72 127.000000
NoteOff 0.118776 1 72 63.500000 NoteOff 0.118776 1 72 63.500000
NoteOn 0.006259 1 75 127.000000 NoteOn 0.006259 1 75 127.000000
NoteOff 0.062494 1 75 63.500000 NoteOff 0.062494 1 75 63.500000
NoteOn 0.062494 1 68 127.000000 NoteOn 0.062494 1 68 127.000000
NoteOff 0.062494 1 68 63.500000 NoteOff 0.062494 1 68 63.500000
NoteOn 0.062494 1 67 127.000000 NoteOn 0.062494 1 67 127.000000
NoteOff 0.118776 1 67 63.500000 NoteOff 0.118776 1 67 63.500000
NoteOn 0.006259 1 70 127.000000 NoteOn 0.006259 1 70 127.000000
NoteOff 0.062494 1 70 63.500000 NoteOff 0.062494 1 70 63.500000
NoteOn 0.062494 1 74 127.000000 NoteOn 0.062494 1 74 127.000000
NoteOff 0.062494 1 74 63.500000 NoteOff 0.062494 1 74 63.500000
NoteOn 0.062494 1 67 127.000000 NoteOn 0.062494 1 67 127.000000
NoteOff 0.062494 1 67 63.500000 NoteOff 0.062494 1 67 63.500000
NoteOn 0.062494 1 65 127.000000 NoteOn 0.062494 1 65 127.000000
NoteOff 0.118776 1 65 63.500000 NoteOff 0.118776 1 65 63.500000
NoteOn 0.006259 1 68 127.000000 NoteOn 0.006259 1 68 127.000000
NoteOff 0.118776 1 68 63.500000 NoteOff 0.118776 1 68 63.500000
NoteOn 0.006259 1 72 127.000000 NoteOn 0.006259 1 72 127.000000
NoteOff 0.062494 1 72 63.500000 NoteOff 0.062494 1 72 63.500000
NoteOn 0.062494 1 65 127.000000 NoteOn 0.062494 1 65 127.000000
NoteOff 0.062494 1 65 63.500000 NoteOff 0.062494 1 65 63.500000
NoteOn 0.062494 1 63 127.000000 NoteOn 0.062494 1 63 127.000000
NoteOff 0.118776 1 63 63.500000 NoteOff 0.118776 1 63 63.500000
NoteOn 0.006259 1 67 127.000000 NoteOn 0.006259 1 67 127.000000
NoteOff 0.062494 1 67 63.500000 NoteOff 0.062494 1 67 63.500000
NoteOn 0.062494 1 70 127.000000 NoteOn 0.062494 1 70 127.000000
NoteOff 0.062494 1 70 63.500000 NoteOff 0.062494 1 70 63.500000
NoteOn 0.062494 1 62 127.000000 NoteOn 0.062494 1 62 127.000000
NoteOff 0.062494 1 62 63.500000 NoteOff 0.062494 1 62 63.500000
NoteOn 0.062494 1 60 127.000000 NoteOn 0.062494 1 60 127.000000
NoteOff 0.124989 1 60 63.500000 NoteOff 0.124989 1 60 63.500000
NoteOn 0.124989 1 79 127.000000 NoteOn 0.124989 1 79 127.000000
NoteOff 0.187483 1 79 63.500000 NoteOff 0.187483 1 79 63.500000
NoteOn 0.187483 1 82 127.000000 NoteOn 0.187483 1 82 127.000000
NoteOff 0.356236 1 82 63.500000 NoteOff 0.356236 1 82 63.500000
NoteOn 0.018776 1 84 127.000000 NoteOn 0.018776 1 84 127.000000
ControlChange 0.000000 1 1 20.000000 ControlChange 0.000000 1 1 20.000000
NoteOff 0.950023 1 84 63.500000 NoteOff 0.950023 1 84 63.500000
NoteOff 0.050023 1 84 63.500000 NoteOff 0.050023 1 84 63.500000

View File

@@ -1,97 +1,97 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoiseLevel 0.000 1 30.0 NoiseLevel 0.000 1 30.0
NoteOn 0.000 1 79 80.000000 NoteOn 0.000 1 79 80.000000
NoteOff 0.100 1 79 63.500000 NoteOff 0.100 1 79 63.500000
NoteOn 0.100 1 84 90.000000 NoteOn 0.100 1 84 90.000000
NoteOff 0.100 1 84 63.500000 NoteOff 0.100 1 84 63.500000
NoteOn 0.100 1 79 70.000000 NoteOn 0.100 1 79 70.000000
NoteOff 0.100 1 79 63.500000 NoteOff 0.100 1 79 63.500000
NoteOn 0.100 1 76 120.000000 NoteOn 0.100 1 76 120.000000
NoteOn 0.100 1 77 110.000000 NoteOn 0.100 1 77 110.000000
NoteOn 0.100 1 79 70.000000 NoteOn 0.100 1 79 70.000000
NoteOff 0.100 1 79 70.0 NoteOff 0.100 1 79 70.0
NoteOn 0.100 1 79 90.000000 NoteOn 0.100 1 79 90.000000
NoteOff 0.150 1 79 63.500000 NoteOff 0.150 1 79 63.500000
NoteOn 0.050 1 79 80.000000 NoteOn 0.050 1 79 80.000000
NoteOff 0.100 1 79 63.500000 NoteOff 0.100 1 79 63.500000
NoteOn 0.100 1 84 90.000000 NoteOn 0.100 1 84 90.000000
NoteOff 0.100 1 84 63.500000 NoteOff 0.100 1 84 63.500000
NoteOn 0.100 1 79 70.000000 NoteOn 0.100 1 79 70.000000
NoteOff 0.100 1 79 63.500000 NoteOff 0.100 1 79 63.500000
NoteOn 0.100 1 76 70.000000 NoteOn 0.100 1 76 70.000000
NoteOn 0.100 1 77 70.000000 NoteOn 0.100 1 77 70.000000
NoteOn 0.100 1 79 80.000000 NoteOn 0.100 1 79 80.000000
NoteOff 0.100 1 79 70.0 NoteOff 0.100 1 79 70.0
NoteOn 0.100 1 79 90.000000 NoteOn 0.100 1 79 90.000000
NoteOff 0.150 1 79 63.500000 NoteOff 0.150 1 79 63.500000
NoteOn 0.050 1 81 120.000000 NoteOn 0.050 1 81 120.000000
NoteOn 0.100 1 79 110.000000 NoteOn 0.100 1 79 110.000000
NoteOn 0.100 1 77 70.000000 NoteOn 0.100 1 77 70.000000
NoteOn 0.100 1 76 120.000000 NoteOn 0.100 1 76 120.000000
NoteOn 0.100 1 74 110.000000 NoteOn 0.100 1 74 110.000000
NoteOn 0.100 1 72 70.000000 NoteOn 0.100 1 72 70.000000
NoteOn 0.100 1 81 120.000000 NoteOn 0.100 1 81 120.000000
NoteOn 0.200 1 82 60.000000 NoteOn 0.200 1 82 60.000000
NoteOff 0.100 1 82 64.000000 NoteOff 0.100 1 82 64.000000
NoteOn 0.100 1 81 110.000000 NoteOn 0.100 1 81 110.000000
NoteOn 0.200 1 79 60.000000 NoteOn 0.200 1 79 60.000000
NoteOff 0.100 1 79 64.000000 NoteOff 0.100 1 79 64.000000
NoteOn 0.100 1 77 110.000000 NoteOn 0.100 1 77 110.000000
NoteOn 0.200 1 76 60.000000 NoteOn 0.200 1 76 60.000000
NoteOff 0.100 1 76 64.000000 NoteOff 0.100 1 76 64.000000
NoteOn 0.100 1 77 120.000000 NoteOn 0.100 1 77 120.000000
NoteOn 0.100 1 76 110.000000 NoteOn 0.100 1 76 110.000000
NoteOn 0.100 1 74 70.000000 NoteOn 0.100 1 74 70.000000
NoteOn 0.100 1 76 120.000000 NoteOn 0.100 1 76 120.000000
NoteOn 0.100 1 77 110.000000 NoteOn 0.100 1 77 110.000000
NoteOff 0.100 1 77 64.000000 NoteOff 0.100 1 77 64.000000
NoteOn 0.100 1 79 120.000000 NoteOn 0.100 1 79 120.000000
NoteOn 0.100 1 81 110.000000 NoteOn 0.100 1 81 110.000000
NoteOn 0.100 1 79 70.000000 NoteOn 0.100 1 79 70.000000
NoteOn 0.100 1 77 120.000000 NoteOn 0.100 1 77 120.000000
NoteOn 0.100 1 76 110.000000 NoteOn 0.100 1 76 110.000000
NoteOn 0.100 1 74 110.000000 NoteOn 0.100 1 74 110.000000
NoteOn 0.100 1 79 120.000000 NoteOn 0.100 1 79 120.000000
NoteOn 0.200 1 81 110.000000 NoteOn 0.200 1 81 110.000000
NoteOn 0.200 1 79 70.000000 NoteOn 0.200 1 79 70.000000
NoteOn 0.200 1 77 120.000000 NoteOn 0.200 1 77 120.000000
NoteOn 0.200 1 76 110.000000 NoteOn 0.200 1 76 110.000000
NoteOn 0.200 1 74 110.000000 NoteOn 0.200 1 74 110.000000
NoteOff 0.100 1 74 110.000000 NoteOff 0.100 1 74 110.000000
NoteOn 0.100 1 76 120.000000 NoteOn 0.100 1 76 120.000000
NoteOn 0.100 1 74 110.000000 NoteOn 0.100 1 74 110.000000
NoteOn 0.100 1 72 70.000000 NoteOn 0.100 1 72 70.000000
NoteOn 0.100 1 74 120.000000 NoteOn 0.100 1 74 120.000000
NoteOff 0.070 1 74 120.000000 NoteOff 0.070 1 74 120.000000
NoteOn 0.030 1 76 100.000000 NoteOn 0.030 1 76 100.000000
NoteOff 0.070 1 76 120.000000 NoteOff 0.070 1 76 120.000000
NoteOn 0.030 1 77 100.000000 NoteOn 0.030 1 77 100.000000
NoteOff 0.070 1 77 120.000000 NoteOff 0.070 1 77 120.000000
NoteOn 0.030 1 79 100.000000 NoteOn 0.030 1 79 100.000000
NoteOff 0.070 1 79 120.000000 NoteOff 0.070 1 79 120.000000
NoteOn 0.030 1 81 100.000000 NoteOn 0.030 1 81 100.000000
NoteOff 0.070 1 81 120.000000 NoteOff 0.070 1 81 120.000000
NoteOn 0.030 1 82 100.000000 NoteOn 0.030 1 82 100.000000
NoteOff 0.070 1 82 120.000000 NoteOff 0.070 1 82 120.000000
NoteOn 0.030 1 81 100.000000 NoteOn 0.030 1 81 100.000000
NoteOff 0.070 1 81 120.000000 NoteOff 0.070 1 81 120.000000
NoteOn 0.030 1 82 100.000000 NoteOn 0.030 1 82 100.000000
NoteOff 0.070 1 82 120.000000 NoteOff 0.070 1 82 120.000000
NoteOn 0.030 1 79 100.000000 NoteOn 0.030 1 79 100.000000
NoteOff 0.070 1 79 120.000000 NoteOff 0.070 1 79 120.000000
NoiseLevel 0.000 1 40.0 NoiseLevel 0.000 1 40.0
Modulation 0.000 1 25.0 Modulation 0.000 1 25.0
NoteOn 0.030 1 77 120.000000 NoteOn 0.030 1 77 120.000000
NoteOn 1.000 1 89 100.000000 NoteOn 1.000 1 89 100.000000
NoteOff 0.200 1 77 120.000000 NoteOff 0.200 1 77 120.000000

View File

@@ -1,180 +1,180 @@
NoteOn 0.000315 2 69 69 NoteOn 0.000315 2 69 69
NoteOff 0.139851 2 69 0 NoteOff 0.139851 2 69 0
NoteOn 0.292059 2 74 79 NoteOn 0.292059 2 74 79
NoteOff 0.069197 2 74 0 NoteOff 0.069197 2 74 0
NoteOn 0.046664 2 74 71 NoteOn 0.046664 2 74 71
NoteOff 0.062959 2 74 0 NoteOff 0.062959 2 74 0
NoteOn 0.025777 2 74 47 NoteOn 0.025777 2 74 47
NoteOff 0.037024 2 74 0 NoteOff 0.037024 2 74 0
NoteOn 0.065524 2 74 63 NoteOn 0.065524 2 74 63
NoteOff 0.059605 2 74 0 NoteOff 0.059605 2 74 0
NoteOn 0.019622 2 74 47 NoteOn 0.019622 2 74 47
NoteOff 0.039886 2 74 0 NoteOff 0.039886 2 74 0
NoteOn 0.052080 2 74 67 NoteOn 0.052080 2 74 67
NoteOff 0.061615 2 74 0 NoteOff 0.061615 2 74 0
NoteOn 0.021743 2 74 53 NoteOn 0.021743 2 74 53
NoteOff 0.042091 2 74 0 NoteOff 0.042091 2 74 0
NoteOn 0.056058 2 74 69 NoteOn 0.056058 2 74 69
NoteOff 0.122627 2 74 0 NoteOff 0.122627 2 74 0
NoteOn 0.047608 2 74 87 NoteOn 0.047608 2 74 87
NoteOff 0.128503 2 74 0 NoteOff 0.128503 2 74 0
NoteOn 0.187575 2 74 79 NoteOn 0.187575 2 74 79
NoteOff 0.113216 2 74 0 NoteOff 0.113216 2 74 0
NoteOn 0.055912 2 73 82 NoteOn 0.055912 2 73 82
NoteOff 0.145445 2 73 0 NoteOff 0.145445 2 73 0
NoteOn 0.104378 2 73 73 NoteOn 0.104378 2 73 73
NoteOff 0.120442 2 73 0 NoteOff 0.120442 2 73 0
NoteOn 0.047541 2 69 73 NoteOn 0.047541 2 69 73
NoteOff 0.151890 2 69 0 NoteOff 0.151890 2 69 0
NoteOn 0.098655 2 69 64 NoteOn 0.098655 2 69 64
NoteOff 0.137789 2 69 0 NoteOff 0.137789 2 69 0
NoteOn 0.042621 2 71 76 NoteOn 0.042621 2 71 76
NoteOff 0.171097 2 71 0 NoteOff 0.171097 2 71 0
NoteOn 0.081635 2 71 61 NoteOn 0.081635 2 71 61
NoteOff 0.073859 2 71 0 NoteOff 0.073859 2 71 0
NoteOn 0.110418 2 66 69 NoteOn 0.110418 2 66 69
NoteOff 0.304332 2 66 0 NoteOff 0.304332 2 66 0
NoteOn 0.119942 2 66 69 NoteOn 0.119942 2 66 69
NoteOff 0.057357 2 66 0 NoteOff 0.057357 2 66 0
NoteOn 0.034674 2 66 60 NoteOn 0.034674 2 66 60
NoteOff 0.056795 2 66 0 NoteOff 0.056795 2 66 0
NoteOn 0.018853 2 66 76 NoteOn 0.018853 2 66 76
NoteOff 0.061343 2 66 0 NoteOff 0.061343 2 66 0
NoteOn 0.048614 2 66 67 NoteOn 0.048614 2 66 67
NoteOff 0.058950 2 66 0 NoteOff 0.058950 2 66 0
NoteOn 0.008595 2 66 63 NoteOn 0.008595 2 66 63
NoteOff 0.057296 2 66 0 NoteOff 0.057296 2 66 0
NoteOn 0.036486 2 66 67 NoteOn 0.036486 2 66 67
NoteOff 0.125570 2 66 0 NoteOff 0.125570 2 66 0
NoteOn 0.055182 2 66 82 NoteOn 0.055182 2 66 82
NoteOff 0.079954 2 66 0 NoteOff 0.079954 2 66 0
NoteOn 0.021852 2 66 64 NoteOn 0.021852 2 66 64
NoteOff 0.085418 2 66 0 NoteOff 0.085418 2 66 0
NoteOn 0.065201 2 64 79 NoteOn 0.065201 2 64 79
NoteOff 0.070529 2 64 0 NoteOff 0.070529 2 64 0
NoteOn 0.055850 2 66 76 NoteOn 0.055850 2 66 76
NoteOff 0.080037 2 66 0 NoteOff 0.080037 2 66 0
NoteOn 0.047400 2 64 73 NoteOn 0.047400 2 64 73
NoteOff 0.079393 2 64 0 NoteOff 0.079393 2 64 0
NoteOn 0.075934 2 62 76 NoteOn 0.075934 2 62 76
NoteOff 0.073956 2 62 0 NoteOff 0.073956 2 62 0
NoteOn 0.038639 2 62 69 NoteOn 0.038639 2 62 69
NoteOff 0.125310 2 62 0 NoteOff 0.125310 2 62 0
NoteOn 0.067131 2 62 67 NoteOn 0.067131 2 62 67
NoteOff 0.114670 2 62 0 NoteOff 0.114670 2 62 0
NoteOn 0.053501 2 62 62 NoteOn 0.053501 2 62 62
NoteOff 0.058095 2 62 0 NoteOff 0.058095 2 62 0
NoteOn 0.017163 2 62 47 NoteOn 0.017163 2 62 47
NoteOff 0.056632 2 62 0 NoteOff 0.056632 2 62 0
NoteOn 0.023810 2 62 64 NoteOn 0.023810 2 62 64
NoteOff 0.070499 2 62 0 NoteOff 0.070499 2 62 0
NoteOn 0.018403 2 62 64 NoteOn 0.018403 2 62 64
NoteOff 0.044563 2 62 0 NoteOff 0.044563 2 62 0
NoteOn 0.038905 2 62 64 NoteOn 0.038905 2 62 64
NoteOff 0.128219 2 62 0 NoteOff 0.128219 2 62 0
NoteOn 0.020654 2 62 79 NoteOn 0.020654 2 62 79
NoteOff 0.100199 2 62 0 NoteOff 0.100199 2 62 0
NoteOn 0.119351 2 66 69 NoteOn 0.119351 2 66 69
NoteOff 0.140313 2 66 0 NoteOff 0.140313 2 66 0
NoteOn 0.023378 2 64 67 NoteOn 0.023378 2 64 67
NoteOff 0.157359 2 64 0 NoteOff 0.157359 2 64 0
NoteOn 0.103959 2 62 69 NoteOn 0.103959 2 62 69
NoteOff 0.072433 2 62 0 NoteOff 0.072433 2 62 0
NoteOn 0.089338 2 62 63 NoteOn 0.089338 2 62 63
NoteOff 0.067472 2 62 0 NoteOff 0.067472 2 62 0
NoteOn 0.131003 2 62 63 NoteOn 0.131003 2 62 63
NoteOff 0.092003 2 62 0 NoteOff 0.092003 2 62 0
NoteOn 0.084592 2 62 64 NoteOn 0.084592 2 62 64
NoteOff 0.156367 2 62 0 NoteOff 0.156367 2 62 0
NoteOn 0.024942 2 62 69 NoteOn 0.024942 2 62 69
NoteOff 0.154966 2 62 0 NoteOff 0.154966 2 62 0
NoteOn 0.023168 2 62 67 NoteOn 0.023168 2 62 67
NoteOff 0.402274 2 62 0 NoteOff 0.402274 2 62 0
NoteOn 0.151088 2 69 82 NoteOn 0.151088 2 69 82
NoteOff 0.295762 2 69 0 NoteOff 0.295762 2 69 0
NoteOn 0.144298 2 74 67 NoteOn 0.144298 2 74 67
NoteOff 0.064684 2 74 0 NoteOff 0.064684 2 74 0
NoteOn 0.046916 2 74 61 NoteOn 0.046916 2 74 61
NoteOff 0.061961 2 74 0 NoteOff 0.061961 2 74 0
NoteOn 0.013175 2 74 58 NoteOn 0.013175 2 74 58
NoteOff 0.063742 2 74 0 NoteOff 0.063742 2 74 0
NoteOn 0.063079 2 74 64 NoteOn 0.063079 2 74 64
NoteOff 0.115461 2 74 0 NoteOff 0.115461 2 74 0
NoteOn 0.066345 2 74 64 NoteOn 0.066345 2 74 64
NoteOff 0.104482 2 74 0 NoteOff 0.104482 2 74 0
NoteOn 0.058225 2 74 69 NoteOn 0.058225 2 74 69
NoteOff 0.137897 2 74 0 NoteOff 0.137897 2 74 0
NoteOn 0.028045 2 74 82 NoteOn 0.028045 2 74 82
NoteOff 0.227867 2 74 0 NoteOff 0.227867 2 74 0
NoteOn 0.089793 2 74 73 NoteOn 0.089793 2 74 73
NoteOff 0.137043 2 74 0 NoteOff 0.137043 2 74 0
NoteOn 0.027024 2 73 64 NoteOn 0.027024 2 73 64
NoteOff 0.156746 2 73 0 NoteOff 0.156746 2 73 0
NoteOn 0.091269 2 73 73 NoteOn 0.091269 2 73 73
NoteOff 0.144116 2 73 0 NoteOff 0.144116 2 73 0
NoteOn 0.040937 2 69 76 NoteOn 0.040937 2 69 76
NoteOff 0.131683 2 69 0 NoteOff 0.131683 2 69 0
NoteOn 0.111516 2 69 63 NoteOn 0.111516 2 69 63
NoteOff 0.119809 2 69 0 NoteOff 0.119809 2 69 0
NoteOn 0.055603 2 71 69 NoteOn 0.055603 2 71 69
NoteOff 0.151398 2 71 0 NoteOff 0.151398 2 71 0
NoteOn 0.092930 2 71 61 NoteOn 0.092930 2 71 61
NoteOff 0.077496 2 71 0 NoteOff 0.077496 2 71 0
NoteOn 0.108207 2 66 73 NoteOn 0.108207 2 66 73
NoteOff 0.268736 2 66 0 NoteOff 0.268736 2 66 0
NoteOn 0.105231 2 66 82 NoteOn 0.105231 2 66 82
NoteOff 0.068718 2 66 0 NoteOff 0.068718 2 66 0
NoteOn 0.052997 2 66 69 NoteOn 0.052997 2 66 69
NoteOff 0.121595 2 66 0 NoteOff 0.121595 2 66 0
NoteOn 0.089177 2 66 58 NoteOn 0.089177 2 66 58
NoteOff 0.106939 2 66 0 NoteOff 0.106939 2 66 0
NoteOn 0.049675 2 66 67 NoteOn 0.049675 2 66 67
NoteOff 0.145059 2 66 0 NoteOff 0.145059 2 66 0
NoteOn 0.033535 2 66 24 NoteOn 0.033535 2 66 24
NoteOff 0.169419 2 66 0 NoteOff 0.169419 2 66 0
NoteOn 0.058897 2 66 63 NoteOn 0.058897 2 66 63
NoteOff 0.086285 2 66 0 NoteOff 0.086285 2 66 0
NoteOn 0.041606 2 64 76 NoteOn 0.041606 2 64 76
NoteOff 0.084153 2 64 0 NoteOff 0.084153 2 64 0
NoteOn 0.044987 2 66 69 NoteOn 0.044987 2 66 69
NoteOff 0.100239 2 66 0 NoteOff 0.100239 2 66 0
NoteOn 0.022854 2 64 76 NoteOn 0.022854 2 64 76
NoteOff 0.075048 2 64 0 NoteOff 0.075048 2 64 0
NoteOn 0.065983 2 62 67 NoteOn 0.065983 2 62 67
NoteOff 0.081468 2 62 0 NoteOff 0.081468 2 62 0
NoteOn 0.040989 2 62 71 NoteOn 0.040989 2 62 71
NoteOff 0.134240 2 62 0 NoteOff 0.134240 2 62 0
NoteOn 0.062401 2 62 61 NoteOn 0.062401 2 62 61
NoteOff 0.119152 2 62 0 NoteOff 0.119152 2 62 0
NoteOn 0.050401 2 62 64 NoteOn 0.050401 2 62 64
NoteOff 0.128506 2 62 0 NoteOff 0.128506 2 62 0
NoteOn 0.030134 2 62 64 NoteOn 0.030134 2 62 64
NoteOff 0.142160 2 62 0 NoteOff 0.142160 2 62 0
NoteOn 0.037510 2 62 79 NoteOn 0.037510 2 62 79
NoteOff 0.239364 2 62 0 NoteOff 0.239364 2 62 0
NoteOn 0.018231 2 66 73 NoteOn 0.018231 2 66 73
NoteOff 0.131528 2 66 0 NoteOff 0.131528 2 66 0
NoteOn 0.042607 2 64 76 NoteOn 0.042607 2 64 76
NoteOff 0.149396 2 64 0 NoteOff 0.149396 2 64 0
NoteOn 0.089318 2 62 73 NoteOn 0.089318 2 62 73
NoteOff 0.087485 2 62 0 NoteOff 0.087485 2 62 0
NoteOn 0.085324 2 62 73 NoteOn 0.085324 2 62 73
NoteOff 0.072863 2 62 0 NoteOff 0.072863 2 62 0
NoteOn 0.023103 2 62 73 NoteOn 0.023103 2 62 73
NoteOff 0.085817 2 62 0 NoteOff 0.085817 2 62 0
NoteOn 0.021983 2 62 64 NoteOn 0.021983 2 62 64
NoteOff 0.061305 2 62 0 NoteOff 0.061305 2 62 0
NoteOn 0.036091 2 62 61 NoteOn 0.036091 2 62 61
NoteOff 0.070809 2 62 0 NoteOff 0.070809 2 62 0
NoteOn 0.011382 2 62 58 NoteOn 0.011382 2 62 58
NoteOff 0.060215 2 62 0 NoteOff 0.060215 2 62 0
NoteOn 0.027180 2 62 61 NoteOn 0.027180 2 62 61
NoteOff 0.075393 2 62 0 NoteOff 0.075393 2 62 0
NoteOn 0.025560 2 62 29 NoteOn 0.025560 2 62 29
NoteOff 0.038858 2 62 0 NoteOff 0.038858 2 62 0
NoteOn 0.030691 2 62 64 NoteOn 0.030691 2 62 64
NoteOff 0.129305 2 62 0 NoteOff 0.129305 2 62 0
NoteOn 0.021792 2 62 76 NoteOn 0.021792 2 62 76
NoteOff 0.075593 2 62 0 NoteOff 0.075593 2 62 0
NoteOn 0.030875 2 62 95 NoteOn 0.030875 2 62 95
NoteOff 0.459440 2 62 0 NoteOff 0.459440 2 62 0

View File

@@ -1,105 +1,105 @@
/* Howdy!!!! SKINI0.9 Test Score ***********/ /* Howdy!!!! SKINI0.9 Test Score ***********/
// First a pretty good player // First a pretty good player
PlayerSkill 0.000000 2 100 PlayerSkill 0.000000 2 100
NoteOn 0.000081 2 69 64 NoteOn 0.000081 2 69 64
NoteOff 0.220735 2 69 0 NoteOff 0.220735 2 69 0
Strumming 0.000000 2 127 Strumming 0.000000 2 127
NoteOn 0.244988 2 74 69 NoteOn 0.244988 2 74 69
NoteOff 1.085355 2 74 0 NoteOff 1.085355 2 74 0
NotStrumming 0.000000 2 0 NotStrumming 0.000000 2 0
NoteOn 0.133034 2 74 58 NoteOn 0.133034 2 74 58
NoteOff 0.121377 2 74 0 NoteOff 0.121377 2 74 0
NoteOn 0.025178 2 73 56 NoteOn 0.025178 2 73 56
NoteOff 0.204028 2 73 0 NoteOff 0.204028 2 73 0
NoteOn 0.070314 2 73 58 NoteOn 0.070314 2 73 58
NoteOff 0.150998 2 73 0 NoteOff 0.150998 2 73 0
NoteOn 0.029853 2 69 63 NoteOn 0.029853 2 69 63
NoteOff 0.152847 2 69 0 NoteOff 0.152847 2 69 0
NoteOn 0.097649 2 69 58 NoteOn 0.097649 2 69 58
NoteOff 0.140495 2 69 0 NoteOff 0.140495 2 69 0
NoteOn 0.052114 2 71 69 NoteOn 0.052114 2 71 69
NoteOff 0.177446 2 71 0 NoteOff 0.177446 2 71 0
NoteOn 0.084674 2 71 53 NoteOn 0.084674 2 71 53
NoteOff 0.084189 2 71 0 NoteOff 0.084189 2 71 0
NoteOn 0.107113 2 66 82 NoteOn 0.107113 2 66 82
NoteOff 0.345345 2 66 0 NoteOff 0.345345 2 66 0
Strumming 0.000000 2 127 Strumming 0.000000 2 127
NoteOn 0.114209 2 66 69 NoteOn 0.114209 2 66 69
NoteOff 0.638118 2 66 0 NoteOff 0.638118 2 66 0
NotStrumming 0.000000 2 0 NotStrumming 0.000000 2 0
NoteOn 0.096405 2 66 61 NoteOn 0.096405 2 66 61
NoteOff 0.134993 2 66 0 NoteOff 0.134993 2 66 0
NoteOn 0.028328 2 64 67 NoteOn 0.028328 2 64 67
NoteOff 0.251752 2 64 0 NoteOff 0.251752 2 64 0
NoteOn 0.052434 2 62 64 NoteOn 0.052434 2 62 64
NoteOff 0.077954 2 62 0 NoteOff 0.077954 2 62 0
Strumming 0.000000 2 127 Strumming 0.000000 2 127
NoteOn 0.069474 2 62 69 NoteOn 0.069474 2 62 69
NoteOff 1.132502 2 62 0 NoteOff 1.132502 2 62 0
NotStrumming 0.000000 2 0 NotStrumming 0.000000 2 0
NoteOn 0.043887 2 66 69 NoteOn 0.043887 2 66 69
NoteOff 0.096938 2 66 0 NoteOff 0.096938 2 66 0
NoteOn 0.046985 2 64 71 NoteOn 0.046985 2 64 71
NoteOff 0.085443 2 64 0 NoteOff 0.085443 2 64 0
NoteOn 0.055538 2 66 63 NoteOn 0.055538 2 66 63
NoteOff 0.105148 2 66 0 NoteOff 0.105148 2 66 0
NoteOn 0.021553 2 64 62 NoteOn 0.021553 2 64 62
NoteOff 0.103749 2 64 0 NoteOff 0.103749 2 64 0
Strumming 0.000000 2 127 Strumming 0.000000 2 127
NoteOn 0.054633 2 62 67 NoteOn 0.054633 2 62 67
NoteOff 1.033837 2 62 0 NoteOff 1.033837 2 62 0
NotStrumming 0.000000 2 0 NotStrumming 0.000000 2 0
// Now a really bad player // Now a really bad player
PlayerSkill 0.000000 2 10 PlayerSkill 0.000000 2 10
NoteOn 0.235617 2 69 69 NoteOn 0.235617 2 69 69
NoteOff 0.316772 2 69 0 NoteOff 0.316772 2 69 0
Strumming 0.000000 2 127 Strumming 0.000000 2 127
NoteOn 0.145871 2 74 64 NoteOn 0.145871 2 74 64
NoteOff 1.100060 2 74 0 NoteOff 1.100060 2 74 0
NotStrumming 0.000000 2 0 NotStrumming 0.000000 2 0
NoteOn 0.115729 2 74 58 NoteOn 0.115729 2 74 58
NoteOff 0.166520 2 74 0 NoteOff 0.166520 2 74 0
NoteOn 0.007216 2 73 61 NoteOn 0.007216 2 73 61
NoteOff 0.192106 2 73 0 NoteOff 0.192106 2 73 0
NoteOn 0.067405 2 73 62 NoteOn 0.067405 2 73 62
NoteOff 0.160641 2 73 0 NoteOff 0.160641 2 73 0
NoteOn 0.015116 2 69 58 NoteOn 0.015116 2 69 58
NoteOff 0.176983 2 69 0 NoteOff 0.176983 2 69 0
NoteOn 0.083744 2 69 62 NoteOn 0.083744 2 69 62
NoteOff 0.155400 2 69 0 NoteOff 0.155400 2 69 0
NoteOn 0.020502 2 71 69 NoteOn 0.020502 2 71 69
NoteOff 0.187489 2 71 0 NoteOff 0.187489 2 71 0
NoteOn 0.076011 2 71 56 NoteOn 0.076011 2 71 56
NoteOff 0.094456 2 71 0 NoteOff 0.094456 2 71 0
NoteOn 0.094632 2 66 73 NoteOn 0.094632 2 66 73
NoteOff 0.303251 2 66 0 NoteOff 0.303251 2 66 0
Strumming 0.000000 2 127 Strumming 0.000000 2 127
NoteOn 0.136058 2 66 69 NoteOn 0.136058 2 66 69
NoteOff 0.601147 2 66 0 NoteOff 0.601147 2 66 0
NotStrumming 0.000000 2 0 NotStrumming 0.000000 2 0
NoteOn 0.073985 2 66 56 NoteOn 0.073985 2 66 56
NoteOff 0.145772 2 66 0 NoteOff 0.145772 2 66 0
NoteOn 0.028922 2 64 64 NoteOn 0.028922 2 64 64
NoteOff 0.082327 2 64 0 NoteOff 0.082327 2 64 0
NoteOn 0.047864 2 66 61 NoteOn 0.047864 2 66 61
NoteOff 0.099460 2 66 0 NoteOff 0.099460 2 66 0
NoteOn 0.020486 2 64 40 NoteOn 0.020486 2 64 40
NoteOff 0.131447 2 64 0 NoteOff 0.131447 2 64 0
Strumming 0.000000 2 127 Strumming 0.000000 2 127
NoteOn 0.042691 2 62 71 NoteOn 0.042691 2 62 71
NoteOff 1.131626 2 62 0 NoteOff 1.131626 2 62 0
NotStrumming 0.000000 2 0 NotStrumming 0.000000 2 0
NoteOn 0.040285 2 66 51 NoteOn 0.040285 2 66 51
NoteOff 0.141532 2 66 0 NoteOff 0.141532 2 66 0
NoteOn 0.016442 2 64 64 NoteOn 0.016442 2 64 64
NoteOff 0.195371 2 64 0 NoteOff 0.195371 2 64 0
NoteOn 0.073368 2 62 67 NoteOn 0.073368 2 62 67
NoteOff 0.098382 2 62 0 NoteOff 0.098382 2 62 0
Strumming 0.000000 2 127 Strumming 0.000000 2 127
NoteOn 0.082045 2 62 69 NoteOn 0.082045 2 62 69
NoteOff 0.796526 2 62 0 NoteOff 0.796526 2 62 0
NotStrumming 0.000000 2 0 NotStrumming 0.000000 2 0
NoteOn 0.079242 2 62 64 NoteOn 0.079242 2 62 64
NoteOff 0.473653 2 62 0 NoteOff 0.473653 2 62 0

View File

@@ -1,34 +1,34 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
ControlChange 0.000000 1 1 20.000000 ControlChange 0.000000 1 1 20.000000
ControlChange 0.000000 1 4 22.000000 ControlChange 0.000000 1 4 22.000000
NoteOn 0.000000 1 46 64.000000 NoteOn 0.000000 1 46 64.000000
ControlChange 0.200000 1 4 8.000000 ControlChange 0.200000 1 4 8.000000
NoteOff 0.800000 1 46 64.500000 NoteOff 0.800000 1 46 64.500000
NoteOn 0.000000 1 51 74.000000 NoteOn 0.000000 1 51 74.000000
NoteOff 0.750000 1 51 74.500000 NoteOff 0.750000 1 51 74.500000
NoteOn 0.000000 1 53 84.000000 NoteOn 0.000000 1 53 84.000000
ControlChange 0.000000 1 4 0.000000 ControlChange 0.000000 1 4 0.000000
NoteOff 0.250000 1 53 84.500000 NoteOff 0.250000 1 53 84.500000
NoteOn 0.000000 1 54 84.000000 NoteOn 0.000000 1 54 84.000000
ControlChange 0.000000 1 4 10.000000 ControlChange 0.000000 1 4 10.000000
NoteOff 1.500000 1 54 84.500000 NoteOff 1.500000 1 54 84.500000
NoteOn 0.000000 1 54 84.000000 NoteOn 0.000000 1 54 84.000000
ControlChange 0.000000 1 4 8.000000 ControlChange 0.000000 1 4 8.000000
NoteOff 0.500000 1 54 84.500000 NoteOff 0.500000 1 54 84.500000
NoteOn 0.000000 1 53 84.000000 NoteOn 0.000000 1 53 84.000000
ControlChange 0.000000 1 4 0.000000 ControlChange 0.000000 1 4 0.000000
NoteOff 0.500000 1 53 84.500000 NoteOff 0.500000 1 53 84.500000
NoteOn 0.000000 1 51 84.000000 NoteOn 0.000000 1 51 84.000000
NoteOff 0.500000 1 51 84.500000 NoteOff 0.500000 1 51 84.500000
NoteOn 0.000000 1 53 84.000000 NoteOn 0.000000 1 53 84.000000
ControlChange 0.000000 1 4 4.000000 ControlChange 0.000000 1 4 4.000000
NoteOff 0.500000 1 53 84.500000 NoteOff 0.500000 1 53 84.500000
NoteOn 0.000000 1 54 94.000000 NoteOn 0.000000 1 54 94.000000
NoteOff 0.500000 1 54 94.500000 NoteOff 0.500000 1 54 94.500000
NoteOn 0.000000 1 51 74.000000 NoteOn 0.000000 1 51 74.000000
ControlChange 0.000000 1 4 0.000000 ControlChange 0.000000 1 4 0.000000
NoteOff 1.000000 1 51 74.500000 NoteOff 1.000000 1 51 74.500000
NoteOn 0.000000 1 46 32.000000 NoteOn 0.000000 1 46 32.000000
ControlChange 0.000000 1 4 8.000000 ControlChange 0.000000 1 4 8.000000
ControlChange 0.000000 1 1 40.000000 ControlChange 0.000000 1 1 40.000000
NoteOff 1.950023 1 46 64.500000 NoteOff 1.950023 1 46 64.500000

View File

@@ -1,45 +1,45 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoteOn 0.000082 2 55 82 NoteOn 0.000082 2 55 82
NoteOff 1.000000 2 55 0 NoteOff 1.000000 2 55 0
NoteOn 0.000082 2 55 82 NoteOn 0.000082 2 55 82
NoteOff 0.700000 2 55 0 NoteOff 0.700000 2 55 0
NoteOn 0.000082 2 62 82 NoteOn 0.000082 2 62 82
NoteOff 0.600000 2 62 0 NoteOff 0.600000 2 62 0
NoteOn 0.000082 2 62 82 NoteOn 0.000082 2 62 82
NoteOff 1.000000 2 62 0 NoteOff 1.000000 2 62 0
NoteOn 0.000082 2 69 82 NoteOn 0.000082 2 69 82
NoteOff 0.500000 2 69 0 NoteOff 0.500000 2 69 0
ControlChange 0.100000 1 1 10 ControlChange 0.100000 1 1 10
ControlChange 0.100000 1 1 20 ControlChange 0.100000 1 1 20
ControlChange 0.100000 1 1 30 ControlChange 0.100000 1 1 30
ControlChange 0.100000 1 1 40 ControlChange 0.100000 1 1 40
ControlChange 0.100000 1 1 50 ControlChange 0.100000 1 1 50
NoteOn 0.000000 2 69 82 NoteOn 0.000000 2 69 82
ControlChange 0.100000 1 1 40 ControlChange 0.100000 1 1 40
ControlChange 0.100000 1 1 30 ControlChange 0.100000 1 1 30
ControlChange 0.100000 1 1 22 ControlChange 0.100000 1 1 22
ControlChange 0.100000 1 1 12 ControlChange 0.100000 1 1 12
NoteOn 0.000000 2 69 82 NoteOn 0.000000 2 69 82
ControlChange 0.100000 1 1 10 ControlChange 0.100000 1 1 10
ControlChange 0.100000 1 1 20 ControlChange 0.100000 1 1 20
ControlChange 0.100000 1 1 30 ControlChange 0.100000 1 1 30
ControlChange 0.100000 1 1 40 ControlChange 0.100000 1 1 40
ControlChange 0.100000 1 1 50 ControlChange 0.100000 1 1 50
ControlChange 0.100000 1 1 60 ControlChange 0.100000 1 1 60
ControlChange 0.100000 1 1 50 ControlChange 0.100000 1 1 50
ControlChange 0.100000 1 1 40 ControlChange 0.100000 1 1 40
ControlChange 0.100000 1 1 30 ControlChange 0.100000 1 1 30
ControlChange 0.100000 1 1 20 ControlChange 0.100000 1 1 20
ControlChange 0.100000 1 1 10 ControlChange 0.100000 1 1 10
ControlChange 0.100000 1 1 6 ControlChange 0.100000 1 1 6
NoteOn 0.000082 2 69 82 NoteOn 0.000082 2 69 82
NoteOff 1.000000 2 69 0 NoteOff 1.000000 2 69 0
NoteOn 0.000082 2 76 82 NoteOn 0.000082 2 76 82
NoteOff 0.800000 2 76 0 NoteOff 0.800000 2 76 0
NoteOn 0.000082 2 76 82 NoteOn 0.000082 2 76 82
NoteOff 0.800000 2 76 0 NoteOff 0.800000 2 76 0
NoteOn 0.000082 2 55 82 NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82 NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82 NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82 NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 79 82 NoteOff 1.000000 2 79 82

Some files were not shown because too many files have changed in this diff Show More