summaryrefslogtreecommitdiff
path: root/note_compiler/note.cpp.todo
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-01-05 18:25:04 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-01-05 18:40:20 +0100
commite8382521c1a35ad59efea5e8cebb915a67c0008e (patch)
tree62ec5889e76461080c5569bbe811d3102dd5f42a /note_compiler/note.cpp.todo
parent3d95a25600b5cab8a7e5245b7a581bd8c8939276 (diff)
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
Diffstat (limited to 'note_compiler/note.cpp.todo')
-rw-r--r--note_compiler/note.cpp.todo72
1 files changed, 0 insertions, 72 deletions
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");
-
- }
-}