Version 4.4.0

This commit is contained in:
Gary Scavone
2013-09-29 23:11:39 +02:00
committed by Stephen Sinclair
parent d199342e86
commit eccd8c9981
287 changed files with 11712 additions and 7676 deletions

View File

@@ -7,16 +7,16 @@ SRC_PATH = ../../src
OBJECT_PATH = @object_path@
vpath %.o $(OBJECT_PATH)
OBJECTS = Stk.o Generator.o Noise.o SubNoise.o Envelope.o ADSR.o \
OBJECTS = Stk.o Noise.o Envelope.o ADSR.o \
Modulate.o SingWave.o SineWave.o FileRead.o FileWrite.o \
WvIn.o FileWvIn.o WaveLoop.o WvOut.o FileWvOut.o \
Filter.o OneZero.o OnePole.o PoleZero.o TwoZero.o \
FileWvIn.o FileLoop.o FileWvOut.o \
OneZero.o OnePole.o PoleZero.o TwoZero.o \
BiQuad.o FormSwep.o Delay.o DelayL.o DelayA.o \
Function.o ReedTable.o JetTable.o BowTable.o \
Effect.o PRCRev.o \
ReedTable.o JetTable.o BowTable.o \
PRCRev.o \
Voicer.o Vector3D.o Sphere.o \
\
Instrmnt.o Clarinet.o BlowHole.o Saxofony.o Flute.o Brass.o BlowBotl.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 \
@@ -31,18 +31,16 @@ endif
vpath %.h $(INCLUDE)
CC = @CXX@
DEFS = @byte_order@
DEFS += @debug@
CFLAGS = @cflags@
CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include
DEFS = @CPPFLAGS@
DEFS += @byte_order@
CFLAGS = @CXXFLAGS@
CFLAGS += -I$(INCLUDE) -I$(INCLUDE)/../src/include
LIBRARY = @LIBS@
LIBRARY += @frameworks@
REALTIME = @realtime@
ifeq ($(REALTIME),yes)
PROGRAMS += demo
OBJECTS += RtMidi.o RtAudio.o Thread.o Mutex.o Socket.o TcpServer.o @objects@
DEFS += @audio_apis@
endif
RAWWAVES = @rawwaves@
@@ -76,6 +74,7 @@ $(OBJECTS) : Stk.h
clean :
-rm $(OBJECT_PATH)/*.o
-rm $(PROGRAMS) *.exe
-rm -fR *~ *.dSYM
strip :
strip $(PROGRAMS)

View File

@@ -12,9 +12,8 @@
#include "RtMidi.h"
#include "SKINI.msg"
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
void usage(void) {
std::cout << "\nuseage: Md2Skini <flag(s)>\n\n";
@@ -161,6 +160,8 @@ void midiCallback( double deltatime, std::vector< unsigned char > *bytes, void *
if ( file != NULL )
fprintf( file, "%s %.3f %d %.1f %.1f\n", typeName.c_str(), deltatime, channel, (float)databyte1, (float)databyte2 );
}
fflush( stdout );
}
int main( int argc,char *argv[] )

View File

@@ -28,13 +28,15 @@ using std::min;
bool done;
static void finish(int ignore){ done = true; }
using namespace stk;
// The TickData structure holds all the class instances and data that
// are shared by the various processing functions.
struct TickData {
WvOut **wvout;
Instrmnt **instrument;
Voicer *voicer;
Effect *reverb;
PRCRev reverb;
Messager messager;
Skini::Message message;
StkFloat volume;
@@ -51,7 +53,7 @@ struct TickData {
// Default constructor.
TickData()
: wvout(0), instrument(0), voicer(0), reverb(0), volume(1.0), t60(1.0),
: wvout(0), instrument(0), voicer(0), volume(1.0), t60(1.0),
nWvOuts(0), nVoices(1), currentVoice(0), channels(2), counter(0),
realtime( false ), settling( false ), haveMessage( false ) {}
};
@@ -90,7 +92,7 @@ void processMessage( TickData* data )
case __SK_ControlChange_:
if (value1 == 44.0)
data->reverb->setEffectMix(value2 * ONE_OVER_128);
data->reverb.setEffectMix(value2 * ONE_OVER_128);
else if (value1 == 7.0)
data->volume = value2 * ONE_OVER_128;
else if (value1 == 49.0)
@@ -183,7 +185,7 @@ int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
counter = min( nTicks, data->counter );
data->counter -= counter;
for ( int i=0; i<counter; i++ ) {
sample = data->volume * data->reverb->tick( data->voicer->tick() );
sample = data->volume * data->reverb.tick( data->voicer->tick() );
for ( unsigned int j=0; j<data->nWvOuts; j++ ) data->wvout[j]->tick(sample);
if ( data->realtime )
for ( int k=0; k<data->channels; k++ ) *samples++ = sample;
@@ -212,6 +214,10 @@ int main( int argc, char *argv[] )
// specified in the command line, it will override this setting.
Stk::setSampleRate( 44100.0 );
// Depending on how you compile STK, you may need to explicitly set
// the path to the rawwave directory.
Stk::setRawwavePath( "../../rawwaves/" );
// By default, warning messages are not printed. If we want to see
// them, we need to specify that here.
Stk::showWarnings( true );
@@ -267,8 +273,8 @@ int main( int argc, char *argv[] )
#endif
// Set the reverb parameters.
data.reverb = new PRCRev( data.t60 );
data.reverb->setEffectMix(0.2);
data.reverb.setT60( data.t60 );
data.reverb.setEffectMix(0.2);
// Install an interrupt handler function.
(void) signal(SIGINT, finish);
@@ -315,7 +321,6 @@ int main( int argc, char *argv[] )
for ( i=0; i<(int)data.nWvOuts; i++ ) delete data.wvout[i];
free( data.wvout );
delete data.reverb;
delete data.voicer;
for ( i=0; i<data.nVoices; i++ ) delete data.instrument[i];

View File

@@ -119,10 +119,6 @@ SOURCE=..\..\src\Bowed.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\BowTable.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Brass.cpp
# End Source File
# Begin Source File
@@ -151,10 +147,6 @@ SOURCE=..\..\src\Drummer.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Effect.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Envelope.cpp
# End Source File
# Begin Source File
@@ -175,10 +167,6 @@ SOURCE=..\..\src\FileWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Filter.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Flute.cpp
# End Source File
# Begin Source File
@@ -195,30 +183,14 @@ SOURCE=..\..\src\FormSwep.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Function.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\HevyMetl.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Instrmnt.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\JCRev.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\JetTable.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Mandolin.cpp
# End Source File
# Begin Source File
@@ -291,10 +263,6 @@ SOURCE=..\..\src\PRCRev.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\ReedTable.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Resonate.cpp
# End Source File
# Begin Source File
@@ -367,10 +335,6 @@ SOURCE=..\..\src\Stk.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\SubNoise.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\TcpServer.cpp
# End Source File
# Begin Source File
@@ -395,10 +359,6 @@ 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
@@ -407,7 +367,7 @@ SOURCE=..\..\src\VoicForm.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
SOURCE=..\..\src\FileLoop.cpp
# End Source File
# Begin Source File
@@ -417,14 +377,6 @@ SOURCE=..\..\src\Whistle.cpp
SOURCE=..\..\src\Wurley.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
@@ -707,10 +659,6 @@ SOURCE=..\..\include\Stk.h
# End Source File
# Begin Source File
SOURCE=..\..\include\SubNoise.h
# End Source File
# Begin Source File
SOURCE=..\..\include\TcpServer.h
# End Source File
# Begin Source File
@@ -743,7 +691,7 @@ SOURCE=..\..\include\Voicer.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
SOURCE=..\..\include\FileLoop.h
# End Source File
# Begin Source File

View File

@@ -83,11 +83,6 @@ pack .buttons -pady 5 -padx 5
button .exit -text "Exit Program" -bg grey66 -command myExit
pack .exit -side bottom -pady 20
#bind all <KeyPress> {
bind . <KeyPress> {
noteOn $pitch $press
}
# Bind an X windows "close" event with the Exit routine
bind . <Destroy> +myExit

View File

@@ -36,6 +36,8 @@
#include "Resonate.h"
#include "Whistle.h"
using namespace stk;
#define NUM_INSTS 28
// The order of the following list is important. The location of a particular

View File

@@ -6,9 +6,9 @@
#include "FileWvOut.h"
#include "Messager.h"
int voiceByNumber(int number, Instrmnt **instrument);
int voiceByNumber(int number, stk::Instrmnt **instrument);
int voiceByName(char *name, Instrmnt **instrument);
int voiceByName(char *name, stk::Instrmnt **instrument);
void usage(char *function);
@@ -16,4 +16,4 @@ int checkArgs(int numArgs, char *args[]);
int countVoices(int nArgs, char *args[]);
bool parseArgs(int numArgs, char *args[], WvOut **output, Messager& messager);
bool parseArgs(int numArgs, char *args[], stk::WvOut **output, stk::Messager& messager);

View File

@@ -20,18 +20,16 @@ endif
vpath %.h $(INCLUDE)
CC = @CXX@
DEFS = @byte_order@
DEFS += @debug@
CFLAGS = @cflags@
CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include
DEFS = @CPPFLAGS@
DEFS += @byte_order@
CFLAGS = @CXXFLAGS@
CFLAGS += -I$(INCLUDE) -I$(INCLUDE)/../src/include
LIBRARY = @LIBS@
LIBRARY += @frameworks@
REALTIME = @realtime@
ifeq ($(REALTIME),yes)
PROGRAMS += effects
OBJECTS += RtMidi.o RtAudio.o Thread.o Mutex.o Socket.o TcpServer.o @objects@
DEFS += @audio_apis@
endif
RAWWAVES = @rawwaves@
@@ -59,6 +57,7 @@ $(OBJECTS) : Stk.h
clean :
-rm $(OBJECT_PATH)/*.o
-rm $(PROGRAMS) *.exe
-rm -fR *.dSYM
strip :
strip $(PROGRAMS)

View File

@@ -1,6 +1,6 @@
The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995-2007.
By Perry R. Cook and Gary P. Scavone, 1995-2009.
EFFECTS PROJECT:

View File

@@ -13,10 +13,13 @@
#include "RtAudio.h"
#include <signal.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using std::min;
using namespace stk;
void usage(void) {
// Error function in case of incorrect command-line argument specifications
std::cout << "\nuseage: effects flags \n";
@@ -33,7 +36,7 @@ static void finish(int ignore){ done = true; }
// The TickData structure holds all the class instances and data that
// are shared by the various processing functions.
struct TickData {
Effect *effect;
unsigned int effectId;
PRCRev prcrev;
JCRev jcrev;
NRev nrev;
@@ -51,7 +54,7 @@ struct TickData {
// Default constructor.
TickData()
: effect(0), t60(1.0), counter(0),
: effectId(0), t60(1.0), counter(0),
settling( false ), haveMessage( false ) {}
};
@@ -90,18 +93,7 @@ void processMessage( TickData* data )
case 20: { // effect type change
int type = data->message.intValues[1];
if ( type == 0 )
data->effect = &(data->echo);
else if ( type == 1 )
data->effect = &(data->shifter);
else if ( type == 2 )
data->effect = &(data->chorus);
else if ( type == 3 )
data->effect = &(data->prcrev);
else if ( type == 4 )
data->effect = &(data->jcrev);
else if ( type == 5 )
data->effect = &(data->nrev);
data->effectId = (unsigned int) type;
break;
}
@@ -153,6 +145,7 @@ int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
TickData *data = (TickData *) dataPointer;
register StkFloat *oSamples = (StkFloat *) outputBuffer, *iSamples = (StkFloat *) inputBuffer;
register StkFloat sample;
Effect *effect;
int i, counter, nTicks = (int) nBufferFrames;
while ( nTicks > 0 && !done ) {
@@ -170,9 +163,35 @@ int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
counter = min( nTicks, data->counter );
data->counter -= counter;
for ( i=0; i<counter; i++ ) {
sample = data->envelope.tick() * data->effect->tick( *iSamples++ );
*oSamples++ = sample; // two channels interleaved
*oSamples++ = sample;
if ( data->effectId < 2 ) { // Echo and PitShift ... mono output
if ( data->effectId == 0 )
sample = data->envelope.tick() * data->echo.tick( *iSamples++ );
else
sample = data->envelope.tick() * data->shifter.tick( *iSamples++ );
*oSamples++ = sample; // two channels interleaved
*oSamples++ = sample;
}
else { // Chorus or a reverb ... stereo output
if ( data->effectId == 2 ) {
data->chorus.tick( *iSamples++ );
effect = (Effect *) &(data->chorus);
}
else if ( data->effectId == 3 ) {
data->prcrev.tick( *iSamples++ );
effect = (Effect *) &(data->prcrev);
}
else if ( data->effectId == 4 ) {
data->jcrev.tick( *iSamples++ );
effect = (Effect *) &(data->jcrev);
}
else {
data->nrev.tick( *iSamples++ );
effect = (Effect *) &(data->nrev);
}
const StkFrames& samples = effect->lastFrame();
*oSamples++ = data->envelope.tick() * samples[0];
*oSamples++ = data->envelope.lastOut() * samples[1];
}
nTicks--;
}
if ( nTicks == 0 ) break;
@@ -184,7 +203,6 @@ int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
return 0;
}
int main( int argc, char *argv[] )
{
TickData data;
@@ -230,7 +248,6 @@ int main( int argc, char *argv[] )
}
data.envelope.setRate( 0.001 );
data.effect = &( data.echo );
// Install an interrupt handler function.
(void) signal( SIGINT, finish );

View File

@@ -118,10 +118,6 @@ SOURCE=..\..\include\Echo.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Effect.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Effect.h
# End Source File
# Begin Source File
@@ -154,18 +150,10 @@ SOURCE=..\..\include\FileWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Filter.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Filter.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Generator.h
# End Source File
# Begin Source File
@@ -282,15 +270,11 @@ SOURCE=..\..\include\Thread.h
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
SOURCE=..\..\src\FileLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
SOURCE=..\..\include\FileLoop.h
# End Source File
# Begin Source File

View File

@@ -14,17 +14,15 @@ endif
vpath %.h $(INCLUDE)
CC = @CXX@
DEFS = @byte_order@
DEFS += @debug@
CFLAGS = @cflags@
CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include
DEFS = @CPPFLAGS@
DEFS += @byte_order@
CFLAGS = @CXXFLAGS@
CFLAGS += -I$(INCLUDE) -I$(INCLUDE)/../src/include
LIBRARY = @LIBS@
LIBRARY += @frameworks@
REALTIME = @realtime@
ifeq ($(REALTIME),yes)
PROGRAMS += play record audioprobe midiprobe duplex inetIn inetOut rtsine crtsine bethree controlbee threebees playsmf grains
DEFS += @audio_apis@
endif
RAWWAVES = @rawwaves@
@@ -46,6 +44,7 @@ $(OBJECTS) : Stk.h
clean :
-rm $(OBJECT_PATH)/*.o
-rm $(PROGRAMS) *.exe
-rm -fR *~ *.dSYM
strip :
strip $(PROGRAMS)
@@ -56,47 +55,47 @@ audioprobe: RtAudio.o @objects@
midiprobe: RtMidi.o
$(CC) $(CFLAGS) $(DEFS) -o midiprobe midiprobe.cpp $(OBJECT_PATH)/RtMidi.o $(LIBRARY)
play: play.cpp Stk.o FileRead.o WvIn.o FileWvIn.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o play play.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
play: play.cpp Stk.o FileRead.o FileWvIn.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o play play.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
record: record.cpp Stk.o WvIn.o FileWrite.o WvOut.o FileWvOut.o RtWvIn.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o record record.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/FileWrite.o $(OBJECT_PATH)/FileWvOut.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/RtWvIn.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
record: record.cpp Stk.o FileWrite.o FileWvOut.o RtWvIn.o RtAudio.o Mutex.o
$(CC) $(CFLAGS) $(DEFS) -o record record.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/FileWrite.o $(OBJECT_PATH)/FileWvOut.o $(OBJECT_PATH)/RtWvIn.o $(OBJECT_PATH)/Mutex.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
sine: sine.cpp Stk.o Generator.o SineWave.o FileWrite.o WvOut.o FileWvOut.o
$(CC) $(CFLAGS) $(DEFS) -o sine sine.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/Generator.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/FileWrite.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/FileWvOut.o $(LIBRARY)
sine: sine.cpp Stk.o SineWave.o FileWrite.o FileWvOut.o
$(CC) $(CFLAGS) $(DEFS) -o sine sine.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/FileWrite.o $(OBJECT_PATH)/FileWvOut.o $(LIBRARY)
duplex: duplex.cpp RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o duplex duplex.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
inetIn: inetIn.cpp Stk.o WvIn.o InetWvIn.o WvOut.o RtWvOut.o RtAudio.o Socket.o TcpServer.o UdpSocket.o Thread.o Mutex.o
$(CC) $(CFLAGS) $(DEFS) -o inetIn inetIn.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/InetWvIn.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/TcpServer.o $(OBJECT_PATH)/UdpSocket.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/Mutex.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/RtWvOut.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
inetIn: inetIn.cpp Stk.o InetWvIn.o RtWvOut.o RtAudio.o Socket.o TcpServer.o UdpSocket.o Thread.o Mutex.o
$(CC) $(CFLAGS) $(DEFS) -o inetIn inetIn.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/InetWvIn.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/TcpServer.o $(OBJECT_PATH)/UdpSocket.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/Mutex.o $(OBJECT_PATH)/RtWvOut.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
inetOut: inetOut.cpp Stk.o FileRead.o WvIn.o FileWvIn.o WvOut.o InetWvOut.o Socket.o TcpClient.o UdpSocket.o Thread.o Mutex.o
$(CC) $(CFLAGS) $(DEFS) -o inetOut inetOut.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/TcpClient.o $(OBJECT_PATH)/UdpSocket.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/Mutex.o $(OBJECT_PATH)/InetWvOut.o $(LIBRARY)
inetOut: inetOut.cpp Stk.o FileRead.o FileWvIn.o InetWvOut.o Socket.o TcpClient.o UdpSocket.o Thread.o Mutex.o
$(CC) $(CFLAGS) $(DEFS) -o inetOut inetOut.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/TcpClient.o $(OBJECT_PATH)/UdpSocket.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/Mutex.o $(OBJECT_PATH)/InetWvOut.o $(LIBRARY)
sineosc: sineosc.cpp Stk.o FileRead.o WvIn.o FileWvIn.o WaveLoop.o FileWrite.o WvOut.o FileWvOut.o
$(CC) $(CFLAGS) $(DEFS) -o sineosc sineosc.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/FileWrite.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/FileWvOut.o $(OBJECT_PATH)/WaveLoop.o $(LIBRARY)
sineosc: sineosc.cpp Stk.o FileRead.o FileWvIn.o FileLoop.o FileWrite.o FileWvOut.o
$(CC) $(CFLAGS) $(DEFS) -o sineosc sineosc.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/FileWrite.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/FileWvOut.o $(OBJECT_PATH)/FileLoop.o $(LIBRARY)
rtsine: rtsine.cpp Stk.o Generator.o SineWave.o WvOut.o RtWvOut.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o rtsine rtsine.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/Generator.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/RtWvOut.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
rtsine: rtsine.cpp Stk.o SineWave.o RtWvOut.o RtAudio.o Mutex.o
$(CC) $(CFLAGS) $(DEFS) -o rtsine rtsine.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/RtWvOut.o $(OBJECT_PATH)/RtAudio.o $(OBJECT_PATH)/Mutex.o $(LIBRARY)
crtsine: crtsine.cpp Stk.o Generator.o SineWave.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o crtsine crtsine.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/Generator.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
crtsine: crtsine.cpp Stk.o SineWave.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o crtsine crtsine.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
bethree: bethree.cpp Stk.o WvIn.o FileRead.o FileWvIn.o WaveLoop.o FM.o RtAudio.o Instrmnt.o Filter.o TwoZero.o Generator.o SineWave.o Envelope.o ADSR.o BeeThree.o
$(CC) $(CFLAGS) $(DEFS) -o bethree bethree.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/WaveLoop.o $(OBJECT_PATH)/FM.o $(OBJECT_PATH)/RtAudio.o $(OBJECT_PATH)/Instrmnt.o $(OBJECT_PATH)/Filter.o $(OBJECT_PATH)/TwoZero.o $(OBJECT_PATH)/Generator.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/Envelope.o $(OBJECT_PATH)/ADSR.o $(OBJECT_PATH)/BeeThree.o $(LIBRARY)
bethree: bethree.cpp Stk.o FileRead.o FileWvIn.o FileLoop.o FM.o RtAudio.o TwoZero.o SineWave.o ADSR.o BeeThree.o
$(CC) $(CFLAGS) $(DEFS) -o bethree bethree.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/FileLoop.o $(OBJECT_PATH)/FM.o $(OBJECT_PATH)/RtAudio.o $(OBJECT_PATH)/TwoZero.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/ADSR.o $(OBJECT_PATH)/BeeThree.o $(LIBRARY)
controlbee: controlbee.cpp Stk.o WvIn.o FileRead.o FileWvIn.o WaveLoop.o FM.o RtAudio.o Instrmnt.o Filter.o TwoZero.o Generator.o SineWave.o Envelope.o ADSR.o BeeThree.o Messager.o RtMidi.o Socket.o TcpServer.o Thread.o Mutex.o Skini.o
$(CC) $(CFLAGS) $(DEFS) -o controlbee controlbee.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/WaveLoop.o $(OBJECT_PATH)/FM.o $(OBJECT_PATH)/RtAudio.o $(OBJECT_PATH)/Instrmnt.o $(OBJECT_PATH)/Filter.o $(OBJECT_PATH)/TwoZero.o $(OBJECT_PATH)/Generator.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/Envelope.o $(OBJECT_PATH)/ADSR.o $(OBJECT_PATH)/BeeThree.o $(OBJECT_PATH)/Messager.o $(OBJECT_PATH)/RtMidi.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/TcpServer.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/Mutex.o $(OBJECT_PATH)/Skini.o $(LIBRARY)
controlbee: controlbee.cpp Stk.o FileRead.o FileWvIn.o FileLoop.o FM.o RtAudio.o TwoZero.o SineWave.o ADSR.o BeeThree.o Messager.o RtMidi.o Socket.o TcpServer.o Thread.o Mutex.o Skini.o
$(CC) $(CFLAGS) $(DEFS) -o controlbee controlbee.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/FileLoop.o $(OBJECT_PATH)/FM.o $(OBJECT_PATH)/RtAudio.o $(OBJECT_PATH)/TwoZero.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/ADSR.o $(OBJECT_PATH)/BeeThree.o $(OBJECT_PATH)/Messager.o $(OBJECT_PATH)/RtMidi.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/TcpServer.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/Mutex.o $(OBJECT_PATH)/Skini.o $(LIBRARY)
foursine: foursine.cpp Stk.o Generator.o SineWave.o FileWrite.o WvOut.o FileWvOut.o
$(CC) $(CFLAGS) $(DEFS) -o foursine foursine.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/Generator.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/FileWrite.o $(OBJECT_PATH)/WvOut.o $(OBJECT_PATH)/FileWvOut.o $(LIBRARY)
foursine: foursine.cpp Stk.o SineWave.o FileWrite.o FileWvOut.o
$(CC) $(CFLAGS) $(DEFS) -o foursine foursine.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/FileWrite.o $(OBJECT_PATH)/FileWvOut.o $(LIBRARY)
threebees: threebees.cpp Stk.o FileRead.o WvIn.o FileWvIn.o WaveLoop.o FM.o RtAudio.o Instrmnt.o Filter.o TwoZero.o Generator.o SineWave.o Envelope.o ADSR.o BeeThree.o Messager.o RtMidi.o Socket.o TcpServer.o Thread.o Mutex.o Skini.o Voicer.o
$(CC) $(CFLAGS) $(DEFS) -o threebees threebees.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/WaveLoop.o $(OBJECT_PATH)/FM.o $(OBJECT_PATH)/RtAudio.o $(OBJECT_PATH)/Instrmnt.o $(OBJECT_PATH)/Filter.o $(OBJECT_PATH)/TwoZero.o $(OBJECT_PATH)/Generator.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/Envelope.o $(OBJECT_PATH)/ADSR.o $(OBJECT_PATH)/BeeThree.o $(OBJECT_PATH)/Messager.o $(OBJECT_PATH)/RtMidi.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/TcpServer.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/Mutex.o $(OBJECT_PATH)/Skini.o $(OBJECT_PATH)/Voicer.o $(LIBRARY)
threebees: threebees.cpp Stk.o FileRead.o FileWvIn.o FileLoop.o FM.o RtAudio.o TwoZero.o SineWave.o ADSR.o BeeThree.o Messager.o RtMidi.o Socket.o TcpServer.o Thread.o Mutex.o Skini.o Voicer.o
$(CC) $(CFLAGS) $(DEFS) -o threebees threebees.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/FileLoop.o $(OBJECT_PATH)/FM.o $(OBJECT_PATH)/RtAudio.o $(OBJECT_PATH)/TwoZero.o $(OBJECT_PATH)/SineWave.o $(OBJECT_PATH)/ADSR.o $(OBJECT_PATH)/BeeThree.o $(OBJECT_PATH)/Messager.o $(OBJECT_PATH)/RtMidi.o $(OBJECT_PATH)/Socket.o $(OBJECT_PATH)/TcpServer.o $(OBJECT_PATH)/Thread.o $(OBJECT_PATH)/Mutex.o $(OBJECT_PATH)/Skini.o $(OBJECT_PATH)/Voicer.o $(LIBRARY)
playsmf: playsmf.cpp Stk.o MidiFileIn.o RtMidi.o
$(CC) $(CFLAGS) $(DEFS) -o playsmf playsmf.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/MidiFileIn.o $(OBJECT_PATH)/RtMidi.o $(LIBRARY)
grains: grains.cpp Stk.o Generator.o Granulate.o Noise.o FileRead.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o grains grains.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/Generator.o $(OBJECT_PATH)/Granulate.o $(OBJECT_PATH)/Noise.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
grains: grains.cpp Stk.o Granulate.o Noise.o FileRead.o RtAudio.o
$(CC) $(CFLAGS) $(DEFS) -o grains grains.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/Granulate.o $(OBJECT_PATH)/Noise.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY)

View File

@@ -160,3 +160,4 @@ SOURCE=..\..\include\RtError.h
# End Group
# End Target
# End Project

View File

@@ -2,6 +2,7 @@
#include "BeeThree.h"
#include "RtAudio.h"
using namespace stk;
// The TickData structure holds all the class instances and data that
// are shared by the various processing functions.

View File

@@ -111,19 +111,11 @@ SOURCE=..\..\src\FileWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Filter.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FM.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Instrmnt.cpp
# Begin Source File
SOURCE=..\..\src\Mutex.cpp
@@ -147,15 +139,7 @@ SOURCE=..\..\src\TwoZero.cpp
# Begin Source File
SOURCE=..\..\src\TwoZero.cpp
SOURCE=..\..\src\WaveLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileLoop.cpp
@@ -197,6 +181,10 @@ SOURCE=..\..\include\Generator.h
SOURCE=..\..\include\Generator.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Instrmnt.h
# End Source File
# Begin Source File
@@ -215,7 +203,7 @@ SOURCE=..\..\include\TwoZero.h
SOURCE=..\..\include\Stk.h
# End Source File
SOURCE=..\..\include\WaveLoop.h
# Begin Source File
SOURCE=..\..\include\TwoZero.h
# End Source File

View File

@@ -8,6 +8,8 @@
#include <algorithm>
using std::min;
using namespace stk;
void usage(void) {
// Error function in case of incorrect command-line
// argument specifications.

View File

@@ -112,22 +112,10 @@ SOURCE=..\..\src\FileWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Filter.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FM.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Instrmnt.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Messager.cpp
# End Source File
# Begin Source File
@@ -176,15 +164,7 @@ SOURCE=..\..\src\TwoZero.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
SOURCE=..\..\src\FileLoop.cpp
# End Source File
# End Group
# Begin Group "Header Files"
@@ -252,7 +232,7 @@ SOURCE=..\..\include\TwoZero.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
SOURCE=..\..\include\FileLoop.h
# End Source File
# Begin Source File

View File

@@ -2,6 +2,7 @@
#include "SineWave.h"
#include "RtAudio.h"
using namespace stk;
// This tick() function handles sample computation only. It will be
// called automatically when the system needs a new buffer of audio

View File

@@ -91,18 +91,6 @@ SOURCE=.\crtsine.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileRead.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
@@ -113,14 +101,6 @@ SOURCE=..\..\src\SineWave.cpp
SOURCE=..\..\src\Stk.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# End Group
# Begin Group "Header Files"
@@ -133,13 +113,9 @@ SOURCE=..\..\include\RtAudio.h
SOURCE=..\..\include\Stk.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# Begin Source File
SOURCE=..\..\include\Generator.h

View File

@@ -10,6 +10,8 @@
#include "RtAudio.h"
#include <iostream>
#include <stdlib.h>
#include <string.h>
/*
typedef signed long MY_TYPE;
@@ -86,10 +88,16 @@ int main(int argc, char *argv[])
// Set the same number of channels for both input and output.
unsigned int bufferFrames = 512;
RtAudio::StreamParameters iParams, oParams;
iParams.deviceId = iDevice;
if ( iDevice == 0 )
iParams.deviceId = adac.getDefaultInputDevice();
else
iParams.deviceId = iDevice - 1;
iParams.nChannels = channels;
iParams.firstChannel = iOffset;
oParams.deviceId = oDevice;
if ( oDevice == 0 )
oParams.deviceId = adac.getDefaultOutputDevice();
else
oParams.deviceId = oDevice - 1;
oParams.nChannels = channels;
oParams.firstChannel = oOffset;

View File

@@ -2,6 +2,7 @@
#include "SineWave.h"
#include "FileWvOut.h"
using namespace stk;
int main()
{
@@ -29,7 +30,7 @@ int main()
for ( i=0; i<4; i++ )
inputs[i].tick( frames, i );
output.tickFrame( frames );
output.tick( frames );
// Now write the first sine to all four channels for two seconds
for ( i=0; i<88200; i++ ) {

View File

@@ -85,18 +85,10 @@ LINK32=link.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\FileRead.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileWrite.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileWvOut.cpp
# End Source File
# Begin Source File
@@ -105,28 +97,12 @@ SOURCE=.\foursine.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\SineWave.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Stk.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
@@ -145,14 +121,6 @@ SOURCE=..\..\include\Stk.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.h
# End Source File
# End Group

View File

@@ -5,6 +5,8 @@
#include "Granulate.h"
#include "RtAudio.h"
using namespace stk;
// This tick() function handles sample computation only. It will be
// called automatically when the system needs a new buffer of audio
// samples.
@@ -13,9 +15,15 @@ int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
{
Granulate *grani = (Granulate *) dataPointer;
register StkFloat *samples = (StkFloat *) outputBuffer;
const StkFrames& lastframe = grani->lastFrame();
unsigned int nChannels = lastframe.channels();
for ( unsigned int i=0; i<nBufferFrames; i++ )
*samples++ = grani->tick();
unsigned int j;
for ( unsigned int i=0; i<nBufferFrames; i++ ) {
grani->tick();
for ( j=0; j<nChannels; j++ )
*samples++ = lastframe[j];
}
return 0;
}
@@ -67,7 +75,7 @@ int main( int argc, char *argv[] )
// Figure out how many bytes in an StkFloat and setup the RtAudio stream.
RtAudio::StreamParameters parameters;
parameters.deviceId = dac.getDefaultOutputDevice();
parameters.nChannels = 1;
parameters.nChannels = grani.channelsOut();
RtAudioFormat format = ( sizeof(StkFloat) == 8 ) ? RTAUDIO_FLOAT64 : RTAUDIO_FLOAT32;
unsigned int bufferFrames = RT_BUFFER_SIZE;
try {

View File

@@ -91,10 +91,6 @@ SOURCE=..\..\src\FileRead.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=.\grains.cpp
# End Source File
# Begin Source File

View File

@@ -31,6 +31,8 @@
#include "InetWvIn.h"
#include "RtWvOut.h"
using namespace stk;
void usage(void) {
// Error function in case of incorrect command-line
// argument specifications.
@@ -73,7 +75,7 @@ int main(int argc, char *argv[])
// Here's the runtime loop.
while ( input.isConnected() )
output->tickFrame( input.tickFrame( frame ) );
output->tick( input.tick( frame ) );
cleanup:
delete output;

View File

@@ -125,14 +125,6 @@ SOURCE=..\..\src\Thread.cpp
SOURCE=..\..\src\UdpSocket.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"

View File

@@ -20,6 +20,8 @@
#include "FileWvIn.h"
#include "InetWvOut.h"
using namespace stk;
void usage(void) {
// Error function in case of incorrect command-line
// argument specifications.
@@ -57,7 +59,7 @@ int main( int argc, char *argv[] )
input.setRate( rate );
// Find out how many channels we have.
int channels = input.getChannels();
int channels = input.channelsOut();
StkFrames frames( 4096, channels );
// Attempt to connect to the socket server.
@@ -71,7 +73,7 @@ int main( int argc, char *argv[] )
// Here's the runtime loop
while ( !input.isFinished() )
output.tickFrame( input.tickFrame( frames ) );
output.tick( input.tick( frames ) );
return 0;
}

View File

@@ -117,14 +117,6 @@ SOURCE=..\..\src\TcpClient.cpp
SOURCE=..\..\src\UdpSocket.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"

View File

@@ -10,17 +10,15 @@ endif
vpath %.h $(INCLUDE)
CC = @CXX@
DEFS = @byte_order@
DEFS += @debug@
CFLAGS = @cflags@
CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include
DEFS = @CPPFLAGS@
DEFS += @byte_order@
CFLAGS = @CXXFLAGS@
CFLAGS += -I$(INCLUDE) -Iinclude
LIBRARY = @LIBS@
LIBRARY += @frameworks@
REALTIME = @realtime@
ifeq ($(REALTIME),yes)
PROGRAMS += audioprobe midiprobe duplex play record inetIn inetOut rtsine crtsine bethree controlbee threebees playsmf grains
DEFS += @audio_apis@
endif
RAWWAVES = @rawwaves@

View File

@@ -5,6 +5,7 @@
// by Gary Scavone, 2003-2004.
#include <iostream>
#include <stdlib.h>
#include "RtMidi.h"
int main()

View File

@@ -19,6 +19,8 @@
#include <signal.h>
#include <iostream>
using namespace stk;
// Eewww ... global variables! :-)
bool done;
StkFrames frames;
@@ -44,7 +46,7 @@ int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
FileWvIn *input = (FileWvIn *) userData;
register StkFloat *samples = (StkFloat *) outputBuffer;
input->tickFrame( frames );
input->tick( frames );
for ( unsigned int i=0; i<frames.size(); i++ )
*samples++ = frames[i];
@@ -85,7 +87,7 @@ int main(int argc, char *argv[])
input.ignoreSampleRateChange();
// Find out how many channels we have.
int channels = input.getChannels();
int channels = input.channelsOut();
// Figure out how many bytes in an StkFloat and setup the RtAudio stream.
RtAudio::StreamParameters parameters;

View File

@@ -103,20 +103,8 @@ SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Stk.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
@@ -127,20 +115,12 @@ SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtWvOut.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Stk.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.h
# End Source File
# End Group
# Begin Group "Resource Files"

View File

@@ -12,6 +12,8 @@
bool done = false;
static void finish(int ignore){ done = true; }
using namespace stk;
void usage(void) {
// Error function in case of incorrect command-line
// argument specifications.

View File

@@ -1,158 +0,0 @@
# Microsoft Developer Studio Project File - Name="probe" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=probe - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "probe.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "probe.mak" CFG="probe - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "probe - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "probe - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "probe - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "probe___Win32_Release"
# PROP BASE Intermediate_Dir "probe___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "probe - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "probe___Win32_Debug"
# PROP BASE Intermediate_Dir "probe___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# 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 /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "probe - Win32 Release"
# Name "probe - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\asio\asio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\iasiothiscallresolver.cpp
# End Source File
# Begin Source File
SOURCE=.\probe.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\src\asio\asio.h
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\asiolist.h
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\asiosys.h
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\ginclude.h
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\iasiothiscallresolver.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -25,6 +25,8 @@
#include "RtWvIn.h"
#include "FileWvOut.h"
using namespace stk;
void usage( void ) {
// Error function in case of incorrect command-line
// argument specifications.
@@ -75,7 +77,7 @@ int main( int argc, char *argv[] )
// Here's the runtime loop
samples = (long) ( time * Stk::sampleRate() );
for ( i=0; i<samples; i++ ) {
output->tickFrame( input->tickFrame( frame ) );
output->tick( input->tick( frame ) );
}
cleanup:

View File

@@ -101,7 +101,11 @@ SOURCE=.\record.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
SOURCE=..\..\src\Mutex.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
@@ -111,14 +115,6 @@ SOURCE=..\..\src\RtWvIn.cpp
SOURCE=..\..\src\RtWvIn.cpp
# End Source File
# Begin Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
SOURCE=..\..\src\Stk.cpp
# End Source File
@@ -131,6 +127,10 @@ SOURCE=..\..\include\RtAudio.h
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtWvIn.h
# End Source File
# Begin Source File

View File

@@ -2,6 +2,7 @@
#include "SineWave.h"
#include "RtWvOut.h"
using namespace stk;
int main()
{
@@ -9,6 +10,7 @@ int main()
Stk::setSampleRate( 44100.0 );
Stk::showWarnings( true );
int nFrames = 100000;
SineWave sine;
RtWvOut *dac = 0;
@@ -22,8 +24,19 @@ int main()
sine.setFrequency( 441.0 );
// Play the oscillator for 40000 samples
for ( int i=0; i<40000; i++ ) {
// Option 1: Use StkFrames
/*
StkFrames frames( nFrames, 1 );
try {
dac->tick( sine.tick( frames ) );
}
catch ( StkError & ) {
goto cleanup;
}
*/
// Option 2: Single-sample computations
for ( int i=0; i<nFrames; i++ ) {
try {
dac->tick( sine.tick() );
}

View File

@@ -87,18 +87,6 @@ LINK32=link.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\FileRead.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
@@ -107,7 +95,11 @@ SOURCE=.\rtsine.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvOut.cpp
SOURCE=..\..\src\Mutex.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvOut.cpp
@@ -117,32 +109,12 @@ SOURCE=..\..\src\SineWave.cpp
SOURCE=..\..\src\SineWave.cpp
# End Source File
# Begin Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
SOURCE=..\..\src\Stk.cpp
# End Source File
# End Group
# Begin Group "Header Files"
SOURCE=..\..\include\FileRead.h
# End Source File
# Begin Source File
SOURCE=..\..\include\FileWvIn.h
# End Source File
# Begin Source File
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
@@ -153,13 +125,9 @@ SOURCE=..\..\include\RtWvOut.h
SOURCE=..\..\include\RtWvOut.h
# End Source File
# Begin Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
SOURCE=..\..\include\Stk.h
# End Source File
# Begin Source File

View File

@@ -14,6 +14,7 @@
#include "SineWave.h"
#include "FileWvOut.h"
using namespace stk;
void usage(void) {
// Error function in case of incorrect command-line
@@ -73,7 +74,7 @@ int main( int argc, char *argv[] )
for ( i=0; i<channels; i++ )
oscs[i]->tick( frames, i );
output.tickFrame( frames );
output.tick( frames );
cleanup:
for ( i=0; i<channels; i++ )

View File

@@ -87,26 +87,14 @@ LINK32=link.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\FileRead.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileWrite.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FileWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=.\sine.cpp
# End Source File
# Begin Source File
@@ -117,18 +105,6 @@ SOURCE=..\..\src\SineWave.cpp
SOURCE=..\..\src\Stk.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
@@ -137,18 +113,18 @@ SOURCE=..\..\src\WvOut.cpp
SOURCE=..\..\include\Stk.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# Begin Source File
SOURCE=..\..\include\FileWrite.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.h
# End Source File
# Begin Source File

View File

@@ -1,14 +1,16 @@
// sineosc.cpp STK tutorial program
#include "WaveLoop.h"
#include "FileLoop.h"
#include "FileWvOut.h"
using namespace stk;
int main()
{
// Set the global sample rate before creating class instances.
Stk::setSampleRate( 44100.0 );
WaveLoop input;
int nFrames = 100000;
FileLoop input;
FileWvOut output;
try {
@@ -24,10 +26,19 @@ int main()
input.setFrequency( 440.0 );
// Run the oscillator for 40000 samples, writing to the output file
int i;
for ( i=0; i<40000; i++ ) {
// Option 1: Use StkFrames
/*
StkFrames frames( nFrames, 1 );
try {
output.tick( input.tick( frames ) );
}
catch ( StkError & ) {
exit( 1 );
}
*/
// Option 2: Single-sample computations
for ( int i=0; i<nFrames; i++ ) {
try {
output.tick( input.tick() );
}

View File

@@ -102,10 +102,6 @@ SOURCE=..\..\src\FileWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=.\sineosc.cpp
# End Source File
# Begin Source File
@@ -114,15 +110,7 @@ SOURCE=..\..\src\Stk.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
SOURCE=..\..\src\FileLoop.cpp
# End Source File
# End Group
# Begin Group "Header Files"
@@ -138,7 +126,19 @@ SOURCE=..\..\include\Stk.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
SOURCE=..\..\include\FileRead.h
# End Source File
# Begin Source File
SOURCE=..\..\include\FileWrite.h
# End Source File
# Begin Source File
SOURCE=..\..\include\FileLoop.h
# End Source File

View File

@@ -9,6 +9,8 @@
#include <algorithm>
using std::min;
using namespace stk;
// The TickData structure holds all the class instances and data that
// are shared by the various processing functions.
struct TickData {

View File

@@ -107,22 +107,10 @@ SOURCE=..\..\src\FileWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Filter.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\FM.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Instrmnt.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Messager.cpp
# End Source File
# Begin Source File
@@ -179,15 +167,7 @@ SOURCE=..\..\src\Voicer.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
SOURCE=..\..\src\FileLoop.cpp
# End Source File
# End Group
# Begin Group "Header Files"
@@ -259,7 +239,7 @@ SOURCE=..\..\include\Voicer.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
SOURCE=..\..\include\FileLoop.h
# End Source File
# Begin Source File

View File

@@ -13,15 +13,17 @@
Stanford, bearing the names of Karplus and/or
Strong.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
by Perry R. Cook and Gary P. Scavone, 1995 - 2009.
*/
/***************************************************/
#include "Drone.h"
namespace stk {
Drone :: Drone( StkFloat lowestFrequency )
{
length_ = (unsigned long) (Stk::sampleRate() / lowestFrequency + 1);
length_ = (unsigned long) ( Stk::sampleRate() / lowestFrequency + 1 );
loopGain_ = 0.999;
delayLine_.setMaximumDelay( length_ );
delayLine_.setDelay( 0.5 * length_ );
@@ -29,11 +31,11 @@ Drone :: Drone( StkFloat lowestFrequency )
this->clear();
}
Drone :: ~Drone()
Drone :: ~Drone( void )
{
}
void Drone :: clear()
void Drone :: clear( void )
{
delayLine_.clear();
loopFilter_.clear();
@@ -95,11 +97,4 @@ void Drone :: noteOff( StkFloat amplitude )
#endif
}
StkFloat Drone :: computeSample()
{
// Here's the whole inner loop of the instrument!!
lastOutput_ = delayLine_.tick( loopFilter_.tick( delayLine_.lastOut() * loopGain_ )
+ (0.005 * envelope_.tick() * noise_.tick()));
return lastOutput_;
}
} // stk namespace

View File

@@ -1,3 +1,14 @@
#ifndef STK_DRONE_H
#define STK_DRONE_H
#include "Instrmnt.h"
#include "DelayA.h"
#include "OneZero.h"
#include "ADSR.h"
#include "Noise.h"
namespace stk {
/***************************************************/
/*! \class Drone
\brief STK "drone" plucked string model.
@@ -13,19 +24,10 @@
Stanford, bearing the names of Karplus and/or
Strong.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
by Perry R. Cook and Gary P. Scavone, 1995 - 2009.
*/
/***************************************************/
#ifndef STK_DRONE_H
#define STK_DRONE_H
#include "Instrmnt.h"
#include "DelayA.h"
#include "OneZero.h"
#include "ADSR.h"
#include "Noise.h"
class Drone : public Instrmnt
{
public:
@@ -33,27 +35,28 @@ class Drone : public Instrmnt
Drone( StkFloat lowestFrequency = 20 );
//! Class destructor.
~Drone();
~Drone( void );
//! Reset and clear all internal state.
void clear();
void clear( void );
//! Set instrument parameters for a particular frequency.
virtual void setFrequency(StkFloat frequency);
void setFrequency( StkFloat frequency );
//! Pluck the string with the given amplitude using the current frequency.
void pluck(StkFloat amplitude);
void pluck( StkFloat amplitude );
//! Start a note with the given frequency and amplitude.
virtual void noteOn(StkFloat frequency, StkFloat amplitude);
void noteOn( StkFloat frequency, StkFloat amplitude );
//! Stop a note with the given amplitude (speed of decay).
virtual void noteOff(StkFloat amplitude);
void noteOff( StkFloat amplitude );
//! Compute and return one output sample.
StkFloat tick( unsigned int channel = 0 );
protected:
StkFloat computeSample( void );
DelayA delayLine_;
OneZero loopFilter_;
ADSR envelope_;
@@ -63,5 +66,15 @@ class Drone : public Instrmnt
};
inline StkFloat Drone :: tick( unsigned int )
{
// Here's the whole inner loop of the instrument!!
lastFrame_[0] = delayLine_.tick( loopFilter_.tick( delayLine_.lastOut() * loopGain_ )
+ ( 0.005 * envelope_.tick() * noise_.tick() ) );
return lastFrame_[0];
}
} // stk namespace
#endif

View File

@@ -7,12 +7,12 @@ SRC_PATH = ../../src
OBJECT_PATH = @object_path@
vpath %.o $(OBJECT_PATH)
OBJECTS = Stk.o Generator.o Noise.o Envelope.o ADSR.o \
Filter.o DelayA.o Delay.o \
OBJECTS = Stk.o Noise.o ADSR.o \
DelayA.o Delay.o \
OnePole.o OneZero.o Skini.o \
Tabla.o Instrmnt.o Sitar.o \
Drone.o VoicDrum.o FileRead.o WvOut.o WvIn.o FileWvIn.o \
Effect.o JCRev.o Messager.o
Tabla.o Sitar.o \
Drone.o VoicDrum.o FileRead.o FileWvIn.o \
JCRev.o Messager.o
INCLUDE = @include@
ifeq ($(strip $(INCLUDE)), )
@@ -21,18 +21,16 @@ endif
vpath %.h $(INCLUDE)
CC = @CXX@
DEFS = @byte_order@
DEFS += @debug@
CFLAGS = @cflags@
CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include
DEFS = @CPPFLAGS@
DEFS += @byte_order@
CFLAGS = @CXXFLAGS@
CFLAGS += -I$(INCLUDE) -I$(INCLUDE)/../src/include
LIBRARY = @LIBS@
LIBRARY += @frameworks@
REALTIME = @realtime@
ifeq ($(REALTIME),yes)
PROGRAMS = ragamat
OBJECTS += RtMidi.o RtAudio.o RtWvOut.o Thread.o Mutex.o Socket.o TcpServer.o @objects@
DEFS += @audio_apis@
endif
RAWWAVES = @rawwaves@
@@ -60,6 +58,7 @@ $(OBJECTS) : Stk.h
clean :
-rm $(OBJECT_PATH)/*.o
-rm $(PROGRAMS) *.exe
-rm -fR *.dSYM
strip :
strip $(PROGRAMS)

View File

@@ -8,14 +8,16 @@
sample rates. You can specify the maximum polyphony (maximum
number of simultaneous voices) in Tabla.h.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
by Perry R. Cook and Gary P. Scavone, 1995 - 2009.
*/
/***************************************************/
#include "Tabla.h"
#include <cmath>
Tabla :: Tabla() : Instrmnt()
namespace stk {
Tabla :: Tabla( void ) : Instrmnt()
{
// This counts the number of sounding voices.
nSounding_ = 0;
@@ -23,7 +25,7 @@ Tabla :: Tabla() : Instrmnt()
soundNumber_ = std::vector<int> (TABLA_POLYPHONY, -1);
}
Tabla :: ~Tabla()
Tabla :: ~Tabla( void )
{
}
@@ -45,7 +47,7 @@ static char tablaWaves[TABLA_NUMWAVES][16] =
"DrTak2.raw"
};
void Tabla :: noteOn(StkFloat instrument, StkFloat amplitude)
void Tabla :: noteOn( StkFloat instrument, StkFloat amplitude )
{
#if defined(_STK_DEBUG_)
errorString_ << "Tabla::noteOn: instrument = " << instrument << ", amplitude = " << amplitude << '.';
@@ -117,34 +119,11 @@ void Tabla :: noteOn(StkFloat instrument, StkFloat amplitude)
#endif
}
void Tabla :: noteOff(StkFloat amplitude)
void Tabla :: noteOff( StkFloat amplitude )
{
// Set all sounding wave filter gains low.
int i = 0;
while ( i < nSounding_ ) filters_[i++].setGain( amplitude * 0.01 );
}
StkFloat Tabla :: computeSample()
{
lastOutput_ = 0.0;
if ( nSounding_ == 0 ) return lastOutput_;
for ( int i=0; i<TABLA_POLYPHONY; i++ ) {
if ( soundOrder_[i] >= 0 ) {
if ( waves_[i].isFinished() ) {
// Re-order the list.
for ( int j=0; j<TABLA_POLYPHONY; j++ ) {
if ( soundOrder_[j] > soundOrder_[i] )
soundOrder_[j] -= 1;
}
soundOrder_[i] = -1;
nSounding_--;
}
else
lastOutput_ += filters_[i].tick( waves_[i].tick() );
}
}
return lastOutput_;
}
} // stk namespace

View File

@@ -1,3 +1,12 @@
#ifndef STK_TABLA_H
#define STK_TABLA_H
#include "Instrmnt.h"
#include "FileWvIn.h"
#include "OnePole.h"
namespace stk {
/***************************************************/
/*! \class Tabla
\brief STK tabla drum class.
@@ -8,17 +17,10 @@
sample rates. You can specify the maximum polyphony (maximum
number of simultaneous voices) in Tabla.h.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
by Perry R. Cook and Gary P. Scavone, 1995 - 2009.
*/
/***************************************************/
#ifndef STK_TABLA_H
#define STK_TABLA_H
#include "Instrmnt.h"
#include "FileWvIn.h"
#include "OnePole.h"
const int TABLA_NUMWAVES = 15;
const int TABLA_POLYPHONY = 4;
@@ -26,27 +28,54 @@ class Tabla : public Instrmnt
{
public:
//! Class constructor.
Tabla();
Tabla( void );
//! Class destructor.
~Tabla();
~Tabla( void );
//! Start a note with the given drum type and amplitude.
void noteOn(StkFloat instrument, StkFloat amplitude);
void noteOn( StkFloat instrument, StkFloat amplitude );
//! Stop a note with the given amplitude (speed of decay).
void noteOff(StkFloat amplitude);
void noteOff( StkFloat amplitude );
//! Compute and return one output sample.
StkFloat tick( unsigned int channel = 0 );
protected:
StkFloat computeSample( void );
FileWvIn waves_[TABLA_POLYPHONY];
OnePole filters_[TABLA_POLYPHONY];
std::vector<int> soundOrder_;
std::vector<int> soundNumber_;
int nSounding_;
int nSounding_;
};
inline StkFloat Tabla :: tick( unsigned int )
{
lastFrame_[0] = 0.0;
if ( nSounding_ == 0 ) return lastFrame_[0];
for ( int i=0; i<TABLA_POLYPHONY; i++ ) {
if ( soundOrder_[i] >= 0 ) {
if ( waves_[i].isFinished() ) {
// Re-order the list.
for ( int j=0; j<TABLA_POLYPHONY; j++ ) {
if ( soundOrder_[j] > soundOrder_[i] )
soundOrder_[j] -= 1;
}
soundOrder_[i] = -1;
nSounding_--;
}
else
lastFrame_[0] += filters_[i].tick( waves_[i].tick() );
}
}
return lastFrame_[0];
}
} // stk namespace
#endif

View File

@@ -8,14 +8,16 @@
sample rates. You can specify the maximum polyphony (maximum
number of simultaneous voices) in VoicDrum.h.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
by Perry R. Cook and Gary P. Scavone, 1995 - 2009.
*/
/***************************************************/
#include "VoicDrum.h"
#include <cmath>
VoicDrum :: VoicDrum() : Instrmnt()
namespace stk {
VoicDrum :: VoicDrum( void ) : Instrmnt()
{
// This counts the number of sounding voices.
nSounding_ = 0;
@@ -23,7 +25,7 @@ VoicDrum :: VoicDrum() : Instrmnt()
soundNumber_ = std::vector<int> (VOICE_POLYPHONY, -1);
}
VoicDrum :: ~VoicDrum()
VoicDrum :: ~VoicDrum( void )
{
}
@@ -114,33 +116,11 @@ void VoicDrum :: noteOn( StkFloat instrument, StkFloat amplitude )
#endif
}
void VoicDrum :: noteOff(StkFloat amplitude)
void VoicDrum :: noteOff( StkFloat amplitude )
{
// Set all sounding wave filter gains low.
int i = 0;
while ( i < nSounding_ ) filters_[i++].setGain( amplitude * 0.01 );
}
StkFloat VoicDrum :: computeSample()
{
lastOutput_ = 0.0;
if ( nSounding_ == 0 ) return lastOutput_;
for ( int i=0; i<VOICE_POLYPHONY; i++ ) {
if ( soundOrder_[i] >= 0 ) {
if ( waves_[i].isFinished() ) {
// Re-order the list.
for ( int j=0; j<VOICE_POLYPHONY; j++ ) {
if ( soundOrder_[j] > soundOrder_[i] )
soundOrder_[j] -= 1;
}
soundOrder_[i] = -1;
nSounding_--;
}
else
lastOutput_ += filters_[i].tick( waves_[i].tick() );
}
}
return lastOutput_;
}
} // stk namespace

View File

@@ -1,3 +1,12 @@
#ifndef STK_VOICDRUM_H
#define STK_VOICDRUM_H
#include "Instrmnt.h"
#include "FileWvIn.h"
#include "OnePole.h"
namespace stk {
/***************************************************/
/*! \class VoicDrum
\brief STK vocal drum sample player class.
@@ -8,17 +17,10 @@
sample rates. You can specify the maximum polyphony (maximum
number of simultaneous voices) in VoicDrum.h.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
by Perry R. Cook and Gary P. Scavone, 1995 - 2009.
*/
/***************************************************/
#ifndef STK_VOICDRUM_H
#define STK_VOICDRUM_H
#include "Instrmnt.h"
#include "FileWvIn.h"
#include "OnePole.h"
const int VOICE_NUMWAVES = 11;
const int VOICE_POLYPHONY = 4;
@@ -26,21 +28,22 @@ class VoicDrum : public Instrmnt
{
public:
//! Class constructor.
VoicDrum();
VoicDrum( void );
//! Class destructor.
~VoicDrum();
~VoicDrum( void );
//! Start a note with the given drum type and amplitude.
void noteOn(StkFloat instrument, StkFloat amplitude);
void noteOn( StkFloat instrument, StkFloat amplitude );
//! Stop a note with the given amplitude (speed of decay).
void noteOff(StkFloat amplitude);
void noteOff( StkFloat amplitude );
//! Compute and return one output sample.
StkFloat tick( unsigned int channel = 0 );
protected:
StkFloat computeSample( void );
FileWvIn waves_[VOICE_POLYPHONY];
OnePole filters_[VOICE_POLYPHONY];
std::vector<int> soundOrder_;
@@ -49,4 +52,30 @@ class VoicDrum : public Instrmnt
};
inline StkFloat VoicDrum :: tick( unsigned int )
{
lastFrame_[0] = 0.0;
if ( nSounding_ == 0 ) return lastFrame_[0];
for ( int i=0; i<VOICE_POLYPHONY; i++ ) {
if ( soundOrder_[i] >= 0 ) {
if ( waves_[i].isFinished() ) {
// Re-order the list.
for ( int j=0; j<VOICE_POLYPHONY; j++ ) {
if ( soundOrder_[j] > soundOrder_[i] )
soundOrder_[j] -= 1;
}
soundOrder_[i] = -1;
nSounding_--;
}
else
lastFrame_[0] += filters_[i].tick( waves_[i].tick() );
}
}
return lastFrame_[0];
}
} // stk namespace
#endif

View File

@@ -11,9 +11,11 @@
#include "RtAudio.h"
#include <signal.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using std::min;
using namespace stk;
StkFloat float_random(StkFloat max) // Return random float between 0.0 and max
{

View File

@@ -124,10 +124,6 @@ SOURCE=.\Drone.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Effect.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Effect.h
# End Source File
# Begin Source File
@@ -156,26 +152,14 @@ SOURCE=..\..\include\FileWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Filter.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Filter.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Generator.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Generator.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Instrmnt.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Instrmnt.h
# End Source File
# Begin Source File
@@ -312,15 +296,11 @@ SOURCE=.\VoicDrum.h
# End Source File
# Begin Source File
SOURCE=..\..\src\WaveLoop.cpp
SOURCE=..\..\src\FileLoop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\WaveLoop.h
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
SOURCE=..\..\include\FileLoop.h
# End Source File
# Begin Source File
@@ -328,10 +308,6 @@ SOURCE=..\..\include\WvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.h
# End Source File
# End Target