Guitarix
gx_internal_plugins.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
3  * Copyright (C) 2011 Pete Shorthose
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  * --------------------------------------------------------------------------
19  */
20 
21 /* ------- This is the guitarix Engine namespace ------- */
22 
23 #pragma once
24 
25 #include "dsp.h"
26 #include "activations.h"
27 
28 #pragma GCC diagnostic push
29 #pragma GCC diagnostic ignored "-Wreorder"
30 #pragma GCC diagnostic ignored "-Winfinite-recursion"
31 #include "RTNeural.h"
32 #pragma GCC diagnostic pop
33 
34 namespace gx_jack { class GxJack; }
35 
36 namespace gx_engine {
37 
38 /****************************************************************
39  ** MonoMute, StereoMute, MaxLevel
40  */
41 
42 class MonoMute: public PluginDef {
43 private:
44  static void process(int count, float *input, float *output, PluginDef*);
45 public:
47 };
48 
49 class StereoMute: public PluginDef {
50 private:
51  static void process(int count, float *input0, float *input1,
52  float *output0, float *output1, PluginDef*);
53 public:
55 };
56 
57 class MaxLevel: public PluginDef {
58 public:
59  static const unsigned int channelcount = 2;
60 private:
61  static float maxlevel[channelcount];
62  static void process(int count, float *input0, float *input1,
63  float *output0, float *output1, PluginDef*);
64  static int activate(bool start, PluginDef *plugin);
65  static int regparam(const ParamReg& reg);
66 public:
67  static float get(unsigned int channel) {
68  assert(channel < channelcount);
69  float v = maxlevel[channel];
70  maxlevel[channel] = 0;
71  return v;
72  }
74 };
75 
76 
77 /****************************************************************
78  ** class TunerAdapter
79  */
80 
81 #ifndef GUITARIX_AS_PLUGIN
82 #include "faust/low_high_cut.h"
83 #else
84 #include "low_high_cut.h"
85 #endif
86 
87 class TunerAdapter: public ModuleSelector, private PluginDef, public sigc::trackable {
88 private:
89  static void feed_tuner(int count, float *input, float *output, PluginDef*);
90  static int regparam(const ParamReg& reg);
91  static int activate(bool start, PluginDef *plugin);
92  static void init(unsigned int samplingFreq, PluginDef *plugin);
93  low_high_cut::Dsp lhc;
95  int state;
97  enum { tuner_use = 0x01, switcher_use = 0x02, midi_use = 0x04 };
98  void set_and_check(int use, bool on);
100 public:
104  void used_for_display(bool on) { set_and_check(tuner_use, on); }
105  bool used_for_display() { return state & tuner_use; }
106  void used_by_midi(bool on) { set_and_check(midi_use, on); }
107  void set_dep_module(Plugin* dep) { dep_plugin = dep; }
108  void set_module();
110  sigc::signal<void >& signal_freq_changed() { return pitch_tracker.new_freq; }
113 };
114 
115 
116 /****************************************************************
117  ** class NoiseGate
118  */
119 
120 class NoiseGate : public PluginDef {
121 private:
122  inline void inputlevel_process(int count, float *input0, float *output0);
123  inline int noisegate_register(const ParamReg& reg);
124  inline int noisegate_start(bool start);
125  static int noisegate_params_static(const ParamReg& reg);
126  static void inputlevel_compute(int count, float *input0, float *output0, PluginDef*);
127  static int noisegate_activate(bool start, PluginDef *pdef);
128 public:
129  bool off;
130  float fnglevel;
131  float ngate;
135 };
136 
137 /****************************************************************
138  ** class OutPutGate
139  */
140 
141 class OutPutGate : public PluginDef {
142 private:
143  inline void outputgate_process(int count, float *input, float *output);
144  static void outputgate_compute(int count, float *input, float *output, PluginDef*);
145 public:
150 };
151 
152 /****************************************************************
153  ** class OscilloscopeAdapter
154  */
155 
157 private:
159  sigc::signal<void(unsigned int, float*)> size_change;
160  float *buffer;
161  unsigned int buffer_size;
162  friend class OscilloscopeAdapter;
163 public:
164  int load;
165  int frames;
166  bool is_rt;
167  jack_nframes_t bsize;
168 
169  public:
171  jack(nullptr), size_change(), buffer(nullptr), buffer_size(0),
172  load(0), frames(0), is_rt(false), bsize(0) {}
175  void update();
176  float *get_buffer() const { return buffer; }
177  unsigned int get_buffer_size() const { return buffer_size; }
178  sigc::signal<void(unsigned int, float*)> signal_size_change() { return size_change; }
179 };
180 
181 template<>
183 private:
186  sigc::signal<void, const OscilloscopeInfo&> changed;
187  void trigger_changed() override;
188 public:
189  ParameterV(const string& id, OscilloscopeInfo *v);
192  virtual void serializeJSON(gx_system::JsonWriter& jw) override;
193  sigc::signal<void, const OscilloscopeInfo&>& signal_changed() { return changed; }
195  ParamMap &pmap, const string& id, OscilloscopeInfo *v);
196  OscilloscopeInfo& get_value() const { return *value; }
197  virtual void stdJSON_value() override;
198  virtual bool on_off_value() override;
199  virtual void writeJSON(gx_system::JsonWriter& jw) const override;
200  virtual bool compareJSON_value() override;
201  virtual void setJSON_value() override;
202  virtual void readJSON_value(gx_system::JsonParser& jp) override;
203 };
204 
206 
208 public:
210 private:
212  static void fill_buffer(int count, float *input0, float *output0, PluginDef*);
213  static int osc_register(const ParamReg& reg);
214  static int osc_load_ui(const UiBuilder& builder, int format);
215  void change_buffersize(unsigned int);
217 public:
219  void clear_buffer();
220  unsigned int get_size() const { return info.buffer_size; }
221  inline float *get_buffer() const { return info.buffer; }
222  int get_mul_buffer() { return mul_buffer; }
223  void set_mul_buffer(int a, unsigned int b) { mul_buffer = a; change_buffersize(b); }
225  void set_jack(gx_jack::GxJack& jack) { info.jack = &jack; }
226 };
227 
228 
229 /****************************************************************
230  ** class GxSeqSettings
231  */
232 
234  private:
235 
236  std::vector<int> seqline;
238  friend class SequencerAdapter;
239  friend class ParameterV<GxSeqSettings>;
240  public:
243  bool operator==(const GxSeqSettings& seqset) const;
244  // getters and setters
245  inline const std::vector<int>& getseqline() const { return seqline; }
246 
247  inline void setseqline(const std::vector<int>& seq) { seqline = seq; }
248 
249  public:
252 };
253 
254 template<>
256 private:
261  sigc::signal<void, const GxSeqSettings*> changed;
262 public:
263  ParameterV(const string& id, GxSeqSettings *v);
267  sigc::signal<void, const GxSeqSettings*>& signal_changed() { return changed; }
269  ParamMap &pmap, const string& id, GxSeqSettings *v);
270  bool set(const GxSeqSettings& val) const;
271  const GxSeqSettings& get_value() const { return *value; }
272  virtual void stdJSON_value();
273  virtual bool on_off_value();
274  virtual void writeJSON(gx_system::JsonWriter& jw) const;
275  virtual bool compareJSON_value();
276  virtual void setJSON_value();
278 };
279 
281 
282 /****************************************************************
283  ** class GxJConvSettings
284  */
285 
287  private:
288  // main jconv setting
289  std::string fIRFile;
290  std::string fIRDir;
291 
292  float fGain; // jconv gain
293  guint fOffset; // offset in IR where to start comvolution
294  guint fLength; // length of the IR to use for convolution
295  guint fDelay; // delay when to apply reverb
296  Gainline gainline;
297  bool fGainCor;
299  inline void setIRDir(string name) { fIRDir = name; }
300  friend class ConvolverAdapter;
301  friend class ParameterV<GxJConvSettings>;
302  public:
305  bool operator==(const GxJConvSettings& jcset) const;
306  // getters and setters
307  inline const std::string& getIRFile() const { return fIRFile; }
308  std::string getFullIRPath() const;
309  inline float getGain() const { return fGain; }
310  inline guint getOffset() const { return fOffset; }
311  inline guint getLength() const { return fLength; }
312  inline guint getDelay() const { return fDelay; }
313  inline bool getGainCor() const { return fGainCor; }
314  inline const Gainline& getGainline() const { return gainline; }
315  const std::string& getIRDir() const { return fIRDir; }
316  void setFullIRPath(string name);
317  inline void setIRFile(string name) { fIRFile = name; }
318  inline void setGain(float gain) { fGain = gain; }
319  inline void setGainCor(bool gain) { fGainCor = gain; }
320  inline void setOffset(guint offs) { fOffset = offs; }
321  inline void setLength(guint leng) { fLength = leng; }
322  inline void setDelay(guint del) { fDelay = del; }
323  inline void setGainline(const Gainline& gain) { gainline = gain; }
324 
325  public:
328 };
329 
330 class ConvolverAdapter;
331 
332 template<>
334 private:
339  sigc::signal<void, const GxJConvSettings*> changed;
340 public:
341  ParameterV(const string& id, ConvolverAdapter &conv, GxJConvSettings *v);
345  sigc::signal<void, const GxJConvSettings*>& signal_changed() { return changed; }
347  ParamMap &pmap, const string& id, ConvolverAdapter &conv, GxJConvSettings *v);
348  bool set(const GxJConvSettings& val) const;
349  const GxJConvSettings& get_value() const { return *value; }
350  virtual void stdJSON_value();
351  virtual bool on_off_value();
352  virtual void writeJSON(gx_system::JsonWriter& jw) const;
353  virtual bool compareJSON_value();
354  virtual void setJSON_value();
356 };
357 
359 
360 
361 /****************************************************************
362  ** class ConvolverAdapter
363  */
364 
365 class ConvolverAdapter: protected PluginDef, public sigc::trackable {
366 protected:
368  boost::mutex activate_mutex;
370  sigc::slot<void> sync;
371  bool activated;
372  // wrapper for the rack order function pointers
373  void change_buffersize(unsigned int size);
376 public:
378 public:
381  void restart();
382  bool conv_start();
383  inline const std::string& getIRFile() const { return jcset.getIRFile(); }
384  inline void set_sync(bool val) { conv.set_sync(val); }
385  inline std::string getFullIRPath() const { return jcset.getFullIRPath(); }
386  inline const std::string& getIRDir() const { return jcset.getIRDir(); }
387  bool set(const GxJConvSettings& jcset) const { return jcp->set(jcset); }
388  const GxJConvSettings& get_jcset() const { return jcset; }
390 };
391 
392 
393 /****************************************************************
394  ** class ConvolverStereoAdapter
395  */
396 
397 #ifndef GUITARIX_AS_PLUGIN
398 #include "faust/jconv_post.h"
399 #include "faust/jconv_post_mono.h"
400 #else
401 #include "jconv_post.h"
402 #include "jconv_post_mono.h"
403 #endif
404 
406 private:
407  jconv_post::Dsp jc_post;
408  // wrapper for the rack order function pointers
409  static void convolver_init(unsigned int samplingFreq, PluginDef *pdef);
410  static int activate(bool start, PluginDef *pdef);
411  static void convolver(int count, float *input0, float *input1,
412  float *output0, float *output1, PluginDef*);
413  static int convolver_register(const ParamReg& reg);
414  static int jconv_load_ui(const UiBuilder& builder, int format);
415 public:
418 };
419 
420 
421 /****************************************************************
422  ** class ConvolverMonoAdapter
423  */
424 
426 private:
427  jconv_post_mono::Dsp jc_post_mono;
428  // wrapper for the rack order function pointers
429  static void convolver_init(unsigned int samplingFreq, PluginDef *pdef);
430  static int activate(bool start, PluginDef *pdef);
431  static void convolver(int count, float *input, float *output, PluginDef*);
432  static int convolver_register(const ParamReg& reg);
433  static int jconv_load_ui(const UiBuilder& builder, int format);
434 public:
437 };
438 
439 
440 /****************************************************************
441  ** class BaseConvolver
442  */
443 
444 
445 class BaseConvolver: protected PluginDef {
446 protected:
448  boost::mutex activate_mutex;
450  sigc::slot<void> sync;
451  bool activated;
452  sigc::connection update_conn;
453  static void init(unsigned int samplingFreq, PluginDef *p);
454  static int activate(bool start, PluginDef *pdef);
455  void change_buffersize(unsigned int);
456  int conv_start();
458  virtual void check_update() = 0;
459  virtual bool start(bool force = false) = 0;
460 public:
462 public:
464  virtual ~BaseConvolver();
465  inline void set_sync(bool val) { conv.set_sync(val); }
466 };
467 
468 /****************************************************************
469  ** class FixedBaseConvolver
470  */
471 
472 
473 class FixedBaseConvolver: protected PluginDef {
474 protected:
476  boost::mutex activate_mutex;
478  sigc::slot<void> sync;
479  bool activated;
480  unsigned int SamplingFreq;
481  unsigned int buffersize;
482  unsigned int bz;
483  sigc::connection update_conn;
484  static void init(unsigned int samplingFreq, PluginDef *p);
485  unsigned int getSamplingFreq() { return SamplingFreq;};
486  static int activate(bool start, PluginDef *pdef);
487  void change_buffersize(unsigned int);
488  int conv_start();
490  virtual void check_update() = 0;
491  virtual bool start(bool force = false) = 0;
492 public:
494 public:
497  inline void set_sync(bool val) { conv.set_sync(val); }
498 };
499 
500 /****************************************************************
501  ** class CabinetConvolver
502  */
503 
504 #ifndef GUITARIX_AS_PLUGIN
505 #include "faust/cabinet_impulse_former.h"
506 #else
507 #include "cabinet_impulse_former.h"
508 #endif
509 
511 private:
513  float level;
514  int cabinet;
515  float bass;
516  float treble;
518  cabinet_impulse_former::Dsp impf;
520  static void run_cab_conf(int count, float *input, float *output, PluginDef*);
521  static int register_cab(const ParamReg& reg);
522  bool do_update();
523  virtual void check_update() override;
524  virtual bool start(bool force = false) override;
525  bool cabinet_changed() { return current_cab != cabinet; }
527 public:
531 #ifdef GUITARIX_AS_PLUGIN
532  void pl_check_update() { return check_update();}
533 #endif
534 };
535 
536 #ifndef GUITARIX_AS_PLUGIN
537 #include "faust/cabinet_impulse_former_st.h"
538 #else
539 #include "cabinet_impulse_former_st.h"
540 #endif
541 
543 private:
545  float level;
546  int cabinet;
547  float bass;
548  float treble;
550  cabinet_impulse_former_st::Dsp impf;
553  static void run_cab_conf(int count, float *input, float *input1, float *output, float *output1, PluginDef*);
554  static int register_cab(const ParamReg& reg);
555  bool do_update();
556  virtual void check_update() override;
557  virtual bool start(bool force = false) override;
558  bool cabinet_changed() { return current_cab != cabinet; }
560 public:
564 #ifdef GUITARIX_AS_PLUGIN
565  void pl_check_update() { return check_update();}
566 #endif
567 };
568 
569 
570 /****************************************************************
571  ** class PreampConvolver
572  */
573 
574 #ifndef GUITARIX_AS_PLUGIN
575 #include "faust/preamp_impulse_former.h"
576 #else
577 #include "preamp_impulse_former.h"
578 #endif
579 
581 private:
583  float level;
584  int preamp;
585  float bass;
586  float treble;
588  preamp_impulse_former::Dsp impf;
590  static void run_pre_conf(int count, float *input, float *output, PluginDef*);
591  static int register_pre(const ParamReg& reg);
592  bool do_update();
593  virtual void check_update() override;
594  virtual bool start(bool force = false) override;
595  bool preamp_changed() { return current_pre != preamp; }
597 public:
601 #ifdef GUITARIX_AS_PLUGIN
602  void pl_check_update() { return check_update();}
603 #endif
604 };
605 
606 #ifndef GUITARIX_AS_PLUGIN
607 #include "faust/preamp_impulse_former_st.h"
608 #else
609 #include "preamp_impulse_former_st.h"
610 #endif
611 
613 private:
615  float level;
616  int preamp;
617  float bass;
618  float treble;
620  preamp_impulse_former_st::Dsp impf;
623  static void run_pre_conf(int count, float *input, float *input1, float *output, float *output1, PluginDef*);
624  static int register_pre(const ParamReg& reg);
625  bool do_update();
626  virtual void check_update() override;
627  virtual bool start(bool force = false) override;
628  bool preamp_changed() { return current_pre != preamp; }
630 public:
634 #ifdef GUITARIX_AS_PLUGIN
635  void pl_check_update() { return check_update();}
636 #endif
637 };
638 
639 /****************************************************************
640  ** class ContrastConvolver
641  */
642 
643 #ifndef GUITARIX_AS_PLUGIN
644 #include "faust/presence_level.h"
645 #else
646 #include "presence_level.h"
647 #endif
648 
650 private:
651  float level;
652  float sum;
653  presence_level::Dsp presl;
655  static void run_contrast(int count, float *input, float *output, PluginDef*);
656  static int register_con(const ParamReg& reg);
657  inline void update_sum() { sum = level; }
658  virtual void check_update() override;
659  bool do_update();
660  inline bool sum_changed() { return std::abs(sum - level) > 0.01; }
661  virtual bool start(bool force = false) override;
662 public:
666 #ifdef GUITARIX_AS_PLUGIN
667  void pl_check_update() { return check_update();}
668 #endif
669 };
670 
671 /****************************************************************
672  ** class Neural Amp Modeler
673  */
674 
675 class NeuralAmp: public PluginDef {
676 private:
677  nam::DSP* model;
680  sigc::slot<void> sync;
681  volatile int ready;
684  float fVslider0;
685  float fVslider1;
686  double fRec0[2];
687  double fRec1[2];
689  float loudness;
690  bool is_inited;
691  Glib::ustring load_file;
692  std::string idstring;
693 
695  int load_ui_f(const UiBuilder& b, int form);
696  void init(unsigned int sample_rate);
697  void compute(int count, float *input0, float *output0);
699  int register_par(const ParamReg& reg);
700 
702  static void init_static(unsigned int sample_rate, PluginDef*);
703  static int load_ui_f_static(const UiBuilder& b, int form);
704  static void compute_static(int count, float *input0, float *output0, PluginDef*);
705  static int register_params_static(const ParamReg& reg);
706  static void del_instance(PluginDef *p);
707 public:
709  NeuralAmp(ParamMap& param_, std::string id, sigc::slot<void> sync);
711 };
712 
713 /****************************************************************
714  ** class NeuralAmpMulti
715  */
716 
717 class NeuralAmpMulti: public PluginDef {
718 private:
719  nam::DSP* modela;
720  nam::DSP* modelb;
724  sigc::slot<void> sync;
725  volatile int ready;
729  float fVslider0;
730  float fVslider1;
731  float fVslider2;
732  double fRec0[2];
733  double fRec1[2];
734  double fRec2[2];
737  float loudnessa;
738  float loudnessb;
739  bool is_inited;
740  Glib::ustring load_afile;
741  Glib::ustring load_bfile;
742  std::string idstring;
743 
745  int load_ui_f(const UiBuilder& b, int form);
746  void init(unsigned int sample_rate);
747  void compute(int count, float *input0, float *output0);
750  int register_par(const ParamReg& reg);
751 
753  static void init_static(unsigned int sample_rate, PluginDef*);
754  static int load_ui_f_static(const UiBuilder& b, int form);
755  static void compute_static(int count, float *input0, float *output0, PluginDef*);
756  static int register_params_static(const ParamReg& reg);
757  static void del_instance(PluginDef *p);
758 public:
760  NeuralAmpMulti(ParamMap& param_, std::string id, sigc::slot<void> sync);
762 };
763 
764 /****************************************************************
765  ** class RTNeural
766  */
767 
768 class RtNeural: public PluginDef {
769 private:
770  RTNeural::Model<float> *model;
773  sigc::slot<void> sync;
774  volatile int ready;
777  float fVslider0;
778  float fVslider1;
779  double fRec0[2];
780  double fRec1[2];
782  bool is_inited;
783  Glib::ustring load_file;
784  std::string idstring;
785 
787  int load_ui_f(const UiBuilder& b, int form);
788  void init(unsigned int sample_rate);
789  void compute(int count, float *input0, float *output0);
790  void get_samplerate(std::string config_file);
792  int register_par(const ParamReg& reg);
793 
795  static void init_static(unsigned int sample_rate, PluginDef*);
796  static int load_ui_f_static(const UiBuilder& b, int form);
797  static void compute_static(int count, float *input0, float *output0, PluginDef*);
798  static int register_params_static(const ParamReg& reg);
799  static void del_instance(PluginDef *p);
800 public:
802  RtNeural(ParamMap& param_, std::string id, sigc::slot<void> sync);
804 };
805 
806 /****************************************************************
807  ** class RTNeuralMulti
808  */
809 
810 class RtNeuralMulti: public PluginDef {
811 private:
812  RTNeural::Model<float> *modela;
813  RTNeural::Model<float> *modelb;
817  sigc::slot<void> sync;
818  volatile int ready;
822  float fVslider0;
823  float fVslider1;
824  float fVslider2;
825  double fRec0[2];
826  double fRec1[2];
827  double fRec2[2];
830  bool is_inited;
831  Glib::ustring load_afile;
832  Glib::ustring load_bfile;
833  std::string idstring;
834 
836  int load_ui_f(const UiBuilder& b, int form);
837  void init(unsigned int sample_rate);
838  void compute(int count, float *input0, float *output0);
839  void get_samplerate(std::string config_file, int *mSampleRate);
842  int register_par(const ParamReg& reg);
843 
845  static void init_static(unsigned int sample_rate, PluginDef*);
846  static int load_ui_f_static(const UiBuilder& b, int form);
847  static void compute_static(int count, float *input0, float *output0, PluginDef*);
848  static int register_params_static(const ParamReg& reg);
849  static void del_instance(PluginDef *p);
850 public:
852  RtNeuralMulti(ParamMap& param_, std::string id, sigc::slot<void> sync);
854 };
855 
856 /****************************************************************
857  ** class LV2Features
858  */
859 
860 class LV2Features {
861 private:
862 
863  static LV2_Options_Option gx_options[2];
864  static LV2_Feature gx_options_feature;
865 
866  static LV2_URID lv2_urid_map(LV2_URID_Map_Handle, const char* const uri_);
867  static LV2_Feature gx_urid_map_feature;
868 
869 #pragma GCC diagnostic push
870 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
871  static uint32_t lv2_uri_to_id(LV2_URI_Map_Callback_Data handle, const char*, const char* uri);
872  static LV2_URI_Map_Feature gx_uri_map;
873  static LV2_Feature gx_uri_map_feature;
874 #pragma GCC diagnostic pop
875 
876  static const char* lv2_urid_unmap(LV2_URID_Unmap_Handle, const LV2_URID urid);
877  static LV2_Feature gx_urid_unmap_feature;
879 
880 public:
882  {
883  static LV2Features instance;
884  return instance;
885  }
886  static LV2_Feature* gx_features[];
887  static LV2_URID_Map gx_urid_map;
888  static LV2_URID_Unmap gx_urid_unmap;
889 
890  LV2Features(LV2Features const&) = delete;
891  void operator=(LV2Features const&) = delete;
892 
893 };
894 
895 /****************************************************************
896  ** class LadspaLoader
897  */
898 
900 
901 struct paradesc: boost::noncopyable {
902  int index;
903  std::string name;
904  float dflt;
905  float low;
906  float up;
907  float step;
909  bool newrow;
912  paradesc(): index(), name(), dflt(), low(), up(), step(), tp(), newrow(), has_caption(true), values() {}
914  void set_valuelist(const std::vector<std::string>& v);
917 };
918 
919 enum quirkflag { need_activate = 1, no_cleanup = 2, is_lv2 = 4 };
920 
921 class plugdesc {
922 public:
923  std::string path;
924  unsigned int index;
925  unsigned long UniqueID;
926  Glib::ustring Label;
927  Glib::ustring shortname;
928  Glib::ustring category;
929  int quirks; // quirkflag bits
933  Glib::ustring master_label;
934  std::vector<paradesc*> names;
935  std::string id_str;
936 private:
937  plugdesc() {}
939  friend class LadspaLoader;
940 public:
943 };
944 
946 public:
947  typedef std::vector<plugdesc*> pluginarray;
948 private:
951  LilvWorld* world;
953  const LilvPlugins* lv2_plugins;
954  LilvNode* lv2_AudioPort;
955  LilvNode* lv2_ControlPort;
956  LilvNode* lv2_InputPort;
957  LilvNode* lv2_OutputPort;
958  LilvNode* lv2_AtomPort;
959 private:
960  void read_module_config(const std::string& filename, plugdesc *p);
962 public:
965  bool load(pluginarray& p);
966  unsigned int size() { return plugins.size(); }
967  PluginDef *create(unsigned int idx) { return create(plugins[idx]); }
969  pluginarray::iterator begin() { return plugins.begin(); }
970  pluginarray::iterator end() { return plugins.end(); }
971  pluginarray::iterator find(plugdesc* desc);
972  void clear_list();
973  void set_plugins(pluginarray& new_plugins);
974  void update_instance(PluginDef *pdef, plugdesc *pdesc);
975  static std::string get_ladspa_filename(unsigned long uid)
976  { return "ladspa"+gx_system::to_string(uid)+".js"; }
977  static std::string get_ladspa_filename(std::string uid_key)
978  { return "ladspa"+uid_key.substr(9)+".js"; }
979  ParamMap& get_parameter_map() const { return param; }
980  friend class Lv2Dsp;
981 };
982 
983 
984 /****************************************************************
985  ** class Directout
986  */
987 
988 class Directout: public PluginDef {
989 public:
990  float* outdata;
991 private:
993  int bsize;
994  bool fdfill;
996  sigc::slot<void> sync;
997  void mem_alloc();
998  void mem_free();
999  void init(unsigned int samplingFreq);
1000  void compute(int count, float *input0, float *input1, float *output0, float *output1);
1001  void change_buffersize(unsigned int size);
1002 
1003  static void init_static(unsigned int samplingFreq, PluginDef*);
1004  static void compute_static(int count, float *input0, float *input1, float *output0, float *output1, PluginDef*);
1005 public:
1007  float* get_buffer() {return outdata;};
1008  void set_data(bool dfill);
1010  Directout( EngineControl& engine, sigc::slot<void> sync);
1012 };
1013 
1014 
1015 /****************************************************************
1016  ** class LiveLooper
1017  */
1018 
1019 class LiveLooper: public PluginDef {
1020 
1021 
1023 private:
1024  Resampler r_file;
1026 public:
1027  int setup(int _inputRate, int _outputRate);
1028  int run(int count, float *input, float *output);
1029  int max_out_count(int in_count) {
1030  return static_cast<int>(ceil((in_count*static_cast<double>(outputRate))/inputRate)); }
1031 };
1032 
1033 private:
1035  float gain;
1036  float fRec0[2];
1037  float gain_out;
1038  float fclip1;
1039  float fclip2;
1040  float fclip3;
1041  float fclip4;
1042  float fclips1;
1043  float fclips2;
1044  float fclips3;
1045  float fclips4;
1046  float fspeed1;
1047  float fspeed2;
1048  float fspeed3;
1049  float fspeed4;
1050  float rplay1;
1051  float rplay2;
1052  float rplay3;
1053  float rplay4;
1054  float od1;
1055  float od2;
1056  float od3;
1057  float od4;
1058  float fod1;
1059  float fod2;
1060  float fod3;
1061  float fod4;
1062  float record1;
1063  int iVec0[2];
1064  int IOTA1;
1065  int IOTA2;
1066  int IOTA3;
1067  int IOTA4;
1068  float IOTAR1;
1069  float IOTAR2;
1070  float IOTAR3;
1071  float IOTAR4;
1072  float *tape1;
1074  float fConst0;
1075  float fConst1;
1076  float fConst2;
1077  float reset1;
1078  int RecSize1[2];
1079  float rectime0;
1080  float fRec1[2];
1081  float fRec2[2];
1082  int iRec3[2];
1083  int iRec4[2];
1084  float play1;
1085  float playh1;
1086  float gain1;
1087  float record2;
1088  int iVec2[2];
1089  float *tape2;
1091  float reset2;
1092  int RecSize2[2];
1093  float rectime1;
1094  float fRec6[2];
1095  float fRec7[2];
1096  int iRec8[2];
1097  int iRec9[2];
1098  float play2;
1099  float playh2;
1100  float gain2;
1101  float record3;
1102  int iVec4[2];
1103  float *tape3;
1105  float reset3;
1106  int RecSize3[2];
1107  float rectime2;
1108  float fRec11[2];
1109  float fRec12[2];
1110  int iRec13[2];
1111  int iRec14[2];
1112  float play3;
1113  float playh3;
1114  float gain3;
1115  float record4;
1116  int iVec6[2];
1117  float *tape4;
1119  float reset4;
1120  int RecSize4[2];
1121  float rectime3;
1122  float fRec16[2];
1123  float fRec17[2];
1124  int iRec18[2];
1125  int iRec19[2];
1126  float play4;
1127  float playh4;
1128  float gain4;
1129  float play_all;
1130  float dout;
1131  float* outbuffer;
1132  bool save1;
1133  bool save2;
1134  bool save3;
1135  bool save4;
1136  bool first1;
1137  bool first2;
1138  bool first3;
1139  bool first4;
1140  bool RP1;
1141  bool RP2;
1142  bool RP3;
1143  bool RP4;
1144  Glib::ustring preset_name;
1145  Glib::ustring load_file1;
1146  Glib::ustring load_file2;
1147  Glib::ustring load_file3;
1148  Glib::ustring load_file4;
1149  Glib::ustring cur_name;
1150  Glib::ustring loop_dir;
1151  bool save_p;
1154  sigc::slot<void> sync;
1155  volatile int ready;
1158 
1159  int do_resample(int inrate, int insize, float *input, int maxsize);
1160  int do_mono(int c, int f, float *oIn, float *tape, int n);
1162  void mem_alloc();
1163  void mem_free();
1165  int activate(bool start);
1166  int load_ui_f(const UiBuilder& b, int form);
1167  void init(unsigned int samplingFreq);
1168  void compute(int count, float *input0, float *output0);
1169  int register_par(const ParamReg& reg);
1170  void save_array(std::string name);
1171  void load_array(std::string name);
1172  void save_to_wave(std::string fname, float *tape, float fSize, int tape_size);
1173  int load_from_wave(std::string fname, float **tape, int tape_size);
1174  void set_p_state();
1175  void load_tape1();
1176  void load_tape2();
1177  void load_tape3();
1178  void load_tape4();
1179 
1181  static int activate_static(bool start, PluginDef*);
1182  static int load_ui_f_static(const UiBuilder& b, int form);
1183  static void init_static(unsigned int samplingFreq, PluginDef*);
1184  static void compute_static(int count, float *input0, float *output0, PluginDef*);
1185  static int register_params_static(const ParamReg& reg);
1186  static void del_instance(PluginDef *p);
1187 public:
1189  LiveLooper(ParamMap& param_, Directout* d, sigc::slot<void> sync, const string& loop_dir_);
1191 };
1192 
1193 
1194 /****************************************************************
1195  ** class SCapture
1196  */
1197 
1198 
1199 class SCapture: public PluginDef {
1200 private:
1201  SNDFILE * recfile;
1204  int channel;
1205  float fcheckbox0;
1206  float fcheckbox1;
1207  float fslider0;
1208  float fbargraph0;
1209  float fRecC0[2];
1210  float fformat;
1211  int IOTA;
1212  int iA;
1215  float *fRec0;
1216  float *fRec1;
1217  float *tape;
1218  sem_t m_trig;
1219  pthread_t m_pthr;
1220  volatile bool keep_stream;
1222  bool is_wav;
1223  bool err;
1224  float fConst0;
1225  float fRecb0[2];
1226  int iRecb1[2];
1227  float fRecb2[2];
1228  void mem_alloc();
1229  void mem_free();
1231  int activate(bool start);
1232  int load_ui_f(const UiBuilder& b, int form);
1233  void init(unsigned int samplingFreq);
1234  void compute(int count, float *input0, float *output0);
1235  void compute_st(int count, float *input0, float *input1, float *output0, float *output1);
1236  int register_par(const ParamReg& reg);
1237  void save_to_wave(SNDFILE * sf, float *tape, int lSize);
1238  SNDFILE *open_stream(std::string fname);
1239  void close_stream(SNDFILE **sf);
1240  void stop_thread();
1242  void disc_stream();
1243  inline std::string get_ffilename();
1244 
1245  static void *run_thread(void* p);
1247  static int activate_static(bool start, PluginDef*);
1248  static const char *glade_def;
1249  static const char *glade_def_st;
1250  static int load_ui_f_static(const UiBuilder& b, int form);
1251  static void init_static(unsigned int samplingFreq, PluginDef*);
1252  static void compute_static(int count, float *input0, float *output0, PluginDef*);
1253  static void compute_static_st(int count, float *input0, float *input1, float *output0, float *output1, PluginDef*);
1254  static int register_params_static(const ParamReg& reg);
1255  static void del_instance(PluginDef *p);
1256 public:
1258  SCapture(EngineControl& engine, int channel_);
1260 };
1261 
1262 /****************************************************************
1263  ** class DrumSequencer
1264  */
1265 
1266 #ifndef GUITARIX_AS_PLUGIN
1267 #include "faust/drumseq.h"
1268 #else
1269 #include "drumseq.h"
1270 #endif
1271 
1272 class Drumout {
1273 private:
1274  static float* set;
1275  static bool mb;
1276  static float* data;
1278  static void outputdrum_compute(int count, float *input0, float *input1, float *output0, float *output1, PluginDef*);
1279 public:
1280  static void set_plugin(Plugin p);
1281  static void set_data(float* mode, bool ready, float* buf);
1285 };
1286 
1287 
1288 class DrumSequencer: public PluginDef {
1289 private:
1296  drumseq::Dsp drums;
1297 
1298  int counter;
1300  int bsize;
1313  std::vector<int> Vectom;
1314  std::vector<int> Vectom1;
1315  std::vector<int> Vectom2;
1316  std::vector<int> Veckick;
1317  std::vector<int> Vecsnare;
1318  std::vector<int> Vechat;
1319 
1322  sigc::slot<void> sync;
1323  volatile bool ready;
1324  float *outdata;
1337 
1338  void mem_alloc();
1339  void mem_free();
1340  void init(unsigned int samplingFreq);
1341  void compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0);
1342  void change_buffersize(unsigned int size);
1343  int register_par(const ParamReg& reg);
1344 
1346  void reset_tom();
1347  void reset_tom1();
1348  void reset_tom2();
1349  void reset_kick();
1350  void reset_hat();
1351  void reset_snare();
1352 
1353  static void init_static(unsigned int samplingFreq, PluginDef*);
1354  static void compute_static(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0, PluginDef*);
1355  static int register_params_static(const ParamReg& reg);
1356  static void del_instance(PluginDef *p);
1357  static int drum_load_ui(const UiBuilder& builder, int format);
1358 public:
1362 };
1363 
1364 /****************************************************************************
1365 *
1366 * NAME: smbPitchShift.cpp
1367 * VERSION: 1.2
1368 * HOME URL: http://www.dspdimension.com
1369 * KNOWN BUGS: none
1370 *
1371 *
1372 * COPYRIGHT 1999-2009 Stephan M. Bernsee <smb [AT] dspdimension [DOT] com>
1373 *
1374 * Modified for guitarix by Hermann Meyer 2014
1375 *
1376 * The Wide Open License (WOL)
1377 *
1378 * Permission to use, copy, modify, distribute and sell this software and its
1379 * documentation for any purpose is hereby granted without fee, provided that
1380 * the above copyright notice and this license appear in all source copies.
1381 * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF
1382 * ANY KIND. See http://www.dspguru.com/wol.htm for more information.
1383 *
1384 *****************************************************************************/
1385 
1386 
1387 #define M_PI 3.14159265358979323846
1388 #define MAX_FRAME_LENGTH 8096
1389 
1390 class smbPitchShift : public PluginDef {
1391 private:
1395  sigc::slot<void> sync;
1396  volatile bool ready;
1399  float *fpb;
1400  float *expect;
1401  float *hanning;
1402  float *hanningd;
1403  float *resampin;
1404  float *resampin2;
1405  float *resampout;
1406  float *indata2;
1414  float semitones;
1415  float a,b,c,d,l;
1416  float wet;
1417  float dry;
1418  float mpi, mpi1;
1419  float tone;
1421  int latency;
1422  int ai;
1423  int aio;
1424  int ii;
1425  long gRover ;
1426  double magn, phase, tmp, real, imag;
1430  double osamp1,osamp2;
1432 
1435 
1436  inline int load_ui_f(const UiBuilder& b, int form);
1437  int register_par(const ParamReg& reg);
1439 
1440  void mem_alloc();
1441  void mem_free();
1442  void clear_state();
1443  int activate(bool start);
1445  void PitchShift(int count, float *indata, float *outdata);
1446  void change_buffersize(unsigned int size);
1447  static int activate_static(bool start, PluginDef*);
1448  static void del_instance(PluginDef *p);
1449  static int registerparam(const ParamReg& reg);
1450  static int load_ui_f_static(const UiBuilder& b, int form);
1451  static void init(unsigned int sampleRate, PluginDef *plugin);
1452  static void compute_static(int count, float *input0, float *output0, PluginDef *p);
1453 
1454 public:
1458 };
1459 
1460 
1461 } // namespace gx_engine
virtual bool start(bool force=false)=0
static int activate(bool start, PluginDef *pdef)
BaseConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
virtual void check_update()=0
void change_buffersize(unsigned int)
static void init(unsigned int samplingFreq, PluginDef *p)
virtual void check_update() override
cabinet_impulse_former::Dsp impf
gx_resample::FixedRateResampler smp
static void run_cab_conf(int count, float *input, float *output, PluginDef *)
CabinetConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
static int register_cab(const ParamReg &reg)
virtual bool start(bool force=false) override
virtual bool start(bool force=false) override
virtual void check_update() override
CabinetStereoConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
gx_resample::FixedRateResampler smps
static void run_cab_conf(int count, float *input, float *input1, float *output, float *output1, PluginDef *)
gx_resample::FixedRateResampler smp
cabinet_impulse_former_st::Dsp impf
static int register_cab(const ParamReg &reg)
static int register_con(const ParamReg &reg)
gx_resample::FixedRateResampler smp
static void run_contrast(int count, float *input, float *output, PluginDef *)
virtual bool start(bool force=false) override
ContrastConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
virtual void check_update() override
const std::string & getIRFile() const
const std::string & getIRDir() const
void change_buffersize(unsigned int size)
ParamMap & get_parameter_map() const
const GxJConvSettings & get_jcset() const
std::string getFullIRPath() const
bool set(const GxJConvSettings &jcset) const
ConvolverAdapter(EngineControl &engine, sigc::slot< void > sync)
static int convolver_register(const ParamReg &reg)
static void convolver(int count, float *input, float *output, PluginDef *)
ConvolverMonoAdapter(EngineControl &engine, sigc::slot< void > sync)
static void convolver_init(unsigned int samplingFreq, PluginDef *pdef)
static int activate(bool start, PluginDef *pdef)
static int jconv_load_ui(const UiBuilder &builder, int format)
static void convolver(int count, float *input0, float *input1, float *output0, float *output1, PluginDef *)
static void convolver_init(unsigned int samplingFreq, PluginDef *pdef)
ConvolverStereoAdapter(EngineControl &engine, sigc::slot< void > sync)
static int activate(bool start, PluginDef *pdef)
static int convolver_register(const ParamReg &reg)
static int jconv_load_ui(const UiBuilder &builder, int format)
static void compute_static(int count, float *input0, float *input1, float *output0, float *output1, PluginDef *)
void set_data(bool dfill)
static void init_static(unsigned int samplingFreq, PluginDef *)
Directout(EngineControl &engine, sigc::slot< void > sync)
void change_buffersize(unsigned int size)
sigc::slot< void > sync
void compute(int count, float *input0, float *input1, float *output0, float *output1)
void init(unsigned int samplingFreq)
void compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0)
DrumSequencer(EngineControl &engine, sigc::slot< void > sync)
static void init_static(unsigned int samplingFreq, PluginDef *)
void change_buffersize(unsigned int size)
void init(unsigned int samplingFreq)
static int drum_load_ui(const UiBuilder &builder, int format)
static void del_instance(PluginDef *p)
static void compute_static(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0, PluginDef *)
int register_par(const ParamReg &reg)
static int register_params_static(const ParamReg &reg)
static void set_plugin(Plugin p)
static void set_data(float *mode, bool ready, float *buf)
static void outputdrum_compute(int count, float *input0, float *input1, float *output0, float *output1, PluginDef *)
static PluginDef outputdrum
virtual void check_update()=0
FixedBaseConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
static int activate(bool start, PluginDef *pdef)
static void init(unsigned int samplingFreq, PluginDef *p)
virtual bool start(bool force=false)=0
void change_buffersize(unsigned int)
void read_gainline(gx_system::JsonParser &jp)
void writeJSON(gx_system::JsonWriter &w) const
void readJSON(gx_system::JsonParser &jp)
std::string getFullIRPath() const
bool operator==(const GxJConvSettings &jcset) const
const std::string & getIRFile() const
GxJConvSettings & operator=(GxJConvSettings const &jcset)
void setFullIRPath(string name)
const std::string & getIRDir() const
void setGainline(const Gainline &gain)
const Gainline & getGainline() const
void writeJSON(gx_system::JsonWriter &w) const
bool operator==(const GxSeqSettings &seqset) const
void read_seqline(gx_system::JsonParser &jp)
GxSeqSettings & operator=(GxSeqSettings const &seqset)
void readJSON(gx_system::JsonParser &jp)
void setseqline(const std::vector< int > &seq)
const std::vector< int > & getseqline() const
LV2Features(LV2Features const &)=delete
static LV2_Options_Option gx_options[2]
void operator=(LV2Features const &)=delete
static uint32_t lv2_uri_to_id(LV2_URI_Map_Callback_Data handle, const char *, const char *uri)
static LV2_Feature gx_options_feature
static LV2Features & getInstance()
static const char * lv2_urid_unmap(LV2_URID_Unmap_Handle, const LV2_URID urid)
static LV2_Feature gx_urid_map_feature
static LV2_URID_Map gx_urid_map
static LV2_Feature gx_uri_map_feature
static LV2_Feature gx_urid_unmap_feature
static LV2_URID_Unmap gx_urid_unmap
static LV2_URID lv2_urid_map(LV2_URID_Map_Handle, const char *const uri_)
static LV2_Feature * gx_features[]
static LV2_URI_Map_Feature gx_uri_map
PluginDef * create(const plugdesc *p)
void update_instance(PluginDef *pdef, plugdesc *pdesc)
pluginarray::iterator begin()
static std::string get_ladspa_filename(unsigned long uid)
pluginarray::iterator end()
void read_module_list(pluginarray &p)
const LilvPlugins * lv2_plugins
void set_plugins(pluginarray &new_plugins)
PluginDef * create(unsigned int idx)
bool load(pluginarray &p)
static std::string get_ladspa_filename(std::string uid_key)
LadspaLoader(const gx_system::CmdlineOptions &options, ParamMap &param)
ParamMap & get_parameter_map() const
const gx_system::CmdlineOptions & options
std::vector< plugdesc * > pluginarray
void read_module_config(const std::string &filename, plugdesc *p)
pluginarray::iterator find(plugdesc *desc)
int setup(int _inputRate, int _outputRate)
int run(int count, float *input, float *output)
void save_to_wave(std::string fname, float *tape, float fSize, int tape_size)
static void del_instance(PluginDef *p)
int do_mono(int c, int f, float *oIn, float *tape, int n)
LiveLooper(ParamMap &param_, Directout *d, sigc::slot< void > sync, const string &loop_dir_)
int register_par(const ParamReg &reg)
void init(unsigned int samplingFreq)
int load_from_wave(std::string fname, float **tape, int tape_size)
static int activate_static(bool start, PluginDef *)
int do_resample(int inrate, int insize, float *input, int maxsize)
static void compute_static(int count, float *input0, float *output0, PluginDef *)
void save_array(std::string name)
static void init_static(unsigned int samplingFreq, PluginDef *)
static void clear_state_f_static(PluginDef *)
int load_ui_f(const UiBuilder &b, int form)
void load_array(std::string name)
void compute(int count, float *input0, float *output0)
static int register_params_static(const ParamReg &reg)
int activate(bool start)
static int load_ui_f_static(const UiBuilder &b, int form)
static const unsigned int channelcount
static float get(unsigned int channel)
static void process(int count, float *input0, float *input1, float *output0, float *output1, PluginDef *)
static int regparam(const ParamReg &reg)
static int activate(bool start, PluginDef *plugin)
static float maxlevel[channelcount]
static void process(int count, float *input, float *output, PluginDef *)
static int register_params_static(const ParamReg &reg)
NeuralAmp(ParamMap &param_, std::string id, sigc::slot< void > sync)
static int load_ui_f_static(const UiBuilder &b, int form)
void compute(int count, float *input0, float *output0)
static void init_static(unsigned int sample_rate, PluginDef *)
int load_ui_f(const UiBuilder &b, int form)
void init(unsigned int sample_rate)
static void compute_static(int count, float *input0, float *output0, PluginDef *)
sigc::slot< void > sync
gx_resample::FixedRateResampler smp
int register_par(const ParamReg &reg)
static void del_instance(PluginDef *p)
static void clear_state_f_static(PluginDef *)
gx_resample::FixedRateResampler smpb
NeuralAmpMulti(ParamMap &param_, std::string id, sigc::slot< void > sync)
gx_resample::FixedRateResampler smpa
static void clear_state_f_static(PluginDef *)
void compute(int count, float *input0, float *output0)
int load_ui_f(const UiBuilder &b, int form)
static void compute_static(int count, float *input0, float *output0, PluginDef *)
static int register_params_static(const ParamReg &reg)
static void init_static(unsigned int sample_rate, PluginDef *)
static int load_ui_f_static(const UiBuilder &b, int form)
static void del_instance(PluginDef *p)
void init(unsigned int sample_rate)
int register_par(const ParamReg &reg)
void inputlevel_process(int count, float *input0, float *output0)
static void inputlevel_compute(int count, float *input0, float *output0, PluginDef *)
int noisegate_start(bool start)
int noisegate_register(const ParamReg &reg)
static int noisegate_activate(bool start, PluginDef *pdef)
static int noisegate_params_static(const ParamReg &reg)
void set_jack(gx_jack::GxJack &jack)
static int osc_register(const ParamReg &reg)
OscilloscopeAdapter(ModuleSequencer &engine)
void set_mul_buffer(int a, unsigned int b)
static int osc_load_ui(const UiBuilder &builder, int format)
void change_buffersize(unsigned int)
static void fill_buffer(int count, float *input0, float *output0, PluginDef *)
void writeJSON(gx_system::JsonWriter &w) const
unsigned int get_buffer_size() const
sigc::signal< void(unsigned int, float *)> signal_size_change()
sigc::signal< void(unsigned int, float *)> size_change
void readJSON(gx_system::JsonParser &jp)
static void outputgate_compute(int count, float *input, float *output, PluginDef *)
const NoiseGate * noisegate
OutPutGate(const NoiseGate *noisegate)
void outputgate_process(int count, float *input, float *output)
virtual void serializeJSON(gx_system::JsonWriter &jw)
ParameterV(const string &id, ConvolverAdapter &conv, GxJConvSettings *v)
sigc::signal< void, const GxJConvSettings * > & signal_changed()
bool set(const GxJConvSettings &val) const
static ParameterV< GxJConvSettings > * insert_param(ParamMap &pmap, const string &id, ConvolverAdapter &conv, GxJConvSettings *v)
const GxJConvSettings & get_value() const
virtual void readJSON_value(gx_system::JsonParser &jp)
sigc::signal< void, const GxJConvSettings * > changed
virtual void writeJSON(gx_system::JsonWriter &jw) const
ParameterV(gx_system::JsonParser &jp)
bool set(const GxSeqSettings &val) const
static ParameterV< GxSeqSettings > * insert_param(ParamMap &pmap, const string &id, GxSeqSettings *v)
sigc::signal< void, const GxSeqSettings * > & signal_changed()
const GxSeqSettings & get_value() const
virtual void writeJSON(gx_system::JsonWriter &jw) const
virtual void readJSON_value(gx_system::JsonParser &jp)
virtual void serializeJSON(gx_system::JsonWriter &jw)
sigc::signal< void, const GxSeqSettings * > changed
ParameterV(gx_system::JsonParser &jp)
ParameterV(const string &id, GxSeqSettings *v)
ParameterV(const string &id, OscilloscopeInfo *v)
ParameterV(gx_system::JsonParser &jp)
virtual bool compareJSON_value() override
virtual void serializeJSON(gx_system::JsonWriter &jw) override
static ParameterV< OscilloscopeInfo > * insert_param(ParamMap &pmap, const string &id, OscilloscopeInfo *v)
virtual void writeJSON(gx_system::JsonWriter &jw) const override
sigc::signal< void, const OscilloscopeInfo & > changed
virtual void readJSON_value(gx_system::JsonParser &jp) override
sigc::signal< void, const OscilloscopeInfo & > & signal_changed()
sigc::signal< void > new_freq
void set_fast_note_detection(bool v)
virtual bool start(bool force=false) override
gx_resample::FixedRateResampler smp
static int register_pre(const ParamReg &reg)
static void run_pre_conf(int count, float *input, float *output, PluginDef *)
preamp_impulse_former::Dsp impf
virtual void check_update() override
PreampConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
gx_resample::FixedRateResampler smps
virtual bool start(bool force=false) override
static int register_pre(const ParamReg &reg)
virtual void check_update() override
preamp_impulse_former_st::Dsp impf
PreampStereoConvolver(EngineControl &engine, sigc::slot< void > sync, gx_resample::BufferResampler &resamp)
static void run_pre_conf(int count, float *input, float *input1, float *output, float *output1, PluginDef *)
gx_resample::FixedRateResampler smp
static int load_ui_f_static(const UiBuilder &b, int form)
RtNeural(ParamMap &param_, std::string id, sigc::slot< void > sync)
void compute(int count, float *input0, float *output0)
gx_resample::FixedRateResampler smp
int load_ui_f(const UiBuilder &b, int form)
sigc::slot< void > sync
static void compute_static(int count, float *input0, float *output0, PluginDef *)
int register_par(const ParamReg &reg)
static void init_static(unsigned int sample_rate, PluginDef *)
static int register_params_static(const ParamReg &reg)
static void del_instance(PluginDef *p)
void init(unsigned int sample_rate)
void get_samplerate(std::string config_file)
static void clear_state_f_static(PluginDef *)
RTNeural::Model< float > * model
gx_resample::FixedRateResampler smpa
RTNeural::Model< float > * modela
void compute(int count, float *input0, float *output0)
static void clear_state_f_static(PluginDef *)
RTNeural::Model< float > * modelb
static int register_params_static(const ParamReg &reg)
gx_resample::FixedRateResampler smpb
static void del_instance(PluginDef *p)
int load_ui_f(const UiBuilder &b, int form)
int register_par(const ParamReg &reg)
static int load_ui_f_static(const UiBuilder &b, int form)
void get_samplerate(std::string config_file, int *mSampleRate)
static void init_static(unsigned int sample_rate, PluginDef *)
void init(unsigned int sample_rate)
RtNeuralMulti(ParamMap &param_, std::string id, sigc::slot< void > sync)
static void compute_static(int count, float *input0, float *output0, PluginDef *)
static int activate_static(bool start, PluginDef *)
void close_stream(SNDFILE **sf)
void save_to_wave(SNDFILE *sf, float *tape, int lSize)
static void compute_static_st(int count, float *input0, float *input1, float *output0, float *output1, PluginDef *)
int activate(bool start)
std::string get_ffilename()
void compute(int count, float *input0, float *output0)
static void init_static(unsigned int samplingFreq, PluginDef *)
static void * run_thread(void *p)
void init(unsigned int samplingFreq)
static void clear_state_f_static(PluginDef *)
int load_ui_f(const UiBuilder &b, int form)
SCapture(EngineControl &engine, int channel_)
static const char * glade_def
static void compute_static(int count, float *input0, float *output0, PluginDef *)
static int load_ui_f_static(const UiBuilder &b, int form)
SNDFILE * open_stream(std::string fname)
void compute_st(int count, float *input0, float *input1, float *output0, float *output1)
int register_par(const ParamReg &reg)
static void del_instance(PluginDef *p)
static int register_params_static(const ParamReg &reg)
static const char * glade_def_st
static void process(int count, float *input0, float *input1, float *output0, float *output1, PluginDef *)
static int regparam(const ParamReg &reg)
static void feed_tuner(int count, float *input, float *output, PluginDef *)
void set_fast_note_detection(bool on)
void set_and_check(int use, bool on)
static int activate(bool start, PluginDef *plugin)
TunerAdapter(ModuleSequencer &engine)
sigc::signal< void > & signal_freq_changed()
void set_dep_module(Plugin *dep)
static void init(unsigned int samplingFreq, PluginDef *plugin)
void readJSON(gx_system::JsonParser &jp)
std::vector< paradesc * > names
void writeJSON(gx_system::JsonWriter &jw)
float gSynMagn[MAX_FRAME_LENGTH]
void PitchShift(int count, float *indata, float *outdata)
float gInFIFO[MAX_FRAME_LENGTH]
gx_resample::SimpleResampler resamp
float gAnaMagn[MAX_FRAME_LENGTH]
float gLastPhase[MAX_FRAME_LENGTH/2+1]
int activate(bool start)
float gSynFreq[MAX_FRAME_LENGTH]
int load_ui_f(const UiBuilder &b, int form)
fftwf_complex fftw_out[MAX_FRAME_LENGTH]
float gAnaFreq[MAX_FRAME_LENGTH]
static void compute_static(int count, float *input0, float *output0, PluginDef *p)
static int activate_static(bool start, PluginDef *)
smbPitchShift(EngineControl &engine, sigc::slot< void > sync)
float gOutputAccum[2 *MAX_FRAME_LENGTH]
static void init(unsigned int sampleRate, PluginDef *plugin)
static int registerparam(const ParamReg &reg)
static int load_ui_f_static(const UiBuilder &b, int form)
fftwf_complex fftw_in[MAX_FRAME_LENGTH]
static void del_instance(PluginDef *p)
float gSumPhase[MAX_FRAME_LENGTH/2+1]
int register_par(const ParamReg &reg)
void change_buffersize(unsigned int size)
bool setParameters(int sampleRate)
float gOutFIFO[MAX_FRAME_LENGTH]
#define FAUSTFLOAT
#define MAX_FRAME_LENGTH
ParameterV< OscilloscopeInfo > OscParameter
ParameterV< GxSeqSettings > SeqParameter
ParameterV< GxJConvSettings > JConvParameter
std::string to_string(const T &t)
Definition: gx_system.h:572
Parameter registration function pointers.
Definition: gx_plugin.h:141
const char * name
Definition: gx_plugin.h:200
void writeJSON(gx_system::JsonWriter &jw)
void readJSON(gx_system::JsonParser &jp)
void set_valuelist(const std::vector< std::string > &v)