diff --git a/embeddedcommon/DFT32.c b/embeddedcommon/DFT32.c index 5e5dc8d..67b8aad 100644 --- a/embeddedcommon/DFT32.c +++ b/embeddedcommon/DFT32.c @@ -159,7 +159,7 @@ static uint16_t SquareRootRounded(uint32_t a_nInput) void UpdateOutputBins32() { int i; - int * ipt = &Sdatspace32BOut[0]; + int32_t * ipt = &Sdatspace32BOut[0]; for( i = 0; i < FIXBINS; i++ ) { int16_t isps = *(ipt++)>>16; diff --git a/embeddedcommon/embeddednf.h b/embeddedcommon/embeddednf.h index 4619300..c1f2f1f 100644 --- a/embeddedcommon/embeddednf.h +++ b/embeddedcommon/embeddednf.h @@ -42,7 +42,7 @@ //the response for the slow-response, or what we use to determine size of //splotches, AMP 2 is the quick response, or what we use to see the visual //strength of the notes. -#define AMP_1_IIR_BITS 5 +#define AMP_1_IIR_BITS 4 #define AMP_2_IIR_BITS 2 //This is the amplitude, coming from folded_bins. If the value is below this diff --git a/embeddedcommon/embeddedout.c b/embeddedcommon/embeddedout.c index f4eb756..5712a19 100644 --- a/embeddedcommon/embeddedout.c +++ b/embeddedcommon/embeddedout.c @@ -90,6 +90,7 @@ void UpdateLinearLEDs() local_peak_amps[i] = note_peak_amps[sorted_note_map[i]] - note_nerf_a; local_peak_amps2[i] = note_peak_amps2[sorted_note_map[i]]; local_peak_freq[i] = note_peak_freqs[sorted_note_map[i]]; +// printf( "%5d ", local_peak_amps[i] ); } // printf( "\n" ); @@ -109,12 +110,13 @@ void UpdateLinearLEDs() return; } - uint32_t porportional = (uint32_t)(NUM_LIN_LEDS<<8)/((uint32_t)total_size_all_notes); + uint32_t porportional = (uint32_t)(NUM_LIN_LEDS<<16)/((uint32_t)total_size_all_notes); + uint16_t total_accounted_leds = 0; for( i = 0; i < sorted_map_count; i++ ) { - porpamps[i] = (local_peak_amps[i] * porportional) >> 8; + porpamps[i] = (local_peak_amps[i] * porportional) >> 16; total_accounted_leds += porpamps[i]; } diff --git a/embeddedcommon/embeddedout.h b/embeddedcommon/embeddedout.h index 8a9685f..3985569 100644 --- a/embeddedcommon/embeddedout.h +++ b/embeddedcommon/embeddedout.h @@ -10,7 +10,9 @@ //Controls, basically, the minimum size of the splotches. #define NERF_NOTE_PORP 15 //value from 0 to 255 +#ifndef NUM_LIN_LEDS #define NUM_LIN_LEDS 296 +#endif #define LIN_WRAPAROUND 0 //Whether the output lights wrap around. #define SORT_NOTES 0 //Whether the notes will be sorted.