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)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
This distribution of the Synthesis ToolKit in C++ (STK) contains the following:
include: STK class header files
src: STK class source files
rawwaves: STK audio files (1-channel, 16-bit, big-endian)
doc: STK documentation
projects: example STK programs
Please read the Legal and Ethical notes near the bottom of this document.
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.
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 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).
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.
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.
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.
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!
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, there is a Makefile in the src directory that will accomplish that (Linux and SGI 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.
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.
If you make a million dollars with it, give us some. If you make compositions with it, put us in the program notes.
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.
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.
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.
1) I needed to port many of the things I've done
into something which is generic enough to port
further to different machines.
2) I really plan to document this stuff, so that
you don't have to be me to figure out what's
going on. (I'll probably be sorry I said this
in a couple of years, when even I can't figure
out what I was thinking.)
3) The classic difficulties most people have in
trying to implement physical models are:
A) They have trouble understanding the papers,
and/or in turning the theory into practice.
B) The Physical Model instruments are a pain to get
to oscillate, and coming up with stable and
meaningful parameter values is required to
get the models to work at all.
This set of C++ unit generators and instruments
might help to diminish the scores of emails I
get asking what to do with those block diagrams
I put in my papers.
4) I wanted to try some new stuff with modal synthesis,
and implement some classic FM patches as well.
5) I wanted to reimplement, and newly implement
more of the intelligent and physical performer
models I've talked about in some of my papers.
But I wanted to do it in a portable way, and in
such a way that I can hook up modules quickly.
I also wanted to make these instruments connectable
to such player objects, so folks like Brad Garton
who really think a lot about the players can connect
them to my instruments, a lot about which I think.
6) More rationalizations to follow . . .
The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
This distribution of the Synthesis ToolKit in C++ (STK) contains the following:
include: STK class header files
src: STK class source files
rawwaves: STK audio files (1-channel, 16-bit, big-endian)
doc: STK documentation
projects: example STK programs
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 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 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).
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) 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:
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.
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.
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!
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.
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.
If you make a million dollars with it, give us some. If you make compositions with it, put us in the program notes.
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.
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.
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.
1) I needed to port many of the things I've done
into something which is generic enough to port
further to different machines.
2) I really plan to document this stuff, so that
you don't have to be me to figure out what's
going on. (I'll probably be sorry I said this
in a couple of years, when even I can't figure
out what I was thinking.)
3) The classic difficulties most people have in
trying to implement physical models are:
A) They have trouble understanding the papers,
and/or in turning the theory into practice.
B) The Physical Model instruments are a pain to get
to oscillate, and coming up with stable and
meaningful parameter values is required to
get the models to work at all.
This set of C++ unit generators and instruments
might help to diminish the scores of emails I
get asking what to do with those block diagrams
I put in my papers.
4) I wanted to try some new stuff with modal synthesis,
and implement some classic FM patches as well.
5) I wanted to reimplement, and newly implement
more of the intelligent and physical performer
models I've talked about in some of my papers.
But I wanted to do it in a portable way, and in
such a way that I can hook up modules quickly.
I also wanted to make these instruments connectable
to such player objects, so folks like Brad Garton
who really think a lot about the players can connect
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++
By Perry R. Cook and Gary P. Scavone, 1995-2002.
STK Classes - See the HTML documentation in the html directory for complete information.
.- Envelope - ADSR
|
|- Noise - SubNoise
|
|- Table
|
|- WvIn - (WaveLoop, RtWvIn, TcpWvIn)
|
|- WvOut - (RtWvOut, TcpWvOut)
|
|- Filter - (OnePole, OneZero, Delay, TwoPole, TwoZero, PoleZero, Biquad)
| | |
| DelayL FormSwep
| DelayA
|
|- Echo, Chorus, PitShift
|
|- RtAudio, RtMidi, Socket, Thread
Stk -|
|- Reverb - (PRCRev, JCRev, NRev)
|
|- Modulate
|
|- Messager
|
|- SKINI
|
|- ReedTabl, JetTabl, BowTabl
|
| .- FM - (HevyMetl, PercFlut, Rhodey, Wurley, TubeBell, BeeThree, FMVoices)
| |
| |- Modal - ModalBar
| |
| |- Sampler - Moog
| |
| |- Resonate
| |
| |- PluckedTwo - Mandolin
.- Instrmnt -|
|- Drummer
|
|- Clarinet, BlowHole, Saxofony, Flute, Brass, BlowBotl, Bowed, Plucked, StifKarp, Sitar
|
|- Shakers
|
|- BandedWG
|
.- Mesh2D
*********** UNIT GENERATORS **************
Master Class: Stk.cpp Sample rate, byte-swapping, error handling functionality
Sources: Envelope.cpp Linearly Goes to Target by Rate
ADSR.cpp ADSR Flavor of Envelope
Noise.cpp Random Number Generator
SubNoise.cpp Random Numbers each N samples
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
WaveLoop.cpp Wavetable looping (subclass of WvIn)
RtWvIn.cpp Realtime Audio Input Class (subclass of WvIn)
TcpWvIn.cpp Audio Streaming (socket server) Input Class (subclass of WvIn)
Sinks: WvOut.cpp Output Master Class for RAW, WAV, SND (AU), AIFF, MAT-file files
RtWvOut.cpp Realtime Output Class (subclass of WvOut)
TcpWvOut.cpp Audio Streaming (socket client) Output Class (subclass of WvOut)
Duplex: RtDuplex.cpp Synchronous Realtime Audio Input/Output Class
Filters: Filter.cpp Filter Master Class
OneZero.cpp One Zero Filter
OnePole.cpp One Pole Filter
PoleZero.cpp One Pole/One Zero Filter
TwoZero.cpp Two Zero Filter
TwoPole.cpp Two Pole Filter
BiQuad.cpp Two Pole/Two Zero Filter
FormSwep.cpp Sweepable BiQuad Filter (goes to target by rate)
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)
Non-Linear: JetTabl.cpp Cubic Jet Non-Linearity
BowTabl.cpp x^(-3) Bow Non-Linearity
ReedTabl.cpp One Breakpoint Saturating Reed Non-Linearity
Derived: Modulate.cpp Periodic and Random Vibrato: RawWvIn, SubNoise, OnePole
********** INSTRUMENTS AND ALGORITHMS **************
Each Class will be listed either with all the unit generators it uses,
or the <<Algorithm>> of which it is a flavor. All inherit from Instrmnt,
which inherits from Stk.
Simple.cpp Simple Instrument Pulse oscillator + resonant filtered noise
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
Mandolin.cpp Commuted Mandolin <<flavor of PluckTwo>>
Bowed.cpp So So Bowed String DelayL, BowTabl, OnePole, BiQuad, WaveLoop, ADSR
Brass.cpp Not So Bad Brass Instrument DelayA, BiQuad, PoleZero, ADSR, WaveLoop
Clarinet.cpp Pretty Good Clarinet DelayL, ReedTabl, OneZero, Envelope, Noise, WaveLoop
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
Flute.cpp Pretty Good Flute JetTabl, DelayL, OnePole, PoleZero, Noise, ADSR, WaveLoop
BlowBotl.cpp Blown Bottle JetTabl, BiQuad, PoleZero, Noise, ADSR, WaveLoop
BandedWG.cpp Banded Waveguide Meta-Object Delay, BowTabl, ADSR, BiQuad
Modal.cpp N Resonances Envelope, WaveLoop, BiQuad, OnePole
ModalBar.cpp Various presets 4 Resonance Models
FM.cpp N Operator FM Master ADSR, WaveLoop, TwoZero
HevyMetl.cpp Distorted FM Synthesizer 3 Cascade with FB Modulator
PercFlut.cpp Percussive Flute 3 Cascade Operators
Rhodey.cpp Rhodes-Like Electric Piano 2 Parallel Simple FMs
Wurley.cpp Wurlitzer Electric Piano 2 Parallel Simple FMs
TubeBell.cpp Classic FM Bell 2 Parallel Simple FMs
FMVoices.cpp 3 Formant FM Voice 3 Carriers Share 1 Modulator
BeeThree.cpp Cheezy Additive Organ 4 Oscillators Additive
Sampler.cpp Sampling Synthesizer 5 each ADSR, WvIn, WaveLoop, OnePole
Moog.cpp Swept Filter Sampler with Swept Filter
Resonate.cpp Filtered Noise ADSR, BiQuad, Noise
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.
Reverb.cpp Reverberator Effects Processor Master Class for reverberators
JCRev.cpp Chowning Reverberator 3 series allpass units, 4 parallel combs, 2 stereo delays
NRev.cpp Another famous CCRMA Reverb 8 allpass, 6 parallel comb filters
PRCRev.cpp Dirt Cheap Reverb by Cook 2 allpass, 2 comb filters
Flanger.cpp Flanger Effects Processor DelayL, WaveLoop
Chorus.cpp Chorus Effects Processor DelayL, WaveLoop
PitShift.cpp Cheap Pitch Shifter DelayL
*********** OTHER SUPPORT CLASSES AND FILES **************
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
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
STK: A ToolKit of Audio Synthesis Classes and Instruments in C++
By Perry R. Cook and Gary P. Scavone, 1995-2002.
STK Classes - See the HTML documentation in the html directory for complete information.
.- Envelope - ADSR
|
|- Noise - SubNoise
|
|- Table
|
|- WvIn - (WaveLoop, RtWvIn, TcpWvIn)
|
|- WvOut - (RtWvOut, TcpWvOut)
|
|- Filter - (OnePole, OneZero, Delay, TwoPole, TwoZero, PoleZero, Biquad)
| | |
| DelayL FormSwep
| DelayA
|
|- Echo, Chorus, PitShift
|
|- RtAudio, RtMidi, Socket, Thread
Stk -|
|- Reverb - (PRCRev, JCRev, NRev)
|
|- Modulate
|
|- SingWave
|
|- Voicer
|
|- Messager
|
|- SKINI
|
|- ReedTabl, JetTabl, BowTabl
|
| .- FM - (HevyMetl, PercFlut, Rhodey, Wurley, TubeBell, BeeThree, FMVoices)
| |
| |- Modal - ModalBar
| |
| |- VoicForm
| |
| |- Sampler - Moog
| |
| |- Resonate
| |
| |- PluckedTwo - Mandolin
.- Instrmnt -|
|- Drummer
|
|- Clarinet, BlowHole, Saxofony, Flute, Brass, BlowBotl, Bowed, Plucked, StifKarp, Sitar
|
|- Shakers
|
|- BandedWG
|
|- Mesh2D
|
.- Whistle
*********** UNIT GENERATORS **************
Master Class: Stk.cpp Sample rate, byte-swapping, error handling functionality
Sources: Envelope.cpp Linearly Goes to Target by Rate
ADSR.cpp ADSR Flavor of Envelope
Noise.cpp Random Number Generator
SubNoise.cpp Random Numbers each N samples
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
WaveLoop.cpp Wavetable looping (subclass of WvIn)
RtWvIn.cpp Realtime Audio Input Class (subclass of WvIn)
TcpWvIn.cpp Audio Streaming (socket server) Input Class (subclass of WvIn)
Sinks: WvOut.cpp Output Master Class for RAW, WAV, SND (AU), AIFF, MAT-file files
RtWvOut.cpp Realtime Output Class (subclass of WvOut)
TcpWvOut.cpp Audio Streaming (socket client) Output Class (subclass of WvOut)
Duplex: RtDuplex.cpp Synchronous Realtime Audio Input/Output Class
Filters: Filter.cpp Filter Master Class
OneZero.cpp One Zero Filter
OnePole.cpp One Pole Filter
PoleZero.cpp One Pole/One Zero Filter
TwoZero.cpp Two Zero Filter
TwoPole.cpp Two Pole Filter
BiQuad.cpp Two Pole/Two Zero Filter
FormSwep.cpp Sweepable BiQuad Filter (goes to target by rate)
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)
Non-Linear: JetTabl.cpp Cubic Jet Non-Linearity
BowTabl.cpp x^(-3) Bow Non-Linearity
ReedTabl.cpp One Breakpoint Saturating Reed Non-Linearity
Derived: Modulate.cpp Periodic and Random Vibrato: RawWvIn, SubNoise, OnePole
SingWave.cpp Looping wave table with randomness: Modulate, WaveLoop, Envelope
********** INSTRUMENTS AND ALGORITHMS **************
Each Class will be listed either with all the unit generators it uses,
or the <<Algorithm>> of which it is a flavor. All inherit from Instrmnt,
which inherits from Stk.
Simple.cpp Simple Instrument Pulse oscillator + resonant filtered noise
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
Mandolin.cpp Commuted Mandolin <<flavor of PluckTwo>>
Bowed.cpp So So Bowed String DelayL, BowTabl, OnePole, BiQuad, WaveLoop, ADSR
Brass.cpp Not So Bad Brass Instrument DelayA, BiQuad, PoleZero, ADSR, WaveLoop
Clarinet.cpp Pretty Good Clarinet DelayL, ReedTabl, OneZero, Envelope, Noise, WaveLoop
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
Flute.cpp Pretty Good Flute JetTabl, DelayL, OnePole, PoleZero, Noise, ADSR, WaveLoop
BlowBotl.cpp Blown Bottle JetTabl, BiQuad, PoleZero, Noise, ADSR, WaveLoop
BandedWG.cpp Banded Waveguide Meta-Object Delay, BowTabl, ADSR, BiQuad
Modal.cpp N Resonances Envelope, WaveLoop, BiQuad, OnePole
ModalBar.cpp Various presets 4 Resonance Models
FM.cpp N Operator FM Master ADSR, WaveLoop, TwoZero
HevyMetl.cpp Distorted FM Synthesizer 3 Cascade with FB Modulator
PercFlut.cpp Percussive Flute 3 Cascade Operators
Rhodey.cpp Rhodes-Like Electric Piano 2 Parallel Simple FMs
Wurley.cpp Wurlitzer Electric Piano 2 Parallel Simple FMs
TubeBell.cpp Classic FM Bell 2 Parallel Simple FMs
FMVoices.cpp 3 Formant FM Voice 3 Carriers Share 1 Modulator
VoicForm.cpp 4 Formant Voice Synthesis FormSwep, SingWave, OnePole, OneZero, Envelope, Noise
BeeThree.cpp Cheezy Additive Organ 4 Oscillators Additive
Sampler.cpp Sampling Synthesizer 5 each ADSR, WvIn, WaveLoop, OnePole
Moog.cpp Swept Filter Sampler with Swept Filter
Resonate.cpp Filtered Noise ADSR, BiQuad, Noise
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.
Whistle.cpp Hybrid physical/spectral model of a police whistle.
Reverb.cpp Reverberator Effects Processor Master Class for reverberators
JCRev.cpp Chowning Reverberator 3 series allpass units, 4 parallel combs, 2 stereo delays
NRev.cpp Another famous CCRMA Reverb 8 allpass, 6 parallel comb filters
PRCRev.cpp Dirt Cheap Reverb by Cook 2 allpass, 2 comb filters
Flanger.cpp Flanger Effects Processor DelayL, WaveLoop
Chorus.cpp Chorus Effects Processor DelayL, WaveLoop
PitShift.cpp Cheap Pitch Shifter DelayL
*********** OTHER SUPPORT CLASSES AND FILES **************
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)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
Please read the file README 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.
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:
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:
setserial /dev/ttyS0 baud_base 57600
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.
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.
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 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.
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__).
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 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.
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.

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)
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.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.
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.
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)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
Please read the file README 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).
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.
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!
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.
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 (with various warnings) using CC version 7.30.
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!

View File

@@ -1,73 +1,74 @@
The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
Please read the file README for more general STK information.
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.
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.
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).
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":
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).
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.
5. Under C/C++ > Preprocessor: Add "__WINDOWS_DS__" to the definitions field.
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.
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.
Finally, to use it all -
PLAY SKINI SCOREFILES IN REALTIME:
demo Clarinet -or < scores/streetsf.ski
USE TCL/TK GUIs FOR REALTIME CONTROL:
1. Open a DOS console window and start syntmono (eg. demo Clarinet -or -is).
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.
3. Start moving the sliders to control the instrument.
USE REALTIME MIDI INPUT FOR CONTROL:
1. Open a DOS console window and start syntmono with MIDI input (eg. demo Clarinet -or -im).
This assumes you already have MIDI setup correctly for your computer.
WINDOWS 2000/XP:
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.
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.
The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
Please read the file README for more general STK information.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Finally, to use it all -
WINDOWS XP/2000:
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.
WINDOWS 95/98:
PLAY SKINI SCOREFILES IN REALTIME:
demo Clarinet -or < scores/streetsf.ski
USE TCL/TK GUIs FOR REALTIME CONTROL:
1. Open a DOS console window and start syntmono (eg. demo Clarinet -or -is).
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.
3. Start moving the sliders to control the instrument.
USE REALTIME MIDI INPUT FOR CONTROL:
1. Open a DOS console window and start syntmono with MIDI input (eg. demo Clarinet -or -im).
This assumes you already have MIDI setup correctly for your computer.
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. 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)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
v4.0: (April 2002)
- new documentation and tutorial
- several new instruments, including Saxofony, BlowBotl, and StifKarp
- new Stk base class, replacing Object class
- new Filter class structure and methods
- extensive modifications to WvIn and WvOut class structures and methods
- looping functionality moved to WaveLoop (subclass of WvIn)
- automatic file type detection in WvIn ... hosed WavWvIn, AifWvIn, RawWavIn, SndWavIn, and MatWvIn subclasses
- new file type specifier argument in WvOut ... hosed WavWvOut, AifWvOut, RawWavOut, SndWavOut, and MatWvOut subclasses
- some simplifications of Messager class (was Controller)
- new independent RtAudio class
- extensive revisions in code and a significant number of API changes
v3.2: (13 November 2000)
- new control handling class (Controller)
- added AIFF file input/output support
- stklib.a Makefile in src directory
- added C++ error handling capabilities
- added input/output internet streaming support (StrmWvIn/StrmWvOut)
- added native ALSA support for linux
- added optional "device" argument to all "Rt" classes (audio and MIDI) and printout of devices when argument is invalid
- WvIn classes rewritten to support very big files (incremental load from disk)
- changed WvIn/WvOut classes to work with sample frame buffers
- fixed looping and negative rate calculations in WvIn classes
- fixed interpolation bug in RtWvIn
- windoze RtAudio code rewritten (thanks Dave!)
- simplified byte-swapping functions (in-place swapping)
- new FIR filter class (thanks Julius!)
- "stereo-ized" RagaMatic
- probably a bunch more fixes that I've long since forgotten about
v3.1: (13 March 2000)
- new RagaMatic project!!!
- added "microphone position" to Mandolin in STKdemo
- fixed MIDI system message exclusion under Irix
- added a few bitmaps for the Shaker instruments
- made destructors virtual for Reverb.h, WvIn.h and Simple.h
- fixed bug setting delay length in DLineA when value too big
- fixed bug in WinMM realtime code (RTSoundIO)
- added tick() method to BowTabl, JetTabl, and ReedTabl (same as lookup)
- switched to pthread API on SGI platforms
- added some defines to Object.h for random number generation, FPU overflow checking, etc...
- a lot of minor changes, some bug fixes ... can't remember all of them
v3.0: (10 October 1999)
- 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
- OS type defines now in Makefile
- new RAWWAVE_PATH define in Object.h
- syntmono pulled out to separate directory and cleaned up
- socketing capabilities under Unix, as well as Windoze
- multiple simultaneous socket client connections to STK servers now possible
- MD2SKINI now can merge MIDI and piped messages under Irix and Linux (for TCL->MD2SKINI->syntmono control)
- defined INT16 and INT32 types and fixed various WvIn and WvOut classes
- updated MatWvIn and MatWvOut for new MAT-file documentation from Matlab
- new demo GUI
- minor fixes to FM behavior
- added record/duplex capabilities to RTSoundIO (Linux, SGI, and Windoze)
- fixed bugs in WavWvOut and MatWvOut header specifications
- added RawWvOut class
- new WvIn class with RawWvIn, SndWvIn, WavWvIn, MatWvIn, and RTWvIn subclasses
- removed RawWave, RawShot, RawInterp, and RawLoop classes (supplanted by RawWvIn)
- multi-channel data support in WvIn and WvOut classes using MY_MULTI data type (pointer to MY_FLOAT) and the methods mtick() and mlastOutput()
- now writing to primary buffer under Windoze when allowed by hardware
- cleaned up Object.h a bit
- pulled various utility and thread functions out of syntmono.cpp (to aid readability of the code)
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.
- modified syntmono parsing vs. tick routine so that some ticking occurs between each message. When multiple messages are waiting to be processed, the time between message updates is inversely proportional to the number of messages in the buffer.
- fixed DirectSound playback bug in 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.
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:
The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2002.
v4.1: (8 October 2002)
- Macintosh OS X support added
- new Whistle class
- added Voicer, SingWave, and VoicForm classes
- improvements/fixes to the banded waveguide instruments
- demo program now uses Voicer, allowing polyphony
- demo tcl/tk scripts changed to use SKINI PitchChange instead of PitchBend
- demo program response to PitchBend modified to octave up/down
- several RtAudio fixes and improvements (OS X and Windows ASIO support added)
- added nextOut() method to Delay classes
- documentation fixes for Reverb classes
- RAWWAVE_PATH changed to include the "rawwave" directory
- "configure" support added for unix systems
- multivoice flag (-n NUMBER) added as command line option to demo program
- sample rate flag added as command line option to all example programs
- socket port number added as command line option to all example programs
v4.0: (April 2002)
- new documentation and tutorial
- several new instruments, including Saxofony, BlowBotl, and StifKarp
- new Stk base class, replacing Object class
- new Filter class structure and methods
- extensive modifications to WvIn and WvOut class structures and methods
- looping functionality moved to WaveLoop (subclass of WvIn)
- automatic file type detection in WvIn ... hosed WavWvIn, AifWvIn, RawWavIn, SndWavIn, and MatWvIn subclasses
- new file type specifier argument in WvOut ... hosed WavWvOut, AifWvOut, RawWavOut, SndWavOut, and MatWvOut subclasses
- some simplifications of Messager class (was Controller)
- new independent RtAudio class
- extensive revisions in code and a significant number of API changes
v3.2: (13 November 2000)
- new control handling class (Controller)
- added AIFF file input/output support
- stklib.a Makefile in src directory
- added C++ error handling capabilities
- added input/output internet streaming support (StrmWvIn/StrmWvOut)
- added native ALSA support for linux
- added optional "device" argument to all "Rt" classes (audio and MIDI) and printout of devices when argument is invalid
- WvIn classes rewritten to support very big files (incremental load from disk)
- changed WvIn/WvOut classes to work with sample frame buffers
- fixed looping and negative rate calculations in WvIn classes
- fixed interpolation bug in RtWvIn
- windoze RtAudio code rewritten (thanks Dave!)
- simplified byte-swapping functions (in-place swapping)
- new FIR filter class (thanks Julius!)
- "stereo-ized" RagaMatic
- probably a bunch more fixes that I've long since forgotten about
v3.1: (13 March 2000)
- new RagaMatic project!!!
- added "microphone position" to Mandolin in STKdemo
- fixed MIDI system message exclusion under Irix
- added a few bitmaps for the Shaker instruments
- made destructors virtual for Reverb.h, WvIn.h and Simple.h
- fixed bug setting delay length in DLineA when value too big
- fixed bug in WinMM realtime code (RTSoundIO)
- added tick() method to BowTabl, JetTabl, and ReedTabl (same as lookup)
- switched to pthread API on SGI platforms
- added some defines to Object.h for random number generation, FPU overflow checking, etc...
- a lot of minor changes, some bug fixes ... can't remember all of them
v3.0: (10 October 1999)
- 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
- OS type defines now in Makefile
- new RAWWAVE_PATH define in Object.h
- syntmono pulled out to separate directory and cleaned up
- socketing capabilities under Unix, as well as Windoze
- multiple simultaneous socket client connections to STK servers now possible
- MD2SKINI now can merge MIDI and piped messages under Irix and Linux (for TCL->MD2SKINI->syntmono control)
- defined INT16 and INT32 types and fixed various WvIn and WvOut classes
- updated MatWvIn and MatWvOut for new MAT-file documentation from Matlab
- new demo GUI
- minor fixes to FM behavior
- added record/duplex capabilities to RTSoundIO (Linux, SGI, and Windoze)
- fixed bugs in WavWvOut and MatWvOut header specifications
- added RawWvOut class
- new WvIn class with RawWvIn, SndWvIn, WavWvIn, MatWvIn, and RTWvIn subclasses
- removed RawWave, RawShot, RawInterp, and RawLoop classes (supplanted by RawWvIn)
- multi-channel data support in WvIn and WvOut classes using MY_MULTI data type (pointer to MY_FLOAT) and the methods mtick() and mlastOutput()
- now writing to primary buffer under Windoze when allowed by hardware
- cleaned up Object.h a bit
- pulled various utility and thread functions out of syntmono.cpp (to aid readability of the code)
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.
- modified syntmono parsing vs. tick routine so that some ticking occurs between each message. When multiple messages are waiting to be processed, the time between message updates is inversely proportional to the number of messages in the buffer.
- fixed DirectSound playback bug in 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.
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.

View File

@@ -1,391 +1,391 @@
This describes the latest (version 1.1) implementation of SKINI.
Synthesis toolKit Instrument Network Interface
for the Synthesis Toolkit in C++ by Perry R. Cook.
*********************************
* Too good to be true? *
* Have control and read it too? *
* A SKINI Haiku. *
*********************************
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.
1) MIDI Compatibility
SKINI was designed to be MIDI compatible wherever possible,
and extend MIDI in incremental, then maybe profound ways.
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.
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.
2) 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.
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.
3) 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.
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.
NonMIDI 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.
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.
4) 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.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.
5) 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:
a) If the first (non-delimiter (see c)) character in a SKINI
string is '/' that line is treated as a comment and echoed
to stdout.
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 non-characters.
c) 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).
d) 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.
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
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).
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
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.
g) 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.
6) A Short SKINI File:
/* Howdy!!! Welcome to SKINI, by P. Cook 1999
NoteOn 0.000082 2 55 82
NoteOff 1.000000 2 55 0
NoteOn 0.000082 2 69 82
StringDetune 0.100000 2 10
StringDetune 0.100000 2 30
StringDetune 0.100000 2 50
NoteOn 0.000000 2 69 82
StringDetune 0.100000 2 40
StringDetune 0.100000 2 22
StringDetune 0.100000 2 12
//
StringDamping 0.000100 2 0.0
NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82
StringDamping =4.000000 2 0.0
NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82
7) The SKINI.tbl File, How Messages are Parsed:
The SKINI.tbl file contains an array of structures which
are accessed by the parser object SKINI.cpp. The struct is:
struct SKINISpec { char messageString[32];
long type;
long data2;
long data3;
};
so an assignment of one of these structs looks like:
MessageStr$ ,type, data2, data3,
type is the message type sent back from the SKINI line parser.
data<n> 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
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_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
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
{"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
{"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL},
{"StringDamping" , __SK_ControlChange_, __SK_StringDamping_, SK_DBL},
{"StringDetune" , __SK_ControlChange_, __SK_StringDetune_, SK_DBL},
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 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:
ControlChange 0.000000 2 7 64.1
Volume 0.000000 2 64.1
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.
8) Objects using SKINI
Here's a simple example of code which uses the SKINI object
to read a SKINI file and control a single instrument.
instrument = new Mandolin(50.0);
score = new SKINI(argv[1]);
while(score->getType() > 0) {
tempDouble = score->getDelta();
if (tempDouble < 0) {
tempDouble = - tempDouble;
tempDouble = tempDouble - output.getTime();
if (tempDouble < 0) {
printf("Bad News Here!!! Backward Absolute Time Required.\n");
tempDouble = 0.0;
}
}
tempLong = (long) (tempDouble * Stk::sampleRate());
for (i=0;i<tempLong;i++) {
output.tick(instrument->tick());
}
tempDouble3 = score->getByteThree();
if (score->getType()== __SK_NoteOn_ ) {
tempDouble3 *= NORM_MIDI;
if (score->getByteThree() == 0) {
tempDouble3 = 0.5;
instrument->noteOff(tempDouble3);
}
else {
tempLong = (int) score->getByteTwo();
tempDouble2 = Midi2Pitch[tempLong];
instrument->noteOn(tempDouble2,tempDouble3);
}
}
else if (score->getType() == __SK_NoteOff_) {
tempDouble3 *= NORM_MIDI;
instrument->noteOff(tempDouble3);
}
else if (score->getType() == __SK_ControlChange_) {
tempLong = score->getByteTwoInt();
instrument->controlChange(tempLong,temp3.0);
}
score->nextMessage();
}
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.
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 last line reads and parses the next message in the file.
This describes the latest (version 1.1) implementation of SKINI.
Synthesis toolKit Instrument Network Interface
for the Synthesis Toolkit in C++ by Perry R. Cook.
*********************************
* Too good to be true? *
* Have control and read it too? *
* A SKINI Haiku. *
*********************************
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.
1) MIDI Compatibility
SKINI was designed to be MIDI compatible wherever possible,
and extend MIDI in incremental, then maybe profound ways.
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.
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.
2) 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.
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.
3) 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.
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.
NonMIDI 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.
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.
4) 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.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.
5) 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:
a) If the first (non-delimiter (see c)) character in a SKINI
string is '/' that line is treated as a comment and echoed
to stdout.
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 non-characters.
c) 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).
d) 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.
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
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).
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
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.
g) 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.
6) A Short SKINI File:
/* Howdy!!! Welcome to SKINI, by P. Cook 1999
NoteOn 0.000082 2 55 82
NoteOff 1.000000 2 55 0
NoteOn 0.000082 2 69 82
StringDetune 0.100000 2 10
StringDetune 0.100000 2 30
StringDetune 0.100000 2 50
NoteOn 0.000000 2 69 82
StringDetune 0.100000 2 40
StringDetune 0.100000 2 22
StringDetune 0.100000 2 12
//
StringDamping 0.000100 2 0.0
NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82
StringDamping =4.000000 2 0.0
NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82
7) The SKINI.tbl File, How Messages are Parsed:
The SKINI.tbl file contains an array of structures which
are accessed by the parser object SKINI.cpp. The struct is:
struct SKINISpec { char messageString[32];
long type;
long data2;
long data3;
};
so an assignment of one of these structs looks like:
MessageStr$ ,type, data2, data3,
type is the message type sent back from the SKINI line parser.
data<n> 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
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_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
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
{"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
{"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL},
{"StringDamping" , __SK_ControlChange_, __SK_StringDamping_, SK_DBL},
{"StringDetune" , __SK_ControlChange_, __SK_StringDetune_, SK_DBL},
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 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:
ControlChange 0.000000 2 7 64.1
Volume 0.000000 2 64.1
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.
8) Objects using SKINI
Here's a simple example of code which uses the SKINI object
to read a SKINI file and control a single instrument.
instrument = new Mandolin(50.0);
score = new SKINI(argv[1]);
while(score->getType() > 0) {
tempDouble = score->getDelta();
if (tempDouble < 0) {
tempDouble = - tempDouble;
tempDouble = tempDouble - output.getTime();
if (tempDouble < 0) {
printf("Bad News Here!!! Backward Absolute Time Required.\n");
tempDouble = 0.0;
}
}
tempLong = (long) (tempDouble * Stk::sampleRate());
for (i=0;i<tempLong;i++) {
output.tick(instrument->tick());
}
tempDouble3 = score->getByteThree();
if (score->getType()== __SK_NoteOn_ ) {
tempDouble3 *= NORM_MIDI;
if (score->getByteThree() == 0) {
tempDouble3 = 0.5;
instrument->noteOff(tempDouble3);
}
else {
tempLong = (int) score->getByteTwo();
tempDouble2 = Midi2Pitch[tempLong];
instrument->noteOn(tempDouble2,tempDouble3);
}
}
else if (score->getType() == __SK_NoteOff_) {
tempDouble3 *= NORM_MIDI;
instrument->noteOff(tempDouble3);
}
else if (score->getType() == __SK_ControlChange_) {
tempLong = score->getByteTwoInt();
instrument->controlChange(tempLong,temp3.0);
}
score->nextMessage();
}
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.
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 last line reads and parses the next message in the file.

View File

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

View File

@@ -1,10 +1,10 @@
/*! \page classes Class Documentation
<UL>
<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="files.html">File List</a></LI>
<LI><a class="qindex" href="functions.html">Compound Members</a></LI>
</UL>
/*! \page classes Class Documentation
<UL>
<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="files.html">File List</a></LI>
<LI><a class="qindex" href="functions.html">Compound Members</a></LI>
</UL>
*/

View File

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

View File

@@ -1,10 +1,10 @@
<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<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>
<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<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="links.html">Links</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>

View File

@@ -1,15 +1,16 @@
/*! \mainpage <I>The Synthesis ToolKit in C++ (STK)</I>
<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.
- \ref information
- \ref classes
- \ref download
- \ref usage
- \ref maillist
- \ref system
- \ref tutorial
*/
/*! \mainpage <I>The Synthesis ToolKit in C++ (STK)</I>
<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.
- \ref information
- \ref classes
- \ref download
- \ref usage
- \ref maillist
- \ref system
- \ref links
- \ref tutorial
*/

View File

@@ -1,50 +1,50 @@
/*! \page information General Information
<H3>References</H3>
<UL>
<LI><A HREF="Papers/stkicmc99.pdf">ICMC99 Paper</A></LI>
<BR>
A somewhat recent paper by Perry and Gary about the Synthesis ToolKit in C++.
<P>
<LI><A HREF="Papers/STKsiggraph96.pdf">SIGGRAPH96 Paper</A></LI>
<BR>
A not-so-recent paper by Perry about the Synthesis ToolKit in C++.
<P>
<LI><A HREF="http://www.cs.princeton.edu/~prc/NewWork.html#STK">Perry's STK Web Page</A></LI>
<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.
</UL>
<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 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>
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).
<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.
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>
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>
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>
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.
/*! \page information General Information
<H3>References</H3>
<UL>
<LI><A HREF="Papers/stkicmc99.pdf">ICMC99 Paper</A></LI>
<BR>
A somewhat recent paper by Perry and Gary about the Synthesis ToolKit in C++.
<P>
<LI><A HREF="Papers/STKsiggraph96.pdf">SIGGRAPH96 Paper</A></LI>
<BR>
A not-so-recent paper by Perry about the Synthesis ToolKit in C++.
<P>
<LI><A HREF="http://www.cs.princeton.edu/~prc/NewWork.html#STK">Perry's STK Web Page</A></LI>
<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.
</UL>
<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 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).
<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.
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>
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.
<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.
<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.
<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.
*/

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
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>
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>
<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>
with the contents: <TT>unsubscribe</TT>
/*! \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.
<P>
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>
<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>
with the contents: <TT>unsubscribe</TT>
*/

View File

@@ -1,218 +1,218 @@
/*! \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.
\code
Too good to be true?
Have control and read it too?
A SKINI haiku.
\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.
\section compatibility MIDI Compatibility
SKINI was designed to be MIDI compatible wherever possible, and extend MIDI in incremental, then maybe profound ways.
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.
- 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?
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.
\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.
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.
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.
\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.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.
\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:
- 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.
- 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 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.
- 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:
\code
/* Howdy!!! Welcome to SKINI, by P. Cook 1999
NoteOn 0.000082 2 55 82
NoteOff 1.000000 2 55 0
NoteOn 0.000082 2 69 82
StringDetune 0.100000 2 10
StringDetune 0.100000 2 30
StringDetune 0.100000 2 50
NoteOn 0.000000 2 69 82
StringDetune 0.100000 2 40
StringDetune 0.100000 2 22
StringDetune 0.100000 2 12
//
StringDamping 0.000100 2 0.0
NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82
StringDamping =4.000000 2 0.0
NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82
\endcode
\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:
\code
struct SKINISpec {
char messageString[32];
long type;
long data2;
long data3;
};
\endcode
so an assignment of one of these structs looks like:
\code
MessageStr$ ,type, data2, data3,
\endcode
<TT>type</TT> is the message type sent back from the SKINI line parser.
<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.
- 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_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
\code
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
{"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
{"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL},
{"StringDamping" , __SK_ControlChange_, __SK_StringDamping_, SK_DBL},
{"StringDetune" , __SK_ControlChange_, __SK_StringDetune_, SK_DBL},
\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 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:
\code
ControlChange 0.000000 2 7 64.1
Volume 0.000000 2 64.1
\endcode
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.
\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.
\code
instrument = new Mandolin(50.0);
score = new SKINI(argv[1]);
while(score->getType() > 0) {
tempDouble = score->getDelta();
if (tempDouble < 0) {
tempDouble = - tempDouble;
tempDouble = tempDouble - output.getTime();
if (tempDouble < 0) {
printf("Bad News Here!!! Backward Absolute Time Required.\n");
tempDouble = 0.0;
}
}
tempLong = (long) (tempDouble * Stk::sampleRate());
for (i=0;i<tempLong;i++) {
output.tick(instrument->tick());
}
tempDouble3 = score->getByteThree();
if (score->getType()== __SK_NoteOn_ ) {
tempDouble3 *= NORM_MIDI;
if (score->getByteThree() == 0) {
tempDouble3 = 0.5;
instrument->noteOff(tempDouble3);
}
else {
tempLong = (int) score->getByteTwo();
tempDouble2 = Midi2Pitch[tempLong];
instrument->noteOn(tempDouble2,tempDouble3);
}
}
else if (score->getType() == __SK_NoteOff_) {
tempDouble3 *= NORM_MIDI;
instrument->noteOff(tempDouble3);
}
else if (score->getType() == __SK_ControlChange_) {
tempLong = score->getByteTwoInt();
instrument->controlChange(tempLong,temp3.0);
}
score->nextMessage();
}
\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.
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.
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.
/*! \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.
\code
Too good to be true?
Have control and read it too?
A SKINI haiku.
\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.
\section compatibility MIDI Compatibility
SKINI was designed to be MIDI compatible wherever possible, and extend MIDI in incremental, then maybe profound ways.
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.
- 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?
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.
\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.
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.
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.
\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.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.
\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:
- 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.
- 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 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.
- 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:
\code
/* Howdy!!! Welcome to SKINI, by P. Cook 1999
NoteOn 0.000082 2 55 82
NoteOff 1.000000 2 55 0
NoteOn 0.000082 2 69 82
StringDetune 0.100000 2 10
StringDetune 0.100000 2 30
StringDetune 0.100000 2 50
NoteOn 0.000000 2 69 82
StringDetune 0.100000 2 40
StringDetune 0.100000 2 22
StringDetune 0.100000 2 12
//
StringDamping 0.000100 2 0.0
NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82
StringDamping =4.000000 2 0.0
NoteOn 0.000082 2 55 82
NoteOn 0.200000 2 62 82
NoteOn 0.100000 2 71 82
NoteOn 0.200000 2 79 82
NoteOff 1.000000 2 55 82
NoteOff 0.000000 2 62 82
NoteOff 0.000000 2 71 82
NoteOff 0.000000 2 79 82
\endcode
\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:
\code
struct SKINISpec {
char messageString[32];
long type;
long data2;
long data3;
};
\endcode
so an assignment of one of these structs looks like:
\code
MessageStr$ ,type, data2, data3,
\endcode
<TT>type</TT> is the message type sent back from the SKINI line parser.
<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.
- 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_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
\code
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
{"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
{"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL},
{"StringDamping" , __SK_ControlChange_, __SK_StringDamping_, SK_DBL},
{"StringDetune" , __SK_ControlChange_, __SK_StringDetune_, SK_DBL},
\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 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:
\code
ControlChange 0.000000 2 7 64.1
Volume 0.000000 2 64.1
\endcode
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.
\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.
\code
instrument = new Mandolin(50.0);
score = new SKINI(argv[1]);
while(score->getType() > 0) {
tempDouble = score->getDelta();
if (tempDouble < 0) {
tempDouble = - tempDouble;
tempDouble = tempDouble - output.getTime();
if (tempDouble < 0) {
printf("Bad News Here!!! Backward Absolute Time Required.\n");
tempDouble = 0.0;
}
}
tempLong = (long) (tempDouble * Stk::sampleRate());
for (i=0;i<tempLong;i++) {
output.tick(instrument->tick());
}
tempDouble3 = score->getByteThree();
if (score->getType()== __SK_NoteOn_ ) {
tempDouble3 *= NORM_MIDI;
if (score->getByteThree() == 0) {
tempDouble3 = 0.5;
instrument->noteOff(tempDouble3);
}
else {
tempLong = (int) score->getByteTwo();
tempDouble2 = Midi2Pitch[tempLong];
instrument->noteOn(tempDouble2,tempDouble3);
}
}
else if (score->getType() == __SK_NoteOff_) {
tempDouble3 *= NORM_MIDI;
instrument->noteOff(tempDouble3);
}
else if (score->getType() == __SK_ControlChange_) {
tempLong = score->getByteTwoInt();
instrument->controlChange(tempLong,temp3.0);
}
score->nextMessage();
}
\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.
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.
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.
*/

View File

@@ -1,29 +1,43 @@
/*! \page system System Requirements
<B>General</B>
<UL>
<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>
</UL>
<B>Linux (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.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>
<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>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>
</UL>
<P>
/*! \page system System Requirements
<B>General:</B>
<UL>
<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>
</UL>
<B>Linux (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.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>Macintosh OS X (specific):</B>
<UL>
<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>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:
\code
wish tcl/Demo.tcl | demo Clarinet -or -ip
\endcode
Initial tests have shown somewhat poor response between changes made in the tcl/tk script and the resulting audio updates.</LI>
</UL>
<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
- \ref intro
- \ref start
- \ref compile
- \ref rtvsnonrt
\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:
<UL>
<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 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>wish to teach real-time synthesis and processing, and wish to use some of our classes and examples</LI>
</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.).
\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.
\code
// sineosc.cpp
#include "WaveLoop.h"
#include "RtWvOut.h"
int main()
{
// Set the global sample rate before creating class instances.
Stk::setSampleRate( 44100.0 );
// Define and load the sine wave file
WaveLoop *input = new WaveLoop("sinewave.raw", TRUE);
input->setFrequency(440.0);
// Define and open the default realtime output device for one-channel playback
RtWvOut *output = new RtWvOut(1);
// Play the oscillator for 40000 samples
for (int i=0; i<40000; i++) {
output->tick( input->tick() );
}
// Clean up
delete input;
delete output;
return 0;
}
\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.
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.
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.
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
// sineosc.cpp
#include "WaveLoop.h"
#include "RtWvOut.h"
int main()
{
// Set the global sample rate before creating class instances.
Stk::setSampleRate( 44100.0 );
WaveLoop *input = 0;
RtWvOut *output = 0;
try {
// Define and load the sine wave file
input = new WaveLoop( "sinewave.raw", TRUE );
// Define and open the default realtime output device for one-channel playback
output = new RtWvOut(1);
}
catch (StkError &) {
goto cleanup;
}
input->setFrequency(440.0);
// Play the oscillator for 40000 samples
for (int i=0; i<40000; i++) {
try {
output->tick(input->tick());
}
catch (StkError &) {
goto cleanup;
}
}
cleanup:
delete input;
delete output;
return 0;
}
\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.
\section compile Compiling
\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):
\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
\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.
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
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
CC -Wall -D__IRIX_AL__ -o sineosc Stk.cpp WvIn.cpp WaveLoop.cpp WvOut.cpp RtWvOut.cpp RtAudio.cpp sineosc.cpp -lpthread
\endcode
\subsection compileWin Windows
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 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, 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.
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 ...
*/
/*! \page tutorial Tutorial
- \ref intro
- \ref start
- \ref compile
- \ref rtvsnonrt
\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:
<UL>
<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 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>wish to teach real-time synthesis and processing, and wish to use some of our classes and examples</LI>
</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.).
\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.
\code
// sineosc.cpp
#include "WaveLoop.h"
#include "RtWvOut.h"
int main()
{
// Set the global sample rate before creating class instances.
Stk::setSampleRate( 44100.0 );
// Define and load the sine wave file
WaveLoop *input = new WaveLoop("sinewave.raw", TRUE);
input->setFrequency(440.0);
// Define and open the default realtime output device for one-channel playback
RtWvOut *output = new RtWvOut(1);
// Play the oscillator for 40000 samples
for (int i=0; i<40000; i++) {
output->tick( input->tick() );
}
// Clean up
delete input;
delete output;
return 0;
}
\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.
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.
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.
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
// sineosc.cpp
#include "WaveLoop.h"
#include "RtWvOut.h"
int main()
{
// Set the global sample rate before creating class instances.
Stk::setSampleRate( 44100.0 );
WaveLoop *input = 0;
RtWvOut *output = 0;
try {
// Define and load the sine wave file
input = new WaveLoop( "sinewave.raw", TRUE );
// Define and open the default realtime output device for one-channel playback
output = new RtWvOut(1);
}
catch (StkError &) {
goto cleanup;
}
input->setFrequency(440.0);
// Play the oscillator for 40000 samples
for (int i=0; i<40000; i++) {
try {
output->tick(input->tick());
}
catch (StkError &) {
goto cleanup;
}
}
cleanup:
delete input;
delete output;
return 0;
}
\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.
\section compile Compiling
\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):
\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
\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.
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
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
CC -Wall -D__IRIX_AL__ -o sineosc Stk.cpp WvIn.cpp WaveLoop.cpp WvOut.cpp RtWvOut.cpp RtAudio.cpp sineosc.cpp -lpthread
\endcode
\subsection compileOSX Macintosh OS X
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
\endcode
\subsection compileWin Windows
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 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
- \ref directory
- \ref compiling
- \ref control
- \ref instruments
- \ref nort
- \ref rt
- \ref tcl
- \ref midi
<HR>
\section directory Directory Structure:
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>
<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>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>projects</B></I> directory contains various demo and example STK programs.</LI><P>
</UL>
This release of STK comes with four separate "project" directories:
<OL>
<LI> The <I><B>demo</B></I> project is used to demonstrate nearly all of the STK instruments. The <I><B>demo</B></I> program has been written to allow a variety of control input and sound data output options. %Simple graphical user interfaces (GUIs) are also provided.<P></LI>
<LI> The <I><B>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>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:
<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>
<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>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>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>
<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>
\section control Control Data:
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:
<OL>
<LI>Redirect or pipe SKINI scorefiles to an executable.</LI>
<LI>Pipe realtime SKINI input messages to an executable (not possible under Windows95/98).</LI>
<LI>Socket realtime SKINI input messages to an executable.</LI>
<LI>Acquire realtime MIDI messages from a MIDI port on your computer.</LI>
</OL>
<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.
\section instruments Demo: STK Instruments
The <I><B>demo</B></I> project demonstrates the behavior of all the distributed STK instruments. The instruments available with this release include:
<UL>
<LI>Clarinet: Pretty good physical model of the clarinet</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>Flute: Pretty good physical model of the flute</LI>
<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>
<LI>Plucked: Yer basic plucked string physical model</LI>
<LI>StifKarp: A simple plucked, stiff string physical model</LI>
<LI>Sitar: A simple sitar/plucked string physical model</LI>
<LI>Mandolin: Two-string mandolin physical model</LI>
<LI>Rhodey: Rhodes-like electric piano FM synthesis model</LI>
<LI>Wurley: Wurlitzer-like electric piano FM synthesis model</LI>
<LI>TubeBell: FM synthesis model</LI>
<LI>HevyMetl: Distorted synthesizer FM synthesis model</LI>
<LI>PercFlut: Percussive flute-like FM synthesis model</LI>
<LI>BeeThree: Cheezy organ FM synthesis model</LI>
<LI>Moog: Swept filter sampler</LI>
<LI>FMVoices: Three-formant FM voice synthesis</LI>
<LI>Resonate: Noise through a BiQuad filter</LI>
<LI>Drummer: Sampling synthesis</LI>
<LI>BandedWG: Banded waveguide meta-object for bowed bars, tibetan bowls, etc.</LI>
<LI>Shakers: Various stochastic event models of shaker instruments</LI>
<LI>ModalBar: Various four-resonance presets (marimba, vibraphone, etc...)</LI>
<LI>Mesh2D: Two-dimensional, rectilinear digital waveguide mesh</LI>
</UL>
\section nort Demo: Non-Realtime Use
See the information above with respect to compiling STK for non-realtime use.
In non-realtime mode, it is assumed that input control messages are provided from a SKINI scorefile and that audio output is written to a soundfile (.snd, .wav, .aif, .mat, .raw). A number of SKINI scorefiles are provided in the <I>scores</I> directory of the <I><B>demo</B></I> project. Assuming a successful compilation of the <I><B>demo</B></I> program, typing:
\code
cat scores/bookert.ski | demo BeeThree -w myfile.wav
\endcode
or (on WindowsXX and/or Unix)
\code
demo BeeThree -w myfile.wav < scores\bookert.ski
\endcode
from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I> using the STK BeeThree instrument and write the resulting audio data to a WAV formatted soundfile called "myfile.wav". Typing <TT>demo</TT> without any arguments will provide a full program usage description.
\section rt Demo: Realtime Use
STK realtime audio and MIDI input/output and realtime SKINI control input via socketing support is provided for Linux, SGI, and Windows95/98/2000/XP operating systems. STK realtime SKINI control input via piping is possible under Linux, SGI, and Windows2000/XP only.
<P>
Control input and audio output options are typically specified as command-line arguments to STK programs. For example, the <I><B>demo</B></I> program is invoked as:
\code
demo instrument flags
\endcode
where instruments include those described above and flags can be any or all of:
<UL>
<LI><I>-or</I> for realtime audio output,</LI>
<LI><I>-ow <file name></I> for WAV soundfile output,</LI>
<LI><I>-os <file name></I> for SND (AU) soundfile output,</LI>
<LI><I>-om <file name></I> for MAT-file output,</LI>
<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>
</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.
Assuming a successful compilation of the <I><B>demo</B></I> program, typing:
\code
cat scores/bookert.ski | demo BeeThree -or
\endcode
or (on WindowsXX and/or Unix)
\code
demo BeeThree -or < scores\bookert.ski
\endcode
from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I> using the STK BeeThree instrument and stream the resulting audio data in realtime to the audio output channel of your computer. Typing <TT>demo</TT> without any arguments will provide a full program usage description.
\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 wish80 executable to the name <I>wish</I>). The PhysicalDemo 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
*/
/*! \page usage Usage Documentation
- \ref directory
- \ref compiling
- \ref control
- \ref instruments
- \ref nort
- \ref rt
- \ref tcl
- \ref midi
- \ref polyphony
<HR>
\section directory Directory Structure:
The top level distribution contains the following directories:
<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 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>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>
This release of STK comes with four separate "project" directories:
<OL>
<LI> The <I><B>demo</B></I> project is used to demonstrate nearly all of the STK instruments. The <I><B>demo</B></I> program has been written to allow a variety of control input and sound data output options. %Simple graphical user interfaces (GUIs) are also provided.<P></LI>
<LI> The <I><B>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>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:
<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>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>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.
Several options can be supplied to the <TT>configure</TT> script to customize the build behavior:
<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>
<LI><TT>--with-alsa</TT> to choose native ALSA API support (linux only)</LI>
</UL>
<P>
In addition, it is possible to specify the location of the STK rawwaves and the STK include path as follows:
\code
./configure RAWWAVE_PATH="/home/gary/rawwaves/"
./configure INCLUDE_PATH="/home/gary/include/"
\endcode
For novice STK users, the default configuration should be adequate.
</UL>
For those who wish to create their own system-specific <TT>Makefiles</TT>:
<UL>
<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>
<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>
<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><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>
\section control Control Data:
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:
<OL>
<LI>Redirect or pipe SKINI scorefiles to an executable.</LI>
<LI>Pipe realtime SKINI input messages to an executable (not possible under Windows95/98).</LI>
<LI>Socket realtime SKINI input messages to an executable.</LI>
<LI>Acquire realtime MIDI messages from a MIDI port on your computer.</LI>
</OL>
<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.
\section instruments Demo: STK Instruments
The <I><B>demo</B></I> project demonstrates the behavior of all the distributed STK instruments. The instruments available with this release include:
<UL>
<LI>Clarinet: Pretty good physical model of the clarinet</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>Flute: Pretty good physical model of the flute</LI>
<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>
<LI>Plucked: Yer basic plucked string physical model</LI>
<LI>StifKarp: A simple plucked, stiff string physical model</LI>
<LI>Sitar: A simple sitar/plucked string physical model</LI>
<LI>Mandolin: Two-string mandolin physical model</LI>
<LI>Rhodey: Rhodes-like electric piano FM synthesis model</LI>
<LI>Wurley: Wurlitzer-like electric piano FM synthesis model</LI>
<LI>TubeBell: FM synthesis model</LI>
<LI>HevyMetl: Distorted synthesizer FM synthesis model</LI>
<LI>PercFlut: Percussive flute-like FM synthesis model</LI>
<LI>BeeThree: Cheezy organ FM synthesis model</LI>
<LI>Moog: Swept filter sampler</LI>
<LI>FMVoices: Three-formant FM voice synthesis</LI>
<LI>VoicForm: Four-formant resonance filter voice synthesis</LI>
<LI>Resonate: Noise through a BiQuad filter</LI>
<LI>Drummer: Sampling synthesis</LI>
<LI>BandedWG: Banded waveguide meta-object for bowed bars, tibetan bowls, etc.</LI>
<LI>Shakers: Various stochastic event models of shaker instruments</LI>
<LI>ModalBar: Various four-resonance presets (marimba, vibraphone, etc...)</LI>
<LI>Mesh2D: Two-dimensional, rectilinear digital waveguide mesh</LI>
<LI>Whistle: Hybrid physical/spectral model of a police whistle</LI>
</UL>
\section nort Demo: Non-Realtime Use
See the information above with respect to compiling STK for non-realtime use.
In non-realtime mode, it is assumed that input control messages are provided from a SKINI scorefile and that audio output is written to a soundfile (.snd, .wav, .aif, .mat, .raw). A number of SKINI scorefiles are provided in the <I>scores</I> directory of the <I><B>demo</B></I> project. Assuming a successful compilation of the <I><B>demo</B></I> program, typing:
\code
cat scores/bookert.ski | demo BeeThree -ow myfile.wav
\endcode
or (on WindowsXX and/or Unix)
\code
demo BeeThree -ow myfile.wav < scores\bookert.ski
\endcode
from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I> using the STK BeeThree instrument and write the resulting audio data to a WAV formatted soundfile called "myfile.wav". Typing <TT>demo</TT> without any arguments will provide a full program usage description.
\section rt Demo: Realtime Use
STK realtime audio and MIDI input/output and realtime SKINI control input via socketing support is provided for Linux, 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.
<P>
Control input and audio output options are typically specified as command-line arguments to STK programs. For example, the <I><B>demo</B></I> program is invoked as:
\code
demo instrument flags
\endcode
where instruments include those described above and flags can be any or all of:
<UL>
<LI><I>-or</I> for realtime audio output,</LI>
<LI><I>-ow <file name></I> for WAV soundfile output,</LI>
<LI><I>-os <file name></I> for SND (AU) soundfile output,</LI>
<LI><I>-om <file name></I> for MAT-file output,</LI>
<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>
<LI><I>-im <file name></I> for MIDI control input</LI>
<LI><I>-s RATE</I> to specify a sample rate</LI>
<LI><I>-n NUMBER</I> to specify multivoice polyphony</LI>
</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.
Assuming a successful compilation of the <I><B>demo</B></I> program, typing:
\code
cat scores/bookert.ski | demo BeeThree -or
\endcode
or (on WindowsXX and/or Unix)
\code
demo BeeThree -or < scores\bookert.ski
\endcode
from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I> using the STK BeeThree instrument and stream the resulting audio data in realtime to the audio output channel of your computer. Typing <TT>demo</TT> without any arguments will provide a full program usage description.
\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
\brief STK ADSR envelope class.
This Envelope subclass implements a
traditional ADSR (Attack, Decay,
Sustain, Release) envelope. It
responds to simple keyOn and keyOff
messages, keeping track of its state.
The \e state = ADSR::DONE after the
envelope value reaches 0.0 in the
ADSR::RELEASE state.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__ADSR_H)
#define __ADSR_H
#include "Envelope.h"
class ADSR : public Envelope
{
public:
//! Envelope states.
enum { ATTACK, DECAY, SUSTAIN, RELEASE, DONE };
//! Default constructor.
ADSR(void);
//! Class destructor.
~ADSR(void);
//! Set target = 1, state = \e ADSR::ATTACK.
void keyOn(void);
//! Set target = 0, state = \e ADSR::RELEASE.
void keyOff(void);
//! Set the attack rate.
void setAttackRate(MY_FLOAT aRate);
//! Set the decay rate.
void setDecayRate(MY_FLOAT aRate);
//! Set the sustain level.
void setSustainLevel(MY_FLOAT aLevel);
//! Set the release rate.
void setReleaseRate(MY_FLOAT aRate);
//! Set the attack rate based on a time duration.
void setAttackTime(MY_FLOAT aTime);
//! Set the decay rate based on a time duration.
void setDecayTime(MY_FLOAT aTime);
//! Set the release rate based on a time duration.
void setReleaseTime(MY_FLOAT aTime);
//! 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);
//! Set the target value.
void setTarget(MY_FLOAT aTarget);
//! Return the current envelope \e state (ATTACK, DECAY, SUSTAIN, RELEASE, DONE).
int getState(void) const;
//! Set to state = ADSR::SUSTAIN with current and target values of \e aValue.
void setValue(MY_FLOAT aValue);
//! Return one envelope output value.
MY_FLOAT tick(void);
//! Return \e vectorSize envelope outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected:
MY_FLOAT attackRate;
MY_FLOAT decayRate;
MY_FLOAT sustainLevel;
MY_FLOAT releaseRate;
};
#endif
/***************************************************/
/*! \class ADSR
\brief STK ADSR envelope class.
This Envelope subclass implements a
traditional ADSR (Attack, Decay,
Sustain, Release) envelope. It
responds to simple keyOn and keyOff
messages, keeping track of its state.
The \e state = ADSR::DONE after the
envelope value reaches 0.0 in the
ADSR::RELEASE state.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__ADSR_H)
#define __ADSR_H
#include "Envelope.h"
class ADSR : public Envelope
{
public:
//! Envelope states.
enum { ATTACK, DECAY, SUSTAIN, RELEASE, DONE };
//! Default constructor.
ADSR(void);
//! Class destructor.
~ADSR(void);
//! Set target = 1, state = \e ADSR::ATTACK.
void keyOn(void);
//! Set target = 0, state = \e ADSR::RELEASE.
void keyOff(void);
//! Set the attack rate.
void setAttackRate(MY_FLOAT aRate);
//! Set the decay rate.
void setDecayRate(MY_FLOAT aRate);
//! Set the sustain level.
void setSustainLevel(MY_FLOAT aLevel);
//! Set the release rate.
void setReleaseRate(MY_FLOAT aRate);
//! Set the attack rate based on a time duration.
void setAttackTime(MY_FLOAT aTime);
//! Set the decay rate based on a time duration.
void setDecayTime(MY_FLOAT aTime);
//! Set the release rate based on a time duration.
void setReleaseTime(MY_FLOAT aTime);
//! 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);
//! Set the target value.
void setTarget(MY_FLOAT aTarget);
//! Return the current envelope \e state (ATTACK, DECAY, SUSTAIN, RELEASE, DONE).
int getState(void) const;
//! Set to state = ADSR::SUSTAIN with current and target values of \e aValue.
void setValue(MY_FLOAT aValue);
//! Return one envelope output value.
MY_FLOAT tick(void);
//! Return \e vectorSize envelope outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
protected:
MY_FLOAT attackRate;
MY_FLOAT decayRate;
MY_FLOAT sustainLevel;
MY_FLOAT releaseRate;
};
#endif

View File

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

View File

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

View File

@@ -1,77 +1,77 @@
/***************************************************/
/*! \class BlowBotl
\brief STK blown bottle instrument class.
This class implements a helmholtz resonator
(biquad filter) with a polynomial jet
excitation (a la Cook).
Control Change Numbers:
- Noise Gain = 4
- Vibrato Frequency = 11
- Vibrato Gain = 1
- Volume = 128
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__BOTTLE_H)
#define __BOTTLE_H
#include "Instrmnt.h"
#include "JetTabl.h"
#include "BiQuad.h"
#include "PoleZero.h"
#include "Noise.h"
#include "ADSR.h"
#include "WaveLoop.h"
class BlowBotl : public Instrmnt
{
public:
//! Class constructor.
BlowBotl();
//! Class destructor.
~BlowBotl();
//! 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:
JetTabl *jetTable;
BiQuad *resonator;
PoleZero *dcBlock;
Noise *noise;
ADSR *adsr;
WaveLoop *vibrato;
MY_FLOAT maxPressure;
MY_FLOAT noiseGain;
MY_FLOAT vibratoGain;
MY_FLOAT outputGain;
};
#endif
/***************************************************/
/*! \class BlowBotl
\brief STK blown bottle instrument class.
This class implements a helmholtz resonator
(biquad filter) with a polynomial jet
excitation (a la Cook).
Control Change Numbers:
- Noise Gain = 4
- Vibrato Frequency = 11
- Vibrato Gain = 1
- Volume = 128
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__BOTTLE_H)
#define __BOTTLE_H
#include "Instrmnt.h"
#include "JetTabl.h"
#include "BiQuad.h"
#include "PoleZero.h"
#include "Noise.h"
#include "ADSR.h"
#include "WaveLoop.h"
class BlowBotl : public Instrmnt
{
public:
//! Class constructor.
BlowBotl();
//! Class destructor.
~BlowBotl();
//! 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:
JetTabl *jetTable;
BiQuad *resonator;
PoleZero *dcBlock;
Noise *noise;
ADSR *adsr;
WaveLoop *vibrato;
MY_FLOAT maxPressure;
MY_FLOAT noiseGain;
MY_FLOAT vibratoGain;
MY_FLOAT outputGain;
};
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,127 +1,127 @@
/***************************************************/
/*! \class SKINI
\brief STK SKINI parsing class
This class parses SKINI formatted text
messages. It can be used to parse individual
messages or it can be passed an entire file.
The file specification is Perry's and his
alone, but it's all text so it shouldn't be to
hard to figure out.
SKINI (Synthesis toolKit Instrument Network
Interface) is like MIDI, but allows for
floating-point control changes, note numbers,
etc. The following example causes a sharp
middle C to be played with a velocity of 111.132:
\code
noteOn 60.01 111.13
\endcode
\sa \ref skini
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__SKINI_H)
#define __SKINI_H
#include "Stk.h"
#include <stdio.h>
class SKINI : public Stk
{
public:
//! Default constructor used for parsing messages received externally.
SKINI();
//! Overloaded constructor taking a SKINI formatted scorefile.
SKINI(char *fileName);
//! Class destructor
~SKINI();
//! Attempt to parse the given string, returning the message type.
/*!
A type value equal to zero indicates an invalid message.
*/
long parseThis(char* aString);
//! 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.
*/
long nextMessage();
//! Return the current message type.
long getType() const;
//! Return the current message channel value.
long getChannel() const;
//! Return the current message delta time value (in seconds).
MY_FLOAT getDelta() const;
//! Return the current message byte two value.
MY_FLOAT getByteTwo() const;
//! Return the current message byte three value.
MY_FLOAT getByteThree() const;
//! Return the current message byte two value (integer).
long getByteTwoInt() const;
//! Return the current message byte three value (integer).
long getByteThreeInt() const;
//! Return remainder string after parsing.
const char* getRemainderString();
//! Return the message type as a string.
const char* getMessageTypeString();
//! Return the SKINI type string for the given type value.
const char* whatsThisType(long type);
//! Return the SKINI controller string for the given controller number.
const char* whatsThisController(long number);
protected:
FILE *myFile;
long messageType;
char msgTypeString[64];
long channel;
MY_FLOAT deltaTime;
MY_FLOAT byteTwo;
MY_FLOAT byteThree;
long byteTwoInt;
long byteThreeInt;
char remainderString[1024];
char whatString[1024];
};
static const double Midi2Pitch[129] = {
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,
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,
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,
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,
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,
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,
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,
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,
13289.75};
#endif
/***************************************************/
/*! \class SKINI
\brief STK SKINI parsing class
This class parses SKINI formatted text
messages. It can be used to parse individual
messages or it can be passed an entire file.
The file specification is Perry's and his
alone, but it's all text so it shouldn't be to
hard to figure out.
SKINI (Synthesis toolKit Instrument Network
Interface) is like MIDI, but allows for
floating-point control changes, note numbers,
etc. The following example causes a sharp
middle C to be played with a velocity of 111.132:
\code
noteOn 60.01 111.13
\endcode
\sa \ref skini
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__SKINI_H)
#define __SKINI_H
#include "Stk.h"
#include <stdio.h>
class SKINI : public Stk
{
public:
//! Default constructor used for parsing messages received externally.
SKINI();
//! Overloaded constructor taking a SKINI formatted scorefile.
SKINI(char *fileName);
//! Class destructor
~SKINI();
//! Attempt to parse the given string, returning the message type.
/*!
A type value equal to zero indicates an invalid message.
*/
long parseThis(char* aString);
//! 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.
*/
long nextMessage();
//! Return the current message type.
long getType() const;
//! Return the current message channel value.
long getChannel() const;
//! Return the current message delta time value (in seconds).
MY_FLOAT getDelta() const;
//! Return the current message byte two value.
MY_FLOAT getByteTwo() const;
//! Return the current message byte three value.
MY_FLOAT getByteThree() const;
//! Return the current message byte two value (integer).
long getByteTwoInt() const;
//! Return the current message byte three value (integer).
long getByteThreeInt() const;
//! Return remainder string after parsing.
const char* getRemainderString();
//! Return the message type as a string.
const char* getMessageTypeString();
//! Return the SKINI type string for the given type value.
const char* whatsThisType(long type);
//! Return the SKINI controller string for the given controller number.
const char* whatsThisController(long number);
protected:
FILE *myFile;
long messageType;
char msgTypeString[64];
long channel;
MY_FLOAT deltaTime;
MY_FLOAT byteTwo;
MY_FLOAT byteThree;
long byteTwoInt;
long byteThreeInt;
char remainderString[1024];
char whatString[1024];
};
static const double Midi2Pitch[129] = {
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,
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,
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,
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,
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,
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,
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,
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,
13289.75};
#endif

View File

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

View File

@@ -1,130 +1,131 @@
#include "SKINI.msg"
#define __SK_MaxMsgTypes_ 128
struct SKINISpec { char messageString[32];
long type;
long data2;
long data3;
};
/* SEE COMMENT BLOCK AT BOTTOM FOR FIELDS AND USES */
/* MessageString ,type, ch?, data2 , data3 */
struct SKINISpec skini_msgs[__SK_MaxMsgTypes_] =
{
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
{"PolyPressure" , __SK_PolyPressure_, SK_DBL, SK_DBL},
{"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
{"ProgramChange" , __SK_ProgramChange_, SK_DBL, SK_DBL},
{"AfterTouch" , __SK_AfterTouch_, SK_DBL, NOPE},
{"ChannelPressure" ,__SK_ChannelPressure_, SK_DBL, NOPE},
{"PitchWheel" , __SK_PitchWheel_, SK_DBL, NOPE},
{"PitchBend" , __SK_PitchBend_, SK_DBL, NOPE},
{"Clock" , __SK_Clock_, NOPE, NOPE},
{"Undefined" , 249, NOPE, NOPE},
{"SongStart" , __SK_SongStart_, NOPE, NOPE},
{"Continue" , __SK_Continue_, NOPE, NOPE},
{"SongStop" , __SK_SongStop_, NOPE, NOPE},
{"Undefined" , 253, 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},
{"Modulation" , __SK_ControlChange_, __SK_Modulation_ , SK_DBL},
{"Breath" , __SK_ControlChange_, __SK_Breath_ , SK_DBL},
{"FootControl" , __SK_ControlChange_, __SK_FootControl_ , SK_DBL},
{"Portamento" , __SK_ControlChange_, __SK_Portamento_ , SK_DBL},
{"Balance" , __SK_ControlChange_, __SK_Balance_ , SK_DBL},
{"Pan" , __SK_ControlChange_, __SK_Pan_ , SK_DBL},
{"Sustain" , __SK_ControlChange_, __SK_Sustain_ , 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},
{"StringDamping" , __SK_ControlChange_, __SK_StringDamping_ , SK_DBL},
{"StringDetune" , __SK_ControlChange_, __SK_StringDetune_ , SK_DBL},
{"BodySize" , __SK_ControlChange_, __SK_BodySize_ , SK_DBL},
{"BowPressure" , __SK_ControlChange_, __SK_BowPressure_ , 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},
{"FluteEmbouchure" , __SK_ControlChange_, __SK_FluteEmbouchure_, SK_DBL},
{"LipTension" , __SK_ControlChange_, __SK_LipTension_ , 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},
{"Strumming" , __SK_ControlChange_, __SK_Strumming_ , 127 },
{"NotStrumming" , __SK_ControlChange_, __SK_Strumming_ , 0 },
{"PlayerSkill" , __SK_ControlChange_, __SK_PlayerSkill_ , SK_DBL},
{"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 },
{"Sekere" , __SK_ControlChange_, __SK_ShakerInst_ , 1 },
{"Cabasa" , __SK_ControlChange_, __SK_ShakerInst_ , 2 },
{"Bamboo" , __SK_ControlChange_, __SK_ShakerInst_ , 3 },
{"Waterdrp" , __SK_ControlChange_, __SK_ShakerInst_ , 4 },
{"Tambourn" , __SK_ControlChange_, __SK_ShakerInst_ , 5 },
{"Sleighbl" , __SK_ControlChange_, __SK_ShakerInst_ , 6 },
{"Guiro" , __SK_ControlChange_, __SK_ShakerInst_ , 7 },
{"OpenFile" , 256, SK_STR , NOPE},
{"SetPath" , 257, SK_STR , NOPE},
{"FilePath" , __SK_SINGER_FilePath_, SK_STR , NOPE},
{"Frequency" , __SK_SINGER_Frequency_, SK_STR , NOPE},
{"NoteName" , __SK_SINGER_NoteName_, SK_STR , NOPE},
{"VocalShape" , __SK_SINGER_Shape_ , SK_STR , NOPE},
{"Glottis" , __SK_SINGER_Glot_ , SK_STR , NOPE},
{"VoicedUnVoiced" , __SK_SINGER_VoicedUnVoiced_, SK_DBL , SK_STR},
{"Synthesize" , __SK_SINGER_Synthesize_, SK_STR , NOPE},
{"Silence" , __SK_SINGER_Silence_, SK_STR , NOPE},
{"VibratoAmt" , __SK_ControlChange_ ,__SK_SINGER_VibratoAmt_,SK_DBL},
{"RndVibAmt" , __SK_SINGER_RndVibAmt_ ,SK_STR, NOPE},
{"VibFreq" , __SK_ControlChange_ ,__SK_SINGER_VibFreq_ ,SK_DBL}
};
/** FORMAT: *************************************************************/
/* */
/* MessageStr$ ,type, data2, data3, */
/* */
/* type is the message type sent back from the SKINI line parser. */
/* data<n> 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 */
/* SK_INT : byte (actually scanned as 32 bit signed integer) */
/* 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_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 */
/* 256bytes 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 stored in the */
/* SK_STR field, or as a new type of multi-line */
/* message. */
/* */
/*************************************************************************/
#include "SKINI.msg"
#define __SK_MaxMsgTypes_ 128
struct SKINISpec { char messageString[32];
long type;
long data2;
long data3;
};
/* SEE COMMENT BLOCK AT BOTTOM FOR FIELDS AND USES */
/* MessageString ,type, ch?, data2 , data3 */
struct SKINISpec skini_msgs[__SK_MaxMsgTypes_] =
{
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
{"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
{"PolyPressure" , __SK_PolyPressure_, SK_DBL, SK_DBL},
{"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
{"ProgramChange" , __SK_ProgramChange_, SK_DBL, SK_DBL},
{"AfterTouch" , __SK_AfterTouch_, SK_DBL, NOPE},
{"ChannelPressure" ,__SK_ChannelPressure_, SK_DBL, NOPE},
{"PitchWheel" , __SK_PitchWheel_, SK_DBL, NOPE},
{"PitchBend" , __SK_PitchBend_, SK_DBL, NOPE},
{"PitchChange" , __SK_PitchChange_, SK_DBL, NOPE},
{"Clock" , __SK_Clock_, NOPE, NOPE},
{"Undefined" , 249, NOPE, NOPE},
{"SongStart" , __SK_SongStart_, NOPE, NOPE},
{"Continue" , __SK_Continue_, NOPE, NOPE},
{"SongStop" , __SK_SongStop_, NOPE, NOPE},
{"Undefined" , 253, 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},
{"Modulation" , __SK_ControlChange_, __SK_Modulation_ , SK_DBL},
{"Breath" , __SK_ControlChange_, __SK_Breath_ , SK_DBL},
{"FootControl" , __SK_ControlChange_, __SK_FootControl_ , SK_DBL},
{"Portamento" , __SK_ControlChange_, __SK_Portamento_ , SK_DBL},
{"Balance" , __SK_ControlChange_, __SK_Balance_ , SK_DBL},
{"Pan" , __SK_ControlChange_, __SK_Pan_ , SK_DBL},
{"Sustain" , __SK_ControlChange_, __SK_Sustain_ , 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},
{"StringDamping" , __SK_ControlChange_, __SK_StringDamping_ , SK_DBL},
{"StringDetune" , __SK_ControlChange_, __SK_StringDetune_ , SK_DBL},
{"BodySize" , __SK_ControlChange_, __SK_BodySize_ , SK_DBL},
{"BowPressure" , __SK_ControlChange_, __SK_BowPressure_ , 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},
{"FluteEmbouchure" , __SK_ControlChange_, __SK_FluteEmbouchure_, SK_DBL},
{"LipTension" , __SK_ControlChange_, __SK_LipTension_ , 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},
{"Strumming" , __SK_ControlChange_, __SK_Strumming_ , 127 },
{"NotStrumming" , __SK_ControlChange_, __SK_Strumming_ , 0 },
{"PlayerSkill" , __SK_ControlChange_, __SK_PlayerSkill_ , SK_DBL},
{"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 },
{"Sekere" , __SK_ControlChange_, __SK_ShakerInst_ , 1 },
{"Cabasa" , __SK_ControlChange_, __SK_ShakerInst_ , 2 },
{"Bamboo" , __SK_ControlChange_, __SK_ShakerInst_ , 3 },
{"Waterdrp" , __SK_ControlChange_, __SK_ShakerInst_ , 4 },
{"Tambourn" , __SK_ControlChange_, __SK_ShakerInst_ , 5 },
{"Sleighbl" , __SK_ControlChange_, __SK_ShakerInst_ , 6 },
{"Guiro" , __SK_ControlChange_, __SK_ShakerInst_ , 7 },
{"OpenFile" , 256, SK_STR , NOPE},
{"SetPath" , 257, SK_STR , NOPE},
{"FilePath" , __SK_SINGER_FilePath_, SK_STR , NOPE},
{"Frequency" , __SK_SINGER_Frequency_, SK_STR , NOPE},
{"NoteName" , __SK_SINGER_NoteName_, SK_STR , NOPE},
{"VocalShape" , __SK_SINGER_Shape_ , SK_STR , NOPE},
{"Glottis" , __SK_SINGER_Glot_ , SK_STR , NOPE},
{"VoicedUnVoiced" , __SK_SINGER_VoicedUnVoiced_, SK_DBL , SK_STR},
{"Synthesize" , __SK_SINGER_Synthesize_, SK_STR , NOPE},
{"Silence" , __SK_SINGER_Silence_, SK_STR , NOPE},
{"VibratoAmt" , __SK_ControlChange_ ,__SK_SINGER_VibratoAmt_,SK_DBL},
{"RndVibAmt" , __SK_SINGER_RndVibAmt_ ,SK_STR, NOPE},
{"VibFreq" , __SK_ControlChange_ ,__SK_SINGER_VibFreq_ ,SK_DBL}
};
/** FORMAT: *************************************************************/
/* */
/* MessageStr$ ,type, data2, data3, */
/* */
/* type is the message type sent back from the SKINI line parser. */
/* data<n> 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 */
/* SK_INT : byte (actually scanned as 32 bit signed integer) */
/* 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_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 */
/* 256bytes 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 stored in the */
/* 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
\brief STK TCP socket client/server class.
This class provides a uniform cross-platform
TCP socket client or socket server interface.
Methods are provided for reading or writing
data buffers to/from connections. This class
also provides a number of static functions for
use with external socket descriptors.
The user is responsible for checking the values
returned by the read/write methods. Values
less than or equal to zero indicate a closed
or lost connection or the occurence of an error.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__SOCKET_H)
#define __SOCKET_H
#include "Stk.h"
class Socket : public Stk
{
public:
//! 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.
*/
Socket( int port = 2006 );
//! 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.
*/
Socket( int port, const char *hostname );
//! The class destructor closes the socket instance, breaking any existing connections.
~Socket();
//! 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
a socket server, -1 is returned. If the socket client is already
connected, that connection is terminated and a new connection is
attempted. Server connections are made using the accept() method.
An StkError will be thrown if a socket error occurs during
instantiation. \sa accept
*/
int connect( int port, const char *hostname = "localhost" );
//! Close this socket.
void close( void );
//! Return the server/client socket descriptor.
int socket( void ) const;
//! Return the server/client port number.
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 no connection requests are pending and the socket has not
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
returned.
*/
int accept( void );
//! 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 );
//! Close the socket with the given descriptor.
static void close( int socket );
//! Returns TRUE is the socket descriptor is valid.
static bool isValid( int socket );
//! 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);
//! 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 );
//! 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);
//! 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 );
protected:
char msg[256];
int soket;
int poort;
bool server;
};
#endif // defined(__SOCKET_H)
/***************************************************/
/*! \class Socket
\brief STK TCP socket client/server class.
This class provides a uniform cross-platform
TCP socket client or socket server interface.
Methods are provided for reading or writing
data buffers to/from connections. This class
also provides a number of static functions for
use with external socket descriptors.
The user is responsible for checking the values
returned by the read/write methods. Values
less than or equal to zero indicate a closed
or lost connection or the occurence of an error.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__SOCKET_H)
#define __SOCKET_H
#include "Stk.h"
class Socket : public Stk
{
public:
//! 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.
*/
Socket( int port = 2006 );
//! 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.
*/
Socket( int port, const char *hostname );
//! The class destructor closes the socket instance, breaking any existing connections.
~Socket();
//! 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
a socket server, -1 is returned. If the socket client is already
connected, that connection is terminated and a new connection is
attempted. Server connections are made using the accept() method.
An StkError will be thrown if a socket error occurs during
instantiation. \sa accept
*/
int connect( int port, const char *hostname = "localhost" );
//! Close this socket.
void close( void );
//! Return the server/client socket descriptor.
int socket( void ) const;
//! Return the server/client port number.
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 no connection requests are pending and the socket has not
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
returned.
*/
int accept( void );
//! 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 );
//! Close the socket with the given descriptor.
static void close( int socket );
//! Returns TRUE is the socket descriptor is valid.
static bool isValid( int socket );
//! 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);
//! 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 );
//! 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);
//! 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 );
protected:
char msg[256];
int soket;
int poort;
bool server;
};
#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
\brief STK base class
Nearly all STK classes inherit from this class.
The global sample rate can be queried and
modified via Stk. In addition, this class
provides error handling and byte-swapping
functions.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__STK_H)
#define __STK_H
// Most data in STK is passed and calculated with the following
// user-definable floating-point type. You can change this to "float"
// if you prefer or perhaps a "long double" in the future.
typedef double MY_FLOAT;
//! STK error handling class.
/*!
This is a fairly abstract exception handling class. There could
be sub-classes to take care of more specific error conditions ... or
not.
*/
class StkError
{
public:
enum TYPE {
WARNING,
DEBUG_WARNING,
FUNCTION_ARGUMENT,
FILE_NOT_FOUND,
FILE_UNKNOWN_FORMAT,
FILE_ERROR,
PROCESS_THREAD,
PROCESS_SOCKET,
PROCESS_SOCKET_IPADDR,
AUDIO_SYSTEM,
MIDI_SYSTEM,
UNSPECIFIED
};
protected:
char message[256];
TYPE type;
public:
//! The constructor.
StkError(const char *p, TYPE tipe = StkError::UNSPECIFIED);
//! The destructor.
virtual ~StkError(void);
//! Prints "thrown" error message to stdout.
virtual void printMessage(void);
//! Returns the "thrown" error message TYPE.
virtual const TYPE& getType(void) { return type; }
//! Returns the "thrown" error message string.
virtual const char *getMessage(void) const { return message; }
};
class Stk
{
public:
typedef unsigned long STK_FORMAT;
static const STK_FORMAT STK_SINT8; /*!< -128 to +127 */
static const STK_FORMAT STK_SINT16; /*!< -32768 to +32767 */
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_FLOAT64; /*!< Normalized between plus/minus 1.0. */
//! Static method which returns the current STK sample rate.
static MY_FLOAT sampleRate(void);
//! Static method which sets the STK sample rate.
/*!
The sample rate set using this method is queried by all STK
classes which depend on its value. It is initialized to the
default SRATE set in Stk.h. Many STK classes use the sample rate
during instantiation. Therefore, if you wish to use a rate which
is different from the default rate, it is imperative that it be
set \e BEFORE STK objects are instantiated.
*/
static void setSampleRate(MY_FLOAT newRate);
//! Static method which byte-swaps a 16-bit data type.
static void swap16(unsigned char *ptr);
//! Static method which byte-swaps a 32-bit data type.
static void swap32(unsigned char *ptr);
//! Static method which byte-swaps a 64-bit data type.
static void swap64(unsigned char *ptr);
//! Static cross-platform method to sleep for a number of milliseconds.
static void sleep(unsigned long milliseconds);
private:
static MY_FLOAT srate;
protected:
//! Default constructor.
Stk(void);
//! Class destructor.
virtual ~Stk(void);
//! Function for error reporting and handling.
static void handleError( const char *message, StkError::TYPE type );
};
// Here are a few other useful typedefs.
typedef signed short SINT16;
typedef signed int SINT32;
typedef float FLOAT32;
typedef double FLOAT64;
// Boolean values
#define FALSE 0
#define TRUE 1
// The default sampling rate.
#define SRATE (MY_FLOAT) 22050.0
// Real-time audio input and output buffer size. If clicks are
// occuring in the input and/or output sound stream, a larger buffer
// size may help. Larger buffer sizes, however, produce more latency.
#define RT_BUFFER_SIZE 512
// The RAWWAVE_PATH definition is concatenated to the beginning of all
// references to rawwave files in the various STK core classes
// (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
// path definition appropriately. The current definition is a
// relative reference that will work "out of the box" for the STK
// distribution.
#define RAWWAVE_PATH "../../"
#define PI (MY_FLOAT) 3.14159265359
#define TWO_PI (MY_FLOAT) (MY_FLOAT) (2 * PI)
#define ONE_OVER_128 (MY_FLOAT) 0.0078125
#if defined(__WINDOWS_DS__)
#define __OS_WINDOWS__
#define __STK_REALTIME__
#elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__)
#define __OS_LINUX__
#define __STK_REALTIME__
#elif defined(__IRIX_AL__)
#define __OS_IRIX__
#define __STK_REALTIME__
#endif
//#define _STK_DEBUG_
#endif
/***************************************************/
/*! \class Stk
\brief STK base class
Nearly all STK classes inherit from this class.
The global sample rate can be queried and
modified via Stk. In addition, this class
provides error handling and byte-swapping
functions.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__STK_H)
#define __STK_H
// Most data in STK is passed and calculated with the following
// user-definable floating-point type. You can change this to "float"
// if you prefer or perhaps a "long double" in the future.
typedef double MY_FLOAT;
//! STK error handling class.
/*!
This is a fairly abstract exception handling class. There could
be sub-classes to take care of more specific error conditions ... or
not.
*/
class StkError
{
public:
enum TYPE {
WARNING,
DEBUG_WARNING,
FUNCTION_ARGUMENT,
FILE_NOT_FOUND,
FILE_UNKNOWN_FORMAT,
FILE_ERROR,
PROCESS_THREAD,
PROCESS_SOCKET,
PROCESS_SOCKET_IPADDR,
AUDIO_SYSTEM,
MIDI_SYSTEM,
UNSPECIFIED
};
protected:
char message[256];
TYPE type;
public:
//! The constructor.
StkError(const char *p, TYPE tipe = StkError::UNSPECIFIED);
//! The destructor.
virtual ~StkError(void);
//! Prints "thrown" error message to stdout.
virtual void printMessage(void);
//! Returns the "thrown" error message TYPE.
virtual const TYPE& getType(void) { return type; }
//! Returns the "thrown" error message string.
virtual const char *getMessage(void) const { return message; }
};
class Stk
{
public:
typedef unsigned long STK_FORMAT;
static const STK_FORMAT STK_SINT8; /*!< -128 to +127 */
static const STK_FORMAT STK_SINT16; /*!< -32768 to +32767 */
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_FLOAT64; /*!< Normalized between plus/minus 1.0. */
//! Static method which returns the current STK sample rate.
static MY_FLOAT sampleRate(void);
//! Static method which sets the STK sample rate.
/*!
The sample rate set using this method is queried by all STK
classes which depend on its value. It is initialized to the
default SRATE set in Stk.h. Many STK classes use the sample rate
during instantiation. Therefore, if you wish to use a rate which
is different from the default rate, it is imperative that it be
set \e BEFORE STK objects are instantiated.
*/
static void setSampleRate(MY_FLOAT newRate);
//! Static method which byte-swaps a 16-bit data type.
static void swap16(unsigned char *ptr);
//! Static method which byte-swaps a 32-bit data type.
static void swap32(unsigned char *ptr);
//! Static method which byte-swaps a 64-bit data type.
static void swap64(unsigned char *ptr);
//! Static cross-platform method to sleep for a number of milliseconds.
static void sleep(unsigned long milliseconds);
private:
static MY_FLOAT srate;
protected:
//! Default constructor.
Stk(void);
//! Class destructor.
virtual ~Stk(void);
//! Function for error reporting and handling.
static void handleError( const char *message, StkError::TYPE type );
};
// Here are a few other useful typedefs.
typedef signed short SINT16;
typedef signed int SINT32;
typedef float FLOAT32;
typedef double FLOAT64;
// Boolean values
#define FALSE 0
#define TRUE 1
// The default sampling rate.
#define SRATE (MY_FLOAT) 22050.0
// Real-time audio input and output buffer size. If clicks are
// occuring in the input and/or output sound stream, a larger buffer
// size may help. Larger buffer sizes, however, produce more latency.
#define RT_BUFFER_SIZE 512
// The RAWWAVE_PATH definition is concatenated to the beginning of all
// references to rawwave files in the various STK core classes
// (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
// path definition appropriately. The current definition is a
// relative reference that will work for the programs in the STK
// projects directory. The path can also be specified to configure and
// set via the Makefiles.
#if !defined(RAWWAVE_PATH)
#define RAWWAVE_PATH "../../rawwaves/"
#endif
#define PI (MY_FLOAT) 3.14159265359
#define TWO_PI (MY_FLOAT) (MY_FLOAT) (2 * PI)
#define ONE_OVER_128 (MY_FLOAT) 0.0078125
#if defined(__WINDOWS_DS__)
#define __OS_WINDOWS__
#define __STK_REALTIME__
#elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__)
#define __OS_LINUX__
#define __STK_REALTIME__
#elif defined(__IRIX_AL__)
#define __OS_IRIX__
#define __STK_REALTIME__
#elif defined(__MACOSX_CORE__)
#define __OS_MACOSX__
#define __STK_REALTIME__
#endif
//#define _STK_DEBUG_
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,74 +1,74 @@
/***************************************************/
/*! \class TwoZero
\brief STK two-zero filter class.
This protected Filter subclass implements
a two-zero digital filter. A method is
provided for creating a "notch" in the
frequency response while maintaining a
constant filter gain.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__TWOZERO_H)
#define __TWOZERO_H
#include "Filter.h"
class TwoZero : protected Filter
{
public:
//! Default constructor creates a second-order pass-through filter.
TwoZero();
//! Class destructor.
~TwoZero();
//! Clears the internal states of the filter.
void clear(void);
//! Set the b[0] coefficient value.
void setB0(MY_FLOAT b0);
//! Set the b[1] coefficient value.
void setB1(MY_FLOAT b1);
//! Set the b[2] coefficient value.
void setB2(MY_FLOAT b2);
//! Sets the filter coefficients for a "notch" at \e frequency (in Hz).
/*!
This method determines the filter coefficients corresponding to
two complex-conjugate zeros with the given \e frequency (in Hz)
and \e radius from the z-plane origin. The coefficients are then
normalized to produce a maximum filter gain of one (independent of
the filter \e gain parameter). The resulting filter frequency
response has a "notch" or anti-resonance at the given \e
frequency. The closer the zeros are to the unit-circle (\e radius
close to or equal to one), the narrower the resulting notch width.
*/
void setNotch(MY_FLOAT frequency, MY_FLOAT radius);
//! Set the filter gain.
/*!
The gain is applied at the filter input and does not affect the
coefficient values. The default gain value is 1.0.
*/
void setGain(MY_FLOAT theGain);
//! Return the current filter gain.
MY_FLOAT getGain(void) const;
//! Return the last computed output value.
MY_FLOAT lastOut(void) const;
//! Input one sample to the filter and return one output.
MY_FLOAT tick(MY_FLOAT sample);
//! 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);
};
#endif
/***************************************************/
/*! \class TwoZero
\brief STK two-zero filter class.
This protected Filter subclass implements
a two-zero digital filter. A method is
provided for creating a "notch" in the
frequency response while maintaining a
constant filter gain.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__TWOZERO_H)
#define __TWOZERO_H
#include "Filter.h"
class TwoZero : protected Filter
{
public:
//! Default constructor creates a second-order pass-through filter.
TwoZero();
//! Class destructor.
~TwoZero();
//! Clears the internal states of the filter.
void clear(void);
//! Set the b[0] coefficient value.
void setB0(MY_FLOAT b0);
//! Set the b[1] coefficient value.
void setB1(MY_FLOAT b1);
//! Set the b[2] coefficient value.
void setB2(MY_FLOAT b2);
//! Sets the filter coefficients for a "notch" at \e frequency (in Hz).
/*!
This method determines the filter coefficients corresponding to
two complex-conjugate zeros with the given \e frequency (in Hz)
and \e radius from the z-plane origin. The coefficients are then
normalized to produce a maximum filter gain of one (independent of
the filter \e gain parameter). The resulting filter frequency
response has a "notch" or anti-resonance at the given \e
frequency. The closer the zeros are to the unit-circle (\e radius
close to or equal to one), the narrower the resulting notch width.
*/
void setNotch(MY_FLOAT frequency, MY_FLOAT radius);
//! Set the filter gain.
/*!
The gain is applied at the filter input and does not affect the
coefficient values. The default gain value is 1.0.
*/
void setGain(MY_FLOAT theGain);
//! Return the current filter gain.
MY_FLOAT getGain(void) const;
//! Return the last computed output value.
MY_FLOAT lastOut(void) const;
//! Input one sample to the filter and return one output.
MY_FLOAT tick(MY_FLOAT sample);
//! 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);
};
#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
\brief STK waveform oscillator class.
This class inherits from WvIn and provides
audio file looping functionality.
WaveLoop supports multi-channel data in
interleaved format. It is important to
distinguish the tick() methods, which return
samples produced by averaging across sample
frames, from the tickFrame() methods, which
return pointers to multi-channel sample frames.
For single-channel data, these methods return
equivalent values.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__WAVELOOP_H)
#define __WAVELOOP_H
#include "WvIn.h"
#include <stdio.h>
class WaveLoop : public WvIn
{
public:
//! Class constructor.
WaveLoop( const char *fileName, bool raw = FALSE );
//! Class destructor.
virtual ~WaveLoop();
//! Set the data interpolation rate based on a looping frequency.
/*!
This function determines the interpolation rate based on the file
size and the current Stk::sampleRate. The \e aFrequency value
corresponds to file cycles per second. The frequency can be
negative, in which case the loop is read in reverse order.
*/
void setFrequency(MY_FLOAT aFrequency);
//! Increment the read pointer by \e aTime samples, modulo file size.
void addTime(MY_FLOAT aTime);
//! Increment current read pointer by \e anAngle, relative to a looping frequency.
/*!
This function increments the read pointer based on the file
size and the current Stk::sampleRate. The \e anAngle value
is a multiple of file size.
*/
void addPhase(MY_FLOAT anAngle);
//! Add a phase offset to the current read pointer.
/*!
This function determines a time offset based on the file
size and the current Stk::sampleRate. The \e anAngle value
is a multiple of file size.
*/
void addPhaseOffset(MY_FLOAT anAngle);
//! Return a pointer to the next sample frame of data.
const MY_FLOAT *tickFrame(void);
protected:
// Read file data.
void readData(unsigned long index);
MY_FLOAT phaseOffset;
};
#endif // defined(__WAVELOOP_H)
/***************************************************/
/*! \class WaveLoop
\brief STK waveform oscillator class.
This class inherits from WvIn and provides
audio file looping functionality.
WaveLoop supports multi-channel data in
interleaved format. It is important to
distinguish the tick() methods, which return
samples produced by averaging across sample
frames, from the tickFrame() methods, which
return pointers to multi-channel sample frames.
For single-channel data, these methods return
equivalent values.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__WAVELOOP_H)
#define __WAVELOOP_H
#include "WvIn.h"
#include <stdio.h>
class WaveLoop : public WvIn
{
public:
//! Class constructor.
WaveLoop( const char *fileName, bool raw = FALSE );
//! Class destructor.
virtual ~WaveLoop();
//! Set the data interpolation rate based on a looping frequency.
/*!
This function determines the interpolation rate based on the file
size and the current Stk::sampleRate. The \e aFrequency value
corresponds to file cycles per second. The frequency can be
negative, in which case the loop is read in reverse order.
*/
void setFrequency(MY_FLOAT aFrequency);
//! Increment the read pointer by \e aTime samples, modulo file size.
void addTime(MY_FLOAT aTime);
//! Increment current read pointer by \e anAngle, relative to a looping frequency.
/*!
This function increments the read pointer based on the file
size and the current Stk::sampleRate. The \e anAngle value
is a multiple of file size.
*/
void addPhase(MY_FLOAT anAngle);
//! Add a phase offset to the current read pointer.
/*!
This function determines a time offset based on the file
size and the current Stk::sampleRate. The \e anAngle value
is a multiple of file size.
*/
void addPhaseOffset(MY_FLOAT anAngle);
//! Return a pointer to the next sample frame of data.
const MY_FLOAT *tickFrame(void);
protected:
// Read file data.
void readData(unsigned long index);
MY_FLOAT phaseOffset;
};
#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
\brief STK audio data input base class.
This class provides input support for various
audio file formats. It also serves as a base
class for "realtime" streaming subclasses.
WvIn loads the contents of an audio file for
subsequent output. Linear interpolation is
used for fractional "read rates".
WvIn supports multi-channel data in interleaved
format. It is important to distinguish the
tick() methods, which return samples produced
by averaging across sample frames, from the
tickFrame() methods, which return pointers to
multi-channel sample frames. For single-channel
data, these methods return equivalent values.
Small files are completely read into local memory
during instantiation. Large files are read
incrementally from disk. The file size threshold
and the increment size values are defined in
WvIn.h.
WvIn currently supports WAV, AIFF, SND (AU),
MAT-file (Matlab), and STK RAW file formats.
Signed integer (8-, 16-, and 32-bit) and floating-
point (32- and 64-bit) data types are supported.
Uncompressed data types are not supported. If
using MAT-files, data should be saved in an array
with each data channel filling a matrix row.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__WVIN_H)
#define __WVIN_H
// Files larger than CHUNK_THRESHOLD will be copied into memory
// in CHUNK_SIZE increments, rather than completely loaded into
// a buffer at once.
#define CHUNK_THRESHOLD 5000000 // 5 Mb
#define CHUNK_SIZE 1024 // sample frames
#include "Stk.h"
#include <stdio.h>
class WvIn : public Stk
{
public:
//! Default constructor.
WvIn();
//! Overloaded constructor for file input.
/*!
An StkError will be thrown if the file is not found, its format is
unknown, or a read error occurs.
*/
WvIn( const char *fileName, bool raw = FALSE );
//! Class destructor.
virtual ~WvIn();
//! Open the specified file and load its data.
/*!
An StkError will be thrown if the file is not found, its format is
unknown, or a read error occurs.
*/
void openFile( const char *fileName, bool raw = FALSE );
//! If a file is open, close it.
void closeFile(void);
//! Clear outputs and reset time (file pointer) to zero.
void reset(void);
//! Normalize data to a maximum of +-1.0.
/*!
For large, incrementally loaded files with integer data types,
normalization is computed relative to the data type maximum.
No normalization is performed for incrementally loaded files
with floating-point data types.
*/
void normalize(void);
//! Normalize data to a maximum of \e +-peak.
/*!
For large, incrementally loaded files with integer data types,
normalization is computed relative to the data type maximum
(\e peak/maximum). For incrementally loaded files with floating-
point data types, direct scaling by \e peak is performed.
*/
void normalize(MY_FLOAT peak);
//! Return the file size in sample frames.
unsigned long getSize(void) const;
//! Return the number of audio channels in the file.
unsigned int getChannels(void) const;
//! Return the input file sample rate in Hz (not the data read rate).
/*!
WAV, SND, and AIF formatted files specify a sample rate in
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.
*/
MY_FLOAT getFileRate(void) const;
//! Query whether reading is complete.
bool isFinished(void) const;
//! 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.
*/
void setRate(MY_FLOAT aRate);
//! Increment the read pointer by \e aTime samples.
virtual void addTime(MY_FLOAT aTime);
//! Turn linear interpolation on/off.
/*!
Interpolation is automatically off when the read rate is
an integer value. If interpolation is turned off for a
fractional rate, the time index is truncated to an integer
value.
*/
void setInterpolate(bool doInterpolate);
//! Return the average across the last output sample frame.
virtual MY_FLOAT lastOut(void) const;
//! 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.
*/
virtual MY_FLOAT tick(void);
//! 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.
*/
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Return a pointer to the last output sample frame.
virtual const MY_FLOAT *lastFrame(void) const;
//! 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.
*/
virtual const MY_FLOAT *tickFrame(void);
//! 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.
*/
virtual MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames);
protected:
// Initialize class variables.
void init( void );
// Read file data.
virtual void readData(unsigned long index);
// Get STK RAW file information.
bool getRawInfo( const char *fileName );
// Get WAV file header information.
bool getWavInfo( const char *fileName );
// Get SND (AU) file header information.
bool getSndInfo( const char *fileName );
// Get AIFF file header information.
bool getAifInfo( const char *fileName );
// Get MAT-file header information.
bool getMatInfo( const char *fileName );
char msg[256];
FILE *fd;
MY_FLOAT *data;
MY_FLOAT *lastOutput;
bool chunking;
bool finished;
bool interpolate;
bool byteswap;
unsigned long fileSize;
unsigned long bufferSize;
unsigned long dataOffset;
unsigned int channels;
long chunkPointer;
STK_FORMAT dataType;
MY_FLOAT fileRate;
MY_FLOAT gain;
MY_FLOAT time;
MY_FLOAT rate;
};
#endif // defined(__WVIN_H)
/***************************************************/
/*! \class WvIn
\brief STK audio data input base class.
This class provides input support for various
audio file formats. It also serves as a base
class for "realtime" streaming subclasses.
WvIn loads the contents of an audio file for
subsequent output. Linear interpolation is
used for fractional "read rates".
WvIn supports multi-channel data in interleaved
format. It is important to distinguish the
tick() methods, which return samples produced
by averaging across sample frames, from the
tickFrame() methods, which return pointers to
multi-channel sample frames. For single-channel
data, these methods return equivalent values.
Small files are completely read into local memory
during instantiation. Large files are read
incrementally from disk. The file size threshold
and the increment size values are defined in
WvIn.h.
WvIn currently supports WAV, AIFF, SND (AU),
MAT-file (Matlab), and STK RAW file formats.
Signed integer (8-, 16-, and 32-bit) and floating-
point (32- and 64-bit) data types are supported.
Uncompressed data types are not supported. If
using MAT-files, data should be saved in an array
with each data channel filling a matrix row.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__WVIN_H)
#define __WVIN_H
// Files larger than CHUNK_THRESHOLD will be copied into memory
// in CHUNK_SIZE increments, rather than completely loaded into
// a buffer at once.
#define CHUNK_THRESHOLD 5000000 // 5 Mb
#define CHUNK_SIZE 1024 // sample frames
#include "Stk.h"
#include <stdio.h>
class WvIn : public Stk
{
public:
//! Default constructor.
WvIn();
//! Overloaded constructor for file input.
/*!
An StkError will be thrown if the file is not found, its format is
unknown, or a read error occurs.
*/
WvIn( const char *fileName, bool raw = FALSE );
//! Class destructor.
virtual ~WvIn();
//! Open the specified file and load its data.
/*!
An StkError will be thrown if the file is not found, its format is
unknown, or a read error occurs.
*/
void openFile( const char *fileName, bool raw = FALSE );
//! If a file is open, close it.
void closeFile(void);
//! Clear outputs and reset time (file pointer) to zero.
void reset(void);
//! Normalize data to a maximum of +-1.0.
/*!
For large, incrementally loaded files with integer data types,
normalization is computed relative to the data type maximum.
No normalization is performed for incrementally loaded files
with floating-point data types.
*/
void normalize(void);
//! Normalize data to a maximum of \e +-peak.
/*!
For large, incrementally loaded files with integer data types,
normalization is computed relative to the data type maximum
(\e peak/maximum). For incrementally loaded files with floating-
point data types, direct scaling by \e peak is performed.
*/
void normalize(MY_FLOAT peak);
//! Return the file size in sample frames.
unsigned long getSize(void) const;
//! Return the number of audio channels in the file.
unsigned int getChannels(void) const;
//! Return the input file sample rate in Hz (not the data read rate).
/*!
WAV, SND, and AIF formatted files specify a sample rate in
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.
*/
MY_FLOAT getFileRate(void) const;
//! Query whether reading is complete.
bool isFinished(void) const;
//! 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.
*/
void setRate(MY_FLOAT aRate);
//! Increment the read pointer by \e aTime samples.
virtual void addTime(MY_FLOAT aTime);
//! Turn linear interpolation on/off.
/*!
Interpolation is automatically off when the read rate is
an integer value. If interpolation is turned off for a
fractional rate, the time index is truncated to an integer
value.
*/
void setInterpolate(bool doInterpolate);
//! Return the average across the last output sample frame.
virtual MY_FLOAT lastOut(void) const;
//! 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.
*/
virtual MY_FLOAT tick(void);
//! 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.
*/
virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Return a pointer to the last output sample frame.
virtual const MY_FLOAT *lastFrame(void) const;
//! 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.
*/
virtual const MY_FLOAT *tickFrame(void);
//! 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.
*/
virtual MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames);
protected:
// Initialize class variables.
void init( void );
// Read file data.
virtual void readData(unsigned long index);
// Get STK RAW file information.
bool getRawInfo( const char *fileName );
// Get WAV file header information.
bool getWavInfo( const char *fileName );
// Get SND (AU) file header information.
bool getSndInfo( const char *fileName );
// Get AIFF file header information.
bool getAifInfo( const char *fileName );
// Get MAT-file header information.
bool getMatInfo( const char *fileName );
char msg[256];
FILE *fd;
MY_FLOAT *data;
MY_FLOAT *lastOutput;
bool chunking;
bool finished;
bool interpolate;
bool byteswap;
unsigned long fileSize;
unsigned long bufferSize;
unsigned long dataOffset;
unsigned int channels;
long chunkPointer;
STK_FORMAT dataType;
MY_FLOAT fileRate;
MY_FLOAT gain;
MY_FLOAT time;
MY_FLOAT rate;
};
#endif // defined(__WVIN_H)

View File

@@ -1,149 +1,149 @@
/***************************************************/
/*! \class WvOut
\brief STK audio data output base class.
This class provides output support for various
audio file formats. It also serves as a base
class for "realtime" streaming subclasses.
WvOut writes samples to an audio file. It
supports multi-channel data in interleaved
format. It is important to distinguish the
tick() methods, which output single samples
to all channels in a sample frame, from the
tickFrame() method, which takes a pointer
to multi-channel sample frame data.
WvOut currently supports WAV, AIFF, AIFC, SND
(AU), MAT-file (Matlab), and STK RAW file
formats. Signed integer (8-, 16-, and 32-bit)
and floating- point (32- and 64-bit) data types
are supported. STK RAW files use 16-bit
integers by definition. MAT-files will always
be written as 64-bit floats. If a data type
specification does not match the specified file
type, the data type will automatically be
modified. Uncompressed data types are not
supported.
Currently, WvOut is non-interpolating and the
output rate is always Stk::sampleRate().
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__WVOUT_H)
#define __WVOUT_H
#include "Stk.h"
#include <stdio.h>
#define BUFFER_SIZE 1024 // sample frames
class WvOut : public Stk
{
public:
typedef unsigned long 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_SND; /*!< SND (AU) file type. */
static const FILE_TYPE WVOUT_AIF; /*!< AIFF file type. */
static const FILE_TYPE WVOUT_MAT; /*!< Matlab MAT-file type. */
//! Default constructor.
WvOut();
//! 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.
*/
WvOut( const char *fileName, unsigned int nChannels = 1, FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 );
//! Class destructor.
virtual ~WvOut();
//! 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.
*/
void openFile( const char *fileName, unsigned int nChannels = 1,
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.
void closeFile( void );
//! Return the number of sample frames output.
unsigned long getFrames( void ) const;
//! Return the number of seconds of data output.
MY_FLOAT getTime( void ) const;
//! Output a single sample to all channels in a sample frame.
/*!
An StkError is thrown if a file read error occurs.
*/
virtual void tick(const MY_FLOAT sample);
//! Output each sample in \e vector to all channels in \e vectorSize sample frames.
/*!
An StkError is thrown if a file read error occurs.
*/
virtual void tick(const MY_FLOAT *vector, unsigned int vectorSize);
//! Output the \e frameVector of sample frames of the given length.
/*!
An StkError is thrown if a file read error occurs.
*/
virtual void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1);
protected:
// Initialize class variables.
void init( void );
// Write data to output file;
virtual void writeData( unsigned long frames );
// Write STK RAW file header.
bool setRawFile( const char *fileName );
// Write WAV file header.
bool setWavFile( const char *fileName );
// Close WAV file, updating the header.
void closeWavFile( void );
// Write SND (AU) file header.
bool setSndFile( const char *fileName );
// Close SND file, updating the header.
void closeSndFile( void );
// Write AIFF file header.
bool setAifFile( const char *fileName );
// Close AIFF file, updating the header.
void closeAifFile( void );
// Write MAT-file header.
bool setMatFile( const char *fileName );
// Close MAT-file, updating the header.
void closeMatFile( void );
char msg[256];
FILE *fd;
MY_FLOAT *data;
FILE_TYPE fileType;
STK_FORMAT dataType;
bool byteswap;
unsigned int channels;
unsigned long counter;
unsigned long totalCount;
};
#endif // defined(__WVOUT_H)
/***************************************************/
/*! \class WvOut
\brief STK audio data output base class.
This class provides output support for various
audio file formats. It also serves as a base
class for "realtime" streaming subclasses.
WvOut writes samples to an audio file. It
supports multi-channel data in interleaved
format. It is important to distinguish the
tick() methods, which output single samples
to all channels in a sample frame, from the
tickFrame() method, which takes a pointer
to multi-channel sample frame data.
WvOut currently supports WAV, AIFF, AIFC, SND
(AU), MAT-file (Matlab), and STK RAW file
formats. Signed integer (8-, 16-, and 32-bit)
and floating- point (32- and 64-bit) data types
are supported. STK RAW files use 16-bit
integers by definition. MAT-files will always
be written as 64-bit floats. If a data type
specification does not match the specified file
type, the data type will automatically be
modified. Uncompressed data types are not
supported.
Currently, WvOut is non-interpolating and the
output rate is always Stk::sampleRate().
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#if !defined(__WVOUT_H)
#define __WVOUT_H
#include "Stk.h"
#include <stdio.h>
#define BUFFER_SIZE 1024 // sample frames
class WvOut : public Stk
{
public:
typedef unsigned long 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_SND; /*!< SND (AU) file type. */
static const FILE_TYPE WVOUT_AIF; /*!< AIFF file type. */
static const FILE_TYPE WVOUT_MAT; /*!< Matlab MAT-file type. */
//! Default constructor.
WvOut();
//! 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.
*/
WvOut( const char *fileName, unsigned int nChannels = 1, FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 );
//! Class destructor.
virtual ~WvOut();
//! 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.
*/
void openFile( const char *fileName, unsigned int nChannels = 1,
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.
void closeFile( void );
//! Return the number of sample frames output.
unsigned long getFrames( void ) const;
//! Return the number of seconds of data output.
MY_FLOAT getTime( void ) const;
//! Output a single sample to all channels in a sample frame.
/*!
An StkError is thrown if a file read error occurs.
*/
virtual void tick(const MY_FLOAT sample);
//! Output each sample in \e vector to all channels in \e vectorSize sample frames.
/*!
An StkError is thrown if a file read error occurs.
*/
virtual void tick(const MY_FLOAT *vector, unsigned int vectorSize);
//! Output the \e frameVector of sample frames of the given length.
/*!
An StkError is thrown if a file read error occurs.
*/
virtual void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1);
protected:
// Initialize class variables.
void init( void );
// Write data to output file;
virtual void writeData( unsigned long frames );
// Write STK RAW file header.
bool setRawFile( const char *fileName );
// Write WAV file header.
bool setWavFile( const char *fileName );
// Close WAV file, updating the header.
void closeWavFile( void );
// Write SND (AU) file header.
bool setSndFile( const char *fileName );
// Close SND file, updating the header.
void closeSndFile( void );
// Write AIFF file header.
bool setAifFile( const char *fileName );
// Close AIFF file, updating the header.
void closeAifFile( void );
// Write MAT-file header.
bool setMatFile( const char *fileName );
// Close MAT-file, updating the header.
void closeMatFile( void );
char msg[256];
FILE *fd;
MY_FLOAT *data;
FILE_TYPE fileType;
STK_FORMAT dataType;
bool byteswap;
unsigned int channels;
unsigned long counter;
unsigned long totalCount;
};
#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.
This object takes MIDI from the input stream
(via the RtMidi class), parses it, and turns it
into SKINI messages.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#include "RtMidi.h"
#include "Thread.h"
#include "Socket.h"
#include "SKINI.msg"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// Exit thread declaration.
extern "C" THREAD_RETURN THREAD_TYPE stdinMonitor(void * ptr);
void usage(void) {
printf("\nuseage: Md2Skini <flag(s)>\n\n");
printf(" With no arguments, Md2Skini converts MIDI input to SKINI\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(" connection (port 2001) to the optional hostname (default = localhost).\n");
printf(" With flag = -f <filename>, the output stream is simultaneously\n");
printf(" written to the file specified by the optional <filename>\n");
printf(" (default = test.ski).\n\n");
exit(0);
}
int main(int argc,char *argv[])
{
bool done = false, firstMessage = true, writeFile = false, useSocket = false;
FILE *file = NULL;
char fileName[256];
char hostName[128];
RtMidi *rtmidi = 0;
Socket *soket = 0;
Thread *thread = 0;
if ( argc>5 ) {
usage();
}
// Parse the command-line arguments.
int i = 1;
while (i < argc) {
if (argv[i][0] == '-') {
switch(argv[i][1]) {
case 's':
if ((i+1 < argc) && argv[i+1][0] != '-') {
i++;
strncpy(hostName, argv[i], 128);
}
else strcpy(hostName, "localhost");
useSocket = true;
break;
case 'f':
if ((i+1 < argc) && argv[i+1][0] != '-') {
i++;
strncpy(fileName, argv[i], 252);
if ( strstr(fileName,".ski") == NULL ) strcat(fileName, ".ski");
}
else strcpy(fileName, "test.ski");
file = fopen(fileName,"wb");
writeFile = true;
break;
default:
usage();
break;
}
}
else usage();
i++;
}
MY_FLOAT dt=0.0;
try {
rtmidi = new RtMidi();
}
catch (StkError &) {
exit(0);
}
// If using sockets, setup the client socket
if (useSocket) {
try {
soket = new Socket( 2001, hostName );
}
catch (StkError &) {
exit(0);
}
}
// Start the "exit" thread.
thread = new Thread();
if ( !thread->start( (THREAD_FUNCTION)&stdinMonitor, (void *) &done ) ) {
fprintf(stderr, "Unable to create exit thread ... aborting.\n");
goto cleanup;
}
// Write SKINI messages to buffer 's'. This is the easiest way to
// allow this single executable to work for both socketing and
// printf's to stdout.
char s[128];
int channel, j;
MY_FLOAT byte2, byte3;
while ( !done ) {
if (rtmidi->nextMessage() > 0) {
byte3 = rtmidi->getByteThree();
byte2 = rtmidi->getByteTwo();
channel = rtmidi->getChannel();
if (writeFile) dt = rtmidi->getDeltaTime();
if (firstMessage) { // first MIDI message time stamp is meaningless
dt = 0.0;
firstMessage = false;
}
switch(rtmidi->getType()) {
case __SK_NoteOn_:
if (byte3 < 1.0) {
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,64.0);
if (writeFile) {
fprintf(file,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,64.0);
}
} else {
sprintf(s,"NoteOn\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
if (writeFile) {
fprintf(file,"NoteOn\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
}
}
break;
case __SK_NoteOff_:
if (byte3 < 2.0) byte3 = 64.0;
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
if (writeFile) {
fprintf(file,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
}
break;
case __SK_PolyPressure_:
sprintf(s,"PolyPressure\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
if (writeFile) {
fprintf(file,"PolyPressure\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
}
break;
case __SK_ControlChange_:
j = (int) byte2;
switch(j) {
case __SK_Volume_:
sprintf(s,"Volume\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Volume\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_ModWheel_:
sprintf(s,"ModWheel\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"ModWheel\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Breath_:
sprintf(s,"Breath\t\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Breath\t\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_FootControl_:
sprintf(s,"FootControl\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"FootControl\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Portamento_:
sprintf(s,"Portamento\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Portamento\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Balance_:
sprintf(s,"Balance\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Balance\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Pan_:
sprintf(s,"Pan\t\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Pan\t\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Sustain_:
sprintf(s,"Sustain\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Sustain\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Expression_:
sprintf(s,"Expression\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Expression\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
default:
sprintf(s,"ControlChange\t%.3f %d %d %.1f\n",0.0,channel,j,byte3);
if (writeFile) {
fprintf(file,"ControlChange\t%.3f %d %d %.1f\n",dt,channel,j,byte3);
}
break;
}
break;
case __SK_ProgramChange_:
j = (int) byte2;
sprintf(s,"ProgramChange\t%.3f %d %d\n",0.0,channel,j);
if (writeFile) {
fprintf(file,"ProgramChange\t%.3f %d %d\n",dt,channel,j);
}
break;
case __SK_ChannelPressure_:
sprintf(s,"ChannelPressure\t%.3f %d %.1f\n",0.0,channel,byte2);
if (writeFile) {
fprintf(file,"ChannelPressure\t%.3f %d %.1f\n",dt,channel,byte2);
}
break;
case __SK_PitchBend_:
sprintf(s,"PitchBend\t%.3f %d %f\n",0.0,channel,byte2);
if (writeFile) {
fprintf(file,"PitchBend\t%.3f %d %f\n",dt,channel,byte2);
}
break;
default:
sprintf(s,"// Unknown\t%.3f %d %f %f\n",0.0,channel,byte2,byte3);
if (writeFile) {
fprintf(file,"// Unknown\t\t%.3f %d %f %f\n",dt,channel,byte2,byte3);
}
break;
}
if (useSocket) {
if ( soket->writeBuffer( s, strlen(s), 0 ) < 0 ) {
fprintf(stderr,"Socket connection failed ... aborting.\n");
goto cleanup;
}
}
else {
printf("%s", s);
fflush(stdout);
}
memset(s, 0, sizeof(s));
} else {
// Sleep for 10 milliseconds
Stk::sleep( 10 );
}
}
sprintf(s, "Exiting Md2Skini process ... bye!\n");
if (useSocket)
soket->writeBuffer( s, strlen(s), 0 );
else {
printf("%s", s);
fflush(stdout);
}
if (writeFile) {
printf("Wrote SKINI output to file %s.\n", fileName);
fclose(file);
}
cleanup:
done = true;
delete rtmidi;
delete soket;
delete thread;
return 0;
}
THREAD_RETURN THREAD_TYPE stdinMonitor(void * ptr)
{
bool *done = (bool *) ptr;
char inputString[128];
printf("Type 'Exit<cr>' to quit.\n");
while ( !*done ) {
fgets(inputString, 128, stdin);
if (inputString[3] == 't' && inputString[1] == 'x'
&& inputString[2] == 'i' && inputString[0] == 'E') {
*done = true;
}
else {
printf(inputString);
fflush(stdout);
}
}
return 0;
}
/***************************************************/
/*
Simple realtime MIDI to SKINI parser.
This object takes MIDI from the input stream
(via the RtMidi class), parses it, and turns it
into SKINI messages.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
*/
/***************************************************/
#include "RtMidi.h"
#include "Thread.h"
#include "Socket.h"
#include "SKINI.msg"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// Exit thread declaration.
extern "C" THREAD_RETURN THREAD_TYPE stdinMonitor(void * ptr);
void usage(void) {
printf("\nuseage: Md2Skini <flag(s)>\n\n");
printf(" With no arguments, Md2Skini converts MIDI input to SKINI\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(" connection (port 2001) to the optional hostname (default = localhost).\n");
printf(" With flag = -f <filename>, the output stream is simultaneously\n");
printf(" written to the file specified by the optional <filename>\n");
printf(" (default = test.ski).\n\n");
exit(0);
}
int main(int argc,char *argv[])
{
bool done = false, firstMessage = true, writeFile = false, useSocket = false;
FILE *file = NULL;
char fileName[256];
char hostName[128];
RtMidi *rtmidi = 0;
Socket *soket = 0;
Thread *thread = 0;
if ( argc>5 ) {
usage();
}
// Parse the command-line arguments.
int i = 1;
while (i < argc) {
if (argv[i][0] == '-') {
switch(argv[i][1]) {
case 's':
if ((i+1 < argc) && argv[i+1][0] != '-') {
i++;
strncpy(hostName, argv[i], 128);
}
else strcpy(hostName, "localhost");
useSocket = true;
break;
case 'f':
if ((i+1 < argc) && argv[i+1][0] != '-') {
i++;
strncpy(fileName, argv[i], 252);
if ( strstr(fileName,".ski") == NULL ) strcat(fileName, ".ski");
}
else strcpy(fileName, "test.ski");
file = fopen(fileName,"wb");
writeFile = true;
break;
default:
usage();
break;
}
}
else usage();
i++;
}
MY_FLOAT dt=0.0;
try {
rtmidi = new RtMidi();
}
catch (StkError &) {
exit(0);
}
// If using sockets, setup the client socket
if (useSocket) {
try {
soket = new Socket( 2001, hostName );
}
catch (StkError &) {
exit(0);
}
}
// Start the "exit" thread.
thread = new Thread();
if ( !thread->start( (THREAD_FUNCTION)&stdinMonitor, (void *) &done ) ) {
fprintf(stderr, "Unable to create exit thread ... aborting.\n");
goto cleanup;
}
// Write SKINI messages to buffer 's'. This is the easiest way to
// allow this single executable to work for both socketing and
// printf's to stdout.
char s[128];
int channel, j;
MY_FLOAT byte2, byte3;
while ( !done ) {
if (rtmidi->nextMessage() > 0) {
byte3 = rtmidi->getByteThree();
byte2 = rtmidi->getByteTwo();
channel = rtmidi->getChannel();
if (writeFile) dt = rtmidi->getDeltaTime();
if (firstMessage) { // first MIDI message time stamp is meaningless
dt = 0.0;
firstMessage = false;
}
switch(rtmidi->getType()) {
case __SK_NoteOn_:
if (byte3 < 1.0) {
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,64.0);
if (writeFile) {
fprintf(file,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,64.0);
}
} else {
sprintf(s,"NoteOn\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
if (writeFile) {
fprintf(file,"NoteOn\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
}
}
break;
case __SK_NoteOff_:
if (byte3 < 2.0) byte3 = 64.0;
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
if (writeFile) {
fprintf(file,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
}
break;
case __SK_PolyPressure_:
sprintf(s,"PolyPressure\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
if (writeFile) {
fprintf(file,"PolyPressure\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
}
break;
case __SK_ControlChange_:
j = (int) byte2;
switch(j) {
case __SK_Volume_:
sprintf(s,"Volume\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Volume\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_ModWheel_:
sprintf(s,"ModWheel\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"ModWheel\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Breath_:
sprintf(s,"Breath\t\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Breath\t\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_FootControl_:
sprintf(s,"FootControl\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"FootControl\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Portamento_:
sprintf(s,"Portamento\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Portamento\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Balance_:
sprintf(s,"Balance\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Balance\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Pan_:
sprintf(s,"Pan\t\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Pan\t\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Sustain_:
sprintf(s,"Sustain\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Sustain\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
case __SK_Expression_:
sprintf(s,"Expression\t%.3f %d %.1f\n",0.0,channel,byte3);
if (writeFile) {
fprintf(file,"Expression\t%.3f %d %.1f\n",dt,channel,byte3);
}
break;
default:
sprintf(s,"ControlChange\t%.3f %d %d %.1f\n",0.0,channel,j,byte3);
if (writeFile) {
fprintf(file,"ControlChange\t%.3f %d %d %.1f\n",dt,channel,j,byte3);
}
break;
}
break;
case __SK_ProgramChange_:
j = (int) byte2;
sprintf(s,"ProgramChange\t%.3f %d %d\n",0.0,channel,j);
if (writeFile) {
fprintf(file,"ProgramChange\t%.3f %d %d\n",dt,channel,j);
}
break;
case __SK_ChannelPressure_:
sprintf(s,"ChannelPressure\t%.3f %d %.1f\n",0.0,channel,byte2);
if (writeFile) {
fprintf(file,"ChannelPressure\t%.3f %d %.1f\n",dt,channel,byte2);
}
break;
case __SK_PitchBend_:
sprintf(s,"PitchBend\t%.3f %d %f\n",0.0,channel,byte2);
if (writeFile) {
fprintf(file,"PitchBend\t%.3f %d %f\n",dt,channel,byte2);
}
break;
default:
sprintf(s,"// Unknown\t%.3f %d %f %f\n",0.0,channel,byte2,byte3);
if (writeFile) {
fprintf(file,"// Unknown\t\t%.3f %d %f %f\n",dt,channel,byte2,byte3);
}
break;
}
if (useSocket) {
if ( soket->writeBuffer( s, strlen(s), 0 ) < 0 ) {
fprintf(stderr,"Socket connection failed ... aborting.\n");
goto cleanup;
}
}
else {
printf("%s", s);
fflush(stdout);
}
memset(s, 0, sizeof(s));
} else {
// Sleep for 10 milliseconds
Stk::sleep( 10 );
}
}
sprintf(s, "Exiting Md2Skini process ... bye!\n");
if (useSocket)
soket->writeBuffer( s, strlen(s), 0 );
else {
printf("%s", s);
fflush(stdout);
}
if (writeFile) {
printf("Wrote SKINI output to file %s.\n", fileName);
fclose(file);
}
cleanup:
done = true;
delete rtmidi;
delete soket;
delete thread;
return 0;
}
THREAD_RETURN THREAD_TYPE stdinMonitor(void * ptr)
{
bool *done = (bool *) ptr;
char inputString[128];
printf("Type 'Exit<cr>' to quit.\n");
while ( !*done ) {
fgets(inputString, 128, stdin);
if (inputString[3] == 't' && inputString[1] == 'x'
&& inputString[2] == 'i' && inputString[0] == 'E') {
*done = true;
}
else {
printf(inputString);
fflush(stdout);
}
}
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
//
// An STK program for monophonic voice playback and control.
// An example STK program for voice playback and control.
#include "SKINI.msg"
#include "Messager.h"
#include "WvOut.h"
#include "Instrmnt.h"
#include "PRCRev.h"
#include "Voicer.h"
// Miscellaneous command-line parsing and instrument allocation
// functions are defined in utilites.cpp ... specific to this program.
#include "utilities.h"
#include <stdlib.h>
#include <signal.h>
#include <math.h>
#include <iostream.h>
bool done;
static void finish(int ignore){ done = true; }
int main(int argc, char *argv[])
{
bool done;
Instrmnt *instrument = 0;
Messager *messager = 0;
Instrmnt **instrument = 0;
WvOut **output = 0;
Messager *messager = 0;
Reverb *reverb = 0;
MY_FLOAT pitch = 220.0;
Voicer *voicer = 0;
int i, nVoices = 1;
MY_FLOAT t60 = 1.0; // in seconds
// 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 );
// 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);
output = (WvOut **) calloc(nOutputs, sizeof(WvOut *));
// Instantiate the instrument from the command-line argument.
int voice = voiceByName(argv[1], &instrument);
if ( voice < 0 ) usage(argv[0]);
// Instantiate the instrument(s) type from the command-line argument
// (in utilities.cpp).
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
// the input message controller (in utilities.cpp).
voicer = (Voicer *) new Voicer(nVoices);
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 {
int controlMask = parseArgs(argc, argv, output);
messager = new Messager( controlMask );
parseArgs(argc, argv, output, &messager);
}
catch (StkError &) {
goto cleanup;
@@ -52,10 +70,13 @@ int main(int argc, char *argv[])
reverb = new PRCRev( t60 );
reverb->setEffectMix(0.2);
// Install an interrupt handler function.
(void) signal(SIGINT, finish);
// The runtime loop begins here:
done = FALSE;
int nTicks, type, j, i;
MY_FLOAT temp, byte2, byte3, sample;
int nTicks, type, j;
MY_FLOAT byte2, byte3, sample;
while (!done) {
// Look for new messages and return a delta time (in samples).
@@ -64,9 +85,8 @@ int main(int argc, char *argv[])
done = TRUE;
nTicks = messager->getDelta();
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);
}
@@ -79,51 +99,50 @@ int main(int argc, char *argv[])
case __SK_NoteOn_:
if (byte3 == 0.0) // velocity is zero ... really a NoteOff
instrument->noteOff( 0.5 );
else { // a NoteOn
if ( byte2 < 0.0 || byte2 > 128.0 ) continue;
pitch = Midi2Pitch[(unsigned int) byte2];
instrument->noteOn(pitch, byte3 * ONE_OVER_128);
}
voicer->noteOff( byte2, 64.0 );
else // a NoteOn
voicer->noteOn( byte2, byte3 );
break;
case __SK_NoteOff_:
instrument->noteOff(byte3 * ONE_OVER_128);
voicer->noteOff( byte2, byte3 );
break;
case __SK_ControlChange_:
if (byte2 == 44.0)
reverb->setEffectMix(byte3 * ONE_OVER_128);
else
instrument->controlChange( (int)byte2, byte3 );
voicer->controlChange( (int) byte2, byte3 );
break;
case __SK_AfterTouch_:
instrument->controlChange( 128, byte2 );
voicer->controlChange( 128, byte2 );
break;
case __SK_PitchChange_:
voicer->setFrequency( byte2 );
break;
case __SK_PitchBend_:
if ( byte2 < 0.0 || byte2 > 128.0 ) continue;
temp = byte2 - (int)byte2; // floating-point remainder
pitch = Midi2Pitch[(unsigned int)byte2] * pow(2.0, temp/12.0);
instrument->setFrequency(pitch);
voicer->pitchBend( byte2 );
break;
case __SK_ProgramChange_:
if (voice != (int)byte2) {
instrument->noteOff(1.0);
// Let the instrument settle a bit.
for (i=0; i<4096; i++) {
sample = reverb->tick( instrument->tick() );
if ( voice != (int) byte2 ) {
voicer->silence();
// Let the instrument(s) settle a bit.
for ( i=0; i<4096; i++ ) {
sample = reverb->tick( voicer->tick() );
for ( j=0; j<nOutputs; j++ ) output[j]->tick(sample);
}
delete instrument;
voice = voiceByNumber( (int)byte2, &instrument );
if ( voice < 0 ) {
// Default instrument = 0
voice = voiceByNumber( 0, &instrument );
for ( i=0; i<nVoices; i++ ) {
voicer->removeInstrument( instrument[i] );
delete instrument[i];
voice = voiceByNumber( (int)byte2, &instrument[i] );
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.
nTicks = (long) (t60 * Stk::sampleRate());
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);
}
@@ -142,8 +161,14 @@ int main(int argc, char *argv[])
free(output);
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;
}

View File

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

View File

@@ -1,20 +1,20 @@
Suggested Score/Instrument Pairings:
BeeThree bookert.ski, organs.ski
Rhodey doogie.ski
Mandolin duelingb.ski
Bowed fiddle.ski
PercFlut misacrio.ski
AgogoBel morazbel.ski
Brass pictures.ski
Wurley nriderson.ski
Flute simplgft.ski
Clarinet simplgft.ski
Marimba spain.ski
Vibraphn spain.ski
HeavyMtl streetsf.ski
Moog1 thecars.ski
TubeBell tubebell.ski
FMVoices lacrymos.ski, vocaliz.ski
VoicForm lacrymos.ski, vocaliz.ski
Suggested Score/Instrument Pairings:
BeeThree bookert.ski, organs.ski
Rhodey doogie.ski
Mandolin duelingb.ski
Bowed fiddle.ski
PercFlut misacrio.ski
AgogoBel morazbel.ski
Brass pictures.ski
Wurley nriderson.ski
Flute simplgft.ski
Clarinet simplgft.ski
Marimba spain.ski
Vibraphn spain.ski
HeavyMtl streetsf.ski
Moog1 thecars.ski
TubeBell tubebell.ski
FMVoices 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 */
NoteOn 0.000000 1 60 114.299997
NoteOff 0.380000 1 60 63.500000
NoteOn 0.020000 1 60 101.600002
NoteOff 0.100000 1 60 63.500000
NoteOn 0.100000 1 48 63.500000
NoteOff 0.200000 1 48 63.500000
NoteOn 0.200000 1 48 88.899998
NoteOff 0.190023 1 48 63.500000
NoteOn 0.010023 1 51 101.600002
NoteOff 0.570023 1 51 63.500000
NoteOn 0.030023 1 53 88.899998
NoteOff 0.570023 1 53 63.500000
NoteOn 0.030023 1 48 38.100002
NoteOff 0.300000 1 48 63.500000
NoteOn 0.300000 1 67 101.600002
NoteOff 0.570023 1 67 63.500000
NoteOn 0.030023 1 66 76.200003
NoteOff 0.190023 1 66 63.500000
NoteOn 0.010023 1 65 63.500000
NoteOff 0.190023 1 65 63.500000
NoteOn 0.010023 1 63 50.800001
NoteOff 0.190023 1 63 63.500000
NoteOn 0.010023 1 60 76.200003
NoteOff 0.380000 1 60 63.500000
NoteOn 0.020000 1 58 50.800001
NoteOff 0.190023 1 58 63.500000
NoteOn 0.010023 1 48 114.299997
NoteOff 0.380000 1 48 63.500000
NoteOn 0.020000 1 48 101.600002
NoteOff 0.100000 1 48 63.500000
NoteOn 0.100000 1 36 63.500000
NoteOff 0.200000 1 36 63.500000
NoteOn 0.200000 1 36 88.899998
NoteOff 0.190023 1 36 63.500000
NoteOn 0.010023 1 39 101.600002
NoteOff 0.570023 1 39 63.500000
NoteOn 0.030023 1 41 88.899998
NoteOff 0.570023 1 41 63.500000
NoteOn 0.030023 1 84 127.000000
NoteOff 0.475011 1 84 63.500000
NoteOn 0.025034 1 83 120.649998
NoteOff 0.066531 1 83 63.500000
NoteOn 0.003537 1 82 114.299997
NoteOff 0.057007 1 82 63.500000
NoteOn 0.003039 1 81 107.950003
NoteOff 0.047528 1 81 63.500000
NoteOn 0.002540 1 80 101.600002
NoteOff 0.047528 1 80 63.500000
NoteOn 0.002540 1 78 95.250000
NoteOff 0.038005 1 78 63.500000
NoteOn 0.002041 1 78 88.899998
NoteOff 0.028526 1 78 63.500000
NoteOn 0.001542 1 77 82.549997
NoteOff 0.019002 1 77 63.500000
NoteOn 0.001043 1 76 76.200003
NoteOff 0.019002 1 76 63.500000
NoteOn 0.001043 1 75 69.850002
NoteOff 0.019002 1 75 63.500000
NoteOn 0.001043 1 74 63.500000
NoteOff 0.019002 1 74 63.500000
NoteOn 0.001043 1 73 63.500000
NoteOff 0.028526 1 73 63.500000
NoteOn 0.001542 1 72 63.500000
NoteOff 0.019002 1 72 63.500000
NoteOn 0.001043 1 71 57.149998
NoteOff 0.028526 1 71 63.500000
NoteOn 0.001542 1 70 50.800001
NoteOff 0.038005 1 70 63.500000
NoteOn 0.002041 1 69 44.449999
NoteOff 0.047528 1 69 63.500000
NoteOn 0.002540 1 68 38.100002
NoteOff 0.057007 1 68 63.500000
NoteOn 0.003039 1 67 31.750000
NoteOff 0.057007 1 67 63.500000
NoteOn 0.003039 1 66 25.400000
NoteOff 0.057007 1 66 63.500000
NoteOn 0.003039 1 65 31.750000
NoteOff 0.066531 1 65 63.500000
NoteOn 0.003537 1 64 25.400000
NoteOff 0.076009 1 64 63.500000
NoteOn 0.004036 1 63 19.050001
NoteOff 0.085533 1 63 63.500000
NoteOn 0.004535 1 62 31.750000
NoteOff 0.095011 1 62 63.500000
NoteOn 0.005034 1 61 44.449999
NoteOff 0.104535 1 61 63.500000
ControlChange 0.005533 1 1 127.000000
NoteOn 0.000000 1 60 63.500000
NoteOff 1.500000 1 60 63.500000
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoteOn 0.000000 1 60 114.299997
NoteOff 0.380000 1 60 63.500000
NoteOn 0.020000 1 60 101.600002
NoteOff 0.100000 1 60 63.500000
NoteOn 0.100000 1 48 63.500000
NoteOff 0.200000 1 48 63.500000
NoteOn 0.200000 1 48 88.899998
NoteOff 0.190023 1 48 63.500000
NoteOn 0.010023 1 51 101.600002
NoteOff 0.570023 1 51 63.500000
NoteOn 0.030023 1 53 88.899998
NoteOff 0.570023 1 53 63.500000
NoteOn 0.030023 1 48 38.100002
NoteOff 0.300000 1 48 63.500000
NoteOn 0.300000 1 67 101.600002
NoteOff 0.570023 1 67 63.500000
NoteOn 0.030023 1 66 76.200003
NoteOff 0.190023 1 66 63.500000
NoteOn 0.010023 1 65 63.500000
NoteOff 0.190023 1 65 63.500000
NoteOn 0.010023 1 63 50.800001
NoteOff 0.190023 1 63 63.500000
NoteOn 0.010023 1 60 76.200003
NoteOff 0.380000 1 60 63.500000
NoteOn 0.020000 1 58 50.800001
NoteOff 0.190023 1 58 63.500000
NoteOn 0.010023 1 48 114.299997
NoteOff 0.380000 1 48 63.500000
NoteOn 0.020000 1 48 101.600002
NoteOff 0.100000 1 48 63.500000
NoteOn 0.100000 1 36 63.500000
NoteOff 0.200000 1 36 63.500000
NoteOn 0.200000 1 36 88.899998
NoteOff 0.190023 1 36 63.500000
NoteOn 0.010023 1 39 101.600002
NoteOff 0.570023 1 39 63.500000
NoteOn 0.030023 1 41 88.899998
NoteOff 0.570023 1 41 63.500000
NoteOn 0.030023 1 84 127.000000
NoteOff 0.475011 1 84 63.500000
NoteOn 0.025034 1 83 120.649998
NoteOff 0.066531 1 83 63.500000
NoteOn 0.003537 1 82 114.299997
NoteOff 0.057007 1 82 63.500000
NoteOn 0.003039 1 81 107.950003
NoteOff 0.047528 1 81 63.500000
NoteOn 0.002540 1 80 101.600002
NoteOff 0.047528 1 80 63.500000
NoteOn 0.002540 1 78 95.250000
NoteOff 0.038005 1 78 63.500000
NoteOn 0.002041 1 78 88.899998
NoteOff 0.028526 1 78 63.500000
NoteOn 0.001542 1 77 82.549997
NoteOff 0.019002 1 77 63.500000
NoteOn 0.001043 1 76 76.200003
NoteOff 0.019002 1 76 63.500000
NoteOn 0.001043 1 75 69.850002
NoteOff 0.019002 1 75 63.500000
NoteOn 0.001043 1 74 63.500000
NoteOff 0.019002 1 74 63.500000
NoteOn 0.001043 1 73 63.500000
NoteOff 0.028526 1 73 63.500000
NoteOn 0.001542 1 72 63.500000
NoteOff 0.019002 1 72 63.500000
NoteOn 0.001043 1 71 57.149998
NoteOff 0.028526 1 71 63.500000
NoteOn 0.001542 1 70 50.800001
NoteOff 0.038005 1 70 63.500000
NoteOn 0.002041 1 69 44.449999
NoteOff 0.047528 1 69 63.500000
NoteOn 0.002540 1 68 38.100002
NoteOff 0.057007 1 68 63.500000
NoteOn 0.003039 1 67 31.750000
NoteOff 0.057007 1 67 63.500000
NoteOn 0.003039 1 66 25.400000
NoteOff 0.057007 1 66 63.500000
NoteOn 0.003039 1 65 31.750000
NoteOff 0.066531 1 65 63.500000
NoteOn 0.003537 1 64 25.400000
NoteOff 0.076009 1 64 63.500000
NoteOn 0.004036 1 63 19.050001
NoteOff 0.085533 1 63 63.500000
NoteOn 0.004535 1 62 31.750000
NoteOff 0.095011 1 62 63.500000
NoteOn 0.005034 1 61 44.449999
NoteOff 0.104535 1 61 63.500000
ControlChange 0.005533 1 1 127.000000
NoteOn 0.000000 1 60 63.500000
NoteOff 1.500000 1 60 63.500000

View File

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

View File

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

View File

@@ -1,128 +1,128 @@
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoteOn 0.000000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.400000 1 38 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 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.000000 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.000000 1 42 127.000000
NoteOn 0.200000 1 49 127.000000
NoteOn 0.200000 1 38 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.400000 1 38 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 60.000000
NoteOn 0.200000 1 38 80.000000
NoteOn 0.200000 1 38 90.000000
NoteOn 0.100000 1 38 100.000000
NoteOn 0.100000 1 38 105.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 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 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 56 127.000000
NoteOn 0.200000 1 38 127.000000
NoteOn 0.000000 1 56 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 56 127.000000
NoteOn 0.200000 1 38 127.000000
NoteOn 0.000000 1 56 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 56 127.000000
NoteOn 0.200000 1 38 127.000000
NoteOn 0.000000 1 56 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.100000 1 42 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.300000 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 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 49 127.000000
NoteOff 1.000000 1 49 127.000000
/* Howdy!! ToolKit96cpp SKINI File, Perry Cook */
NoteOn 0.000000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.400000 1 38 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 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.000000 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.000000 1 42 127.000000
NoteOn 0.200000 1 49 127.000000
NoteOn 0.200000 1 38 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.400000 1 38 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.100000 1 36 60.000000
NoteOn 0.200000 1 38 80.000000
NoteOn 0.200000 1 38 90.000000
NoteOn 0.100000 1 38 100.000000
NoteOn 0.100000 1 38 105.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 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 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 56 127.000000
NoteOn 0.200000 1 38 127.000000
NoteOn 0.000000 1 56 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 56 127.000000
NoteOn 0.200000 1 38 127.000000
NoteOn 0.000000 1 56 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 42 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 49 127.000000
NoteOn 0.000000 1 42 127.000000
NoteOn 0.200000 1 56 127.000000
NoteOn 0.200000 1 38 127.000000
NoteOn 0.000000 1 56 127.000000
NoteOn 0.300000 1 36 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.000000 1 38 127.000000
NoteOn 0.200000 1 36 127.000000
NoteOn 0.100000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.000000 1 36 127.000000
NoteOn 0.000000 1 54 127.000000
NoteOn 0.100000 1 36 127.000000
NoteOn 0.100000 1 42 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.300000 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 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 49 127.000000
NoteOff 1.000000 1 49 127.000000

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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