From e8382521c1a35ad59efea5e8cebb915a67c0008e Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 5 Jan 2011 18:25:04 +0100 Subject: Finished note-compiler, seems to work. TODO: CLI The note-compiler now also generates code for set_param, and a function has been added which returns a pointer to a newly created object (important for loading from a shared object). There's also a destroyer function. TODO: - write a CLI for the note-compiler - let the note-compiler issue the build-commands on his own - make the synth load instruments from shared objects --- note_compiler/note.cpp.todo | 72 --------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 note_compiler/note.cpp.todo (limited to 'note_compiler/note.cpp.todo') diff --git a/note_compiler/note.cpp.todo b/note_compiler/note.cpp.todo deleted file mode 100644 index a256525..0000000 --- a/note_compiler/note.cpp.todo +++ /dev/null @@ -1,72 +0,0 @@ -void Note::set_param(const parameter_t &p, fixed_t v) //ACHTUNG: -{ - //wenn das verändert wird, muss auch program_t::set_param verändert werden! - switch(p.par) - { - case ATTACK: envelope[p.osc]->set_attack(v*samp_rate >>SCALE); break; - case DECAY: envelope[p.osc]->set_decay(v*samp_rate >>SCALE); break; - case SUSTAIN: envelope[p.osc]->set_sustain(v); break; - case RELEASE: envelope[p.osc]->set_release(v*samp_rate >>SCALE); break; - case HOLD: envelope[p.osc]->set_hold(v!=0); break; - - case KSR: oscillator[p.osc].ksr=float(v)/ONE; break; - case KSL: oscillator[p.osc].ksl=float(v)/ONE; break; - - case FACTOR: oscillator[p.osc].factor=v; break; - case MODULATION: oscillator[p.osc].fm_strength[p.index]=v*pfactor.fm[p.osc][p.index] >>SCALE; break; - case OUTPUT: oscillator[p.osc].output=v*pfactor.out[p.osc] >>SCALE; break; - case TREMOLO: oscillator[p.osc].tremolo_depth=v; break; - case TREM_LFO: oscillator[p.osc].tremolo_lfo=v; break; - case VIBRATO: oscillator[p.osc].vibrato_depth=v; break; - case VIB_LFO: oscillator[p.osc].vibrato_lfo=v; break; - case WAVEFORM: oscillator[p.osc].waveform=v; break; - case SYNC: oscillator[p.osc].sync=(v!=0); break; - - case FILTER_ENABLED: output_note("NOTE: cannot enable filter in playing notes"); break; - case FILTER_ENV_AMOUNT: filter_params.env_amount=float(v*pfactor.filter_env)/ONE/ONE; break; - - case FILTER_ATTACK: - if (filter_params.enabled) - filter_envelope->set_attack(v*samp_rate/filter_update_frames >>SCALE); - else - output_note("NOTE: cannot set filter-attack when filter is disabled"); - break; - - case FILTER_DECAY: - if (filter_params.enabled) - filter_envelope->set_decay(v*samp_rate/filter_update_frames >>SCALE); - else - output_note("NOTE: cannot set filter-decay when filter is disabled"); - break; - - case FILTER_SUSTAIN: - if (filter_params.enabled) - filter_envelope->set_sustain(v); - else - output_note("NOTE: cannot set filter-sustain when filter is disabled"); - break; - - case FILTER_RELEASE: - if (filter_params.enabled) - filter_envelope->set_release(v*samp_rate/filter_update_frames >>SCALE); - else - output_note("NOTE: cannot set filter-release when filter is disabled"); - break; - - case FILTER_HOLD: - if (filter_params.enabled) - filter_envelope->set_hold(v!=0); - else - output_note("NOTE: cannot set filter-hold when filter is disabled"); - break; - - case FILTER_OFFSET: filter_params.freqfactor_offset=float(v*pfactor.filter_offset)/ONE/ONE; break; - case FILTER_RESONANCE: filter_params.resonance=float(v*pfactor.filter_res)/ONE/ONE; break; - case FILTER_TREMOLO: filter_params.trem_strength=v; break; - case FILTER_TREM_LFO: filter_params.trem_lfo=v; break; - - case SYNC_FACTOR: sync_factor=v; break; - default: throw string("trying to set an unknown parameter"); - - } -} -- cgit v1.2.3