From 2bb479031e69223453488647ee705f2a8ab8810f Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Wed, 27 Dec 2017 16:34:59 +0300 Subject: [PATCH] Possible issue with sfx: Bass tones sounds high #438 --- src/tic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tic.c b/src/tic.c index 8b76265..bc05039 100644 --- a/src/tic.c +++ b/src/tic.c @@ -38,7 +38,6 @@ #define MAX_PERIOD_VALUE 4096 #define BASE_NOTE_FREQ 440.0 #define BASE_NOTE_POS 49.0 -#define ENVELOPE_FREQ_SCALE 2 #define NOTES_PER_MUNUTE (TIC_FRAMERATE / NOTES_PER_BEET * 60) #define min(a,b) ((a) < (b) ? (a) : (b)) #define max(a,b) ((a) > (b) ? (a) : (b)) @@ -103,7 +102,7 @@ static inline s32 freq2period(double freq) { if(freq == 0.0) return MAX_PERIOD_VALUE; - enum {Rate = CLOCKRATE * ENVELOPE_FREQ_SCALE / ENVELOPE_VALUES}; + enum {Rate = CLOCKRATE / ENVELOPE_VALUES}; s32 period = round((double)Rate / freq - 1.0); if(period < MIN_PERIOD_VALUE) return MIN_PERIOD_VALUE; @@ -121,7 +120,7 @@ static inline s32 getAmp(const tic_sound_register* reg, s32 amp) static void runEnvelope(blip_buffer_t* blip, tic_sound_register* reg, tic_sound_register_data* data, s32 end_time ) { - s32 period = freq2period(reg->freq * ENVELOPE_FREQ_SCALE); + s32 period = freq2period(reg->freq); for ( ; data->time < end_time; data->time += period ) { @@ -1548,7 +1547,7 @@ static void api_tick(tic_mem* tic, tic_tick_data* data) cart2ram(tic); tic->input.data = 0; - + if(compareMetatag(code, "input", "mouse", config->singleComment)) tic->input.mouse = 1; else if(compareMetatag(code, "input", "gamepad", config->singleComment))