summaryrefslogtreecommitdiff
path: root/note_compiler/templates/set_param.2
blob: aaa21b47c02f41fe83f2bd197e77ad025b3474f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;