Small changes while hunting for the reboot error under Teensyduino-1.59.0

dev
Holger Wirtz 9 months ago
parent 0426342dde
commit fe256cd8c8
  1. 15
      MicroDexed.ino
  2. 4
      config.h
  3. 8
      midi_devices.hpp
  4. 32
      third-party/effect_modulated_delay/src/effect_modulated_delay.h

@ -514,16 +514,18 @@ void setup() {
// Setup EPiano // Setup EPiano
// EP_CHORUS // EP_CHORUS
ep_delayline_r = (int16_t*)malloc(MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t)); //ep_delayline_r = (int16_t*)malloc(MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t));
if (ep_delayline_r == NULL) { ep_delayline_r = new int16_t[MOD_DELAY_SAMPLE_BUFFER];
if (!ep_delayline_r) {
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("AudioEffectModulatedDelay R - memory allocation failed EP")); Serial.println(F("AudioEffectModulatedDelay R - memory allocation failed EP"));
#endif #endif
while (1) while (1)
; ;
} }
ep_delayline_l = (int16_t*)malloc(MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t)); //ep_delayline_l = (int16_t*)malloc(MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t));
if (ep_delayline_l == NULL) { ep_delayline_l = new int16_t[MOD_DELAY_SAMPLE_BUFFER];
if (!ep_delayline_l) {
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("AudioEffectModulatedDelay L - memory allocation failed EP")); Serial.println(F("AudioEffectModulatedDelay L - memory allocation failed EP"));
#endif #endif
@ -557,8 +559,9 @@ void setup() {
// Setup effects // Setup effects
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) {
delayline[instance_id] = (int16_t*)malloc(MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t)); //delayline[instance_id] = (int16_t*)malloc(MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t));
if (delayline[instance_id] != NULL) { delayline[instance_id] = new int16_t[MOD_DELAY_SAMPLE_BUFFER];
if (delayline[instance_id]) {
memset(delayline[instance_id], 0, MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t)); memset(delayline[instance_id], 0, MOD_DELAY_SAMPLE_BUFFER * sizeof(int16_t));
if (!modchorus[instance_id]->begin(delayline[instance_id], MOD_DELAY_SAMPLE_BUFFER)) { if (!modchorus[instance_id]->begin(delayline[instance_id], MOD_DELAY_SAMPLE_BUFFER)) {
#ifdef DEBUG #ifdef DEBUG

@ -132,8 +132,8 @@
// CHORUS parameters // CHORUS parameters
#define MOD_DELAY_SAMPLE_BUFFER int32_t(TIME_MS2SAMPLES(15.0)) // 15.0 ms delay buffer. #define MOD_DELAY_SAMPLE_BUFFER int32_t(TIME_MS2SAMPLES(15.0)) // 15.0 ms delay buffer.
#define MOD_WAVEFORM WAVEFORM_TRIANGLE // WAVEFORM_SINE WAVEFORM_TRIANGLE WAVEFORM_SAWTOOTH WAVEFORM_SAWTOOTH_REVERSE #define MOD_WAVEFORM WAVEFORM_TRIANGLE // WAVEFORM_SINE WAVEFORM_TRIANGLE WAVEFORM_SAWTOOTH WAVEFORM_SAWTOOTH_REVERSE
//#define MOD_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT // MOD_LINKWITZ_RILEY_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT #define MOD_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT // MOD_LINKWITZ_RILEY_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT
#define MOD_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT // MOD_LINKWITZ_RILEY_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT //#define MOD_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT // MOD_LINKWITZ_RILEY_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT
#define MOD_FILTER_CUTOFF_HZ 2000 #define MOD_FILTER_CUTOFF_HZ 2000
// SGTL5000 // SGTL5000

@ -1,10 +1,12 @@
/* /*
MicroDexed MicroDexed
MicroMDAEPiano is a port of the MDA-EPiano sound engine MicroDexed is a port of the Dexed sound engine
(https://sourceforge.net/projects/mda-vst/) for the Teensy-3.5/3.6/4.x with audio shield. (https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6/4.x with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2019-2023 H. Wirtz <wirtz@parasitstudio.de> (c)2018-2023 H. Wirtz <wirtz@parasitstudio.de>
(c)2021-2022 H. Wirtz <wirtz@parasitstudio.de>, M. Koslowski <positionhigh@gmx.de>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

@ -33,8 +33,7 @@
// 140219 - correct storage class (not static) // 140219 - correct storage class (not static)
// 190527 - added modulation input handling (Aug 2019 by Holger Wirtz) // 190527 - added modulation input handling (Aug 2019 by Holger Wirtz)
class AudioEffectModulatedDelay : class AudioEffectModulatedDelay : public AudioStream
public AudioStream
{ {
public: public:
AudioEffectModulatedDelay(void): AudioEffectModulatedDelay(void):
@ -42,10 +41,10 @@ class AudioEffectModulatedDelay :
{ } { }
boolean begin(short *delayline, uint16_t delay_length); boolean begin(short *delayline, uint16_t delay_length);
virtual void update(void); void update(void);
virtual uint16_t get_delay_length(void); uint16_t get_delay_length(void);
virtual void set_bypass(bool b); void set_bypass(bool b);
virtual bool get_bypass(void); bool get_bypass(void);
private: private:
audio_block_t *inputQueueArray[2]; audio_block_t *inputQueueArray[2];
@ -54,11 +53,10 @@ class AudioEffectModulatedDelay :
uint16_t _delay_length; // calculated number of samples of the delay uint16_t _delay_length; // calculated number of samples of the delay
int16_t cb_mod_index; // current read pointer with modulation for the circular buffer int16_t cb_mod_index; // current read pointer with modulation for the circular buffer
uint16_t _delay_offset; uint16_t _delay_offset;
bool bypass; bool bypass = false;
}; };
class AudioEffectModulatedDelayStereo : class AudioEffectModulatedDelayStereo : public AudioStream
public AudioStream
{ {
public: public:
AudioEffectModulatedDelayStereo(void): AudioEffectModulatedDelayStereo(void):
@ -66,12 +64,12 @@ class AudioEffectModulatedDelayStereo :
{ } { }
boolean begin(short *delayline_l, short *delayline_r, uint16_t delay_length); boolean begin(short *delayline_l, short *delayline_r, uint16_t delay_length);
virtual void update(void); void update(void);
virtual uint16_t get_delay_length(void); uint16_t get_delay_length(void);
virtual void set_stereo(bool s); void set_stereo(bool s);
virtual bool get_stereo(void); bool get_stereo(void);
virtual void set_bypass(bool b); void set_bypass(bool b);
virtual bool get_bypass(void); bool get_bypass(void);
private: private:
audio_block_t *inputQueueArray[3]; audio_block_t *inputQueueArray[3];
@ -80,7 +78,7 @@ class AudioEffectModulatedDelayStereo :
uint16_t _delay_length; // calculated number of samples of the delay uint16_t _delay_length; // calculated number of samples of the delay
int16_t cb_mod_index[2]; // current read pointer with modulation for the circular buffer int16_t cb_mod_index[2]; // current read pointer with modulation for the circular buffer
uint16_t _delay_offset; uint16_t _delay_offset;
bool stereo; bool stereo = true;
bool bypass; bool bypass = false;
}; };
#endif #endif

Loading…
Cancel
Save