Version 3.2

This commit is contained in:
Gary Scavone
2013-09-25 14:47:10 +02:00
committed by Stephen Sinclair
parent 4b6500d3de
commit 3f126af4e5
443 changed files with 11772 additions and 8060 deletions

123
projects/effects/Chorus.cpp Normal file
View File

@@ -0,0 +1,123 @@
/******************************************/
/* Chorus Effect Applied to Soundfile */
/* by Perry Cook, 1996 */
/******************************************/
#include "Chorus.h"
Chorus :: Chorus(MY_FLOAT baseDelay)
{
delayLine[0] = new DLineL((long) (baseDelay * 1.414) + 2);
delayLine[1] = new DLineL((long) (baseDelay) + 2);
delayLine[0]->setDelay(baseDelay);
delayLine[1]->setDelay(baseDelay);
baseLength = baseDelay;
// Concatenate the STK RAWWAVE_PATH to the rawwave file
char temp[128];
strcpy(temp, RAWWAVE_PATH);
mods[0] = new RawWvIn(strcat(temp,"rawwaves/sinewave.raw"),"looping");
strcpy(temp, RAWWAVE_PATH);
mods[1] = new RawWvIn(strcat(temp,"rawwaves/sinewave.raw"),"looping");
mods[0]->setFreq(0.2);
mods[1]->setFreq(0.222222);
modDepth = 0.05;
effectMix = (MY_FLOAT) 0.5;
this->clear();
}
Chorus :: ~Chorus()
{
delete delayLine[0];
delete delayLine[1];
delete mods[0];
delete mods[1];
}
void Chorus :: clear()
{
delayLine[0]->clear();
delayLine[1]->clear();
lastOutL = (MY_FLOAT) 0.0;
lastOutR = (MY_FLOAT) 0.0;
}
void Chorus :: setEffectMix(MY_FLOAT mix)
{
effectMix = mix;
}
void Chorus :: setModDepth(MY_FLOAT depth)
{
modDepth = depth;
}
void Chorus :: setModFreq(MY_FLOAT freq)
{
mods[0]->setFreq(freq);
mods[1]->setFreq(freq*1.1111);
}
MY_FLOAT Chorus :: lastOutput()
{
return (lastOutL + lastOutR) * (MY_FLOAT) 0.5;
}
MY_FLOAT Chorus :: lastOutputL()
{
return lastOutL;
}
MY_FLOAT Chorus :: lastOutputR()
{
return lastOutR;
}
MY_FLOAT Chorus :: tick(MY_FLOAT input)
{
delayLine[0]->setDelay(baseLength * 0.707 * (1.0 + mods[0]->tick()));
delayLine[1]->setDelay(baseLength * 0.5 * (1.0 - mods[1]->tick()));
lastOutL = input * (1.0 - effectMix);
lastOutL += effectMix * delayLine[0]->tick(input);
lastOutR = input * (1.0 - effectMix);
lastOutR += effectMix * delayLine[1]->tick(input);
return (lastOutL + lastOutR) * (MY_FLOAT) 0.5;
}
/************** Test Main Program *********************/
/*
int main(int argc, char *argv[])
{
FILE *soundIn,*soundOut;
short data;
float efMix,maxDel;
Chorus *effect;
if (argc==5) {
soundIn = fopen(argv[3],"rb");
soundOut = fopen(argv[4],"wb");
if (soundIn && soundOut) {
efMix = atof(argv[1]);
maxDel = atof(argv[2]);
effect = new Chorus(maxDel);
effect->setEffectMix(efMix);
while (fread(&data,2,1,soundIn)) {
data = effect->tick(data);
fwrite(&data,2,1,soundOut);
}
delete effect;
fclose(soundIn);
fclose(soundOut);
}
else {
printf("Can't open one of the files\n");
}
}
else {
printf("useage: Chorus mix maxDelay soundIn.snd soundOut.snd\n");
printf("0.0 <= mix <= 1.0\n");
printf("maxDelay is in samples\n");
printf("soundfiles are 16 bit linear mono or stereo\n");
}
}
*/

37
projects/effects/Chorus.h Normal file
View File

@@ -0,0 +1,37 @@
/******************************************/
/* Chorus Effect */
/* by Perry Cook, 1996 */
/******************************************/
#if !defined(__Chorus_h)
#define __Chorus_h
#include "Object.h"
#include "DLineL.h"
#include "RawWvIn.h"
class Chorus : public Object
{
protected:
DLineL *delayLine[2];
RawWvIn *mods[2];
MY_FLOAT baseLength;
MY_FLOAT modDepth;
MY_FLOAT lastOutL;
MY_FLOAT lastOutR;
MY_FLOAT effectMix;
public:
Chorus(MY_FLOAT baseDelay);
~Chorus();
void clear();
void setModDepth(MY_FLOAT depth);
void setModFreq(MY_FLOAT freq);
void setEffectMix(MY_FLOAT mix);
MY_FLOAT lastOutput();
MY_FLOAT lastOutputL();
MY_FLOAT lastOutputR();
MY_FLOAT tick(MY_FLOAT input);
};
#endif

44
projects/effects/Echo.cpp Normal file
View File

@@ -0,0 +1,44 @@
/******************************************/
/* Echo Effect */
/* by Perry Cook, 1996 */
/******************************************/
#include "Echo.h"
Echo :: Echo(MY_FLOAT longestDelay)
{
length = (long) longestDelay + 2;
delayLine = new DLineN(length);
effectMix = 0.5;
this->clear();
this->setDelay(longestDelay);
}
Echo :: ~Echo()
{
delete delayLine;
}
void Echo :: clear()
{
delayLine->clear();
lastOut = 0.0;
}
void Echo :: setDelay(MY_FLOAT delay)
{
delayLine->setDelay(delay);
}
void Echo :: setEffectMix(MY_FLOAT mix)
{
effectMix = mix;
}
MY_FLOAT Echo :: tick(MY_FLOAT input)
{
lastOut = effectMix * delayLine->tick(input);
lastOut += input * (1.0 - effectMix);
return lastOut;
}

30
projects/effects/Echo.h Normal file
View File

@@ -0,0 +1,30 @@
/******************************************/
/* Echo Effect Applied to Soundfile */
/* by Perry Cook, 1996 */
/******************************************/
#if !defined(__Echo_h)
#define __Echo_h
#include "Object.h"
#include "DLineN.h"
class Echo : public Object
{
protected:
DLineN *delayLine;
long length;
MY_FLOAT lastOut;
MY_FLOAT effectMix;
public:
Echo(MY_FLOAT longestDelay);
~Echo();
void clear();
void setDelay(MY_FLOAT delay);
void setEffectMix(MY_FLOAT mix);
MY_FLOAT lastOutput();
MY_FLOAT tick(MY_FLOAT input);
};
#endif

1
projects/effects/GUIeffects Executable file
View File

@@ -0,0 +1 @@
wish < tcl/Effects.tcl | effects -ip

60
projects/effects/Makefile Normal file
View File

@@ -0,0 +1,60 @@
# Effects Makefile
OS = $(shell uname)
# The following definition indicates the relative location of
# the core STK classes.
STK_PATH = ../../src/
O_FILES = Object.o Reverb.o PRCRev.o JCRev.o \
NRev.o RtAudio.o DLineN.o Filter.o \
RtDuplex.o SKINI11.o Envelope.o Echo.o \
PitShift.o DLineL.o Chorus.o RawWvIn.o \
WvIn.o ByteSwap.o StkError.o Controller.o \
RtMidi.o
RM = /bin/rm
ifeq ($(OS),IRIX) # These are for SGI
INSTR = effects
CC = CC -O2 -D__OS_IRIX_ # -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__OS_Linux_ # -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) :
Echo.o: Echo.cpp
$(CC) $(INCLUDE) -c Echo.cpp
PitShift.o: PitShift.cpp
$(CC) $(INCLUDE) -c PitShift.cpp
Chorus.o: Chorus.cpp
$(CC) $(INCLUDE) -c Chorus.cpp

View File

@@ -0,0 +1,53 @@
# STK Makefile for Effects project- SGI solo version (non-GNU Makefile utilities version)
# The following definition indicates the relative location of
# the core STK classes.
STK_PATH = ../../src/
O_FILES = $(STK_PATH)Object.o $(STK_PATH)Envelope.o $(STK_PATH)Filter.o \
$(STK_PATH)DLineL.o $(STK_PATH)DLineN.o $(STK_PATH)ByteSwap.o \
$(STK_PATH)SKINI11.o $(STK_PATH)WvIn.o $(STK_PATH)RawWvIn.o \
$(STK_PATH)Reverb.o $(STK_PATH)PRCRev.o $(STK_PATH)JCRev.o \
$(STK_PATH)NRev.o $(STK_PATH)RtAudio.o $(STK_PATH)RtMidi.o \
$(STK_PATH)RtDuplex.o $(STK_PATH)StkError.o $(STK_PATH)Controller.o
O_LOCAL_FILES = Echo.o PitShift.o Chorus.o
RM = /bin/rm
INSTR = effects
CC = CC -O2 -D__OS_IRIX_ # -g -fullwarn -D__SGI_CC__
LIBRARY = -L/usr/sgitcl/lib -laudio -lmd -lm -lpthread
INCLUDE = -I../../include/
.SUFFIXES: .cpp
.cpp.o: $(O_FILES)
$(CC) $(INCLUDE) -c -o $@ $<
all: $(INSTR)
effects: effects.cpp $(O_FILES) $(O_LOCAL_FILES)
$(CC) -o effects effects.cpp $(O_FILES) $(O_LOCAL_FILES) $(LIBRARY) $(INCLUDE)
clean :
rm *.o
rm $(STK_PATH)*.o
rm $(INSTR)
cleanIns :
rm $(INSTR)
strip :
strip $(INSTR)
# $(O_FILES) :
Echo.o: Echo.cpp
$(CC) $(INCLUDE) -c Echo.cpp
PitShift.o: PitShift.cpp
$(CC) $(INCLUDE) -c PitShift.cpp
Chorus.o: Chorus.cpp
$(CC) $(INCLUDE) -c Chorus.cpp

View File

@@ -0,0 +1,106 @@
/*********************************************/
/* PitchShift Effect */
/* by Perry Cook, 1996 */
/*********************************************/
#include "PitShift.h"
PitShift :: PitShift()
{
delayLine[0] = new DLineL((long) 1024);
delayLine[1] = new DLineL((long) 1024);
delay[0] = 12;
delay[1] = 512;
delayLine[0]->setDelay(delay[0]);
delayLine[1]->setDelay(delay[1]);
effectMix = (MY_FLOAT) 0.5;
rate = 1.0;
}
PitShift :: ~PitShift()
{
delete delayLine[0];
delete delayLine[1];
}
void PitShift :: setEffectMix(MY_FLOAT mix)
{
effectMix = mix;
}
void PitShift :: setShift(MY_FLOAT shift)
{
if (shift < 1.0) {
rate = 1.0 - shift;
}
else if (shift > 1.0) {
rate = 1.0 - shift;
}
else {
rate = 0.0;
delay[0] = 512;
}
}
MY_FLOAT PitShift :: lastOutput()
{
return lastOut;
}
MY_FLOAT PitShift :: tick(MY_FLOAT input)
{
delay[0] = delay[0] + rate;
while (delay[0] > 1012) delay[0] -= 1000;
while (delay[0] < 12) delay[0] += 1000;
delay[1] = delay[0] + 500;
while (delay[1] > 1012) delay[1] -= 1000;
while (delay[1] < 12) delay[1] += 1000;
delayLine[0]->setDelay(delay[0]);
delayLine[1]->setDelay(delay[1]);
env[1] = fabs(delay[0] - 512) * 0.002;
env[0] = 1.0 - env[1];
lastOut = env[0] * delayLine[0]->tick(input);
lastOut += env[1] * delayLine[1]->tick(input);
lastOut *= effectMix;
lastOut += (1.0 - effectMix) * input;
return lastOut;
}
/************** Test Main Program *********************/
/*
int main(int argc, char *argv[])
{
FILE *soundIn,*soundOut;
short data;
float efMix,pitchshift;
PitShift *effect;
if (argc==5) {
soundIn = fopen(argv[3],"rb");
soundOut = fopen(argv[4],"wb");
if (soundIn && soundOut) {
efMix = atof(argv[1]);
pitchshift = atof(argv[2]);
effect = new PitShift();
effect->setShift(pitchshift);
effect->setEffectMix(efMix);
while (fread(&data,2,1,soundIn)) {
data = effect->tick(data);
fwrite(&data,2,1,soundOut);
}
delete effect;
fclose(soundIn);
fclose(soundOut);
}
else {
printf("Can't open one of the files\n");
}
}
else {
printf("useage: pitshift mix shiftRate soundIn.snd soundOut.snd\n");
printf("0.0 <= mix <= 1.0\n");
printf("maxDelay is in samples\n");
printf("soundfiles are 16 bit linear mono or stereo\n");
}
}
*/

View File

@@ -0,0 +1,32 @@
/*********************************************/
/* PitchShift Effect */
/* by Perry Cook, 1996 */
/*********************************************/
#if !defined(__PitShift_h)
#define __PitShift_h
#include "Object.h"
#include "DLineL.h"
class PitShift : public Object
{
protected:
DLineL *delayLine[2];
MY_FLOAT lastOut;
MY_FLOAT delay[2];
MY_FLOAT env[2];
MY_FLOAT effectMix;
MY_FLOAT rate;
public:
PitShift();
~PitShift();
void clear();
void setShift(MY_FLOAT shift);
void setEffectMix(MY_FLOAT mix);
virtual MY_FLOAT lastOutput();
MY_FLOAT tick(MY_FLOAT input);
};
#endif

View File

@@ -0,0 +1,16 @@
STK: A ToolKit of Audio Synthesis Classes and Instruments in C++
Version 3.2
By Perry R. Cook, 1995-2000
and Gary P. Scavone, 1997-2000.
EFFECTS PROJECT:
This directory contains a program that demonstrates realtime duplex mode (simultaneous audio input and output) operation, as well as several simple delay-line based effects algorithms. Proper duplex mode operation is very hardware dependent. If you have trouble with this application, make sure your soundcard supports the desired sample rate and sample size (16-bit).
NOTES:
1. This project will not run under WindowsNT or NeXTStep, due to lack of realtime audio input support. However, it should run under Windows2000.
2. Audio input from either a microphone or line-input device MUST be available to the audio input port when the program is started.

View File

View File

@@ -0,0 +1,171 @@
/************** Effects Program *********************/
#include "RtDuplex.h"
#include "SKINI11.h"
#include "SKINI11.msg"
#include "Envelope.h"
#include "PRCRev.h"
#include "JCRev.h"
#include "NRev.h"
#include "Echo.h"
#include "PitShift.h"
#include "Chorus.h"
// The input control handler.
#include "Controller.h"
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(" (won't work under Win95/98),\n");
printf(" and flag = -is for realtime SKINI input by socket.\n");
exit(0);
}
int main(int argc,char *argv[])
{
MY_FLOAT inSample = 0.0;
MY_FLOAT lastSample = 0.0;
MY_FLOAT byte2, byte3;
long i, nTicks;
int type, effect = 0;
int controlMask = 0;
bool done;
Controller *controller;
if (argc != 2) usage();
if (!strcmp(argv[1],"-is") )
controlMask |= STK_SOCKET;
else if (!strcmp(argv[1],"-ip") )
controlMask |= STK_PIPE;
else
usage();
Envelope *envelope = new Envelope;
PRCRev *prcrev = new PRCRev(2.0);
JCRev *jcrev = new JCRev(2.0);
NRev *nrev = new NRev(2.0);
Echo *echo = new Echo(SRATE); // one second delay
PitShift *shifter = new PitShift();
Chorus *chorus = new Chorus(5000.0);
SKINI11 *score = new SKINI11();
RtDuplex *inout;
try {
inout = new RtDuplex(1, SRATE);
// Instantiate the input message controller.
controller = new Controller( controlMask );
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// The runtime loop begins here:
done = FALSE;
while (!done) {
nTicks = controller->getNextMessage();
if (nTicks == -1)
done = TRUE;
for (i=0; i<nTicks; i++) {
if (effect == 0)
inSample = inout->tick(envelope->tick() * echo->tick(lastSample));
else if (effect == 1)
inSample = inout->tick(envelope->tick() * shifter->tick(lastSample));
else if (effect == 2)
inSample = inout->tick(envelope->tick() * chorus->tick(lastSample));
else if (effect == 3)
inSample = inout->tick(envelope->tick() * prcrev->tick(lastSample));
else if (effect == 4)
inSample = inout->tick(envelope->tick() * jcrev->tick(lastSample));
else if (effect == 5)
inSample = inout->tick(envelope->tick() * nrev->tick(lastSample));
lastSample = inSample;
}
type = controller->getType();
if (type > 0) {
// parse the input control message
byte2 = controller->getByte2();
byte3 = controller->getByte3();
switch(type) {
case __SK_NoteOn_:
if (byte3 == 0) { // velocity is zero ... really a NoteOff
envelope->setRate(0.001);
envelope->setTarget(0.0);
}
else { // really a NoteOn
envelope->setRate(0.001);
envelope->setTarget(1.0);
}
break;
case __SK_NoteOff_:
envelope->setRate(0.001);
envelope->setTarget(0.0);
break;
case __SK_ControlChange_:
if (byte2 == 20) effect = (int) byte3; // effect change
else if (byte2 == 44) { // effects mix
echo->setEffectMix(byte3*NORM_7);
shifter->setEffectMix(byte3*NORM_7);
chorus->setEffectMix(byte3*NORM_7);
prcrev->setEffectMix(byte3*NORM_7);
jcrev->setEffectMix(byte3*NORM_7);
nrev->setEffectMix(byte3*NORM_7);
}
else if (byte2 == 22) { // effect1 parameter change
echo->setDelay(byte3*NORM_7*SRATE*0.95 + 2);
shifter->setShift(byte3*NORM_7*3 + 0.25);
chorus->setModFreq(byte3*NORM_7);
}
else if (byte2 == 23) { // effect1 parameter change
chorus->setModDepth(byte3*NORM_7*0.2);
}
break;
}
}
}
envelope->setRate(0.001);
envelope->setTarget(0.0);
for (i=0;i<SRATE;i++) { /* let the sound settle a bit */
if (effect == 0)
inSample = inout->tick(envelope->tick() * echo->tick(lastSample));
else if (effect == 1)
inSample = inout->tick(envelope->tick() * shifter->tick(lastSample));
else if (effect == 2)
inSample = inout->tick(envelope->tick() * chorus->tick(lastSample));
else if (effect == 3)
inSample = inout->tick(envelope->tick() * prcrev->tick(lastSample));
else if (effect == 4)
inSample = inout->tick(envelope->tick() * jcrev->tick(lastSample));
else if (effect == 5)
inSample = inout->tick(envelope->tick() * nrev->tick(lastSample));
lastSample = inSample;
}
delete inout;
delete echo;
delete shifter;
delete chorus;
delete prcrev;
delete jcrev;
delete nrev;
delete score;
delete envelope;
delete controller;
printf("effects finished ... goodbye.\n");
return 0;
}

View File

@@ -0,0 +1,260 @@
# Microsoft Developer Studio Project File - Name="effects" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=effects - 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 "effects.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 "effects.mak" CFG="effects - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "effects - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "effects - 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)" == "effects - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# 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 /MT /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 /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 Wsock32.lib dsound.lib winmm.lib /nologo /subsystem:console /machine:I386
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "effects - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "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 /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /YX /FD /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 /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 Wsock32.lib dsound.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "effects - Win32 Release"
# Name "effects - Win32 Debug"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=.\Chorus.cpp
# End Source File
# Begin Source File
SOURCE=.\Chorus.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Controller.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Controller.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DLineL.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\DLineL.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DLineN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\DLineN.h
# End Source File
# Begin Source File
SOURCE=.\Echo.cpp
# End Source File
# Begin Source File
SOURCE=.\Echo.h
# End Source File
# Begin Source File
SOURCE=.\effects.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Envelope.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Envelope.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\JCRev.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\JCRev.h
# End Source File
# Begin Source File
SOURCE=..\..\src\NRev.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\NRev.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=.\PitShift.cpp
# End Source File
# Begin Source File
SOURCE=.\PitShift.h
# End Source File
# Begin Source File
SOURCE=..\..\src\PRCRev.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\PRCRev.h
# End Source File
# Begin Source File
SOURCE=..\..\src\RawWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\RawWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Reverb.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Reverb.h
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\src\RtDuplex.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\RtDuplex.h
# End Source File
# Begin Source File
SOURCE=..\..\src\RtMidi.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\RtMidi.h
# End Source File
# Begin Source File
SOURCE=..\..\src\SKINI11.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\SKINI11.h
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "effects"=.\effects.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -0,0 +1,219 @@
set mixlevel 64.0
set effect1 64.0
set effect2 64.0
set effect 0
set outID "stdout"
set commtype "stdout"
# Configure main window
wm title . "STK Effects Controller"
wm iconname . "Effects"
. 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
# Configure title display
label .title -text "STK Effects Controller" \
-font {Times 14 bold} -background white \
-foreground darkred -relief raised
label .title2 -text "by Gary P. Scavone\n Center for Computer Research in Music & Acoustics (CCRMA) \n Stanford University" \
-font {Times 12 bold} -background white \
-foreground darkred -relief raised
pack .title -padx 5 -pady 10
pack .title2 -padx 5 -pady 10
# Configure "note-on" buttons
frame .noteOn -bg black
button .noteOn.on -text NoteOn -bg grey66 -command { noteOn 64.0 64.0 }
button .noteOn.off -text NoteOff -bg grey66 -command { noteOff 64.0 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
# Configure sliders
frame .left -bg black
scale .left.effectsmix -from 0 -to 127 -length 400 \
-command {printWhatz "ControlChange 0.0 1 " 44} \
-orient horizontal -label "Effects Mix" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable mixlevel
scale .left.effect1 -from 0 -to 127 -length 400 \
-command {printWhatz "ControlChange 0.0 1 " 22} \
-orient horizontal -label "Echo Delay" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable effect1
scale .left.effect2 -from 0 -to 127 -length 400 \
-command {printWhatz "ControlChange 0.0 1 " 23} \
-orient horizontal -label "Disabled" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable effect2
pack .left.effectsmix -padx 10 -pady 3
pack .left.effect1 -padx 10 -pady 3
pack .left.effect2 -padx 10 -pady 3
pack .left -side left
# Configure effect select buttons
frame .effectSelect -bg black
pack .effectSelect -side right -padx 5 -pady 5
radiobutton .effectSelect.echo -text "Echo" -variable effect -relief flat \
-value 0 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
radiobutton .effectSelect.shifter -text "Pitch Shift" -variable effect -relief flat \
-value 1 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
radiobutton .effectSelect.chorus -text "Chorus" -variable effect -relief flat \
-value 2 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
radiobutton .effectSelect.prcrev -text "PRC Reverb" -variable effect -relief flat \
-value 3 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
radiobutton .effectSelect.jcrev -text "JC Reverb" -variable effect -relief flat \
-value 4 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
radiobutton .effectSelect.nrev -text "NRev Reverb" -variable effect -relief flat \
-value 5 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
pack .effectSelect.echo -pady 2 -padx 5 -side top -anchor w -fill x
pack .effectSelect.shifter -pady 2 -padx 5 -side top -anchor w -fill x
pack .effectSelect.chorus -pady 2 -padx 5 -side top -anchor w -fill x
pack .effectSelect.prcrev -pady 2 -padx 5 -side top -anchor w -fill x
pack .effectSelect.jcrev -pady 2 -padx 5 -side top -anchor w -fill x
pack .effectSelect.nrev -pady 2 -padx 5 -side top -anchor w -fill x
proc myExit {} {
global outID
puts $outID [format "NoteOff 0.0 1 64 127" ]
flush $outID
puts $outID [format "ExitProgram"]
flush $outID
close $outID
exit
}
proc noteOn {pitchVal pressVal} {
global outID
puts $outID [format "NoteOn 0.0 1 %f %f" $pitchVal $pressVal]
flush $outID
}
proc noteOff {pitchVal pressVal} {
global outID
puts $outID [format "NoteOff 0.0 1 %f %f" $pitchVal $pressVal]
flush $outID
}
proc printWhatz {tag value1 value2 } {
global outID
puts $outID [format "%s %i %f" $tag $value1 $value2]
flush $outID
}
proc changeEffect {tag value1 value2 } {
global outID
if ($value2==0) {
.left.effect1 config -state normal -label "Echo Delay"
.left.effect2 config -state disabled -label "Disabled"
}
if ($value2==1) {
.left.effect1 config -state normal -label "Pitch Shift Amount"
.left.effect2 config -state disabled -label "Disabled"
}
if ($value2==2) {
.left.effect1 config -state normal -label "Chorus Modulation Frequency"
.left.effect2 config -state normal -label "Chorus Modulation Depth"
}
if {$value2>=3 && $value2<=5} {
.left.effect1 config -state disabled -label "Disabled"
.left.effect2 config -state disabled -label "Disabled"
}
puts $outID [format "%s %i %f" $tag $value1 $value2]
flush $outID
}
# 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

@@ -0,0 +1,60 @@
# Misc 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)
# You will have to modify this path to correspond to the correct
# location in your system. The following definition corresponds
# to an STK project directory that is a subdirectory of the core
# STK distribution.
STK_PATH = ../../src/
O_FILES = Object.o WvOut.o WvIn.o RtAudio.o \
RtWvIn.o RtWvOut.o ByteSwap.o \
StkError.o WavWvOut.o StrmWvIn.o \
RtDuplex.o StrmWvOut.o WavWvIn.o \
RawWvIn.o
RM = /bin/rm
ifeq ($(OS),Linux) # These are for Linux
INSTR = sineN playN recordN ioN streamInN streamOutN
CC = g++ -O3 -Wall -D__OS_Linux_ # -g -pg -O3
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)
playN: playN.cpp $(O_FILES)
$(CC) -o playN playN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
streamOutN: streamOutN.cpp $(O_FILES)
$(CC) -o streamOutN streamOutN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
streamInN: streamInN.cpp $(O_FILES)
$(CC) -o streamInN streamInN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
recordN: recordN.cpp $(O_FILES)
$(CC) -o recordN recordN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
ioN: ioN.cpp $(O_FILES)
$(CC) -o ioN ioN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
sineN: sineN.cpp $(O_FILES)
$(CC) -o sineN sineN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)

89
projects/examples/examples.dsw Executable file
View File

@@ -0,0 +1,89 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "ioN"=.\ioN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "playN"=.\playN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "recordN"=.\recordN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "sineN"=.\sineN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "streamInN"=.\streamInN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "streamOutN"=.\streamOutN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

99
projects/examples/ioN.cpp Normal file
View File

@@ -0,0 +1,99 @@
/******************************************/
/*
Example program for realtime input/output
by Gary P. Scavone, 2000
This program reads N channels of realtime
audio input for a specified amount of time
and immediately play them back in realtime
(duplex mode). This program also demonstrates
the use of FIFO scheduling priority. To be
run with such priority, the program must be
set suid (chmod +s) and owned by root.
*/
/******************************************/
#include "RtDuplex.h"
#if !defined(__OS_Win_)
#include <sched.h>
#endif
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: ioN N time \n");
printf(" where N = number of channels,\n");
printf(" and time = the amount of time to record (in seconds).\n\n");
exit(0);
}
int
main(int argc, char *argv[])
{
int i=0;
// minimal command-line checking
if (argc != 3) usage();
int chans = (int) atoi(argv[1]);
float time = atof(argv[2]);
float sample_rate = SRATE;
MY_FLOAT *inSamples;
MY_FLOAT *lastSamples;
// allocate the lastSamples array
lastSamples = (MY_FLOAT *) new MY_FLOAT[chans];
for (i=0; i<chans; i++)
lastSamples[i] = 0.0;
// Define and open the realtime duplex device
RtDuplex *inout;
try {
inout = new RtDuplex(chans, sample_rate);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
#if !defined(__OS_Win_)
// set schedulling priority to SCHED_FIFO
struct sched_param p;
int min, max, priority;
if (!getuid() || !geteuid()) {
min=sched_get_priority_min(SCHED_FIFO);
max=sched_get_priority_max(SCHED_FIFO);
priority=min+(max-min)/2;
p.sched_priority=priority;
if (sched_setscheduler(0, SCHED_FIFO, &p)==-1) {
fprintf(stderr, "\ncould not activate scheduling with priority %d\n", priority);
}
seteuid(getuid());
}
#endif
// Here's the runtime loop
int j=0;
int samples = (int) (time*SRATE);
while (i<samples) {
inSamples = inout->mtick(lastSamples);
for (int k=0; k<chans; k++)
lastSamples[k] = inSamples[k];
i++;
#if !defined(__OS_Win_)
j++;
if (j>=256) {
sched_yield();
j = 0;
}
#endif
}
// Clean up
delete inout;
delete [] lastSamples;
}

142
projects/examples/ioN.dsp Executable file
View File

@@ -0,0 +1,142 @@
# Microsoft Developer Studio Project File - Name="ioN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=ioN - 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 "ioN.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 "ioN.mak" CFG="ioN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ioN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ioN - 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)" == "ioN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ioN___Win32_Release"
# PROP BASE Intermediate_Dir "ioN___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# 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 "__OS_Win_" /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 dsound.lib winmm.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "ioN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ioN___Win32_Debug"
# PROP BASE Intermediate_Dir "ioN___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 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 dsound.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "ioN - Win32 Release"
# Name "ioN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=.\ioN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtDuplex.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtDuplex.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.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

@@ -0,0 +1,66 @@
/******************************************/
/*
Example program to play an N channel soundfile
by Gary P. Scavone, 2000
This program is currently written to load
a WAV file and play it in realtime. However,
it is simple to replace the instance of
WavWvIn with any other WvIn subclass.
Likewise, RtWvOut can be replaced with any
other WvOut subclass.
*/
/******************************************/
#include "RtWvOut.h"
#include "WavWvIn.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: playN N file fs \n");
printf(" where N = number of channels,\n");
printf(" file = the .wav file to play,\n");
printf(" and fs = the sample rate.\n\n");
exit(0);
}
int main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 4) usage();
int chans = (int) atoi(argv[1]);
// Define and load the SND soundfile
WvIn *input;
try {
input = new WavWvIn((char *)argv[2], "oneshot");
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Set playback rate here
input->setRate(atof(argv[3])/SRATE);
// Define and open the realtime output device
WvOut *output;
try {
output = new RtWvOut(chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
while (!input->isFinished()) {
output->mtick(input->mtick());
}
// Clean up
delete input;
delete output;
}

167
projects/examples/playN.dsp Executable file
View File

@@ -0,0 +1,167 @@
# Microsoft Developer Studio Project File - Name="playN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=playN - 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 "playN.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 "playN.mak" CFG="playN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "playN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "playN - 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)" == "playN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# 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 "__OS_Win_" /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 winmm.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 /machine:I386
!ELSEIF "$(CFG)" == "playN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "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 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "playN - Win32 Release"
# Name "playN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=.\playN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WavWvIn.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"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtWvOut.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WavWvIn.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"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,71 @@
/******************************************/
/*
Example program to record N channels of data
by Gary P. Scavone, 2000
This program is currently written to read
from a realtime audio input device and to
write to a WAV output file. However, it
is simple to replace the instance of
RtWvIn with any other WvIn subclass.
Likewise, WavWvOut can be replaced with any
other WvOut subclass.
*/
/******************************************/
#include "RtWvIn.h"
#include "WavWvOut.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: recordN N file time fs \n");
printf(" where N = number of channels,\n");
printf(" file = the .wav file to create,\n");
printf(" time = the amount of time to record (in seconds),\n");
printf(" and fs = the sample rate.\n\n");
exit(0);
}
int main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 5) usage();
int chans = (int) atoi(argv[1]);
float sample_rate = atof(argv[4]);
float time = atof(argv[3]);
// Define and open the realtime input device
WvIn *input;
try {
input = new RtWvIn(chans, sample_rate);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Define and open the soundfile for output
WvOut *output;
try {
output = new WavWvOut(argv[2],chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
int i=0;
int samples = (int) (time*SRATE);
while (i<samples) {
output->mtick(input->mtick());
i++;
}
// Clean up
delete input;
delete output;
}

166
projects/examples/recordN.dsp Executable file
View File

@@ -0,0 +1,166 @@
# Microsoft Developer Studio Project File - Name="recordN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=recordN - 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 "recordN.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 "recordN.mak" CFG="recordN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "recordN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "recordN - 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)" == "recordN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# 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 "__OS_Win_" /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 dsound.lib winmm.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "recordN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "recordN___Win32_Debug"
# PROP BASE Intermediate_Dir "recordN___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 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 dsound.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "recordN - Win32 Release"
# Name "recordN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=.\recordN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WavWvOut.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"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WavWvOut.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"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,54 @@
# A simple Tcl/Tk example script
# Set initial control values
set pitch 64.0
set press 64.0
set outID "stdout"
# Configure main window
wm title . "A Simple GUI"
wm iconname . "simple"
. config -bg black
# Configure a "note-on" button
frame .noteOn -bg black
button .noteOn.on -text NoteOn -bg grey66 -command { noteOn $pitch $press }
pack .noteOn.on -side left -padx 5
pack .noteOn
# Configure sliders
frame .slider -bg black
scale .slider.pitch -from 0 -to 128 -length 200 \
-command {changePitch } -variable pitch \
-orient horizontal -label "MIDI Note Number" \
-tickinterval 32 -showvalue true -bg grey66
pack .slider.pitch -padx 10 -pady 10
pack .slider -side left
# Bind an X windows "close" event with the Exit routine
bind . <Destroy> +myExit
proc myExit {} {
global pitch outID
puts $outID [format "NoteOff 0.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 0.0 1 %f %f" $pitchVal $pressVal]
flush $outID
}
proc changePitch {value} {
global outID
puts $outID [format "PitchBend 0.0 1 %.3f" $value]
flush $outID
}

View File

@@ -0,0 +1,79 @@
/******************************************/
/*
Example program to write N sine tones to
an N channel soundfile
by Gary P. Scavone, 2000
This program is currently written to write
an N channel WAV file. However, it is
simple to replace the instance of WavWvOut
with any other WvOut subclass.
*/
/******************************************/
#include "WavWvOut.h"
#include "RawWvIn.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: sineN N file time \n");
printf(" where N = number of channels (sines),\n");
printf(" file = the .wav file to create,\n");
printf(" and time = the amount of time to record (in seconds).\n\n");
exit(0);
}
int
main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 4) usage();
int chans = (int) atoi(argv[1]);
float time = atof(argv[3]);
int i;
// Define and load the rawwave file(s) ... the path is critical
RawWvIn *oscs[chans];
try {
for (i=0; i<chans; i++)
oscs[i] = new RawWvIn("../../rawwaves/sinewave.raw", "looping");
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Set oscillator frequency(ies) here ... somewhat random
float base_freq = 220.0;
for (i=0; i<chans; i++)
oscs[i]->setFreq(base_freq + i*(45.0));
// Define and open the soundfile for output
WvOut *output;
try {
output = new WavWvOut(argv[2],chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
i=0;
int samples = (int) (time*SRATE);
MY_FLOAT *outvec = (MY_FLOAT *) new MY_FLOAT[chans];
while (i<samples) {
for (int j=0; j<chans; j++)
outvec[j] = oscs[j]->tick();
output->mtick(outvec);
i++;
}
// Clean up
for (i=0; i<chans; i++)
delete oscs[i];
delete [] outvec;
delete output;
}

156
projects/examples/sineN.dsp Executable file
View File

@@ -0,0 +1,156 @@
# Microsoft Developer Studio Project File - Name="sineN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=sineN - 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 "sineN.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 "sineN.mak" CFG="sineN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "sineN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "sineN - 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)" == "sineN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "sineN___Win32_Release"
# PROP BASE Intermediate_Dir "sineN___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 /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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)" == "sineN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "sineN___Win32_Debug"
# PROP BASE Intermediate_Dir "sineN___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# 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 "__OS_Win_" /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "sineN - Win32 Release"
# Name "sineN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RawWvIn.cpp
# End Source File
# Begin Source File
SOURCE=.\sineN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WavWvOut.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"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RawWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WavWvOut.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"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,73 @@
/******************************************/
/*
Example program to read N channels of audio
data that are streamed over an ethernet
connection.
by Gary P. Scavone, 2000
This program is currently written to play
the input data in realtime. However, it
is simple to replace the instance of
RtWvOut with any other WvOut subclass.
The class StrmWvIn sets up a socket server
and waits for a connection. Thus, this
program needs to be started before the
streaming client. This program will
terminate when the socket connection is
closed.
*/
/******************************************/
#include "Object.h"
#include "StrmWvIn.h"
#include "RtWvOut.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: streamInN N fs \n");
printf(" where N = number of channels,\n");
printf(" and fs = the sample rate.\n\n");
exit(0);
}
int main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 3) usage();
int chans = (int) atoi(argv[1]);
WvIn *input;
try {
input = new StrmWvIn(chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Set playback rate here
input->setRate(atof(argv[2])/SRATE);
// Define and open the realtime output device
WvOut *output;
try {
output = new RtWvOut(chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
while (!input->isFinished()) {
output->mtick(input->mtick());
}
// Clean up
delete input;
delete output;
}

166
projects/examples/streamInN.dsp Executable file
View File

@@ -0,0 +1,166 @@
# Microsoft Developer Studio Project File - Name="streamInN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=streamInN - 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 "streamInN.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 "streamInN.mak" CFG="streamInN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "streamInN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "streamInN - 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)" == "streamInN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# 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 /MT /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 dsound.lib winmm.lib Wsock32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "streamInN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "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 /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 dsound.lib winmm.lib Wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "streamInN - Win32 Release"
# Name "streamInN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=.\streamInN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StrmWvIn.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"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtWvOut.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StrmWvIn.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"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,73 @@
/******************************************/
/*
Example program to output N channels of audio
data over an ethernet socket connection.
by Gary P. Scavone, 2000
This program is currently written to load
a WAV file for streaming. However, it is
simple to replace the instance of WavWvIn
with any other WvIn subclass.
The class StrmWvOut first attempts to
establish a socket connection to a socket
server running on port 2005. Thus, this
program needs to be started after the
streaming server.
*/
/******************************************/
#include "WavWvIn.h"
#include "StrmWvOut.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: streamOutN N file host fs \n");
printf(" where N = number of channels,\n");
printf(" file = the .wav file to load,\n");
printf(" host = the hostname of the receiving app,\n");
printf(" and fs = the sample rate.\n\n");
exit(0);
}
int main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 5) usage();
int chans = (int) atoi(argv[1]);
// Define and load the SND soundfile
WvIn *input;
try {
input = new WavWvIn((char *)argv[2], "oneshot");
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Set playback rate here
input->setRate(atof(argv[4])/SRATE);
// Define and open the realtime output device
WvOut *output;
try {
output = new StrmWvOut(2005, (char *)argv[3], chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
while (!input->isFinished()) {
output->mtick(input->mtick());
}
// Clean up
delete input;
delete output;
}

158
projects/examples/streamOutN.dsp Executable file
View File

@@ -0,0 +1,158 @@
# Microsoft Developer Studio Project File - Name="streamOutN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=streamOutN - 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 "streamOutN.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 "streamOutN.mak" CFG="streamOutN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "streamOutN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "streamOutN - 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)" == "streamOutN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# 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 "__OS_Win_" /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 Wsock32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "streamOutN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "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 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 Wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "streamOutN - Win32 Release"
# Name "streamOutN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=.\streamOutN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StrmWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WavWvIn.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"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StrmWvOut.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WavWvIn.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"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

1
projects/ragamatic/GUIRaga Executable file
View File

@@ -0,0 +1 @@
wish < tcl/TCLRaga.tcl | ragamat -ip

View File

@@ -0,0 +1,66 @@
# 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 = Object.o Envelope.o ADSR.o Noise.o \
Filter.o DLineA.o DLineL.o DLineN.o \
OnePole.o OneZero.o DCBlock.o SKINI11.o \
ByteSwap.o Tabla.o Instrmnt.o Sitar1.o \
StrDrone.o VoicDrum.o WvOut.o WvIn.o RawWvIn.o \
RtAudio.o RtWvOut.o RtMidi.o Reverb.o \
JCRev.o Controller.o StkError.o
RM = /bin/rm
ifeq ($(OS),IRIX) # These are for SGI
INSTR = ragamat
CC = CC -O2 -D__OS_IRIX_ # -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__OS_Linux_ # -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
Sitar1.o: Sitar1.cpp
$(CC) $(INCLUDE) -c Sitar1.cpp
StrDrone.o: StrDrone.cpp
$(CC) $(INCLUDE) -c StrDrone.cpp
VoicDrum.o: VoicDrum.cpp
$(CC) $(INCLUDE) -c VoicDrum.cpp

View File

@@ -0,0 +1,58 @@
# STK Makefile for RagaMatic project- SGI solo version (non-GNU Makefile utilities version)
# The following definition indicates the relative location of
# the core STK classes.
STK_PATH = ../../src/
O_FILES = $(STK_PATH)Object.o $(STK_PATH)Envelope.o $(STK_PATH)ADSR.o \
$(STK_PATH)Filter.o $(STK_PATH)DLineL.o $(STK_PATH)DLineN.o \
$(STK_PATH)ByteSwap.o $(STK_PATH)Noise.o $(STK_PATH)OnePole.o \
$(STK_PATH)OneZero.o $(STK_PATH)DCBlock.o $(STK_PATH)SKINI11.o \
$(STK_PATH)Instrmnt.o $(STK_PATH)WvIn.o $(STK_PATH)RawWvIn.o \
$(STK_PATH)DLineA.o $(STK_PATH)Reverb.o $(STK_PATH)JCRev.o \
$(STK_PATH)WvOut.o $(STK_PATH)RtAudio.o $(STK_PATH)RtMidi.o \
$(STK_PATH)RtWvOut.o $(STK_PATH)StkError.o $(STK_PATH)Controller.o
O_LOCAL_FILES = Tabla.o Sitar1.o StrDrone.o VoicDrum.o
RM = /bin/rm
INSTR = ragamat
CC = CC -O2 -D__OS_IRIX_ # -g -fullwarn -D__SGI_CC__
LIBRARY = -L/usr/sgitcl/lib -laudio -lmd -lm -lpthread
INCLUDE = -I../../include/
.SUFFIXES: .cpp
.cpp.o: $(O_FILES)
$(CC) $(INCLUDE) -c -o $@ $<
all: $(INSTR)
ragamat: ragamat.cpp $(O_FILES) $(O_LOCAL_FILES)
$(CC) -o ragamat ragamat.cpp $(O_FILES) $(O_LOCAL_FILES) $(LIBRARY) $(INCLUDE)
clean :
rm *.o
rm $(STK_PATH)*.o
rm $(INSTR)
cleanIns :
rm $(INSTR)
strip :
strip $(INSTR)
# $(O_FILES) :
Tabla.o: Tabla.cpp
$(CC) $(INCLUDE) -c Tabla.cpp
Sitar1.o: Sitar1.cpp
$(CC) $(INCLUDE) -c Sitar1.cpp
StrDrone.o: StrDrone.cpp
$(CC) $(INCLUDE) -c StrDrone.cpp
VoicDrum.o: VoicDrum.cpp
$(CC) $(INCLUDE) -c VoicDrum.cpp

View File

@@ -0,0 +1,23 @@
This is RagaMatic (tm).
by Perry Cook
Written for Ken Steiglitz's birthday, 1999.
Sitar and Drones are physical models.
Vocalize drums and Tabla drums are samples.
In the RagaMatic directory, type:
> make
to compile and then
> GUIRaga
to have fun and achieve inner peace.
If you ask me, I think this band needs a flute player too. If you like, team up and see if you can add the flute model to the project. This requires adding a few files to the Makefile, a few lines to the ragamat.cpp file (including how the flute player should play, etc.), and another slider to the TCL script to control the flute's contributions. This might only run on the fastest machines once you've added the flute.
Since latency isn't much of an issue in raga-land, you might bump up the RT_BUFFER_SIZE in Object.h to something around 1024, depending on the speed of your machine. If you don't have the GNU makefile utilities on your system, take a look at one of the system-specific makefiles (example: Makefile.sgi) in the syntmono directory to see what changes you need to make.
All is Bliss...
All is Bliss...

View File

@@ -0,0 +1,100 @@
/******************************************/
/* Karplus-Strong Sitar1 string model */
/* by Perry Cook, 1995-96 */
/* */
/* There exist at least two patents, */
/* assigned to Stanford, bearing the */
/* names of Karplus and/or Strong. */
/******************************************/
#include "Sitar1.h"
Sitar1 :: Sitar1(MY_FLOAT lowestFreq)
{
length = (long) (SRATE / lowestFreq + 1);
loopGain = (MY_FLOAT) 0.999;
loopFilt = new OneZero();
loopFilt->setCoeff(0.01);
delayLine = new DLineA(length);
delay = length/2;
delayTarg = delay;
envelope = new ADSR();
noise = new Noise;
envelope->setAllTimes(0.001,0.04,0.0,0.5);
this->clear();
}
Sitar1 :: ~Sitar1()
{
delete loopFilt;
delete delayLine;
delete envelope;
delete noise;
}
void Sitar1 :: clear()
{
loopFilt->clear();
delayLine->clear();
}
void Sitar1 :: setFreq(MY_FLOAT frequency)
{
delayTarg = (SRATE / frequency);
delay = delayTarg * (1.0 + (0.05 * noise->tick()));
delayLine->setDelay(delay);
loopGain = (MY_FLOAT) 0.995 + (frequency * (MY_FLOAT) 0.000001);
if (loopGain>1.0) loopGain = (MY_FLOAT) 0.9995;
}
void Sitar1 :: pluck(MY_FLOAT amplitude)
{
envelope->keyOn();
}
void Sitar1 :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
{
this->setFreq(freq);
this->pluck(amp);
amPluck = 0.05 * amp;
#if defined(_debug_)
printf("Sitar1 : NoteOn: Freq=%lf Amp=%lf\n",freq,amp);
#endif
}
void Sitar1 :: noteOff(MY_FLOAT amp)
{
loopGain = (MY_FLOAT) 1.0 - amp;
#if defined(_debug_)
printf("Sitar1 : NoteOff: Amp=%lf\n",amp);
#endif
}
MY_FLOAT Sitar1 :: tick()
{
MY_FLOAT temp;
temp = delayLine->lastOut();
if (fabs(temp) > 1.0) {
loopGain = 0.1;
this->noteOff(0.9);
delay = delayTarg;
delayLine->setDelay(delay);
}
temp *= loopGain;
if (fabs(delayTarg - delay) > 0.001) {
if (delayTarg < delay)
delay *= 0.99999;
else
delay *= 1.00001;
delayLine->setDelay(delay);
}
lastOutput = delayLine->tick(loopFilt->tick(temp)
+ (amPluck * envelope->tick() * noise->tick()));
return lastOutput;
}

View File

@@ -0,0 +1,43 @@
/******************************************/
/* Karplus-Strong Sitar1 string model */
/* by Perry Cook, 1995-96 */
/* */
/* There exist at least two patents, */
/* assigned to Stanford, bearing the */
/* names of Karplus and/or Strong. */
/******************************************/
#if !defined(__Sitar1_h)
#define __Sitar1_h
#include "Instrmnt.h"
#include "DLineA.h"
#include "OneZero.h"
#include "ADSR.h"
#include "Noise.h"
class Sitar1 : public Instrmnt
{
protected:
DLineA *delayLine;
OneZero *loopFilt;
ADSR *envelope;
Noise *noise;
long length;
MY_FLOAT loopGain;
MY_FLOAT amPluck;
MY_FLOAT delay;
MY_FLOAT delayTarg;
public:
Sitar1(MY_FLOAT lowestFreq);
~Sitar1();
void clear();
virtual void setFreq(MY_FLOAT frequency);
void pluck(MY_FLOAT amplitude);
virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
virtual void noteOff(MY_FLOAT amp);
virtual MY_FLOAT tick();
};
#endif

View File

@@ -0,0 +1,77 @@
/******************************************/
/* Karplus-Strong StrDrone string model */
/* by Perry Cook, 1995-96 */
/* */
/* There exist at least two patents, */
/* assigned to Stanford, bearing the */
/* names of Karplus and/or Strong. */
/******************************************/
#include "StrDrone.h"
StrDrone :: StrDrone(MY_FLOAT lowestFreq)
{
length = (long) (SRATE / lowestFreq + 1);
loopGain = (MY_FLOAT) 0.999;
loopFilt = new OneZero();
delayLine = new DLineA(length);
envelope = new ADSR();
noise = new Noise;
envelope->setAllTimes(2.0,0.5,0.0,0.5);
this->clear();
}
StrDrone :: ~StrDrone()
{
delete loopFilt;
delete delayLine;
delete envelope;
delete noise;
}
void StrDrone :: clear()
{
loopFilt->clear();
delayLine->clear();
}
void StrDrone :: setFreq(MY_FLOAT frequency)
{
MY_FLOAT delay;
delay = (SRATE / frequency);
delayLine->setDelay(delay - 0.5);
loopGain = (MY_FLOAT) 0.997 + (frequency * (MY_FLOAT) 0.000002);
if (loopGain>1.0) loopGain = (MY_FLOAT) 0.99999;
}
void StrDrone :: pluck(MY_FLOAT amplitude)
{
envelope->keyOn();
}
void StrDrone :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
{
this->setFreq(freq);
this->pluck(amp);
#if defined(_debug_)
printf("StrDrone : NoteOn: Freq=%lf Amp=%lf\n",freq,amp);
#endif
}
void StrDrone :: noteOff(MY_FLOAT amp)
{
loopGain = (MY_FLOAT) 1.0 - amp;
#if defined(_debug_)
printf("StrDrone : NoteOff: Amp=%lf\n",amp);
#endif
}
MY_FLOAT StrDrone :: tick()
{
/* check this out */
/* here's the whole inner loop of the instrument!! */
lastOutput = delayLine->tick(loopFilt->tick((delayLine->lastOut() * loopGain))
+ (0.005 * envelope->tick() * noise->tick()));
return lastOutput;
}

View File

@@ -0,0 +1,40 @@
/******************************************/
/* Karplus-Strong StrDrone string model */
/* by Perry Cook, 1995-96 */
/* */
/* There exist at least two patents, */
/* assigned to Stanford, bearing the */
/* names of Karplus and/or Strong. */
/******************************************/
#if !defined(__StrDrone_h)
#define __StrDrone_h
#include "Instrmnt.h"
#include "DLineA.h"
#include "OneZero.h"
#include "ADSR.h"
#include "Noise.h"
class StrDrone : public Instrmnt
{
protected:
DLineA *delayLine;
ADSR *envelope;
Noise *noise;
OneZero *loopFilt;
long length;
MY_FLOAT loopGain;
public:
StrDrone(MY_FLOAT lowestFreq);
~StrDrone();
void clear();
virtual void setFreq(MY_FLOAT frequency);
void pluck(MY_FLOAT amplitude);
virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
virtual void noteOff(MY_FLOAT amp);
virtual MY_FLOAT tick();
};
#endif

View File

@@ -0,0 +1,155 @@
/*******************************************/
/* Master Class for Drum Synthesizer */
/* by Perry R. Cook, 1995-96 */
/* */
/* This instrument contains a bunch of */
/* RawWvIn objects, run through a bunch */
/* of one-pole filters. All the */
/* corresponding rawwave files have been */
/* sampled at 22050 Hz. Thus, if the */
/* compile-time SRATE = 22050, then */
/* no interpolation is used. Otherwise, */
/* the rawwave data is appropriately */
/* interpolated for the current SRATE. */
/* You can specify the maximum Polyphony */
/* (maximum number of simultaneous voices)*/
/* in a #define in the .h file. */
/* */
/* Modified for RawWvIn class */
/* by Gary P. Scavone (4/99) */
/*******************************************/
#include "Tabla.h"
#include <string.h>
Tabla :: Tabla() : Instrmnt()
{
int i;
for (i=0;i<TABLA_POLYPHONY;i++) {
filters[i] = new OnePole;
sounding[i] = -1;
}
/* This counts the number of sounding voices */
numSounding = 0;
/* Print warning about aliasing if SRATE < 22050 */
if (SRATE < 22050) {
printf("\nWarning: Tabla is designed for sampling rates of\n");
printf("22050 Hz or greater. You will likely encounter aliasing\n");
printf("at the current sampling rate of %.0f Hz.\n\n", SRATE);
}
}
Tabla :: ~Tabla()
{
int i;
for ( i=0; i<numSounding-1; i++ ) delete waves[i];
for ( i=0; i<TABLA_POLYPHONY; i++ ) delete filters[i];
}
void Tabla :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
{
int i, notDone;
int noteNum;
int vel;
char tempString[64];
RawWvIn *tempWv;
OnePole *tempFilt;
char waveNames[TABLA_NUMWAVES][16] = {
"Drdak2.raw",
"Drdak3.raw",
"Drdak4.raw",
"Drddak1.raw",
"Drdee1.raw",
"Drdee2.raw",
"Drdoo1.raw",
"Drdoo2.raw",
"Drdoo3.raw",
"Drjun1.raw",
"Drjun2.raw",
"DrDoi1.raw",
"DrDoi2.raw",
"DrTak1.raw",
"DrTak2.raw"
};
noteNum = (int) freq;
vel = (int) (amp * 127);
#if defined(_debug_)
printf("NoteOn: %i vel=%i\n",noteNum,vel);
#endif
notDone = -1;
for (i=0;i<TABLA_POLYPHONY;i++) { /* Check first to see */
if (sounding[i] == noteNum) notDone = i; /* if there's already */
} /* one like this sounding */
if (notDone<0) { /* If not, then */
if (numSounding == TABLA_POLYPHONY) { /* If we're already */
delete waves[0]; /* at max polyphony, */
filters[0]->clear(); /* then */
tempWv = waves[0];
tempFilt = filters[0];
for (i=0;i<TABLA_POLYPHONY-1;i++) { /* preempt oldest */
waves[i] = waves[i+1]; /* voice and */
filters[i] = filters[i+1]; /* ripple all down */
}
waves[TABLA_POLYPHONY-1] = tempWv;
filters[TABLA_POLYPHONY-1] = tempFilt;
} else {
numSounding += 1; /* otherwise just add one */
}
sounding[numSounding-1] = noteNum; /* allocate new wave */
strcpy(tempString,"rawwaves/");
strcat(tempString,waveNames[noteNum]);
waves[numSounding-1] = new RawWvIn(tempString, "oneshot");
if (SRATE != 22050) {
waves[numSounding-1]->setRate((MY_FLOAT) (22050.0/SRATE));
}
waves[numSounding-1]->normalize((MY_FLOAT) 0.4);
filters[numSounding-1]->setPole((MY_FLOAT) 0.999 - ((MY_FLOAT) vel * NORM_7 * 0.6));
filters[numSounding-1]->setGain(vel / (MY_FLOAT) 128.0);
}
else {
waves[notDone]->reset();
filters[notDone]->setPole((MY_FLOAT) 0.999 - ((MY_FLOAT) vel * NORM_7 * 0.6));
filters[notDone]->setGain(vel / (MY_FLOAT) 128.0);
}
#if defined(_debug_)
printf("Number Sounding = %i\n",numSounding);
for (i=0;i<numSounding;i++) printf(" %i ",sounding[i]);
printf("\n");
#endif
}
MY_FLOAT Tabla :: tick()
{
int j, i = 0;
MY_FLOAT output = 0.0;
OnePole *tempFilt;
while (i < numSounding) {
output += filters[i]->tick(waves[i]->lastOut());
if (waves[i]->informTick() == 1) {
delete waves[i];
tempFilt = filters[i];
for (j=i;j<numSounding-1;j++) {
sounding[j] = sounding[j+1];
waves[j] = waves[j+1];
filters[j] = filters[j+1];
}
filters[j] = tempFilt;
filters[j]->clear();
sounding[j] = -1;
numSounding -= 1;
i -= 1;
}
i++;
}
return output;
}

View File

@@ -0,0 +1,46 @@
/*******************************************/
/* Master Class for Drum Synthesizer */
/* by Perry R. Cook, 1995-96 */
/* */
/* This instrument contains a bunch of */
/* RawWvIn objects, run through a bunch */
/* of one-pole filters. All the */
/* corresponding rawwave files have been */
/* sampled at 22050 Hz. Thus, if the */
/* compile-time SRATE = 22050, then */
/* no interpolation is used. Otherwise, */
/* the rawwave data is appropriately */
/* interpolated for the current SRATE. */
/* You can specify the maximum Polyphony */
/* (maximum number of simultaneous voices)*/
/* in a #define in the .h file. */
/* */
/* Modified for RawWvIn class */
/* by Gary P. Scavone (4/99) */
/*******************************************/
#if !defined(__Tabla_h)
#define __Tabla_h
#include "Instrmnt.h"
#include "RawWvIn.h"
#include "OnePole.h"
#define TABLA_NUMWAVES 15
#define TABLA_POLYPHONY 4
class Tabla : public Instrmnt
{
protected:
RawWvIn *waves[TABLA_POLYPHONY];
OnePole *filters[TABLA_POLYPHONY];
int sounding[TABLA_POLYPHONY];
int numSounding;
public:
Tabla();
~Tabla();
virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
virtual MY_FLOAT tick();
};
#endif

View File

@@ -0,0 +1,152 @@
/*******************************************/
/* Master Class for Drum Synthesizer */
/* by Perry R. Cook, 1995-96 */
/* */
/* This instrument contains a bunch of */
/* RawWvIn objects, run through a bunch */
/* of one-pole filters. All the */
/* corresponding rawwave files have been */
/* sampled at 22050 Hz. Thus, if the */
/* compile-time SRATE = 22050, then */
/* no interpolation is used. Otherwise, */
/* the rawwave data is appropriately */
/* interpolated for the current SRATE. */
/* You can specify the maximum Polyphony */
/* (maximum number of simultaneous voices)*/
/* in a #define in the .h file. */
/* */
/* Modified for RawWvIn class */
/* by Gary P. Scavone (4/99) */
/*******************************************/
#include "VoicDrum.h"
#include <string.h>
VoicDrum :: VoicDrum() : Instrmnt()
{
int i;
for (i=0;i<DRUM_POLYPHONY;i++) {
filters[i] = new OnePole;
sounding[i] = -1;
}
/* This counts the number of sounding voices */
numSounding = 0;
/* Print warning about aliasing if SRATE < 22050 */
if (SRATE < 22050) {
printf("\nWarning: VoicDrum is designed for sampling rates of\n");
printf("22050 Hz or greater. You will likely encounter aliasing\n");
printf("at the current sampling rate of %.0f Hz.\n\n", SRATE);
}
}
VoicDrum :: ~VoicDrum()
{
int i;
for ( i=0; i<numSounding-1; i++ ) delete waves[i];
for ( i=0; i<DRUM_POLYPHONY; i++ ) delete filters[i];
}
void VoicDrum :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
{
int i, notDone;
int noteNum;
int vel;
char tempString[64];
RawWvIn *tempWv;
OnePole *tempFilt;
char waveNames[DRUM_NUMWAVES][16] = {
"tak2.raw",
"tak1.raw",
"bee1.raw",
"dee1.raw",
"dee2.raw",
"din1.raw",
"gun1.raw",
"jun1.raw",
"jun2.raw",
"tak3.raw",
"tak4.raw"
};
/* Yes I know, this is tres kludgey */
noteNum = (int)freq;
vel = (int) (amp * 127);
#if defined(_debug_)
printf("NoteOn: %i vel=%i\n",noteNum,vel);
#endif
notDone = -1;
for (i=0;i<DRUM_POLYPHONY;i++) { /* Check first to see */
if (sounding[i] == noteNum) notDone = i; /* if there's already */
} /* one like this sounding */
if (notDone<0) { /* If not, then */
if (numSounding == DRUM_POLYPHONY) { /* If we're already */
delete waves[0]; /* at max polyphony, */
filters[0]->clear(); /* then */
tempWv = waves[0];
tempFilt = filters[0];
for (i=0;i<DRUM_POLYPHONY-1;i++) { /* preempt oldest */
waves[i] = waves[i+1]; /* voice and */
filters[i] = filters[i+1]; /* ripple all down */
}
waves[DRUM_POLYPHONY-1] = tempWv;
filters[DRUM_POLYPHONY-1] = tempFilt;
} else {
numSounding += 1; /* otherwise just add one */
}
sounding[numSounding-1] = noteNum; /* allocate new wave */
strcpy(tempString,"rawwaves/");
strcat(tempString,waveNames[noteNum]);
waves[numSounding-1] = new RawWvIn(tempString, "oneshot");
if (SRATE != 22050) {
waves[numSounding-1]->setRate((MY_FLOAT) (22050.0/SRATE));
}
waves[numSounding-1]->normalize((MY_FLOAT) 0.4);
filters[numSounding-1]->setPole((MY_FLOAT) 0.999 - ((MY_FLOAT) vel * NORM_7 * 0.6));
filters[numSounding-1]->setGain(vel / (MY_FLOAT) 128.0);
}
else {
waves[notDone]->reset();
filters[notDone]->setPole((MY_FLOAT) 0.999 - ((MY_FLOAT) vel * NORM_7 * 0.6));
filters[notDone]->setGain(vel / (MY_FLOAT) 128.0);
}
#if defined(_debug_)
printf("Number Sounding = %i\n",numSounding);
for (i=0;i<numSounding;i++) printf(" %i ",sounding[i]);
printf("\n");
#endif
}
MY_FLOAT VoicDrum :: tick()
{
int j, i = 0;
MY_FLOAT output = 0.0;
OnePole *tempFilt;
while (i < numSounding) {
output += filters[i]->tick(waves[i]->lastOut());
if (waves[i]->informTick() == 1) {
delete waves[i];
tempFilt = filters[i];
for (j=i;j<numSounding-1;j++) {
sounding[j] = sounding[j+1];
waves[j] = waves[j+1];
filters[j] = filters[j+1];
}
filters[j] = tempFilt;
filters[j]->clear();
sounding[j] = -1;
numSounding -= 1;
i -= 1;
}
i++;
}
return output;
}

View File

@@ -0,0 +1,46 @@
/*******************************************/
/* Master Class for Drum Synthesizer */
/* by Perry R. Cook, 1995-96 */
/* */
/* This instrument contains a bunch of */
/* RawWvIn objects, run through a bunch */
/* of one-pole filters. All the */
/* corresponding rawwave files have been */
/* sampled at 22050 Hz. Thus, if the */
/* compile-time SRATE = 22050, then */
/* no interpolation is used. Otherwise, */
/* the rawwave data is appropriately */
/* interpolated for the current SRATE. */
/* You can specify the maximum Polyphony */
/* (maximum number of simultaneous voices)*/
/* in a #define in the .h file. */
/* */
/* Modified for RawWvIn class */
/* by Gary P. Scavone (4/99) */
/*******************************************/
#if !defined(__VoicDrum_h)
#define __VoicDrum_h
#include "Instrmnt.h"
#include "RawWvIn.h"
#include "OnePole.h"
#define DRUM_NUMWAVES 11
#define DRUM_POLYPHONY 4
class VoicDrum : public Instrmnt
{
protected:
RawWvIn *waves[DRUM_POLYPHONY];
OnePole *filters[DRUM_POLYPHONY];
int sounding[DRUM_POLYPHONY];
int numSounding;
public:
VoicDrum();
~VoicDrum();
virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
virtual MY_FLOAT tick();
};
#endif

View File

@@ -0,0 +1,264 @@
/************** Test Main Program Individual Voice *********************/
#include "RtWvOut.h"
#include "SKINI11.msg"
#include "Instrmnt.h"
#include "Reverb.h"
#include "JCRev.h"
#include "StrDrone.h"
#include "Sitar1.h"
#include "Tabla.h"
#include "VoicDrum.h"
#include "miditabl.h"
#define RATE_NORM (MY_FLOAT) (22050.0/SRATE)
// The input control handler.
#include "Controller.h"
// Return random float between 0.0 and max
MY_FLOAT float_random(MY_FLOAT max) {
MY_FLOAT temp;
#if defined(__OS_Win_) /* For Windoze */
temp = (MY_FLOAT) (rand() * max);
temp *= ONE_OVER_RANDLIMIT;
#else /* This is for unix */
temp = (MY_FLOAT) (random() * max);
temp *= ONE_OVER_RANDLIMIT;
#endif
return temp;
}
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");
exit(0);
}
int main(int argc,char *argv[])
{
long i, nTicks;
int type;
MY_FLOAT byte2, byte3, temp;
MY_FLOAT outSamples[2];
int controlMask = 0;
bool done;
MY_FLOAT reverbTime = 4.0; /* in seconds */
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};
int tempo = 3000;
int counter = 3000;
int key = 0;
int ragaStep, ragaPoint = 6, voicNote;
int ragaUp[2][13] = {{57, 60, 62, 64, 65, 68, 69, 71, 72, 76, 77, 81},
{52, 54, 55, 57, 59, 60, 63, 64, 66, 67, 71, 72}};
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}};
RtWvOut *output;
Instrmnt *drones[3];
Instrmnt *sitar;
Instrmnt *voicDrums;
Instrmnt *drums;
Reverb *reverbs[2];
SKINI11 *score;
Controller *controller;
if (argc != 2) usage();
if (!strcmp(argv[1],"-is") )
controlMask |= STK_SOCKET;
else if (!strcmp(argv[1],"-ip") )
controlMask |= STK_PIPE;
else
usage();
try {
output = new RtWvOut(2);
// Instantiate the input message controller.
controller = new Controller( controlMask );
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
drones[0] = new StrDrone(50.0);
drones[1] = new StrDrone(50.0);
drones[2] = new StrDrone(50.0);
sitar = new Sitar1(50.0);
voicDrums = new VoicDrum();
drums = new Tabla();
score = new SKINI11();
reverbs[0] = new JCRev(reverbTime);
reverbs[0]->setEffectMix(0.5);
reverbs[1] = new JCRev(2.0);
reverbs[1]->setEffectMix(0.2);
drones[0]->noteOn(droneFreqs[0],0.1);
drones[1]->noteOn(droneFreqs[1],0.1);
drones[2]->noteOn(droneFreqs[2],0.1);
for (i=0;i<SRATE;i++) { /* warm everybody up a little */
outSamples[0] = reverbs[0]->tick(drones[0]->tick() + drones[2]->tick());
outSamples[1] = reverbs[1]->tick(1.5 * drones[1]->tick());
output->mtick(outSamples);
}
// The runtime loop begins here:
done = FALSE;
while (!done) {
nTicks = controller->getNextMessage();
if (nTicks == -1)
done = TRUE;
for (i=0; i<nTicks; i++) {
outSamples[0] = reverbs[0]->tick(drones[0]->tick() + drones[2]->tick()
+ sitar->tick());
outSamples[1] = reverbs[1]->tick(1.5 * drones[1]->tick() + 0.5 * voicDrums->tick()
+ 0.5 * drums->tick());
// mix a little left to right and back
temp = outSamples[0];
outSamples[0] += 0.3 * outSamples[1];
outSamples[1] += 0.3 * temp;
output->mtick(outSamples);
counter -= 1;
if (counter == 0) {
counter = (int) (tempo / RATE_NORM);
if (float_random(1.0) < drone_prob)
drones[0]->noteOn(droneFreqs[0],0.1);
if (float_random(1.0) < drone_prob)
drones[1]->noteOn(droneFreqs[1],0.1);
if (float_random(1.0) < drone_prob)
drones[2]->noteOn(droneFreqs[2],0.1);
if (float_random(1.0) < note_prob) {
if ((temp = float_random(1.0)) < 0.1)
ragaStep = 0;
else if (temp < 0.5)
ragaStep = 1;
else
ragaStep = -1;
ragaPoint += ragaStep;
if (ragaPoint < 0)
ragaPoint -= (2*ragaStep);
if (ragaPoint > 11)
ragaPoint = 11;
if (ragaStep > 0)
sitar->noteOn(__MIDI_To_Pitch[ragaUp[key][ragaPoint]],
0.05 + float_random(0.3));
else
sitar->noteOn(__MIDI_To_Pitch[ragaDown[key][ragaPoint]],
0.05 + float_random(0.3));
}
if (float_random(1.0) < voic_prob) {
voicNote = (int) float_random(11);
voicDrums->noteOn(voicNote, 0.3 + (0.4 * drum_prob) +
float_random(0.9 * voic_prob));
}
if (float_random(1.0) < drum_prob) {
voicNote = (int) float_random(TABLA_NUMWAVES);
drums->noteOn(voicNote, 0.2 + (0.2 * drum_prob) +
float_random(0.7 * drum_prob));
}
}
}
type = controller->getType();
if (type > 0) {
// parse the input control message
byte2 = controller->getByte2();
byte3 = controller->getByte3();
switch(type) {
case __SK_ControlChange_:
if (byte2 == 1) {
drone_prob = byte3 * NORM_7;
}
else if (byte2 == 2) {
note_prob = byte3 * NORM_7;
}
else if (byte2 == 4) {
voic_prob = byte3 * NORM_7;
}
else if (byte2 == 11) {
drum_prob = byte3 * NORM_7;
}
else if (byte2 == 7) {
tempo = (int) (11025 - (byte3 * 70));
}
else if (byte2 == 64) {
if (byte3 == 0) {
key = 1;
droneFreqs[0] = 55.0;
droneFreqs[1] = 82.5;
droneFreqs[2] = 220.0;
}
else {
key = 0;
droneFreqs[0] = 82.5;
droneFreqs[1] = 123.5;
droneFreqs[2] = 330.0;
}
}
}
}
}
printf("What Need Have I for This?\n");
drones[1]->noteOn(droneFreqs[1],0.1);
for (i=0; i<reverbTime*SRATE; i++) { // Calm down a little
outSamples[0] = reverbs[0]->tick(drones[0]->tick() + drones[2]->tick());
outSamples[1] = reverbs[1]->tick(1.5 * drones[1]->tick());
output->mtick(outSamples);
}
printf("What Need Have I for This?\n");
drones[2]->noteOn(droneFreqs[2],0.1);
for (i=0; i<reverbTime*SRATE; i++) { // and a little more
outSamples[0] = reverbs[0]->tick(drones[0]->tick() + drones[2]->tick());
outSamples[1] = reverbs[1]->tick(1.5 * drones[1]->tick());
output->mtick(outSamples);
}
printf("RagaMatic finished ... \n");
drones[0]->noteOn(droneFreqs[0],0.1);
for (i=0; i<reverbTime*SRATE; i++) { // almost ready to think about ending
outSamples[0] = reverbs[0]->tick(drones[0]->tick() + drones[2]->tick());
outSamples[1] = reverbs[1]->tick(1.5 * drones[1]->tick());
output->mtick(outSamples);
}
printf("All is Bliss ...\n");
for (i=0; i<reverbTime*SRATE; i++) { // nearly finished now
outSamples[0] = reverbs[0]->tick(drones[0]->tick() + drones[2]->tick());
outSamples[1] = reverbs[1]->tick(1.5 * drones[1]->tick());
output->mtick(outSamples);
}
printf("All is Bliss ...\n");
for (i=0; i<reverbTime*SRATE; i++) { // all is bliss....
outSamples[0] = reverbs[0]->tick(drones[0]->tick() + drones[2]->tick());
outSamples[1] = reverbs[1]->tick(1.5 * drones[1]->tick());
output->mtick(outSamples);
}
delete output;
delete score;
delete drones[0];
delete drones[1];
delete drones[2];
delete sitar;
delete drums;
delete voicDrums;
delete reverbs[0];
delete reverbs[1];
delete controller;
return 0;
}

322
projects/ragamatic/ragamat.dsp Executable file
View File

@@ -0,0 +1,322 @@
# Microsoft Developer Studio Project File - Name="ragamatic" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=ragamatic - 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 "ragamat.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 "ragamat.mak" CFG="ragamatic - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ragamatic - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ragamatic - 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)" == "ragamatic - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# 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 /MT /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 /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 Wsock32.lib dsound.lib winmm.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "ragamatic - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "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 /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /YX /FD /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 /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 Wsock32.lib dsound.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "ragamatic - Win32 Release"
# Name "ragamatic - Win32 Debug"
# Begin Source File
SOURCE=..\..\src\ADSR.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\ADSR.h
# End Source File
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Controller.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Controller.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DLineA.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\DLineA.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DLineL.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\DLineL.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DLineN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\DLineN.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Envelope.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Envelope.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\Instrmnt.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Instrmnt.h
# End Source File
# Begin Source File
SOURCE=..\..\src\JCRev.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\JCRev.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Noise.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Noise.h
# End Source File
# Begin Source File
SOURCE=..\..\src\NRev.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\NRev.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\src\OnePole.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\OnePole.h
# End Source File
# Begin Source File
SOURCE=..\..\src\OneZero.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\OneZero.h
# End Source File
# Begin Source File
SOURCE=..\..\src\PRCRev.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\PRCRev.h
# End Source File
# Begin Source File
SOURCE=.\ragamat.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RawWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\RawWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\src\Reverb.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\Reverb.h
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\src\RtMidi.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\RtMidi.h
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\RtWvOut.h
# End Source File
# Begin Source File
SOURCE=.\Sitar1.cpp
# End Source File
# Begin Source File
SOURCE=.\Sitar1.h
# End Source File
# Begin Source File
SOURCE=..\..\src\SKINI11.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\SKINI11.h
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=.\StrDrone.cpp
# End Source File
# Begin Source File
SOURCE=.\StrDrone.h
# End Source File
# Begin Source File
SOURCE=.\Tabla.cpp
# End Source File
# Begin Source File
SOURCE=.\Tabla.h
# End Source File
# Begin Source File
SOURCE=.\VoicDrum.cpp
# End Source File
# Begin Source File
SOURCE=.\VoicDrum.h
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
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
# End Project

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "ragamatic"=.\ragamat.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,55 @@
/**********************************************/
/** Utility to make various functions **/
/** like exponential and log gain curves. **/
/** **/
/** Included here: **/
/** Yamaha TX81Z curves for master gain, **/
/** Envelope Rates (in normalized units), **/
/** envelope sustain level, and more.... **/
/**********************************************/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
int i,j;
double temp;
double data[128];
/*************** TX81Z Master Gain *************/
for (i=0;i<100;i++) {
data[i] = pow(2.0,-(99-i)/10.0);
}
data[0] = 0.0;
printf("double __FM4Op_gains[99] = {");
for (i=0;i<100;i++) {
if (i%8 == 0) printf("\n");
printf("%lf,",data[i]);
}
printf("};\n");
/*************** TX81Z Sustain Level ***********/
for (i=0;i<16;i++) {
data[i] = pow(2.0,-(15-i)/2.0);
}
data[0] = 0.0;
printf("double __FM4Op_susLevels[16] = {");
for (i=0;i<16;i++) {
if (i%8 == 0) printf("\n");
printf("%lf,",data[i]);
}
printf("};\n");
/****************** Attack Rate ***************/
for (i=0;i<32;i++) {
data[i] = 6.0 * pow(5.7,-(i-1)/5.0);
}
printf("double __FM4Op_attTimes[16] = {");
for (i=0;i<32;i++) {
if (i%8 == 0) printf("\n");
printf("%lf,",data[i]);
}
printf("};\n");
exit(1);
}

View File

@@ -0,0 +1,33 @@
/**********************************************/
/** Utility to make various functions **/
/** like exponential and log gain curves. **/
/** Specifically for direct MIDI parameter **/
/** conversions. **/
/** Included here: **/
/** A440 Referenced Equal Tempered Pitches **/
/** as a function of MIDI note number. **/
/** **/
/**********************************************/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
int i,j;
double temp;
double data[128];
/********* Pitch as fn. of MIDI Note **********/
printf("double __MIDI_To_Pitch[128] = {");
for (i=0;i<128;i++) {
if (i%8 == 0) printf("\n");
temp = 220.0 * pow(2.0,((double) i - 57) / 12.0);
printf("%.2lf,",temp);
}
printf("};\n");
exit(1);
}

View File

@@ -0,0 +1,116 @@
/**********************************************/
/** Utility to make various flavors of **/
/** sine wave (rectified, etc), and **/
/** other commonly needed waveforms, like **/
/** triangles, ramps, etc. **/
/** The files generated are all 16 bit **/
/** linear signed integer, of length **/
/** as defined by LENGTH below **/
/**********************************************/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define LENGTH 256
#define PI 3.14159265358979323846
void main()
{
int i,j;
double temp;
short data[LENGTH + 2];
FILE *fd;
/////////// Yer Basic TX81Z Waves, Including Sine ///////////
fd = fopen("halfwave.raw","wb");
for (i=0;i<LENGTH/2;i++)
data[i] = 32767 * sin(i * 2 * PI / (double) LENGTH);
for (i=LENGTH/2;i<LENGTH;i++)
data[i] = 0;
fwrite(&data,2,LENGTH,fd);
fclose(fd);
fd = fopen("sinewave.raw","wb");
for (i=LENGTH/2;i<LENGTH;i++)
data[i] = 32767 * sin(i * 2 * PI / (double) LENGTH);
fwrite(&data,2,LENGTH,fd);
fclose(fd);
fd = fopen("sineblnk.raw","wb");
for (i=0;i<LENGTH/2;i++)
data[i] = data[2*i];
for (i=LENGTH/2;i<LENGTH;i++)
data[i] = 0;
fwrite(&data,2,LENGTH,fd);
fclose(fd);
fd = fopen("fwavblnk.raw","wb");
for (i=0;i<LENGTH/4;i++)
data[i+LENGTH/4] = data[i];
fwrite(&data,2,LENGTH,fd);
fclose(fd);
fd = fopen("snglpeak.raw","wb");
for (i=0;i<=LENGTH/4;i++)
data[i] = 32767 * (1.0 - cos(i * 2 * PI / (double) LENGTH));
for (i=0;i<=LENGTH/4;i++)
data[LENGTH/2-i] = data[i];
for (i=LENGTH/2;i<LENGTH;i++)
data[i] = 0;
fwrite(&data,2,LENGTH,fd);
fclose(fd);
fd = fopen("twopeaks.raw","wb");
for (i=0;i<=LENGTH/2;i++) {
data[LENGTH/2+i] = -data[i];
}
fwrite(&data,2,LENGTH,fd);
fclose(fd);
fd = fopen("peksblnk.raw","wb");
for (i=0;i<=LENGTH/2;i++)
data[i] = data[i*2];
for (i=LENGTH/2;i<LENGTH;i++)
data[i] = 0;
fwrite(&data,2,LENGTH,fd);
fclose(fd);
fd = fopen("ppksblnk.raw","wb");
for (i=0;i<=LENGTH/4;i++)
data[i+LENGTH/4] = data[i];
fwrite(&data,2,LENGTH,fd);
fclose(fd);
/////////// Impulses of various bandwidth ///////////
fd = fopen("impuls10.raw","wb");
for (i=0;i<LENGTH;i++) {
temp = 0.0;
for (j=1;j<=10;j++)
temp += cos(i * j * 2 * PI / (double) LENGTH);
data[i] = 32767 / 10.0 * temp;
}
fwrite(&data,2,LENGTH,fd);
fclose(fd);
fd = fopen("impuls20.raw","wb");
for (i=0;i<LENGTH;i++) {
temp = 0.0;
for (j=1;j<=20;j++)
temp += cos(i * j * 2 * PI / (double) LENGTH);
data[i] = 32767 / 20.0 * temp;
}
fwrite(&data,2,LENGTH,fd);
fclose(fd);
fd = fopen("impuls40.raw","wb");
for (i=0;i<LENGTH;i++) {
temp = 0.0;
for (j=1;j<=40;j++)
temp += cos(i * j * 2 * PI / (double) LENGTH);
data[i] = 32767 / 40.0 * temp;
}
fwrite(&data,2,LENGTH,fd);
fclose(fd);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,304 @@
# Tcl/Tk GUI for the RagaMatic
# by Perry R. Cook
# Set initial control values
set cont1 10.0
set cont2 7.0
set cont4 0.0
set cont11 10.0
set cont7 3.0
set outID "stdout"
set commtype "stdout"
# Configure main window
wm title . "STK RagaMatic Controller"
wm iconname . "raga"
. config -bg grey20
# 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
# Configure bitmap display
if {[file isdirectory bitmaps]} {
set bitmappath bitmaps
} else {
set bitmappath tcl/bitmaps
}
frame .banner -bg black
button .banner.top -bitmap @$bitmappath/ragamat2.xbm \
-background white -foreground black
frame .banner.bottom -bg black
label .banner.bottom.ragamat -text " * * RagaMatic * *\n\n \
by Perry R. Cook\n for Ken's Birthday\n \
January, 1999\n\n (thanks also to\n \
Brad for rough\n riff inspirations)" \
-background black -foreground white -relief groove \
-width 20 -height 10
# Bind an X windows "close" event with the Exit routine
bind . <Destroy> +myExit
proc myExit {} {
global outID
puts $outID [format "NoteOff -1.0 1 60 127"]
flush $outID
puts $outID [format "ExitProgram"]
flush $outID
close $outID
exit
}
proc mellow {} {
global cont1 cont2 cont4 cont7 cont11
set cont1 10.0
set cont2 7.0
set cont4 0.0
set cont11 10.0
set cont7 3.0
printWhatz "ControlChange -1.0 1 " 1 $cont1
printWhatz "ControlChange -1.0 1 " 2 $cont2
printWhatz "ControlChange -1.0 1 " 4 $cont4
printWhatz "ControlChange -1.0 1 " 7 $cont7
printWhatz "ControlChange -1.0 1 " 11 $cont11
}
proc nicevibe {} {
global cont1 cont2 cont4 cont7 cont11
set cont1 6.0
set cont2 72.0
set cont4 21.0
set cont11 50.0
set cont7 60.0
printWhatz "ControlChange -1.0 1 " 1 $cont1
printWhatz "ControlChange -1.0 1 " 2 $cont2
printWhatz "ControlChange -1.0 1 " 4 $cont4
printWhatz "ControlChange -1.0 1 " 7 $cont7
printWhatz "ControlChange -1.0 1 " 11 $cont11
}
proc voicSolo {} {
global cont1 cont2 cont4 cont7 cont11
set cont1 2.0
set cont2 37.0
set cont4 90.0
set cont11 10.0
set cont7 120.0
printWhatz "ControlChange -1.0 1 " 1 $cont1
printWhatz "ControlChange -1.0 1 " 2 $cont2
printWhatz "ControlChange -1.0 1 " 4 $cont4
printWhatz "ControlChange -1.0 1 " 7 $cont7
printWhatz "ControlChange -1.0 1 " 11 $cont11
}
proc drumSolo {} {
global cont1 cont2 cont4 cont7 cont11
set cont1 3.0
set cont2 37.0
set cont4 0.0
set cont11 100.0
set cont7 120.0
printWhatz "ControlChange -1.0 1 " 1 $cont1
printWhatz "ControlChange -1.0 1 " 2 $cont2
printWhatz "ControlChange -1.0 1 " 4 $cont4
printWhatz "ControlChange -1.0 1 " 7 $cont7
printWhatz "ControlChange -1.0 1 " 11 $cont11
}
proc rockOut {} {
global cont1 cont2 cont4 cont7 cont11
set cont1 1.0
set cont2 97.0
set cont4 52.0
set cont11 120.0
set cont7 123.0
printWhatz "ControlChange -1.0 1 " 1 $cont1
printWhatz "ControlChange -1.0 1 " 2 $cont2
printWhatz "ControlChange -1.0 1 " 4 $cont4
printWhatz "ControlChange -1.0 1 " 7 $cont7
printWhatz "ControlChange -1.0 1 " 11 $cont11
}
proc raga {scale} {
global outID
puts $outID [format "ControlChange -1.0 1 64 %f" $scale]
flush $outID
}
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 printWhatz {tag value1 value2 } {
global outID
puts $outID [format "%s %i %f" $tag $value1 $value2]
flush $outID
}
frame .banner.butts -bg black
frame .banner.butts.ragas -bg black
button .banner.butts.ragas.raga0 -text "Raga1" \
-bg grey66 -command {raga 0}
button .banner.butts.ragas.raga1 -text "Raga2" \
-bg grey66 -command {raga 1}
frame .banner.butts.presets1 -bg black
button .banner.butts.presets1.warmup -text "Warmup" \
-bg grey66 -command mellow
button .banner.butts.presets1.nicevibe -text "NiceVibe" \
-bg grey66 -command nicevibe
frame .banner.butts.presets2 -bg black
button .banner.butts.presets2.voicsolo -text "VoiceSolo" \
-bg grey66 -command voicSolo
button .banner.butts.presets2.drumsolo -text "DrumSolo" \
-bg grey66 -command drumSolo
button .banner.butts.rockout -text "RockOut" \
-bg grey66 -command rockOut
button .banner.butts.noteOn -text "Cease Meditations and Exit" \
-bg grey66 -command myExit
frame .controls -bg black
scale .controls.cont1 -from 0 -to 128 -length 300 \
-command {printWhatz "ControlChange -1.0 1 " 1} \
-orient horizontal -label "Drone Probability" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable cont1
scale .controls.cont2 -from 0 -to 128 -length 300 \
-command {printWhatz "ControlChange -1.0 1 " 2} \
-orient horizontal -label "Sitar Probability" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable cont2
scale .controls.cont4 -from 0 -to 128 -length 300 \
-command {printWhatz "ControlChange -1.0 1 " 4} \
-orient horizontal -label "Voice Drum Probability" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable cont4
scale .controls.cont11 -from 0 -to 128 -length 300 \
-command {printWhatz "ControlChange -1.0 1 " 11} \
-orient horizontal -label "Tabla Probability" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable cont11
scale .controls.cont7 -from 0 -to 128 -length 300 \
-command {printWhatz "ControlChange -1.0 1 " 7} \
-orient horizontal -label "Tempo" \
-tickinterval 32 -showvalue true -bg grey66 \
-variable cont7
pack .banner.top -pady 10 -padx 10
pack .banner.bottom.ragamat -padx 5 -pady 5
pack .banner.bottom -pady 10
pack .banner.butts.ragas.raga0 -side left
pack .banner.butts.ragas.raga1 -side left
pack .banner.butts.ragas
pack .banner.butts.presets1.warmup -side left
pack .banner.butts.presets1.nicevibe -side left
pack .banner.butts.presets1
pack .banner.butts.presets2.voicsolo -side left
pack .banner.butts.presets2.drumsolo -side left
pack .banner.butts.presets2
pack .banner.butts.rockout
pack .banner.butts.noteOn
pack .banner.butts -side left -padx 5 -pady 10
pack .banner -side left
pack .controls.cont1 -padx 10 -pady 10
pack .controls.cont2 -padx 10 -pady 10
pack .controls.cont4 -padx 10 -pady 10
pack .controls.cont11 -padx 10 -pady 10
pack .controls.cont7 -padx 10 -pady 10
pack .controls -side left -padx 10 -pady 10
# 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

@@ -0,0 +1,101 @@
#define prc_width 100
#define prc_height 112
static char prc_bits[] = {
0xff,0xff,0xff,0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xb5,0x6a,
0xad,0x55,0xfd,0xff,0xff,0xbf,0xaa,0x6a,0x6d,0x55,0xfd,0xff,0xff,0xff,0xff,
0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd5,0xb6,0xb5,0xd5,0xff,0xff,
0xff,0xff,0x6f,0xad,0xb5,0x6d,0xfb,0xbf,0xdf,0xdf,0xff,0xff,0xff,0x7f,0xff,
0xff,0xff,0xff,0xbf,0xff,0xf6,0x75,0x7d,0xf5,0xff,0xff,0xf7,0xfb,0xff,0xd5,
0xda,0xea,0xfd,0xbd,0xfe,0xef,0xff,0xff,0x7b,0xdf,0xae,0xff,0xff,0xff,0xbf,
0xfe,0xef,0x57,0xbb,0xff,0xff,0xde,0xf5,0x75,0xfd,0xdb,0xb6,0xed,0xfb,0xbb,
0xfd,0xef,0xff,0x57,0xab,0x2e,0x5b,0xf5,0xbf,0xff,0xdf,0xfe,0xee,0x57,0xfd,
0x7f,0xab,0x6a,0x55,0xad,0xaa,0xff,0x6a,0xf5,0xfb,0x7b,0xfd,0xf7,0xff,0x75,
0xad,0x6a,0xb5,0xa5,0xff,0xff,0x5f,0xff,0xde,0x57,0xfd,0x3f,0x95,0x55,0xab,
0xd5,0xaa,0xfe,0x6f,0xfb,0xfd,0xb7,0xfd,0xff,0xaf,0x5a,0x55,0x55,0x55,0xab,
0xfe,0xfb,0x6e,0xff,0xfb,0xaf,0xfe,0x5b,0x55,0x55,0x55,0x55,0xad,0xfa,0xbf,
0xbb,0xfb,0xae,0xf5,0xff,0x6b,0x55,0x55,0xa9,0xaa,0x6a,0xf5,0xef,0xef,0xfd,
0xfb,0xbf,0x7f,0xad,0x55,0x52,0x4a,0x55,0xb5,0xf6,0xbf,0xba,0xfe,0x6f,0xed,
0xff,0x55,0xa5,0x4a,0xa5,0xaa,0x56,0xeb,0xff,0xef,0xfb,0xfb,0xf7,0x5f,0x5b,
0x95,0x2a,0x29,0x55,0xd5,0xda,0xff,0xdd,0xfe,0xad,0xfd,0xbf,0x55,0x55,0x52,
0xa5,0x54,0x55,0x6d,0xbf,0xbb,0xfb,0xff,0xef,0xef,0x56,0xaa,0x4a,0x95,0xaa,
0xaa,0xb5,0xff,0xef,0xfe,0xd5,0xfa,0x5f,0x55,0x49,0xaa,0x54,0x55,0xb5,0xda,
0xfe,0x7b,0xff,0xff,0xff,0xbf,0x55,0x55,0x55,0xaa,0xa4,0xaa,0x6d,0xff,0xaf,
0xfb,0xd5,0xfa,0xef,0xaa,0xaa,0x24,0x45,0xaa,0xaa,0xd6,0xfe,0xfb,0xfe,0xff,
0xff,0xbf,0xad,0x92,0xaa,0x28,0xa5,0xaa,0x7a,0xff,0xae,0xfb,0xda,0xfa,0xdf,
0xaa,0x4a,0x45,0x55,0x29,0x55,0xd5,0xfe,0xfb,0xfe,0xf7,0xff,0x6f,0x55,0x55,
0x28,0x82,0x94,0xaa,0xaa,0xff,0xaf,0xfb,0x7d,0xfd,0xbf,0x55,0x55,0x93,0x54,
0x52,0xaa,0xf6,0xfe,0xff,0xfe,0xd7,0xff,0xdf,0xea,0x57,0x49,0x22,0xd5,0x75,
0xab,0xff,0xb7,0xfb,0xfd,0xfd,0x6f,0xfd,0xff,0x2b,0x95,0x74,0xff,0x7d,0xff,
0xef,0xff,0x6f,0xff,0xbf,0x6e,0x7f,0x95,0x40,0xda,0xff,0xaf,0xff,0xbf,0xfa,
0xf5,0xfd,0x6f,0xff,0xef,0x5b,0x94,0xea,0xff,0x6f,0xff,0xef,0xff,0xbf,0xff,
0xdf,0xba,0x7a,0xab,0x4a,0x74,0xbd,0xbf,0xff,0xff,0xfa,0xea,0xfd,0x6f,0xd7,
0xaa,0x2a,0x21,0x95,0x67,0x7d,0xff,0xaf,0xff,0x7f,0xff,0xbf,0xad,0x5d,0xab,
0x94,0xea,0xba,0xb6,0xff,0xf7,0xfb,0xda,0xfd,0xaf,0xf7,0xff,0x5d,0xaa,0x7a,
0xdf,0xfb,0xfe,0xaf,0xfe,0x7d,0xff,0x6f,0x79,0xf7,0x6f,0x45,0xdf,0x77,0xad,
0xff,0xff,0xfb,0xef,0xfb,0xdf,0xee,0x7f,0xbb,0x52,0xf7,0xfe,0xf7,0xff,0xaf,
0xfe,0xf5,0xfe,0xaf,0xbe,0xbf,0xaf,0xaa,0xff,0xff,0xaf,0xfe,0xfb,0xfb,0xbf,
0xff,0x77,0xfb,0xbe,0xf5,0xda,0xb6,0xff,0xdf,0xff,0xaf,0xfe,0xf5,0xf5,0xaf,
0xbd,0x7f,0x5f,0xb7,0xdf,0xbe,0xaf,0xfe,0xfa,0xfb,0x7f,0xef,0xaf,0xd6,0xd4,
0xb5,0xd9,0x75,0x6b,0x7b,0xff,0xaf,0xfe,0xd5,0xdf,0xb7,0x2a,0x6b,0xdf,0x6e,
0xdf,0xad,0xad,0xbf,0xfa,0xfb,0x7e,0x6b,0x5f,0x55,0xbd,0xb5,0xaa,0xfb,0xb6,
0xd6,0x7e,0x6f,0xff,0xeb,0xdd,0xaa,0xd5,0x52,0xd5,0x75,0xad,0xdb,0x5a,0xdb,
0xbb,0xfb,0xff,0x6b,0xb7,0x6a,0x5f,0xad,0xae,0xf7,0x6e,0xab,0x76,0xed,0xfe,
0x6a,0xaf,0x5d,0xb5,0x55,0x75,0xb3,0x95,0xb5,0x75,0xbb,0xbf,0xfb,0xff,0xbb,
0xb6,0xda,0xaa,0xda,0xaa,0x5e,0xda,0xaa,0xd7,0xea,0xfe,0xdb,0xae,0xdb,0x4a,
0x55,0xad,0xaa,0xb6,0xaa,0xaa,0x6e,0xbf,0xfb,0xf6,0xdb,0x56,0x55,0x8a,0x56,
0xa5,0x7a,0x51,0x55,0xad,0xeb,0xfe,0xbf,0xbf,0x5b,0x55,0x51,0x55,0xa9,0xca,
0xaa,0x6a,0xff,0xfe,0xfb,0xf5,0xd5,0x6f,0xab,0x8a,0xeb,0xa6,0xbf,0x45,0xad,
0x5a,0x57,0xff,0xdf,0xff,0x5a,0x55,0x68,0xfd,0xfb,0x7f,0x93,0x6a,0xef,0xfb,
0xfd,0x7b,0xb5,0x6e,0x95,0xaa,0xfe,0xef,0xdf,0x4d,0x52,0xbb,0xae,0xff,0xfe,
0xdf,0xba,0x25,0x69,0xff,0xff,0xff,0x26,0xea,0xed,0xfb,0xfa,0x6b,0x75,0x5d,
0x95,0xb4,0xff,0xff,0xff,0x5f,0xa9,0xd6,0xde,0xff,0xff,0x7f,0x6b,0x55,0xea,
0xff,0xff,0xff,0x4f,0x6a,0xfb,0xfb,0xfd,0xb6,0xda,0xbd,0x2b,0xfd,0xff,0xff,
0xff,0x7f,0xd5,0x6d,0x5f,0xff,0xdf,0xff,0xd6,0x94,0xfe,0xff,0xff,0xff,0xbf,
0x6a,0xfb,0xf5,0xfb,0xf5,0xda,0x7d,0xab,0xfe,0xff,0xff,0xff,0xff,0xb4,0xbf,
0xdf,0xfe,0x5f,0x7f,0xd7,0xaa,0xff,0xff,0xff,0xff,0xff,0xd6,0xfa,0xfb,0xff,
0xfb,0xf7,0x7f,0xd5,0xff,0xff,0xff,0xff,0xff,0xe9,0xef,0x5e,0xfb,0x5f,0xbd,
0xed,0xd5,0xff,0xff,0xff,0xff,0xff,0x5a,0xbf,0xf7,0xff,0xf6,0xef,0xbe,0xd6,
0xff,0x7f,0x55,0xfd,0xff,0xea,0xfd,0xdf,0xfe,0xdf,0xfe,0x6b,0xd3,0xff,0xaa,
0xb7,0xb7,0xff,0xb6,0xff,0xfa,0xff,0xfb,0x6b,0xff,0xda,0x5f,0xb7,0xd4,0xea,
0x7e,0xea,0xdb,0x6f,0xfb,0x5f,0xff,0xad,0xd7,0xbf,0xfd,0xff,0xff,0xff,0xfd,
0x7e,0xff,0xff,0xfb,0xd7,0xff,0xa9,0xd7,0xfe,0xff,0x5f,0x7d,0xd5,0xf7,0xbb,
0xfd,0x6e,0xfb,0xb6,0xd6,0x6f,0xff,0xff,0xff,0x7e,0x7b,0xff,0xef,0xff,0xfb,
0xaf,0xfb,0xdf,0xbf,0xfe,0xff,0xbf,0xfe,0xee,0xdd,0x7e,0xff,0x5f,0xfb,0xdf,
0xea,0xbf,0xff,0xff,0xdf,0x7e,0xfb,0xfb,0xfb,0xfd,0xf7,0xdf,0xf6,0xbf,0xff,
0xfe,0xff,0xaf,0xff,0xdd,0xff,0xdf,0xff,0xdf,0xf6,0xff,0xab,0xff,0xff,0xff,
0xff,0x7f,0xff,0xbf,0xfd,0xfe,0xfb,0xbb,0xdb,0xfe,0xfe,0xfe,0xff,0xef,0xff,
0xee,0xf6,0xef,0xff,0xdf,0xef,0xff,0xaf,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,
0xbe,0xfb,0xfd,0xfd,0xf6,0xfb,0xff,0xff,0xff,0xff,0x7f,0x5f,0xf7,0xfb,0xff,
0xb7,0xd7,0xff,0xae,0xfe,0xff,0xff,0xff,0xff,0xbb,0xde,0xef,0xfe,0xff,0xff,
0x9b,0xfa,0xff,0xff,0xff,0xff,0xbf,0xbd,0x7e,0xff,0xff,0xdb,0xf6,0x4f,0xef,
0xfe,0xff,0xff,0xff,0xff,0xff,0xfa,0xbb,0xfd,0xfe,0xdf,0xe2,0xb7,0xff,0xff,
0xff,0xff,0x5f,0xf5,0xfc,0xff,0xff,0xef,0x7b,0xf9,0xf7,0xfe,0xff,0xff,0xff,
0xff,0xfd,0xd9,0xdd,0xff,0xbd,0x3f,0xfe,0xab,0xfd,0xff,0xff,0xff,0x6f,0xfb,
0xf8,0xf7,0xfd,0xff,0x9d,0xff,0xff,0xfb,0xff,0xff,0xff,0xbb,0xfd,0xf9,0xbf,
0xff,0xed,0xcf,0xff,0x57,0xef,0xff,0xff,0xff,0xef,0xf6,0x70,0xff,0xff,0xff,
0xdd,0xff,0xaf,0xbd,0xff,0xff,0x7f,0x5b,0xfb,0xfa,0xdb,0xfd,0xb7,0xcf,0xff,
0xf7,0x76,0xdd,0xff,0xd7,0x6e,0xfd,0xd0,0xff,0xff,0xfe,0xcb,0xff,0x5b,0xef,
0xb6,0xd4,0x7a,0xb7,0xfe,0x01,0xfa,0xfe,0xff,0x8e,0xff,0xaf,0xba,0xdb,0x56,
0xd5,0xda,0x7b,0x84,0xd0,0xff,0xed,0xa7,0xff,0x7b,0xdb,0xaa,0xaa,0xae,0x55,
0x3f,0x10,0x82,0xfe,0xff,0x8b,0xff,0xaf,0x6d,0x55,0xd5,0x6a,0xab,0xbf,0x40,
0x10,0xf8,0xf7,0x0a,0xfe,0xbf,0xb6,0xb7,0x55,0x55,0xd5,0x1f,0x02,0x40,0xf2,
0x7e,0x41,0xfe,0xdb,0xda,0x54,0xaa,0xaa,0xfa,0x0f,0x20,0x05,0xf0,0x17,0x00,
0xfc,0x7f,0x6b,0x55,0x55,0x55,0xd5,0x01,0x04,0x10,0xf2,0x47,0x12,0xfc,0xdf,
0xaa,0x56,0xa9,0xaa,0xfe,0x00,0x20,0x81,0xf0,0x00,0x80,0xf8,0xff,0xd7,0x52,
0xa5,0xaa,0x7d,0x22,0x01,0x08,0xf2,0x00,0x08,0xf0,0x7f,0xad,0xaa,0x2a,0x55,
0x2f,0x00,0x24,0x02,0xf0,0x24,0x21,0xf0,0xff,0x57,0x15,0x49,0xe9,0x0f,0x00,
0x00,0x48,0xf0,0x00,0x00,0xe1,0xff,0x7d,0xa5,0x24,0xf6,0x03,0x42,0x90,0x00,
0xf2,0x92,0x08,0xa0,0xff,0xaf,0x12,0x49,0x7d,0x01,0x00,0x02,0x04,0xf0,0x00,
0x42,0x80,0xff,0xff,0xaa,0x24,0x57,0x40,0x08,0x08,0x90,0xf0,0x08,0x08,0x04,
0xff,0xb7,0x4a,0xd2,0x00,0x09,0x20,0x80,0x00,0xf2,0x40,0x40,0x01,0xfe,0xff,
0x55,0xa9,0x40,0x02,0x00,0x11,0x02,0xf0,0x02,0x01,0x10,0xfc,0x7f,0xaf,0x6a,
0x28,0x50,0x02,0x00,0x48,0xf0,0x08,0x24,0x42,0xe4,0xff,0x5d,0x3b,0x82,0x00,
0x08,0x42,0x00,0xf2,0x20,0x80,0x00,0x8a,0xfe,0xff,0x7d,0x00,0x52,0x40,0x08,
0x20,0xf0,0x01,0x01,0x08,0x34,0xfc,0xff,0x3f,0x00,0x48,0x00,0x20,0x82,0xf0,
0x08,0x10,0x82,0xf4,0xf1,0xfe,0x3f,0x49,0x20,0x84,0x00,0x00,0xf2,0x40,0x42,
0x10,0xe0,0xd3,0x60,0x7f,0x00,0x52,0x10,0x82,0x08,0xf0,0x02,0x00,0x42,0x84,
0x87,0xc1,0xff,0x25,0x00,0x00,0x08,0x20,0xf0,0x48,0x08,0x10,0x00,0x0a,0x80,
0xff,0x81,0x28,0x01,0x20,0x00,0xf2,0x00,0x21,0x81,0x10,0x24,0x84,0xff,0x07,
0x00,0x48,0x00,0x42,0xf0,0x00,0x00,0x10,0x00,0x10,0x00,0xfe,0x07,0x92,0x01,
0x81,0x00,0xf1,0x24,0x09,0x40,0x42,0x48,0x00,0xfc,0x27,0x88,0x05,0x08,0x08,
0xf0};

View File

@@ -0,0 +1,60 @@
#define prcFunny_width 100
#define prcFunny_height 65
static char prcFunny_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xf0,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x07,0xf0,0x00,0xa8,0xea,0x7d,0xef,0x7f,0xfb,0xdb,0xb5,0x5e,0x55,0x05,
0xf0,0x00,0xfc,0xff,0xf7,0xff,0xff,0xbf,0xff,0xff,0xff,0xff,0x07,0xf0,0x00,
0x58,0xd5,0x5f,0x5f,0xf7,0xff,0xdb,0xbb,0x7f,0x55,0x05,0xf0,0x00,0xf4,0x7f,
0x01,0x39,0x76,0xbc,0x91,0x13,0xe3,0xff,0x07,0xf0,0x00,0xbc,0xed,0x01,0x39,
0x76,0xb2,0x11,0x12,0xe3,0x6d,0x05,0xf0,0x00,0xd8,0xfb,0x00,0x00,0xf6,0xb3,
0x0d,0x62,0x83,0xdf,0x07,0xf0,0x00,0xec,0xfe,0x00,0x00,0x80,0x0f,0x0c,0x00,
0x83,0x77,0x05,0xf0,0x00,0x7c,0x1f,0x00,0x00,0x80,0x0f,0xe0,0x0f,0x00,0xdf,
0x07,0xf0,0x00,0xd4,0x03,0x00,0xff,0x07,0x02,0x1e,0xf0,0x00,0x7f,0x05,0xf0,
0x00,0x7c,0x03,0xf8,0x00,0x78,0xc0,0x01,0x00,0x03,0xec,0x07,0xf0,0x00,0xd4,
0x03,0x1f,0x00,0x80,0x73,0x00,0x00,0x04,0x7c,0x05,0xf0,0x00,0xfc,0x03,0x00,
0x00,0x00,0x3e,0x00,0x00,0x18,0xd8,0x07,0xf0,0x00,0xa8,0x00,0xc0,0xff,0x3f,
0x8e,0xff,0x7f,0x60,0x78,0x05,0xf0,0x00,0xfc,0x00,0x20,0x00,0x70,0x40,0x00,
0x80,0x00,0xe0,0x07,0xf0,0x00,0xd8,0x00,0x1e,0x00,0xc0,0x31,0x00,0x00,0x07,
0x40,0x05,0xf0,0x00,0xec,0x00,0x07,0x00,0x00,0x0e,0x00,0x08,0x1c,0xe0,0x07,
0xf0,0x00,0xfc,0x00,0x01,0x00,0x00,0x02,0x00,0x00,0x78,0x60,0x05,0xf0,0x00,
0xe4,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x07,0xf0,0x00,0x64,0xe4,
0x80,0x02,0x08,0x10,0x00,0x00,0x80,0x23,0x04,0xf0,0x00,0x64,0x24,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0x20,0x04,0xf0,0x00,0x60,0x38,0x00,0x00,0x00,0x10,
0x04,0x00,0x80,0x20,0x04,0xf0,0x00,0x60,0x38,0x00,0x00,0x00,0x02,0x00,0x00,
0x80,0x20,0x04,0xf0,0x00,0x60,0x18,0x08,0x00,0x00,0x00,0x04,0x00,0x81,0x00,
0x04,0xf0,0x00,0x60,0x18,0x00,0x00,0x3f,0x04,0x00,0x20,0x00,0xc0,0x04,0xf0,
0x00,0x64,0x18,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0xc3,0x04,0xf0,0x00,0x64,
0x18,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0xc3,0x04,0xf0,0x00,0xe4,0x18,0x00,
0x00,0x0e,0x80,0x03,0x00,0x00,0xc3,0x07,0xf0,0x00,0xfc,0x38,0x00,0x00,0x00,
0xc0,0x0f,0x00,0x80,0xc3,0x07,0xf0,0x00,0xfc,0x23,0x00,0x00,0x00,0xc0,0x0f,
0x00,0x80,0x00,0x05,0xf0,0x00,0xa8,0xe3,0x80,0x00,0x00,0x80,0x03,0x00,0x80,
0x00,0x07,0xf0,0x00,0xfc,0xc3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,
0xf0,0x00,0xac,0x03,0x40,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x06,0xf0,0x00,
0xf8,0x03,0x01,0x00,0x02,0x02,0x00,0x00,0x78,0xc0,0x07,0xf0,0x00,0xac,0x03,
0x07,0x00,0x00,0x0e,0x80,0x00,0x1c,0x60,0x03,0xf0,0x00,0xfc,0x03,0x20,0x00,
0x72,0x40,0x00,0x80,0x00,0xc0,0x06,0xf0,0x00,0xa8,0x03,0xc0,0xff,0x3f,0x80,
0x7f,0x7f,0x00,0xc0,0x07,0xf0,0x00,0xfc,0x03,0x00,0x00,0x80,0x31,0x00,0x00,
0x00,0x40,0x05,0xf0,0x00,0x58,0x03,0x00,0x00,0x80,0x31,0x00,0x00,0x00,0xc0,
0x07,0xf0,0x00,0xf4,0x03,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x40,0x05,0xf0,
0x00,0xbc,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x07,0xf0,0x00,0xd8,
0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xf0,0x00,0x74,0x1d,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x07,0xf0,0x00,0xdc,0x37,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x60,0x05,0xf0,0x00,0x78,0xfd,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xe0,0x07,0xf0,0x00,0xdc,0xd7,0x00,0x07,0x81,0x03,0x10,0x00,0x00,
0x40,0x05,0xf0,0x00,0xf4,0xfd,0xc0,0xf8,0xff,0x3f,0xfe,0x0f,0x00,0xfc,0x07,
0xf0,0x00,0x5c,0xaf,0x00,0x00,0x70,0xc0,0xed,0x0f,0x00,0x6c,0x05,0xf0,0x00,
0xf4,0xf5,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xdc,0x07,0xf0,0x00,0x5c,0xbf,
0x1e,0x00,0x00,0x00,0x00,0x00,0x80,0x77,0x05,0xf0,0x00,0xf4,0xd6,0x3b,0x00,
0x00,0x00,0x00,0x00,0x80,0xdd,0x07,0xf0,0x00,0xdc,0xfd,0xfe,0x01,0x00,0x00,
0x00,0x80,0xff,0x77,0x05,0xf0,0x00,0xb8,0xb7,0xd7,0x0f,0x00,0x00,0x00,0xf0,
0xaf,0xde,0x07,0xf0,0x00,0xec,0xee,0x7a,0xff,0xff,0xff,0x9f,0xff,0xfb,0x7b,
0x05,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xf0};

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