SpectMorph
smmorphoutput.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_MORPH_OUTPUT_HH
4 #define SPECTMORPH_MORPH_OUTPUT_HH
5 
6 #include "smmorphoperator.hh"
7 #include "smutils.hh"
8 #include "smmath.hh"
9 #include "smproperty.hh"
10 
11 #include <string>
12 
13 namespace SpectMorph
14 {
15 
16 class MorphOutput;
17 
19 {
21 
27 
28  XParamProperty<MorphOutput> portamento_glide;
29 
31  LogParamProperty<MorphOutput> vibrato_frequency;
32  LinearParamProperty<MorphOutput> vibrato_attack;
33 
34  LinearParamProperty<MorphOutput> velocity_sensitivity;
35 };
36 
37 class MorphOutput : public MorphOperator
38 {
39  std::vector<std::string> load_channel_op_names;
40  std::vector<MorphOperator *> channel_ops;
41 
42  float m_velocity_sensitivity;
43 
44  bool m_sines;
45  bool m_noise;
46 
47  bool m_unison;
48  int m_unison_voices;
49  float m_unison_detune;
50 
51  bool m_adsr;
52  float m_adsr_skip;
53  float m_adsr_attack;
54  float m_adsr_decay;
55  float m_adsr_sustain;
56  float m_adsr_release;
57 
58  bool m_portamento;
59  float m_portamento_glide;
60 
61  bool m_vibrato;
62  float m_vibrato_depth;
63  float m_vibrato_frequency;
64  float m_vibrato_attack;
65 
66 public:
67  MorphOutput (MorphPlan *morph_plan);
68  ~MorphOutput();
69 
70  // inherited from MorphOperator
71  const char *type();
72  int insert_order();
73  bool save (OutFile& out_file);
74  bool load (InFile& in_file);
75  void post_load (OpNameMap& op_name_map);
76  OutputType output_type();
77 
78  void set_sines (bool es);
79  bool sines() const;
80 
81  void set_noise (bool en);
82  bool noise() const;
83 
84  void set_unison (bool eu);
85  bool unison() const;
86 
87  void set_unison_voices (int voices);
88  int unison_voices() const;
89 
90  void set_unison_detune (float voices);
91  float unison_detune() const;
92 
93  void set_adsr (bool eadsr);
94  bool adsr() const;
95 
96  void set_adsr_skip (float skip);
97  float adsr_skip() const;
98 
99  void set_adsr_attack (float attack);
100  float adsr_attack() const;
101 
102  void set_adsr_decay (float decay);
103  float adsr_decay() const;
104 
105  void set_adsr_sustain (float sustain);
106  float adsr_sustain() const;
107 
108  void set_adsr_release (float release);
109  float adsr_release() const;
110 
111  void set_portamento (bool ep);
112  bool portamento() const;
113 
114  void set_portamento_glide (float glide);
115  float portamento_glide() const;
116 
117  void set_vibrato (bool ev);
118  bool vibrato() const;
119 
120  void set_vibrato_depth (float depth);
121  float vibrato_depth() const;
122 
123  void set_vibrato_frequency (float frequency);
124  float vibrato_frequency() const;
125 
126  void set_vibrato_attack (float attack);
127  float vibrato_attack() const;
128 
129  void set_velocity_sensitivity (float vsense);
130  float velocity_sensitivity() const;
131 
132  void set_channel_op (int ch, MorphOperator *op);
133  MorphOperator *channel_op (int ch);
134 
135 /* slots: */
136  void on_operator_removed (MorphOperator *op);
137 };
138 
139 }
140 
141 #endif
Definition: smproperty.hh:140
Definition: smmorphoutput.hh:18
Definition: smproperty.hh:77
Definition: smoutfile.hh:15
Definition: smmorphplan.hh:16
Definition: smproperty.hh:110
Class to read SpectMorph binary data.
Definition: sminfile.hh:25
Definition: smmorphoperator.hh:18
Definition: smadsrenvelope.hh:8
Definition: smmorphoutput.hh:37