... trying...

pull/1/head
Holger Wirtz 8 years ago
parent aa30700848
commit c4be756007
  1. 4
      src/Makefile
  2. 110
      src/dexed.cpp
  3. 63
      src/dexed.h

@ -1,8 +1,8 @@
BUNDLE = dexed.lv2
INSTALL_DIR = /usr/local/lib/lv2
CFLAGS := -fPIC -DPIC -DDEBUG=0 -std=c++11 -I/usr/include/lv2-c++-tools
OBJ = dexed.o fm_core.o env.o lfo.o dx7note.o sin.o pitchenv.o fm_op_kernel.o freqlut.o exp2.o EngineMkI.o EngineOpl.o PluginFx.o PluginProcessor.o
# SysexComm.o
OBJ = dexed.o fm_core.o env.o lfo.o dx7note.o sin.o pitchenv.o fm_op_kernel.o freqlut.o exp2.o EngineMkI.o EngineOpl.o
# SysexComm.o PluginFx.o
$(BUNDLE): manifest.ttl Dexed.ttl dexed.so
rm -rf $(BUNDLE)

@ -2,109 +2,23 @@
#include <lv2synth.hpp>
#include "dexed.peg"
#include "dexed.h"
#include "EngineMkI.h"
#include "EngineOpl.h"
class DexedVoice : public LV2::Voice {
public:
Controllers controllers;
StringArray programNames;
Cartridge currentCart;
uint8_t data[161];
SysexComm sysexComm;
VoiceStatus voiceStatus;
File activeFileCartridge;
int getEngineType();
void setEngineType(int rs);
Array<Ctrl*> ctrl;
OperatorCtrl opCtrl[6];
ScopedPointer<CtrlDX> pitchEgRate[4];
ScopedPointer<CtrlDX> pitchEgLevel[4];
ScopedPointer<CtrlDX> pitchModSens;
ScopedPointer<CtrlDX> algo;
ScopedPointer<CtrlDX> oscSync;
ScopedPointer<CtrlDX> feedback;
ScopedPointer<CtrlDX> lfoRate;
ScopedPointer<CtrlDX> lfoDelay;
ScopedPointer<CtrlDX> lfoAmpDepth;
ScopedPointer<CtrlDX> lfoPitchDepth;
ScopedPointer<CtrlDX> lfoWaveform;
ScopedPointer<CtrlDX> lfoSync;
ScopedPointer<CtrlDX> transpose;
ScopedPointer<CtrlFloat> fxCutoff;
ScopedPointer<CtrlFloat> fxReso;
ScopedPointer<CtrlFloat> output;
ScopedPointer<Ctrl> tune;
DexedVoice(double rate)
: m_key(LV2::INVALID_KEY), m_rate(rate) {
}
void on(unsigned char key, unsigned char velocity) {
m_key = key;
}
void off(unsigned char velocity) {
m_key = LV2::INVALID_KEY;
}
unsigned char get_key() const {
return m_key;
}
void render(uint32_t from, uint32_t to) {
int i=0;
if (m_key == LV2::INVALID_KEY)
return;
float s=0.0;
p(p_lv2_audio_out_1)[i] += s;
}
protected:
unsigned char m_key;
double m_rate;
PluginFx fx;
bool refreshVoice;
bool normalizeDxVelocity;
bool sendSysexChange;
static const int MAX_ACTIVE_NOTES = 16;
ProcessorVoice voices[MAX_ACTIVE_NOTES];
int currentNote;
Lfo lfo;
bool sustain;
bool monoMode;
float extra_buf[N];
int extra_buf_size;
int currentProgram;
long lastStateSave;
uint32_t engineType;
FmCore engineMsfa;
EngineMkI engineMkI;
EngineOpl engineOpl;
int feedback_bitdepth;
#include "msfa/exp2.h"
#include "msfa/sin.h"
DexedVoice::DexedVoice(double rate)
{
Exp2::init();
Tanh::init();
Sin::init();
};
class Dexed : public LV2::Synth<DexedVoice, Dexed> {
public:
Dexed(double rate)
: LV2::Synth<DexedVoice, Dexed>(p_n_ports, p_lv2_events_in) {
Dexed::Dexed(double rate) : LV2::Synth<DexedVoice, Dexed>(p_n_ports, p_lv2_events_in)
{
add_voices(new DexedVoice(rate), new DexedVoice(rate), new DexedVoice(rate));
add_audio_outputs(p_lv2_audio_out_1);
}
};
}
static int _ = Dexed::register_class(p_uri);

@ -0,0 +1,63 @@
/**
*
* Copyright (c) 2013-2015 Pascal Gauthier.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef DEXED_H_INCLUDED
#define DEXED_H_INCLUDED
#include "msfa/controllers.h"
#include "msfa/dx7note.h"
#include "msfa/lfo.h"
#include "msfa/synth.h"
#include "msfa/fm_core.h"
#include "PluginFx.h"
#include "EngineMkI.h"
#include "EngineOpl.h"
struct ProcessorVoice {
int midi_note;
bool keydown;
bool sustained;
bool live;
Dx7Note *dx7_note;
};
enum DexedEngineResolution {
DEXED_ENGINE_MODERN,
DEXED_ENGINE_MARKI,
DEXED_ENGINE_OPL
};
//==============================================================================
class DexedVoice : public LV2::Voice
{
public:
DexedVoice(double rate);
};
//==============================================================================
class Dexed : public LV2::Synth<DexedVoice, Dexed>
{
public:
Dexed(double rate);
};
#endif // PLUGINPROCESSOR_H_INCLUDED
Loading…
Cancel
Save