summaryrefslogtreecommitdiff
path: root/note_compiler/templates/set_param.2
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/templates/set_param.2
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/templates/set_param.2')
-rw-r--r--note_compiler/templates/set_param.234
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;