SpectMorph
smeffectdecoder.hh
1 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl-2.1.html
2 
3 #ifndef SPECTMORPH_EFFECTDECODER_HH
4 #define SPECTMORPH_EFFECTDECODER_HH
5 
6 #include "smlivedecoder.hh"
7 #include "smlivedecodersource.hh"
8 #include "smmorphoutput.hh"
9 #include "smadsrenvelope.hh"
10 #include "smlivedecoderfilter.hh"
11 
12 #include <memory>
13 
14 namespace SpectMorph
15 {
16 
17 class SimpleEnvelope;
18 class EffectDecoderSource;
20 {
21  MorphOutputModule *output_module;
22 
23  LiveDecoder chain_decoder;
24  std::unique_ptr<EffectDecoderSource> skip_source;
25  std::unique_ptr<ADSREnvelope> adsr_envelope;
26  std::unique_ptr<SimpleEnvelope> simple_envelope;
27  bool adsr_enabled = false;
28 
29  bool filter_enabled = false;
30  LiveDecoderFilter live_decoder_filter;
31  float current_freq = 440;
32 
33 public:
34  EffectDecoder (MorphOutputModule *output_module, float mix_freq);
35  ~EffectDecoder();
36 
37  void set_config (const MorphOutput::Config *cfg, LiveDecoderSource *source, float mix_freq);
38 
39  void retrigger (int channel, float freq, int midi_velocity);
40  void process (RTMemoryArea& rt_memory_area,
41  size_t n_values,
42  const float *freq_in,
43  float *audio_out);
44  void release();
45  bool done();
46 
47  double time_offset_ms() const;
48 };
49 
50 }
51 
52 #endif
Definition: smeffectdecoder.hh:20
Definition: smlivedecoderfilter.hh:19
Definition: smlivedecodersource.hh:12
Definition: smlivedecoder.hh:19
Definition: smmorphoutputmodule.hh:14
Definition: smrtmemory.hh:16
Definition: smmorphoutput.hh:53