Skip to content
Snippets Groups Projects
Commit bfe91616 authored by deuce's avatar deuce
Browse files

Those wern't harmonics, the selected frequency (And loudest bit) was the

third harmonic (First three were played with increasing amplitude)
Add a "real" harmonic set for the two _HARM shapes and rename the old
SINE_SAW_HARM to SINE_SAW_CHORD ('cause it sounded cool)
New default is SINE_SAW_HARM and sounds niceish.
parent 33df522d
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@ enum {
,WAVE_SHAPE_SQUARE
,WAVE_SHAPE_SINE_SAW
,WAVE_SHAPE_SINE_HARM
,WAVE_SHAPE_SINE_SAW_CHORD
,WAVE_SHAPE_SINE_SAW_HARM
};
......@@ -66,8 +67,8 @@ void makewave(double freq, unsigned char *wave, int samples)
break;
case WAVE_SHAPE_SINE_HARM:
wave[i]=(sin (pos))*64+128;
wave[i]=(sin ((inc/2)*(double)i))*24+128;
wave[i]=(sin ((inc/3)*(double)i))*16+128;
wave[i]=(sin ((inc*2)*(double)i))*24+128;
wave[i]=(sin ((inc*3)*(double)i))*16+128;
break;
case WAVE_SHAPE_SAWTOOTH:
wave[i]=(WAVE_TPI-pos)*40.5;
......@@ -78,11 +79,16 @@ void makewave(double freq, unsigned char *wave, int samples)
case WAVE_SHAPE_SINE_SAW:
wave[i]=(((sin (pos))*127+128)+((WAVE_TPI-pos)*40.5))/2;
break;
case WAVE_SHAPE_SINE_SAW_HARM:
case WAVE_SHAPE_SINE_SAW_CHORD:
wave[i]=(((sin (pos))*64+128)+((WAVE_TPI-pos)*6.2))/2;
wave[i]+=(sin ((inc/2)*(double)i))*24+128;
wave[i]+=(sin ((inc/3)*(double)i))*16+128;
break;
case WAVE_SHAPE_SINE_SAW_HARM:
wave[i]=(((sin (pos))*64+128)+((WAVE_TPI-pos)*6.2))/2;
wave[i]+=(sin ((inc*2)*(double)i))*24+128;
wave[i]+=(sin ((inc*3)*(double)i))*16+128;
break;
}
}
......
......@@ -4,7 +4,7 @@
#include "gen_defs.h"
#if defined(_WIN32)
#if 0
#if 1
#define BEEP(freq,dur) xpbeep((double)(freq),(DWORD)(dur))
#else
#define BEEP(freq,dur) Beep((DWORD)(freq),(DWORD)(dur))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment