Only save the current state... it's quite not easy to make a LV2 plugin out of JUCE :-/

pull/1/head
Holger Wirtz 8 years ago
parent 8a765b347a
commit aa30700848
  1. 1539
      src/Dexed.ttl
  2. 94
      src/Makefile
  3. 2
      src/PluginProcessor.h
  4. 110
      src/dexed.cpp
  5. 1539
      src/dexed.lv2/Dexed.ttl
  6. 11
      src/dexed.lv2/manifest.ttl
  7. 333
      src/dexed.peg
  8. 11
      src/manifest.ttl
  9. 0
      src/trash/SysexComm.h

File diff suppressed because it is too large Load Diff

@ -1,26 +1,76 @@
CFLAGS := -DDEBUG=0 -std=c++11
all: \
msfa/fm_core.o \
msfa/env.o \
msfa/lfo.o \
msfa/dx7note.o \
msfa/sin.o \
msfa/pitchenv.o \
msfa/fm_op_kernel.o \
msfa/freqlut.o \
msfa/exp2.o \
EngineMkI.o \
EngineOpl.o \
PluginFx.o \
PluginProcessor.o \
SysexComm.o \
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
$(BUNDLE): manifest.ttl Dexed.ttl dexed.so
rm -rf $(BUNDLE)
mkdir $(BUNDLE)
cp $^ $(BUNDLE)
clean:
rm -f *.o *~ *.bak *.gch
rm -f *.o *~ *.bak *.gch *.peg
install: $(BUNDLE)
mkdir -p $(INSTALL_DIR)
rm -rf $(INSTALL_DIR)/$(BUNDLE)
cp -R $(BUNDLE) $(INSTALL_DIR)
dexed.so: $(OBJ)
g++ -shared -fPIC -DPIC $(OBJ) `pkg-config --cflags --libs lv2-plugin` -o dexed.so
dexed.o: dexed.cpp dexed.peg
$(CXX) $(CFLAGS) -Wall -c dexed.cpp
fm_core.o: msfa/fm_core.cc
$(CXX) $(CFLAGS) -Wall -c msfa/fm_core.cc
env.o: msfa/env.cc
$(CXX) $(CFLAGS) -Wall -c msfa/env.cc
lfo.o: msfa/lfo.cc
$(CXX) $(CFLAGS) -Wall -c msfa/lfo.cc
dx7note.o: msfa/dx7note.cc
$(CXX) $(CFLAGS) -Wall -c msfa/dx7note.cc
sin.o: msfa/sin.cc
$(CXX) $(CFLAGS) -Wall -c msfa/sin.cc
pitchenv.o: msfa/pitchenv.cc
$(CXX) $(CFLAGS) -Wall -c msfa/pitchenv.cc
fm_op_kernel.o: msfa/fm_op_kernel.cc
$(CXX) $(CFLAGS) -Wall -c msfa/fm_op_kernel.cc
freqlut.o: msfa/freqlut.cc
$(CXX) $(CFLAGS) -Wall -c msfa/freqlut.cc
exp2.o: msfa/exp2.cc
$(CXX) $(CFLAGS) -Wall -c msfa/exp2.cc
EngineMkI.o: EngineMkI.cpp
$(CXX) $(CFLAGS) -Wall -c EngineMkI.cpp
EngineOpl.o: EngineOpl.cpp
$(CXX) $(CFLAGS) -Wall -c EngineOpl.cpp
PluginFx.o: PluginFx.cpp
$(CXX) $(CFLAGS) -Wall -c PluginFx.cpp
PluginProcessor.o: PluginProcessor.cpp
$(CXX) $(CFLAGS) -Wall -c PluginProcessor.cpp
SysexComm.o: SysexComm.cpp
$(CXX) $(CFLAGS) -Wall -c SysexComm.cpp
#msfa/%.o: msfa/%.cc
# $(CXX) $(CFLAGS) -Wall -c $<
#
#%.o: %.cpp
# $(CXX) $(CFLAGS) -Wall -c $<
msfa/%.o: msfa/%.cc
$(CXX) $(CFLAGS) -Wall -c $<
dexed.peg: Dexed.ttl
lv2peg Dexed.ttl dexed.peg
%.o: %.cpp
$(CXX) $(CFLAGS) -Wall -c $<

@ -27,7 +27,7 @@
#include "msfa/synth.h"
#include "msfa/fm_core.h"
#include "PluginFx.h"
#include "SysexComm.h"
//#include "SysexComm.h"
#include "EngineMkI.h"
#include "EngineOpl.h"

@ -0,0 +1,110 @@
// from: http://ll-plugins.nongnu.org/lv2pftci/#A_synth
#include <lv2synth.hpp>
#include "dexed.peg"
#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;
};
class Dexed : public LV2::Synth<DexedVoice, Dexed> {
public:
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);

File diff suppressed because it is too large Load Diff

@ -0,0 +1,11 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix pset: <http://lv2plug.in/ns/ext/presets#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
@prefix mdap: <http://moddevices.com/plugins/mda/presets#> .
@prefix pset: <http://lv2plug.in/ns/ext/presets#> .
<https://github.com/dcoredump/dexed>
a lv2:Plugin ;
lv2:binary <Dexed.so> ;
rdfs:seeAlso <Dexed.ttl> .

@ -0,0 +1,333 @@
#ifndef dexed_peg
#define dexed_peg
#ifndef PEG_STRUCT
#define PEG_STRUCT
typedef struct {
float min;
float max;
float default_value;
char toggled;
char integer;
char logarithmic;
} peg_data_t;
#endif
/* <https://github.com/asb2m10/dexed> */
static const char p_uri[] = "https://github.com/asb2m10/dexed";
enum p_port_enum {
p_lv2_events_in,
p_lv2_freewheel,
p_lv2_latency,
p_lv2_audio_out_1,
p_cutoff,
p_resonance,
p_output,
p_algorithm,
p_feedback,
p_osc_key_sync,
p_lfo_speed,
p_lfo_delay,
p_lfo_pm_depth,
p_lfo_am_depth,
p_lfo_key_sync,
p_lfo_wave,
p_middle_c,
p_p_mode_sens_,
p_pitch_eg_rate_1,
p_pitch_eg_rate_2,
p_pitch_eg_rate_3,
p_pitch_eg_rate_4,
p_pitch_eg_level_1,
p_pitch_eg_level_2,
p_pitch_eg_level_3,
p_pitch_eg_level_4,
p_op1_eg_rate_1,
p_op1_eg_rate_2,
p_op1_eg_rate_3,
p_op1_eg_rate_4,
p_op1_eg_level_1,
p_op1_eg_level_2,
p_op1_eg_level_3,
p_op1_eg_level_4,
p_op1_output_level,
p_op1_mode,
p_op1_f_coarse,
p_op1_f_fine,
p_op1_osc_detune,
p_op1_break_point,
p_op1_l_scale_depth,
p_op1_r_scale_depth,
p_op1_l_key_scale,
p_op1_r_key_scale,
p_op1_rate_scaling,
p_op1_a_mod_sens_,
p_op1_key_velocity,
p_op2_eg_rate_1,
p_op2_eg_rate_2,
p_op2_eg_rate_3,
p_op2_eg_rate_4,
p_op2_eg_level_1,
p_op2_eg_level_2,
p_op2_eg_level_3,
p_op2_eg_level_4,
p_op2_output_level,
p_op2_mode,
p_op2_f_coarse,
p_op2_f_fine,
p_op2_osc_detune,
p_op2_break_point,
p_op2_l_scale_depth,
p_op2_r_scale_depth,
p_op2_l_key_scale,
p_op2_r_key_scale,
p_op2_rate_scaling,
p_op2_a_mod_sens_,
p_op2_key_velocity,
p_op3_eg_rate_1,
p_op3_eg_rate_2,
p_op3_eg_rate_3,
p_op3_eg_rate_4,
p_op3_eg_level_1,
p_op3_eg_level_2,
p_op3_eg_level_3,
p_op3_eg_level_4,
p_op3_output_level,
p_op3_mode,
p_op3_f_coarse,
p_op3_f_fine,
p_op3_osc_detune,
p_op3_break_point,
p_op3_l_scale_depth,
p_op3_r_scale_depth,
p_op3_l_key_scale,
p_op3_r_key_scale,
p_op3_rate_scaling,
p_op3_a_mod_sens_,
p_op3_key_velocity,
p_op4_eg_rate_1,
p_op4_eg_rate_2,
p_op4_eg_rate_3,
p_op4_eg_rate_4,
p_op4_eg_level_1,
p_op4_eg_level_2,
p_op4_eg_level_3,
p_op4_eg_level_4,
p_op4_output_level,
p_op4_mode,
p_op4_f_coarse,
p_op4_f_fine,
p_op4_osc_detune,
p_op4_break_point,
p_op4_l_scale_depth,
p_op4_r_scale_depth,
p_op4_l_key_scale,
p_op4_r_key_scale,
p_op4_rate_scaling,
p_op4_a_mod_sens_,
p_op4_key_velocity,
p_op5_eg_rate_1,
p_op5_eg_rate_2,
p_op5_eg_rate_3,
p_op5_eg_rate_4,
p_op5_eg_level_1,
p_op5_eg_level_2,
p_op5_eg_level_3,
p_op5_eg_level_4,
p_op5_output_level,
p_op5_mode,
p_op5_f_coarse,
p_op5_f_fine,
p_op5_osc_detune,
p_op5_break_point,
p_op5_l_scale_depth,
p_op5_r_scale_depth,
p_op5_l_key_scale,
p_op5_r_key_scale,
p_op5_rate_scaling,
p_op5_a_mod_sens_,
p_op5_key_velocity,
p_op6_eg_rate_1,
p_op6_eg_rate_2,
p_op6_eg_rate_3,
p_op6_eg_rate_4,
p_op6_eg_level_1,
p_op6_eg_level_2,
p_op6_eg_level_3,
p_op6_eg_level_4,
p_op6_output_level,
p_op6_mode,
p_op6_f_coarse,
p_op6_f_fine,
p_op6_osc_detune,
p_op6_break_point,
p_op6_l_scale_depth,
p_op6_r_scale_depth,
p_op6_l_key_scale,
p_op6_r_key_scale,
p_op6_rate_scaling,
p_op6_a_mod_sens_,
p_op6_key_velocity,
p_n_ports
};
static const peg_data_t p_ports[] = {
{ -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 0 },
{ -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 },
{ -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 },
{ 0, 1, 1, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 0 },
{ 0, 1, 1, 0, 0, 0 },
{ 1, 32, 1, 0, 0, 0 },
{ 1, 8, 1, 0, 0, 0 },
{ 1, 1, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 0 },
{ 1, 6, 1, 0, 0, 0 },
{ 0, 48, 24, 0, 0, 0 },
{ 1, 8, 1, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
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 0, 99, 99, 0, 0, 0 },
{ 0, 99, 99, 0, 0, 0 },
{ 0, 99, 99, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 0 },
{ 0, 31, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ -7, 7, 0, 0, 0, 0 },
{ 0, 99, 39, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 3, 0, 0, 0, 0 },
{ 0, 3, 0, 0, 0, 0 },
{ 0, 7, 0, 0, 0, 0 },
{ 0, 3, 0, 0, 0, 0 },
{ 0, 7, 0, 0, 0, 0 },
{ 0, 99, 99, 0, 0, 0 },
{ 0, 99, 99, 0, 0, 0 },
{ 0, 99, 99, 0, 0, 0 },
{ 0, 99, 99, 0, 0, 0 },
{ 0, 99, 99, 0, 0, 0 },
{ 0, 99, 99, 0, 0, 0 },
{ 0, 99, 99, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 0 },
{ 0, 31, 1, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ -7, 7, 7, 0, 0, 0 },
{ 0, 99, 39, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 99, 0, 0, 0, 0 },
{ 0, 3, 0, 0, 0, 0 },
{ 0, 3, 0, 0, 0, 0 },
{ 0, 7, 0, 0, 0, 0 },
{ 0, 3, 0, 0, 0, 0 },
{ 0, 7, 0, 0, 0, 0 },
};
#endif /* dexed_peg */

@ -0,0 +1,11 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix pset: <http://lv2plug.in/ns/ext/presets#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
@prefix mdap: <http://moddevices.com/plugins/mda/presets#> .
@prefix pset: <http://lv2plug.in/ns/ext/presets#> .
<https://github.com/dcoredump/dexed>
a lv2:Plugin ;
lv2:binary <Dexed.so> ;
rdfs:seeAlso <Dexed.ttl> .
Loading…
Cancel
Save