summaryrefslogtreecommitdiffstats
path: root/src/synth_engine.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2023-11-26 16:29:00 +0200
committergramanas <anastasis.gramm2@gmail.com>2023-11-26 16:29:00 +0200
commit8d17aa29baf0b33229dbdd82d8d5f6cbe3fe0240 (patch)
treebc4ec3351f8585b548ddf016c93d3715b324b64c /src/synth_engine.c
parentc03d395f6848fe9b2d1185173a9cf5ec8277394f (diff)
downloadsynth-project-8d17aa29baf0b33229dbdd82d8d5f6cbe3fe0240.tar.gz
synth-project-8d17aa29baf0b33229dbdd82d8d5f6cbe3fe0240.tar.bz2
synth-project-8d17aa29baf0b33229dbdd82d8d5f6cbe3fe0240.zip
Many changes!
Diffstat (limited to 'src/synth_engine.c')
-rw-r--r--src/synth_engine.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/synth_engine.c b/src/synth_engine.c
index b47d510..15dda16 100644
--- a/src/synth_engine.c
+++ b/src/synth_engine.c
@@ -464,6 +464,10 @@ init_synth(synth_t * synth)
CC(synth->cc_lfo_freq, "lfo_freq", 1, 1000, 2, 1);
CC(synth->cc_lfo_amp, "lfo_amp", 0, 1, .01, 0);
CC(synth->cc_pitch, "pitch", -3, 4, 0.01, 1);
+ CC(synth->cc_adsr_a, "attack", 0, 3, 0.05, 0.00);
+ CC(synth->cc_adsr_d, "decay", 0, 2, 0.05, 0.3);
+ CC(synth->cc_adsr_s, "sustain", 0, 1.0f, 0.05f, 0.7f);
+ CC(synth->cc_adsr_r, "release", 0, 5, 0.05f, 0.2f);
synth->modi = 0;
@@ -481,7 +485,7 @@ init_synth(synth_t * synth)
synth->lfo.amp = 0.0f;
synth->lfo.elapsed = 0;
- for (int i =0; i<MIDI_NOTES; i++) {
+ for (int i = 0; i < MIDI_NOTES; i++) {
synth->midi_note[i].freq = 0;
synth->midi_note[i].channel = -1;
synth->midi_note[i].noteOn = -1;
@@ -529,6 +533,7 @@ init_synth(synth_t * synth)
init_sound(synth, sound_gen);
synth->osctri = make_tri("triangle");
+
}
void