From f18aa020bea82385b6642373cfbde2eb07d2231e Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Thu, 6 Oct 2016 15:22:24 +0200 Subject: [PATCH] save the current state... --- src/dexed.cpp | 31 +++++++++++++++++++++++++++++-- src/dexed.h | 19 +++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/dexed.cpp b/src/dexed.cpp index 026059f..bfa5150 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -8,16 +8,43 @@ #include "msfa/exp2.h" #include "msfa/sin.h" -DexedVoice::DexedVoice(double rate) +DexedVoice::DexedVoice(double rate) : m_key(LV2::INVALID_KEY), m_rate(rate) { Exp2::init(); Tanh::init(); Sin::init(); + }; +void DexedVoice::on(unsigned char key, unsigned char velocity) +{ +} + +void DexedVoice::off(unsigned char velocity) +{ +} + +unsigned char DexedVoice::get_key(void) const +{ + return m_key; +} + +void DexedVoice::render(uint32_t from, uint32_t to) +{ + if (m_key == LV2::INVALID_KEY) + return; +} + + +//============================================================================== + Dexed::Dexed(double rate) : LV2::Synth(p_n_ports, p_lv2_events_in) { - add_voices(new DexedVoice(rate), new DexedVoice(rate), new DexedVoice(rate)); + feedback_bitdepth=11; + engineType=DEXED_ENGINE_MARKI; + core=&engineMkI; + + add_voices(new DexedVoice(rate)); add_audio_outputs(p_lv2_audio_out_1); } diff --git a/src/dexed.h b/src/dexed.h index ea33ded..0e28283 100644 --- a/src/dexed.h +++ b/src/dexed.h @@ -50,6 +50,15 @@ class DexedVoice : public LV2::Voice { public: DexedVoice(double rate); + void on(unsigned char key, unsigned char velocity); + void off(unsigned char velocity); + unsigned char get_key(void) const; + void render(uint32_t from, uint32_t to); + + protected: + unsigned char m_key; + double m_rate; + ProcessorVoice voice; }; //============================================================================== @@ -58,6 +67,16 @@ class Dexed : public LV2::Synth { public: Dexed(double rate); + FmCore *core; + + protected: + // dexed internal + int feedback_bitdepth; + uint32_t engineType; + + FmCore engineMsfa; + EngineMkI engineMkI; + EngineOpl engineOpl; }; #endif // PLUGINPROCESSOR_H_INCLUDED