Version 4.1.2

This commit is contained in:
Gary Scavone
2009-03-24 23:02:13 -04:00
committed by Stephen Sinclair
parent 6e0d1955a8
commit 586b0add5f
125 changed files with 7301 additions and 5337 deletions

View File

@@ -22,7 +22,7 @@ LIBRARY += @frameworks@
REALTIME = @realtime@
ifeq ($(REALTIME),yes)
DEFS += @sound_api@
DEFS += @audio_apis@
DEFS += @midiator@
endif

View File

@@ -5,8 +5,9 @@
int main()
{
// Set the global sample rate before creating class instances.
// Set the global sample rate and rawwave path before creating class instances.
Stk::setSampleRate( 44100.0 );
Stk::setRawwavePath( "../../rawwaves/" );
Instrmnt *instrument = 0;
RtWvOut *output = 0;

View File

@@ -8,8 +8,9 @@
int main()
{
// Set the global sample rate before creating class instances.
// Set the global sample rate and rawwave path before creating class instances.
Stk::setSampleRate( 44100.0 );
Stk::setRawwavePath( "../../rawwaves/" );
Instrmnt *instrument = 0;
RtWvOut *output = 0;

View File

@@ -16,7 +16,8 @@
#include "RtDuplex.h"
#include <stdio.h>
#if defined(__OS_LINUX_) || defined(__OS_IRIX__)
#if defined(__OS_LINUX__) || defined(__OS_IRIX__)
#include <unistd.h>
#include <sched.h>
#endif

View File

@@ -0,0 +1,77 @@
### STK examples Makefile - for various flavors of unix
PROGRAMS = sine play record io tcpIn tcpOut sineosc rtsine bethree controlbee foursine threebees
RM = /bin/rm
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 += @audio_apis@
DEFS += @midiator@
endif
RAWWAVES = @rawwaves@
ifeq ($(strip $(RAWWAVES)), )
RAWWAVES = ../../rawwaves/
endif
DEFS += -DRAWWAVE_PATH=\"$(RAWWAVES)\"
all : $(PROGRAMS)
$(OBJECTS) : Stk.h
clean :
-rm $(PROGRAMS)
strip :
strip $(PROGRAMS)
#play: play.cpp Stk.o WvIn.o WvOut.o RtWvOut.o RtAudio.o
play: play.cpp
$(CC) $(CFLAGS) $(DEFS) -o play play.cpp -L../../src $(LIBRARY) -lstk
record: record.cpp
$(CC) $(CFLAGS) $(DEFS) -o record record.cpp -L../../src $(LIBRARY) -lstk
sine: sine.cpp
$(CC) $(CFLAGS) $(DEFS) -o sine sine.cpp -L../../src $(LIBRARY) -lstk
io: io.cpp
$(CC) $(CFLAGS) $(DEFS) -o io io.cpp -L../../src $(LIBRARY) -lstk
tcpIn: tcpIn.cpp
$(CC) $(CFLAGS) $(DEFS) -o tcpIn tcpIn.cpp -L../../src $(LIBRARY) -lstk
tcpOut: tcpOut.cpp
$(CC) $(CFLAGS) $(DEFS) -o tcpOut tcpOut.cpp -L../../src $(LIBRARY) -lstk
sineosc: sineosc.cpp
$(CC) $(CFLAGS) $(DEFS) -o sineosc sineosc.cpp -L../../src $(LIBRARY) -lstk
rtsine: rtsine.cpp
$(CC) $(CFLAGS) $(DEFS) -o rtsine rtsine.cpp -L../../src $(LIBRARY) -lstk
bethree: bethree.cpp
$(CC) $(CFLAGS) $(DEFS) -o bethree bethree.cpp -L../../src $(LIBRARY) -lstk
controlbee: controlbee.cpp
$(CC) $(CFLAGS) $(DEFS) -o controlbee controlbee.cpp -L../../src $(LIBRARY) -lstk
foursine: foursine.cpp
$(CC) $(CFLAGS) $(DEFS) -o foursine foursine.cpp -L../../src $(LIBRARY) -lstk
threebees: threebees.cpp
$(CC) $(CFLAGS) $(DEFS) -o threebees threebees.cpp -L../../src $(LIBRARY) -lstk

View File

@@ -44,12 +44,10 @@ int main(int argc, char *argv[])
exit(0);
}
// Set the global STK sample rate to the file rate.
Stk::setSampleRate( input->getFileRate() );
// Set input read rate.
// Set input read rate based on the default STK sample rate.
float rate = 1.0;
if ( argc == 3 ) rate = atof(argv[2]);
rate = input->getFileRate() / Stk::sampleRate();
if ( argc == 3 ) rate *= atof(argv[2]);
input->setRate( rate );
// Find out how many channels we have.
@@ -57,7 +55,7 @@ int main(int argc, char *argv[])
// Define and open the realtime output device
try {
output = new RtWvOut( channels, Stk::sampleRate(), 0, 512, 4 );
output = new RtWvOut( channels, Stk::sampleRate(), 0, RT_BUFFER_SIZE, 4 );
}
catch (StkError &) {
goto cleanup;

View File

@@ -15,7 +15,6 @@
#include "WaveLoop.h"
#include "WvOut.h"
#include <stdlib.h>
#include <iostream.h>
void usage(void) {
// Error function in case of incorrect command-line
@@ -68,7 +67,7 @@ main(int argc, char *argv[])
// Define and open the soundfile for output. Other file
// format options include: WVOUT_SND, WVOUT_AIF, WVOUT_MAT,
// and WVOUT_RAW. Other data type options include:
// STK_SINT8, STK_SINT32, STK_FLOAT32, and STK_FLOAT64.
// STK_SINT8, STK_SINT32, MY_FLOAT32, and MY_FLOAT64.
try {
output = new WvOut( argv[2], channels, WvOut::WVOUT_WAV, Stk::STK_SINT16 );
}

View File

@@ -8,8 +8,9 @@
int main()
{
// Set the global sample rate before creating class instances.
// Set the global sample rate and rawwave path before creating class instances.
Stk::setSampleRate( 44100.0 );
Stk::setRawwavePath( "../../rawwaves/" );
int i;
RtWvOut *output = 0;