Is this the right way???

pull/1/head
Holger Wirtz 8 years ago
parent f18aa020be
commit 07e5c475ac
  1. 1
      src/.gitignore
  2. 43
      src/dexed.cpp
  3. 19
      src/dexed.h
  4. 333
      src/dexed.peg
  5. 0
      src/trash/OperatorEditor.h
  6. 0
      src/trash/PluginData.cpp
  7. 0
      src/trash/PluginData.h
  8. 0
      src/trash/PluginProcessor.cpp
  9. 0
      src/trash/PluginProcessor.h

1
src/.gitignore vendored

@ -0,0 +1 @@
*.peg

@ -7,21 +7,21 @@
#include "EngineOpl.h"
#include "msfa/exp2.h"
#include "msfa/sin.h"
#include "msfa/freqlut.h"
DexedVoice::DexedVoice(double rate) : m_key(LV2::INVALID_KEY), m_rate(rate)
{
Exp2::init();
Tanh::init();
Sin::init();
};
voice.dx7_note=new Dx7Note;
}
void DexedVoice::on(unsigned char key, unsigned char velocity)
{
voice.dx7_note->init(data, key, velocity, 11);
}
void DexedVoice::off(unsigned char velocity)
{
voice.dx7_note->keyup();
}
unsigned char DexedVoice::get_key(void) const
@ -33,6 +33,15 @@ void DexedVoice::render(uint32_t from, uint32_t to)
{
if (m_key == LV2::INVALID_KEY)
return;
for (uint32_t i = from; i < to; ++i)
{
int32_t s;
//dx7_note->compute(&s, lfovalue, lfodelay, &controllers);
voice.dx7_note->compute(&s, 0, 0, NULL);
float fs=float(s)/(INT32_MAX);
p(p_lv2_audio_out_1)[i]+=fs;
}
}
@ -40,12 +49,26 @@ void DexedVoice::render(uint32_t from, uint32_t to)
Dexed::Dexed(double rate) : LV2::Synth<DexedVoice, Dexed>(p_n_ports, p_lv2_events_in)
{
feedback_bitdepth=11;
engineType=DEXED_ENGINE_MARKI;
core=&engineMkI;
Exp2::init();
Tanh::init();
Sin::init();
Freqlut::init(rate);
Lfo::init(rate);
PitchEnv::init(rate);
Env::init_sr(rate);
feedback_bitdepth=11;
engineType=DEXED_ENGINE_MARKI;
core=&engineMkI;
for(uint i=0;i<sizeof(init_voice);i++) {
data[i] = init_voice[i];
}
add_voices(new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate),new DexedVoice(rate)
);
add_voices(new DexedVoice(rate));
add_audio_outputs(p_lv2_audio_out_1);
add_audio_outputs(p_lv2_audio_out_1);
}
static int _ = Dexed::register_class(p_uri);

@ -71,12 +71,27 @@ class Dexed : public LV2::Synth<DexedVoice, Dexed>
protected:
// dexed internal
int feedback_bitdepth;
uint32_t engineType;
FmCore engineMsfa;
EngineMkI engineMkI;
EngineOpl engineOpl;
};
// Global vars
uint8_t feedback_bitdepth=11;
uint32_t engineType;
const char init_voice[] =
{ 99, 99, 99, 99, 99, 99, 99, 00, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7,
99, 99, 99, 99, 99, 99, 99, 00, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7,
99, 99, 99, 99, 99, 99, 99, 00, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7,
99, 99, 99, 99, 99, 99, 99, 00, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7,
99, 99, 99, 99, 99, 99, 99, 00, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7,
99, 99, 99, 99, 99, 99, 99, 00, 39, 0, 0, 0, 0, 0, 0, 0, 99, 0, 1, 0, 7,
99, 99, 99, 99, 50, 50, 50, 50, 0, 0, 1, 35, 0, 0, 0, 1, 0, 3, 24,
73, 78, 73, 84, 32, 86, 79, 73, 67, 69 };
uint8_t data[161]; // program data
#endif // PLUGINPROCESSOR_H_INCLUDED

@ -1,333 +0,0 @@
#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, 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