Version 0.99

This commit is contained in:
Gary Scavone
2009-03-24 22:41:14 -04:00
committed by Stephen Sinclair
commit 6485746ee9
218 changed files with 13786 additions and 0 deletions

55
rawwaves/MAKEFUNC.C Normal file
View File

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

33
rawwaves/MAKEMIDI.C Normal file
View File

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

116
rawwaves/MAKEWAVS.C Normal file
View File

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

17
rawwaves/MIDITABL.H Normal file
View File

@@ -0,0 +1,17 @@
double __MIDI_To_Pitch[128] = {
8.18,8.66,9.18,9.72,10.30,10.91,11.56,12.25,
12.98,13.75,14.57,15.43,16.35,17.32,18.35,19.45,
20.60,21.83,23.12,24.50,25.96,27.50,29.14,30.87,
32.70,34.65,36.71,38.89,41.20,43.65,46.25,49.00,
51.91,55.00,58.27,61.74,65.41,69.30,73.42,77.78,
82.41,87.31,92.50,98.00,103.83,110.00,116.54,123.47,
130.81,138.59,146.83,155.56,164.81,174.61,185.00,196.00,
207.65,220.00,233.08,246.94,261.63,277.18,293.66,311.13,
329.63,349.23,369.99,392.00,415.30,440.00,466.16,493.88,
523.25,554.37,587.33,622.25,659.26,698.46,739.99,783.99,
830.61,880.00,932.33,987.77,1046.50,1108.73,1174.66,1244.51,
1318.51,1396.91,1479.98,1567.98,1661.22,1760.00,1864.66,1975.53,
2093.00,2217.46,2349.32,2489.02,2637.02,2793.83,2959.96,3135.96,
3322.44,3520.00,3729.31,3951.07,4186.01,4434.92,4698.64,4978.03,
5274.04,5587.65,5919.91,6271.93,6644.88,7040.00,7458.62,7902.13,
8372.02,8869.84,9397.27,9956.06,10548.08,11175.30,11839.82,12543.85,};

BIN
rawwaves/ahh.raw Normal file

Binary file not shown.

BIN
rawwaves/britestk.raw Normal file

Binary file not shown.

BIN
rawwaves/drumwavs/bass.raw Normal file

Binary file not shown.

Binary file not shown.

BIN
rawwaves/drumwavs/crash.raw Normal file

Binary file not shown.

BIN
rawwaves/drumwavs/hat.raw Normal file

Binary file not shown.

BIN
rawwaves/drumwavs/ride.raw Normal file

Binary file not shown.

BIN
rawwaves/drumwavs/snar.raw Normal file

Binary file not shown.

BIN
rawwaves/drumwavs/tamb.raw Normal file

Binary file not shown.

BIN
rawwaves/drumwavs/tomhi.raw Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
rawwaves/eee.raw Normal file

Binary file not shown.

BIN
rawwaves/fwavblnk.raw Normal file

Binary file not shown.

BIN
rawwaves/halfwave.raw Normal file

Binary file not shown.

BIN
rawwaves/impuls10.raw Normal file

Binary file not shown.

BIN
rawwaves/impuls20.raw Normal file

Binary file not shown.

BIN
rawwaves/impuls40.raw Normal file

Binary file not shown.

BIN
rawwaves/mandpluk.raw Normal file

Binary file not shown.

BIN
rawwaves/marmstk1.raw Normal file

Binary file not shown.

BIN
rawwaves/ooo.raw Normal file

Binary file not shown.

BIN
rawwaves/peksblnk.raw Normal file

Binary file not shown.

BIN
rawwaves/ppksblnk.raw Normal file

Binary file not shown.

BIN
rawwaves/silence.aiff Normal file

Binary file not shown.

BIN
rawwaves/silence.raw Normal file

Binary file not shown.

BIN
rawwaves/sineblnk.raw Normal file

Binary file not shown.

BIN
rawwaves/sinewave.raw Normal file

Binary file not shown.

BIN
rawwaves/snglpeak.raw Normal file

Binary file not shown.

BIN
rawwaves/twopeaks.raw Normal file

Binary file not shown.