SpectMorph
smmorphgridmodule.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_MORPH_GRID_MODULE_HH
4 #define SPECTMORPH_MORPH_GRID_MODULE_HH
5 
6 #include "smmorphoperatormodule.hh"
7 #include "smmorphgrid.hh"
8 #include "smwavset.hh"
9 #include "smmorphsourcemodule.hh"
10 
11 namespace SpectMorph
12 {
13 
15 {
16 public:
17  struct InputNode
18  {
20  double delta_db;
21  bool has_source;
22  SimpleWavSetSource source;
23  };
24 
25 private:
26  std::vector< std::vector<InputNode> > input_node;
27 
28  size_t width;
29  size_t height;
30 
31  double x_morphing;
32  MorphGrid::ControlType x_control_type;
33  double y_morphing;
34  MorphGrid::ControlType y_control_type;
35 
36  MorphOperatorModule *x_control_mod;
37  MorphOperatorModule *y_control_mod;
38 
39  // output
40  Audio audio;
41  AudioBlock audio_block;
42 
43  struct MySource : public LiveDecoderSource
44  {
45  // temporary blocks for morphing:
46  AudioBlock audio_block_a;
47  AudioBlock audio_block_b;
48  AudioBlock audio_block_c;
49  AudioBlock audio_block_d;
50  AudioBlock audio_block_ab;
51  AudioBlock audio_block_cd;
52 
53  MorphGridModule *module;
54 
55  void retrigger (int channel, float freq, int midi_velocity, float mix_freq);
56  Audio* audio();
57  AudioBlock *audio_block (size_t index);
58  } my_source;
59 
60 public:
62  ~MorphGridModule();
63 
64  void set_config (MorphOperator *op);
65  LiveDecoderSource *source();
66 };
67 
68 }
69 
70 #endif
Audio sample containing many blocks.
Definition: smaudio.hh:81
Definition: smmorphsourcemodule.hh:12
Definition: smmorphgridmodule.hh:17
Block of audio data, encoded in SpectMorph parametric format.
Definition: smaudio.hh:28
Definition: smmorphoperatormodule.hh:23
Definition: smlivedecodersource.hh:10
Definition: smmorphplanvoice.hh:14
Definition: smmorphoperator.hh:19
Definition: smalignedarray.cc:7
Definition: smmorphgridmodule.hh:14