Fixing signed_saturate_rshift() usage.

pull/32/head
Holger Wirtz 5 years ago
parent 656f139145
commit f49205b964
  1. 7
      MicroDexed.ino
  2. 2
      config.h
  3. 4
      dexed.cpp

@ -2054,13 +2054,11 @@ void show_cpu_and_mem_usage(void)
{ {
uint32_t sum_xrun = 0; uint32_t sum_xrun = 0;
uint16_t sum_render_time_max = 0; uint16_t sum_render_time_max = 0;
uint32_t sum_overload = 0;
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{ {
sum_xrun += MicroDexed[instance_id]->xrun; sum_xrun += MicroDexed[instance_id]->xrun;
sum_render_time_max += MicroDexed[instance_id]->render_time_max; sum_render_time_max += MicroDexed[instance_id]->render_time_max;
sum_overload += MicroDexed[instance_id]->overload;
MicroDexed[instance_id]->render_time_max = 0; MicroDexed[instance_id]->render_time_max = 0;
} }
if (AudioProcessorUsageMax() > 99.9) if (AudioProcessorUsageMax() > 99.9)
@ -2087,10 +2085,7 @@ void show_cpu_and_mem_usage(void)
Serial.print(sum_render_time_max, DEC); Serial.print(sum_render_time_max, DEC);
Serial.print(F("|XRUN:")); Serial.print(F("|XRUN:"));
Serial.print(sum_xrun, DEC); Serial.print(sum_xrun, DEC);
Serial.print(F("|OVERLOAD:")); Serial.print(F("|PEAKR:"));
Serial.println(sum_overload, DEC);
Serial.print(F("PEAKR:"));
Serial.print(peak_r, DEC); Serial.print(peak_r, DEC);
Serial.print(F("|PEAKL:")); Serial.print(F("|PEAKL:"));
Serial.print(peak_l, DEC); Serial.print(peak_l, DEC);

@ -84,7 +84,7 @@
//************************************************************************************************* //*************************************************************************************************
//* DEBUG OUTPUT SETTINGS //* DEBUG OUTPUT SETTINGS
//************************************************************************************************* //*************************************************************************************************
//#define DEBUG 1 #define DEBUG 1
#define SERIAL_SPEED 230400 #define SERIAL_SPEED 230400
#define SHOW_XRUN 1 #define SHOW_XRUN 1
#define SHOW_CPU_LOAD_MSEC 5000 #define SHOW_CPU_LOAD_MSEC 5000

@ -148,10 +148,8 @@ void Dexed::getSamples(uint16_t n_samples, int16_t* buffer)
for (j = 0; j < _N_; ++j) for (j = 0; j < _N_; ++j)
{ {
//sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j] >> 4, 24, 9)) / 0x8000;
//sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j] >> 5, 24, 9)) / 0x8000; //sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j] >> 5, 24, 9)) / 0x8000;
sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j], 32, 12)) / 0x8000; sumbuf[i + j] += signed_saturate_rshift(audiobuf.get()[j] >> 4, 24, 9) / 32768.0;
//sumbuf[i + j] += static_cast<float>(audiobuf.get()[j] / 0x8000);
audiobuf.get()[j] = 0; audiobuf.get()[j] = 0;
} }
} }

Loading…
Cancel
Save