diff --git a/src/configuration.h b/src/configuration.h index 7e347d6..b7b90d9 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -48,7 +48,7 @@ void load_config(){ strcpy(configuration.softness.ui_type_string, "s"); configuration.softness.type = f32; configuration.softness.ui_type = ui_type_slider; - configuration.softness.value.f32 = 0.25; + configuration.softness.value.f32 = 0.0; //configuration.softness.value.f32 = preferences.getFloat(configuration.softness.name, 0.25); // Color @@ -103,8 +103,7 @@ void load_config(){ strcpy(configuration.background.ui_type_string, "s"); configuration.background.type = f32; configuration.background.ui_type = ui_type_slider; - configuration.background.value.f32 = 0.2 - ; + configuration.background.value.f32 = 0.0; //configuration.background.value.f32 = preferences.getFloat(configuration.background.name, 0.25); // Current Mode diff --git a/src/global_defines.h b/src/global_defines.h index a878f5b..2ecd8f5 100644 --- a/src/global_defines.h +++ b/src/global_defines.h @@ -31,7 +31,7 @@ #define NUM_TEMPI (96) // BPM range -#define TEMPO_LOW (32) +#define TEMPO_LOW (48) #define TEMPO_HIGH (TEMPO_LOW + NUM_TEMPI) // How far forward or back in time the beat phase is shifted diff --git a/src/leds.h b/src/leds.h index 271bf3f..8712adc 100644 --- a/src/leds.h +++ b/src/leds.h @@ -421,9 +421,9 @@ void draw_line(CRGBF* layer, float x1, float x2, CRGBF color, float opacity) { layer[i].b += color.b * mix; } else { // Blend mode: Mix color - layer[i].r = layer[i].r * (1.0 - mix) + color.r * mix; - layer[i].g = layer[i].g * (1.0 - mix) + color.g * mix; - layer[i].b = layer[i].b * (1.0 - mix) + color.b * mix; + //layer[i].r = layer[i].r * (1.0 - mix) + color.r * mix; + //layer[i].g = layer[i].g * (1.0 - mix) + color.g * mix; + //layer[i].b = layer[i].b * (1.0 - mix) + color.b * mix; } } } diff --git a/src/light_modes/active/metronome.h b/src/light_modes/active/metronome.h index 97eb46c..c8ad0e0 100644 --- a/src/light_modes/active/metronome.h +++ b/src/light_modes/active/metronome.h @@ -23,7 +23,7 @@ void draw_metronome() { metronome_width = 1.0; } - float dot_pos = clip_float( sine * (0.5*(sqrt((contribution))) * metronome_width) + 0.5 ); + float dot_pos = clip_float( sine * (0.5*(sqrt(sqrt((contribution)))) * metronome_width) + 0.5 ); float opacity = clip_float(contribution*2.0); diff --git a/src/microphone.h b/src/microphone.h index f7ee493..1fa5c2b 100644 --- a/src/microphone.h +++ b/src/microphone.h @@ -49,12 +49,12 @@ __attribute__((aligned(16))) float fft_output[FFT_SIZE]; __attribute__((aligned(16))) -float fft_max[FFT_SIZE];+* +float fft_max[FFT_SIZE]; void perform_fft(){ memset(fft_input_complex, 0, sizeof(float) * (FFT_SIZE << 1)); - const uint8_t step_size = 4; + const uint8_t step_size = 3; for(uint16_t i = 0; i < FFT_SIZE; i++){ fft_input[i] = sample_history[((SAMPLE_HISTORY_LENGTH-1) - (FFT_SIZE*step_size)) + i*step_size ]; } @@ -73,9 +73,12 @@ void perform_fft(){ // Calculate the magnitude of the complex numbers and convert to 0.0 to 1.0 range for (uint16_t i = 0 ; i < FFT_SIZE; i++) { + float progress = (float)i / FFT_SIZE; float real = fft_input_complex[i << 1]; float imag = fft_input_complex[(i << 1) + 1]; fft_output[i] = sqrtf(real * real + imag * imag) / (FFT_SIZE >> 1); + fft_output[i] = fft_output[i]*(0.5+0.5*progress); + fft_max[i] = fmaxf(fft_max[i], fft_output[i]); } } diff --git a/src/tempo.h b/src/tempo.h index 533629a..a97bb3f 100644 --- a/src/tempo.h +++ b/src/tempo.h @@ -202,8 +202,8 @@ void calculate_tempi_magnitudes(int16_t single_bin = -1) { } } - if (max_val < 0.02) { - max_val = 0.02; + if (max_val < 0.01) { + max_val = 0.01; } float autoranger_scale = 1.0 / (max_val);