SpectMorph
smlivedecoderfilter.hh
1 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl-2.1.html
2 
3 #pragma once
4 
5 #include "smutils.hh"
6 #include "smladdervcf.hh"
7 #include "smskfilter.hh"
8 #include "smmorphoutput.hh"
9 #include "smlinearsmooth.hh"
10 #include "smflexadsr.hh"
11 #include "smdcblocker.hh"
12 
13 namespace SpectMorph
14 {
15 
16 class MorphOutputModule;
17 
19 {
20  struct SmoothValue {
21  float value;
22  float delta;
23  bool constant;
24  };
25  SmoothValue log_cutoff_smooth;
26  SmoothValue resonance_smooth;
27  SmoothValue drive_smooth;
28  bool smooth_first = false;
29  float current_note = 60;
30  float key_tracking = 0;
31  FlexADSR envelope;
32  float depth_octaves = 0;
33  float mix_freq = 0;
34 
35  MorphOutput::FilterType filter_type;
36  MorphOutputModule *output_module = nullptr;
37 
38  static constexpr int FILTER_OVERSAMPLE = 4;
39 
40  LadderVCF ladder_filter { FILTER_OVERSAMPLE };
41  SKFilter sk_filter { FILTER_OVERSAMPLE };
42  DCBlocker dc_blocker;
43 
44 public:
46 
47  void retrigger (float note);
48  void release();
49  void process (size_t n_values, float *audio);
50 
51  void set_config (MorphOutputModule *output_module, const MorphOutput::Config *cfg, float mix_freq);
52 
53  int idelay();
54 };
55 
56 }
Definition: smdcblocker.hh:15
Definition: smflexadsr.hh:9
Definition: smladdervcf.hh:17
Definition: smlivedecoderfilter.hh:19
Definition: smmorphoutputmodule.hh:14
Definition: smskfilter.hh:14
Definition: smmorphoutput.hh:53