Fixed portamento glissango mode.

Fixing display values for fx storage place.
pull/32/head
Holger Wirtz 5 years ago
parent af91adffcd
commit 161f77c3e2
  1. 4
      UI.hpp
  2. 5
      controllers.h
  3. 10
      dexed.cpp
  4. 9
      dx7note.cpp
  5. 4
      dx7note.h

@ -3868,7 +3868,7 @@ void UI_func_load_fx(uint8_t param)
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(F("Load FX SD")); lcd.print(F("Load FX SD"));
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
sprintf(tmp, "[%7d]", configuration.performance.fx_number); sprintf(tmp, "[%d]", configuration.performance.fx_number);
lcd.print(tmp); lcd.print(tmp);
} }
@ -3941,7 +3941,7 @@ void UI_func_save_fx(uint8_t param)
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(F("Save FX")); lcd.print(F("Save FX"));
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
sprintf(tmp, "[%7d]", configuration.performance.fx_number); sprintf(tmp, "[%d]", configuration.performance.fx_number);
lcd.print(tmp); lcd.print(tmp);
sprintf(tmp, "/%s/%s%d.syx", FX_CONFIG_PATH, FX_CONFIG_NAME, configuration.performance.fx_number); sprintf(tmp, "/%s/%s%d.syx", FX_CONFIG_PATH, FX_CONFIG_NAME, configuration.performance.fx_number);

@ -28,6 +28,7 @@
const int kControllerPitch = 0; const int kControllerPitch = 0;
const int kControllerPitchRange = 1; const int kControllerPitchRange = 1;
const int kControllerPitchStep = 2; const int kControllerPitchStep = 2;
const int kControllerPortamentoGlissando = 3;
class FmCore; class FmCore;
@ -98,7 +99,7 @@ class Controllers {
} }
public: public:
int32_t values_[3]; int32_t values_[4];
uint8_t amp_mod; uint8_t amp_mod;
uint8_t pitch_mod; uint8_t pitch_mod;
@ -110,7 +111,7 @@ class Controllers {
uint8_t modwheel_cc; uint8_t modwheel_cc;
bool portamento_enable_cc; bool portamento_enable_cc;
int portamento_cc; int portamento_cc;
bool portamento_gliss_cc;
int masterTune; int masterTune;
uint8_t opSwitch; uint8_t opSwitch;

@ -120,7 +120,7 @@ void Dexed::getSamples(uint16_t n_samples, int16_t* buffer)
for (i = 0; i < max_notes; i++) for (i = 0; i < max_notes; i++)
{ {
if ( voices[i].live ) if ( voices[i].live )
voices[i].dx7_note->update(data, voices[i].midi_note, voices[i].velocity, voices[i].porta); voices[i].dx7_note->update(data, voices[i].midi_note, voices[i].velocity, voices[i].porta, &controllers);
} }
lfo.reset(data + 137); lfo.reset(data + 137);
refreshVoice = false; refreshVoice = false;
@ -193,7 +193,7 @@ void Dexed::keydown(int16_t pitch, uint8_t velo) {
voices[i].keydown = true; voices[i].keydown = true;
voices[i].sustained = sustain; voices[i].sustained = sustain;
voices[i].live = true; voices[i].live = true;
voices[i].dx7_note->init(data, pitch, velo, pitch, porta); voices[i].dx7_note->init(data, pitch, velo, pitch, porta, &controllers);
return; return;
} }
} }
@ -209,7 +209,7 @@ void Dexed::keydown(int16_t pitch, uint8_t velo) {
voices[note].sustained = sustain; voices[note].sustained = sustain;
voices[note].keydown = true; voices[note].keydown = true;
int srcnote = (previousKeyDown >= 0) ? previousKeyDown : pitch; int srcnote = (previousKeyDown >= 0) ? previousKeyDown : pitch;
voices[note].dx7_note->init(data, pitch, velo, srcnote, porta); voices[note].dx7_note->init(data, pitch, velo, srcnote, porta, &controllers);
if ( data[136] ) if ( data[136] )
voices[note].dx7_note->oscSync(); voices[note].dx7_note->oscSync();
break; break;
@ -383,6 +383,8 @@ void Dexed::resetControllers(void)
controllers.values_[kControllerPitch] = 0x2000; controllers.values_[kControllerPitch] = 0x2000;
controllers.values_[kControllerPitchRange] = 0; controllers.values_[kControllerPitchRange] = 0;
controllers.values_[kControllerPitchStep] = 0; controllers.values_[kControllerPitchStep] = 0;
controllers.values_[kControllerPortamentoGlissando] = 0;
controllers.modwheel_cc = 0; controllers.modwheel_cc = 0;
controllers.foot_cc = 0; controllers.foot_cc = 0;
controllers.breath_cc = 0; controllers.breath_cc = 0;
@ -774,5 +776,7 @@ void Dexed::setPortamentoMode(uint8_t portamento_mode, uint8_t portamento_glissa
else else
controllers.portamento_enable_cc = false; controllers.portamento_enable_cc = false;
controllers.values_[kControllerPortamentoGlissando] = portamento_glissando;
controllers.refresh(); controllers.refresh();
} }

@ -156,7 +156,7 @@ Dx7Note::Dx7Note() {
} }
//void Dx7Note::init(const uint8_t patch[156], int midinote, int velocity) { //void Dx7Note::init(const uint8_t patch[156], int midinote, int velocity) {
void Dx7Note::init(const uint8_t patch[156], int midinote, int velocity, int srcnote, int porta) { void Dx7Note::init(const uint8_t patch[156], int midinote, int velocity, int srcnote, int porta, const Controllers *ctrls) {
int rates[4]; int rates[4];
int levels[4]; int levels[4];
for (int op = 0; op < 6; op++) { for (int op = 0; op < 6; op++) {
@ -202,7 +202,7 @@ void Dx7Note::init(const uint8_t patch[156], int midinote, int velocity, int src
pitchmodsens_ = pitchmodsenstab[patch[143] & 7]; pitchmodsens_ = pitchmodsenstab[patch[143] & 7];
ampmoddepth_ = (patch[140] * 165) >> 6; ampmoddepth_ = (patch[140] * 165) >> 6;
porta_rateindex_ = (porta < 128) ? porta : 127; porta_rateindex_ = (porta < 128) ? porta : 127;
porta_gliss_ = 0; // TO BE FIXED porta_gliss_ = ctrls->values_[kControllerPortamentoGlissando];
} }
void Dx7Note::compute(int32_t *buf, int32_t lfo_val, int32_t lfo_delay, const Controllers *ctrls) { void Dx7Note::compute(int32_t *buf, int32_t lfo_val, int32_t lfo_delay, const Controllers *ctrls) {
@ -306,7 +306,7 @@ void Dx7Note::keyup() {
pitchenv_.keydown(false); pitchenv_.keydown(false);
} }
void Dx7Note::update(const uint8_t patch[156], int midinote, int velocity, int porta) { void Dx7Note::update(const uint8_t patch[156], int midinote, int velocity, int porta, const Controllers *ctrls) {
int rates[4]; int rates[4];
int levels[4]; int levels[4];
for (int op = 0; op < 6; op++) { for (int op = 0; op < 6; op++) {
@ -344,7 +344,8 @@ void Dx7Note::update(const uint8_t patch[156], int midinote, int velocity, int p
pitchmodsens_ = pitchmodsenstab[patch[143] & 7]; pitchmodsens_ = pitchmodsenstab[patch[143] & 7];
ampmoddepth_ = (patch[140] * 165) >> 6; ampmoddepth_ = (patch[140] * 165) >> 6;
porta_rateindex_ = (porta < 128) ? porta : 127; porta_rateindex_ = (porta < 128) ? porta : 127;
porta_gliss_ = 0; // TO BE FIXED porta_gliss_ = ctrls->values_[kControllerPortamentoGlissando];
} }
void Dx7Note::peekVoiceStatus(VoiceStatus &status) { void Dx7Note::peekVoiceStatus(VoiceStatus &status) {

@ -38,7 +38,7 @@ struct VoiceStatus {
class Dx7Note { class Dx7Note {
public: public:
Dx7Note(); Dx7Note();
void init(const uint8_t patch[156], int midinote, int velocity, int srcnote, int porta); void init(const uint8_t patch[156], int midinote, int velocity, int srcnote, int porta, const Controllers *ctrls);
// Note: this _adds_ to the buffer. Interesting question whether it's // Note: this _adds_ to the buffer. Interesting question whether it's
// worth it... // worth it...
@ -52,7 +52,7 @@ class Dx7Note {
// keyup, that won't work. // keyup, that won't work.
// PG:add the update // PG:add the update
void update(const uint8_t patch[156], int midinote, int velocity, int porta); void update(const uint8_t patch[156], int midinote, int velocity, int porta, const Controllers *ctrls);
void peekVoiceStatus(VoiceStatus &status); void peekVoiceStatus(VoiceStatus &status);
void transferState(Dx7Note& src); void transferState(Dx7Note& src);
void transferSignal(Dx7Note &src); void transferSignal(Dx7Note &src);

Loading…
Cancel
Save