Moving several functions to FLASHMEM.

dev
Holger Wirtz 4 months ago
parent 136fec3f86
commit 974e8f897e
  1. 8
      MicroDexed.ino
  2. 508
      UI.hpp
  3. 16
      control_sgtl5000plus.cpp
  4. 16
      control_sgtl5000plus.h

@ -1180,7 +1180,7 @@ void handleControlChange(uint8_t inChannel, uint8_t inCtrl, uint8_t inValue) {
break;
case 103: // CC 103: filter resonance
configuration.fx.filter_resonance[instance_id] = map(inValue, 0, 0x7f, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX);
MicroDexed[instance_id]->setFilterResonance(mapfloat(configuration.fx.filter_resonance[instance_id], FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0));
//MicroDexed[instance_id]->setFilterResonance(mapfloat(configuration.fx.filter_resonance[instance_id], FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0));
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_filter_resonance)) {
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
@ -1188,7 +1188,7 @@ void handleControlChange(uint8_t inChannel, uint8_t inCtrl, uint8_t inValue) {
break;
case 104: // CC 104: filter cutoff
configuration.fx.filter_cutoff[instance_id] = map(inValue, 0, 0x7f, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX);
MicroDexed[instance_id]->setFilterCutoff(mapfloat(configuration.fx.filter_cutoff[instance_id], FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0));
//MicroDexed[instance_id]->setFilterCutoff(mapfloat(configuration.fx.filter_cutoff[instance_id], FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0));
;
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_filter_cutoff)) {
LCDML.OTHER_updateFunc();
@ -2046,8 +2046,8 @@ void set_fx_params(void) {
reverb_mixer_l.gain(instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT)));
// DEXED FILTER
MicroDexed[instance_id]->setFilterResonance(mapfloat(configuration.fx.filter_resonance[instance_id], FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0));
MicroDexed[instance_id]->setFilterCutoff(mapfloat(configuration.fx.filter_cutoff[instance_id], FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0));
//MicroDexed[instance_id]->setFilterResonance(mapfloat(configuration.fx.filter_resonance[instance_id], FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0));
//MicroDexed[instance_id]->setFilterCutoff(mapfloat(configuration.fx.filter_cutoff[instance_id], FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0));
MicroDexed[instance_id]->doRefreshVoice();
}

508
UI.hpp

File diff suppressed because it is too large Load Diff

@ -27,7 +27,7 @@
#include <Audio.h>
#include "control_sgtl5000plus.h"
void AudioControlSGTL5000Plus::init_parametric_eq(uint8_t n)
FLASHMEM void AudioControlSGTL5000Plus::init_parametric_eq(uint8_t n)
{
num_bands = constrain(n, 1, 7);
@ -102,7 +102,7 @@ void AudioControlSGTL5000Plus::init_parametric_eq(uint8_t n)
}
}
void AudioControlSGTL5000Plus::setEQType(uint8_t band, uint8_t ft)
FLASHMEM void AudioControlSGTL5000Plus::setEQType(uint8_t band, uint8_t ft)
{
if (filter_type && _enabled != false)
{
@ -111,7 +111,7 @@ void AudioControlSGTL5000Plus::setEQType(uint8_t band, uint8_t ft)
}
}
void AudioControlSGTL5000Plus::setEQFc(uint8_t band, float frq)
FLASHMEM void AudioControlSGTL5000Plus::setEQFc(uint8_t band, float frq)
{
if (Fc && _enabled != false)
{
@ -120,7 +120,7 @@ void AudioControlSGTL5000Plus::setEQFc(uint8_t band, float frq)
}
}
void AudioControlSGTL5000Plus::setEQQ(uint8_t band, float q)
FLASHMEM void AudioControlSGTL5000Plus::setEQQ(uint8_t band, float q)
{
if (Q && _enabled != false)
{
@ -131,7 +131,7 @@ void AudioControlSGTL5000Plus::setEQQ(uint8_t band, float q)
// Calculate Q: http://www.sengpielaudio.com/calculator-bandwidth.htm
// http://jdm12.ch/Audio/EQ_BPF-Q-bandwidth.asp
void AudioControlSGTL5000Plus::setEQBandwidth(uint8_t band, float bw)
FLASHMEM void AudioControlSGTL5000Plus::setEQBandwidth(uint8_t band, float bw)
{
if (Q && Fc && _enabled != false)
{
@ -140,7 +140,7 @@ void AudioControlSGTL5000Plus::setEQBandwidth(uint8_t band, float bw)
}
}
void AudioControlSGTL5000Plus::setEQGain(uint8_t band, float gain)
FLASHMEM void AudioControlSGTL5000Plus::setEQGain(uint8_t band, float gain)
{
if (peakGainDB && _enabled != false)
{
@ -149,7 +149,7 @@ void AudioControlSGTL5000Plus::setEQGain(uint8_t band, float gain)
}
}
void AudioControlSGTL5000Plus::commitFilter(uint8_t band)
FLASHMEM void AudioControlSGTL5000Plus::commitFilter(uint8_t band)
{
int filter[5] = {0, 0, 0, 0, 0};
@ -162,7 +162,7 @@ void AudioControlSGTL5000Plus::commitFilter(uint8_t band)
eqFilter(band, filter);
}
void AudioControlSGTL5000Plus::show_params(uint8_t band)
FLASHMEM void AudioControlSGTL5000Plus::show_params(uint8_t band)
{
if (_enabled == false)
{

@ -63,14 +63,14 @@ class AudioControlSGTL5000Plus : public AudioControlSGTL5000
_enabled = false;
num_bands = constrain(n, 1, 7);
};
void setEQType(uint8_t band, uint8_t ft);
void setEQFc(uint8_t band, float frq);
void setEQQ(uint8_t band, float q);
void setEQBandwidth(uint8_t band, float bw);
void setEQGain(uint8_t band, float gain);
void commitFilter(uint8_t band);
void show_params(uint8_t band);
void init_parametric_eq(uint8_t n = 7);
FLASHMEM void setEQType(uint8_t band, uint8_t ft);
FLASHMEM void setEQFc(uint8_t band, float frq);
FLASHMEM void setEQQ(uint8_t band, float q);
FLASHMEM void setEQBandwidth(uint8_t band, float bw);
FLASHMEM void setEQGain(uint8_t band, float gain);
FLASHMEM void commitFilter(uint8_t band);
FLASHMEM void show_params(uint8_t band);
FLASHMEM void init_parametric_eq(uint8_t n = 7);
private:
bool _enabled;

Loading…
Cancel
Save