diff options
author | Florian Jung <flo@thinkpad.(none)> | 2011-01-05 18:25:04 +0100 |
---|---|---|
committer | Florian Jung <flo@thinkpad.(none)> | 2011-01-05 18:40:20 +0100 |
commit | e8382521c1a35ad59efea5e8cebb915a67c0008e (patch) | |
tree | 62ec5889e76461080c5569bbe811d3102dd5f42a /note_compiler/templates/set_param.2 | |
parent | 3d95a25600b5cab8a7e5245b7a581bd8c8939276 (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/templates/set_param.2')
-rw-r--r-- | note_compiler/templates/set_param.2 | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/note_compiler/templates/set_param.2 b/note_compiler/templates/set_param.2 new file mode 100644 index 0000000..aaa21b4 --- /dev/null +++ b/note_compiler/templates/set_param.2 @@ -0,0 +1,34 @@ + 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; |