From be11f60acfc7a9283ab038b4a1cd25e5e6882cc7 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 30 Dec 2010 16:23:59 +0100 Subject: Note inherits from NoteSkel -- DOES NOT WORK! The program compiles well, but as soon as a note is created, it exits, because a pure virtual method is called in NoteSkel's ctor (which is called before Note's ctor) which tries to call a function which is implemented in Note, but not in NoteSkel --- synth/note.cpp | 64 +--------------------------------------------------------- 1 file changed, 1 insertion(+), 63 deletions(-) (limited to 'synth/note.cpp') diff --git a/synth/note.cpp b/synth/note.cpp index 87f1806..6b73fbf 100644 --- a/synth/note.cpp +++ b/synth/note.cpp @@ -16,9 +16,8 @@ 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; @@ -61,17 +60,8 @@ Note::Note(int n, float v, program_t &prg, jack_nframes_t pf, fixed_t pb, int pr } - portamento_frames=0; - set_portamento_frames(pf); - - set_note(n); - freq=dest_freq; - set_vel(v); do_ksl(); - pitchbend=pb; - - program=prg_no; filter_params=prg.filter_settings; orig.filter_params=prg.filter_settings; @@ -260,52 +250,6 @@ void Note::reattack() envelope[i]->reattack(); } -void Note::set_pitchbend(fixed_t pb) -{ - pitchbend=pb; -} - -void Note::set_freq(float f) -{ - old_freq=freq; - dest_freq=f*ONE; - portamento_t=0; - - do_ksr(); -} - -void Note::set_freq(float f, bool do_port) -{ - set_freq(f); - - if (!do_port) - old_freq=dest_freq; -} - -void Note::set_note(int n) -{ - note=n; - set_freq(440.0*pow(2.0,(float)(n-69)/12.0)); -} - -void Note::set_note(int n, bool do_port) -{ - note=n; - set_freq(440.0*pow(2.0,(float)(n-69)/12.0), do_port); -} - -int Note::get_note() -{ - return note; -} - -void Note::set_vel(float v) -{ - vel=v*ONE; - - recalc_factors(); - apply_pfactor(); -} void Note::do_ksl() { //osc.ksl is in Bel/octave (i.e. dB/10) @@ -326,12 +270,6 @@ void Note::do_ksr() envelope[i]->set_ratefactor(1.0 / pow(freq>>SCALE, oscillator[i].ksr)); } -void Note::set_portamento_frames(jack_nframes_t t) -{ - portamento_frames=t; - portamento_t=0; -} - fixed_t Note::get_sample() { if (freq!=dest_freq) -- cgit v1.2.3