Version 4.1

This commit is contained in:
Gary Scavone
2009-03-24 23:02:12 -04:00
committed by Stephen Sinclair
parent 81475b04c5
commit 2f09fcd019
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.

14
README
View File

@@ -12,26 +12,28 @@ 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 libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler.
The Synthesis ToolKit in C++ (STK) is a set of audio signal processing and synthesis classes and algorithms written in C++. You can use these classes to create programs that make sounds with a variety of synthesis techniques. This is not a terribly novel concept, except that the Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (no unusual libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, Macintosh OS X, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler.
The Synthesis ToolKit is free for non-commercial use. The only parts of the Synthesis ToolKit that are platform-dependent concern real-time audio and MIDI input and output, and that is taken care of with a few special classes. The interface for MIDI input and the simple <A HREF="http://dev.scriptics.com">Tcl/Tk</A> graphical user interfaces (GUIs) provided is the same, so it's easy to experiment in real time using either the GUIs or MIDI. The Synthesis ToolKit can generate simultaneous SND (AU), WAV, AIFF, and MAT-file output soundfile formats (as well as realtime sound output), so you can view your results using one of a large variety of sound/signal analysis tools already available (e.g. <A HREF="http://www-ccrma.stanford.edu/software/snd/">Snd</A>, Cool Edit, Matlab).
The Synthesis ToolKit is free for non-commercial use. The only parts of the Synthesis ToolKit that are platform-dependent concern real-time audio and MIDI input and output, and that is taken care of with a few special classes. The interface for MIDI input and the simple 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 <A HREF="http://dev.scriptics.com">Tcl/Tk</A> (which is freely distributed for all the supported ToolKit platforms). A number of Tcl/Tk GUI scripts are distributed with the ToolKit release. For control, the Synthesis Toolkit uses raw MIDI (on supported platforms), and SKINI (Synthesis ToolKit Instrument Network Interface, a MIDI-like text message synthesis control format).
For those instances where a simple GUI with sliders and buttons is helpful, we use Tcl/Tk (http://dev.scriptics.com) which is freely distributed for all the supported ToolKit platforms. A number of Tcl/Tk GUI scripts are distributed with the ToolKit release. For control, the Synthesis Toolkit uses raw MIDI (on supported platforms), and SKINI (Synthesis ToolKit Instrument Network Interface, a MIDI-like text message synthesis control format).
SYSTEM REQUIREMENTS:
See the individual README's (eg. README-linux) for platform specific information and system requirements. In general, you will use either the provided Makefiles (Unix platforms) or the VC++ workspace files to compile the example programs. To use the Tcl/Tk GUIs, you will need Tcl/Tk version 8.0 or higher.
See the individual README's (eg. README-linux) in the /doc directory for platform specific information and system requirements. In general, you will use the configure script to create Makefiles on unix platforms or the VC++ workspace files to compile the example programs. To use the Tcl/Tk GUIs, you will need Tcl/Tk version 8.0 or higher.
WHAT'S NEW:
STK has undergone several key revisions, changes, and additions since its last release. Despite being available in one form or another since 1996, we still consider STK to be alpha software. Thus, backward compatability has not been a priority. Please read the Release Notes to see what has changed since the last release.
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.
@@ -39,7 +41,7 @@ Realtime audio input capabilities were added to STK with release 3.0, though the
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).
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:

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

@@ -27,6 +27,10 @@ Stk -|
|
|- Modulate
|
|- SingWave
|
|- Voicer
|
|- Messager
|
|- SKINI
@@ -37,6 +41,8 @@ Stk -|
| |
| |- Modal - ModalBar
| |
| |- VoicForm
| |
| |- Sampler - Moog
| |
| |- Resonate
@@ -51,7 +57,9 @@ Stk -|
|
|- BandedWG
|
.- Mesh2D
|- Mesh2D
|
.- Whistle
*********** UNIT GENERATORS **************
@@ -91,6 +99,7 @@ Non-Linear: JetTabl.cpp Cubic Jet 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 **************
@@ -121,6 +130,7 @@ 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
@@ -128,6 +138,7 @@ 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
@@ -143,6 +154,7 @@ PitShift.cpp Cheap Pitch Shifter DelayL
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

View File

@@ -2,7 +2,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 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.

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

@@ -2,8 +2,6 @@ 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.
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

@@ -2,11 +2,11 @@ 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 and INSTALL for more general STK information.
When using the Makefiles provided, first try invoking "gmake" (for GNU make). If that doesn't work, try to download the GNU Makefile utilities from the Internet and use STK's default Makefile. If this is not possible, try using Makefile.sgi (make -f Makefile.sgi).
The project Makefiles are created by configure. If you have trouble running "make", try invoking "gmake" (for GNU make). If that doesn't work, try to download the GNU Makefile utilities from the Internet.
Another issue that has crept up with this release is proper compiler support for C++ error handling. If you experience problems, you probably don't have a recent version of the C++ compiler. Otherwise, STK should compile and run on SGI platforms without any problems. Release 4.0 of STK is confirmed to compile without difficulty using CC version 7.30.
Another issue that has crept up with this release is proper compiler support for C++ error handling. If you experience problems, you probably don't have a recent version of the C++ compiler. Otherwise, STK should compile and run on SGI platforms without any problems. Release 4.0 of STK is confirmed to compile (with various warnings) using CC version 7.30.
NOTE REGARDING PTHREADS:

View File

@@ -11,13 +11,13 @@ STK is currently distributed with Visual C++ 6.0 project and workspace files. I
IMPORTANT VC++ NOTE: When compiling "release" versions of STK programs, link to the release multithreaded library. When compiling "debug" versions, link to the debug multithreaded library. Compiler errors will result otherwise. Also, the Microsoft folk are up to their old habits of trying to change standards. The .NET compiler will complain about cerr for some reason.
The STK realtime sound input capabilities under Windoze are only supported using the DirectSoundCapture API. The latency is pretty horrendous, but what do you expect? Also, there is a chance you don't have DirectSoundCapture support on your computer. If not, you should download the DirectX 6.0 (or higher) runtime libraries from Microsoft's WWW site (http://www.microsoft.com/directx/download.asp) in order to run the pre-compiled STK executables for Windoze. The last time I checked, there was no DirectSoundCapture support for WindowsNT ... you'll have to switch to Windows 2000 or XP. I stopped supporting the WinMM audio output code with release 3.2.
Both the DirectSound and Steinberg ASIO audio APIs are supported for realtime audio input/output. The Visual C++ project files included with this distribution are configured to use the DirectSound API. In order to use the ASIO API, it is necessary to change the preprocessor definition from __WINDOWS_DS__ to __WINDOWS_ASIO__, as well as include all the files in the /src/asio/ directory (i.e. asio.h, asio.cpp, ...). If you have a good quality soundcard and a native ASIO driver (not emulated), you are likely to get much better input/output response using that.
Realtime sound output under Windoze is supported using the DirectSound (dsound.lib) API. All new versions of WindowsXX come with the DirectSound library, but early versions did not. If you have trouble running the distributed executables, then you probably don't have DirectSound installed on your system. You can download the necessary DirectSound stuff from Microsoft's WWW pages (http://www.microsoft.com/directx/download.asp).
When using the DirectSound API for audio input, latency is typically pretty horrendous (should we be surprised?). Also, there is a slight chance you don't have DirectSoundCapture support on your computer. If not, you should download the DirectX 6.0 (or higher) runtime libraries from Microsoft's WWW site (http://www.microsoft.com/directx/download.asp) in order to run the pre-compiled STK executables for Windoze. The last time I checked, there was no DirectSoundCapture support for WindowsNT ... you'll have to switch to Windows 2000 or XP or use an ASIO driver. I stopped supporting the WinMM audio output code with release 3.2.
Realtime MIDI input is supported using the winmm.lib API.
Visual C++ 6.0 workspaces have been created for the various STK projects. Everything has already been configured for you. The intermediate .obj files will be written to either the "release" or "debug" directories, but the executable files will be written to the main project directories (where they need to be for proper execution). If you should somehow lose or hose the VC++ workspace file for a project, then you will have to do a LOT of configuring to recreate it ... it's probably easier just to download the distribution again from our WWW sites. Anyway, for your benefit and mine, here is a list of things that need to be added to the various "Project Settings":
Visual C++ 6.0 workspaces have been created for the various STK projects. Everything has already been configured for you. The intermediate .obj files will be written to either the "Release" or "Debug" directories, but the executable files will be written to the main project directories (where they need to be for proper execution). If you should somehow lose or hose the VC++ workspace file for a project, then you will have to do a LOT of configuring to recreate it ... it's probably easier just to download the distribution again from our WWW sites. Anyway, for your benefit and mine, here is a list of things that need to be added to the various "Project Settings":
1. Under General: Set "Output files:" to <blank> (this will put the executable in the main project directory.
@@ -40,16 +40,22 @@ In order for socketing to work, it is necessary to have the TCP protocol install
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 TCLSpecs (eg. TCLPhys.tcl) from the Windows Explorer to start the GUI. Select the "communications" menu item and "Socket" and make the connection.
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.
@@ -61,13 +67,8 @@ USE REALTIME MIDI INPUT FOR CONTROL:
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.
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

@@ -2,6 +2,23 @@ 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

View File

@@ -51,9 +51,9 @@ 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
INPUT = . ../../include
FILE_PATTERNS = *.txt *.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =

View File

@@ -1,12 +1,35 @@
/*! \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>
<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>

View File

@@ -6,5 +6,5 @@
<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>
<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

@@ -10,6 +10,7 @@ The <B>Synthesis ToolKit in C++ (STK)</B> is a set of audio signal processing an
- \ref usage
- \ref maillist
- \ref system
- \ref links
- \ref tutorial
*/

View File

@@ -18,7 +18,7 @@ This is a link to Perry Cook's STK Web page. He has information about the \ref
<H4>What is the <I>Synthesis ToolKit</I>?</H4>
The Synthesis ToolKit in C++ (STK) is a set of audio signal processing and synthesis classes and algorithms written in C++. You can use these classes to create programs that make sounds with a variety of synthesis techniques. This is not a terribly novel concept, except that the Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (no libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler.
The Synthesis ToolKit in C++ (STK) is a set of audio signal processing and synthesis classes and algorithms written in C++. You can use these classes to create programs that make sounds with a variety of synthesis techniques. This is not a terribly novel concept, except that the Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (no unusual libraries, no hidden drivers, and all source code is included). We like to think that this increases the chances that our programs will still work in another 5-10 years. In fact, the ToolKit has been working continuously for nearly 8 years now. STK currently runs with "realtime" support (audio and MIDI) on SGI (Irix), Linux, Macintosh OS X, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler.
The Synthesis ToolKit is free for non-commercial use. The only parts of the Synthesis ToolKit that are platform-dependent concern real-time audio and MIDI input and output, and that is taken care of with a few special classes. The interface for MIDI input and the simple <A HREF="http://dev.scriptics.com">Tcl/Tk</A> graphical user interfaces (GUIs) provided is the same, so it's easy to experiment in real time using either the GUIs or MIDI. The Synthesis ToolKit can generate simultaneous SND (AU), WAV, AIFF, and MAT-file output soundfile formats (as well as realtime sound output), so you can view your results using one of a large variety of sound/signal analysis tools already available (e.g. <A HREF="http://www-ccrma.stanford.edu/software/snd/">Snd</A>, Cool Edit, Matlab).

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,17 +1,31 @@
/*! \page system System Requirements
<B>General</B>
<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>
<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>
<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>
@@ -19,9 +33,9 @@
<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>
<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>
<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

@@ -133,6 +133,13 @@ The irix (SGI) and linux operating systems are both flavors of unix and thus beh
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.
@@ -140,7 +147,7 @@ I have personally only worked with Visual C++ when compiling programs under wind
\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.
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.

View File

@@ -8,6 +8,7 @@
- \ref rt
- \ref tcl
- \ref midi
- \ref polyphony
<HR>
@@ -16,9 +17,9 @@
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>src</B></I> directory contains the source .cpp files for all the STK unit generator and algorithm classes.</LI><P>
<LI> The <I><B>include</B></I> directory contains the header files for almost all the STK unit generator and algorithm classes.</LI><P>
<LI> The <I><B>include</B></I> directory contains the header files for all the STK unit generator and algorithm classes.</LI><P>
<LI> The <I><B>rawwaves</B></I> directory contains various raw, monophonic, 16-bit, big-endian soundfiles used with the STK classes.</LI><P>
@@ -42,15 +43,38 @@ This release of STK comes with four separate "project" directories:
\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>
<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>
@@ -91,12 +115,14 @@ The <I><B>demo</B></I> project demonstrates the behavior of all the distributed
<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
@@ -106,13 +132,13 @@ 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
cat scores/bookert.ski | demo BeeThree -ow myfile.wav
\endcode
or (on WindowsXX and/or Unix)
\code
demo BeeThree -w myfile.wav < scores\bookert.ski
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.
@@ -120,7 +146,7 @@ from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I>
\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.
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:
@@ -134,8 +160,11 @@ where instruments include those described above and flags can be any or all of:
<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>-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.
@@ -156,7 +185,7 @@ from the <I><B>demo</B></I> directory will play the scorefile <I>bookert.ski</I>
\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:
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
@@ -180,4 +209,13 @@ On all supported realtime platforms, you can direct realtime MIDI input to the S
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

@@ -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

@@ -60,6 +60,12 @@ public:
//! 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);

View File

@@ -53,6 +53,12 @@ public:
//! 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);
@@ -60,6 +66,8 @@ protected:
MY_FLOAT alpha;
MY_FLOAT coeff;
MY_FLOAT apInput;
MY_FLOAT nextOutput;
bool doNextOut;
};
#endif

View File

@@ -50,12 +50,20 @@ public:
//! 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

@@ -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

@@ -41,6 +41,9 @@
#define MESSAGE_LENGTH 128
#define MAX_MESSAGES 25
#define STK_MIDI 0x0001
#define STK_PIPE 0x0002
#define STK_SOCKET 0x0004
#if defined(__STK_REALTIME__)
@@ -48,13 +51,9 @@
#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__))
#if (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__))
#include <sys/types.h>
#include <sys/time.h>
#endif
@@ -64,15 +63,16 @@ extern "C" THREAD_RETURN THREAD_TYPE stdinHandler(void * ptr);
class Messager : public Stk
{
public:
//! Constructor performs initialization based on an input mask.
//! 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. For realtime input types, an StkError can be
thrown during instantiation.
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);
Messager(int inputMask = 0, int port = 2001);
//! Class destructor.
~Messager();

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

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

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,9 +1,41 @@
/******************************************/
/*
RtAudio - realtime sound I/O C++ class
by Gary P. Scavone, 2001-2002.
/************************************************************************/
/*! \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
@@ -15,7 +47,6 @@
#include <pthread.h>
#include <unistd.h>
#define THREAD_TYPE
typedef snd_pcm_t *AUDIO_HANDLE;
typedef int DEVICE_ID;
typedef pthread_t THREAD_HANDLE;
@@ -25,7 +56,6 @@
#include <pthread.h>
#include <unistd.h>
#define THREAD_TYPE
typedef int AUDIO_HANDLE;
typedef int DEVICE_ID;
typedef pthread_t THREAD_HANDLE;
@@ -43,34 +73,61 @@
UINT bufferPointer;
} AUDIO_HANDLE;
#define THREAD_TYPE __stdcall
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>
#define THREAD_TYPE
typedef ALport AUDIO_HANDLE;
typedef int DEVICE_ID;
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
// *************************************************** //
//
// RtError class declaration.
//
// *************************************************** //
/************************************************************************/
/*! \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,
@@ -107,6 +164,24 @@ public:
};
// 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.
@@ -124,10 +199,10 @@ public:
// 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_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. */
@@ -136,17 +211,19 @@ public:
typedef int (*RTAUDIO_CALLBACK)(char *buffer, int bufferSize, void *userData);
//! The public device information structure for passing queried values.
typedef struct {
char name[128];
DEVICE_ID id[2]; /*!< No value reported by getDeviceInfo(). */
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;
int maxInputChannels;
int maxDuplexChannels;
int minOutputChannels;
int minInputChannels;
int minDuplexChannels;
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. */
@@ -154,11 +231,10 @@ public:
//! 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.
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();
@@ -237,8 +313,8 @@ public:
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.
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);
@@ -255,16 +331,14 @@ public:
//! 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.
//! Fill a user-supplied RTAUDIO_DEVICE structure for a specified device number.
/*!
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.
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);
@@ -320,6 +394,14 @@ public:
*/
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:
@@ -329,8 +411,8 @@ private:
enum { FAILURE, SUCCESS };
enum STREAM_MODE {
PLAYBACK,
RECORD,
OUTPUT,
INPUT,
DUPLEX,
UNINITIALIZED = -75
};
@@ -342,7 +424,7 @@ private:
typedef struct {
int device[2]; // Playback and record, respectively.
STREAM_MODE mode; // PLAYBACK, RECORD, or DUPLEX.
STREAM_MODE mode; // OUTPUT, INPUT, or DUPLEX.
AUDIO_HANDLE handle[2]; // Playback and record handles, respectively.
STREAM_STATE state; // STOPPED or RUNNING
char *userBuffer;
@@ -357,11 +439,8 @@ private:
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;
CALLBACK_INFO callbackInfo;
} RTAUDIO_STREAM;
typedef signed short INT16;
@@ -384,6 +463,18 @@ private:
*/
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);
@@ -428,7 +519,7 @@ private:
int formatBytes(RTAUDIO_FORMAT format);
};
// Uncomment the following definition to have extra information spewed to stderr.
//#define RTAUDIO_DEBUG
// Define the following flag to have extra information spewed to stderr.
//#define __RTAUDIO_DEBUG__
#endif

View File

@@ -29,6 +29,7 @@
#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

View File

@@ -23,6 +23,7 @@ struct SKINISpec skini_msgs[__SK_MaxMsgTypes_] =
{"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},

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

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

@@ -143,9 +143,12 @@ typedef double FLOAT64;
// (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 "../../"
// 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)
@@ -161,6 +164,9 @@ typedef double FLOAT64;
#elif defined(__IRIX_AL__)
#define __OS_IRIX__
#define __STK_REALTIME__
#elif defined(__MACOSX_CORE__)
#define __OS_MACOSX__
#define __STK_REALTIME__
#endif
//#define _STK_DEBUG_

View File

@@ -16,7 +16,7 @@
#include "Stk.h"
#if (defined(__OS_IRIX__) || defined(__OS_LINUX__))
#if (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__))
#include <pthread.h>
#define THREAD_TYPE

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

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,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
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.
voicer->silence();
// Let the instrument(s) settle a bit.
for ( i=0; i<4096; i++ ) {
sample = reverb->tick( instrument->tick() );
sample = reverb->tick( voicer->tick() );
for ( j=0; j<nOutputs; j++ ) output[j]->tick(sample);
}
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

File diff suppressed because it is too large Load Diff

View File

@@ -168,7 +168,7 @@ proc changePress {value} {
proc changePitch {value} {
global outID
puts $outID [format "PitchBend 0.0 1 %.3f" $value]
puts $outID [format "PitchChange 0.0 1 %.3f" $value]
flush $outID
}

View File

@@ -1,233 +0,0 @@
# Tcl/Tk Bowed Bar Model GUI for the Synthesis Toolkit (STK)
set press 64.0
set pitch 64.0
set cont1 127.0
set cont2 20.0
set cont4 127.0
set cont11 0.0
set outID "stdout"
set commtype "stdout"
set struckbow 0
# Configure main window
wm title . "STK Bowed Bar Controller"
wm iconname . "bowedbar"
. config -bg black
# Configure "communications" menu
menu .menu -tearoff 0
menu .menu.communication -tearoff 0
.menu add cascade -label "Communication" -menu .menu.communication \
-underline 0
.menu.communication add radio -label "Console" -variable commtype \
-value "stdout" -command { setComm }
.menu.communication add radio -label "Socket" -variable commtype \
-value "socket" -command { setComm }
. configure -menu .menu
frame .leftsid -bg black
proc myExit {} {
global pitch outID
puts $outID [format "NoteOff -1.0 1 %f 127" $pitch ]
flush $outID
puts $outID [format "ExitProgram"]
flush $outID
close $outID
exit
}
proc noteOn {pitchVal pressVal} {
global outID
puts $outID [format "NoteOn -1.0 1 %f %f" $pitchVal $pressVal]
flush $outID
}
proc noteOff {pitchVal pressVal} {
global outID
puts $outID [format "NoteOff -1.0 1 %f %f" $pitchVal $pressVal]
flush $outID
}
proc patchChange {value} {
global outID press cont1 cont4 cont11
set patch $value
puts $outID [format "ProgramChange -1.0 1 %i" $value]
flush $outID
set cont1 64.0
set cont4 64.0
set cont11 64.0
}
proc printWhatz {tag value1 value2 } {
global outID
puts $outID [format "%s %i %f" $tag $value1 $value2]
flush $outID
}
proc changePress {value} {
global outID
puts $outID [format "AfterTouch -1.0 1 %f" $value]
flush $outID
}
proc changePitch {value} {
global outID
puts $outID [format "PitchBend -1.0 1 %.3f" $value]
flush $outID
}
proc activateVel {} {
global pitch
noteOn $pitch 127
printWhatz "ControlChange -1.0 1 " 65 0
}
# Configure sliders
frame .press -bg grey66
button .press.pos -text Pos. -bg grey66 \
-command {printWhatz "ControlChange -1.0 1 " 65 127}
button .press.vel -text Vel. -bg grey66 \
-command activateVel
scale .press.bPressure -from 0 -to 128 -length 200 \
-command {changePress } -variable press\
-orient horizontal -label "Pos on Bow / Vel of Bow" \
-tickinterval 32 -showvalue true -bg grey66
scale .pitch -from 0 -to 128 -length 200 \
-command {changePitch } -variable pitch \
-orient horizontal -label "MIDI Note Number" \
-tickinterval 32 -showvalue true -bg grey66
scale .cont2 -from 0 -to 128 -length 200 \
-command {printWhatz "ControlChange -1.0 1 " 2} \
-orient horizontal -label "Bowing Pressure" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable cont2
scale .cont4 -from 0 -to 128 -length 200 \
-command {printWhatz "ControlChange -1.0 1 " 4} \
-orient horizontal -label "Strike/Bow Position" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable cont4
scale .cont11 -from 0 -to 128 -length 200 \
-command {printWhatz "ControlChange -1.0 1 " 11} \
-orient horizontal -label "Integration" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable cont11
scale .reson -from 0 -to 128 -length 200 \
-command {printWhatz "ControlChange -1.0 1 " 1} \
-orient horizontal -label "Mode Resonance" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable cont1
. config -bg grey20
frame .bowstruk -bg black
radiobutton .bowstruk.bowed -text Bowed -bg grey66 \
-command {printWhatz "ControlChange -1.0 1 " 64 127} \
-value 1 -variable struckbow
radiobutton .bowstruk.struck -text Struck -bg grey66 \
-command {printWhatz "ControlChange -1.0 1 " 64 0} \
-value 0 -variable struckbow
pack .press.pos -side left
pack .press.bPressure -side left
pack .press.vel -side left
pack .press -padx 10 -pady 10
pack .pitch -padx 10 -pady 10
pack .cont2 -padx 10 -pady 10
pack .cont4 -padx 10 -pady 10
pack .cont11 -padx 10 -pady 10
pack .reson -padx 10 -pady 10
pack .bowstruk.bowed -side left -padx 5
pack .bowstruk.struck -side left -padx 5
pack .bowstruk -pady 10
frame .noteOn -bg black
button .noteOn.on -text NoteOn -bg grey66 -command { noteOn $pitch $press }
button .noteOn.off -text NoteOff -bg grey66 -command { noteOff $pitch 127.0 }
button .noteOn.exit -text "Exit Program" -bg grey66 -command myExit
pack .noteOn.on -side left -padx 5
pack .noteOn.off -side left -padx 5 -pady 10
pack .noteOn.exit -side left -padx 5 -pady 10
pack .noteOn -pady 10
bind all <KeyPress> {
noteOn $pitch $press
}
# Bind an X windows "close" event with the Exit routine
bind . <Destroy> +myExit
# Socket connection procedure
set d .socketdialog
proc setComm {} {
global outID
global commtype
global d
if {$commtype == "stdout"} {
if { [string compare "stdout" $outID] } {
set i [tk_dialog .dialog "Break Socket Connection?" {You are about to break an existing socket connection ... is this what you want to do?} "" 0 Cancel OK]
switch $i {
0 {set commtype "socket"}
1 {close $outID
set outID "stdout"}
}
}
} elseif { ![string compare "stdout" $outID] } {
set sockport 2001
set sockhost localhost
toplevel $d
wm title $d "STK Client Socket Connection"
wm resizable $d 0 0
grab $d
label $d.message -text "Specify a socket host and port number below (if different than the STK defaults shown) and then click the \"Connect\" button to invoke a socket-client connection attempt to the STK socket server." \
-background white -font {Helvetica 10 bold} \
-wraplength 3i -justify left
frame $d.sockhost
entry $d.sockhost.entry -width 15
label $d.sockhost.text -text "Socket Host:" \
-font {Helvetica 10 bold}
frame $d.sockport
entry $d.sockport.entry -width 15
label $d.sockport.text -text "Socket Port:" \
-font {Helvetica 10 bold}
pack $d.message -side top -padx 5 -pady 10
pack $d.sockhost.text -side left -padx 1 -pady 2
pack $d.sockhost.entry -side right -padx 5 -pady 2
pack $d.sockhost -side top -padx 5 -pady 2
pack $d.sockport.text -side left -padx 1 -pady 2
pack $d.sockport.entry -side right -padx 5 -pady 2
pack $d.sockport -side top -padx 5 -pady 2
$d.sockhost.entry insert 0 $sockhost
$d.sockport.entry insert 0 $sockport
frame $d.buttons
button $d.buttons.cancel -text "Cancel" -bg grey66 \
-command { set commtype "stdout"
set outID "stdout"
destroy $d }
button $d.buttons.connect -text "Connect" -bg grey66 \
-command {
set sockhost [$d.sockhost.entry get]
set sockport [$d.sockport.entry get]
set err [catch {socket $sockhost $sockport} outID]
if {$err == 0} {
destroy $d
} else {
tk_dialog $d.error "Socket Error" {Error: Unable to make socket connection. Make sure the STK socket server is first running and that the port number is correct.} "" 0 OK
} }
pack $d.buttons.cancel -side left -padx 5 -pady 10
pack $d.buttons.connect -side right -padx 5 -pady 10
pack $d.buttons -side bottom -padx 5 -pady 10
}
}

View File

@@ -31,115 +31,146 @@ menu .menu.communication -tearoff 0
.menu.communication add radio -label "Socket" -variable commtype \
-value "socket" -command { setComm }
# Configure instrument change menu
# Configure instrument change menu. Use a unique number for each
# voice. The STK program change value is found by dividing by 100,
# while the remainder corresponds to within-class preset values.
menu .menu.instrument -tearoff 0
.menu add cascade -label "Instrument" -menu .menu.instrument \
.menu add cascade -label "Instruments" -menu .menu.instrument \
-underline 0
.menu.instrument add radio -label "Clarinet" -variable patchnum \
-value 0 -command { patchChange $patchnum }
.menu.instrument add radio -label "BlowHole" -variable patchnum \
-value 1 -command { patchChange $patchnum }
-value 100 -command { patchChange $patchnum }
.menu.instrument add radio -label "Saxofony" -variable patchnum \
-value 2 -command { patchChange $patchnum }
-value 200 -command { patchChange $patchnum }
.menu.instrument add radio -label "Flute" -variable patchnum \
-value 3 -command { patchChange $patchnum }
-value 300 -command { patchChange $patchnum }
.menu.instrument add radio -label "Brass" -variable patchnum \
-value 4 -command { patchChange $patchnum }
-value 400 -command { patchChange $patchnum }
.menu.instrument add radio -label "Blown Bottle" -variable patchnum \
-value 5 -command { patchChange $patchnum }
-value 500 -command { patchChange $patchnum }
.menu.instrument add radio -label "Bowed String" -variable patchnum \
-value 6 -command { patchChange $patchnum }
-value 600 -command { patchChange $patchnum }
.menu.instrument add radio -label "Plucked String" -variable patchnum \
-value 7 -command { patchChange $patchnum }
-value 700 -command { patchChange $patchnum }
.menu.instrument add radio -label "Stiff String" -variable patchnum \
-value 8 -command { patchChange $patchnum }
-value 800 -command { patchChange $patchnum }
.menu.instrument add radio -label "Sitar" -variable patchnum \
-value 9 -command { patchChange $patchnum }
-value 900 -command { patchChange $patchnum }
.menu.instrument add radio -label "Mandolin" -variable patchnum \
-value 10 -command { patchChange $patchnum }
-value 1000 -command { patchChange $patchnum }
.menu.instrument add radio -label "Rhodey" -variable patchnum \
-value 11 -command { patchChange $patchnum }
-value 1100 -command { patchChange $patchnum }
.menu.instrument add radio -label "Wurley" -variable patchnum \
-value 12 -command { patchChange $patchnum }
-value 1200 -command { patchChange $patchnum }
.menu.instrument add radio -label "Tubular Bell" -variable patchnum \
-value 13 -command { patchChange $patchnum }
-value 1300 -command { patchChange $patchnum }
.menu.instrument add radio -label "Heavy Metal" -variable patchnum \
-value 14 -command { patchChange $patchnum }
-value 1400 -command { patchChange $patchnum }
.menu.instrument add radio -label "Percussive Flute" -variable patchnum \
-value 15 -command { patchChange $patchnum }
-value 1500 -command { patchChange $patchnum }
.menu.instrument add radio -label "B3 Organ" -variable patchnum \
-value 16 -command { patchChange $patchnum }
.menu.instrument add radio -label "FM Voices" -variable patchnum \
-value 17 -command { patchChange $patchnum }
-value 1600 -command { patchChange $patchnum }
.menu.instrument add radio -label "FM Voice" -variable patchnum \
-value 1700 -command { patchChange $patchnum }
.menu.instrument add radio -label "Formant Voice" -variable patchnum \
-value 1800 -command { patchChange $patchnum }
.menu.instrument add radio -label "Moog" -variable patchnum \
-value 18 -command { patchChange $patchnum }
-value 1900 -command { patchChange $patchnum }
.menu.instrument add radio -label "Simple" -variable patchnum \
-value 19 -command { patchChange $patchnum }
-value 2000 -command { patchChange $patchnum }
.menu.instrument add radio -label "Drum Kit" -variable patchnum \
-value 20 -command { patchChange $patchnum }
-value 2100 -command { patchChange $patchnum }
.menu.instrument add radio -label "Banded Bar" -variable patchnum \
-value 21 -command { patchChange $patchnum }
-value 2200 -command { patchChange $patchnum }
.menu.instrument add radio -label "Banded Marimba" -variable patchnum \
-value 22 -command { patchChange $patchnum }
-value 2201 -command { patchChange $patchnum }
.menu.instrument add radio -label "Banded Glass" -variable patchnum \
-value 23 -command { patchChange $patchnum }
-value 2202 -command { patchChange $patchnum }
.menu.instrument add radio -label "Banded Bowl" -variable patchnum \
-value 24 -command { patchChange $patchnum }
-value 2203 -command { patchChange $patchnum }
.menu.instrument add radio -label "Maraca" -variable patchnum \
-value 25 -command { patchChange $patchnum }
.menu.instrument add radio -label "Sekere" -variable patchnum \
-value 26 -command { patchChange $patchnum }
-value 2300 -command { patchChange $patchnum }
.menu.instrument add radio -label "Cabasa" -variable patchnum \
-value 27 -command { patchChange $patchnum }
.menu.instrument add radio -label "Bamboo" -variable patchnum \
-value 28 -command { patchChange $patchnum }
.menu.instrument add radio -label "Waterdrop" -variable patchnum \
-value 29 -command { patchChange $patchnum }
.menu.instrument add radio -label "Tambourine" -variable patchnum \
-value 30 -command { patchChange $patchnum }
.menu.instrument add radio -label "Sleigh Bell" -variable patchnum \
-value 31 -command { patchChange $patchnum }
-value 2301 -command { patchChange $patchnum }
.menu.instrument add radio -label "Sekere" -variable patchnum \
-value 2302 -command { patchChange $patchnum }
.menu.instrument add radio -label "Guiro" -variable patchnum \
-value 32 -command { patchChange $patchnum }
-value 2303 -command { patchChange $patchnum }
.menu.instrument add radio -label "Waterdrop" -variable patchnum \
-value 2304 -command { patchChange $patchnum }
.menu.instrument add radio -label "Bamboo" -variable patchnum \
-value 2305 -command { patchChange $patchnum } \
-columnbreak 1
.menu.instrument add radio -label "Tambourine" -variable patchnum \
-value 2306 -command { patchChange $patchnum }
.menu.instrument add radio -label "Sleigh Bell" -variable patchnum \
-value 2307 -command { patchChange $patchnum }
.menu.instrument add radio -label "Sticks" -variable patchnum \
-value 33 -command { patchChange $patchnum }
-value 2308 -command { patchChange $patchnum }
.menu.instrument add radio -label "Crunch" -variable patchnum \
-value 34 -command { patchChange $patchnum }
-value 2309 -command { patchChange $patchnum }
.menu.instrument add radio -label "Wrench" -variable patchnum \
-value 35 -command { patchChange $patchnum }
-value 2310 -command { patchChange $patchnum }
.menu.instrument add radio -label "SandPaper" -variable patchnum \
-value 36 -command { patchChange $patchnum }
-value 2311 -command { patchChange $patchnum }
.menu.instrument add radio -label "CokeCan" -variable patchnum \
-value 37 -command { patchChange $patchnum }
-value 2312 -command { patchChange $patchnum }
.menu.instrument add radio -label "NeXT Mug" -variable patchnum \
-value 2313 -command { patchChange $patchnum }
.menu.instrument add radio -label "Mug & Penny" -variable patchnum \
-value 2314 -command { patchChange $patchnum }
.menu.instrument add radio -label "Mug & Nickle" -variable patchnum \
-value 2315 -command { patchChange $patchnum }
.menu.instrument add radio -label "Mug & Dime" -variable patchnum \
-value 2316 -command { patchChange $patchnum }
.menu.instrument add radio -label "Mug & Quarter" -variable patchnum \
-value 2317 -command { patchChange $patchnum }
.menu.instrument add radio -label "Mug & Franc" -variable patchnum \
-value 2318 -command { patchChange $patchnum }
.menu.instrument add radio -label "Mug & Peso" -variable patchnum \
-value 2319 -command { patchChange $patchnum }
.menu.instrument add radio -label "Big Rocks" -variable patchnum \
-value 2320 -command { patchChange $patchnum }
.menu.instrument add radio -label "Little Rocks" -variable patchnum \
-value 2321 -command { patchChange $patchnum }
.menu.instrument add radio -label "Tuned Bamboo" -variable patchnum \
-value 2322 -command { patchChange $patchnum }
.menu.instrument add radio -label "Marimba" -variable patchnum \
-value 38 -command { patchChange $patchnum }
-value 2400 -command { patchChange $patchnum }
.menu.instrument add radio -label "Vibraphone" -variable patchnum \
-value 39 -command { patchChange $patchnum }
-value 2401 -command { patchChange $patchnum }
.menu.instrument add radio -label "Agogo Bell" -variable patchnum \
-value 40 -command { patchChange $patchnum }
-value 2402 -command { patchChange $patchnum }
.menu.instrument add radio -label "Wood 1" -variable patchnum \
-value 41 -command { patchChange $patchnum }
-value 2403 -command { patchChange $patchnum }
.menu.instrument add radio -label "Reso" -variable patchnum \
-value 42 -command { patchChange $patchnum }
-value 2404 -command { patchChange $patchnum }
.menu.instrument add radio -label "Wood 2" -variable patchnum \
-value 43 -command { patchChange $patchnum }
-value 2405 -command { patchChange $patchnum }
.menu.instrument add radio -label "Beats" -variable patchnum \
-value 44 -command { patchChange $patchnum }
-value 2406 -command { patchChange $patchnum }
.menu.instrument add radio -label "Two Fixed" -variable patchnum \
-value 2407 -command { patchChange $patchnum }
.menu.instrument add radio -label "Clump" -variable patchnum \
-value 2408 -command { patchChange $patchnum }
.menu.instrument add radio -label "2D Mesh" -variable patchnum \
-value 45 -command { patchChange $patchnum }
-value 2500 -command { patchChange $patchnum }
.menu.instrument add radio -label "Resonate" -variable patchnum \
-value 46 -command { patchChange $patchnum }
-value 2600 -command { patchChange $patchnum }
.menu.instrument add radio -label "Police Whistle" -variable patchnum \
-value 2700 -command { patchChange $patchnum }
. configure -menu .menu
# Configure message box
label .note -font {Times 10 normal} -background white \
-foreground darkred -relief raised -height 3 \
label .note -font {Times 12 normal} -background white \
-foreground darkred -relief raised \
-wraplength 300 -width 60 \
-text "Select instruments using the menu above. Impulsively excited instruments can be plucked/struck using the NoteOn button or the spacebar."
pack .note -padx 5 -pady 10
# Configure bitmap display
if {[file isdirectory bitmaps]} {
set bitmappath bitmaps
@@ -249,33 +280,13 @@ proc noteOff {pitchVal pressVal} {
proc patchChange {value} {
global outID bitmappath cont1 cont2 cont4 cont11 oldpatch press pitch temp
if {$value!=$oldpatch} {
if {$value < 21} {
puts $outID [format "ProgramChange 0.0 1 %2i" $value]
set program [expr $value / 100]
puts $outID [format "ProgramChange 0.0 1 %2i" $program]
flush $outID
}
if {($value > 20 && $value < 25) && ($oldpatch < 21 || $oldpatch > 24)} {
puts $outID [format "ProgramChange 0.0 1 21" $value]
flush $outID
}
if {($value > 24 && $value < 38) && ($oldpatch < 25 || $oldpatch > 37)} {
puts $outID [format "ProgramChange 0.0 1 22"]
flush $outID
}
if {($value > 37 && $value < 45) && ($oldpatch < 38 || $oldpatch > 44)} {
puts $outID [format "ProgramChange 0.0 1 23"]
flush $outID
}
if {$value == 45} {
puts $outID [format "ProgramChange 0.0 1 24"]
flush $outID
}
if {$value == 46} {
puts $outID [format "ProgramChange 0.0 1 25"]
flush $outID
}
# This stuff below sets up the correct bitmaps, slider labels, and control
# parameters.
if {$value==0} { # Clarinet
if {$program==0} { # Clarinet
.pretty config -bitmap @$bitmappath/Klar.xbm
.left.bPressure config -state normal -label "Breath Pressure"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -292,7 +303,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
}
if {$value==1} { # BlowHole
if {$program==1} { # BlowHole
.pretty config -bitmap @$bitmappath/Klar.xbm
.left.bPressure config -state normal -label "Breath Pressure"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -309,7 +320,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
}
if {$value==2} { # Saxofony
if {$program==2} { # Saxofony
.pretty config -bitmap @$bitmappath/prcFunny.xbm
.left.bPressure config -state normal -label "Breath Pressure"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -326,7 +337,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
}
if {$value==3} { # Flute
if {$program==3} { # Flute
.pretty config -bitmap @$bitmappath/KFloot.xbm
.left.bPressure config -state normal -label "Breath Pressure"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -343,7 +354,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
}
if {$value==4} { # Brass
if {$program==4} { # Brass
.pretty config -bitmap @$bitmappath/KHose.xbm
.left.bPressure config -state normal -label "Breath Pressure"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -362,7 +373,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 11 $cont11
puts $outID [format "NoteOn 0.0 1 %3.2f %3.2f" $pitch $press]
}
if {$value==5} { # Bottle
if {$program==5} { # Bottle
.pretty config -bitmap @$bitmappath/prcFunny.xbm
.left.bPressure config -state normal -label "Breath Pressure"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -377,7 +388,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
}
if {$value==6} { # Bowed String
if {$program==6} { # Bowed String
.pretty config -bitmap @$bitmappath/KFiddl.xbm
.left.bPressure config -state normal -label "Volume"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -394,7 +405,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
}
if {$value==7} { # Yer Basic Pluck
if {$program==7} { # Yer Basic Pluck
.pretty config -bitmap @$bitmappath/KPluk.xbm
.left.bPressure config -state normal -label "Pluck Strength"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -403,7 +414,7 @@ proc patchChange {value} {
.right.cont11 config -state disabled -label "Disabled"
.right.cont1 config -state disabled -label "Disabled"
}
if {$value==8} { # Stiff String
if {$program==8} { # Stiff String
.pretty config -bitmap @$bitmappath/KPluk.xbm
.left.bPressure config -state normal -label "Pluck Strength"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -418,7 +429,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
}
if {$value==9} { # Sitar
if {$program==9} { # Sitar
.pretty config -bitmap @$bitmappath/KPluk.xbm
.left.bPressure config -state normal -label "Pluck Strength"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -427,7 +438,7 @@ proc patchChange {value} {
.right.cont11 config -state disabled -label "Disabled"
.right.cont1 config -state disabled -label "Disabled"
}
if {$value==10} { # Mandolin
if {$program==10} { # Mandolin
.pretty config -bitmap @$bitmappath/KPluk.xbm
.left.bPressure config -state normal -label "Microphone Position and Gain"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -446,7 +457,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 11 $cont11
changePress $press
}
if {$value>=11 && $value <=16} { # FM Instruments
if {$program>=11 && $program <=16} { # FM Instruments
.pretty config -bitmap @$bitmappath/KFMod.xbm
.left.bPressure config -state normal -label "ADSR 2 and 4 Targets"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -455,16 +466,23 @@ proc patchChange {value} {
.right.cont11 config -state normal -label "Vibrato Rate"
.right.cont1 config -state normal -label "Vibrato Amount"
}
if {$value==17} { # FM Voices
if {$program>=17 && $program <=18} { # FM Voices or Voice Formants
.pretty config -bitmap @$bitmappath/KVoiceFM.xbm
.left.bPressure config -state normal -label "Loudness (Spectral Tilt)"
.left.pitch config -state normal -label "MIDI Note Number"
.left.cont2 config -state normal -label "Formant Q"
.right.cont4 config -state normal -label "Vowel (Bass, Tenor, Alto, Sop.)"
.right.cont11 config -state normal -label "Vibrato Rate"
.right.cont1 config -state normal -label "Vibrato Amount"
if {$program == 17} {
.left.cont2 config -state normal -label "Formant Q"
}
if {$value==18} { # Moog
if {$program == 18} {
.left.cont2 config -state normal -label "Voiced/Unvoiced Mix"
}
set cont1 26.0
printWhatz "ControlChange 0.0 1 " 1 $cont1
}
if {$program==19} { # Moog
.pretty config -bitmap @$bitmappath/prcFunny.xbm
.left.bPressure config -state normal -label "Volume"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -477,7 +495,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
}
if {$value==19} { # Simple
if {$program==20} { # Simple
.pretty config -bitmap @$bitmappath/prcFunny.xbm
.left.bPressure config -state normal -label "Volume"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -491,7 +509,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
}
if {$value==20} { # Drum Kit
if {$program==21} { # Drum Kit
# Given the vastly different interface for the Drum Kit, we open
# a new GUI popup window with the appropriate controls and lock
# focus there until the user hits the "Close" button. We then
@@ -560,7 +578,7 @@ proc patchChange {value} {
patchChange $patchnum}
pack $p.close -side bottom -padx 5 -pady 10
}
if {$value>=21 && $value<=24 } { # Banded Waveguide Instruments
if {$program==22} { # Banded Waveguide Instruments
.pretty config -bitmap @$bitmappath/prcFunny.xbm
.left.bPressure config -state normal -label "Strike/Bow Velocity"
.left.pitch config -state normal -label "MIDI Note Number"
@@ -568,12 +586,7 @@ proc patchChange {value} {
.right.cont4 config -state normal -label "Bow Motion"
.right.cont11 config -state normal -label "Integration Control"
.right.cont1 config -state normal -label "Mode Resonance"
switch $value {
21 {set preset 0}
22 {set preset 1}
23 {set preset 2}
24 {set preset 3}
}
set preset [expr $value-2200]
set press 100.0
set cont1 127.0
set cont2 0.0
@@ -586,7 +599,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 11 $cont11
flush $outID
}
if {$value>=25 && $value <=37} { # Shakers
if {$program==23} { # Shakers
.pretty config -bitmap @$bitmappath/phism.xbm
.left.bPressure config -state normal -label "Shake Energy"
.left.pitch config -state disabled -label "Disabled"
@@ -594,41 +607,35 @@ proc patchChange {value} {
.right.cont4 config -state normal -label "Number of Objects"
.right.cont11 config -state normal -label "(<--High) Damping (Low-->)"
.right.cont1 config -state normal -label "Resonance Center Frequency"
switch $value {
25 {
set pitch 0
set pitch [expr $value-2300]
switch $pitch {
0 {
.pretty config -bitmap @$bitmappath/maraca.xbm
}
26 {set pitch 2}
27 {
set pitch 1
1 {
.pretty config -bitmap @$bitmappath/cabasa.xbm
}
28 {
set pitch 5
.pretty config -bitmap @$bitmappath/bamboo.xbm
}
29 {set pitch 4}
30 {
set pitch 6
.pretty config -bitmap @$bitmappath/tambourine.xbm
}
31 {
set pitch 7
.pretty config -bitmap @$bitmappath/sleighbell.xbm
}
32 {
set pitch 3
3 {
.pretty config -bitmap @$bitmappath/guiro.xbm
}
33 {set pitch 8}
34 {set pitch 9}
35 {
set pitch 10
5 {
.pretty config -bitmap @$bitmappath/bamboo.xbm
}
6 {
.pretty config -bitmap @$bitmappath/tambourine.xbm
}
7 {
.pretty config -bitmap @$bitmappath/sleighbell.xbm
}
10 {
.pretty config -bitmap @$bitmappath/rachet.xbm
}
36 {set pitch 11}
37 {set pitch 12}
12 {
.pretty config -bitmap @$bitmappath/cokecan.xbm
}
22 {
.pretty config -bitmap @$bitmappath/bamboo.xbm
}
}
set cont1 64.0
set cont2 64.0
@@ -641,27 +648,19 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 11 $cont11
flush $outID
}
if {$value>=38 && $value<=44 } { # Modal Instruments
if {$program==24} { # Modal Instruments
.pretty config -bitmap @$bitmappath/KModal.xbm
.left.bPressure config -state normal -label "Strike Vigor"
.left.pitch config -state normal -label "MIDI Note Number"
.left.cont2 config -state normal -label "Stick Hardness"
.right.cont4 config -state normal -label "Stick Position"
if {$value == 39} {
set preset [expr $value-2400]
if {$preset == 1} {
.right.cont11 config -state normal -label "Vibrato Gain"
} else {
.right.cont11 config -state disabled -label "Disabled"
}
.right.cont1 config -state normal -label "Direct Stick Mix"
switch $value {
38 {set preset 0}
39 {set preset 1}
40 {set preset 2}
41 {set preset 3}
42 {set preset 4}
43 {set preset 5}
44 {set preset 6}
}
set cont1 20.0
set cont2 64.0
set cont4 64.0
@@ -673,7 +672,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 11 $cont11
flush $outID
}
if { $value==45 } { # Mesh2D
if { $program==25 } { # Mesh2D
.pretty config -bitmap @$bitmappath/prcFunny.xbm
.left.bPressure config -state normal -label "Strike Vigor"
.left.pitch config -state disabled -label "Disabled"
@@ -691,7 +690,7 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 11 $cont11
flush $outID
}
if { $value==46 } { # Resonate
if { $program==26 } { # Resonate
.pretty config -bitmap @$bitmappath/prcFunny.xbm
.left.bPressure config -state normal -label "Gain"
.left.pitch config -state disabled -label "Disabled"
@@ -709,6 +708,24 @@ proc patchChange {value} {
printWhatz "ControlChange 0.0 1 " 2 $cont2
flush $outID
}
if { $program==27 } { # Whistle
.pretty config -bitmap @$bitmappath/prcFunny.xbm
.left.bPressure config -state normal -label "Gain"
.left.pitch config -state normal -label "Whistle Pitch"
.left.cont2 config -state normal -label "Blowing Modulation"
.right.cont4 config -state normal -label "Noise Gain"
.right.cont11 config -state normal -label "Fipple Frequency Modulation"
.right.cont1 config -state normal -label "Fipple Gain Modulation"
set cont2 64.0
set cont4 40.0
set cont11 64.0
set cont1 64.0
printWhatz "ControlChange 0.0 1 " 4 $cont4
printWhatz "ControlChange 0.0 1 " 11 $cont11
printWhatz "ControlChange 0.0 1 " 1 $cont1
printWhatz "ControlChange 0.0 1 " 2 $cont2
flush $outID
}
set oldpatch $value
}
}
@@ -735,7 +752,7 @@ proc printWhatz {tag value1 value2 } {
proc changePress {value} {
global outID patchnum
if { $patchnum<7 || $patchnum>9 } {
if { $patchnum<700 || $patchnum>900 } {
puts $outID [format "AfterTouch 0.0 1 %3.2f" $value]
flush $outID
}
@@ -743,7 +760,7 @@ proc changePress {value} {
proc changePitch {value} {
global outID
puts $outID [format "PitchBend 0.0 1 %3.2f" $value]
puts $outID [format "PitchChange 0.0 1 %3.2f" $value]
flush $outID
}

View File

@@ -10,7 +10,7 @@ set commtype "stdout"
set preset 0
# Configure main window
wm title . "STK Modal Bar GUI"
wm title . "STK Modal Bar Interface"
wm iconname . "modal"
. config -bg black
@@ -194,7 +194,7 @@ proc changePress {value} {
proc changePitch {value} {
global outID
puts $outID [format "PitchBend 0.0 1 %3.2f" $value]
puts $outID [format "PitchChange 0.0 1 %3.2f" $value]
flush $outID
}

View File

@@ -374,7 +374,7 @@ proc changePress {value} {
proc changePitch {value} {
global outID
puts $outID [format "PitchBend 0.0 1 %.3f" $value]
puts $outID [format "PitchChange 0.0 1 %.3f" $value]
flush $outID
}

View File

@@ -209,6 +209,8 @@ proc changePress {value} {
flush $outID
}
eval patchChange $patchnum
# Socket connection procedure
set d .socketdialog

View File

@@ -9,7 +9,7 @@ set cont4 64.0
set cont11 64.0
set outID "stdout"
set commtype "stdout"
set patchnum 16
set patchnum 17
# Configure main window
wm title . "STK Voice Model Controller"
@@ -31,9 +31,9 @@ menu .menu.communication -tearoff 0
frame .instChoice -bg black
radiobutton .instChoice.fm -text "FMVoice" -bg grey66 \
-command { patchChange 14 } -value 14 -variable patchnum
-command { patchChange 17 } -value 17 -variable patchnum
radiobutton .instChoice.form -text "Formant" -bg grey66 \
-command { patchChange 15 } -value 15 -variable patchnum
-command { patchChange 18 } -value 18 -variable patchnum
pack .instChoice.fm -side left -padx 5
pack .instChoice.form -side left -padx 5 -pady 10
@@ -46,9 +46,8 @@ if {[file isdirectory bitmaps]} {
} else {
set bitmappath tcl/bitmaps
}
button .pretty -bitmap @$bitmappath/prcFunny.xbm \
button .pretty -bitmap @$bitmappath/KVoiceFM.xbm \
-background white -foreground black
.pretty config -bitmap @$bitmappath/prc.xbm
pack .pretty -padx 5 -pady 10
# Configure "note-on" buttons
@@ -115,8 +114,7 @@ pack .right -side right
bind . <Destroy> +myExit
proc myExit {} {
global pitch
global outID
global pitch outID
puts $outID [format "ExitProgram"]
flush $outID
close $outID
@@ -125,24 +123,19 @@ proc myExit {} {
proc noteOn {pitchVal pressVal} {
global outID
puts $outID [format "NoteOn -1.0 1 %f %f" $pitchVal $pressVal]
puts $outID [format "NoteOn 0.0 1 %f %f" $pitchVal $pressVal]
flush $outID
}
proc noteOff {pitchVal pressVal} {
global outID
puts $outID [format "NoteOff -1.0 1 %f %f" $pitchVal $pressVal]
puts $outID [format "NoteOff 0.0 1 %f %f" $pitchVal $pressVal]
flush $outID
}
proc patchChange {value} {
global outID
global bitmappath
global cont1
global cont2
global cont4
global cont11
puts $outID [format "ProgramChange -1.0 1 %i" $value]
global outID bitmappath cont1 cont2 cont4 cont11
puts $outID [format "ProgramChange 0.0 1 %i" $value]
if {$value==16} {
.pretty config -bitmap @$bitmappath/KVoiceFM.xbm
}
@@ -164,13 +157,13 @@ proc printWhatz {tag value1 value2 } {
proc changePress {value} {
global outID
puts $outID [format "AfterTouch -1.0 1 %f" $value]
puts $outID [format "AfterTouch 0.0 1 %f" $value]
flush $outID
}
proc changePitch {value} {
global outID
puts $outID [format "PitchBend -1.0 1 %.3f" $value]
puts $outID [format "PitchChange 0.0 1 %.3f" $value]
flush $outID
}

View File

@@ -0,0 +1,71 @@
#define cokecan_width 62
#define cokecan_height 126
static char cokecan_bits[] = {
0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
0xc1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xc0,0xff,0x02,0x00,0x00,0xea,
0xff,0xc1,0xc0,0x2b,0xa9,0x94,0x55,0xb5,0xfe,0xc0,0xc0,0xd5,0x02,0x00,0x80,
0x54,0xfb,0xc0,0x60,0x4b,0x09,0x21,0x5a,0xaf,0xfd,0xc1,0xe0,0x55,0x45,0x04,
0xa9,0xa4,0xee,0xc1,0xf0,0x96,0x90,0x4a,0xa4,0xda,0xfa,0xc3,0xb0,0x49,0x04,
0x11,0x4a,0x51,0xed,0xc3,0xf0,0x96,0x42,0x44,0xaa,0xac,0xfd,0xc3,0xb8,0x6b,
0x12,0x05,0x80,0xf2,0xee,0xc7,0xfc,0xbd,0x81,0x10,0xa5,0xa8,0xfb,0xc7,0xfc,
0xb7,0x24,0x42,0x00,0xf5,0xef,0xcf,0xfe,0xff,0x02,0x00,0x48,0xa0,0xff,0xdf,
0x7e,0x6f,0x01,0x00,0x00,0x55,0xff,0xdf,0xff,0xbd,0x02,0x02,0x22,0xc0,0xff,
0xff,0xff,0x77,0x00,0x00,0x00,0xaa,0xfe,0xff,0xdf,0x9f,0xfc,0xb7,0xdb,0xaf,
0xbd,0xff,0xff,0x36,0x14,0x88,0x94,0x8a,0xfe,0xfe,0xff,0x2f,0xf4,0xef,0xfa,
0x4f,0xfd,0xff,0xef,0x9d,0x04,0x00,0x02,0xa9,0xff,0xff,0xbf,0x2f,0x00,0x60,
0x08,0xa8,0xf6,0xff,0xff,0x56,0x40,0xdc,0x23,0x42,0xff,0xff,0xff,0xbb,0x04,
0x6c,0x83,0xa8,0xfa,0xff,0xff,0x4f,0x10,0xe8,0x23,0x44,0xdf,0xff,0xff,0x3f,
0x00,0x00,0x00,0xa1,0xff,0xff,0xbf,0x55,0xf6,0xb5,0xbd,0x57,0xfd,0xff,0xfb,
0x1f,0xda,0xbf,0xad,0xa7,0xff,0xff,0xff,0x2e,0x5a,0xf7,0xbf,0xcd,0xfe,0xfd,
0xff,0x27,0x10,0x09,0xa4,0x56,0xef,0xff,0xdf,0x55,0x00,0x00,0x00,0x40,0x7f,
0xff,0xff,0x0f,0x01,0x00,0x20,0xd5,0xfe,0xff,0xff,0x29,0x00,0xe8,0x07,0x50,
0xff,0xff,0x7f,0x57,0x08,0xbb,0x12,0xc5,0xfb,0xff,0xf7,0xaf,0xc0,0x80,0x48,
0x50,0xbf,0xff,0xff,0x9d,0x60,0xfc,0x63,0xd5,0xfe,0xff,0xff,0xbf,0x18,0xa3,
0x4e,0xa0,0xff,0xff,0xbf,0xab,0xd0,0xfc,0xbf,0x75,0xfb,0xff,0xff,0x5f,0x2c,
0xdf,0xb6,0xd2,0xef,0xff,0xfb,0xbf,0x94,0x6a,0xfb,0xb6,0xbf,0xff,0xdf,0x55,
0xb2,0xfb,0xde,0xd6,0xff,0xff,0xff,0x3f,0x6a,0xc9,0xf6,0xed,0xff,0xff,0xff,
0x6e,0xf3,0xff,0xb7,0xb5,0xfd,0xff,0xff,0xbb,0x1c,0xfd,0x71,0xd5,0xff,0xff,
0xdf,0x5f,0xdc,0x7f,0x1c,0xb3,0xff,0xff,0xff,0xad,0x64,0x40,0xdf,0xeb,0xdb,
0xff,0xff,0xbf,0x04,0xba,0x6b,0x67,0xff,0xff,0xef,0x57,0x54,0x9f,0xa2,0xa3,
0xff,0xff,0x7f,0xbd,0x94,0x93,0x91,0xcb,0xff,0xfd,0xff,0x5f,0x04,0x10,0x05,
0x52,0xfd,0xff,0xff,0xb7,0xec,0xff,0xff,0x8b,0xef,0xff,0xbb,0x5d,0xf1,0x98,
0xb1,0xd1,0xfe,0xff,0xff,0xf7,0xda,0xe2,0xf7,0x49,0xff,0xfd,0xff,0x3e,0x79,
0x6b,0xf4,0xd1,0xfd,0xff,0xff,0xb7,0xe1,0x99,0x71,0x44,0xff,0xfe,0xef,0xff,
0xa0,0x9a,0xdd,0x68,0xf7,0xff,0x7f,0xaf,0xc0,0xff,0x3f,0xc4,0xff,0xfe,0xff,
0xbb,0x80,0xfd,0x3b,0xa1,0xfe,0xff,0xff,0x7f,0x04,0xee,0x0f,0x54,0xdf,0xff,
0xff,0x17,0x80,0x12,0x48,0x80,0xfe,0xfe,0x6f,0x5f,0x00,0x06,0x0e,0x2a,0xfb,
0xff,0xff,0x5b,0x00,0x28,0x01,0x90,0xde,0xff,0xff,0x5f,0x02,0x00,0x90,0x44,
0xfb,0xff,0xff,0x57,0x08,0x00,0x00,0xa1,0xfe,0xff,0x7d,0x6f,0x40,0x82,0x20,
0x94,0xfb,0xff,0xef,0xb7,0xb8,0xff,0xfe,0xc1,0xfe,0xff,0xff,0xaf,0xf0,0x7f,
0xd2,0x69,0xdf,0xff,0xbf,0xbb,0xf8,0xaf,0xee,0xa4,0xfd,0xff,0xff,0x5f,0x01,
0x00,0x00,0xd8,0xff,0xff,0xff,0xb7,0x01,0x00,0x00,0xb6,0xfe,0xff,0xff,0xdd,
0x04,0x00,0x00,0xfa,0xf7,0xff,0x6f,0x7f,0x57,0x55,0xa1,0xd5,0xbf,0xfb,0xff,
0xab,0xa9,0xaa,0x8a,0xfe,0xfe,0xff,0xff,0xff,0x57,0xb5,0xf5,0xf6,0xff,0xff,
0xff,0xbd,0xde,0xd6,0x56,0xbf,0xff,0xfb,0xff,0xef,0xb7,0x7f,0xff,0xfb,0xfb,
0xff,0xf7,0x7f,0xe5,0xd5,0x05,0x4e,0xff,0xfb,0xbf,0xed,0x5b,0xff,0x57,0xb8,
0xff,0xff,0xff,0xff,0xf4,0x6d,0xf9,0xcd,0xef,0xff,0xff,0xb6,0xac,0x56,0xdd,
0xeb,0xfe,0xfb,0xff,0x7f,0x3a,0xab,0xa4,0xf3,0xff,0xff,0xef,0x57,0xb3,0x6b,
0xfe,0xfd,0xff,0xff,0xff,0x3d,0x8b,0x74,0xb3,0x4a,0xf7,0xfb,0xfd,0x3f,0x59,
0x20,0xdd,0xd6,0xff,0xff,0xf7,0x36,0x99,0x90,0x09,0x6e,0xff,0xff,0xdf,0x3f,
0x7f,0x3f,0x7f,0xf9,0xff,0xff,0xff,0x2e,0x0b,0x98,0x65,0xe9,0xfb,0xfb,0xff,
0xfb,0xfc,0x65,0x6e,0xf2,0xdf,0xff,0xff,0xbf,0xf7,0xde,0xfd,0x7f,0xff,0xff,
0xff,0xef,0xad,0x6a,0xa7,0xfe,0xff,0xfb,0xbf,0x7d,0x7f,0xaa,0xa8,0xdb,0xff,
0xff,0xff,0xef,0xad,0xb5,0xff,0xff,0xfd,0xff,0xff,0xbf,0xff,0xff,0x6a,0xff,
0xf7,0xfb,0x7f,0xfb,0xb5,0xad,0xff,0xdb,0xff,0xfe,0xef,0x6f,0x7f,0xff,0xdb,
0xfe,0xff,0xff,0xbf,0xff,0xeb,0x20,0xea,0x3b,0xfd,0xfb,0xff,0xfb,0xbd,0xdf,
0x57,0x4f,0xff,0xff,0x7f,0x0f,0xf6,0xd6,0xee,0xf5,0xf5,0xff,0xff,0xbf,0x5d,
0xfd,0xdd,0x9b,0x7a,0xf5,0xff,0x66,0xfd,0x73,0xdf,0x75,0xff,0xff,0xff,0xff,
0xdb,0xaa,0x60,0xaf,0xfa,0xff,0xef,0x5b,0x77,0x29,0xdc,0xcb,0xfe,0xfe,0x7f,
0xb7,0xdc,0x43,0xe9,0x2d,0xfe,0xff,0xff,0x8b,0x75,0xff,0xa7,0xc7,0xff,0xfb,
0xff,0xf3,0xf6,0xd8,0xfe,0x6b,0xf3,0xff,0x7f,0x5f,0xdb,0x22,0xc5,0xf6,0xff,
0xfe,0xfb,0x5f,0x7b,0xef,0xf7,0xeb,0xf9,0xff,0xff,0xf6,0xed,0xfe,0xdf,0x4f,
0xfd,0xfd,0xff,0xef,0xfe,0xa2,0x6a,0xaf,0xfe,0xff,0xdf,0xff,0xaf,0xff,0xfd,
0xff,0xff,0xff,0xff,0x7b,0xfb,0x5d,0x6f,0xfb,0xf7,0xfa,0x7f,0xef,0x6f,0xf7,
0xfd,0xdf,0xff,0xff,0xff,0xbf,0xdf,0xbd,0xf7,0x7f,0xff,0xff,0xfb,0xff,0xfa,
0xf7,0xde,0xfe,0xff,0xff,0xef,0xfb,0xdf,0xde,0xff,0xfb,0xff,0xff,0x7f,0x7f,
0xbb,0xfb,0xf6,0xef,0xfd,0xff,0x97,0x80,0x00,0x00,0x00,0x14,0x55,0xff,0x7e,
0x5b,0x6d,0x55,0xad,0xd5,0xf6,0xfd,0xf6,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,
0xfe,0xef,0xbf,0xbf,0xf7,0xff,0xff,0xdf,0xfc,0xbf,0xed,0xf6,0xbd,0xfd,0xff,
0xc7,0xf0,0xff,0xff,0x7f,0xff,0xf7,0xff,0xc3,0xc0,0xff,0x7f,0xdb,0xff,0xff,
0xff,0xc1,0xc0,0xff,0xee,0xff,0x77,0xff,0xff,0xc0,0x80,0xaf,0xbb,0xaa,0xfa,
0xed,0x7f,0xc0};

View File

@@ -2,8 +2,9 @@
//
// Gary P. Scavone, 1999.
#include <stdlib.h>
#include <string.h>
#include "utilities.h"
#include "Messager.h"
// STK Instrument Classes
#include "Clarinet.h"
@@ -24,6 +25,7 @@
#include "PercFlut.h"
#include "BeeThree.h"
#include "FMVoices.h"
#include "VoicForm.h"
#include "Moog.h"
#include "Simple.h"
#include "Drummer.h"
@@ -32,13 +34,13 @@
#include "ModalBar.h"
#include "Mesh2D.h"
#include "Resonate.h"
#include "Whistle.h"
// STK WvOut classes
#if defined(__STK_REALTIME__)
#include "RtWvOut.h"
#endif
#define NUM_INSTS 26
#define NUM_INSTS 28
// The order of the following list is important. The location of a particular
// instrument in the list should correspond to that instrument's ProgramChange
@@ -46,8 +48,8 @@
char insts[NUM_INSTS][10] = { "Clarinet", "BlowHole", "Saxofony", "Flute", "Brass",
"BlowBotl", "Bowed", "Plucked", "StifKarp", "Sitar", "Mandolin",
"Rhodey", "Wurley", "TubeBell", "HevyMetl", "PercFlut",
"BeeThree", "FMVoices", "Moog", "Simple", "Drummer",
"BandedWG", "Shakers", "ModalBar", "Mesh2D", "Resonate" };
"BeeThree", "FMVoices", "VoicForm", "Moog", "Simple", "Drummer",
"BandedWG", "Shakers", "ModalBar", "Mesh2D", "Resonate", "Whistle" };
int voiceByNumber(int number, Instrmnt **instrument)
{
@@ -73,14 +75,16 @@ int voiceByNumber(int number, Instrmnt **instrument)
else if (number==16) *instrument = new BeeThree;
else if (number==17) *instrument = new FMVoices;
else if (number==18) *instrument = new Moog();
else if (number==19) *instrument = new Simple();
else if (number==20) *instrument = new Drummer();
else if (number==21) *instrument = new BandedWG();
else if (number==22) *instrument = new Shakers();
else if (number==23) *instrument = new ModalBar();
else if (number==24) *instrument = new Mesh2D(10, 10);
else if (number==25) *instrument = new Resonate();
else if (number==18) *instrument = new VoicForm();
else if (number==19) *instrument = new Moog();
else if (number==20) *instrument = new Simple();
else if (number==21) *instrument = new Drummer();
else if (number==22) *instrument = new BandedWG();
else if (number==23) *instrument = new Shakers();
else if (number==24) *instrument = new ModalBar();
else if (number==25) *instrument = new Mesh2D(10, 10);
else if (number==26) *instrument = new Resonate();
else if (number==27) *instrument = new Whistle();
else {
printf("\nUnknown instrument or program change requested!\n");
@@ -113,15 +117,17 @@ void usage(char *function) {
int i, j;
printf("\nuseage: %s Instrument flag(s) \n", function);
printf(" where flag = -os <file name> for .snd audio output file,\n");
printf(" where flag = -s RATE to specify a sample rate,\n");
printf(" -n NUMBER specifies the number of voices to allocate,\n");
printf(" -ow <file name> for .wav audio output file,\n");
printf(" -os <file name> for .snd audio output file,\n");
printf(" -om <file name> for .mat audio output file,\n");
printf(" -oa <file name> for .aif audio output file,\n");
#if defined(__STK_REALTIME__)
printf(" -or for realtime audio output,\n");
printf(" -ip for realtime control input by pipe,\n");
printf(" (won't work under Win95/98),\n");
printf(" -is for realtime control input by socket,\n");
printf(" -is <port> for realtime control input by socket,\n");
printf(" -im for realtime control input by MIDI,\n");
#endif
printf(" and Instrument = one of these:\n");
@@ -145,9 +151,9 @@ int checkArgs(int numArgs, char *args[])
{
int w, i = 2, j = 0;
int numOutputs = 0;
char flags[16] = "";
char flags[2][50] = {""};
if (numArgs < 3 || numArgs > 10) usage(args[0]);
if (numArgs < 3 || numArgs > 17) usage(args[0]);
while (i < numArgs) {
if (args[i][0] == '-') {
@@ -156,14 +162,23 @@ int checkArgs(int numArgs, char *args[])
(args[i][2] == 'w') || (args[i][2] == 'm')
|| (args[i][2] == 'a') )
numOutputs++;
flags[0][j] = 'o';
flags[1][j++] = args[i][2];
}
else if (args[i][1] == 'i') {
if ( (args[i][2] != 's') && (args[i][2] != 'p') &&
(args[i][2] != 'm') ) usage(args[0]);
flags[0][j] = 'i';
flags[1][j++] = args[i][2];
}
else if (args[i][1] == 's' && (i+1 < numArgs) && args[i+1][0] != '-' ) {
Stk::setSampleRate( atoi(args[i+1]) );
flags[0][j++] = 's';
}
else if (args[i][1] == 'n' && (i+1 < numArgs) && args[i+1][0] != '-' ) {
flags[0][j++] = 'n';
}
else usage(args[0]);
flags[j] = args[i][2];
j++;
}
i++;
}
@@ -172,7 +187,7 @@ int checkArgs(int numArgs, char *args[])
for (i=0; i<=j; i++) {
w = i+1;
while (w <= j) {
if (flags[i] == flags[w]) {
if (flags[0][i] == flags[0][w] && flags[1][i] == flags[1][w] ) {
printf("\nError: Multiple command line flags of the same type specified.\n\n");
usage(args[0]);
}
@@ -186,10 +201,28 @@ int checkArgs(int numArgs, char *args[])
return numOutputs;
}
int parseArgs(int numArgs, char *args[], WvOut **output)
int countVoices(int nArgs, char *args[])
{
int i = 2, nInstruments = 1;
while (i < nArgs) {
if ( strncmp( args[i], "-n", 2) == 0 ) {
if ( i+1 < nArgs && args[i+1][0] != '-' ) {
nInstruments = atoi( args[i+1] );
if ( nInstruments < 1 ) nInstruments = 1;
}
}
i++;
}
return nInstruments;
}
void parseArgs(int numArgs, char *args[], WvOut **output, Messager **messager)
{
int i = 2, j = 0;
int inputMask = 0;
int port = -1;
char fileName[256];
while (i < numArgs) {
@@ -207,6 +240,9 @@ int parseArgs(int numArgs, char *args[], WvOut **output)
case 's':
#if defined(__STK_REALTIME__)
inputMask |= STK_SOCKET;
// Check for an optional socket port argument.
if ((i+1 < numArgs) && args[i+1][0] != '-')
port = atoi(args[++i]);
break;
#else
usage(args[0]);
@@ -230,7 +266,7 @@ int parseArgs(int numArgs, char *args[], WvOut **output)
case 'r':
#if defined(__STK_REALTIME__)
output[j] = (WvOut *) new RtWvOut();
output[j] = (WvOut *) new RtWvOut(2);
j++;
break;
#else
@@ -284,5 +320,11 @@ int parseArgs(int numArgs, char *args[], WvOut **output)
}
i++;
}
return inputMask;
// Instantiate the messager.
if ( inputMask & STK_SOCKET && port >= 0 )
*messager = new Messager( inputMask, port );
else
*messager = new Messager( inputMask );
}

View File

@@ -4,6 +4,7 @@
#include "Instrmnt.h"
#include "WvOut.h"
#include "Messager.h"
int voiceByNumber(int number, Instrmnt **instrument);
@@ -13,4 +14,6 @@ void usage(char *function);
int checkArgs(int numArgs, char *args[]);
int parseArgs(int numArgs, char *args[], WvOut **output);
int countVoices(int nArgs, char *args[]);
void parseArgs(int numArgs, char *args[], WvOut **output, Messager **messager);

View File

View File

@@ -1,51 +0,0 @@
# Effects Makefile
OS = $(shell uname)
# The following definition indicates the relative location of
# the core STK classes.
STK_PATH = ../../src/
O_FILES = Stk.o Reverb.o PRCRev.o JCRev.o \
NRev.o RtAudio.o Delay.o Filter.o \
RtDuplex.o SKINI.o Envelope.o Echo.o \
PitShift.o DelayL.o Chorus.o WvIn.o \
WaveLoop.o Messager.o Thread.o Socket.o \
RtMidi.o
RM = /bin/rm
ifeq ($(OS),IRIX) # These are for SGI
INSTR = effects
CC = CC -O2 -D__IRIX_AL__ # -g -fullwarn -D__SGI_CC__
LIBRARY = -L/usr/sgitcl/lib -laudio -lmd -lm -lpthread
INCLUDE = -I../../include
endif
ifeq ($(OS),Linux) # These are for Linux
INSTR = effects
CC = g++ -O3 -Wall -D__LINUX_OSS__ -D__LITTLE_ENDIAN__ # -g
LIBRARY = -lpthread -lm #-lasound
INCLUDE = -I../../include
endif
%.o : $(STK_PATH)%.cpp
$(CC) $(INCLUDE) -c $(<) -o $@
all: $(INSTR)
clean :
rm *.o
rm $(INSTR)
cleanIns :
rm $(INSTR)
strip :
strip $(INSTR)
effects: effects.cpp $(O_FILES)
$(CC) $(INCLUDE) -o effects effects.cpp $(O_FILES) $(LIBRARY)
# $(O_FILES) :

View File

@@ -0,0 +1,57 @@
### STK effects Makefile - for various flavors of unix
PROGRAMS = effects
RM = /bin/rm
SRC_PATH = ../../src
OBJECT_PATH = @object_path@
vpath %.o $(OBJECT_PATH)
OBJECTS = Stk.o Reverb.o PRCRev.o JCRev.o \
NRev.o Delay.o Filter.o \
SKINI.o Envelope.o Echo.o \
PitShift.o DelayL.o Chorus.o \
WvIn.o WaveLoop.o Messager.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 RtDuplex.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)
effects: effects.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o effects effects.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
$(OBJECTS) : Stk.h
clean :
-rm $(OBJECT_PATH)/*.o
-rm $(PROGRAMS)
strip :
strip $(PROGRAMS)

View File

@@ -4,7 +4,7 @@
# the core STK classes.
STK_PATH = ../../src/
O_FILES = $(STK_PATH)Stk.o $(STK_PATH)Envelope.o $(STK_PATH)Filter.o \
OBJECTS = $(STK_PATH)Stk.o $(STK_PATH)Envelope.o $(STK_PATH)Filter.o \
$(STK_PATH)DelayL.o $(STK_PATH)Delay.o $(STK_PATH)SKINI.o \
$(STK_PATH)WvIn.o $(STK_PATH)Reverb.o $(STK_PATH)PRCRev.o \
$(STK_PATH)JCRev.o $(STK_PATH)NRev.o $(STK_PATH)RtAudio.o \
@@ -15,32 +15,29 @@ O_LOCAL_FILES = Echo.o PitShift.o Chorus.o
RM = /bin/rm
INSTR = effects
PROGRAMS = effects
CC = CC -O2 -D__IRIX_AL__ # -g -fullwarn -D__SGI_CC__
LIBRARY = -L/usr/sgitcl/lib -laudio -lmd -lm -lpthread
INCLUDE = -I../../include/
.SUFFIXES: .cpp
.cpp.o: $(O_FILES)
.cpp.o: $(OBJECTS)
$(CC) $(INCLUDE) -c -o $@ $<
all: $(INSTR)
all: $(PROGRAMS)
effects: effects.cpp $(O_FILES) $(O_LOCAL_FILES)
$(CC) -o effects effects.cpp $(O_FILES) $(O_LOCAL_FILES) $(LIBRARY) $(INCLUDE)
effects: effects.cpp $(OBJECTS) $(O_LOCAL_FILES)
$(CC) -o effects effects.cpp $(OBJECTS) $(O_LOCAL_FILES) $(LIBRARY) $(INCLUDE)
clean :
rm *.o
rm $(STK_PATH)*.o
rm $(INSTR)
cleanIns :
rm $(INSTR)
rm $(PROGRAMS)
strip :
strip $(INSTR)
strip $(PROGRAMS)
# $(O_FILES) :
# Project specific objects:
Echo.o: Echo.cpp
$(CC) $(INCLUDE) -c Echo.cpp

View File

@@ -16,29 +16,38 @@
void usage(void) {
/* Error function in case of incorrect command-line argument specifications */
printf("\nuseage: effects flag \n");
printf(" where flag = -ip for realtime SKINI input by pipe\n");
printf("\nuseage: effects flags \n");
printf(" where flag = -s RATE to specify a sample rate,\n");
printf(" flag = -ip for realtime SKINI input by pipe\n");
printf(" (won't work under Win95/98),\n");
printf(" and flag = -is for realtime SKINI input by socket.\n");
printf(" and flag = -is <port> for realtime SKINI input by socket.\n");
exit(0);
}
int main(int argc,char *argv[])
{
if (argc != 2) usage();
int controlMask = 0;
if (!strcmp(argv[1],"-is") )
controlMask |= STK_SOCKET;
else if (!strcmp(argv[1],"-ip") )
controlMask |= STK_PIPE;
else
usage();
if (argc < 2 || argc > 6) usage();
// 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);
int port = -1;
int controlMask = 0;
for (int k=1; k<argc; k++ ) {
if (!strcmp(argv[k],"-is") ) {
controlMask |= STK_SOCKET;
if (k+1 < argc && argv[k+1][0] != '-' ) port = atoi(argv[++k]);
}
else if (!strcmp(argv[k],"-ip") )
controlMask |= STK_PIPE;
else if (!strcmp(argv[k],"-s") && (k+1 < argc) && argv[k+1][0] != '-')
Stk::setSampleRate( atoi(argv[++k]) );
else
usage();
}
bool done;
int effect = 0;
MY_FLOAT lastSample, inSample;
@@ -58,6 +67,9 @@ int main(int argc,char *argv[])
inout = new RtDuplex(1, Stk::sampleRate(), 0, RT_BUFFER_SIZE, 10);
// Instantiate the input message controller.
if ( controlMask & STK_SOCKET && port >= 0 )
messager = new Messager( controlMask, port );
else
messager = new Messager( controlMask );
}
catch (StkError &) {

View File

View File

@@ -1,58 +0,0 @@
# Examples Makefile - Global version for Unix systems which have GNU
# Makefile utilities installed.
OS = $(shell uname)
# You might have to modify the following path if you move things
# around on your system.
STK_SRC = ../../src/
INCLUDE = -I../../include
RM = /bin/rm
INSTR = sine play record io tcpIn tcpOut Moogy
ifeq ($(OS),Linux) # These are for Linux
CC = g++ -O3 -Wall -D__LITTLE_ENDIAN__ -D__LINUX_OSS__
LIBRARY = -lpthread -lm #-lasound
endif
ifeq ($(OS),IRIX) # These are for SGI
CC = CC -D__IRIX_AL__ # -g -fullwarn -O2
LIBRARY = -L/usr/sgitcl/lib -laudio -lmd -lm -lpthread
endif
%.o : $(STK_SRC)%.cpp
$(CC) $(INCLUDE) -c $(<) -o $@
all: $(INSTR)
clean :
rm *.o
rm $(INSTR)
cleanIns :
rm $(INSTR)
strip :
strip $(INSTR)
play: play.cpp Stk.o WvIn.o WvOut.o RtWvOut.o RtAudio.o
$(CC) -o play play.cpp Stk.o WvIn.o WvOut.o RtWvOut.o RtAudio.o $(LIBRARY) $(INCLUDE)
record: record.cpp Stk.o WvIn.o WvOut.o RtWvIn.o RtAudio.o
$(CC) -o record record.cpp Stk.o WvIn.o WvOut.o RtWvIn.o RtAudio.o $(LIBRARY) $(INCLUDE)
sine: sine.cpp Stk.o WvIn.o WvOut.o WaveLoop.o
$(CC) -o sine sine.cpp Stk.o WvIn.o WvOut.o WaveLoop.o $(LIBRARY) $(INCLUDE)
io: io.cpp Stk.o RtAudio.o RtDuplex.o
$(CC) -o io io.cpp Stk.o RtAudio.o RtDuplex.o $(LIBRARY) $(INCLUDE)
tcpIn: tcpIn.cpp Stk.o WvIn.o TcpWvIn.o WvOut.o RtWvOut.o RtAudio.o Socket.o Thread.o
$(CC) -o tcpIn tcpIn.cpp Stk.o WvIn.o Socket.o Thread.o TcpWvIn.o WvOut.o RtWvOut.o RtAudio.o $(LIBRARY) $(INCLUDE)
tcpOut: tcpOut.cpp Stk.o WvIn.o WvOut.o TcpWvOut.o Socket.o Thread.o
$(CC) -o tcpOut tcpOut.cpp Stk.o WvIn.o WvOut.o Socket.o Thread.o TcpWvOut.o $(LIBRARY) $(INCLUDE)
Moogy: Moogy.cpp Stk.o WvIn.o WaveLoop.o WvOut.o RtWvOut.o RtAudio.o Instrmnt.o Sampler.o FormSwep.o Filter.o BiQuad.o Envelope.o ADSR.o OnePole.o Moog.o
$(CC) -o Moogy Stk.o WvIn.o WaveLoop.o WvOut.o RtWvOut.o RtAudio.o Instrmnt.o Sampler.o FormSwep.o Filter.o BiQuad.o Envelope.o ADSR.o OnePole.o Moog.o Moogy.cpp $(LIBRARY) $(INCLUDE)

View File

@@ -0,0 +1,68 @@
### STK examples Makefile - for various flavors of unix
PROGRAMS = sine play record io tcpIn tcpOut Moogy
RM = /bin/rm
SRC_PATH = ../../src
OBJECT_PATH = @object_path@
vpath %.o $(OBJECT_PATH)
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)
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)
$(OBJECTS) : Stk.h
clean :
-rm $(OBJECT_PATH)/*.o
-rm $(PROGRAMS)
strip :
strip $(PROGRAMS)
play: play.cpp Stk.o WvIn.o WvOut.o RtWvOut.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o play play.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/RtWvOut.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
record: record.cpp Stk.o WvIn.o WvOut.o RtWvIn.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o record record.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/RtWvIn.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
sine: sine.cpp Stk.o WvIn.o WvOut.o WaveLoop.o
$(CC) $(CFLAGS) $(DEFS) -o sine sine.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/WaveLoop.o $(LIBRARY)
io: io.cpp Stk.o RtAudio.o RtDuplex.o
$(CC) $(CFLAGS) $(DEFS) -o io io.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/RtAudio.o $(OBJECT_PATH)/RtDuplex.o $(LIBRARY)
tcpIn: tcpIn.cpp Stk.o WvIn.o TcpWvIn.o WvOut.o RtWvOut.o RtAudio.o Socket.o Thread.o
$(CC) $(CFLAGS) $(DEFS) -o tcpIn tcpIn.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/TcpWvIn.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/RtWvOut.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
tcpOut: tcpOut.cpp Stk.o WvIn.o WvOut.o TcpWvOut.o Socket.o Thread.o
$(CC) $(CFLAGS) $(DEFS) -o tcpOut tcpOut.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/TcpWvOut.o $(LIBRARY)
Moogy: Moogy.cpp Stk.o WvIn.o WaveLoop.o WvOut.o RtWvOut.o RtAudio.o Instrmnt.o Sampler.o FormSwep.o Filter.o BiQuad.o Envelope.o ADSR.o OnePole.o Moog.o
$(CC) $(CFLAGS) $(DEFS) -o Moogy Moogy.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/WaveLoop.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/RtWvOut.o $(OBJECT_PATH)/RtAudio.o $(OBJECT_PATH)/Instrmnt.o $(OBJECT_PATH)/Sampler.o $(OBJECT_PATH)/FormSwep.o $(OBJECT_PATH)/Filter.o $(OBJECT_PATH)/BiQuad.o $(OBJECT_PATH)/Envelope.o $(OBJECT_PATH)/ADSR.o $(OBJECT_PATH)/OnePole.o $(OBJECT_PATH)/Moog.o $(LIBRARY)

View File

View File

@@ -38,6 +38,11 @@ main(int argc, char *argv[])
unsigned int channels = (unsigned int) atoi(argv[1]);
float time = atof(argv[2]);
// If you want to change the default sample rate (set in Stk.h), do
// it before instantiating any objects! If the sample rate is
// specified in the command line, it will override this setting.
Stk::setSampleRate( 44100.0 );
// Open the realtime duplex device.
RtDuplex *inout = 0;
try {

View File

@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
// Try to load the soundfile.
try {
input = new WvIn( (char *)argv[1] );
input = new WvIn( argv[1] );
}
catch (StkError &) {
exit(0);

View File

@@ -49,6 +49,6 @@ proc noteOn {pitchVal pressVal} {
proc changePitch {value} {
global outID
puts $outID [format "PitchBend 0.0 1 %.3f" $value]
puts $outID [format "PitchChange 0.0 1 %.3f" $value]
flush $outID
}

View File

@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -65,7 +65,7 @@ LINK32=link.exe
# PROP Intermediate_Dir "debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe

View File

@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe

View File

View File

@@ -1,63 +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 core STK classes.
STK_PATH = ../../src/
O_FILES = Stk.o Envelope.o ADSR.o Noise.o \
Filter.o DelayA.o Delay.o \
OnePole.o OneZero.o SKINI.o \
Tabla.o Instrmnt.o Sitar.o \
Drone.o VoicDrum.o WvOut.o WvIn.o \
RtAudio.o RtWvOut.o RtMidi.o Reverb.o \
JCRev.o Messager.o Socket.o Thread.o
RM = /bin/rm
ifeq ($(OS),IRIX) # These are for SGI
INSTR = ragamat
CC = CC -O2 -D__IRIX_AL__ # -g -fullwarn -D__SGI_CC__
LIBRARY = -L/usr/sgitcl/lib -laudio -lmd -lm -lpthread
INCLUDE = -I../../include
endif
ifeq ($(OS),Linux) # These are for Linux
INSTR = ragamat
CC = g++ -O3 -Wall -D__LINUX_OSS__ -D__LITTLE_ENDIAN__ # -g
LIBRARY = -lpthread -lm #-lasound
INCLUDE = -I../../include
endif
%.o : $(STK_PATH)%.cpp
$(CC) $(INCLUDE) -c $(<) -o $@
all: $(INSTR)
ragamat: ragamat.cpp $(O_FILES)
$(CC) $(INCLUDE) -o ragamat ragamat.cpp $(O_FILES) $(LIBRARY)
clean :
rm *.o
rm $(INSTR)
cleanIns :
rm $(INSTR)
strip :
strip $(INSTR)
# $(O_FILES) :
Tabla.o: Tabla.cpp
$(CC) $(INCLUDE) -c Tabla.cpp
Drone.o: Drone.cpp
$(CC) $(INCLUDE) -c Drone.cpp
VoicDrum.o: VoicDrum.cpp
$(CC) $(INCLUDE) -c VoicDrum.cpp

View File

@@ -0,0 +1,69 @@
### STK ragamatic Makefile - for various flavors of unix
PROGRAMS = ragamat
RM = /bin/rm
SRC_PATH = ../../src
OBJECT_PATH = @object_path@
vpath %.o $(OBJECT_PATH)
OBJECTS = Stk.o Envelope.o ADSR.o Noise.o \
Filter.o DelayA.o Delay.o \
OnePole.o OneZero.o SKINI.o \
Tabla.o Instrmnt.o Sitar.o \
Drone.o VoicDrum.o WvOut.o WvIn.o \
Reverb.o JCRev.o Messager.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)
ragamat: ragamat.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o ragamat ragamat.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
$(OBJECTS) : Stk.h
clean :
-rm $(OBJECT_PATH)/*.o
-rm $(PROGRAMS)
strip :
strip $(PROGRAMS)
# Project specific objects:
Tabla.o: Tabla.cpp
$(CC) $(CFLAGS) $(DEFS) -c Tabla.cpp -o $(OBJECT_PATH)/$@
Drone.o: Drone.cpp
$(CC) $(CFLAGS) $(DEFS) -c Drone.cpp -o $(OBJECT_PATH)/$@
VoicDrum.o: VoicDrum.cpp
$(CC) $(CFLAGS) $(DEFS) -c VoicDrum.cpp -o $(OBJECT_PATH)/$@

View File

View File

@@ -21,10 +21,11 @@ MY_FLOAT float_random(MY_FLOAT max) // Return random float between 0.0 and max
void usage(void) {
/* Error function in case of incorrect command-line argument specifications */
printf("\nuseage: ragamat flag \n");
printf(" where flag = -ip for realtime SKINI input by pipe\n");
printf("\nuseage: ragamat flags \n");
printf(" where flag = -s RATE to specify a sample rate,\n");
printf(" flag = -ip for realtime SKINI input by pipe\n");
printf(" (won't work under Win95/98),\n");
printf(" and flag = -is for realtime SKINI input by socket.\n");
printf(" and flag = -is <port> for realtime SKINI input by socket.\n");
exit(0);
}
@@ -41,10 +42,6 @@ int main(int argc,char *argv[])
Messager *messager;
MY_FLOAT t60 = 4.0; // in seconds
// If you want to change the default sample rate (set in Stk.h), do
// it before instantiating any objects!!
Stk::setSampleRate( 22050.0 );
MY_FLOAT drone_prob = 0.01, note_prob = 0.0;
MY_FLOAT drum_prob = 0.0, voic_prob = 0.0;
MY_FLOAT droneFreqs[3] = {55.0,82.5,220.0};
@@ -57,20 +54,35 @@ int main(int argc,char *argv[])
int ragaDown[2][13] = {{57, 60, 62, 64, 65, 67, 69, 71, 72, 76, 79, 81},
{48, 52, 53, 55, 57, 59, 60, 64, 66, 68, 70, 72}};
if (argc != 2) usage();
// If you want to change the default sample rate (set in Stk.h), do
// it before instantiating any objects! If the sample rate is
// specified in the command line, it will override this setting.
Stk::setSampleRate(22050.0);
int controlMask = 0;
if (!strcmp(argv[1],"-is") )
if (argc < 2 || argc > 6) usage();
int port = -1;
int i, controlMask = 0;
for ( i=1; i<argc; i++ ) {
if (!strcmp(argv[i],"-is") ) {
controlMask |= STK_SOCKET;
else if (!strcmp(argv[1],"-ip") )
if (i+1 < argc && argv[i+1][0] != '-' ) port = atoi(argv[++i]);
}
else if (!strcmp(argv[i],"-ip") )
controlMask |= STK_PIPE;
else if (!strcmp(argv[i],"-s") && (i+1 < argc) && argv[i+1][0] != '-')
Stk::setSampleRate( atoi(argv[++i]) );
else
usage();
}
try {
output = new RtWvOut(2);
// Instantiate the input message controller.
if ( controlMask & STK_SOCKET && port >= 0 )
messager = new Messager( controlMask, port );
else
messager = new Messager( controlMask );
}
catch (StkError &) {
@@ -94,7 +106,6 @@ int main(int argc,char *argv[])
drones[1]->noteOn(droneFreqs[1],0.1);
drones[2]->noteOn(droneFreqs[2],0.1);
int i;
MY_FLOAT outSamples[2];
for (i=0;i<Stk::sampleRate();i++) { /* warm everybody up a little */
outSamples[0] = reverbs[0]->tick(drones[0]->tick() + drones[2]->tick());

0
rawwaves/ahh.raw Executable file → Normal file
View File

0
rawwaves/bassdrum.raw Executable file → Normal file
View File

0
rawwaves/britestk.raw Executable file → Normal file
View File

0
rawwaves/cowbell1.raw Executable file → Normal file
View File

0
rawwaves/crashcym.raw Executable file → Normal file
View File

0
rawwaves/dope.raw Executable file → Normal file
View File

0
rawwaves/eee.raw Executable file → Normal file
View File

0
rawwaves/fwavblnk.raw Executable file → Normal file
View File

0
rawwaves/halfwave.raw Executable file → Normal file
View File

0
rawwaves/hihatcym.raw Executable file → Normal file
View File

0
rawwaves/impuls10.raw Executable file → Normal file
View File

0
rawwaves/impuls20.raw Executable file → Normal file
View File

0
rawwaves/impuls40.raw Executable file → Normal file
View File

0
rawwaves/makefunc.c Executable file → Normal file
View File

0
rawwaves/makemidi.c Executable file → Normal file
View File

0
rawwaves/makewavs.c Executable file → Normal file
View File

0
rawwaves/mand1.raw Executable file → Normal file
View File

0
rawwaves/mand10.raw Executable file → Normal file
View File

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