Cleanup and added peak detection counter.

pull/4/head
Holger Wirtz 6 years ago
parent d2052dc28f
commit 892f3f66db
  1. 17
      MicroDexed.ino
  2. 13
      dexed.cpp
  3. 11
      dexed.h
  4. 5
      dexed_sysex.cpp
  5. 4
      dexed_sysex.h

@ -2,7 +2,8 @@
MicroDexed
MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield. Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018 H. Wirtz <wirtz@parasitstudio.de>
@ -54,11 +55,13 @@ Bounce but1 = Bounce(BUT1_PIN, 10); // 10 ms debounce
AudioPlayQueue queue1; //xy=708,349
AudioAmplifier amp1; //xy=904,314
AudioAmplifier amp2; //xy=909,373
AudioAnalyzePeak peak1; //xy=909,436
AudioOutputI2S i2s1; //xy=1055,343
AudioConnection patchCord1(queue1, amp1);
AudioConnection patchCord2(queue1, amp2);
AudioConnection patchCord3(amp1, 0, i2s1, 0);
AudioConnection patchCord4(amp2, 0, i2s1, 1);
AudioConnection patchCord3(queue1, peak1);
AudioConnection patchCord4(amp1, 0, i2s1, 0);
AudioConnection patchCord5(amp2, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=1055,398
// GUItool: end automatically generated code
@ -69,6 +72,7 @@ uint8_t bank = EEPROM.read(EEPROM_BANK_ADDR);
uint8_t midi_channel = DEFAULT_MIDI_CHANNEL;
uint32_t xrun = 0;
uint32_t overload = 0;
uint32_t peak = 0;
uint16_t render_time_max = 0;
#ifdef MASTER_KEY_MIDI
@ -222,6 +226,11 @@ void loop()
xrun++;
if (t2 > render_time_max)
render_time_max = t2;
if (peak1.available())
{
if (peak1.read() > 0.99)
peak++;
}
queue1.playBuffer();
}
}
@ -602,6 +611,8 @@ void show_cpu_and_mem_usage(void)
Serial.print(xrun, DEC);
Serial.print(F(" OVERLOAD: "));
Serial.print(overload, DEC);
Serial.print(F(" PEAK: "));
Serial.print(peak, DEC);
Serial.println();
AudioProcessorUsageMaxReset();
AudioMemoryUsageMaxReset();

@ -2,7 +2,8 @@
MicroDexed
MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield. Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018 H. Wirtz <wirtz@parasitstudio.de>
@ -38,16 +39,6 @@
#include <Audio.h>
#endif
extern uint8_t bank;
extern uint32_t overload;
extern bool load_sysex(uint8_t bank, uint8_t voice_number);
extern AudioControlSGTL5000 sgtl5000_1;
extern AudioAmplifier amp1;
extern AudioAmplifier amp2;
extern AudioEffectFreeverbStereo freeverbs1;
extern AudioAmplifier amp1;
extern AudioAmplifier amp2;
Dexed::Dexed(int rate)
{
uint8_t i;

@ -2,7 +2,8 @@
MicroDexed
MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield. Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018 H. Wirtz <wirtz@parasitstudio.de>
@ -33,6 +34,14 @@
#include "fm_core.h"
#include "EngineMkI.h"
#include "EngineOpl.h"
#include <Audio.h>
extern uint8_t bank;
extern uint32_t overload;
extern bool load_sysex(uint8_t bank, uint8_t voice_number);
extern AudioControlSGTL5000 sgtl5000_1;
extern AudioAmplifier amp1;
extern AudioAmplifier amp2;
struct ProcessorVoice {
uint8_t midi_note;

@ -2,7 +2,8 @@
MicroDexed
MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield. Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018 H. Wirtz <wirtz@parasitstudio.de>
@ -30,8 +31,6 @@
#include "dexed_sysex.h"
#include "config.h"
extern uint16_t render_time_max;
bool load_sysex(uint8_t bank, uint8_t voice_number)
{
File root;

@ -2,7 +2,8 @@
MicroDexed
MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield. Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018 H. Wirtz <wirtz@parasitstudio.de>
@ -24,6 +25,7 @@
extern bool sd_card_available;
extern Dexed* dexed;
extern uint16_t render_time_max;
bool load_sysex(uint8_t bank, uint8_t voice_number);
bool get_sysex_voice(char* dir, File sysex, uint8_t voice_number, uint8_t* data);

Loading…
Cancel
Save