mirror of
https://github.com/thestk/stk
synced 2026-01-12 04:21:52 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c0ee03d60 |
@@ -16,7 +16,7 @@
|
||||
|
||||
AgogoBel :: AgogoBel() : Modal4()
|
||||
{
|
||||
wave = new RawWave("rawwaves/britestk.raw");
|
||||
wave = new RawInterp("rawwaves/britestk.raw");
|
||||
wave->normalize();
|
||||
wave->setRate((MY_FLOAT) 7.0); /* hardstick */
|
||||
this->setRatioAndReson(0, (MY_FLOAT) 1.00,(MY_FLOAT) 0.999); /* Set our */
|
||||
|
||||
126
DrumSynt.cpp
126
DrumSynt.cpp
@@ -2,12 +2,19 @@
|
||||
/* Master Class for Drum Synthesizer */
|
||||
/* by Perry R. Cook, 1995-96 */
|
||||
/* This instrument contains a bunch of */
|
||||
/* NI1sWave objects (Non-Interpolating, */
|
||||
/* 1 shot players), run through a bunch */
|
||||
/* of one-pole filters. You can specify */
|
||||
/* the maximum Polyphony (maximum number */
|
||||
/* of simultaneous voices) in a #define */
|
||||
/* in the .h file. */
|
||||
/* RawWave 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 */
|
||||
/* RawShot objects are used. Otherwise, */
|
||||
/* RawInterp objects are used. You can */
|
||||
/* specify the maximum Polyphony (maximum */
|
||||
/* number of simultaneous voices) in a */
|
||||
/* #define in the .h file. */
|
||||
/* */
|
||||
/* Modified for RawWave abstract class */
|
||||
/* by Gary P. Scavone (11/11/98) */
|
||||
/*******************************************/
|
||||
|
||||
#include "DrumSynt.h"
|
||||
@@ -48,25 +55,40 @@ char waveNames[DRUM_NUMWAVES][16] = {
|
||||
DrumSynt :: DrumSynt() : Instrmnt()
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i=0;i<DRUM_POLYPHONY;i++) {
|
||||
filters[i] = new OnePole;
|
||||
sounding[i] = -1;
|
||||
}
|
||||
numSounding = 0; /* This counts the number */
|
||||
/* of sounding voices */
|
||||
}
|
||||
}
|
||||
/* This counts the number of sounding voices */
|
||||
numSounding = 0;
|
||||
|
||||
/* Print warning about aliasing if SRATE < 22050 */
|
||||
if (SRATE < 22050) {
|
||||
printf("\nWarning: DrumSynt 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);
|
||||
}
|
||||
}
|
||||
|
||||
DrumSynt :: ~DrumSynt()
|
||||
{
|
||||
int i;
|
||||
for ( i=0; i<numSounding-1; i++ ) delete waves[i];
|
||||
for ( i=0; i<DRUM_POLYPHONY; i++ ) delete filters[i];
|
||||
}
|
||||
|
||||
void DrumSynt :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
|
||||
{
|
||||
int i,notDone;
|
||||
int i, notDone;
|
||||
int noteNum;
|
||||
int vel;
|
||||
char tempString[64];
|
||||
RawWvIn *tempWv;
|
||||
RawWave *tempWv;
|
||||
OnePole *tempFilt;
|
||||
|
||||
noteNum = (int) ((12*log(freq/220)/log(2)) + 57.01); // Yes I know, this is tres kludgey
|
||||
/* Yes I know, this is tres kludgey */
|
||||
noteNum = (int) ((12*log(freq/220)/log(2)) + 57.01);
|
||||
vel = (int) (amp * 127);
|
||||
|
||||
#if defined(_debug_)
|
||||
@@ -77,33 +99,37 @@ void DrumSynt :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
|
||||
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 */
|
||||
|
||||
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 */
|
||||
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 */
|
||||
} else {
|
||||
numSounding += 1; /* otherwise just add one */
|
||||
}
|
||||
|
||||
sounding[numSounding-1] = noteNum; /* allocate new wave */
|
||||
strcpy(tempString,"rawwaves/");
|
||||
strcat(tempString,waveNames[genMIDIMap[noteNum]]);
|
||||
waves[numSounding-1] = new RawWvIn(tempString);
|
||||
waves[numSounding-1]->normalize((MY_FLOAT) 0.2);
|
||||
if (SRATE == 22050) {
|
||||
waves[numSounding-1] = new RawShot(tempString);
|
||||
} else {
|
||||
waves[numSounding-1] = new RawInterp(tempString);
|
||||
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 {
|
||||
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);
|
||||
@@ -118,23 +144,13 @@ void DrumSynt :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
|
||||
|
||||
MY_FLOAT DrumSynt :: tick()
|
||||
{
|
||||
int i, j, notDone;
|
||||
MY_FLOAT output;
|
||||
int j, i = 0;
|
||||
MY_FLOAT output = 0.0;
|
||||
OnePole *tempFilt;
|
||||
|
||||
i = 0;
|
||||
notDone = 1;
|
||||
output = (MY_FLOAT) 0.0;
|
||||
|
||||
if (numSounding == 0) notDone = 0;
|
||||
while (notDone && (i < numSounding)) {
|
||||
|
||||
|
||||
while (i < numSounding) {
|
||||
output += filters[i]->tick(waves[i]->lastOut());
|
||||
|
||||
if (waves[i]->informTick() == 1) {
|
||||
#if defined(_debug_)
|
||||
printf("Wave %i %i down here\n",i,sounding[i]);
|
||||
#endif
|
||||
if (waves[i]->informTick() == 1) {
|
||||
delete waves[i];
|
||||
tempFilt = filters[i];
|
||||
|
||||
@@ -147,37 +163,9 @@ MY_FLOAT DrumSynt :: tick()
|
||||
filters[j]->clear();
|
||||
sounding[j] = -1;
|
||||
numSounding -= 1;
|
||||
if (numSounding == 0) notDone = 0;
|
||||
i -= 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return output * 2;
|
||||
return output;
|
||||
}
|
||||
|
||||
/************** Test Main Program *********************/
|
||||
/*
|
||||
#include "miditabl.h"
|
||||
#include "RawWvOut.h"
|
||||
#include "Reverb.h"
|
||||
#include "Noise.h"
|
||||
|
||||
void main()
|
||||
{
|
||||
long i,j;
|
||||
DrumSynt instrument;
|
||||
RawWvOut output("test.snd");
|
||||
Reverb reverb((MY_FLOAT) 2137);
|
||||
Noise noise;
|
||||
|
||||
for (j=0;j<100;j++) {
|
||||
i = (int) (fabs(noise.tick()) * DRUM_NUMWAVES);
|
||||
instrument.noteOn(i,1.0);
|
||||
for (i=0;i<2000;i++) output.tick(reverb.tick(instrument.tick()));
|
||||
}
|
||||
|
||||
for (i=0;i<22000;i++) output.tick(reverb.tick(instrument.tick()));
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
27
DrumSynt.h
27
DrumSynt.h
@@ -2,19 +2,28 @@
|
||||
/* Master Class for Drum Synthesizer */
|
||||
/* by Perry R. Cook, 1995-96 */
|
||||
/* This instrument contains a bunch of */
|
||||
/* RawWvIn objects (Non-Interpolating, */
|
||||
/* 1 shot players), run through a bunch */
|
||||
/* of one-pole filters. You can specify */
|
||||
/* the maximum Polyphony (maximum number */
|
||||
/* of simultaneous voices) in a #define */
|
||||
/* in the .h file. */
|
||||
/* RawWave 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 */
|
||||
/* RawShot objects are used. Otherwise, */
|
||||
/* RawInterp objects are used. You can */
|
||||
/* specify the maximum Polyphony (maximum */
|
||||
/* number of simultaneous voices) in a */
|
||||
/* #define in the .h file. */
|
||||
/* */
|
||||
/* Modified for RawWave abstract class */
|
||||
/* by Gary P. Scavone (11/11/98) */
|
||||
/*******************************************/
|
||||
|
||||
#if !defined(__DrumSynt_h)
|
||||
#define __DrumSynt_h
|
||||
|
||||
#include "Instrmnt.h"
|
||||
#include "RawWvIn.h"
|
||||
#include "RawWave.h"
|
||||
#include "RawShot.h"
|
||||
#include "RawInterp.h"
|
||||
#include "OnePole.h"
|
||||
|
||||
#define DRUM_NUMWAVES 11
|
||||
@@ -23,13 +32,13 @@
|
||||
class DrumSynt : public Instrmnt
|
||||
{
|
||||
protected:
|
||||
RawWvIn *waves[DRUM_POLYPHONY];
|
||||
RawWave *waves[DRUM_POLYPHONY];
|
||||
OnePole *filters[DRUM_POLYPHONY];
|
||||
int sounding[DRUM_POLYPHONY];
|
||||
int numSounding;
|
||||
public:
|
||||
DrumSynt();
|
||||
/* ~DrumSynt(); */
|
||||
~DrumSynt();
|
||||
virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
|
||||
virtual MY_FLOAT tick();
|
||||
};
|
||||
|
||||
15
MD2SKINI.cpp
15
MD2SKINI.cpp
@@ -90,7 +90,6 @@ void errorf(void) {
|
||||
void main(int argc,char *argv[])
|
||||
{
|
||||
long j;
|
||||
int oneOn = 0;
|
||||
MY_FLOAT byte2, byte3;
|
||||
int channel;
|
||||
int firstMessage = 1;
|
||||
@@ -203,31 +202,23 @@ void main(int argc,char *argv[])
|
||||
switch(controller->getType()) {
|
||||
case __SK_NoteOn_:
|
||||
if (byte3 < 1.0) {
|
||||
if (oneOn == 1) {
|
||||
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,64.0);
|
||||
if (writeFileOut) {
|
||||
fprintf(fileOut,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,64.0);
|
||||
}
|
||||
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,64.0);
|
||||
if (writeFileOut) {
|
||||
}
|
||||
oneOn -= 1;
|
||||
} else {
|
||||
sprintf(s,"NoteOn\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
|
||||
if (writeFileOut) {
|
||||
fprintf(fileOut,"NoteOn\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
|
||||
}
|
||||
oneOn += 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case __SK_NoteOff_:
|
||||
if (byte3 < 2.0) byte3 = 64.0;
|
||||
if (oneOn == 1) {
|
||||
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
|
||||
}
|
||||
sprintf(s,"NoteOff\t\t%.3f %d %.1f %.1f\n",0.0,channel,byte2,byte3);
|
||||
if (writeFileOut) {
|
||||
fprintf(fileOut,"NoteOff\t\t%.3f %d %.1f %.1f\n",dt,channel,byte2,byte3);
|
||||
}
|
||||
oneOn -= 1;
|
||||
break;
|
||||
|
||||
case __SK_PolyPressure_:
|
||||
|
||||
@@ -163,6 +163,7 @@ int MIDIIO :: nextMessage()
|
||||
#include <sys/types.h>
|
||||
#include <sys/soundcard.h>
|
||||
#include <pthread.h>
|
||||
//#include <pthread/mit/pthread.h>
|
||||
|
||||
int _seqfd;
|
||||
|
||||
|
||||
3
Makefile
3
Makefile
@@ -6,7 +6,7 @@
|
||||
OS = $(shell uname)
|
||||
|
||||
O_FILES = Object.o Envelope.o ADSR.o Noise.o SubNoise.o \
|
||||
RawWave.o RawWvIn.o RawLoop.o \
|
||||
RawWave.o RawShot.o RawLoop.o RawInterp.o \
|
||||
Modulatr.o Filter.o OneZero.o \
|
||||
OnePole.o TwoZero.o TwoPole.o DCBlock.o \
|
||||
BiQuad.o DLineA.o DLineL.o DLineN.o VoicMang.o \
|
||||
@@ -43,6 +43,7 @@ ifeq ($(OS),Linux) # These are for Linux
|
||||
CC = gcc -O3 # -g -pg -O3
|
||||
O_FILES += RTWvOut.o RTSoundIO.o MIDIIO.o
|
||||
LIBRARY = -lpthread -lm
|
||||
# LIBRARY = /lib/libpthread.so.0 -lm
|
||||
endif
|
||||
|
||||
.SUFFIXES: .cpp
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# STK98 Makefile - NeXTStep solo version
|
||||
|
||||
O_FILES = Object.o Envelope.o ADSR.o Noise.o SubNoise.o \
|
||||
RawWave.o RawWvIn.o RawLoop.o \
|
||||
RawWave.o RawShot.o RawLoop.o RawInterp.o \
|
||||
Modulatr.o Filter.o OneZero.o \
|
||||
OnePole.o TwoZero.o TwoPole.o DCBlock.o \
|
||||
BiQuad.o DLineA.o DLineL.o DLineN.o VoicMang.o \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# STK98 Makefile - Linux solo version
|
||||
|
||||
O_FILES = Object.o Envelope.o ADSR.o Noise.o SubNoise.o \
|
||||
RawWave.o RawWvIn.o RawLoop.o \
|
||||
RawWave.o RawShot.o RawLoop.o RawInterp.o \
|
||||
Modulatr.o Filter.o OneZero.o \
|
||||
OnePole.o TwoZero.o TwoPole.o DCBlock.o \
|
||||
BiQuad.o DLineA.o DLineL.o DLineN.o VoicMang.o \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# STK98 Makefile - SGI solo version
|
||||
|
||||
O_FILES = Object.o Envelope.o ADSR.o Noise.o SubNoise.o \
|
||||
RawWave.o RawWvIn.o RawLoop.o \
|
||||
RawWave.o RawShot.o RawLoop.o RawInterp.o \
|
||||
Modulatr.o Filter.o OneZero.o \
|
||||
OnePole.o TwoZero.o TwoPole.o DCBlock.o \
|
||||
BiQuad.o DLineA.o DLineL.o DLineN.o VoicMang.o \
|
||||
|
||||
173
Mandolin.cpp
173
Mandolin.cpp
@@ -21,28 +21,28 @@
|
||||
|
||||
Mandolin :: Mandolin(MY_FLOAT lowestFreq) : Plucked2(lowestFreq)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
|
||||
soundfile[0] = new RawWave("rawwaves/mand1.raw");
|
||||
soundfile[1] = new RawWave("rawwaves/mand2.raw");
|
||||
soundfile[2] = new RawWave("rawwaves/mand3.raw");
|
||||
soundfile[3] = new RawWave("rawwaves/mand4.raw");
|
||||
soundfile[4] = new RawWave("rawwaves/mand5.raw");
|
||||
soundfile[5] = new RawWave("rawwaves/mand6.raw");
|
||||
soundfile[6] = new RawWave("rawwaves/mand7.raw");
|
||||
soundfile[7] = new RawWave("rawwaves/mand8.raw");
|
||||
soundfile[8] = new RawWave("rawwaves/mand9.raw");
|
||||
soundfile[9] = new RawWave("rawwaves/mand10.raw");
|
||||
soundfile[10] = new RawWave("rawwaves/mand11.raw");
|
||||
soundfile[11] = new RawWave("rawwaves/mand12.raw");
|
||||
for (i=0;i<12;i++) {
|
||||
// soundfile[i]->normalize((MY_FLOAT) 0.1); /* Empirical hack here */
|
||||
soundfile[i]->setLooping(0);
|
||||
}
|
||||
directBody = 1.0;
|
||||
mic = 0;
|
||||
dampTime = 0;
|
||||
waveDone = 1;
|
||||
soundfile[0] = new RawInterp("rawwaves/mand1.raw");
|
||||
soundfile[1] = new RawInterp("rawwaves/mand2.raw");
|
||||
soundfile[2] = new RawInterp("rawwaves/mand3.raw");
|
||||
soundfile[3] = new RawInterp("rawwaves/mand4.raw");
|
||||
soundfile[4] = new RawInterp("rawwaves/mand5.raw");
|
||||
soundfile[5] = new RawInterp("rawwaves/mand6.raw");
|
||||
soundfile[6] = new RawInterp("rawwaves/mand7.raw");
|
||||
soundfile[7] = new RawInterp("rawwaves/mand8.raw");
|
||||
soundfile[8] = new RawInterp("rawwaves/mand9.raw");
|
||||
soundfile[9] = new RawInterp("rawwaves/mand10.raw");
|
||||
soundfile[10] = new RawInterp("rawwaves/mand11.raw");
|
||||
soundfile[11] = new RawInterp("rawwaves/mand12.raw");
|
||||
for (i=0;i<12;i++) {
|
||||
// soundfile[i]->normalize((MY_FLOAT) 0.1); /* Empirical hack here */
|
||||
soundfile[i]->setLooping(0);
|
||||
}
|
||||
directBody = 1.0;
|
||||
mic = 0;
|
||||
dampTime = 0;
|
||||
waveDone = 1;
|
||||
}
|
||||
|
||||
Mandolin :: ~Mandolin()
|
||||
@@ -50,28 +50,29 @@ Mandolin :: ~Mandolin()
|
||||
}
|
||||
|
||||
void Mandolin :: pluck(MY_FLOAT amplitude)
|
||||
{ /* this function gets interesting here, */
|
||||
soundfile[mic]->reset(); /* because pluck may be longer than */
|
||||
pluckAmp = amplitude; /* string length, so we just reset the */
|
||||
/* soundfile and add in the pluck in */
|
||||
/* the tick method. */
|
||||
combDelay->setDelay(
|
||||
(MY_FLOAT) 0.5 * pluckPos * lastLength); /* Set Pick Position */
|
||||
/* which puts zeroes at pos*length */
|
||||
dampTime = (long) lastLength; /* See tick method below */
|
||||
waveDone = 0;
|
||||
{ /* this function gets interesting here, */
|
||||
/* because pluck may be longer than */
|
||||
/* string length, so we just reset the */
|
||||
/* soundfile and add in the pluck in */
|
||||
/* the tick method. */
|
||||
soundfile[mic]->reset();
|
||||
pluckAmp = amplitude;
|
||||
/* Set Pick Position which puts zeroes at pos*length */
|
||||
combDelay->setDelay((MY_FLOAT) 0.5 * pluckPos * lastLength);
|
||||
dampTime = (long) lastLength; /* See tick method below */
|
||||
waveDone = 0;
|
||||
}
|
||||
|
||||
void Mandolin :: pluck(MY_FLOAT amplitude, MY_FLOAT position)
|
||||
{
|
||||
pluckPos = position; /* pluck position is zeroes at pos*length */
|
||||
this->pluck(amplitude);
|
||||
pluckPos = position; /* pluck position is zeroes at pos*length */
|
||||
this->pluck(amplitude);
|
||||
}
|
||||
|
||||
void Mandolin :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
|
||||
{
|
||||
this->setFreq(freq);
|
||||
this->pluck(amp);
|
||||
this->setFreq(freq);
|
||||
this->pluck(amp);
|
||||
#if defined(_debug_)
|
||||
printf("Mandolin : NoteOn: Freq=%lf Amp=%lf\n",freq,amp);
|
||||
#endif
|
||||
@@ -79,66 +80,64 @@ void Mandolin :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
|
||||
|
||||
void Mandolin :: setBodySize(MY_FLOAT size)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<12;i++) {
|
||||
soundfile[i]->setRate(size);
|
||||
}
|
||||
int i;
|
||||
for (i=0;i<12;i++) {
|
||||
soundfile[i]->setRate(size);
|
||||
}
|
||||
}
|
||||
|
||||
MY_FLOAT Mandolin :: tick()
|
||||
{
|
||||
MY_FLOAT temp = (MY_FLOAT) 0;
|
||||
if (!waveDone) {
|
||||
waveDone = soundfile[mic]->informTick(); /* as long as it goes . . . */
|
||||
temp = soundfile[mic]->lastOut() * pluckAmp; /* scaled pluck excitation */
|
||||
temp = temp - combDelay->tick(temp); /* with comb filtering */
|
||||
}
|
||||
if (dampTime>=0) { /* Damping hack to help avoid */
|
||||
dampTime -= 1; /* overflow on replucking */
|
||||
lastOutput = delayLine->tick( /* Calculate 1st delay */
|
||||
filter->tick( /* filterered reflection */
|
||||
temp + /* plus pluck excitation */
|
||||
(delayLine->lastOut() * (MY_FLOAT) 0.7)));
|
||||
lastOutput += delayLine2->tick( /* and 2nd delay */
|
||||
filter2->tick( /* just like the 1st */
|
||||
temp +
|
||||
(delayLine2->lastOut() * (MY_FLOAT) 0.7))); /* that's the whole thing!! */
|
||||
}
|
||||
else { /* No damping hack after 1 period */
|
||||
lastOutput = delayLine->tick( /* Calculate 1st delay */
|
||||
filter->tick( /* filtered reflection */
|
||||
temp + /* plus pluck excitation */
|
||||
(delayLine->lastOut()
|
||||
* loopGain)));
|
||||
lastOutput += delayLine2->tick( /* and 2nd delay */
|
||||
filter2->tick( /* just like the 1st */
|
||||
temp +
|
||||
(delayLine2->lastOut()
|
||||
* loopGain)));
|
||||
}
|
||||
lastOutput *= (MY_FLOAT) 0.3 / 32768.0;
|
||||
return lastOutput;
|
||||
MY_FLOAT temp = (MY_FLOAT) 0;
|
||||
if (!waveDone) {
|
||||
waveDone = soundfile[mic]->informTick(); /* as long as it goes . . . */
|
||||
temp = soundfile[mic]->lastOut() * pluckAmp; /* scaled pluck excitation */
|
||||
temp = temp - combDelay->tick(temp); /* with comb filtering */
|
||||
}
|
||||
if (dampTime>=0) { /* Damping hack to help avoid */
|
||||
dampTime -= 1; /* overflow on replucking */
|
||||
lastOutput = delayLine->tick( /* Calculate 1st delay */
|
||||
filter->tick( /* filterered reflection */
|
||||
temp + /* plus pluck excitation */
|
||||
(delayLine->lastOut() * (MY_FLOAT) 0.7)));
|
||||
lastOutput += delayLine2->tick( /* and 2nd delay */
|
||||
filter2->tick( /* just like the 1st */
|
||||
temp +
|
||||
(delayLine2->lastOut() * (MY_FLOAT) 0.7))); /* that's the whole thing!! */
|
||||
}
|
||||
else { /* No damping hack after 1 period */
|
||||
lastOutput = delayLine->tick( /* Calculate 1st delay */
|
||||
filter->tick( /* filtered reflection */
|
||||
temp + /* plus pluck excitation */
|
||||
(delayLine->lastOut() * loopGain)));
|
||||
lastOutput += delayLine2->tick( /* and 2nd delay */
|
||||
filter2->tick( /* just like the 1st */
|
||||
temp +
|
||||
(delayLine2->lastOut() * loopGain)));
|
||||
}
|
||||
lastOutput *= (MY_FLOAT) 0.3 / 32768.0;
|
||||
return lastOutput;
|
||||
}
|
||||
|
||||
void Mandolin :: controlChange(int number, MY_FLOAT value)
|
||||
{
|
||||
#if defined(_debug_)
|
||||
printf("Mandolin : ControlChange: Number=%i Value=%f\n",number,value);
|
||||
printf("Mandolin : ControlChange: Number=%i Value=%f\n",number,value);
|
||||
#endif
|
||||
if (number == __SK_BodySize_)
|
||||
this->setBodySize(value * (MY_FLOAT) NORM_7 * (MY_FLOAT) 2.0);
|
||||
else if (number == __SK_PickPosition_)
|
||||
this->setPluckPos(value * (MY_FLOAT) NORM_7);
|
||||
else if (number == __SK_StringDamping_)
|
||||
this->setBaseLoopGain((MY_FLOAT) 0.97 + (value * (MY_FLOAT) NORM_7 * (MY_FLOAT) 0.03));
|
||||
else if (number == __SK_StringDetune_)
|
||||
this->setDetune((MY_FLOAT) 1.0 - (value * (MY_FLOAT) NORM_7 * (MY_FLOAT) 0.1));
|
||||
else if (number == __SK_AfterTouch_)
|
||||
this->pluck(value * (MY_FLOAT) NORM_7);
|
||||
else if (number == 411) {
|
||||
mic = (int) value % 12;
|
||||
}
|
||||
else {
|
||||
printf("Mandolin : Undefined Control Number!! %i\n",number);
|
||||
}
|
||||
if (number == __SK_BodySize_)
|
||||
this->setBodySize(value * (MY_FLOAT) NORM_7 * (MY_FLOAT) 2.0);
|
||||
else if (number == __SK_PickPosition_)
|
||||
this->setPluckPos(value * (MY_FLOAT) NORM_7);
|
||||
else if (number == __SK_StringDamping_)
|
||||
this->setBaseLoopGain((MY_FLOAT) 0.97 + (value * (MY_FLOAT) NORM_7 * (MY_FLOAT) 0.03));
|
||||
else if (number == __SK_StringDetune_)
|
||||
this->setDetune((MY_FLOAT) 1.0 - (value * (MY_FLOAT) NORM_7 * (MY_FLOAT) 0.1));
|
||||
else if (number == __SK_AfterTouch_)
|
||||
this->pluck(value * (MY_FLOAT) NORM_7);
|
||||
else if (number == 411) {
|
||||
mic = (int) value % 12;
|
||||
}
|
||||
else {
|
||||
printf("Mandolin : Undefined Control Number!! %i\n",number);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
#define __Mandolin_h
|
||||
|
||||
#include "Plucked2.h"
|
||||
#include "RawWave.h"
|
||||
#include "RawInterp.h"
|
||||
|
||||
class Mandolin : public Plucked2
|
||||
{
|
||||
protected:
|
||||
RawWave *soundfile[12];
|
||||
RawInterp *soundfile[12];
|
||||
MY_FLOAT directBody;
|
||||
int mic;
|
||||
long dampTime;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
Marimba :: Marimba() : Modal4()
|
||||
{
|
||||
wave = new RawWave("rawwaves/marmstk1.raw");
|
||||
wave = new RawInterp("rawwaves/marmstk1.raw");
|
||||
wave->normalize();
|
||||
wave->setRate((MY_FLOAT) 0.5); /* normal stick */
|
||||
this->setRatioAndReson(0, (MY_FLOAT) 1.00,(MY_FLOAT) 0.9996); /* Set all 132.0 */
|
||||
@@ -105,7 +105,7 @@ void Marimba :: controlChange(int number, MY_FLOAT value)
|
||||
MY_FLOAT Marimba :: tick()
|
||||
{
|
||||
if (multiStrike>0)
|
||||
if (wave->isAllDone()) {
|
||||
if (wave->isFinished()) {
|
||||
wave->reset();
|
||||
multiStrike -= 1;
|
||||
}
|
||||
|
||||
4
Modal4.h
4
Modal4.h
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "Instrmnt.h"
|
||||
#include "Envelope.h"
|
||||
#include "RawWave.h"
|
||||
#include "RawInterp.h"
|
||||
#include "RawLoop.h"
|
||||
#include "BiQuad.h"
|
||||
#include "OnePole.h"
|
||||
@@ -20,7 +20,7 @@ class Modal4 : public Instrmnt
|
||||
{
|
||||
protected:
|
||||
Envelope *envelope;
|
||||
RawWave *wave;
|
||||
RawInterp *wave;
|
||||
BiQuad *filters[4];
|
||||
OnePole *onepole;
|
||||
RawLoop *vibr;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
Moog1 :: Moog1() : SamplFlt()
|
||||
{
|
||||
attacks[0] = new RawWave("rawwaves/mandpluk.raw");
|
||||
attacks[0] = new RawInterp("rawwaves/mandpluk.raw");
|
||||
loops[0] = new RawLoop("rawwaves/impuls20.raw");
|
||||
loops[1] = new RawLoop("rawwaves/sinewave.raw"); /* Steal one for vibrato */
|
||||
attacks[0]->normalize();
|
||||
|
||||
11
Object.h
11
Object.h
@@ -22,6 +22,8 @@ class Object
|
||||
virtual ~Object();
|
||||
};
|
||||
|
||||
/* Uncomment your OS type below! */
|
||||
|
||||
/* #define __OS_NeXT_ */
|
||||
#define __OS_IRIX_
|
||||
/* #define __OS_Linux_ */
|
||||
@@ -58,21 +60,21 @@ class Object
|
||||
#define MAX_IN_STRINGS 25
|
||||
|
||||
/* SRATE here is 44100, others are derived accordingly */
|
||||
|
||||
/*
|
||||
#define SRATE (MY_FLOAT) 44100.0
|
||||
#define SRATE_OVER_TWO (MY_FLOAT) 22050.0
|
||||
#define ONE_OVER_SRATE (MY_FLOAT) 0.00002267573696
|
||||
#define RATE_NORM (MY_FLOAT) 0.5
|
||||
#define TWO_PI_OVER_SRATE (MY_FLOAT) 0.0001424758573
|
||||
|
||||
*/
|
||||
/* SRATE here is 22050, others are derived accordingly */
|
||||
/*
|
||||
|
||||
#define SRATE (MY_FLOAT) 22050.0
|
||||
#define SRATE_OVER_TWO (MY_FLOAT) 11025.0
|
||||
#define ONE_OVER_SRATE (MY_FLOAT) 0.00004535147392
|
||||
#define RATE_NORM (MY_FLOAT) 1.0
|
||||
#define TWO_PI_OVER_SRATE (MY_FLOAT) 0.0002849517146
|
||||
*/
|
||||
|
||||
/* SRATE here is 16000, others are derived accordingly */
|
||||
/*
|
||||
#define SRATE (MY_FLOAT) 16000.0
|
||||
@@ -81,7 +83,6 @@ class Object
|
||||
#define RATE_NORM (MY_FLOAT) 1.375
|
||||
#define TWO_PI_OVER_SRATE (MY_FLOAT) 0.000392699
|
||||
*/
|
||||
|
||||
/* SRATE here is 8k, others are derived accordingly */
|
||||
/*
|
||||
#define SRATE (MY_FLOAT) 8000.0
|
||||
|
||||
73
Plucked.cpp
73
Plucked.cpp
@@ -11,74 +11,73 @@
|
||||
|
||||
Plucked :: Plucked(MY_FLOAT lowestFreq)
|
||||
{
|
||||
length = (long) (SRATE / lowestFreq + 1);
|
||||
loopGain = (MY_FLOAT) 0.999;
|
||||
delayLine = new DLineA(length);
|
||||
loopFilt = new OneZero;
|
||||
pickFilt = new OnePole;
|
||||
noise = new Noise;
|
||||
this->clear();
|
||||
length = (long) (SRATE / lowestFreq + 1);
|
||||
loopGain = (MY_FLOAT) 0.999;
|
||||
delayLine = new DLineA(length);
|
||||
loopFilt = new OneZero;
|
||||
pickFilt = new OnePole;
|
||||
noise = new Noise;
|
||||
this->clear();
|
||||
}
|
||||
|
||||
Plucked :: ~Plucked()
|
||||
{
|
||||
delete delayLine;
|
||||
delete loopFilt;
|
||||
delete pickFilt;
|
||||
delete noise;
|
||||
delete delayLine;
|
||||
delete loopFilt;
|
||||
delete pickFilt;
|
||||
delete noise;
|
||||
}
|
||||
|
||||
void Plucked :: clear()
|
||||
{
|
||||
delayLine->clear();
|
||||
loopFilt->clear();
|
||||
pickFilt->clear();
|
||||
delayLine->clear();
|
||||
loopFilt->clear();
|
||||
pickFilt->clear();
|
||||
}
|
||||
|
||||
void Plucked :: setFreq(MY_FLOAT frequency)
|
||||
{
|
||||
MY_FLOAT delay;
|
||||
delay = (SRATE / frequency) - (MY_FLOAT) 0.5; /* length - delays */
|
||||
delayLine->setDelay(delay);
|
||||
loopGain = (MY_FLOAT) 0.995 + (frequency * (MY_FLOAT) 0.000005);
|
||||
if (loopGain>1.0) loopGain = (MY_FLOAT) 0.99999;
|
||||
MY_FLOAT delay;
|
||||
delay = (SRATE / frequency) - (MY_FLOAT) 0.5; /* length - delays */
|
||||
delayLine->setDelay(delay);
|
||||
loopGain = (MY_FLOAT) 0.995 + (frequency * (MY_FLOAT) 0.000005);
|
||||
if (loopGain>1.0) loopGain = (MY_FLOAT) 0.99999;
|
||||
}
|
||||
|
||||
void Plucked :: pluck(MY_FLOAT amplitude)
|
||||
{
|
||||
long i;
|
||||
pickFilt->setPole((MY_FLOAT) 0.999 - (amplitude * (MY_FLOAT) 0.15));
|
||||
pickFilt->setGain(amplitude * (MY_FLOAT) 0.5);
|
||||
for (i=0;i<length;i++)
|
||||
delayLine->tick(delayLine->lastOut() * (MY_FLOAT) 0.6 /* fill delay with noise */
|
||||
+ pickFilt->tick(noise->tick())); /* additively with current */
|
||||
/* contents */
|
||||
long i;
|
||||
pickFilt->setPole((MY_FLOAT) 0.999 - (amplitude * (MY_FLOAT) 0.15));
|
||||
pickFilt->setGain(amplitude * (MY_FLOAT) 0.5);
|
||||
for (i=0;i<length;i++)
|
||||
delayLine->tick(delayLine->lastOut() * (MY_FLOAT) 0.6 /* fill delay with noise */
|
||||
+ pickFilt->tick(noise->tick())); /* additively with current */
|
||||
/* contents */
|
||||
}
|
||||
|
||||
void Plucked :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
|
||||
{
|
||||
this->setFreq(freq);
|
||||
this->pluck(amp);
|
||||
this->setFreq(freq);
|
||||
this->pluck(amp);
|
||||
#if defined(_debug_)
|
||||
printf("Plucked : NoteOn: Freq=%lf Amp=%lf\n",freq,amp);
|
||||
printf("Plucked : NoteOn: Freq=%lf Amp=%lf\n",freq,amp);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Plucked :: noteOff(MY_FLOAT amp)
|
||||
{
|
||||
loopGain = (MY_FLOAT) 1.0 - amp;
|
||||
loopGain = (MY_FLOAT) 1.0 - amp;
|
||||
#if defined(_debug_)
|
||||
printf("Plucked : NoteOff: Amp=%lf\n",amp);
|
||||
printf("Plucked : NoteOff: Amp=%lf\n",amp);
|
||||
#endif
|
||||
}
|
||||
|
||||
MY_FLOAT Plucked :: tick()
|
||||
{
|
||||
lastOutput = delayLine->tick( /* check this out, */
|
||||
loopFilt->tick( /* here's the whole inner */
|
||||
delayLine->lastOut() /* loop of the instrument!! */
|
||||
* loopGain));
|
||||
lastOutput *= (MY_FLOAT) 3.0;
|
||||
return lastOutput;
|
||||
/* check this out */
|
||||
/* here's the whole inner loop of the instrument!! */
|
||||
lastOutput = delayLine->tick(loopFilt->tick(delayLine->lastOut() * loopGain));
|
||||
lastOutput *= (MY_FLOAT) 3.0;
|
||||
return lastOutput;
|
||||
}
|
||||
|
||||
|
||||
82
Plucked2.cpp
82
Plucked2.cpp
@@ -11,80 +11,80 @@
|
||||
|
||||
Plucked2 :: Plucked2(MY_FLOAT lowestFreq)
|
||||
{
|
||||
length = (long) (SRATE / lowestFreq + 1);
|
||||
baseLoopGain = (MY_FLOAT) 0.995;
|
||||
loopGain = (MY_FLOAT) 0.999;
|
||||
delayLine = new DLineA(length);
|
||||
delayLine2 = new DLineA(length);
|
||||
combDelay = new DLineL(length);
|
||||
filter = new OneZero;
|
||||
filter2 = new OneZero;
|
||||
pluckAmp = (MY_FLOAT) 0.3;
|
||||
pluckPos = (MY_FLOAT) 0.4;
|
||||
detuning = (MY_FLOAT) 0.995;
|
||||
lastFreq = lowestFreq * (MY_FLOAT) 2.0;
|
||||
lastLength = length * (MY_FLOAT) 0.5;
|
||||
length = (long) (SRATE / lowestFreq + 1);
|
||||
baseLoopGain = (MY_FLOAT) 0.995;
|
||||
loopGain = (MY_FLOAT) 0.999;
|
||||
delayLine = new DLineA(length);
|
||||
delayLine2 = new DLineA(length);
|
||||
combDelay = new DLineL(length);
|
||||
filter = new OneZero;
|
||||
filter2 = new OneZero;
|
||||
pluckAmp = (MY_FLOAT) 0.3;
|
||||
pluckPos = (MY_FLOAT) 0.4;
|
||||
detuning = (MY_FLOAT) 0.995;
|
||||
lastFreq = lowestFreq * (MY_FLOAT) 2.0;
|
||||
lastLength = length * (MY_FLOAT) 0.5;
|
||||
}
|
||||
|
||||
Plucked2 :: ~Plucked2()
|
||||
{
|
||||
delete delayLine;
|
||||
delete delayLine2;
|
||||
delete combDelay;
|
||||
delete filter;
|
||||
delete filter2;
|
||||
delete delayLine;
|
||||
delete delayLine2;
|
||||
delete combDelay;
|
||||
delete filter;
|
||||
delete filter2;
|
||||
}
|
||||
|
||||
void Plucked2 :: clear()
|
||||
{
|
||||
delayLine->clear();
|
||||
delayLine2->clear();
|
||||
combDelay->clear();
|
||||
filter->clear();
|
||||
filter2->clear();
|
||||
delayLine->clear();
|
||||
delayLine2->clear();
|
||||
combDelay->clear();
|
||||
filter->clear();
|
||||
filter2->clear();
|
||||
}
|
||||
|
||||
void Plucked2 :: setFreq(MY_FLOAT frequency)
|
||||
{
|
||||
lastFreq = frequency;
|
||||
lastLength = ((MY_FLOAT) SRATE / lastFreq); /* length - delays */
|
||||
delayLine->setDelay((lastLength / detuning) - (MY_FLOAT) 0.5);
|
||||
delayLine2->setDelay((lastLength * detuning) - (MY_FLOAT) 0.5);
|
||||
loopGain = baseLoopGain + (frequency * (MY_FLOAT) 0.000005);
|
||||
if (loopGain>1.0) loopGain = (MY_FLOAT) 0.99999;
|
||||
lastFreq = frequency;
|
||||
lastLength = ((MY_FLOAT) SRATE / lastFreq); /* length - delays */
|
||||
delayLine->setDelay((lastLength / detuning) - (MY_FLOAT) 0.5);
|
||||
delayLine2->setDelay((lastLength * detuning) - (MY_FLOAT) 0.5);
|
||||
loopGain = baseLoopGain + (frequency * (MY_FLOAT) 0.000005);
|
||||
if (loopGain>1.0) loopGain = (MY_FLOAT) 0.99999;
|
||||
}
|
||||
|
||||
void Plucked2 :: setDetune(MY_FLOAT detune)
|
||||
{
|
||||
detuning = detune;
|
||||
delayLine->setDelay((lastLength / detuning) - (MY_FLOAT) 0.5);
|
||||
delayLine2->setDelay((lastLength * detuning) - (MY_FLOAT) 0.5);
|
||||
detuning = detune;
|
||||
delayLine->setDelay((lastLength / detuning) - (MY_FLOAT) 0.5);
|
||||
delayLine2->setDelay((lastLength * detuning) - (MY_FLOAT) 0.5);
|
||||
}
|
||||
|
||||
void Plucked2 :: setFreqAndDetune(MY_FLOAT frequency,MY_FLOAT detune)
|
||||
{
|
||||
lastFreq = frequency;
|
||||
detuning = detune;
|
||||
this->setFreq(frequency);
|
||||
lastFreq = frequency;
|
||||
detuning = detune;
|
||||
this->setFreq(frequency);
|
||||
}
|
||||
|
||||
void Plucked2 :: setPluckPos(MY_FLOAT position)
|
||||
{
|
||||
pluckPos = position;
|
||||
pluckPos = position;
|
||||
}
|
||||
|
||||
void Plucked2 :: setBaseLoopGain(MY_FLOAT aGain)
|
||||
{
|
||||
baseLoopGain = aGain;
|
||||
loopGain = baseLoopGain + (lastFreq * (MY_FLOAT) 0.000005);
|
||||
if (loopGain>1.0) loopGain = (MY_FLOAT) 0.99999;
|
||||
baseLoopGain = aGain;
|
||||
loopGain = baseLoopGain + (lastFreq * (MY_FLOAT) 0.000005);
|
||||
if (loopGain>1.0) loopGain = (MY_FLOAT) 0.99999;
|
||||
}
|
||||
|
||||
void Plucked2 :: noteOff(MY_FLOAT amp)
|
||||
{
|
||||
loopGain = ((MY_FLOAT) 1.0 - amp) * (MY_FLOAT) 0.5;
|
||||
loopGain = ((MY_FLOAT) 1.0 - amp) * (MY_FLOAT) 0.5;
|
||||
#if defined(_debug_)
|
||||
printf("Plucked2 : NoteOff: Amp=%lf\n",amp);
|
||||
printf("Plucked2 : NoteOff: Amp=%lf\n",amp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -205,12 +205,17 @@ RTSoundIO :: RTSoundIO(MY_FLOAT srate, int channels)
|
||||
HWND hWnd;
|
||||
DWORD dwDataLen;
|
||||
WAVEFORMATEX wfFormat;
|
||||
DSBUFFERDESC dsbdDesc;
|
||||
DSBUFFERDESC dsbdDesc, primarydsbDesc;
|
||||
LPDIRECTSOUNDBUFFER m_pDSPrimeBuffer;
|
||||
BYTE *pDSBuffData;
|
||||
|
||||
/* Number of buffers of size RT_BUFFER_SIZE to make secondary DS buffer */
|
||||
int nBufs = 16;
|
||||
|
||||
/* Initialize pointers to NULL */
|
||||
m_pDirectSound = NULL;
|
||||
m_pDSBuffer = NULL;
|
||||
m_pDSPrimeBuffer = NULL;
|
||||
|
||||
/* Create the DS object */
|
||||
if ((result = DirectSoundCreate(NULL, &m_pDirectSound, NULL)) != DS_OK)
|
||||
@@ -225,8 +230,6 @@ RTSoundIO :: RTSoundIO(MY_FLOAT srate, int channels)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Initialize the DS buffer */
|
||||
|
||||
/* Define the wave format structure */
|
||||
wfFormat.wFormatTag = WAVE_FORMAT_PCM;
|
||||
wfFormat.nChannels = channels;
|
||||
@@ -236,15 +239,38 @@ RTSoundIO :: RTSoundIO(MY_FLOAT srate, int channels)
|
||||
wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign;
|
||||
wfFormat.cbSize = 0;
|
||||
|
||||
/* Setup the DS buffer description */
|
||||
m_cbBufSize = RT_BUFFER_SIZE * sizeof(short) * 8;
|
||||
/* Setup the primary DS buffer description */
|
||||
ZeroMemory(&primarydsbDesc, sizeof(DSBUFFERDESC));
|
||||
primarydsbDesc.dwSize = sizeof(DSBUFFERDESC);
|
||||
primarydsbDesc.dwFlags = DSBCAPS_PRIMARYBUFFER;
|
||||
primarydsbDesc.dwBufferBytes = 0;
|
||||
primarydsbDesc.lpwfxFormat = NULL;
|
||||
|
||||
/* Create the primary DS buffer */
|
||||
if ((result = m_pDirectSound->CreateSoundBuffer(&primarydsbDesc,
|
||||
&m_pDSPrimeBuffer, NULL)) != DS_OK)
|
||||
{
|
||||
fprintf(stderr,"Cannot get the primary DS buffer address!\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Set the primary DS buffer sound format. We have to do this because
|
||||
the default primary buffer is 8-bit, 22kHz! */
|
||||
if ((result = m_pDSPrimeBuffer->SetFormat(&wfFormat)) != DS_OK)
|
||||
{
|
||||
fprintf(stderr,"Cannot set the primary DS buffer to proper sound format!\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Setup the secondary DS buffer description */
|
||||
m_cbBufSize = RT_BUFFER_SIZE * sizeof(short) * nBufs;
|
||||
ZeroMemory(&dsbdDesc, sizeof(DSBUFFERDESC));
|
||||
dsbdDesc.dwSize = sizeof(DSBUFFERDESC);
|
||||
dsbdDesc.dwFlags = DSBCAPS_GLOBALFOCUS;
|
||||
dsbdDesc.dwBufferBytes = m_cbBufSize;
|
||||
dsbdDesc.lpwfxFormat = &wfFormat;
|
||||
|
||||
/* Create the DS buffer */
|
||||
/* Create the secondary DS buffer */
|
||||
if ((result = m_pDirectSound->CreateSoundBuffer(&dsbdDesc,
|
||||
&m_pDSBuffer, NULL)) != DS_OK)
|
||||
{
|
||||
|
||||
245
RawInterp.cpp
Normal file
245
RawInterp.cpp
Normal file
@@ -0,0 +1,245 @@
|
||||
/*******************************************/
|
||||
/* Interpolating RawWave Class, */
|
||||
/* by Perry R. Cook, 1995-96 */
|
||||
/* This object can open a raw 16bit data */
|
||||
/* (signed integers) file, and play back */
|
||||
/* the data once or looping, with linear */
|
||||
/* interpolation on playback. */
|
||||
/* */
|
||||
/* Made inherited from RawWave */
|
||||
/* by Gary P. Scavone (11/11/98) */
|
||||
/*******************************************/
|
||||
|
||||
#include "RawInterp.h"
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#include "swapstuf.h"
|
||||
#endif
|
||||
|
||||
RawInterp :: RawInterp(char *fileName)
|
||||
{
|
||||
long i;
|
||||
short temp;
|
||||
FILE *fd;
|
||||
fd = fopen(fileName,"rb");
|
||||
if (!fd) {
|
||||
printf("Couldn't find soundfile %s !!!!!!!!\n",fileName);
|
||||
exit(0);
|
||||
}
|
||||
i = 0;
|
||||
while (fread(&temp,2,1,fd)) i++;
|
||||
|
||||
length = i;
|
||||
fseek(fd,0,0);
|
||||
data = (MY_FLOAT *) malloc(MY_FLOAT_SIZE * (length + 1));
|
||||
myData = 1;
|
||||
i = 0;
|
||||
while (fread(&temp,2,1,fd)) {
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
temp = SwapShort (temp);
|
||||
#endif
|
||||
data[i] = temp;
|
||||
i++;
|
||||
}
|
||||
data[length] = data[length-1];
|
||||
fclose(fd);
|
||||
looping = 0;
|
||||
time = (MY_FLOAT) 0.0;
|
||||
phaseOffset = (MY_FLOAT) 0.0;
|
||||
rate = (MY_FLOAT) 1.0;
|
||||
finished = 0;
|
||||
}
|
||||
|
||||
RawInterp :: RawInterp(MY_FLOAT *someData, long aLength)
|
||||
{
|
||||
|
||||
length = aLength;
|
||||
data = someData;
|
||||
myData = 0;
|
||||
looping = 0;
|
||||
time = (MY_FLOAT) 0.0;
|
||||
phaseOffset = (MY_FLOAT) 0.0;
|
||||
rate = (MY_FLOAT) 1.0;
|
||||
}
|
||||
|
||||
RawInterp :: ~RawInterp()
|
||||
{
|
||||
if (myData) {
|
||||
free(data);
|
||||
data = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void RawInterp :: reset()
|
||||
{
|
||||
time = (MY_FLOAT) 0.0;
|
||||
lastOutput = (MY_FLOAT) 0.0;
|
||||
finished = 0;
|
||||
}
|
||||
|
||||
void RawInterp :: normalize()
|
||||
{
|
||||
this->normalize((MY_FLOAT) 1.0);
|
||||
}
|
||||
|
||||
void RawInterp :: normalize(MY_FLOAT newPeak)
|
||||
{
|
||||
long i;
|
||||
MY_FLOAT max = (MY_FLOAT) 0.0;
|
||||
for (i=0;i<=length;i++)
|
||||
if (fabs(data[i]) > max)
|
||||
max = (MY_FLOAT) fabs(data[i]);
|
||||
if (max > 0.0) {
|
||||
max = (MY_FLOAT) 1.0 / max;
|
||||
max *= newPeak;
|
||||
for (i=0;i<=length;i++)
|
||||
data[i] *= max;
|
||||
}
|
||||
}
|
||||
|
||||
void RawInterp :: setRate(MY_FLOAT aRate)
|
||||
{
|
||||
rate = aRate;
|
||||
}
|
||||
|
||||
void RawInterp :: setFreq(MY_FLOAT aFreq)
|
||||
{
|
||||
rate = length * (MY_FLOAT) ONE_OVER_SRATE * aFreq;
|
||||
}
|
||||
|
||||
void RawInterp :: addTime(MY_FLOAT aTime) /* Add an absolute time */
|
||||
{ /* in samples */
|
||||
time += aTime;
|
||||
}
|
||||
|
||||
void RawInterp :: addPhase(MY_FLOAT anAngle) /* Add a time in cycles */
|
||||
{ /* Cycles here means */
|
||||
time += length * anAngle; /* 1.0 = length */
|
||||
}
|
||||
|
||||
void RawInterp :: addPhaseOffset(MY_FLOAT anAngle)
|
||||
{ /* Add a phase offset */
|
||||
phaseOffset = length * anAngle; /* in cycles, where */
|
||||
} /* 1.0 = length */
|
||||
|
||||
void RawInterp :: setLooping(int aLoopStatus)
|
||||
{
|
||||
time = (MY_FLOAT) 0;
|
||||
looping = aLoopStatus;
|
||||
if (looping) data[length] = data[0];
|
||||
}
|
||||
|
||||
long RawInterp :: getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
MY_FLOAT* RawInterp :: getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
MY_FLOAT RawInterp :: tick()
|
||||
{
|
||||
this->informTick();
|
||||
return lastOutput;
|
||||
}
|
||||
|
||||
int RawInterp :: isFinished()
|
||||
{
|
||||
return finished;
|
||||
}
|
||||
|
||||
int RawInterp :: informTick()
|
||||
{
|
||||
long temp;
|
||||
|
||||
MY_FLOAT temp_time, alpha;
|
||||
|
||||
time += rate; /* Update current time */
|
||||
|
||||
if (looping) {
|
||||
while (time >= length) /* Check for end of sound */
|
||||
time -= length; /* loop back to beginning */
|
||||
while (time < 0.0) /* Check for end of sound */
|
||||
time += length; /* loop back to beginning */
|
||||
}
|
||||
else {
|
||||
if (time >= length) { /* Check for end of sound */
|
||||
time = length-(MY_FLOAT) 1; /* stick at end */
|
||||
finished = 1; /* Information for one-shot use */
|
||||
}
|
||||
else if (time < 0.0) /* Check for end of sound */
|
||||
time = (MY_FLOAT) 0.0; /* stick at beg */
|
||||
}
|
||||
|
||||
temp_time = time;
|
||||
|
||||
if (phaseOffset != 0.0) {
|
||||
temp_time += phaseOffset; /* Add phase offset */
|
||||
if (looping) {
|
||||
while (temp_time >= length) /* Check for end of sound */
|
||||
temp_time -= length; /* loop back to beginning */
|
||||
while (temp_time < 0.0) /* Check for end of sound */
|
||||
temp_time += length; /* loop back to beginning */
|
||||
}
|
||||
else {
|
||||
if (temp_time >= length) /* Check for end of sound */
|
||||
temp_time = length - (MY_FLOAT) 1; /* stick at end */
|
||||
else if (temp_time < 0.0) /* check for end of sound */
|
||||
temp_time = (MY_FLOAT) 0.0; /* stick at beg */
|
||||
}
|
||||
}
|
||||
|
||||
temp = (long) temp_time; /* Integer part of time address */
|
||||
alpha = temp_time - (MY_FLOAT) temp; /* fractional part of time address */
|
||||
lastOutput = data[temp]; /* Do linear interpolation */
|
||||
lastOutput = lastOutput + /* same as alpha*data[temp+1] */
|
||||
(alpha * (data[temp+1] -
|
||||
lastOutput)); /* + (1-alpha)data[temp] */
|
||||
|
||||
return finished;
|
||||
}
|
||||
|
||||
MY_FLOAT RawInterp :: lastOut()
|
||||
{
|
||||
return lastOutput;
|
||||
}
|
||||
|
||||
/************ Test Main Program *****************/
|
||||
/*
|
||||
void main()
|
||||
{
|
||||
RawInterp loopWave("rawwaves/sinewave.raw");
|
||||
RawInterp oneShot("rawwaves/mandpluk.raw");
|
||||
FILE *fd;
|
||||
short data;
|
||||
long i;
|
||||
|
||||
loopWave.setLooping(1);
|
||||
loopWave.setFreq(5500);
|
||||
fd = fopen("test.raw","wb");
|
||||
for (i=0;i<4096;i++) {
|
||||
data = loopWave.tick();
|
||||
fwrite(&data,2,1,fd);
|
||||
}
|
||||
loopWave.setFreq(2750);
|
||||
for (i=0;i<4096;i++) {
|
||||
data = loopWave.tick();
|
||||
fwrite(&data,2,1,fd);
|
||||
}
|
||||
|
||||
oneShot.setLooping(0);
|
||||
for (i=0;i<8192;i++) {
|
||||
data = oneShot.tick();
|
||||
fwrite(&data,2,1,fd);
|
||||
}
|
||||
oneShot.reset();
|
||||
oneShot.setRate(0.5);
|
||||
for (i=0;i<16384;i++) {
|
||||
data = oneShot.tick();
|
||||
fwrite(&data,2,1,fd);
|
||||
}
|
||||
fclose(fd);
|
||||
}
|
||||
*/
|
||||
52
RawInterp.h
Normal file
52
RawInterp.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*******************************************/
|
||||
/* Interpolating RawWave Class, */
|
||||
/* by Perry R. Cook, 1995-96 */
|
||||
/* This object can open a raw 16bit data */
|
||||
/* (signed integers) file, and play back */
|
||||
/* the data once or looping, with linear */
|
||||
/* interpolation on playback. */
|
||||
/* */
|
||||
/* Made inherited from RawWave */
|
||||
/* by Gary P. Scavone (11/11/98) */
|
||||
/*******************************************/
|
||||
|
||||
#if !defined(__RawInterp_h)
|
||||
#define __RawInterp_h
|
||||
|
||||
#include "Object.h"
|
||||
#include "RawWave.h"
|
||||
|
||||
class RawInterp : public RawWave
|
||||
{
|
||||
protected:
|
||||
int looping;
|
||||
int myData;
|
||||
int finished;
|
||||
long length;
|
||||
MY_FLOAT *data;
|
||||
MY_FLOAT rate;
|
||||
MY_FLOAT time;
|
||||
MY_FLOAT phaseOffset;
|
||||
MY_FLOAT lastOutput;
|
||||
public:
|
||||
RawInterp(char *fileName);
|
||||
RawInterp(MY_FLOAT *someData,long aLength);
|
||||
~RawInterp();
|
||||
void reset();
|
||||
void normalize();
|
||||
void normalize(MY_FLOAT newPeak);
|
||||
void setRate(MY_FLOAT aRate);
|
||||
void setFreq(MY_FLOAT aFreq);
|
||||
void addTime(MY_FLOAT aTime);
|
||||
void addPhase(MY_FLOAT anAngle);
|
||||
void addPhaseOffset(MY_FLOAT anAngle);
|
||||
void setLooping(int aLoopStatus);
|
||||
int isFinished();
|
||||
long getLength();
|
||||
MY_FLOAT* getData();
|
||||
MY_FLOAT tick();
|
||||
int informTick();
|
||||
MY_FLOAT lastOut();
|
||||
};
|
||||
|
||||
#endif
|
||||
133
RawLoop.cpp
133
RawLoop.cpp
@@ -1,4 +1,3 @@
|
||||
|
||||
/*******************************************/
|
||||
/* Raw Looped Soundfile Class, */
|
||||
/* by Perry R. Cook, 1995-96 */
|
||||
@@ -14,121 +13,121 @@
|
||||
|
||||
RawLoop :: RawLoop(char *fileName)
|
||||
{
|
||||
long i;
|
||||
short temp;
|
||||
FILE *fd;
|
||||
fd = fopen(fileName,"rb");
|
||||
if (!fd) {
|
||||
printf("Couldn't find soundfile %s !!!!!!!!\n",fileName);
|
||||
exit(0);
|
||||
}
|
||||
i = 0;
|
||||
while (fread(&temp,2,1,fd)) i++;
|
||||
length = i;
|
||||
fseek(fd,0,0);
|
||||
data = (MY_FLOAT *) malloc(MY_FLOAT_SIZE * (length + 1));
|
||||
i = 0;
|
||||
while (fread(&temp,2,1,fd)) {
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
temp = SwapShort (temp);
|
||||
#endif
|
||||
data[i] = temp;
|
||||
i++;
|
||||
}
|
||||
data[length] = data[0];
|
||||
fclose(fd);
|
||||
time = (MY_FLOAT) 0.0;
|
||||
phaseOffset = (MY_FLOAT) 0.0;
|
||||
rate = (MY_FLOAT) 1.0;
|
||||
long i;
|
||||
short temp;
|
||||
FILE *fd;
|
||||
fd = fopen(fileName,"rb");
|
||||
if (!fd) {
|
||||
printf("Couldn't find soundfile %s !!!!!!!!\n",fileName);
|
||||
exit(0);
|
||||
}
|
||||
i = 0;
|
||||
while (fread(&temp,2,1,fd)) i++;
|
||||
length = i;
|
||||
fseek(fd,0,0);
|
||||
data = (MY_FLOAT *) malloc(MY_FLOAT_SIZE * (length + 1));
|
||||
i = 0;
|
||||
while (fread(&temp,2,1,fd)) {
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
temp = SwapShort (temp);
|
||||
#endif
|
||||
data[i] = temp;
|
||||
i++;
|
||||
}
|
||||
data[length] = data[0];
|
||||
fclose(fd);
|
||||
time = (MY_FLOAT) 0.0;
|
||||
phaseOffset = (MY_FLOAT) 0.0;
|
||||
rate = (MY_FLOAT) 1.0;
|
||||
}
|
||||
|
||||
RawLoop :: ~RawLoop()
|
||||
{
|
||||
free(data);
|
||||
free(data);
|
||||
}
|
||||
|
||||
void RawLoop :: reset()
|
||||
{
|
||||
time = (MY_FLOAT) 0.0;
|
||||
lastOutput = (MY_FLOAT) 0.0;
|
||||
time = (MY_FLOAT) 0.0;
|
||||
lastOutput = (MY_FLOAT) 0.0;
|
||||
}
|
||||
|
||||
void RawLoop :: normalize()
|
||||
{
|
||||
this->normalize((MY_FLOAT) 1.0);
|
||||
this->normalize((MY_FLOAT) 1.0);
|
||||
}
|
||||
|
||||
void RawLoop :: normalize(MY_FLOAT newPeak)
|
||||
{
|
||||
long i;
|
||||
MY_FLOAT max = (MY_FLOAT) 0.0;
|
||||
for (i=0;i<=length;i++)
|
||||
if (fabs(data[i]) > max)
|
||||
long i;
|
||||
MY_FLOAT max = (MY_FLOAT) 0.0;
|
||||
for (i=0;i<=length;i++)
|
||||
if (fabs(data[i]) > max)
|
||||
max = (MY_FLOAT) fabs((double) data[i]);
|
||||
if (max > 0.0) {
|
||||
max = (MY_FLOAT) 1.0 / max;
|
||||
max *= newPeak;
|
||||
for (i=0;i<=length;i++)
|
||||
if (max > 0.0) {
|
||||
max = (MY_FLOAT) 1.0 / max;
|
||||
max *= newPeak;
|
||||
for (i=0;i<=length;i++)
|
||||
data[i] *= max;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RawLoop :: setRate(MY_FLOAT aRate)
|
||||
{
|
||||
rate = aRate;
|
||||
rate = aRate;
|
||||
}
|
||||
|
||||
void RawLoop :: setFreq(MY_FLOAT aFreq)
|
||||
{
|
||||
rate = length * ONE_OVER_SRATE * aFreq;
|
||||
rate = length * ONE_OVER_SRATE * aFreq;
|
||||
}
|
||||
|
||||
void RawLoop :: addTime(MY_FLOAT aTime) /* Add an absolute time */
|
||||
{ /* in samples */
|
||||
time += aTime;
|
||||
time += aTime;
|
||||
}
|
||||
|
||||
void RawLoop :: addPhase(MY_FLOAT anAngle) /* Add a time in cycles */
|
||||
{ /* Cycles here means */
|
||||
time += length * anAngle; /* 1.0 = length */
|
||||
time += length * anAngle; /* 1.0 = length */
|
||||
}
|
||||
|
||||
void RawLoop :: addPhaseOffset(MY_FLOAT anAngle)
|
||||
{ /* Add a phase offset */
|
||||
phaseOffset = length * anAngle; /* in cycles, where */
|
||||
} /* 1.0 = length */
|
||||
{ /* Add a phase offset */
|
||||
phaseOffset = length * anAngle; /* in cycles, where */
|
||||
} /* 1.0 = length */
|
||||
|
||||
MY_FLOAT RawLoop :: tick()
|
||||
{
|
||||
long temp;
|
||||
long temp;
|
||||
|
||||
MY_FLOAT temp_time, alpha;
|
||||
MY_FLOAT temp_time, alpha;
|
||||
|
||||
time += rate; /* Update current time */
|
||||
time += rate; /* Update current time */
|
||||
|
||||
while (time >= length) /* Check for end of sound */
|
||||
time -= length; /* loop back to beginning */
|
||||
while (time < 0.0) /* Check for end of sound */
|
||||
time += length; /* loop back to beginning */
|
||||
while (time >= length) /* Check for end of sound */
|
||||
time -= length; /* loop back to beginning */
|
||||
while (time < 0.0) /* Check for end of sound */
|
||||
time += length; /* loop back to beginning */
|
||||
|
||||
temp_time = time;
|
||||
temp_time = time;
|
||||
|
||||
if (phaseOffset != 0.0) {
|
||||
temp_time += phaseOffset; /* Add phase offset */
|
||||
while (temp_time >= length) /* Check for end of sound */
|
||||
if (phaseOffset != 0.0) {
|
||||
temp_time += phaseOffset; /* Add phase offset */
|
||||
while (temp_time >= length) /* Check for end of sound */
|
||||
temp_time -= length; /* loop back to beginning */
|
||||
while (temp_time < 0.0) /* Check for end of sound */
|
||||
while (temp_time < 0.0) /* Check for end of sound */
|
||||
temp_time += length; /* loop back to beginning */
|
||||
}
|
||||
}
|
||||
|
||||
temp = (long) temp_time; /* Integer part of time address */
|
||||
alpha = temp_time - (MY_FLOAT) temp; /* fractional part of time address */
|
||||
lastOutput = data[temp]; /* Do linear interpolation */
|
||||
lastOutput = lastOutput + /* same as alpha*data[temp+1] */
|
||||
(alpha * (data[temp+1]
|
||||
- lastOutput)); /* + (1-alpha)data[temp] */
|
||||
temp = (long) temp_time; /* Integer part of time address */
|
||||
alpha = temp_time - (MY_FLOAT) temp; /* fractional part of time address */
|
||||
lastOutput = data[temp]; /* Do linear interpolation */
|
||||
lastOutput = lastOutput + /* same as alpha*data[temp+1] */
|
||||
(alpha * (data[temp+1]
|
||||
- lastOutput)); /* + (1-alpha)data[temp] */
|
||||
|
||||
return lastOutput;
|
||||
return lastOutput;
|
||||
}
|
||||
|
||||
MY_FLOAT RawLoop :: lastOut()
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
#define __RawLoop_h
|
||||
|
||||
#include "Object.h"
|
||||
#include "RawWave.h"
|
||||
|
||||
class RawLoop : public Object
|
||||
class RawLoop : public RawWave
|
||||
{
|
||||
protected:
|
||||
long length;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*******************************************/
|
||||
/* NonInterpolating One-Shot Raw Sound- */
|
||||
/* Non-Interpolating One-Shot Raw Sound- */
|
||||
/* file Class, by Perry R. Cook, 1995-96 */
|
||||
/* This Object can open a raw 16bit data */
|
||||
/* (signed integers) file, and play back */
|
||||
@@ -13,15 +13,17 @@
|
||||
/* applications). */
|
||||
/*******************************************/
|
||||
|
||||
#include "RawWvIn.h"
|
||||
#include "swapstuf.h"
|
||||
#include "RawShot.h"
|
||||
|
||||
RawWvIn :: RawWvIn(char *fileName)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#include "swapstuf.h"
|
||||
#endif
|
||||
|
||||
RawShot :: RawShot(char *fileName)
|
||||
{
|
||||
long i;
|
||||
|
||||
|
||||
strcpy(fileNm,fileName);
|
||||
|
||||
myFile = fopen(fileNm,"rb");
|
||||
if (!myFile) {
|
||||
printf("Couldn't find soundfile %s !!!!!!!!\n",fileName);
|
||||
@@ -32,6 +34,7 @@ RawWvIn :: RawWvIn(char *fileName)
|
||||
while (fread(&data,2,1,myFile)) i++;
|
||||
length = i;
|
||||
fseek(myFile,0,0);
|
||||
|
||||
time = (MY_FLOAT) 0.0;
|
||||
rate = (MY_FLOAT) 1.0;
|
||||
lastTime = 0;
|
||||
@@ -40,12 +43,12 @@ RawWvIn :: RawWvIn(char *fileName)
|
||||
lastOutput = (MY_FLOAT) 0.0;
|
||||
}
|
||||
|
||||
RawWvIn :: ~RawWvIn()
|
||||
RawShot :: ~RawShot()
|
||||
{
|
||||
this->finish();
|
||||
}
|
||||
|
||||
void RawWvIn :: reset()
|
||||
void RawShot :: reset()
|
||||
{
|
||||
if (finished) {
|
||||
myFile = fopen(fileNm,"rb");
|
||||
@@ -62,19 +65,17 @@ void RawWvIn :: reset()
|
||||
lastOutput = (MY_FLOAT) 0.0;
|
||||
}
|
||||
|
||||
void RawWvIn :: normalize()
|
||||
void RawShot :: normalize()
|
||||
{
|
||||
this->normalize((MY_FLOAT) 1.0);
|
||||
}
|
||||
|
||||
void RawWvIn :: normalize(MY_FLOAT newPeak)
|
||||
void RawShot :: normalize(MY_FLOAT newPeak)
|
||||
{
|
||||
long i;
|
||||
FILE *fd;
|
||||
extern short SwapShort(short);
|
||||
|
||||
gain = (MY_FLOAT) 0.0;
|
||||
|
||||
fd = fopen(fileNm,"rb");
|
||||
for (i=0;i<length;i++) {
|
||||
fread(&data,2,1,fd);
|
||||
@@ -84,18 +85,18 @@ void RawWvIn :: normalize(MY_FLOAT newPeak)
|
||||
if (fabs(data) > gain)
|
||||
gain = (MY_FLOAT) fabs((double) data);
|
||||
}
|
||||
if (gain > 0.0) {
|
||||
if (gain > 0.0) {
|
||||
gain = newPeak / gain;
|
||||
}
|
||||
fclose(fd);
|
||||
}
|
||||
|
||||
void RawWvIn :: setRate(MY_FLOAT aRate)
|
||||
void RawShot :: setRate(MY_FLOAT aRate)
|
||||
{
|
||||
rate = aRate;
|
||||
}
|
||||
|
||||
void RawWvIn :: finish()
|
||||
void RawShot :: finish()
|
||||
{
|
||||
finished = 1;
|
||||
lastOutput = (MY_FLOAT) 0.0;
|
||||
@@ -105,47 +106,47 @@ void RawWvIn :: finish()
|
||||
}
|
||||
}
|
||||
|
||||
MY_FLOAT RawWvIn :: tick()
|
||||
int RawShot :: isFinished()
|
||||
{
|
||||
return finished;
|
||||
}
|
||||
|
||||
MY_FLOAT RawShot :: tick()
|
||||
{
|
||||
this->informTick();
|
||||
return lastOutput;
|
||||
}
|
||||
|
||||
int RawWvIn :: informTick()
|
||||
int RawShot :: informTick()
|
||||
{
|
||||
long temp;
|
||||
extern short SwapShort(short);
|
||||
|
||||
if (!finished)
|
||||
{
|
||||
time += rate; /* Update current time */
|
||||
|
||||
if (time >= length) /* Check for end of sound */
|
||||
{
|
||||
time = (MY_FLOAT) length - 1; /* stick at end */
|
||||
finished = 1; /* Information for one-shot use */
|
||||
fclose(myFile);
|
||||
myFile = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
temp = (long) time; /* Integer part of time address */
|
||||
if (temp > lastTime) /* If we cross next sample time */
|
||||
{
|
||||
lastTime = temp;
|
||||
fread(&data,2,1,myFile); /* Snarf next sample from file */
|
||||
if (!finished) {
|
||||
time += rate; /* Update current time */
|
||||
|
||||
if (time >= length) { /* Check for end of sound */
|
||||
time = (MY_FLOAT) length - 1; /* stick at end */
|
||||
finished = 1; /* Information for one-shot use */
|
||||
fclose(myFile);
|
||||
myFile = 0;
|
||||
}
|
||||
else {
|
||||
temp = (long) time; /* Integer part of time address */
|
||||
if (temp > lastTime) { /* If we cross next sample time */
|
||||
lastTime = temp;
|
||||
fread(&data,2,1,myFile); /* Snarf next sample from file */
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
data = SwapShort(data);
|
||||
data = SwapShort(data);
|
||||
#endif
|
||||
lastOutput = data * gain; /* And save as non-interpolated data */
|
||||
}
|
||||
}
|
||||
}
|
||||
lastOutput = data * gain; /* And save as non-interpolated data */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return finished;
|
||||
}
|
||||
|
||||
MY_FLOAT RawWvIn :: lastOut()
|
||||
MY_FLOAT RawShot :: lastOut()
|
||||
{
|
||||
return lastOutput;
|
||||
}
|
||||
@@ -154,7 +155,7 @@ MY_FLOAT RawWvIn :: lastOut()
|
||||
/*
|
||||
void main()
|
||||
{
|
||||
RawWvIn oneShot("rawwaves/mandpluk.raw");
|
||||
RawShot oneShot("rawwaves/mandpluk.raw");
|
||||
FILE *fd;
|
||||
short data;
|
||||
long i;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*******************************************/
|
||||
/* NonInterpolating One-Shot Raw Sound- */
|
||||
/* Non-Interpolating One-Shot Raw Sound- */
|
||||
/* file Class, by Perry R. Cook, 1995-96 */
|
||||
/* This Object can open a raw 16bit data */
|
||||
/* (signed integers) file, and play back */
|
||||
@@ -13,12 +13,13 @@
|
||||
/* applications). */
|
||||
/*******************************************/
|
||||
|
||||
#if !defined(__RawWvIn_h)
|
||||
#define __RawWvIn_h
|
||||
#if !defined(__RawShot_h)
|
||||
#define __RawShot_h
|
||||
|
||||
#include "Object.h"
|
||||
#include "RawWave.h"
|
||||
|
||||
class RawWvIn : public Object
|
||||
class RawShot : public RawWave
|
||||
{
|
||||
protected:
|
||||
long length;
|
||||
@@ -32,13 +33,14 @@ class RawWvIn : public Object
|
||||
MY_FLOAT gain;
|
||||
MY_FLOAT lastOutput;
|
||||
public:
|
||||
RawWvIn(char *fileName);
|
||||
~RawWvIn();
|
||||
RawShot(char *fileName);
|
||||
~RawShot();
|
||||
void reset();
|
||||
void normalize();
|
||||
void normalize(MY_FLOAT newPeak);
|
||||
void setRate(MY_FLOAT aRate);
|
||||
void finish();
|
||||
int isFinished();
|
||||
MY_FLOAT tick();
|
||||
int informTick();
|
||||
MY_FLOAT lastOut();
|
||||
221
RawWave.cpp
221
RawWave.cpp
@@ -1,241 +1,42 @@
|
||||
/*******************************************/
|
||||
/* Raw Soundfile Class, */
|
||||
/* by Perry R. Cook, 1995-96 */
|
||||
/* This Object can open a raw 16bit data */
|
||||
/* (signed integers) file, and play back */
|
||||
/* the data once or looping, with linear */
|
||||
/* interpolation on playback. */
|
||||
/*******************************************/
|
||||
/********************************************/
|
||||
/* RawWave Abstract Class, */
|
||||
/* by Gary P. Scavone, 1998 */
|
||||
/********************************************/
|
||||
|
||||
#include "RawWave.h"
|
||||
|
||||
#include "swapstuf.h"
|
||||
|
||||
RawWave :: RawWave(char *fileName)
|
||||
RawWave :: RawWave()
|
||||
{
|
||||
long i;
|
||||
short temp;
|
||||
FILE *fd;
|
||||
fd = fopen(fileName,"rb");
|
||||
if (!fd) {
|
||||
printf("Couldn't find soundfile %s !!!!!!!!\n",fileName);
|
||||
exit(0);
|
||||
}
|
||||
i = 0;
|
||||
while (fread(&temp,2,1,fd)) i++;
|
||||
|
||||
length = i;
|
||||
fseek(fd,0,0);
|
||||
data = (MY_FLOAT *) malloc(MY_FLOAT_SIZE * (length + 1));
|
||||
myData = 1;
|
||||
i = 0;
|
||||
while (fread(&temp,2,1,fd)) {
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
temp = SwapShort (temp);
|
||||
#endif
|
||||
data[i] = temp;
|
||||
i++;
|
||||
}
|
||||
data[length] = data[length-1];
|
||||
fclose(fd);
|
||||
looping = 0;
|
||||
time = (MY_FLOAT) length;
|
||||
phaseOffset = (MY_FLOAT) 0.0;
|
||||
rate = (MY_FLOAT) 1.0;
|
||||
allDone = 0;
|
||||
}
|
||||
|
||||
RawWave :: RawWave(MY_FLOAT *someData, long aLength)
|
||||
{
|
||||
|
||||
length = aLength;
|
||||
data = someData;
|
||||
myData = 0;
|
||||
looping = 0;
|
||||
time = (MY_FLOAT) 0.0;
|
||||
phaseOffset = (MY_FLOAT) 0.0;
|
||||
rate = (MY_FLOAT) 1.0;
|
||||
}
|
||||
|
||||
RawWave :: ~RawWave()
|
||||
{
|
||||
if (myData) {
|
||||
free(data);
|
||||
data = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void RawWave :: reset()
|
||||
{
|
||||
time = (MY_FLOAT) 0.0;
|
||||
lastOutput = (MY_FLOAT) 0.0;
|
||||
allDone = 0;
|
||||
}
|
||||
|
||||
void RawWave :: normalize()
|
||||
{
|
||||
this->normalize((MY_FLOAT) 1.0);
|
||||
}
|
||||
|
||||
void RawWave :: normalize(MY_FLOAT newPeak)
|
||||
{
|
||||
long i;
|
||||
MY_FLOAT max = (MY_FLOAT) 0.0;
|
||||
for (i=0;i<=length;i++)
|
||||
if (fabs(data[i]) > max)
|
||||
max = (MY_FLOAT) fabs(data[i]);
|
||||
if (max > 0.0) {
|
||||
max = (MY_FLOAT) 1.0 / max;
|
||||
max *= newPeak;
|
||||
for (i=0;i<=length;i++)
|
||||
data[i] *= max;
|
||||
}
|
||||
}
|
||||
|
||||
void RawWave :: setRate(MY_FLOAT aRate)
|
||||
{
|
||||
rate = aRate;
|
||||
}
|
||||
|
||||
void RawWave :: setFreq(MY_FLOAT aFreq)
|
||||
{
|
||||
rate = length * (MY_FLOAT) ONE_OVER_SRATE * aFreq;
|
||||
}
|
||||
|
||||
void RawWave :: addTime(MY_FLOAT aTime) /* Add an absolute time */
|
||||
{ /* in samples */
|
||||
time += aTime;
|
||||
}
|
||||
|
||||
void RawWave :: addPhase(MY_FLOAT anAngle) /* Add a time in cycles */
|
||||
{ /* Cycles here means */
|
||||
time += length * anAngle; /* 1.0 = length */
|
||||
}
|
||||
|
||||
void RawWave :: addPhaseOffset(MY_FLOAT anAngle)
|
||||
{ /* Add a phase offset */
|
||||
phaseOffset = length * anAngle; /* in cycles, where */
|
||||
} /* 1.0 = length */
|
||||
|
||||
void RawWave :: setLooping(int aLoopStatus)
|
||||
{
|
||||
time = (MY_FLOAT) 0;
|
||||
looping = aLoopStatus;
|
||||
if (looping) data[length] = data[0];
|
||||
}
|
||||
|
||||
long RawWave :: getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
MY_FLOAT* RawWave :: getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
MY_FLOAT RawWave :: tick()
|
||||
{
|
||||
this->informTick();
|
||||
return lastOutput;
|
||||
}
|
||||
|
||||
int RawWave :: isAllDone()
|
||||
{
|
||||
return allDone;
|
||||
}
|
||||
|
||||
int RawWave :: informTick()
|
||||
{
|
||||
long temp;
|
||||
|
||||
MY_FLOAT temp_time, alpha;
|
||||
|
||||
time += rate; /* Update current time */
|
||||
|
||||
if (looping) {
|
||||
while (time >= length) /* Check for end of sound */
|
||||
time -= length; /* loop back to beginning */
|
||||
while (time < 0.0) /* Check for end of sound */
|
||||
time += length; /* loop back to beginning */
|
||||
}
|
||||
else {
|
||||
if (time >= length) { /* Check for end of sound */
|
||||
time = length-(MY_FLOAT) 1; /* stick at end */
|
||||
allDone = 1; /* Information for one-shot use */
|
||||
}
|
||||
else if (time < 0.0) /* Check for end of sound */
|
||||
time = (MY_FLOAT) 0.0; /* stick at beg */
|
||||
}
|
||||
|
||||
temp_time = time;
|
||||
|
||||
if (phaseOffset != 0.0) {
|
||||
temp_time += phaseOffset; /* Add phase offset */
|
||||
if (looping) {
|
||||
while (temp_time >= length) /* Check for end of sound */
|
||||
temp_time -= length; /* loop back to beginning */
|
||||
while (temp_time < 0.0) /* Check for end of sound */
|
||||
temp_time += length; /* loop back to beginning */
|
||||
}
|
||||
else {
|
||||
if (temp_time >= length) /* Check for end of sound */
|
||||
temp_time = length - (MY_FLOAT) 1; /* stick at end */
|
||||
else if (temp_time < 0.0) /* check for end of sound */
|
||||
temp_time = (MY_FLOAT) 0.0; /* stick at beg */
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
temp = (long) temp_time; /* Integer part of time address */
|
||||
alpha = temp_time - (MY_FLOAT) temp; /* fractional part of time address */
|
||||
lastOutput = data[temp]; /* Do linear interpolation */
|
||||
lastOutput = lastOutput + /* same as alpha*data[temp+1] */
|
||||
(alpha * (data[temp+1] -
|
||||
lastOutput)); /* + (1-alpha)data[temp] */
|
||||
|
||||
return allDone;
|
||||
MY_FLOAT RawWave :: tick()
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
MY_FLOAT RawWave :: lastOut()
|
||||
{
|
||||
return lastOutput;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/************ Test Main Program *****************/
|
||||
/*
|
||||
|
||||
void main()
|
||||
{
|
||||
RawWave loopWave("rawwaves/sinewave.raw");
|
||||
RawWave oneShot("rawwaves/mandpluk.raw");
|
||||
FILE *fd;
|
||||
short data;
|
||||
long i;
|
||||
|
||||
loopWave.setLooping(1);
|
||||
loopWave.setFreq(5500);
|
||||
fd = fopen("test.raw","wb");
|
||||
for (i=0;i<4096;i++) {
|
||||
data = loopWave.tick();
|
||||
fwrite(&data,2,1,fd);
|
||||
}
|
||||
loopWave.setFreq(2750);
|
||||
for (i=0;i<4096;i++) {
|
||||
data = loopWave.tick();
|
||||
fwrite(&data,2,1,fd);
|
||||
}
|
||||
|
||||
oneShot.setLooping(0);
|
||||
for (i=0;i<8192;i++) {
|
||||
data = oneShot.tick();
|
||||
fwrite(&data,2,1,fd);
|
||||
}
|
||||
oneShot.reset();
|
||||
oneShot.setRate(0.5);
|
||||
for (i=0;i<16384;i++) {
|
||||
data = oneShot.tick();
|
||||
fwrite(&data,2,1,fd);
|
||||
}
|
||||
fclose(fd);
|
||||
}
|
||||
*/
|
||||
|
||||
55
RawWave.h
55
RawWave.h
@@ -1,48 +1,25 @@
|
||||
/*******************************************/
|
||||
/* Raw Soundfile Class, */
|
||||
/* by Perry R. Cook, 1995-96 */
|
||||
/* This Object can open a raw 16bit data */
|
||||
/* (signed integers) file, and play back */
|
||||
/* the data once or looping, with linear */
|
||||
/* interpolation on playback. */
|
||||
/*******************************************/
|
||||
/********************************************/
|
||||
/* RawWave Abstract Class, */
|
||||
/* by Gary P. Scavone, 1998 */
|
||||
/********************************************/
|
||||
|
||||
#include "Object.h"
|
||||
|
||||
#if !defined(__RawWave_h)
|
||||
#define __RawWave_h
|
||||
|
||||
#include "Object.h"
|
||||
|
||||
class RawWave : public Object
|
||||
{
|
||||
protected:
|
||||
int looping;
|
||||
int myData;
|
||||
int allDone;
|
||||
long length;
|
||||
MY_FLOAT *data;
|
||||
MY_FLOAT rate;
|
||||
MY_FLOAT time;
|
||||
MY_FLOAT phaseOffset;
|
||||
MY_FLOAT lastOutput;
|
||||
public:
|
||||
RawWave(char *fileName);
|
||||
RawWave(MY_FLOAT *someData,long aLength);
|
||||
~RawWave();
|
||||
void reset();
|
||||
void normalize();
|
||||
void normalize(MY_FLOAT newPeak);
|
||||
void setRate(MY_FLOAT aRate);
|
||||
void setFreq(MY_FLOAT aFreq);
|
||||
void addTime(MY_FLOAT aTime);
|
||||
void addPhase(MY_FLOAT anAngle);
|
||||
void addPhaseOffset(MY_FLOAT anAngle);
|
||||
void setLooping(int aLoopStatus);
|
||||
int isAllDone();
|
||||
long getLength();
|
||||
MY_FLOAT* getData();
|
||||
MY_FLOAT tick();
|
||||
int informTick();
|
||||
MY_FLOAT lastOut();
|
||||
RawWave();
|
||||
virtual ~RawWave();
|
||||
virtual void reset();
|
||||
virtual void normalize(MY_FLOAT newPeak);
|
||||
virtual void setRate(MY_FLOAT aRate);
|
||||
virtual int informTick();
|
||||
virtual MY_FLOAT tick();
|
||||
virtual MY_FLOAT lastOut();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // defined(__RawWave_h)
|
||||
|
||||
39
ReleaseNotes.txt
Normal file
39
ReleaseNotes.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
STK: A ToolKit of Audio Synthesis Classes and Instruments in C++
|
||||
|
||||
By Perry R. Cook, 1995-98
|
||||
and Gary P. Scavone, 1997-98
|
||||
|
||||
I'll call this latest release STK98v2.02. There was a v2.01 release shortly after the initial v2.0 release in July 1998, to correct a few SGI/Win return character incompatibilities. Since I am just creating this set of release notes with v2.02, I'll just gloss over the past changes. Hopefully, I'll be able to keep this document updated with future releases.
|
||||
|
||||
--Gary Scavone
|
||||
|
||||
|
||||
v2.02:
|
||||
- 16 November 1998
|
||||
- created RawWave abstract class, with subclasses of RawLoop (looping rawwave oscillator), RawShot (non-looping, non-interpolating rawwave player ... used to be RawWvIn), and RawInterp (looping or non-looping, interpolating rawwave player ... used to be RawWave).
|
||||
- modified DrumSynt to correctly handle sample rates different than 22050 Hz.
|
||||
- modified syntmono parsing vs. tick routine so that some ticking occurs between each message. When multiple messages are waiting to be processed, the time between message updates is inversely proportional to the number of messages in the buffer.
|
||||
- fixed DirectSound playback bug in Win distribution. Sound was being played at 8-bit, 22 kHz in all cases. Playback is now 16-bit and dependent on SRATE.
|
||||
- fixed bug in MD2SKINI which prevented some NoteOff statements from being output.
|
||||
|
||||
|
||||
v2.01:
|
||||
- 27 July 1998
|
||||
- Corrected extraneous ^M line return characters that were incompatible with SGI.
|
||||
|
||||
|
||||
v2.0:
|
||||
- 20 July 1998
|
||||
- The first true release by Gary, with unified capabilities across SGI, Linux, and Win platforms. See WWW pages (http://www-ccrma.stanford.edu/CCRMA/Software/STK/) for more info.
|
||||
|
||||
|
||||
v1.1:
|
||||
- More linux support and other changes that happened so long ago that I can't remember anymore. Never officially released.
|
||||
|
||||
|
||||
v1.0:
|
||||
- Linux support added with the help of Tim Stilson. Never officially released.
|
||||
|
||||
|
||||
v0.8:
|
||||
- One of (if not THE) original distributions for SGI, NeXTStep, and basic Win support. I think this came out in 1996.
|
||||
BIN
STK98v2.ncb
BIN
STK98v2.ncb
Binary file not shown.
BIN
STK98v2.opt
BIN
STK98v2.opt
Binary file not shown.
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "Instrmnt.h"
|
||||
#include "ADSR.h"
|
||||
#include "RawWave.h"
|
||||
#include "RawInterp.h"
|
||||
#include "RawLoop.h"
|
||||
#include "OnePole.h"
|
||||
|
||||
@@ -19,7 +19,7 @@ class Sampler : public Instrmnt
|
||||
{
|
||||
protected:
|
||||
ADSR *adsr;
|
||||
RawWave *attacks[5];
|
||||
RawInterp *attacks[5];
|
||||
RawLoop *loops[5];
|
||||
OnePole *filter;
|
||||
MY_FLOAT baseFreq;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
Vibraphn :: Vibraphn() : Modal4()
|
||||
{
|
||||
wave = new RawWave("rawwaves/marmstk1.raw");
|
||||
wave = new RawInterp("rawwaves/marmstk1.raw");
|
||||
wave->normalize();
|
||||
wave->setRate((MY_FLOAT) 13.33);
|
||||
vibr->setFreq((MY_FLOAT) 4.0);
|
||||
|
||||
32
hierarch.txt
32
hierarch.txt
@@ -13,17 +13,17 @@ SourcSink Filters Reverb Non-Lin ModalSyn FM Physical Sampling Ph
|
||||
Object-----------------------------------Instrmnt----------.
|
||||
| | | | | | |
|
||||
Envelope| Filter Reverb BowTabl | .------------------|---------------------.
|
||||
| | | | JetTabl | | | | | | | | |
|
||||
ADSR | OneZero PRCRev ReedTabl| Modal4 | FM4Op---.| | | | Shakers
|
||||
| OnePole JCRev | | | | || | | | |
|
||||
._____| TwoZero NRev .____| Marimba | FM4Alg3 || Plucked Sampler | Maraca
|
||||
| | TwoPole | Vibraphn| | || Clarinet | | Sekere
|
||||
Noise | DCBlock LipFilt AgogoBel| HeavyMtl|| Brass SamplFlt| Cabasa
|
||||
| | BiQuad | || Flute | | Bamboo
|
||||
SubNoise| DlineL .____| .____|| Bowed Moog1 | Water Drops
|
||||
| DLineA | | || | Tambourine
|
||||
._____| DLineN VoicForm FM4Alg4 ||____. | SleighBells
|
||||
| | FormSwep | | | | Guiro
|
||||
| | | | JetTabl | | | | | | | | |
|
||||
ADSR | OneZero PRCRev ReedTabl| Modal4 | FM4Op---.| | | | Shakers
|
||||
| OnePole JCRev | | | | || | | | |
|
||||
._____| TwoZero NRev .____| Marimba | FM4Alg3 || Plucked Sampler | Maraca
|
||||
| | TwoPole | Vibraphn| | || Clarinet | | Sekere
|
||||
Noise | DCBlock LipFilt AgogoBel| HeavyMtl|| Brass SamplFlt| Cabasa
|
||||
| | BiQuad | || Flute | | Bamboo
|
||||
SubNoise| DlineL .____| .____|| Bowed Moog1 | Water Drops
|
||||
| DLineA | | || | Tambourine
|
||||
._____| DLineN VoicForm FM4Alg4 ||____. | SleighBells
|
||||
| | FormSwep | | | | Guiro
|
||||
RawWave | PercFlut| Plucked2 |
|
||||
| | | |
|
||||
._____| .____| Mandolin .____|
|
||||
@@ -63,7 +63,7 @@ Bowed.cpp Not Hideous Bowed String DlineL,BowTabl,OnePole,BiQuad,RawWave,
|
||||
Brass.cpp Not So Bad Brass Inst. DLineA,LipFilt,DCBlock,ADSR,RawLoop
|
||||
Clarinet.cpp Pretty Good Clarinet DLineL,ReedTabl,OneZero,Envelope,Noise,RawLoop
|
||||
Flute.cpp Pretty Good Flute JetTabl,DLineL,OnePole,DCBlock,Noise,ADSR,RawLoop
|
||||
Modal4.cpp 4 Resonances Envelope,RawWave,RawLoop,BiQuad,OnePole
|
||||
Modal4.cpp 4 Resonances Envelope,RawWave,RawLoop,BiQuad,OnePole
|
||||
Marimba.cpp <<flavor of MODAL4>>
|
||||
Vibraphn.cpp <<flavor of MODAL4>>
|
||||
Agogobel.cpp <<flavor of MODAL4>>
|
||||
@@ -78,12 +78,12 @@ PercFlut.cpp Perc. Flute <<flavor of FM4Alg4>>
|
||||
Rhodey.cpp Rhodes-Like Elec. Piano <<flavor of FM4Alg5>>
|
||||
Wurley.cpp Wurlitz. Elec. Piano <<flavor of FM4Alg5>>
|
||||
TubeBell.cpp Classic FM Bell <<flavor of FM4Alg5>>
|
||||
FMVoices.cpp 3-Formant Voice Synth. <<flavor of FM4Alg6>>
|
||||
BeeThree.cpp Cheezy Organ for Paul <<flavor of FM4Alg8>>
|
||||
FMVoices.cpp 3-Formant Voice Synth. <<flavor of FM4Alg6>>
|
||||
BeeThree.cpp Cheezy Organ for Paul <<flavor of FM4Alg8>>
|
||||
Sampler.cpp Sampling Synth. 4 each ADSR, RawWave (att), RawLoop (loop), OnePole
|
||||
SamplFlt.cpp Sampler with Swept Filter <<flavor of Sampler>>
|
||||
Moog1.cpp Swept filter flavor of <<flavor of SamplFlt>>
|
||||
VoicForm.cpp Source/Filter Voice Envelope,Noise,SingWave,FormSwep,OnePole,OneZero
|
||||
VoicForm.cpp Source/Filter Voice Envelope,Noise,SingWave,FormSwep,OnePole,OneZero
|
||||
DrumSynt.cpp Drum Synthesizer bunch of RawWvIn, and OnePole
|
||||
Shakers.cpp Stochastic Event Models
|
||||
|
||||
@@ -122,7 +122,7 @@ Filters: Filter.cpp Filter Master Class
|
||||
Reverb: Reverb.cpp Reverb Master Class
|
||||
PRCRev.cpp 2 series allpass units, 2 parallel comb filters
|
||||
JCRev.cpp 3 series allpass units, 4 parallel comb filters
|
||||
NReb.cpp 6 parallel comb filters, 3 series allpass units, ...
|
||||
NRev.cpp 6 parallel comb filters, 3 series allpass units, ...
|
||||
|
||||
NonLin&Lookup: JetTabl.cpp Cubic Jet NonLinearity
|
||||
BowTabl.cpp 1/x^3-like Bow NonLinearity
|
||||
|
||||
0
mus151/Debug/.placeholder
Normal file
0
mus151/Debug/.placeholder
Normal file
1
mus151/GUITwoOsc
Executable file
1
mus151/GUITwoOsc
Executable file
@@ -0,0 +1 @@
|
||||
wish < tcl/TwoWaves.tcl | MUS151 TwoOsc -r
|
||||
312
mus151/MUS151.cpp
Normal file
312
mus151/MUS151.cpp
Normal file
@@ -0,0 +1,312 @@
|
||||
/******** Psychoacoustic Interface Program for MUS151 ************/
|
||||
/******** Center for Computer Research in Music & Acoustics ******/
|
||||
/******** Stanford University, by Gary P. Scavone, 1998 **********/
|
||||
|
||||
#include "../miditabl.h"
|
||||
#include "../WvOut.h"
|
||||
#include "../RTWvOut.h"
|
||||
#include "../SKINI11.h"
|
||||
#include "TwoOsc.h"
|
||||
|
||||
#include "../SKINI11.msg"
|
||||
|
||||
#define INSTR_LEN 60
|
||||
|
||||
int numStrings = 0;
|
||||
int notDone = 1;
|
||||
|
||||
#if defined(__SGI_REALTIME_)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <signal.h>
|
||||
|
||||
char inputString[MAX_IN_STRINGS][INSTR_LEN];
|
||||
pid_t string_thread;
|
||||
|
||||
void newString(void *)
|
||||
{
|
||||
int inOne = 0;
|
||||
while (notDone) {
|
||||
fgets(inputString[inOne],INSTR_LEN,stdin);
|
||||
if (inputString[inOne][0] == 'E' && inputString[inOne][1] == 'x') {
|
||||
notDone = 0;
|
||||
}
|
||||
else {
|
||||
numStrings++;
|
||||
if (numStrings > MAX_IN_STRINGS) {
|
||||
fprintf(stderr,"Losing MIDI data ... try increasing MAX_IN_STRINGS.\n");
|
||||
numStrings--;
|
||||
}
|
||||
inOne++;
|
||||
if (inOne == MAX_IN_STRINGS) inOne = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(__USS_REALTIME_)
|
||||
|
||||
#include <pthread.h>
|
||||
//#include <pthread/mit/pthread.h>
|
||||
|
||||
char inputString[MAX_IN_STRINGS][INSTR_LEN];
|
||||
pthread_t string_thread;
|
||||
|
||||
void *newString(void *)
|
||||
{
|
||||
int inOne = 0;
|
||||
while (notDone) {
|
||||
fgets(inputString[inOne],INSTR_LEN,stdin);
|
||||
if (inputString[inOne][0] == 'E' && inputString[inOne][1] == 'x') {
|
||||
notDone = 0;
|
||||
}
|
||||
else {
|
||||
numStrings++;
|
||||
if (numStrings > MAX_IN_STRINGS) {
|
||||
fprintf(stderr,"Losing MIDI data ... try increasing MAX_IN_STRINGS.\n");
|
||||
numStrings--;
|
||||
}
|
||||
inOne++;
|
||||
if (inOne == MAX_IN_STRINGS) inOne = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#elif (defined(__WINDS_REALTIME_) || defined(__WINMM_REALTIME_) )
|
||||
|
||||
#include <process.h>
|
||||
#include <winsock.h>
|
||||
|
||||
char inputString[MAX_IN_STRINGS][INSTR_LEN];
|
||||
unsigned long string_thread;
|
||||
|
||||
#define SERVICE_PORT 2001
|
||||
|
||||
void newString(void *)
|
||||
{
|
||||
int inOne = 0, i=0, m=0, n;
|
||||
SOCKET soc_id, accept_id;
|
||||
WSADATA wsaData;
|
||||
int nRet;
|
||||
struct sockaddr_in sockname;
|
||||
WORD wVersionRequested = MAKEWORD(1,1);
|
||||
char socBuf[INSTR_LEN];
|
||||
|
||||
nRet = WSAStartup(wVersionRequested, &wsaData);
|
||||
if (wsaData.wVersion != wVersionRequested)
|
||||
{
|
||||
fprintf(stderr,"\n Wrong version\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Create the server-side socket */
|
||||
soc_id = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
|
||||
if(soc_id == INVALID_SOCKET) {
|
||||
fprintf(stderr,"Couldn't create socket!\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
sockname.sin_family=AF_INET;
|
||||
sockname.sin_addr.s_addr=INADDR_ANY;
|
||||
sockname.sin_port=htons(SERVICE_PORT);
|
||||
|
||||
/* Bind socket to the appropriate port and interface (INADDR_ANY) */
|
||||
if (bind(soc_id,(LPSOCKADDR)&sockname,sizeof(sockname))==SOCKET_ERROR) {
|
||||
fprintf(stderr,"Couldn't bind socket!\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Listen for incoming connections */
|
||||
printf("Listening for socket on port %d\n", SERVICE_PORT);
|
||||
if (listen(soc_id,1)==SOCKET_ERROR) {
|
||||
fprintf(stderr,"Couldn't set up listen on socket!\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Accept and service one incoming connection request */
|
||||
accept_id=accept(soc_id,NULL,NULL);
|
||||
if (accept_id==INVALID_SOCKET) {
|
||||
fprintf(stderr,"Couldn't accept incoming connection on socket!\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
memset(socBuf, 0, sizeof(socBuf));
|
||||
|
||||
printf("Socket connection made ... ready to receive SKINI messages.\n");
|
||||
while (notDone) {
|
||||
i = recv(accept_id, socBuf, INSTR_LEN, 0);
|
||||
if (i==0) notDone = 0;
|
||||
n = 0;
|
||||
while (n < i) {
|
||||
inputString[inOne][m++] = socBuf[n];
|
||||
if (socBuf[n++] == '\n') {
|
||||
if (inputString[inOne][0] == 'E' && inputString[inOne][1] == 'x') {
|
||||
notDone = 0;
|
||||
n = i;
|
||||
}
|
||||
else {
|
||||
m = 0;
|
||||
numStrings++;
|
||||
if (numStrings > MAX_IN_STRINGS) {
|
||||
fprintf(stderr,"Losing MIDI data ... try increasing MAX_IN_STRINGS.\n");
|
||||
numStrings--;
|
||||
}
|
||||
inOne++;
|
||||
if (inOne == MAX_IN_STRINGS) inOne = 0;
|
||||
}
|
||||
memset(inputString[inOne], 0, INSTR_LEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
closesocket(accept_id);
|
||||
closesocket(soc_id);
|
||||
WSACleanup();
|
||||
printf("Socket connection closed.\n");
|
||||
}
|
||||
|
||||
#else
|
||||
char inputString[1][INSTR_LEN];
|
||||
#endif
|
||||
|
||||
/* Error function in case of incorrect command-line argument specifications */
|
||||
void errorf(char *func) {
|
||||
printf("\nuseage: %s Instr \n",func);
|
||||
printf(" where Instr = TwoOsc (only one available for now)\n\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void main(int argc,char *argv[])
|
||||
{
|
||||
long i, j, synlength;
|
||||
int type, rtInput = 0;
|
||||
int outOne = 0;
|
||||
char *fin;
|
||||
MY_FLOAT settleTime = 0.5; /* in seconds */
|
||||
MY_FLOAT temp, byte3, lastPitch;
|
||||
WvOut *output;
|
||||
TwoOsc *instrument;
|
||||
SKINI11 *score;
|
||||
|
||||
if (argc > 1) {
|
||||
if (!strcmp(argv[1],"TwoOsc")) instrument = new TwoOsc;
|
||||
else errorf(argv[0]);
|
||||
} else errorf(argv[0]);
|
||||
|
||||
output = new RTWvOut();
|
||||
score = new SKINI11();
|
||||
|
||||
rtInput = 1; /* We're going to always use realtime input */
|
||||
|
||||
/* If using realtime input, setup the input thread. */
|
||||
#if defined(__SGI_REALTIME_)
|
||||
if (rtInput) {
|
||||
string_thread = sproc(newString, PR_SALL);
|
||||
if (string_thread == -1) {
|
||||
fprintf(stderr, "unable to create input thread...aborting.\n");
|
||||
exit(-1);
|
||||
}
|
||||
instrument->noteOn(200.0, 0.2);
|
||||
}
|
||||
#elif defined(__USS_REALTIME_)
|
||||
if (rtInput) {
|
||||
if (pthread_create(&string_thread, NULL, newString, NULL))
|
||||
{
|
||||
fprintf(stderr, "unable to create input thread...aborting.\n");
|
||||
exit(-1);
|
||||
}
|
||||
instrument->noteOn(200.0,0.2);
|
||||
}
|
||||
#elif (defined(__WINDS_REALTIME_) || defined(__WINMM_REALTIME_) )
|
||||
if (rtInput) {
|
||||
string_thread = _beginthread(newString, 0, NULL);
|
||||
if (string_thread == -1) {
|
||||
fprintf(stderr, "Unable to create exit thread.\n");
|
||||
printf("Exiting MD2SKINI process.\n");
|
||||
exit(0);
|
||||
}
|
||||
instrument->noteOn(200.0,0.2);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Finally ... the runtime loop begins! */
|
||||
notDone = 1;
|
||||
synlength = RT_BUFFER_SIZE;
|
||||
while(notDone || numStrings) {
|
||||
if (rtInput) {
|
||||
if (numStrings > 1) synlength = (long) RT_BUFFER_SIZE / numStrings;
|
||||
else synlength = RT_BUFFER_SIZE;
|
||||
for ( i=0; i<synlength; i++ ) {
|
||||
output->tick(instrument->tick());
|
||||
}
|
||||
}
|
||||
else {
|
||||
fin = fgets(inputString[0],INSTR_LEN,stdin);
|
||||
if (fin == NULL) notDone = 0;
|
||||
else {
|
||||
numStrings++;
|
||||
}
|
||||
}
|
||||
if (numStrings) {
|
||||
score->parseThis(inputString[outOne]);
|
||||
type = score->getType();
|
||||
if (type > 0) {
|
||||
if (temp = score->getDelta()) { /* SKINI score file */
|
||||
synlength = (long) (temp * SRATE);
|
||||
for ( i=0; i<synlength; i++ ) {
|
||||
output->tick(instrument->tick());
|
||||
}
|
||||
synlength = 0;
|
||||
}
|
||||
if (type == __SK_NoteOn_ ) {
|
||||
if (( byte3 = score->getByteThree() ) == 0)
|
||||
instrument->noteOff(byte3*NORM_7);
|
||||
else {
|
||||
j = (int) score->getByteTwo();
|
||||
temp = __MIDI_To_Pitch[j];
|
||||
lastPitch = temp;
|
||||
instrument->noteOn(temp,byte3*NORM_7);
|
||||
}
|
||||
}
|
||||
else if (type == __SK_NoteOff_) {
|
||||
byte3 = score->getByteThree();
|
||||
instrument->noteOff(byte3*NORM_7);
|
||||
}
|
||||
else if (type == __SK_ControlChange_) {
|
||||
j = (int) score->getByteTwo();
|
||||
byte3 = score->getByteThree();
|
||||
instrument->controlChange(j,byte3);
|
||||
}
|
||||
else if (type == __SK_AfterTouch_) {
|
||||
j = (int) score->getByteTwo();
|
||||
instrument->controlChange(128,j);
|
||||
}
|
||||
else if (type == __SK_PitchBend_) {
|
||||
temp = score->getByteTwo();
|
||||
j = (int) temp;
|
||||
temp -= j;
|
||||
lastPitch = __MIDI_To_Pitch[j] * pow(2.0,temp / 12.0) ;
|
||||
instrument->setFreq(1, lastPitch); /* change osc1 pitch for now */
|
||||
}
|
||||
else if (type == __SK_ProgramChange_) {
|
||||
}
|
||||
}
|
||||
if (rtInput) {
|
||||
outOne += 1;
|
||||
if (outOne == MAX_IN_STRINGS) outOne = 0;
|
||||
}
|
||||
numStrings--;
|
||||
}
|
||||
}
|
||||
for (i=0;i<settleTime*SRATE;i++) { /* let the sound settle a little */
|
||||
output->tick(instrument->tick());
|
||||
}
|
||||
|
||||
delete output;
|
||||
delete score;
|
||||
delete instrument;
|
||||
|
||||
#if defined(__SGI_REALTIME_)
|
||||
if (rtInput) kill(string_thread, SIGKILL);
|
||||
#endif
|
||||
printf("MUS151 finished.\n");
|
||||
}
|
||||
177
mus151/MUS151.dsp
Normal file
177
mus151/MUS151.dsp
Normal file
@@ -0,0 +1,177 @@
|
||||
# Microsoft Developer Studio Project File - Name="MUS151" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=MUS151 - 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 "MUS151.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 "MUS151.MAK" CFG="MUS151 - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "MUS151 - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "MUS151 - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "MUS151 - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "MUS151__"
|
||||
# PROP BASE Intermediate_Dir "MUS151__"
|
||||
# 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 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /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 winmm.lib dsound.lib Wsock32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "MUS151 - 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 /MT /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /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 winmm.lib dsound.lib Wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "MUS151 - Win32 Release"
|
||||
# Name "MUS151 - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Envelope.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Envelope.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MUS151.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Object.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Object.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\RawLoop.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\RawLoop.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\RawWave.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\RawWave.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\RTSoundIO.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\RTSoundIO.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\RTWvOut.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\RTWvOut.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\SKINI11.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\SKINI11.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\SKINI11.msg
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\SKINI11.tbl
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\swapstuf.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\swapstuf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TwoOsc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TwoOsc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\WvOut.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\WvOut.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
29
mus151/MUS151.dsw
Normal file
29
mus151/MUS151.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "MUS151"=.\MUS151.DSP - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
BIN
mus151/MUS151.ncb
Normal file
BIN
mus151/MUS151.ncb
Normal file
Binary file not shown.
65
mus151/Makefile
Normal file
65
mus151/Makefile
Normal file
@@ -0,0 +1,65 @@
|
||||
# MUS151 Makefile - Global version for Unix systems which have GNU
|
||||
# Makefile utilities installed.
|
||||
#
|
||||
# This is an example project Makefile, to demonstrate how one might
|
||||
# develop an STK project that resides apart from the core STK
|
||||
# distribution. It is highly recommended that you keep your
|
||||
# personal STK projects separate from the core distribution, to
|
||||
# make upgrading to newer releases more simple.
|
||||
#
|
||||
# by Gary P. Scavone
|
||||
# CCRMA, Stanford University, 1998.
|
||||
|
||||
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 = ../
|
||||
|
||||
O_FILES = Object.o Envelope.o RawWave.o RawLoop.o \
|
||||
SKINI11.o swapstuf.o WvOut.o \
|
||||
RTWvOut.o RTSoundIO.o \
|
||||
\
|
||||
TwoOsc.o
|
||||
|
||||
RM = /bin/rm
|
||||
|
||||
ifeq ($(OS),IRIX) # These are for SGI
|
||||
INSTR = MUS151
|
||||
CC = CC -O # -g -fullwarn -D__SGI_CC__
|
||||
LIBRARY = -L/usr/sgitcl/lib -laudio -lmd -lm
|
||||
endif
|
||||
|
||||
ifeq ($(OS),Linux) # These are for Linux
|
||||
INSTR = MUS151
|
||||
CC = gcc -O3 # -g -pg -O3
|
||||
LIBRARY = -lpthread -lm
|
||||
# LIBRARY = /lib/libpthread.so.0 -lm
|
||||
endif
|
||||
|
||||
%.o : $(STK_PATH)%.cpp
|
||||
$(CC) -c $(<) -o $@
|
||||
|
||||
MUS151: MUS151.cpp $(O_FILES)
|
||||
$(CC) -o MUS151 MUS151.cpp $(O_FILES) $(LIBRARY)
|
||||
|
||||
# Personal $(O_FILES) :
|
||||
|
||||
TwoOsc.o : TwoOsc.cpp
|
||||
$(CC) -c TwoOsc.cpp
|
||||
|
||||
all: $(INSTR)
|
||||
|
||||
clean :
|
||||
rm *.o
|
||||
rm $(INSTR)
|
||||
|
||||
cleanIns :
|
||||
rm $(INSTR)
|
||||
|
||||
strip :
|
||||
strip $(INSTR)
|
||||
|
||||
|
||||
16
mus151/README-mus151.txt
Normal file
16
mus151/README-mus151.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
MUS151: An example project using STK
|
||||
|
||||
By Gary P. Scavone
|
||||
CCRMA, Stanford University, 1998.
|
||||
|
||||
It is highly recommended that you keep your personal STK projects separate from the STK core distribution, to make upgrading to newer releases more simple. The files in this directory demonstrate how one might manage this.
|
||||
|
||||
This simple project, named MUS151 for the pyschoacoustics class taught at CCRMA, plays two sine waves and allows independent control of their amplitudes and frequencies. The file MUS151.cpp is essentially the same as syntmono.cpp, though simplified to a great extent because of its more specific use. In particular, only one "instrument" is currently supported (TwoOsc) and only real-time output is used (thus, this project cannot be compiled for NeXTStep). A simple Tcl/Tk GUI has been created to control the instrument. The GUI and STK project can be run under Linux and SGI using the simple GUITwoOsc executable script.
|
||||
|
||||
The mus151 project directory has been distributed as a subdirectory of the core STK file directory. In this location, the project should compile without any problems (on Linux, SGI, and Win platforms). Should you choose to relocate this directory, several path variables will need to be updated as described below.
|
||||
|
||||
Three "personal" STK files were created for this project: MUS151.cpp and the TwoOsc class files TwoOsc.h and TwoOsc.cpp. A specific Tcl/Tk GUI script was written (TwoOsc.tcl) and is located in the "tcl" subdirectory. Depending on where you choose to locate the mus151 directory, several #include statements may need to be updated to reflect the location of the STK core distribution. For example, mus151/ is currently a subdirectory of the STK core files, so the various core STK header files are referenced in TwoOsc.h as: #include "../Instrmnt.h". You could move the mus151 files to a completely different point on your directory tree, but you would have to update those statements to correctly reference your core files. Likewise, the "sinewave.raw" file must be correctly referenced in TwoOsc.cpp.
|
||||
|
||||
The unix Makefile must also be updated to correctly reference the STK core distribution. A variable, STK_PATH, has been created to simplify this procedure. Note that all STK core object files are referenced with a single, general statement. All personal object files need their own dependency definitions.
|
||||
|
||||
Finally, it is simple to create a VC++ project directory that is completely separate from the STK core distribution. However, it appears that there is no simple way to redefine the location of the project files should you choose to relocate the project after it is created. You will probably have to manually "Add" all the core STK files to the VC++ project after moving the project directory.
|
||||
0
mus151/Release/.placeholder
Normal file
0
mus151/Release/.placeholder
Normal file
76
mus151/TwoOsc.cpp
Normal file
76
mus151/TwoOsc.cpp
Normal file
@@ -0,0 +1,76 @@
|
||||
/********************************************/
|
||||
/* Two oscillator instrument for use */
|
||||
/* with MUS151 Psychoacoustics course. */
|
||||
/* by Gary P. Scavone & Oded Ben-Tal, 1998 */
|
||||
/* CCRMA, Stanford Unviversity */
|
||||
/********************************************/
|
||||
|
||||
#include "TwoOsc.h"
|
||||
|
||||
TwoOsc :: TwoOsc()
|
||||
{
|
||||
int i;
|
||||
|
||||
envelope = new Envelope; /* Envelope to avoid clicks */
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
osc[i] = new RawLoop("../rawwaves/sinewave.raw");
|
||||
osc[i]->normalize();
|
||||
osc[i]->setFreq((MY_FLOAT) 200.0);
|
||||
amps[i] = 0.2;
|
||||
}
|
||||
lastOutput = 0;
|
||||
}
|
||||
|
||||
TwoOsc :: ~TwoOsc()
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<2; i++) delete osc[i];
|
||||
delete envelope;
|
||||
}
|
||||
|
||||
void TwoOsc :: setFreq(int oscnum, MY_FLOAT frequency)
|
||||
{
|
||||
if (oscnum == 1) osc[0]->setFreq(frequency);
|
||||
else if (oscnum == 2) osc[1]->setFreq(frequency);
|
||||
}
|
||||
|
||||
void TwoOsc :: setAmp(int oscnum, MY_FLOAT amp)
|
||||
{
|
||||
if (oscnum == 1) amps[0] = amp;
|
||||
else if (oscnum == 2) amps[1] = amp;
|
||||
}
|
||||
|
||||
void TwoOsc :: noteOn(MY_FLOAT freq, MY_FLOAT amp)
|
||||
{
|
||||
envelope->keyOn();
|
||||
}
|
||||
|
||||
void TwoOsc :: noteOff(MY_FLOAT amp)
|
||||
{
|
||||
envelope->keyOff();
|
||||
}
|
||||
|
||||
MY_FLOAT TwoOsc :: tick()
|
||||
{
|
||||
lastOutput = 0.5 * envelope->tick() * (amps[0]*osc[0]->tick() + amps[1]*osc[1]->tick());
|
||||
return lastOutput;
|
||||
}
|
||||
|
||||
void TwoOsc :: controlChange(int number, MY_FLOAT value)
|
||||
{
|
||||
switch (number) {
|
||||
case 20:
|
||||
osc[0]->setFreq(value);
|
||||
break;
|
||||
case 21:
|
||||
osc[1]->setFreq(value);
|
||||
break;
|
||||
case 22:
|
||||
amps[0] = value * NORM_7;
|
||||
break;
|
||||
case 23:
|
||||
amps[1] = value * NORM_7;
|
||||
break;
|
||||
}
|
||||
}
|
||||
35
mus151/TwoOsc.h
Normal file
35
mus151/TwoOsc.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/******************************************/
|
||||
/* Two oscillator instrument for use */
|
||||
/* with MUS151 Psychoacoustics course. */
|
||||
/* by Gary P. Scavone, 1998 */
|
||||
/* CCRMA, Stanford Unviversity */
|
||||
/******************************************/
|
||||
|
||||
#if !defined(__TwoOsc_h)
|
||||
#define __TwoOsc_h
|
||||
|
||||
//#include "../Instrmnt.h"
|
||||
#include "../Envelope.h"
|
||||
#include "../RawLoop.h"
|
||||
|
||||
|
||||
class TwoOsc : public Object
|
||||
{
|
||||
protected:
|
||||
Envelope *envelope;
|
||||
RawLoop *osc[2];
|
||||
MY_FLOAT lastOutput;
|
||||
MY_FLOAT amps[2];
|
||||
|
||||
public:
|
||||
TwoOsc();
|
||||
~TwoOsc();
|
||||
virtual void setFreq(int oscnum, MY_FLOAT frequency);
|
||||
virtual void setAmp(int oscnum, MY_FLOAT amp);
|
||||
virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
|
||||
virtual void noteOff(MY_FLOAT amp);
|
||||
virtual MY_FLOAT tick();
|
||||
virtual void controlChange(int number, MY_FLOAT value);
|
||||
};
|
||||
|
||||
#endif
|
||||
201
mus151/tcl/TwoWaves.tcl
Normal file
201
mus151/tcl/TwoWaves.tcl
Normal file
@@ -0,0 +1,201 @@
|
||||
set pitch 64.0
|
||||
set osc1on 1
|
||||
set osc2on 1
|
||||
set freq1 200.0
|
||||
set freq2 200.0
|
||||
set amp1 20
|
||||
set amp2 20
|
||||
set outID "stdout"
|
||||
set commtype "stdout"
|
||||
|
||||
# Configure main window
|
||||
wm title . "MUS152 Two Oscillator Controller"
|
||||
wm iconname . "TwoOsc"
|
||||
. 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 "MUS151 Two Oscillator 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 $pitch 64.0 }
|
||||
button .noteOn.off -text NoteOff -bg grey66 -command { noteOff $pitch 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.freq1 -from 0 -to 10000 -length 400 \
|
||||
-command {changeParam 20 } \
|
||||
-orient horizontal -label "Frequency 1" \
|
||||
-tickinterval 2000 -showvalue true -bg grey66 \
|
||||
-variable freq1
|
||||
|
||||
scale .left.amp1 -from 0 -to 127 -length 400 \
|
||||
-command {changeParam 22 } \
|
||||
-orient horizontal -label "Amp 1" \
|
||||
-tickinterval 32 -showvalue true -bg grey66 \
|
||||
-variable amp1
|
||||
|
||||
scale .left.freq2 -from 0 -to 10000 -length 400 \
|
||||
-command {changeParam 21 } \
|
||||
-orient horizontal -label "Frequency 2" \
|
||||
-tickinterval 2000 -showvalue true -bg grey66 \
|
||||
-variable freq2
|
||||
|
||||
scale .left.amp2 -from 0 -to 127 -length 400 \
|
||||
-command {changeParam 23 } \
|
||||
-orient horizontal -label "Amp 2" \
|
||||
-tickinterval 32 -showvalue true -bg grey66 \
|
||||
-variable amp2
|
||||
|
||||
pack .left.freq1 -padx 10 -pady 3
|
||||
pack .left.amp1 -padx 10 -pady 3
|
||||
pack .left.freq2 -padx 10 -pady 3
|
||||
pack .left.amp2 -padx 10 -pady 3
|
||||
|
||||
pack .left -side left
|
||||
|
||||
# Configure more buttons
|
||||
frame .onOff -bg black
|
||||
|
||||
checkbutton .onOff.1 -text "Play Osc 1" -variable osc1on -relief flat \
|
||||
-command {setPlayStatus 22 $osc1on}
|
||||
checkbutton .onOff.2 -text "Play Osc 2" -variable osc2on -relief flat \
|
||||
-command {setPlayStatus 23 $osc2on}
|
||||
|
||||
pack .onOff.1 .onOff.2 -padx 5
|
||||
pack .onOff -side right -padx 5 -pady 10
|
||||
|
||||
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 changeParam {controlNum value } {
|
||||
global outID freq1 freq2 amp1 amp2 osc1on osc2on
|
||||
if {$controlNum==20 || $controlNum==22} {
|
||||
if {$osc1on==1} {
|
||||
puts $outID [format "ControlChange 0.0 1 %d %f" $controlNum $value ]
|
||||
}
|
||||
} elseif {$controlNum==21 || $controlNum==23} {
|
||||
if {$osc2on==1} {
|
||||
puts $outID [format "ControlChange 0.0 1 %d %f" $controlNum $value ]
|
||||
}
|
||||
}
|
||||
flush $outID
|
||||
}
|
||||
|
||||
proc setPlayStatus {controlNum value } {
|
||||
global outID amp1 amp2 freq1 freq2
|
||||
if {$value==1} {
|
||||
if {$controlNum==22} {
|
||||
puts $outID [format "ControlChange 0.0 1 %d %f" 20 $freq1 ]
|
||||
puts $outID [format "ControlChange 0.0 1 %d %f" $controlNum $amp1 ]
|
||||
} elseif {$controlNum==23} {
|
||||
puts $outID [format "ControlChange 0.0 1 %d %f" 21 $freq2 ]
|
||||
puts $outID [format "ControlChange 0.0 1 %d %f" $controlNum $amp2 ]
|
||||
}
|
||||
} elseif {$value==0} {
|
||||
puts $outID [format "ControlChange 0.0 1 %d %f" $controlNum 0.0 ]
|
||||
}
|
||||
flush $outID
|
||||
}
|
||||
|
||||
# Socket connection procedure
|
||||
set d .socketdialog
|
||||
|
||||
proc setComm {} {
|
||||
global outID commtype 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
|
||||
toplevel $d
|
||||
wm title $d "STK Client Socket Connection"
|
||||
wm resizable $d 0 0
|
||||
grab $d
|
||||
label $d.message -text "Specify a socket port number below (if different than the STK default of 2001) 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.sockport
|
||||
entry $d.sockport.entry -width 6
|
||||
label $d.sockport.text -text "Socket Port Number:" \
|
||||
-font {Helvetica 10 bold}
|
||||
pack $d.message -side top -padx 5 -pady 10
|
||||
pack $d.sockport.text -side left -padx 1 -pady 10
|
||||
pack $d.sockport.entry -side right -padx 5 -pady 10
|
||||
pack $d.sockport -side top -padx 5 -pady 10
|
||||
$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 sockport [$d.sockport.entry get]
|
||||
set err [catch {socket localhost $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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
39
syntmono.cpp
39
syntmono.cpp
@@ -67,7 +67,7 @@ void newString(void *)
|
||||
{
|
||||
int inOne = 0;
|
||||
while (notDone) {
|
||||
fgets(inputString[inOne],128,stdin);
|
||||
fgets(inputString[inOne],INSTR_LEN,stdin);
|
||||
if (inputString[inOne][0] == 'E' && inputString[inOne][1] == 'x') {
|
||||
notDone = 0;
|
||||
}
|
||||
@@ -86,6 +86,7 @@ void newString(void *)
|
||||
#elif defined(__USS_REALTIME_)
|
||||
|
||||
#include <pthread.h>
|
||||
//#include <pthread/mit/pthread.h>
|
||||
|
||||
char inputString[MAX_IN_STRINGS][INSTR_LEN];
|
||||
pthread_t string_thread;
|
||||
@@ -94,7 +95,7 @@ void *newString(void *)
|
||||
{
|
||||
int inOne = 0;
|
||||
while (notDone) {
|
||||
fgets(inputString[inOne],128,stdin);
|
||||
fgets(inputString[inOne],INSTR_LEN,stdin);
|
||||
if (inputString[inOne][0] == 'E' && inputString[inOne][1] == 'x') {
|
||||
notDone = 0;
|
||||
}
|
||||
@@ -434,12 +435,14 @@ void main(int argc,char *argv[])
|
||||
instrument->noteOn(200.0,0.1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Finally ... the runtime loop begins! */
|
||||
notDone = 1;
|
||||
synlength = RT_BUFFER_SIZE;
|
||||
while(notDone || numStrings) {
|
||||
if (rtInput) {
|
||||
synlength = RT_BUFFER_SIZE;
|
||||
if (numStrings > 1) synlength = (long) RT_BUFFER_SIZE / numStrings;
|
||||
else synlength = RT_BUFFER_SIZE;
|
||||
for ( i=0; i<synlength; i++ ) {
|
||||
if (numOuts > 1) {
|
||||
outSample = reverb->tick(instrument->tick());
|
||||
@@ -455,22 +458,21 @@ void main(int argc,char *argv[])
|
||||
numStrings++;
|
||||
}
|
||||
}
|
||||
while (numStrings) {
|
||||
if (numStrings) {
|
||||
score->parseThis(inputString[outOne]);
|
||||
type = score->getType();
|
||||
if (type > 0) {
|
||||
synlength = (long) (score->getDelta() * SRATE);
|
||||
#if defined(_debug_)
|
||||
if (!rtInput) printf("Time = %f: ",output.getTime());
|
||||
#endif
|
||||
for ( i=0; i<synlength; i++ ) {
|
||||
if (numOuts > 1) {
|
||||
outSample = reverb->tick(instrument->tick());
|
||||
for ( j=0; j<numOuts; j++ ) output[j]->tick(outSample);
|
||||
if (type > 0) {
|
||||
if (temp = score->getDelta()) { /* SKINI score file */
|
||||
synlength = (long) (temp * SRATE);
|
||||
for ( i=0; i<synlength; i++ ) {
|
||||
if (numOuts > 1) {
|
||||
outSample = reverb->tick(instrument->tick());
|
||||
for ( j=0; j<numOuts; j++ ) output[j]->tick(outSample);
|
||||
}
|
||||
else output[0]->tick(reverb->tick(instrument->tick()));
|
||||
}
|
||||
else output[0]->tick(reverb->tick(instrument->tick()));
|
||||
synlength = 0;
|
||||
}
|
||||
synlength = 0;
|
||||
if (type == __SK_NoteOn_ ) {
|
||||
if (( byte3 = score->getByteThree() ) == 0)
|
||||
instrument->noteOff(byte3*NORM_7);
|
||||
@@ -578,7 +580,8 @@ void main(int argc,char *argv[])
|
||||
numStrings--;
|
||||
}
|
||||
}
|
||||
for (i=0;i<2*reverbTime*SRATE;i++) { /* let the reverb settle a little */
|
||||
|
||||
for (i=0;i<reverbTime*SRATE;i++) { /* let the reverb settle a little */
|
||||
if (numOuts > 1) {
|
||||
outSample = reverb->tick(instrument->tick());
|
||||
for ( j=0; j<numOuts; j++ ) output[j]->tick(outSample);
|
||||
@@ -596,5 +599,5 @@ void main(int argc,char *argv[])
|
||||
#if defined(__SGI_REALTIME_)
|
||||
if (rtInput) kill(string_thread, SIGKILL);
|
||||
#endif
|
||||
printf("syntmono finished ... au revoir.\n");
|
||||
printf("syntmono finished ... goodbye.\n");
|
||||
}
|
||||
|
||||
24
syntmono.dsp
24
syntmono.dsp
@@ -452,6 +452,14 @@ SOURCE=.\PRCRev.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RawInterp.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RawInterp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RawLoop.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -460,6 +468,14 @@ SOURCE=.\RawLoop.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RawShot.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RawShot.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RawWave.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -468,14 +484,6 @@ SOURCE=.\RawWave.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RawWvIn.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RawWvIn.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ReedTabl.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
151
syntmono.plg
151
syntmono.plg
@@ -10,15 +10,83 @@ Project's tools are:
|
||||
"Custom Build" with flags ""
|
||||
"<Component 0xa>" with flags ""
|
||||
|
||||
Creating temp file "c:\windows\TEMP\RSP8374.TMP" with contents </nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Release/syntmono.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
|
||||
Creating temp file "C:\WINDOWS\TEMP\RSPF2B0.TMP" with contents </nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Release/syntmono.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
|
||||
"D:\gary\STK98v2\ADSR.cpp"
|
||||
"D:\gary\STK98v2\AgogoBel.cpp"
|
||||
"D:\gary\STK98v2\BeeThree.cpp"
|
||||
"D:\gary\STK98v2\BiQuad.cpp"
|
||||
"D:\gary\STK98v2\Bowed.cpp"
|
||||
"D:\gary\STK98v2\BowTabl.cpp"
|
||||
"D:\gary\STK98v2\Brass.cpp"
|
||||
"D:\gary\STK98v2\Clarinet.cpp"
|
||||
"D:\gary\STK98v2\DCBlock.cpp"
|
||||
"D:\gary\STK98v2\DLineA.cpp"
|
||||
"D:\gary\STK98v2\DLineL.cpp"
|
||||
"D:\gary\STK98v2\DLineN.cpp"
|
||||
"D:\gary\STK98v2\DrumSynt.cpp"
|
||||
"D:\gary\STK98v2\Envelope.cpp"
|
||||
"D:\gary\STK98v2\Filter.cpp"
|
||||
"D:\gary\STK98v2\Flute.cpp"
|
||||
"D:\gary\STK98v2\FM4Alg3.cpp"
|
||||
"D:\gary\STK98v2\FM4Alg4.cpp"
|
||||
"D:\gary\STK98v2\FM4Alg5.cpp"
|
||||
"D:\gary\STK98v2\FM4Alg6.cpp"
|
||||
"D:\gary\STK98v2\FM4Alg8.cpp"
|
||||
"D:\gary\STK98v2\FM4Op.cpp"
|
||||
"D:\gary\STK98v2\FMVoices.cpp"
|
||||
"D:\gary\STK98v2\FormSwep.cpp"
|
||||
"D:\gary\STK98v2\HeavyMtl.cpp"
|
||||
"D:\gary\STK98v2\Instrmnt.cpp"
|
||||
"D:\gary\STK98v2\JCRev.cpp"
|
||||
"D:\gary\STK98v2\JetTabl.cpp"
|
||||
"D:\gary\STK98v2\LipFilt.cpp"
|
||||
"D:\gary\STK98v2\Mandolin.cpp"
|
||||
"D:\gary\STK98v2\Mandplyr.cpp"
|
||||
"D:\gary\STK98v2\Marimba.cpp"
|
||||
"D:\gary\STK98v2\MatWvOut.cpp"
|
||||
"D:\gary\STK98v2\Modal4.cpp"
|
||||
"D:\gary\STK98v2\Modulatr.cpp"
|
||||
"D:\gary\STK98v2\Moog1.cpp"
|
||||
"D:\gary\STK98v2\Noise.cpp"
|
||||
"D:\gary\STK98v2\NRev.cpp"
|
||||
"D:\gary\STK98v2\Object.cpp"
|
||||
"D:\gary\STK98v2\OnePole.cpp"
|
||||
"D:\gary\STK98v2\OneZero.cpp"
|
||||
"D:\gary\STK98v2\PercFlut.cpp"
|
||||
"D:\gary\STK98v2\Plucked.cpp"
|
||||
"D:\gary\STK98v2\Plucked2.cpp"
|
||||
"D:\gary\STK98v2\PRCRev.cpp"
|
||||
"D:\gary\STK98v2\RawInterp.cpp"
|
||||
"D:\gary\STK98v2\RawLoop.cpp"
|
||||
"D:\gary\STK98v2\RawShot.cpp"
|
||||
"D:\gary\STK98v2\RawWave.cpp"
|
||||
"D:\gary\STK98v2\ReedTabl.cpp"
|
||||
"D:\gary\STK98v2\Reverb.cpp"
|
||||
"D:\gary\STK98v2\Rhodey.cpp"
|
||||
"D:\gary\STK98v2\RTSoundIO.cpp"
|
||||
"D:\gary\STK98v2\RTWvOut.cpp"
|
||||
"D:\gary\STK98v2\Sampler.cpp"
|
||||
"D:\gary\STK98v2\SamplFlt.cpp"
|
||||
"D:\gary\STK98v2\Shakers.cpp"
|
||||
"D:\gary\STK98v2\Simple.cpp"
|
||||
"D:\gary\STK98v2\SingWave.cpp"
|
||||
"D:\gary\STK98v2\SKINI11.cpp"
|
||||
"D:\gary\STK98v2\SndWvOut.cpp"
|
||||
"D:\gary\STK98v2\SubNoise.cpp"
|
||||
"D:\gary\STK98v2\Swapstuf.cpp"
|
||||
"D:\gary\STK98v2\Syntmono.cpp"
|
||||
"D:\gary\STK98v2\TubeBell.cpp"
|
||||
"D:\gary\STK98v2\TwoPole.cpp"
|
||||
"D:\gary\STK98v2\TwoZero.cpp"
|
||||
"D:\gary\STK98v2\Vibraphn.cpp"
|
||||
"D:\gary\STK98v2\VoicForm.cpp"
|
||||
"D:\gary\STK98v2\VoicMang.cpp"
|
||||
"D:\gary\STK98v2\WavWvOut.cpp"
|
||||
"D:\gary\STK98v2\Wurley.cpp"
|
||||
"D:\gary\STK98v2\WvOut.cpp"
|
||||
>
|
||||
Creating command line "cl.exe @c:\windows\TEMP\RSP8374.TMP"
|
||||
Creating temp file "c:\windows\TEMP\RSP8375.TMP" with contents <kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib dsound.lib Wsock32.lib /nologo /subsystem:console /incremental:no /pdb:"syntmono.pdb" /machine:I386 /out:"syntmono.exe"
|
||||
Creating command line "cl.exe @C:\WINDOWS\TEMP\RSPF2B0.TMP"
|
||||
Creating temp file "C:\WINDOWS\TEMP\RSPF2B1.TMP" with contents <kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib dsound.lib Wsock32.lib /nologo /subsystem:console /incremental:no /pdb:"syntmono.pdb" /machine:I386 /out:"syntmono.exe"
|
||||
.\Release\ADSR.obj
|
||||
.\Release\AgogoBel.obj
|
||||
.\Release\BeeThree.obj
|
||||
@@ -51,6 +119,7 @@ Creating temp file "c:\windows\TEMP\RSP8375.TMP" with contents <kernel32.lib use
|
||||
.\Release\Mandolin.obj
|
||||
.\Release\Mandplyr.obj
|
||||
.\Release\Marimba.obj
|
||||
.\Release\MatWvOut.obj
|
||||
.\Release\Modal4.obj
|
||||
.\Release\Modulatr.obj
|
||||
.\Release\Moog1.obj
|
||||
@@ -63,9 +132,10 @@ Creating temp file "c:\windows\TEMP\RSP8375.TMP" with contents <kernel32.lib use
|
||||
.\Release\Plucked.obj
|
||||
.\Release\Plucked2.obj
|
||||
.\Release\PRCRev.obj
|
||||
.\Release\RawInterp.obj
|
||||
.\Release\RawLoop.obj
|
||||
.\Release\RawShot.obj
|
||||
.\Release\RawWave.obj
|
||||
.\Release\RawWvIn.obj
|
||||
.\Release\ReedTabl.obj
|
||||
.\Release\Reverb.obj
|
||||
.\Release\Rhodey.obj
|
||||
@@ -89,15 +159,82 @@ Creating temp file "c:\windows\TEMP\RSP8375.TMP" with contents <kernel32.lib use
|
||||
.\Release\VoicMang.obj
|
||||
.\Release\WavWvOut.obj
|
||||
.\Release\Wurley.obj
|
||||
.\Release\WvOut.obj
|
||||
.\Release\MatWvOut.obj>
|
||||
Creating command line "link.exe @c:\windows\TEMP\RSP8375.TMP"
|
||||
.\Release\WvOut.obj>
|
||||
Creating command line "link.exe @C:\WINDOWS\TEMP\RSPF2B1.TMP"
|
||||
Compiling...
|
||||
ADSR.cpp
|
||||
AgogoBel.cpp
|
||||
BeeThree.cpp
|
||||
BiQuad.cpp
|
||||
Bowed.cpp
|
||||
BowTabl.cpp
|
||||
Brass.cpp
|
||||
Clarinet.cpp
|
||||
DCBlock.cpp
|
||||
DLineA.cpp
|
||||
DLineL.cpp
|
||||
DLineN.cpp
|
||||
DrumSynt.cpp
|
||||
Envelope.cpp
|
||||
Filter.cpp
|
||||
Flute.cpp
|
||||
FM4Alg3.cpp
|
||||
FM4Alg4.cpp
|
||||
FM4Alg5.cpp
|
||||
FM4Alg6.cpp
|
||||
FM4Alg8.cpp
|
||||
FM4Op.cpp
|
||||
FMVoices.cpp
|
||||
FormSwep.cpp
|
||||
HeavyMtl.cpp
|
||||
Instrmnt.cpp
|
||||
JCRev.cpp
|
||||
JetTabl.cpp
|
||||
LipFilt.cpp
|
||||
Mandolin.cpp
|
||||
Mandplyr.cpp
|
||||
Marimba.cpp
|
||||
MatWvOut.cpp
|
||||
Modal4.cpp
|
||||
Modulatr.cpp
|
||||
Moog1.cpp
|
||||
Noise.cpp
|
||||
NRev.cpp
|
||||
Object.cpp
|
||||
OnePole.cpp
|
||||
OneZero.cpp
|
||||
PercFlut.cpp
|
||||
Plucked.cpp
|
||||
Plucked2.cpp
|
||||
PRCRev.cpp
|
||||
RawInterp.cpp
|
||||
RawLoop.cpp
|
||||
RawShot.cpp
|
||||
RawWave.cpp
|
||||
ReedTabl.cpp
|
||||
Reverb.cpp
|
||||
Rhodey.cpp
|
||||
RTSoundIO.cpp
|
||||
RTWvOut.cpp
|
||||
Sampler.cpp
|
||||
SamplFlt.cpp
|
||||
Shakers.cpp
|
||||
Simple.cpp
|
||||
SingWave.cpp
|
||||
SKINI11.cpp
|
||||
SndWvOut.cpp
|
||||
SubNoise.cpp
|
||||
Swapstuf.cpp
|
||||
Syntmono.cpp
|
||||
TubeBell.cpp
|
||||
TwoPole.cpp
|
||||
TwoZero.cpp
|
||||
Vibraphn.cpp
|
||||
VoicForm.cpp
|
||||
VoicMang.cpp
|
||||
WavWvOut.cpp
|
||||
Wurley.cpp
|
||||
WvOut.cpp
|
||||
Linking...
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user