mirror of
https://github.com/thestk/stk
synced 2026-04-23 23:58:38 +00:00
Version 4.4.0
This commit is contained in:
committed by
Stephen Sinclair
parent
d199342e86
commit
eccd8c9981
@@ -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)
|
||||
|
||||
@@ -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[] )
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user