Disabled code for pitchbend wheel. Seems to make problems.

pull/1/head
Holger Wirtz 8 years ago
parent e432b47f22
commit 27f8a52a47
  1. 18
      src/dexed.cpp
  2. 4
      src/msfa/dx7note.cc

@ -12,6 +12,7 @@
#include "msfa/controllers.h"
#include "PluginFx.h"
#include <unistd.h>
#include <limits.h>
Dexed::Dexed(double rate) : lvtk::Synth<DexedVoice, Dexed>(p_n_ports, p_midi_in)
{
@ -19,10 +20,6 @@ Dexed::Dexed(double rate) : lvtk::Synth<DexedVoice, Dexed>(p_n_ports, p_midi_in)
TRACE("Hi");
engineMkI=new EngineMkI;
engineOpl=new EngineOpl;
engineMsfa=new FmCore;
Exp2::init();
Tanh::init();
Sin::init();
@ -33,6 +30,10 @@ Dexed::Dexed(double rate) : lvtk::Synth<DexedVoice, Dexed>(p_n_ports, p_midi_in)
Env::init_sr(rate);
fx.init(rate);
engineMkI=new EngineMkI;
engineOpl=new EngineOpl;
engineMsfa=new FmCore;
for(i=0; i<MAX_ACTIVE_NOTES; ++i) {
voices[i].dx7_note = new Dx7Note;
voices[i].keydown = false;
@ -415,10 +416,11 @@ void Dexed::GetSamples(uint32_t n_samples, float* buffer)
if (voices[note].live) {
voices[note].dx7_note->compute(audiobuf.get(), lfovalue, lfodelay, &controllers);
for (uint32_t j=0; j < N; ++j) {
int32_t val = audiobuf.get()[j];
/*int32_t val = audiobuf.get()[j];
val = val >> 4;
int32_t clip_val = val < -(1 << 24) ? 0x8000 : val >= (1 << 24) ? 0x7fff : val >> 9;
float f = static_cast<float>(clip_val) / float(0x8000);
int32_t clip_val = val < -(1 << 24) ? 0x8000 : val >= (1 << 24) ? 0x7fff : val >> 9;
float f = static_cast<float>(clip_val)/0x8000; */
float f=static_cast<float>(audiobuf.get()[j]<<3)/INT_MAX;
if(f>1.0)
f=1.0;
if(f<-1.0)
@ -475,7 +477,7 @@ void Dexed::ProcessMidiMessage(const uint8_t *buf, uint32_t buf_size) {
return;
break;
case 0x90 :
TRACE("MIDI keyup event: %d %d",buf[1],buf[2]);
TRACE("MIDI keydown event: %d %d",buf[1],buf[2]);
keydown(buf[1], buf[2]);
return;
break;

@ -190,7 +190,7 @@ void Dx7Note::compute(int32_t *buf, int32_t lfo_val, int32_t lfo_delay, const Co
int32_t pitch_mod = max(pmod_1, pmod_2);
pitch_mod = pitchenv_.getsample() + (pitch_mod * (senslfo < 0 ? -1 : 1));
// ---- PITCH BEND ----
/* // ---- PITCH BEND ----
int pitchbend = ctrls->values_[kControllerPitch];
int32_t pb = (pitchbend - 0x2000);
if (pb != 0) {
@ -204,7 +204,7 @@ void Dx7Note::compute(int32_t *buf, int32_t lfo_val, int32_t lfo_delay, const Co
}
pitch_mod += pb;
pitch_mod += ctrls->masterTune;
*/
// ==== AMP MOD ====
uint32_t amod_1 = ((int64_t) ampmoddepth_ * (int64_t) lfo_delay) >> 8; // Q24 :D
amod_1 = ((int64_t) amod_1 * (int64_t) lfo_val) >> 24;

Loading…
Cancel
Save