From 27f8a52a47f0b41b8fefc0002016d3f2c38cc135 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Sun, 18 Dec 2016 14:54:28 +0000 Subject: [PATCH] Disabled code for pitchbend wheel. Seems to make problems. --- src/dexed.cpp | 18 ++++++++++-------- src/msfa/dx7note.cc | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/dexed.cpp b/src/dexed.cpp index 5f6fd9f..4e92ef5 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -12,6 +12,7 @@ #include "msfa/controllers.h" #include "PluginFx.h" #include +#include Dexed::Dexed(double rate) : lvtk::Synth(p_n_ports, p_midi_in) { @@ -19,10 +20,6 @@ Dexed::Dexed(double rate) : lvtk::Synth(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(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; icompute(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(clip_val) / float(0x8000); + int32_t clip_val = val < -(1 << 24) ? 0x8000 : val >= (1 << 24) ? 0x7fff : val >> 9; + float f = static_cast(clip_val)/0x8000; */ + float f=static_cast(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; diff --git a/src/msfa/dx7note.cc b/src/msfa/dx7note.cc index 174be51..d44ec1b 100644 --- a/src/msfa/dx7note.cc +++ b/src/msfa/dx7note.cc @@ -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;