Fix: Allow variable #'s of LEDs.
Fix: Don't snuff out the porportional control, otherwise LEDs don't know how to share. Fix: Speed up the amp1 IIR.
This commit is contained in:
parent
000261ace5
commit
91d8502d23
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue