Merge pull request #90 from bbkiwi/masterfix

Bug fix broken code when APPROXNORM 1 and also bug fix for SORT_NOTES option.
This commit is contained in:
CNLohr 2019-05-23 19:25:14 -04:00 committed by GitHub
commit ab11048f10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View file

@ -6,9 +6,9 @@
#define HPABUFFSIZE 512 #define HPABUFFSIZE 512
#define CCEMBEDDED #define CCEMBEDDED
#define NUM_LIN_LEDS 541 #define NUM_LIN_LEDS 16
#define DFREQ 16000 #define DFREQ 16000
#define LUXETRON 0
#define memcpy ets_memcpy #define memcpy ets_memcpy
#define memset ets_memset #define memset ets_memset

View file

@ -45,9 +45,8 @@ Extra copyright info:
//Creates an I2S SR of 93,750 Hz, or 3 MHz Bitclock (.333us/sample) //Creates an I2S SR of 93,750 Hz, or 3 MHz Bitclock (.333us/sample)
// 12000000L/(div*bestbck*2) // 12000000L/(div*bestbck*2)
//It is likely you could speed this up a little. //It is likely you could speed this up a little.
#define LUXETRON
#ifdef LUXETRON #if LUXETRON == 1
#define INVERT #define INVERT
#define WS_I2S_BCK 14 #define WS_I2S_BCK 14
#define WS_I2S_DIV 5 #define WS_I2S_DIV 5

View file

@ -192,6 +192,7 @@ void UpdateOutputBins32()
isps = isps<0? -isps : isps; isps = isps<0? -isps : isps;
ispc = ispc<0? -ispc : ispc; ispc = ispc<0? -ispc : ispc;
uint32_t rmux = isps>ispc? isps + (ispc>>1) : ispc + (isps>>1); uint32_t rmux = isps>ispc? isps + (ispc>>1) : ispc + (isps>>1);
rmux = rmux>>16;
#else #else
uint32_t rmux = ( (isps) * (isps)) + ((ispc) * (ispc)); uint32_t rmux = ( (isps) * (isps)) + ((ispc) * (ispc));
rmux = SquareRootRounded( rmux ); rmux = SquareRootRounded( rmux );

View file

@ -61,17 +61,17 @@ void UpdateLinearLEDs()
{ {
if( note_peak_freqs[ sorted_note_map[j] ] > nff ) if( note_peak_freqs[ sorted_note_map[j] ] > nff )
{ {
break; break; // so j is correct place to insert
} }
} }
for( k = sorted_map_count; k > j; k-- ) for( k = sorted_map_count; k > j; k-- ) // make room
{ {
sorted_note_map[k] = sorted_note_map[k-1]; sorted_note_map[k] = sorted_note_map[k-1];
} }
sorted_note_map[j] = i; sorted_note_map[j] = i; // insert in correct place
#else #else
sorted_note_map[sorted_map_count] = i; // insert at end
#endif #endif
sorted_note_map[sorted_map_count] = i;
sorted_map_count++; sorted_map_count++;
} }