26 namespace gx_jack {
class GxJack; }
36 static void process(
int count,
float *input,
float *output,
PluginDef*);
43 static void process(
int count,
float *input0,
float *input1,
44 float *output0,
float *output1,
PluginDef*);
51 static const unsigned int channelcount = 2;
53 static float maxlevel[channelcount];
54 static void process(
int count,
float *input0,
float *input1,
55 float *output0,
float *output1,
PluginDef*);
58 static float get(
unsigned int channel) {
59 assert(channel < channelcount);
60 float v = maxlevel[channel];
61 maxlevel[channel] = 0;
74 static void feed_tuner(
int count,
float *input,
float *output,
PluginDef*);
75 static int regparam(
const ParamReg& reg);
77 static void init(
unsigned int samplingFreq,
PluginDef *plugin);
81 enum { tuner_use = 0x01, switcher_use = 0x02, midi_use = 0x04 };
82 void set_and_check(
int use,
bool on);
164 unsigned char* midi_send;
165 unsigned char* midi_send1;
166 unsigned char* midi_send2;
169 void register_parameter(
const ParamReg& reg);
170 void init(
int samplingFreq);
171 void process_midi(
int len,
float *audiodata,
void *midi_port_buf,
float jcpu_load,
172 float fConsta4,
float fConsta1t);
179 enum Load { load_off = -1, load_low = 0, load_high = 1, load_over = 2 };
185 Glib::Dispatcher overload_change;
186 static void fill_buffer(
int count,
float *input0,
float *output0,
PluginDef*);
187 static int regparam(
const ParamReg& reg);
188 static void init(
unsigned int samplingFreq,
PluginDef *plugin);
207 static float fnglevel;
210 static int noisegate_register(
const ParamReg& reg);
211 static void inputlevel_compute(
int count,
float *input0,
float *output0,
PluginDef*);
212 static void outputgate_compute(
int count,
float *input,
float *output,
PluginDef*);
227 static float* buffer;
228 static unsigned int size;
229 static void fill_buffer(
int count,
float *input0,
float *output0,
PluginDef*);
230 static int osc_register(
const ParamReg& reg);
232 void change_buffersize(
unsigned int);
242 void set_mul_buffer(
int a,
unsigned int b) { mul_buffer = a; change_buffersize(b); }
254 std::vector<int> seqline;
256 friend class SequencerAdapter;
263 inline const std::vector<int>&
getseqline()
const {
return seqline; }
265 inline void setseqline(
const std::vector<int>& seq) { seqline = seq; }
279 sigc::signal<void, const GxSeqSettings*> changed;
290 virtual void stdJSON_value();
291 virtual bool on_off_value();
293 virtual bool compareJSON_value();
294 virtual void setJSON_value();
317 inline void setIRDir(
string name) { fIRDir = name; }
325 inline const std::string&
getIRFile()
const {
return fIRFile; }
326 std::string getFullIRPath()
const;
327 inline float getGain()
const {
return fGain; }
333 const std::string&
getIRDir()
const {
return fIRDir; }
334 void setFullIRPath(
string name);
336 inline void setGain(
float gain) { fGain = gain; }
341 inline void setGainline(
const Gainline& gain) { gainline = gain; }
359 sigc::signal<void, const GxJConvSettings*> changed;
370 virtual void stdJSON_value();
371 virtual bool on_off_value();
373 virtual bool compareJSON_value();
374 virtual void setJSON_value();
394 void change_buffersize(
unsigned int size);
418 #include "faust/jconv_post.h" 419 #include "faust/jconv_post_mono.h" 423 jconv_post::Dsp jc_post;
425 static void convolver_init(
unsigned int samplingFreq,
PluginDef *pdef);
427 static void convolver(
int count,
float *input0,
float *input1,
428 float *output0,
float *output1,
PluginDef*);
429 static int convolver_register(
const ParamReg& reg);
442 jconv_post_mono::Dsp jc_post_mono;
444 static void convolver_init(
unsigned int samplingFreq,
PluginDef *pdef);
446 static void convolver(
int count,
float *input,
float *output,
PluginDef*);
447 static int convolver_register(
const ParamReg& reg);
469 void change_buffersize(
unsigned int);
471 bool check_update_timeout();
472 virtual void check_update() = 0;
473 virtual bool start(
bool force =
false) = 0;
501 void change_buffersize(
unsigned int);
503 bool check_update_timeout();
504 virtual void check_update() = 0;
505 virtual bool start(
bool force =
false) = 0;
518 #include "faust/cabinet_impulse_former.h" 529 cabinet_impulse_former::Dsp impf;
531 static void run_cab_conf(
int count,
float *input,
float *output,
PluginDef*);
532 static int register_cab(
const ParamReg& reg);
534 virtual void check_update();
535 virtual bool start(
bool force =
false);
536 bool cabinet_changed() {
return current_cab != cabinet; }
537 void update_cabinet() { current_cab = cabinet; }
538 bool sum_changed() {
return std::abs(sum - (level + bass + treble)) > 0.01; }
539 void update_sum() { sum = level + bass + treble; }
546 #include "faust/cabinet_impulse_former_st.h" 557 cabinet_impulse_former_st::Dsp impf;
560 static void run_cab_conf(
int count,
float *input,
float *input1,
float *output,
float *output1,
PluginDef*);
561 static int register_cab(
const ParamReg& reg);
563 virtual void check_update();
564 virtual bool start(
bool force =
false);
565 bool cabinet_changed() {
return current_cab != cabinet; }
566 void update_cabinet() { current_cab = cabinet; }
567 bool sum_changed() {
return fabs(sum - (level + bass + treble)) > 0.01; }
568 void update_sum() { sum = level + bass + treble; }
580 #include "faust/preamp_impulse_former.h" 591 preamp_impulse_former::Dsp impf;
593 static void run_pre_conf(
int count,
float *input,
float *output,
PluginDef*);
594 static int register_pre(
const ParamReg& reg);
596 virtual void check_update();
597 virtual bool start(
bool force =
false);
598 bool preamp_changed() {
return current_pre != preamp; }
599 void update_preamp() { current_pre = preamp; }
600 bool sum_changed() {
return std::abs(sum - (level + bass + treble)) > 0.01; }
601 void update_sum() { sum = level + bass + treble; }
608 #include "faust/preamp_impulse_former_st.h" 619 preamp_impulse_former_st::Dsp impf;
622 static void run_pre_conf(
int count,
float *input,
float *input1,
float *output,
float *output1,
PluginDef*);
623 static int register_pre(
const ParamReg& reg);
625 virtual void check_update();
626 virtual bool start(
bool force =
false);
627 bool preamp_changed() {
return current_pre != preamp; }
628 void update_preamp() { current_pre = preamp; }
629 bool sum_changed() {
return fabs(sum - (level + bass + treble)) > 0.01; }
630 void update_sum() { sum = level + bass + treble; }
641 #include "faust/presence_level.h" 647 presence_level::Dsp presl;
649 static void run_contrast(
int count,
float *input,
float *output,
PluginDef*);
650 static int register_con(
const ParamReg& reg);
651 inline void update_sum() { sum = level; }
652 virtual void check_update();
654 inline bool sum_changed() {
return std::abs(sum - level) > 0.01; }
655 virtual bool start(
bool force =
false);
669 static LV2_Options_Option gx_options[2];
670 static LV2_Feature gx_options_feature;
672 static LV2_URID lv2_urid_map(LV2_URID_Map_Handle,
const char*
const uri_);
673 static LV2_Feature gx_urid_map_feature;
675 static uint32_t lv2_uri_to_id(LV2_URI_Map_Callback_Data handle,
const char*,
const char* uri);
676 static LV2_URI_Map_Feature gx_uri_map;
677 static LV2_Feature gx_uri_map_feature;
679 static const char* lv2_urid_unmap(LV2_URID_Unmap_Handle,
const LV2_URID urid);
680 static LV2_Feature gx_urid_unmap_feature;
689 static LV2_Feature* gx_features[];
715 paradesc(): index(), name(), dflt(), low(), up(), step(), tp(), newrow(), has_caption(true), values() {}
717 void set_valuelist(
const std::vector<std::string>& v);
755 const LilvPlugins* lv2_plugins;
756 LilvNode* lv2_AudioPort;
757 LilvNode* lv2_ControlPort;
758 LilvNode* lv2_InputPort;
759 LilvNode* lv2_OutputPort;
761 void read_module_config(
const std::string& filename,
plugdesc *p);
762 void read_module_list(pluginarray& p);
766 bool load(pluginarray& p);
767 unsigned int size() {
return plugins.size(); }
770 pluginarray::iterator
begin() {
return plugins.begin(); }
771 pluginarray::iterator
end() {
return plugins.end(); }
772 pluginarray::iterator find(
plugdesc* desc);
773 void set_plugins(pluginarray& new_plugins);
774 void change_plugins(pluginarray& new_plugins);
779 {
return "ladspa"+uid_key.substr(9)+
".js"; }
796 sigc::slot<void> sync;
799 void init(
unsigned int samplingFreq);
800 void compute(
int count,
float *input0,
float *input1,
float *output0,
float *output1);
801 void change_buffersize(
unsigned int size);
803 static void init_static(
unsigned int samplingFreq,
PluginDef*);
804 static void compute_static(
int count,
float *input0,
float *input1,
float *output0,
float *output1,
PluginDef*);
808 void set_data(
bool dfill);
823 class FileResampler {
826 int inputRate, outputRate;
829 int setup(
int _inputRate,
int _outputRate);
830 int run(
int count,
float *input,
float *output);
831 int max_out_count(
int in_count) {
832 return static_cast<int>(ceil((in_count*static_cast<double>(outputRate))/inputRate)); }
950 Glib::ustring preset_name;
951 Glib::ustring load_file1;
952 Glib::ustring load_file2;
953 Glib::ustring load_file3;
954 Glib::ustring load_file4;
955 Glib::ustring cur_name;
956 Glib::ustring loop_dir;
960 sigc::slot<void> sync;
965 int do_resample(
int inrate,
int insize,
float *input,
int maxsize);
966 int do_mono(
int c,
int f,
float *oIn,
float *tape,
int n);
967 void play_all_tapes();
970 void clear_state_f();
971 int activate(
bool start);
972 int load_ui_f(
const UiBuilder& b,
int form);
973 void init(
unsigned int samplingFreq);
974 void compute(
int count,
float *input0,
float *output0);
975 int register_par(
const ParamReg& reg);
976 void save_array(std::string name);
977 void load_array(std::string name);
978 void save_to_wave(std::string fname,
float *tape,
float fSize,
int tape_size);
979 int load_from_wave(std::string fname,
float **tape,
int tape_size);
986 static void clear_state_f_static(
PluginDef*);
987 static int activate_static(
bool start,
PluginDef*);
988 static int load_ui_f_static(
const UiBuilder& b,
int form);
989 static void init_static(
unsigned int samplingFreq,
PluginDef*);
990 static void compute_static(
int count,
float *input0,
float *output0,
PluginDef*);
991 static int register_params_static(
const ParamReg& reg);
1026 volatile bool keep_stream;
1036 void clear_state_f();
1037 int activate(
bool start);
1038 int load_ui_f(
const UiBuilder& b,
int form);
1039 void init(
unsigned int samplingFreq);
1040 void compute(
int count,
float *input0,
float *output0);
1041 void compute_st(
int count,
float *input0,
float *input1,
float *output0,
float *output1);
1042 int register_par(
const ParamReg& reg);
1043 void save_to_wave(SNDFILE * sf,
float *tape,
int lSize);
1044 SNDFILE *open_stream(std::string fname);
1045 void close_stream(SNDFILE **sf);
1047 void start_thread();
1049 inline std::string get_ffilename();
1051 static void *run_thread(
void* p);
1052 static void clear_state_f_static(
PluginDef*);
1053 static int activate_static(
bool start,
PluginDef*);
1054 static const char *glade_def;
1055 static const char *glade_def_st;
1056 static int load_ui_f_static(
const UiBuilder& b,
int form);
1057 static void init_static(
unsigned int samplingFreq,
PluginDef*);
1058 static void compute_static(
int count,
float *input0,
float *output0,
PluginDef*);
1059 static void compute_static_st(
int count,
float *input0,
float *input1,
float *output0,
float *output1,
PluginDef*);
1060 static int register_params_static(
const ParamReg& reg);
1072 #include "faust/drumseq.h" 1079 static Plugin input_drum;
1080 static void outputdrum_compute(
int count,
float *input0,
float *input1,
float *output0,
float *output1,
PluginDef*);
1082 static void set_plugin(
Plugin p);
1083 static void set_data(
float* mode,
bool ready,
float* buf);
1116 std::vector<int> Vectom;
1117 std::vector<int> Vectom1;
1118 std::vector<int> Vectom2;
1119 std::vector<int> Veckick;
1120 std::vector<int> Vecsnare;
1121 std::vector<int> Vechat;
1125 sigc::slot<void> sync;
1126 volatile bool ready;
1132 SeqParameter *tomp1;
1134 SeqParameter *tomp2;
1136 SeqParameter *snarep;
1140 SeqParameter *kickp;
1144 void init(
unsigned int samplingFreq);
1146 void change_buffersize(
unsigned int size);
1147 int register_par(
const ParamReg& reg);
1157 static void init_static(
unsigned int samplingFreq,
PluginDef*);
1159 static int register_params_static(
const ParamReg& reg);
1190 #define M_PI 3.14159265358979323846 1191 #define MAX_FRAME_LENGTH 8096 1198 sigc::slot<void> sync;
1199 volatile bool ready;
1224 int octave, osamp, numSampsToResamp, numSampsToProcess, fftFrameSize, sampleRate ;
1229 long gRover , gInit ;
1230 double magn, phase, tmp, window, real, imag;
1231 double freqPerBin, freqPerBin1, freqPerBin2, expct;
1232 double fftFrameSize3;
1233 double fftFrameSize4;
1234 double osamp1,osamp2;
1235 long i,k, qpd, index, inFifoLatency, stepSize, fftFrameSize2;
1238 fftwf_plan ftPlanForward, ftPlanInverse;
1240 inline int load_ui_f(
const UiBuilder& b,
int form);
1241 int register_par(
const ParamReg& reg);
1242 void change_latency();
1247 int activate(
bool start);
1248 bool setParameters(
int sampleRate);
1249 void PitchShift(
int count,
float *indata,
float *outdata);
1250 void change_buffersize(
unsigned int size);
1251 static int activate_static(
bool start,
PluginDef*);
1253 static int registerparam(
const ParamReg& reg);
1254 static int load_ui_f_static(
const UiBuilder& b,
int form);
1255 static void init(
unsigned int sampleRate,
PluginDef *plugin);
1256 static void compute_static(
int count,
float *input0,
float *output0,
PluginDef *p);
void used_by_midi(bool on)
ParameterV< GxSeqSettings > SeqParameter
static LV2_URID_Unmap gx_urid_unmap
CmdConnection::msg_type start
void setseqline(const std::vector< int > &seq)
Glib::Dispatcher & signal_jack_load_change()
pluginarray::iterator end()
const std::vector< int > & getseqline() const
ParameterV< GxJConvSettings > JConvParameter
const std::string & getIRDir() const
const Gainline & getGainline() const
std::string getFullIRPath() const
void set_jack(gx_jack::GxJack *jack_)
static std::string get_ladspa_filename(std::string uid_key)
std::vector< plugdesc * > pluginarray
bool set(const GxJConvSettings &val) const
unsigned int getSamplingFreq()
std::string getFullIRPath() const
const std::string & getIRDir() const
void used_for_display(bool on)
static Plugin output_drum
sigc::connection update_conn
sigc::signal< void, const GxJConvSettings * > & signal_changed()
const GxJConvSettings & get_jcset() const
const std::string & getIRFile() const
boost::mutex activate_mutex
static PluginDef outputdrum
sigc::signal< int, bool > activation
PluginDef * create(unsigned int idx)
static PluginDef outputgate
void used_for_switching(bool on)
void setGainCor(bool gain)
sigc::connection update_conn
static Plugin directoutput
const std::string & getIRFile() const
static LV2_URID_Map gx_urid_map
boost::mutex activate_mutex
Glib::ustring master_label
std::string to_string(const T &t)
sigc::signal< void, unsigned int > size_change
std::vector< paradesc * > names
void setOffset(guint offs)
const GxJConvSettings & get_value() const
static LV2Features & getInstance()
boost::mutex activate_mutex
pluginarray::iterator begin()
void setGainline(const Gainline &gain)
float get_estimated_note()
void set_dep_module(Plugin *dep)
Glib::Dispatcher & signal_freq_changed()
sigc::signal< void, const GxSeqSettings * > & signal_changed()
ParamMap & get_parameter_map() const
unsigned int SamplingFreq
void setIRFile(string name)
static std::string get_ladspa_filename(unsigned long uid)
float get_estimated_freq()
void setLength(guint leng)
std::string fformat(float value, float step)
Glib::Dispatcher new_freq
const GxSeqSettings & get_value() const
void set_mul_buffer(int a, unsigned int b)