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

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(" (won't work under Win95/98),\n");
printf(" and flag = -is for realtime SKINI input by socket.\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 <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,21 +54,36 @@ 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") )
controlMask |= STK_SOCKET;
else if (!strcmp(argv[1],"-ip") )
controlMask |= STK_PIPE;
else
usage();
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;
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.
messager = new Messager( controlMask );
if ( controlMask & STK_SOCKET && port >= 0 )
messager = new Messager( controlMask, port );
else
messager = new Messager( controlMask );
}
catch (StkError &) {
exit(0);
@@ -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());