From c1a2c43aa8d4c5bcfa345fd3b92215c18c938683 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 30 Dec 2010 17:25:57 +0100 Subject: Note inherits from NoteSkel -- works --- synth/.depend | 28 ++++++++++++++++++++++++++++ synth/note.cpp | 23 ++++++++++++++++++++++- synth/note.h | 11 +---------- synth/note_skel.cpp | 14 +------------- synth/note_skel.h | 4 ++-- 5 files changed, 54 insertions(+), 26 deletions(-) create mode 100644 synth/.depend diff --git a/synth/.depend b/synth/.depend new file mode 100644 index 0000000..127f9d9 --- /dev/null +++ b/synth/.depend @@ -0,0 +1,28 @@ +channel.o: channel.cpp channel.h fixed.h programs.h note.h envelope.h \ + filter.h note_skel.h defines.h util.h globals.h +cli.o: cli.cpp util.h programs.h fixed.h globals.h channel.h note.h \ + envelope.h filter.h note_skel.h defines.h load.h +defines.o: defines.cpp defines.h +envelope.o: envelope.cpp envelope.h programs.h fixed.h +filter.o: filter.cpp filter.h fixed.h defines.h globals.h programs.h \ + channel.h note.h envelope.h note_skel.h util.h +globals.o: globals.cpp globals.h programs.h fixed.h channel.h note.h \ + envelope.h filter.h note_skel.h defines.h util.h +jack.o: jack.cpp defines.h globals.h programs.h fixed.h channel.h note.h \ + envelope.h filter.h note_skel.h util.h jack.h +load.o: load.cpp util.h programs.h fixed.h globals.h channel.h note.h \ + envelope.h filter.h note_skel.h defines.h +main.o: main.cpp jack.h load.h cli.h parser.h fixed.h programs.h \ + channel.h note.h envelope.h filter.h note_skel.h defines.h util.h \ + globals.h +note.o: note.cpp note.h programs.h fixed.h envelope.h filter.h \ + note_skel.h globals.h channel.h defines.h util.h +note_skel.o: note_skel.cpp note_skel.h programs.h fixed.h globals.h \ + channel.h note.h envelope.h filter.h defines.h util.h +parser.o: parser.cpp parser.h fixed.h programs.h defines.h globals.h \ + channel.h note.h envelope.h filter.h note_skel.h util.h readwave.h +programs.o: programs.cpp programs.h fixed.h globals.h channel.h note.h \ + envelope.h filter.h note_skel.h defines.h util.h +readwave.o: readwave.cpp readwave.h programs.h fixed.h util.h +util.o: util.cpp util.h programs.h fixed.h globals.h channel.h note.h \ + envelope.h filter.h note_skel.h defines.h diff --git a/synth/note.cpp b/synth/note.cpp index 6b73fbf..8ab0546 100644 --- a/synth/note.cpp +++ b/synth/note.cpp @@ -16,8 +16,13 @@ inline fixed_t init_custom_osc_phase(int len, fixed_t sr) Note::Note(int n, float v, program_t &prg, jack_nframes_t pf, fixed_t pb, int prg_no) - : NoteSkel(n,v,prg,pf,pb,prg_no) { + + curr_prg=&prg; + + + + n_oscillators=prg.n_osc; @@ -80,6 +85,22 @@ Note::Note(int n, float v, program_t &prg, jack_nframes_t pf, fixed_t pb, int pr sync_factor=prg.sync_factor; sync_phase=0; + + + + + portamento_frames=0; + set_portamento_frames(pf); + + set_note(n); + freq=dest_freq; + set_vel(v); + + pitchbend=pb; + + program=prg_no; + + } Note::~Note() diff --git a/synth/note.h b/synth/note.h index 9e3bc52..0e76505 100644 --- a/synth/note.h +++ b/synth/note.h @@ -30,10 +30,7 @@ class Note : public NoteSkel void apply_pfactor(); Envelope **envelope; - fixed_t freq, dest_freq, old_freq; - fixed_t vel; - jack_nframes_t portamento_t, portamento_frames; - + fixed_t *oscval; fixed_t *old_oscval; int n_oscillators; @@ -44,12 +41,6 @@ class Note : public NoteSkel pfactor_value_t pfactor; - int note; - int program; - program_t *curr_prg; - - fixed_t pitchbend; - LowPassFilter filter; Envelope *filter_envelope; filter_params_t filter_params; diff --git a/synth/note_skel.cpp b/synth/note_skel.cpp index 9523a1b..b028ca4 100644 --- a/synth/note_skel.cpp +++ b/synth/note_skel.cpp @@ -6,20 +6,8 @@ using namespace std; -NoteSkel::NoteSkel(int n, float v, program_t &prg, jack_nframes_t pf, fixed_t pb, int prg_no) +NoteSkel::NoteSkel() { - curr_prg=&prg; - - portamento_frames=0; - set_portamento_frames(pf); - - set_note(n); - freq=dest_freq; - set_vel(v); - - pitchbend=pb; - - program=prg_no; } NoteSkel::~NoteSkel() diff --git a/synth/note_skel.h b/synth/note_skel.h index 75cdc8f..d3b5a13 100644 --- a/synth/note_skel.h +++ b/synth/note_skel.h @@ -9,7 +9,7 @@ class NoteSkel { public: - NoteSkel(int n, float v,program_t &prg, jack_nframes_t pf, fixed_t pb, int prg_no); + NoteSkel(); virtual ~NoteSkel(); virtual fixed_t get_sample()=0; @@ -30,7 +30,7 @@ class NoteSkel virtual void set_param(const parameter_t &p, fixed_t v)=0; - private: + protected: virtual void do_ksl()=0; virtual void do_ksr()=0; -- cgit v1.2.1