diff options
Diffstat (limited to 'synth')
-rw-r--r-- | synth/Makefile | 3 | ||||
-rw-r--r-- | synth/defines.h | 2 | ||||
-rw-r--r-- | synth/envelope.cpp | 8 | ||||
-rw-r--r-- | synth/envelope.h | 1 | ||||
-rw-r--r-- | synth/note.cpp | 2 | ||||
-rw-r--r-- | synth/readwave.cpp | 1 |
6 files changed, 14 insertions, 3 deletions
diff --git a/synth/Makefile b/synth/Makefile index 80cf705..01e27ee 100644 --- a/synth/Makefile +++ b/synth/Makefile @@ -1,5 +1,6 @@ CXX=g++ -CFLAGS=-Wall -O2 +#CFLAGS=-Wall -O2 +CFLAGS=-Wall -O -g CXXFLAGS=$(CFLAGS) LDFLAGS=-lm `pkg-config --cflags --libs jack` diff --git a/synth/defines.h b/synth/defines.h index 354e683..56d2ec5 100644 --- a/synth/defines.h +++ b/synth/defines.h @@ -80,7 +80,7 @@ extern float LFO_FREQ_HZ[]; #if ( (WAVE_SAW_START < N_NORMAL_WAVEFORMS) || \ (WAVE_PULSE_START < WAVE_SAW_START+WAVE_SAW_N) ) - #error NORMAL WAVEFORMS, SAW- AND PULSE-WAVES MAY NOT OVERLAP! + #error NORMAL WAVEFORMS, SAW- AND PULSE-WAVES MAY NOT OVERLAP! #endif #define N_WAVEFORMS (WAVE_PULSE_START+WAVE_PULSE_N) diff --git a/synth/envelope.cpp b/synth/envelope.cpp index 13b1044..837b4a7 100644 --- a/synth/envelope.cpp +++ b/synth/envelope.cpp @@ -85,6 +85,14 @@ void Envelope::reattack() sustain=sustain_orig; } +void Envelope::reset() +{ + state=ATTACK; + sustain=sustain_orig; + level=0; + t=0; +} + void Envelope::release_key() { if (has_release_phase) diff --git a/synth/envelope.h b/synth/envelope.h index a9bb15b..3c93a03 100644 --- a/synth/envelope.h +++ b/synth/envelope.h @@ -17,6 +17,7 @@ class Envelope Envelope(env_settings_t s, int frames=1); void release_key(); void reattack(); + void reset(); fixed_t get_level(); bool still_active(); void set_hold(bool h); diff --git a/synth/note.cpp b/synth/note.cpp index d208ae8..54267a8 100644 --- a/synth/note.cpp +++ b/synth/note.cpp @@ -289,7 +289,7 @@ void Note::reattack() for (int i=0;i<n_oscillators;++i) { envelope[i]->reattack(); - factor_env[i]->reattack(); + factor_env[i]->reset(); } if (filter_params.enabled) diff --git a/synth/readwave.cpp b/synth/readwave.cpp index 0b2c0a0..aa4ef92 100644 --- a/synth/readwave.cpp +++ b/synth/readwave.cpp @@ -1,5 +1,6 @@ #include <string> #include <cstring> +#include <cstdio> #include "readwave.h" #include "util.h" |