summaryrefslogtreecommitdiff
path: root/synth/defines.h
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-02-12 16:02:01 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-02-12 16:02:01 +0100
commitd4e928c4eecdcb12ebc96054c92cfc7b701c9a83 (patch)
tree51114a0abd08b7fd4343fcf3093aea563cd7adde /synth/defines.h
parentf8f00a7afde4c534fe47ddf47673167edae4f33e (diff)
Sawtooth and pulse-waves have now variable phases
for sawtooth, the ratio rising:falling phase is adjustable for pulse, the ratio high:low is adjustable
Diffstat (limited to 'synth/defines.h')
-rw-r--r--synth/defines.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/synth/defines.h b/synth/defines.h
index fb1d63b..1ec5b18 100644
--- a/synth/defines.h
+++ b/synth/defines.h
@@ -56,7 +56,34 @@ extern float LFO_FREQ_HZ[];
#define WAVE_RES 44100
-#define N_WAVEFORMS 8
+
+
+// saw_start must be >= n_normal
+// pulse_start must be > saw_end
+// holes are allowed
+
+// 0..6 different stuff
+// 10..19 saw
+// 20..29 square is allowed, for example
+
+//SAW_N and PULSE_N should be odd numbers, otherwise you won't
+//get equal ratios for falling/rising or high/low
+//in english: you won't get a "normal" triangle wave or a "normal"
+// square wave then
+#define N_NORMAL_WAVEFORMS 6
+#define WAVE_SAW_START 100
+#define WAVE_SAW_N 201
+#define WAVE_PULSE_START 400
+#define WAVE_PULSE_N 201
+
+#if ( (WAVE_SAW_START < N_NORMAL_WAVEFORMS) || \
+ (WAVE_PULSE_START < WAVE_SAW_START+WAVE_SAW_N) )
+ #error NORMAL WAVEFORMS, SAW- AND PULSE-WAVES MAY NOT OVERLAP!
+#endif
+
+#define N_WAVEFORMS (WAVE_PULSE_START+WAVE_PULSE_N)
+
+
#define NO_CONT 128