mirror of https://github.com/dcoredump/dexed.git
parent
8a765b347a
commit
aa30700848
File diff suppressed because it is too large
Load Diff
@ -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 }, |
||||
{ 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, 99, 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, 99, 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 }, |
||||
{ 0, 31, 0, 0, 0, 0 }, |
||||
{ 0, 99, 0, 0, 0, 0 }, |
||||
{ -7, 7, 0, 0, 0, 0 }, |
||||
{ 0, 99, 0, 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, 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, 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 }, |
||||
{ 0, 31, 0, 0, 0, 0 }, |
||||
{ 0, 100, 0, 0, 0, 0 }, |
||||
{ -7, 7, 0, 0, 0, 0 }, |
||||
{ 0, 100, 0, 0, 0, 0 }, |
||||
{ 0, 100, 0, 0, 0, 0 }, |
||||
{ 0, 100, 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, 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, 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 }, |
||||
{ 0, 31, 0, 0, 0, 0 }, |
||||
{ 0, 99, 0, 0, 0, 0 }, |
||||
{ -7, 7, 0, 0, 0, 0 }, |
||||
{ 0, 99, 0, 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, 1, 0, 0, 0 }, |
||||
{ 0, 99, 0, 0, 0, 0 }, |
||||
{ 0, 99, 7, 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, 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, 99, 0, 0, 0 }, |
||||
{ 0, 99, 99, 0, 0, 0 }, |
||||
{ 0, 99, 0, 0, 0, 0 }, |
||||
{ 0, 99, 39, 0, 0, 0 }, |
||||
{ 0, 99, 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, 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…
Reference in new issue