From 4587d53751ab417393b797311c80f4c025785107 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 1 Apr 2013 22:18:33 +0000 Subject: experimental settings, adjust discolight frequencies --- spectrogram.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/spectrogram.c b/spectrogram.c index 7062a96..a97a646 100644 --- a/spectrogram.c +++ b/spectrogram.c @@ -47,11 +47,14 @@ SDL_Rect wf_left, wf_right; /* waterfall */ SDL_Rect sp_left, sp_right; /* spectrogram */ SDL_Rect dl_lo, dl_mi, dl_hi; /* disco light */ -/* Disco Light Frequencies - * LOW 50-800 Hz - * MID 500-2000 Hz - * HI 1500-5000 Hz - */ +/* Disco Light Frequencies, Hz */ + +#define LOSTART 50 +#define LOEND 350 +#define MISTART 200 +#define MIEND 2000 +#define HISTART 1500 +#define HIEND 5000 int die = 0; int flip_left = 1; @@ -167,11 +170,11 @@ draw(double *left, double *right, int p, int step) if (discolight) { av = pow(left[x] + right[x], 2.0); - if (x >= 50 / step && x <= 800 / step) + if (x >= LOSTART / step && x <= LOEND / step) lo += av; - if (x >= 500 / step && x <= 2000 / step) + if (x >= MISTART / step && x <= MIEND / step) mi += av; - if (x >= 1500 / step && x <= 5000 / step) + if (x >= HISTART / step && x <= HIEND / step) hi += av; } @@ -193,13 +196,13 @@ draw(double *left, double *right, int p, int step) /* XXX */ if (discolight) { - lo = sqrt(lo / (750 / step)); + lo = sqrt(lo / ((LOEND - LOSTART) / step)); if (lo > p) lo = p; - mi = sqrt(mi / (1500 / step)); + mi = sqrt(mi / ((MIEND - MISTART) / step)); if (mi > p) mi = p; - hi = sqrt(hi / (3500 / step)); + hi = sqrt(hi / ((HIEND - HISTART) / step)); if (hi > p) hi = p; -- cgit v1.2.3