Codebase list guitarix / 548f704
Imported Upstream version 0.32.1 Ross Gammon 8 years ago
81 changed file(s) with 3617 addition(s) and 412 deletion(s). Raw diff Collapse all Expand all
0 guitarix2 (0.32.1) unstable; urgency=low
1 * fix LADSPA/LV2 plugin load / unload / UI modification
2
3 -- brummer <brummer-@web.de> Tue, 04 Dec 2014 04:30:35 +0200
4
5 guitarix2 (0.32.0) unstable; urgency=low
6 * add GxMultiBandReverb.LV2
7 * add 19-TET and 31-TET tuning scale to guitarix and gxtuner.lv2
8 * fix empty effect menu with clear-skin option
9 * add Midi Clock support
10 * add Jack Transport Support
11 * move a couple of Controllers from unit:ms|hz to unit:bpm
12
13 -- brummer <brummer-@web.de> Tue, 20 Nov 2014 14:30:35 +0200
14
015 guitarix2 (0.31.0) unstable; urgency=low
116 * add GxDigitalDelay.LV2
217 * add GxRoomSimulation.LV2
3030 PROP_DISPLAY_FLAT,
3131 PROP_STREAMING,
3232 PROP_TIMESTEP,
33 PROP_LIMIT_TIMESTEP
33 PROP_LIMIT_TIMESTEP,
34 PROP_TEMPERAMENT
3435 };
3536
3637 enum {
121122 "limit-timestep", P_("In-Limit Time Step"),
122123 P_("time interval in msec for refreshing the streaming match display"),
123124 1, 100, 8, GParamFlags(G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)));
125 g_object_class_install_property(
126 gobject_class, PROP_TEMPERAMENT, g_param_spec_int (
127 "temperament", P_("Temperament"),
128 P_("Division of the octave into temperament steps"),
129 1, 1000, 50, GParamFlags(G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)));
124130 /* new signals */
125131 signals[FREQUENCY_POLL] =
126132 g_signal_new(I_("frequency-poll"),
140146 G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
141147 }
142148
143 static const char *note_sharp[] = {"F#","G","G#","A","A#","B","C","C#","D","D#","E","F"};
144 static const char *note_flat[] = {"Gb","G","Ab","A","Bb","B","C","Db","D","Eb","E","F"};
149 static const char *note_sharp[] = {"A","A#","B","C","C#","D","D#","E","F","F#","G","G#"};
150 static const char *note_flat[] = {"A","Bb","B","C","Db","D","Eb","E","F","Gb","G","Ab"};
151 static const char* note_19[19] = {"A","A♯","B♭","B","B♯","C","C♯","D♭","D","D♯","E♭","E","E♯","F","F♯","G♭","G","G♯","A♭"};
152 static const char* note_31[31] = {"A","B♭♭","A♯","B♭","A♯♯","B","C♭","B♯","C ","D♭♭","C♯","D♭","C♯♯","D","E♭♭","D♯","E♭","D♯♯","E","F♭","E♯","F","G♭♭","F♯","G♭","F♯♯","G","A♭♭","G♯","A♭","G♯♯"};
145153 static const char *octave[] = {"0","1","2","3","4","5"," "};
146154
147155 static void gx_rack_tuner_init (GxRackTuner *tuner)
154162 tuner->timestep = 50;
155163 tuner->in_limit_timestep = 8;
156164 tuner->n_targets = 0;
165 tuner->temperament = 0;
157166 // state
158167 tuner->pos = 0.0;
159168 tuner->in_limit = FALSE;
166175 tuner->in_limit_id = 0;
167176 tuner->target_oc = 0;
168177 tuner->target_note = 0;
178 tuner->target_temperament = 12;
169179 tuner->strng = 0;
170180 // caculated layout
171181 tuner->led_count = 0;
230240 {
231241 g_assert(GX_IS_RACK_TUNER(tuner));
232242 tuner->display_flat = display_flat;
243 if (tuner->temperament == 0) {
233244 if (display_flat) {
234245 tuner->note = note_flat;
235246 } else {
236247 tuner->note = note_sharp;
248 }
237249 }
238250 g_object_notify(G_OBJECT(tuner), "display_flat");
239251 }
270282 return tuner->in_limit_timestep;
271283 }
272284
285 void gx_rack_tuner_set_temperament(GxRackTuner *tuner, gint temperament)
286 {
287 g_assert(GX_IS_RACK_TUNER(tuner));
288 tuner->temperament = temperament;
289 if (tuner->temperament == 0) {
290 tuner->target_temperament = 12;
291 if (tuner->display_flat) {
292 tuner->note = note_flat;
293 } else {
294 tuner->note = note_sharp;
295 }
296 } else if (tuner->temperament == 1) {
297 tuner->target_temperament = 19;
298 tuner->note = note_19;
299 } else if (tuner->temperament == 2) {
300 tuner->target_temperament = 31;
301 tuner->note = note_31;
302 }
303 g_object_notify(G_OBJECT(tuner), "temperament");
304 }
305
306 gint gx_rack_tuner_get_temperament(GxRackTuner *tuner)
307 {
308 g_assert(GX_IS_TUNER(tuner));
309 return tuner->temperament;
310 }
311
273312 void gx_rack_tuner_clear_notes(GxRackTuner *tuner)
274313 {
275314 g_assert(GX_IS_RACK_TUNER(tuner));
276315 tuner->n_targets = 0;
277316 }
278317
279 gboolean gx_rack_tuner_push_note(GxRackTuner *tuner, gint note)
318
319
320
321 gboolean gx_rack_tuner_push_note(GxRackTuner *tuner, gint note, gint A, gint TET)
280322 {
281323 g_assert(GX_IS_RACK_TUNER(tuner));
282324 if (tuner->n_targets >= RACKTUNER_MAXTARGETS) {
283325 return FALSE;
284326 }
285 tuner->targets[tuner->n_targets++] = note - 18;
327 double note2freq = 440.00*pow(2.0, double(note-A)/TET);
328 gint freq2note = round(tuner->target_temperament*(log2(note2freq/440.00)+4));
329 tuner->targets[tuner->n_targets++] = freq2note ;
286330 return TRUE;
287331 }
288332
318362 case PROP_LIMIT_TIMESTEP:
319363 gx_rack_tuner_set_limit_timestep(tuner, g_value_get_int(value));
320364 break;
365 case PROP_TEMPERAMENT:
366 gx_rack_tuner_set_temperament(tuner, g_value_get_int(value));
367 break;
321368 default:
322369 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
323370 break;
350397 break;
351398 case PROP_LIMIT_TIMESTEP:
352399 g_value_set_int(value, tuner->in_limit_timestep);
400 break;
401 case PROP_TEMPERAMENT:
402 g_value_set_int(value, tuner->temperament);
353403 break;
354404 default:
355405 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
371421 if (scale) {
372422 *scale = fnote - *note;
373423 }
374 *oc = int(round(fnoter/12));
424 *oc = int(round(fnoter/tuner->target_temperament));
375425 int octsz = sizeof(octave) / sizeof(octave[0]);
376426 if (*oc < 0 || *oc >= octsz) {
377427 *oc = octsz - 1;
378428 }
379 *note = *note % 12;
429 *note = *note % tuner->target_temperament;
380430 if (*note < 0) {
381 *note += 12;
431 *note += tuner->target_temperament;
382432 }
383433 }
384434
385435 static void gx_rack_tuner_calc(GxRackTuner *tuner)
386436 {
387 double fvis = 12 * (log2(tuner->parent.freq/tuner->parent.reference_pitch) + 4) + 3;
437 double fvis = tuner->target_temperament * (log2(tuner->parent.freq/tuner->parent.reference_pitch) + 4);
388438 gx_rack_tuner_pitch_to_note(tuner, fvis, &tuner->indicate_oc, &tuner->vis, &tuner->scale_val);
389439 if (tuner->n_targets == 0) {
390440 return;
4444 gint GSEAL (in_limit_timestep);
4545 gint GSEAL (n_targets);
4646 gint GSEAL (targets)[RACKTUNER_MAXTARGETS];
47 gint GSEAL (temperament);
4748 // state
4849 double GSEAL (pos); // led lighted position
4950 gboolean GSEAL (in_limit);
5657 guint GSEAL (in_limit_id);
5758 gint GSEAL (target_oc);
5859 gint GSEAL (target_note);
60 gint GSEAL (target_temperament);
5961 gint GSEAL (strng); // number of current string (1 == string with highest pitch)
6062 // caculated layout
6163 gint GSEAL (led_count);
8890 void gx_rack_tuner_set_limit_timestep(GxRackTuner *tuner, gint in_limit_timestep);
8991 gint gx_rack_tuner_get_limit_timestep(GxRackTuner *tuner);
9092 void gx_rack_tuner_clear_notes(GxRackTuner *tuner);
91 gboolean gx_rack_tuner_push_note(GxRackTuner *tuner, gint note);
93 gboolean gx_rack_tuner_push_note(GxRackTuner *tuner, gint note, gint A, gint TET);
94 void gx_rack_tuner_set_temperament(GxRackTuner *tuner, gint temperament);
95 gint gx_rack_tuner_get_temperament(GxRackTuner *tuner);
9296
9397 GtkWidget *gx_rack_tuner_new(void);
9498
3939 _WRAP_METHOD(int get_timestep(), gx_rack_tuner_get_timestep)
4040 _WRAP_METHOD(void set_limit_timestep(int), gx_rack_tuner_set_limit_timestep)
4141 _WRAP_METHOD(int get_limit_timestep(), gx_rack_tuner_get_limit_timestep)
42 _WRAP_METHOD(void set_temperament(int), gx_rack_tuner_set_temperament)
43 _WRAP_METHOD(int get_temperament(), gx_rack_tuner_get_temperament)
4244 _WRAP_METHOD(void clear_notes(), gx_rack_tuner_clear_notes)
43 _WRAP_METHOD(void push_note(int), gx_rack_tuner_push_note)
45 _WRAP_METHOD(void push_note(int, int, int), gx_rack_tuner_push_note)
4446 _WRAP_SIGNAL(void frequency_poll(), "frequency-poll")
4547 _WRAP_SIGNAL(void poll_status_changed(bool), "poll-status-changed")
4648 _WRAP_PROPERTY(freq, double)
5052 _WRAP_PROPERTY(streaming, bool)
5153 _WRAP_PROPERTY(timestep, int)
5254 _WRAP_PROPERTY(limit_timestep, int)
55 _WRAP_PROPERTY(temperament, int)
5356 };
5457
5558 } // namespace Gxw
326326 return gx_rack_tuner_get_limit_timestep(gobj());
327327 }
328328
329 void RackTuner::set_temperament(int p1)
330 {
331 gx_rack_tuner_set_temperament(gobj(), p1);
332 }
333
334 int RackTuner::get_temperament()
335 {
336 return gx_rack_tuner_get_temperament(gobj());
337 }
338
329339 void RackTuner::clear_notes()
330340 {
331341 gx_rack_tuner_clear_notes(gobj());
332342 }
333343
334 void RackTuner::push_note(int p1)
335 {
336 gx_rack_tuner_push_note(gobj(), p1);
344 void RackTuner::push_note(int p1, int p2, int p3)
345 {
346 gx_rack_tuner_push_note(gobj(), p1, p2, p3);
337347 }
338348
339349
444454 Glib::PropertyProxy_ReadOnly< int > RackTuner::property_limit_timestep() const
445455 {
446456 return Glib::PropertyProxy_ReadOnly< int >(this, "limit-timestep");
457 }
458 #endif //GLIBMM_PROPERTIES_ENABLED
459
460 #ifdef GLIBMM_PROPERTIES_ENABLED
461 Glib::PropertyProxy< int > RackTuner::property_temperament()
462 {
463 return Glib::PropertyProxy< int >(this, "temperament");
464 }
465 #endif //GLIBMM_PROPERTIES_ENABLED
466
467 #ifdef GLIBMM_PROPERTIES_ENABLED
468 Glib::PropertyProxy_ReadOnly< int > RackTuner::property_temperament() const
469 {
470 return Glib::PropertyProxy_ReadOnly< int >(this, "temperament");
447471 }
448472 #endif //GLIBMM_PROPERTIES_ENABLED
449473
126126
127127 int get_limit_timestep();
128128
129 void set_temperament(int p1);
130
131 int get_temperament();
132
129133 void clear_notes();
130134
131 void push_note(int p1);
135 void push_note(int p1, int p2, int p3);
132136
133137 /**
134138 * @par Slot Prototype:
287291 Glib::PropertyProxy_ReadOnly< int > property_limit_timestep() const;
288292 #endif //#GLIBMM_PROPERTIES_ENABLED
289293
294 #ifdef GLIBMM_PROPERTIES_ENABLED
295 /** time interval in msec for refreshing the streaming display.
296 *
297 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
298 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
299 * the value of the property changes.
300 */
301 Glib::PropertyProxy< int > property_temperament() ;
302 #endif //#GLIBMM_PROPERTIES_ENABLED
303
304 #ifdef GLIBMM_PROPERTIES_ENABLED
305 /** time interval in msec for refreshing the streaming display.
306 *
307 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
308 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
309 * the value of the property changes.
310 */
311 Glib::PropertyProxy_ReadOnly< int > property_temperament() const;
312 #endif //#GLIBMM_PROPERTIES_ENABLED
290313
291314 };
292315
66 import("guitarix.lib");
77
88
9 process = +(anti_denormal_ac) : speakerbp(30.,999.) : highpass(1,100);
9 process = +(anti_denormal_ac) : speakerbp(23.,999.);
0 declare id "mbe";
1 declare name "MultiBand Reverb";
2 declare shortname "MB Reverb";
3 declare category "Reverb";
4 declare description "Multi Band Reverb";
5
6 import("effect.lib");
7 import("filter.lib");
8 import("music.lib");
9 import("math.lib");
10 import("reduce.lib");
11
12 hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover bandpass frequency]" ,80 , 20, 20000, 1.08);
13 hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover bandpass frequency]",210,20,20000,1.08);
14 hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover bandpass frequency]",1700,20,20000,1.08);
15 hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover bandpass frequency]",5000,20,20000,1.08);
16
17 geq = filterbank(3, (hifr1,hifr2,hifr3,hifr4));
18
19 vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
20 vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
21 vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
22 vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
23 vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
24
25 envelop = abs : max ~ (1.0/SR) : reduce(max,4096) ; // : max(db2linear(-70)) : linear2db;
26
27 /*-----------------------------------------------
28 freeverb by "Grame"
29 -----------------------------------------------*/
30
31 c1 = vslider("RoomSize1", 0.5, 0, 1, 0.025)*0.28 + 0.7;
32 d1 = vslider("damp1",0.5, 0, 1, 0.025);
33 wet1 = vslider("wet_dry1[name:wet/dry]", 50, 0, 100, 1) : /(100);
34 dry1 = 1 - wet1;
35
36 c2 = vslider("RoomSize2", 0.5, 0, 1, 0.025)*0.28 + 0.7;
37 d2 = vslider("damp2",0.5, 0, 1, 0.025);
38 wet2 = vslider("wet_dry2[name:wet/dry]", 50, 0, 100, 1) : /(100);
39 dry2 = 1 - wet2;
40
41 c3 = vslider("RoomSize3", 0.5, 0, 1, 0.025)*0.28 + 0.7;
42 d3 = vslider("damp3",0.5, 0, 1, 0.025);
43 wet3 = vslider("wet_dry3[name:wet/dry]", 50, 0, 100, 1) : /(100);
44 dry3 = 1 - wet3;
45
46 c4 = vslider("RoomSize4", 0.5, 0, 1, 0.025)*0.28 + 0.7;
47 d4 = vslider("damp4",0.5, 0, 1, 0.025);
48 wet4 = vslider("wet_dry4[name:wet/dry]", 50, 0, 100, 1) : /(100);
49 dry4 = 1 - wet4;
50
51 c5 = vslider("RoomSize5", 0.5, 0, 1, 0.025)*0.28 + 0.7;
52 d5 = vslider("damp5",0.5, 0, 1, 0.025);
53 wet5 = vslider("wet_dry5[name:wet/dry]", 50, 0, 100, 1) : /(100);
54 dry5 = 1 - wet5;
55
56 // Filter Parameters
57
58 combtuningL1 = 1116;
59 combtuningL2 = 1188;
60 combtuningL3 = 1277;
61 combtuningL4 = 1356;
62 combtuningL5 = 1422;
63 combtuningL6 = 1491;
64 combtuningL7 = 1557;
65 combtuningL8 = 1617;
66
67 allpasstuningL1 = 556;
68 allpasstuningL2 = 441;
69 allpasstuningL3 = 341;
70 allpasstuningL4 = 225;
71
72
73 // Comb and Allpass filters
74
75 allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
76 comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
77
78 // Reverb components
79
80 monoReverb(fb1, fb2, damp, spread)
81 = _ <: comb(combtuningL1+spread, fb1, damp),
82 comb(combtuningL2+spread, fb1, damp),
83 comb(combtuningL3+spread, fb1, damp),
84 comb(combtuningL4+spread, fb1, damp),
85 comb(combtuningL5+spread, fb1, damp),
86 comb(combtuningL6+spread, fb1, damp),
87 comb(combtuningL7+spread, fb1, damp),
88 comb(combtuningL8+spread, fb1, damp)
89 +>
90 allpass (allpasstuningL1+spread, fb2)
91 : allpass (allpasstuningL2+spread, fb2)
92 : allpass (allpasstuningL3+spread, fb2)
93 : allpass (allpasstuningL4+spread, fb2)
94 ;
95
96 //----------------------------------------------------------------
97
98 fxctrl(g,w,Fx) = _ <: (*(g) <: _ + Fx ), *(1-w) +> _;
99 reverb(dry, wet_dry, combfeed, dampslider) = _<:*(dry),(*(wet_dry):fxctrl(0.015,wet_dry, monoReverb(combfeed, 0.5, dampslider, 23))):>_;
100
101 process = geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :>_ with {
102 dist1s = reverb(dry1,wet1,c1,d1) : vmeter1 ;
103 dist2s = reverb(dry2,wet2,c2,d2) : vmeter2;
104 dist3s = reverb(dry3,wet3,c3,d3) : vmeter3;
105 dist4s = reverb(dry4,wet4,c4,d4) : vmeter4;
106 dist5s = reverb(dry5,wet5,c5,d5) : vmeter5;
107
108 };
1717 double fConst7;
1818 double fConst8;
1919 double fConst9;
20 double fRec4[2];
21 double fVec1[2];
2022 double fConst10;
21 double fRec5[2];
22 double fVec1[2];
23 double fConst11;
24 double fRec4[2];
2523 double fRec3[2];
26 double fRec2[3];
24 double fRec2[2];
2725 double fRec1[3];
28 double fVec2[2];
29 double fConst12;
30 double fConst13;
31 double fConst14;
32 double fConst15;
33 double fConst16;
34 double fRec0[2];
26 double fRec0[3];
3527 void connect(uint32_t port,void* data);
3628 void clear_state_f();
3729 void init(uint32_t samplingFreq);
6961 inline void Dsp::clear_state_f()
7062 {
7163 for (int i=0; i<2; i++) iVec0[i] = 0;
72 for (int i=0; i<2; i++) fRec5[i] = 0;
64 for (int i=0; i<2; i++) fRec4[i] = 0;
7365 for (int i=0; i<2; i++) fVec1[i] = 0;
74 for (int i=0; i<2; i++) fRec4[i] = 0;
7566 for (int i=0; i<2; i++) fRec3[i] = 0;
76 for (int i=0; i<3; i++) fRec2[i] = 0;
67 for (int i=0; i<2; i++) fRec2[i] = 0;
7768 for (int i=0; i<3; i++) fRec1[i] = 0;
78 for (int i=0; i<2; i++) fVec2[i] = 0;
79 for (int i=0; i<2; i++) fRec0[i] = 0;
69 for (int i=0; i<3; i++) fRec0[i] = 0;
8070 }
8171
8272 void Dsp::clear_state_f_static(PluginLV2 *p)
9282 fConst2 = (2 * (1 - (1.0 / faustpower<2>(fConst1))));
9383 fConst3 = (1.0 / fConst1);
9484 fConst4 = (1 + ((fConst3 - 0.7653668647301795) / fConst1));
95 fConst5 = (1 + ((0.7653668647301795 + fConst3) / fConst1));
96 fConst6 = (1.0 / fConst5);
97 fConst7 = (1 + ((fConst3 - 1.8477590650225735) / fConst1));
98 fConst8 = (1.0 / (1 + ((fConst3 + 1.8477590650225735) / fConst1)));
99 fConst9 = (94.24777960769379 / double(iConst0));
100 fConst10 = (1 - fConst9);
101 fConst11 = (1.0 / (1 + fConst9));
102 fConst12 = (1.0 / tan((314.1592653589793 / double(iConst0))));
103 fConst13 = (0 - fConst12);
104 fConst14 = (1 + fConst12);
105 fConst15 = (1.0 / (fConst14 * fConst5));
106 fConst16 = (0 - ((1 - fConst12) / fConst14));
85 fConst5 = (1.0 / (1 + ((0.7653668647301795 + fConst3) / fConst1)));
86 fConst6 = (1 + ((fConst3 - 1.8477590650225735) / fConst1));
87 fConst7 = (1.0 / (1 + ((fConst3 + 1.8477590650225735) / fConst1)));
88 fConst8 = (72.25663103256524 / double(iConst0));
89 fConst9 = (1 - fConst8);
90 fConst10 = (1.0 / (1 + fConst8));
10791 clear_state_f();
10892 }
10993
116100 {
117101 for (int i=0; i<count; i++) {
118102 iVec0[0] = 1;
119 fRec5[0] = ((1e-20 * (1 - iVec0[1])) - fRec5[1]);
120 double fTemp0 = ((double)input0[i] + fRec5[0]);
103 fRec4[0] = ((1e-20 * (1 - iVec0[1])) - fRec4[1]);
104 double fTemp0 = ((double)input0[i] + fRec4[0]);
121105 fVec1[0] = fTemp0;
122 fRec4[0] = (fConst11 * ((fVec1[0] - fVec1[1]) + (fConst10 * fRec4[1])));
123 fRec3[0] = (fConst11 * ((fRec4[0] - fRec4[1]) + (fConst10 * fRec3[1])));
124 fRec2[0] = (fRec3[0] - (fConst8 * ((fConst7 * fRec2[2]) + (fConst2 * fRec2[1]))));
125 fRec1[0] = ((fConst8 * (fRec2[2] + (fRec2[0] + (2 * fRec2[1])))) - (fConst6 * ((fConst4 * fRec1[2]) + (fConst2 * fRec1[1]))));
126 double fTemp1 = (fRec1[2] + (fRec1[0] + (2 * fRec1[1])));
127 fVec2[0] = fTemp1;
128 fRec0[0] = ((fConst16 * fRec0[1]) + (fConst15 * ((fConst12 * fVec2[0]) + (fConst13 * fVec2[1]))));
129 output0[i] = (FAUSTFLOAT)fRec0[0];
106 fRec3[0] = (fConst10 * ((fVec1[0] - fVec1[1]) + (fConst9 * fRec3[1])));
107 fRec2[0] = (fConst10 * ((fRec3[0] - fRec3[1]) + (fConst9 * fRec2[1])));
108 fRec1[0] = (fRec2[0] - (fConst7 * ((fConst6 * fRec1[2]) + (fConst2 * fRec1[1]))));
109 fRec0[0] = ((fConst7 * (fRec1[2] + (fRec1[0] + (2 * fRec1[1])))) - (fConst5 * ((fConst4 * fRec0[2]) + (fConst2 * fRec0[1]))));
110 output0[i] = (FAUSTFLOAT)(fConst5 * (fRec0[2] + (fRec0[0] + (2 * fRec0[1]))));
130111 // post processing
131 fRec0[1] = fRec0[0];
132 fVec2[1] = fVec2[0];
112 fRec0[2] = fRec0[1]; fRec0[1] = fRec0[0];
133113 fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0];
134 fRec2[2] = fRec2[1]; fRec2[1] = fRec2[0];
114 fRec2[1] = fRec2[0];
135115 fRec3[1] = fRec3[0];
116 fVec1[1] = fVec1[0];
136117 fRec4[1] = fRec4[0];
137 fVec1[1] = fVec1[0];
138 fRec5[1] = fRec5[0];
139118 iVec0[1] = iVec0[0];
140119 }
141120 }
199199 lv2:minimum 0 ;
200200 lv2:maximum 4096 ;
201201 lv2:portProperty lv2:reportsLatency, lv2:integer;
202 ] ;
203
204
205 mod:gui [
206 a mod:Gui;
207 mod:resourcesDirectory <modgui>;
208 mod:iconTemplate <modgui/icon-gxdetune.html>;
209 mod:templateData <modgui/data-gxdetune.json>;
210 mod:screenshot <modgui/screenshot-gxdetune.png>;
211 mod:thumbnail <modgui/thumb-gxdetune.png>;
212 ].
202 ] .
213203
214204 <http://guitarix.sourceforge.net/plugins/gx_detune_#gui>
215205 a guiext:GtkUI;
174174 lv2:scalePoint [rdfs:label "1/64note"; rdf:value 17];
175175 lv2:scalePoint [rdfs:label "1/64notetriplets"; rdf:value 18];
176176
177 ];
178 mod:gui [
179 a mod:Gui;
180 mod:resourcesDirectory <modgui>;
181 mod:iconTemplate <modgui/icon-gxdigital_delay.html>;
182 mod:templateData <modgui/data-gxdigital_delay.json>;
183 mod:screenshot <modgui/screenshot-gxdigital_delay.png>;
184 mod:thumbnail <modgui/thumb-gxdigital_delay.png>;
185 ].
177 ] .
186178
187179 <http://guitarix.sourceforge.net/plugins/gx_digital_delay_#gui>
188180 a guiext:GtkUI;
186186 lv2:scalePoint [rdfs:label "1/64note"; rdf:value 17];
187187 lv2:scalePoint [rdfs:label "1/64notetriplets"; rdf:value 18];
188188
189 ];
190 mod:gui [
191 a mod:Gui;
192 mod:resourcesDirectory <modgui>;
193 mod:iconTemplate <modgui/icon-gxdigital_delay_st.html>;
194 mod:templateData <modgui/data-gxdigital_delay_st.json>;
195 mod:screenshot <modgui/screenshot-gxdigital_delay_st.png>;
196 mod:thumbnail <modgui/thumb-gxdigital_delay_st.png>;
197 ].
189 ] .
198190
199191 <http://guitarix.sourceforge.net/plugins/gx_digital_delay_st_#gui>
200192 a guiext:GtkUI;
124124 mod:gui [
125125 a mod:Gui;
126126 mod:resourcesDirectory <modgui>;
127 mod:iconTemplate <modgui/icon-gxduck_delay.html>;
128 mod:templateData <modgui/data-gxduck_delay.json>;
127 mod:iconTemplate <modgui/gxduck_delay.html>;
128 mod:templateData <modgui/gxduck_delay.json>;
129129 mod:screenshot <modgui/screenshot-gxduck_delay.png>;
130130 mod:thumbnail <modgui/thumb-gxduck_delay.png>;
131131 ].
161161 mod:gui [
162162 a mod:Gui;
163163 mod:resourcesDirectory <modgui>;
164 mod:iconTemplate <modgui/icon-gxduck_delay_st.html>;
165 mod:templateData <modgui/data-gxduck_delay_st.json>;
164 mod:iconTemplate <modgui/gxduck_delay_st.html>;
165 mod:templateData <modgui/gxduck_delay_st.json>;
166166 mod:screenshot <modgui/screenshot-gxduck_delay_st.png>;
167167 mod:thumbnail <modgui/thumb-gxduck_delay_st.png>;
168168 ].
2020 {
2121 "name": "FEEDBACK",
2222 "symbol": "FEEDBACK"
23 }
23 },
2424 {
2525 "name": "PINGPONG",
2626 "symbol": "PINGPONG"
27 }
27 },
2828 {
2929 "name": "RELEASE",
3030 "symbol": "RELEASE"
31 }
31 },
3232 {
3333 "name": "TIME",
3434 "symbol": "TIME"
465465 lv2:default 0.0 ;
466466 lv2:minimum 0.0 ;
467467 lv2:maximum 1.0 ;
468 ];
469 mod:gui [
470 a mod:Gui;
471 mod:resourcesDirectory <modgui>;
472 mod:iconTemplate <modgui/icon-gxlivelooper.html>;
473 mod:templateData <modgui/data-gxlivelooper.json>;
474 mod:screenshot <modgui/screenshot-gxlivelooper.png>;
475 mod:thumbnail <modgui/thumb-gxlivelooper.png>;
476 ].
468 ] .
477469
478470 <http://guitarix.sourceforge.net/plugins/gx_livelooper_#gui>
479471 a guiext:GtkUI;
0 /*
1 * Copyright (C) 2014 Guitarix project MOD project
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 * --------------------------------------------------------------------------
17 */
18
19
20 ////////////////////////////// LOCAL INCLUDES //////////////////////////
21
22 #include "gx_common.h" // faust support and denormal protection (SSE)
23 #include "gx_mbreverb.h" // define struct PortIndex
24 #include "gx_pluginlv2.h" // define struct PluginLV2
25 #include "mbreverb.cc" // dsp class generated by faust -> dsp2cc
26
27 ////////////////////////////// PLUG-IN CLASS ///////////////////////////
28
29 namespace mbreverb {
30
31 class Gx_mbreverb_
32 {
33 private:
34 // pointer to buffer
35 float* output;
36 float* input;
37 // pointer to dsp class
38 PluginLV2* mbreverb;
39 // private functions
40 inline void run_dsp_(uint32_t n_samples);
41 inline void connect_(uint32_t port,void* data);
42 inline void init_dsp_(uint32_t rate);
43 inline void connect_all__ports(uint32_t port, void* data);
44 inline void activate_f();
45 inline void clean_up();
46 inline void deactivate_f();
47
48 public:
49 // LV2 Descriptor
50 static const LV2_Descriptor descriptor;
51 // static wrapper to private functions
52 static void deactivate(LV2_Handle instance);
53 static void cleanup(LV2_Handle instance);
54 static void run(LV2_Handle instance, uint32_t n_samples);
55 static void activate(LV2_Handle instance);
56 static void connect_port(LV2_Handle instance, uint32_t port, void* data);
57 static LV2_Handle instantiate(const LV2_Descriptor* descriptor,
58 double rate, const char* bundle_path,
59 const LV2_Feature* const* features);
60 Gx_mbreverb_();
61 ~Gx_mbreverb_();
62 };
63
64 // constructor
65 Gx_mbreverb_::Gx_mbreverb_() :
66 output(NULL),
67 input(NULL),
68 mbreverb(mbreverb::plugin()) {};
69
70 // destructor
71 Gx_mbreverb_::~Gx_mbreverb_()
72 {
73 // just to be sure the plug have given free the allocated mem
74 // it didn't hurd if the mem is already given free by clean_up()
75 if (mbreverb->activate_plugin !=0)
76 mbreverb->activate_plugin(false, mbreverb);
77 // delete DSP class
78 mbreverb->delete_instance(mbreverb);
79 };
80
81 ///////////////////////// PRIVATE CLASS FUNCTIONS /////////////////////
82
83 void Gx_mbreverb_::init_dsp_(uint32_t rate)
84 {
85 AVOIDDENORMALS(); // init the SSE denormal protection
86 mbreverb->set_samplerate(rate, mbreverb); // init the DSP class
87 }
88
89 // connect the Ports used by the plug-in class
90 void Gx_mbreverb_::connect_(uint32_t port,void* data)
91 {
92 switch ((PortIndex)port)
93 {
94 case EFFECTS_OUTPUT:
95 output = static_cast<float*>(data);
96 break;
97 case EFFECTS_INPUT:
98 input = static_cast<float*>(data);
99 break;
100 default:
101 break;
102 }
103 }
104
105 void Gx_mbreverb_::activate_f()
106 {
107 // allocate the internal DSP mem
108 if (mbreverb->activate_plugin !=0)
109 mbreverb->activate_plugin(true, mbreverb);
110 }
111
112 void Gx_mbreverb_::clean_up()
113 {
114 // delete the internal DSP mem
115 if (mbreverb->activate_plugin !=0)
116 mbreverb->activate_plugin(false, mbreverb);
117 }
118
119 void Gx_mbreverb_::deactivate_f()
120 {
121 // delete the internal DSP mem
122 if (mbreverb->activate_plugin !=0)
123 mbreverb->activate_plugin(false, mbreverb);
124 }
125
126 void Gx_mbreverb_::run_dsp_(uint32_t n_samples)
127 {
128 mbreverb->mono_audio(static_cast<int>(n_samples), input, output, mbreverb);
129 }
130
131 void Gx_mbreverb_::connect_all__ports(uint32_t port, void* data)
132 {
133 // connect the Ports used by the plug-in class
134 connect_(port,data);
135 // connect the Ports used by the DSP class
136 mbreverb->connect_ports(port, data, mbreverb);
137 }
138
139 ////////////////////// STATIC CLASS FUNCTIONS ////////////////////////
140
141 LV2_Handle
142 Gx_mbreverb_::instantiate(const LV2_Descriptor* descriptor,
143 double rate, const char* bundle_path,
144 const LV2_Feature* const* features)
145 {
146 // init the plug-in class
147 Gx_mbreverb_ *self = new Gx_mbreverb_();
148 if (!self)
149 {
150 return NULL;
151 }
152
153 self->init_dsp_((uint32_t)rate);
154
155 return (LV2_Handle)self;
156 }
157
158 void Gx_mbreverb_::connect_port(LV2_Handle instance,
159 uint32_t port, void* data)
160 {
161 // connect all ports
162 static_cast<Gx_mbreverb_*>(instance)->connect_all__ports(port, data);
163 }
164
165 void Gx_mbreverb_::activate(LV2_Handle instance)
166 {
167 // allocate needed mem
168 static_cast<Gx_mbreverb_*>(instance)->activate_f();
169 }
170
171 void Gx_mbreverb_::run(LV2_Handle instance, uint32_t n_samples)
172 {
173 // run dsp
174 static_cast<Gx_mbreverb_*>(instance)->run_dsp_(n_samples);
175 }
176
177 void Gx_mbreverb_::deactivate(LV2_Handle instance)
178 {
179 // free allocated mem
180 static_cast<Gx_mbreverb_*>(instance)->deactivate_f();
181 }
182
183 void Gx_mbreverb_::cleanup(LV2_Handle instance)
184 {
185 // well, clean up after us
186 Gx_mbreverb_* self = static_cast<Gx_mbreverb_*>(instance);
187 self->clean_up();
188 delete self;
189 }
190
191 const LV2_Descriptor Gx_mbreverb_::descriptor =
192 {
193 GXPLUGIN_URI "#_mbreverb_",
194 Gx_mbreverb_::instantiate,
195 Gx_mbreverb_::connect_port,
196 Gx_mbreverb_::activate,
197 Gx_mbreverb_::run,
198 Gx_mbreverb_::deactivate,
199 Gx_mbreverb_::cleanup,
200 NULL
201 };
202
203
204 } // end namespace mbreverb
205
206 ////////////////////////// LV2 SYMBOL EXPORT ///////////////////////////
207
208 extern "C"
209 LV2_SYMBOL_EXPORT
210 const LV2_Descriptor*
211 lv2_descriptor(uint32_t index)
212 {
213 switch (index)
214 {
215 case 0:
216 return &mbreverb::Gx_mbreverb_::descriptor;
217 default:
218 return NULL;
219 }
220 }
221
222 ///////////////////////////// FIN //////////////////////////////////////
0 /*
1 * Copyright (C) 2014 Guitarix project MOD project
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 * --------------------------------------------------------------------------
17 */
18
19 #pragma once
20
21 #ifndef SRC_HEADERS_GXEFFECTS_H_
22 #define SRC_HEADERS_GXEFFECTS_H_
23
24 #include <lv2.h>
25
26 #define GXPLUGIN_URI "http://guitarix.sourceforge.net/plugins/gx_mbreverb_"
27 #define GXPLUGIN_UI_URI "http://guitarix.sourceforge.net/plugins/gx_mbreverb_#gui"
28
29
30 typedef enum
31 {
32 EFFECTS_OUTPUT,
33 EFFECTS_INPUT,
34 ROOMSIZE1,
35 ROOMSIZE2,
36 ROOMSIZE3,
37 ROOMSIZE4,
38 ROOMSIZE5,
39 CROSSOVER_B1_B2,
40 CROSSOVER_B2_B3,
41 CROSSOVER_B3_B4,
42 CROSSOVER_B4_B5,
43 DAMP1,
44 DAMP2,
45 DAMP3,
46 DAMP4,
47 DAMP5,
48 V1,
49 V2,
50 V3,
51 V4,
52 V5,
53 WET_DRY1,
54 WET_DRY2,
55 WET_DRY3,
56 WET_DRY4,
57 WET_DRY5,
58 } PortIndex;
59
60 #endif //SRC_HEADERS_GXEFFECTS_H_
0 #
1 # Copyright (C) 2014 Guitarix project MOD project
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 # --------------------------------------------------------------------------
17 #
18
19
20 @prefix doap: <http://usefulinc.com/ns/doap#> .
21 @prefix foaf: <http://xmlns.com/foaf/0.1/> .
22 @prefix lv2: <http://lv2plug.in/ns/lv2core#> .
23 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
24 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
25 @prefix guiext: <http://lv2plug.in/ns/extensions/ui#>.
26 @prefix mod: <http://portalmod.com/ns/modgui#>.
27 @prefix time: <http://lv2plug.in/ns/ext/time/#>.
28 @prefix units: <http://lv2plug.in/ns/extensions/units#> .
29
30 <http://guitarix.sourceforge.net#me>
31 a foaf:Person ;
32 foaf:name "Guitarix team" ;
33 foaf:mbox <mailto:guitarix-developer@lists.sourceforge.net> ;
34 rdfs:seeAlso <http://guitarix.sourceforge.net> .
35
36 <http://guitarix.sourceforge.net/plugins/gx_mbreverb_>
37 a doap:Project ;
38 doap:maintainer <http://guitarix.sourceforge.net#me> ;
39 doap:name "Gx_mbreverb_" .
40
41 <http://guitarix.sourceforge.net/plugins/gx_mbreverb_#_mbreverb_>
42 a lv2:Plugin ,
43 lv2:ReverbPlugin ;
44 doap:maintainer <http://guitarix.sourceforge.net#me> ;
45 doap:name "GxMultiBandReverb";
46 doap:license <http://opensource.org/licenses/isc> ;
47 lv2:project <http://guitarix.sourceforge.net/plugins/gx_mbreverb_> ;
48 lv2:optionalFeature lv2:hardRTCapable ;
49
50 guiext:ui <http://guitarix.sourceforge.net/plugins/gx_mbreverb_#gui>;
51
52
53 lv2:minorVersion 28;
54 lv2:microVersion 3;
55
56 rdfs:comment """
57
58 ...
59
60 """;
61
62 lv2:port [
63 a lv2:AudioPort ,
64 lv2:OutputPort ;
65 lv2:index 0 ;
66 lv2:symbol "out" ;
67 lv2:name "Out"
68 ] , [
69 a lv2:AudioPort ,
70 lv2:InputPort ;
71 lv2:index 1 ;
72 lv2:symbol "in" ;
73 lv2:name "In" ;
74 ]
75 , [
76 a lv2:InputPort ,
77 lv2:ControlPort ;
78 lv2:index 2 ;
79 lv2:symbol "ROOMSIZE1" ;
80 lv2:name "ROOMSIZE1" ;
81 lv2:default 0.5 ;
82 lv2:minimum 0.0 ;
83 lv2:maximum 1.0 ;
84 ] , [
85 a lv2:InputPort ,
86 lv2:ControlPort ;
87 lv2:index 3 ;
88 lv2:symbol "ROOMSIZE2" ;
89 lv2:name "ROOMSIZE2" ;
90 lv2:default 0.5 ;
91 lv2:minimum 0.0 ;
92 lv2:maximum 1.0 ;
93 ] , [
94 a lv2:InputPort ,
95 lv2:ControlPort ;
96 lv2:index 4 ;
97 lv2:symbol "ROOMSIZE3" ;
98 lv2:name "ROOMSIZE3" ;
99 lv2:default 0.5 ;
100 lv2:minimum 0.0 ;
101 lv2:maximum 1.0 ;
102 ] , [
103 a lv2:InputPort ,
104 lv2:ControlPort ;
105 lv2:index 5 ;
106 lv2:symbol "ROOMSIZE4" ;
107 lv2:name "ROOMSIZE4" ;
108 lv2:default 0.5 ;
109 lv2:minimum 0.0 ;
110 lv2:maximum 1.0 ;
111 ] , [
112 a lv2:InputPort ,
113 lv2:ControlPort ;
114 lv2:index 6 ;
115 lv2:symbol "ROOMSIZE5" ;
116 lv2:name "ROOMSIZE5" ;
117 lv2:default 0.5 ;
118 lv2:minimum 0.0 ;
119 lv2:maximum 1.0 ;
120 ] , [
121 a lv2:InputPort ,
122 lv2:ControlPort ;
123 lv2:index 7 ;
124 lv2:symbol "CROSSOVER_B1_B2" ;
125 lv2:name "CROSSOVER_B1_B2" ;
126 lv2:default 8e+01 ;
127 lv2:minimum 2e+01 ;
128 lv2:maximum 2e+04 ;
129 ] , [
130 a lv2:InputPort ,
131 lv2:ControlPort ;
132 lv2:index 8 ;
133 lv2:symbol "CROSSOVER_B2_B3" ;
134 lv2:name "CROSSOVER_B2_B3" ;
135 lv2:default 2.1e+02 ;
136 lv2:minimum 2e+01 ;
137 lv2:maximum 2e+04 ;
138 ] , [
139 a lv2:InputPort ,
140 lv2:ControlPort ;
141 lv2:index 9 ;
142 lv2:symbol "CROSSOVER_B3_B4" ;
143 lv2:name "CROSSOVER_B3_B4" ;
144 lv2:default 1.7e+03 ;
145 lv2:minimum 2e+01 ;
146 lv2:maximum 2e+04 ;
147 ] , [
148 a lv2:InputPort ,
149 lv2:ControlPort ;
150 lv2:index 10 ;
151 lv2:symbol "CROSSOVER_B4_B5" ;
152 lv2:name "CROSSOVER_B4_B5" ;
153 lv2:default 5e+03 ;
154 lv2:minimum 2e+01 ;
155 lv2:maximum 2e+04 ;
156 ] , [
157 a lv2:InputPort ,
158 lv2:ControlPort ;
159 lv2:index 11 ;
160 lv2:symbol "DAMP1" ;
161 lv2:name "DAMP1" ;
162 lv2:default 0.5 ;
163 lv2:minimum 0.0 ;
164 lv2:maximum 1.0 ;
165 ] , [
166 a lv2:InputPort ,
167 lv2:ControlPort ;
168 lv2:index 12 ;
169 lv2:symbol "DAMP2" ;
170 lv2:name "DAMP2" ;
171 lv2:default 0.5 ;
172 lv2:minimum 0.0 ;
173 lv2:maximum 1.0 ;
174 ] , [
175 a lv2:InputPort ,
176 lv2:ControlPort ;
177 lv2:index 13 ;
178 lv2:symbol "DAMP3" ;
179 lv2:name "DAMP3" ;
180 lv2:default 0.5 ;
181 lv2:minimum 0.0 ;
182 lv2:maximum 1.0 ;
183 ] , [
184 a lv2:InputPort ,
185 lv2:ControlPort ;
186 lv2:index 14 ;
187 lv2:symbol "DAMP4" ;
188 lv2:name "DAMP4" ;
189 lv2:default 0.5 ;
190 lv2:minimum 0.0 ;
191 lv2:maximum 1.0 ;
192 ] , [
193 a lv2:InputPort ,
194 lv2:ControlPort ;
195 lv2:index 15 ;
196 lv2:symbol "DAMP5" ;
197 lv2:name "DAMP5" ;
198 lv2:default 0.5 ;
199 lv2:minimum 0.0 ;
200 lv2:maximum 1.0 ;
201 ] , [
202 a lv2:OutputPort ,
203 lv2:ControlPort ;
204 lv2:index 16 ;
205 lv2:symbol "V1" ;
206 lv2:name "V1" ;
207 lv2:default -70.0 ;
208 lv2:minimum -70.0 ;
209 lv2:maximum 4.0 ;
210 ] , [
211 a lv2:OutputPort ,
212 lv2:ControlPort ;
213 lv2:index 17 ;
214 lv2:symbol "V2" ;
215 lv2:name "V2" ;
216 lv2:default -70.0 ;
217 lv2:minimum -70.0 ;
218 lv2:maximum 4.0 ;
219 ] , [
220 a lv2:OutputPort ,
221 lv2:ControlPort ;
222 lv2:index 18 ;
223 lv2:symbol "V3" ;
224 lv2:name "V3" ;
225 lv2:default -70.0 ;
226 lv2:minimum -70.0 ;
227 lv2:maximum 4.0 ;
228 ] , [
229 a lv2:OutputPort ,
230 lv2:ControlPort ;
231 lv2:index 19 ;
232 lv2:symbol "V4" ;
233 lv2:name "V4" ;
234 lv2:default -70.0 ;
235 lv2:minimum -70.0 ;
236 lv2:maximum 4.0 ;
237 ] , [
238 a lv2:OutputPort ,
239 lv2:ControlPort ;
240 lv2:index 20 ;
241 lv2:symbol "V5" ;
242 lv2:name "V5" ;
243 lv2:default -70.0 ;
244 lv2:minimum -70.0 ;
245 lv2:maximum 4.0 ;
246 ] , [
247 a lv2:InputPort ,
248 lv2:ControlPort ;
249 lv2:index 21 ;
250 lv2:symbol "WET_DRY1" ;
251 lv2:name "WET_DRY1" ;
252 lv2:default 5e+01 ;
253 lv2:minimum 0.0 ;
254 lv2:maximum 1e+02 ;
255 ] , [
256 a lv2:InputPort ,
257 lv2:ControlPort ;
258 lv2:index 22 ;
259 lv2:symbol "WET_DRY2" ;
260 lv2:name "WET_DRY2" ;
261 lv2:default 5e+01 ;
262 lv2:minimum 0.0 ;
263 lv2:maximum 1e+02 ;
264 ] , [
265 a lv2:InputPort ,
266 lv2:ControlPort ;
267 lv2:index 23 ;
268 lv2:symbol "WET_DRY3" ;
269 lv2:name "WET_DRY3" ;
270 lv2:default 5e+01 ;
271 lv2:minimum 0.0 ;
272 lv2:maximum 1e+02 ;
273 ] , [
274 a lv2:InputPort ,
275 lv2:ControlPort ;
276 lv2:index 24 ;
277 lv2:symbol "WET_DRY4" ;
278 lv2:name "WET_DRY4" ;
279 lv2:default 5e+01 ;
280 lv2:minimum 0.0 ;
281 lv2:maximum 1e+02 ;
282 ] , [
283 a lv2:InputPort ,
284 lv2:ControlPort ;
285 lv2:index 25 ;
286 lv2:symbol "WET_DRY5" ;
287 lv2:name "WET_DRY5" ;
288 lv2:default 5e+01 ;
289 lv2:minimum 0.0 ;
290 lv2:maximum 1e+02 ;
291 ];
292 mod:gui [
293 a mod:Gui;
294 mod:resourcesDirectory <modgui>;
295 mod:iconTemplate <modgui/icon-gxmbreverb.html>;
296 mod:templateData <modgui/data-gxmbreverb.json>;
297 mod:screenshot <modgui/screenshot-gxmbreverb.png>;
298 mod:thumbnail <modgui/thumb-gxmbreverb.png>;
299 ].
300
301
302 <http://guitarix.sourceforge.net/plugins/gx_mbreverb_#gui>
303 a guiext:GtkUI;
304 guiext:binary <gx_mbreverb_gui.so>;
305 guiext:requiredFeature guiext:makeResident .
0 /*
1 * Copyright (C) 2012 Hermann Meyer, Andreas Degert, Pete Shorthose, Steve Poskitt
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 * --------------------------------------------------------------------------
17 */
18
19
20 #include <string>
21 #include <iostream>
22
23 #include <gtkmm.h>
24 #include "gx_mbreverb.h"
25 #include "widget.h"
26
27
28 #include <lv2.h>
29 #include <lv2/lv2plug.in/ns/extensions/ui/ui.h>
30
31 using namespace std;
32
33 class Gx_mbreverb_GUI
34 {
35 private:
36 Glib::ustring plugskin;
37 Glib::ustring addKnob;
38 Glib::ustring plug_name;
39 void set_knob(Glib::ustring knob);
40 void set_skin();
41 void set_plug_name(const char * plugin_uri);
42 GtkWidget* make_gui();
43 public:
44
45 Widget* widget;
46 static void set_plug_name_static(Gx_mbreverb_GUI *self, const char * plugin_uri)
47 {
48 self->set_plug_name(plugin_uri);
49 }
50 static GtkWidget* make_gui_static(Gx_mbreverb_GUI *self)
51 {
52 return self->make_gui();
53 }
54
55 Gx_mbreverb_GUI () {};
56 ~Gx_mbreverb_GUI () {};
57 } ;
58
59 void Gx_mbreverb_GUI::set_knob( Glib::ustring knob)
60 {
61 addKnob = " style 'gx_";
62 addKnob += plug_name;
63 addKnob += "_dark_skin_icons'\n"
64 " { \n"
65 " stock['bigknob'] = {{'";
66 addKnob += knob;
67 addKnob += "large_151f.png'}}\n"
68 " stock['smallknob'] = {{'";
69 addKnob += knob;
70 addKnob += "small_99f.png'}}\n"
71 " stock['smallknobr'] = {{'";
72 addKnob += knob;
73 addKnob += "medium_151f.png'}}\n"
74 " stock['button_on'] = {{'"
75 "echo-switch_on.png'}}\n"
76 " stock['button_off'] = {{'"
77 "echo-switch_off.png'}}\n"
78 " }\n"
79 "widget '*.";
80 addKnob += plug_name;
81 addKnob += "' style 'gx_";
82 addKnob += plug_name;
83 addKnob += "_dark_skin_icons' \n"
84 "class '*GxToggleImage' style'gx_";
85 addKnob += plug_name;
86 addKnob += "_dark_skin_icons' \n";
87 }
88
89 void Gx_mbreverb_GUI::set_skin()
90 {
91 Glib::ustring toparse = "pixmap_path ";
92 toparse += " '";
93 toparse += GX_LV2_STYLE_DIR;
94 toparse += "/'\n";
95 toparse += "style \"gx_";
96 toparse += plug_name;
97 toparse += "_dark-paintbox\"\n"
98 " { \n"
99 "GxPaintBox::skin-gradient = {\n"
100 "{ 65536, 0, 0, 13107, 52428 }, \n"
101 "{ 52428, 0, 0, 0, 52428 },\n"
102 "{ 13107, 0, 0, 13107, 13107 }}\n"
103 " GxPaintBox::box-gradient = {\n"
104 "{ 0, 61, 61, 61, 62428 }, \n"
105 "{ 22768, 80, 83, 80, 42428 }, \n"
106 "{ 52428, 8, 8, 80, 32428 }, \n"
107 "{ 65536, 4, 4, 4, 52428 }} \n"
108 " GxPaintBox::icon-set =1\n"
109 " }\n"
110 "\n"
111 "style 'gx_head_expander_box' \n"
112 " { \n"
113 " fg[NORMAL] = '#2F0E0E' \n"
114 "font_name = 'sans 7.5 bold' \n"
115 " }\n";
116 toparse += addKnob;
117
118 toparse += " widget '*.amplabel' style:highest 'gx_head_expander_box'\n"
119 "widget '*.";
120 toparse += plug_name;
121 toparse += "' style 'gx_";
122 toparse += plug_name;
123 toparse += "_dark-paintbox' ";
124 toparse += " style 'gx_selector_";
125 toparse += plug_name;
126 toparse += "'\n"
127 " {\n"
128 " fg[NORMAL] = '#c0c6d0'\n"
129 " GtkRange::trough-border = 2\n"
130 " GtkRange::stepper-size = 8\n"
131 " GtkRange::stepper-spacing = 2\n"
132 " GxRegler::value-border = { 2, 2, 2, 2 }\n"
133 " font_name = 'sans 7.5'\n"
134 " xthickness = 10\n"
135 " ythickness = 1\n"
136 " }\n"
137 "widget '*.";
138 toparse += plug_name;
139 toparse += "' style:highest 'gx_selector_";
140 toparse += plug_name;
141 toparse += "'\n";
142 toparse += "style 'gx_switch'\n"
143 "{\n"
144 "xthickness = 0\n"
145 "ythickness = 0\n"
146 "GtkButton::inner-border = {0, 0, 0, 0}\n"
147 "GtkButton::default-border = {0, 0, 0, 0}\n"
148 "GtkButton::focus-line-width = 0\n"
149 "GtkButton::focus-padding = 0\n"
150 "GtkButton::interior-focus = 0\n"
151 "GtkButton::child-displacement-x = 0\n"
152 "GtkButton::child-displacement-y = 0\n"
153 " }\n"
154 "widget '*.";
155 toparse += plug_name;
156 toparse += "' style:highest 'gx_switch'";
157 toparse += "style 'gx_fastmeter'\n"
158 " {\n"
159 " GxFastMeter::clr-bottom = '#003808'\n"
160 " GxFastMeter::clr-middle = '#00ff00'\n"
161 " GxFastMeter::clr-top = '#ff0000'\n"
162 " GxFastMeter::over = '#ff0000'\n"
163 " }\n"
164 " class '*GxFastMeter' style:highest 'gx_fastmeter'\n";
165
166 gtk_rc_parse_string (toparse.c_str());
167 }
168
169 void Gx_mbreverb_GUI::set_plug_name( const char * plugin_uri)
170 {
171 addKnob = "";
172
173 if (strcmp("http://guitarix.sourceforge.net/plugins/gx_mbreverb_#_mbreverb_", plugin_uri) == 0)
174 {
175 plug_name = "_mbreverb_";
176 set_knob("tactile_knob_");
177 }
178 else
179 {
180 plug_name = "_mbreverb_";
181 }
182 }
183
184 GtkWidget* Gx_mbreverb_GUI::make_gui()
185 {
186 // init the gxwmm library
187 Gxw::init();
188 set_skin();
189 GtkWidget* container = gtk_vbox_new(FALSE, 2);
190 widget = new Widget(plug_name);
191 GtkWidget* cWidget = GTK_WIDGET(widget->gobj());
192 gtk_container_add(GTK_CONTAINER(container), cWidget );
193
194 return container;
195 }
196
197
198 static LV2UI_Handle instantiate(const struct _LV2UI_Descriptor * descriptor,
199 const char * plugin_uri,
200 const char * bundle_path,
201 LV2UI_Write_Function write_function,
202 LV2UI_Controller controller,
203 LV2UI_Widget * widget,
204 const LV2_Feature * const * features)
205 {
206 Gx_mbreverb_GUI* self = new Gx_mbreverb_GUI();
207 if (self == NULL) return NULL;
208 self->set_plug_name_static(self, plugin_uri);
209 *widget = (LV2UI_Widget)self->make_gui_static(self);
210 self->widget->controller = controller;
211 self->widget->write_function = write_function;
212 return (LV2UI_Handle)self;
213 }
214
215 static void cleanup(LV2UI_Handle ui)
216 {
217 Gx_mbreverb_GUI *pluginGui = static_cast<Gx_mbreverb_GUI*>(ui);
218 delete pluginGui->widget;
219 delete pluginGui;
220 }
221
222 static void port_event(LV2UI_Handle ui,
223 uint32_t port_index,
224 uint32_t buffer_size,
225 uint32_t format,
226 const void * buffer)
227 {
228 Gx_mbreverb_GUI *self = static_cast<Gx_mbreverb_GUI*>(ui);
229 self->widget->set_value_static( port_index, buffer_size, format, buffer, self->widget);
230 return;
231 }
232
233
234 static LV2UI_Descriptor descriptors[] =
235 {
236 {GXPLUGIN_UI_URI, instantiate, cleanup, port_event, NULL}
237 };
238
239 const LV2UI_Descriptor * lv2ui_descriptor(uint32_t index)
240 {
241 //printf("lv2ui_descriptor(%u) called\n", (uint32_t)index);
242 if (index >= sizeof(descriptors) / sizeof(descriptors[0]))
243 {
244 return NULL;
245 }
246 return descriptors + index;
247 }
248
0 #
1 # Copyright (C) 2012 Hermann Meyer, Andreas Degert, Pete Shorthose, Steve Poskitt
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 # --------------------------------------------------------------------------
17 #
18
19 @prefix lv2: <http://lv2plug.in/ns/lv2core#> .
20 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
21
22 <http://guitarix.sourceforge.net/plugins/gx_mbreverb_#_mbreverb_>
23 a lv2:Plugin ;
24 lv2:binary <gx_mbreverb.so> ;
25 rdfs:seeAlso <gx_mbreverb.ttl> .
0 #
1 # Copyright (C) 2012 Hermann Meyer, Andreas Degert, Pete Shorthose, Steve Poskitt
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 # --------------------------------------------------------------------------
17 #
18
19 @prefix lv2: <http://lv2plug.in/ns/lv2core#> .
20 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
21
22 <http://guitarix.sourceforge.net/plugins/gx_mbreverb_#_mbreverb_>
23 a lv2:Plugin ;
24 lv2:binary <gx_mbreverb@LIB_EXT@> ;
25 rdfs:seeAlso <gx_mbreverb.ttl> .
0 // generated from file './faust/mbreverb.dsp' by dsp2cc:
1 // Code generated with Faust 0.9.65 (http://faust.grame.fr)
2
3
4 namespace mbreverb {
5
6 class Dsp: public PluginLV2 {
7 private:
8 uint32_t fSamplingFreq;
9 int iConst0;
10 double fConst1;
11 FAUSTFLOAT fslider0;
12 FAUSTFLOAT *fslider0_;
13 double fConst2;
14 FAUSTFLOAT fslider1;
15 FAUSTFLOAT *fslider1_;
16 FAUSTFLOAT fslider2;
17 FAUSTFLOAT *fslider2_;
18 FAUSTFLOAT fslider3;
19 FAUSTFLOAT *fslider3_;
20 double fVec0[2];
21 double fRec11[2];
22 double fRec10[3];
23 double fVec1[2];
24 double fRec9[2];
25 double fRec8[3];
26 double fVec2[2];
27 double fRec7[2];
28 double fRec6[3];
29 double fVec3[2];
30 double fRec5[2];
31 double fRec4[3];
32 FAUSTFLOAT fslider4;
33 FAUSTFLOAT *fslider4_;
34 FAUSTFLOAT fslider5;
35 FAUSTFLOAT *fslider5_;
36 double fRec21[2];
37 FAUSTFLOAT fslider6;
38 FAUSTFLOAT *fslider6_;
39 int IOTA;
40 double fVec4[2048];
41 double fRec20[2];
42 double fRec23[2];
43 double fVec5[2048];
44 double fRec22[2];
45 double fRec25[2];
46 double fVec6[2048];
47 double fRec24[2];
48 double fRec27[2];
49 double fVec7[2048];
50 double fRec26[2];
51 double fRec29[2];
52 double fVec8[2048];
53 double fRec28[2];
54 double fRec31[2];
55 double fVec9[2048];
56 double fRec30[2];
57 double fRec33[2];
58 double fVec10[2048];
59 double fRec32[2];
60 double fRec35[2];
61 double fVec11[2048];
62 double fRec34[2];
63 double fVec12[1024];
64 double fRec18[2];
65 double fVec13[512];
66 double fRec16[2];
67 double fVec14[512];
68 double fRec14[2];
69 double fVec15[256];
70 double fRec12[2];
71 double fRec0[2];
72 int iRec1[2];
73 double fRec2[2];
74 FAUSTFLOAT fbargraph0;
75 FAUSTFLOAT *fbargraph0_;
76 double fRec41[2];
77 double fRec40[3];
78 FAUSTFLOAT fslider7;
79 FAUSTFLOAT *fslider7_;
80 FAUSTFLOAT fslider8;
81 FAUSTFLOAT *fslider8_;
82 double fRec51[2];
83 FAUSTFLOAT fslider9;
84 FAUSTFLOAT *fslider9_;
85 double fVec16[2048];
86 double fRec50[2];
87 double fRec53[2];
88 double fVec17[2048];
89 double fRec52[2];
90 double fRec55[2];
91 double fVec18[2048];
92 double fRec54[2];
93 double fRec57[2];
94 double fVec19[2048];
95 double fRec56[2];
96 double fRec59[2];
97 double fVec20[2048];
98 double fRec58[2];
99 double fRec61[2];
100 double fVec21[2048];
101 double fRec60[2];
102 double fRec63[2];
103 double fVec22[2048];
104 double fRec62[2];
105 double fRec65[2];
106 double fVec23[2048];
107 double fRec64[2];
108 double fVec24[1024];
109 double fRec48[2];
110 double fVec25[512];
111 double fRec46[2];
112 double fVec26[512];
113 double fRec44[2];
114 double fVec27[256];
115 double fRec42[2];
116 double fRec36[2];
117 int iRec37[2];
118 double fRec38[2];
119 FAUSTFLOAT fbargraph1;
120 FAUSTFLOAT *fbargraph1_;
121 double fRec72[2];
122 double fRec71[3];
123 double fRec70[3];
124 FAUSTFLOAT fslider10;
125 FAUSTFLOAT *fslider10_;
126 FAUSTFLOAT fslider11;
127 FAUSTFLOAT *fslider11_;
128 double fRec82[2];
129 FAUSTFLOAT fslider12;
130 FAUSTFLOAT *fslider12_;
131 double fVec28[2048];
132 double fRec81[2];
133 double fRec84[2];
134 double fVec29[2048];
135 double fRec83[2];
136 double fRec86[2];
137 double fVec30[2048];
138 double fRec85[2];
139 double fRec88[2];
140 double fVec31[2048];
141 double fRec87[2];
142 double fRec90[2];
143 double fVec32[2048];
144 double fRec89[2];
145 double fRec92[2];
146 double fVec33[2048];
147 double fRec91[2];
148 double fRec94[2];
149 double fVec34[2048];
150 double fRec93[2];
151 double fRec96[2];
152 double fVec35[2048];
153 double fRec95[2];
154 double fVec36[1024];
155 double fRec79[2];
156 double fVec37[512];
157 double fRec77[2];
158 double fVec38[512];
159 double fRec75[2];
160 double fVec39[256];
161 double fRec73[2];
162 double fRec66[2];
163 int iRec67[2];
164 double fRec68[2];
165 FAUSTFLOAT fbargraph2;
166 FAUSTFLOAT *fbargraph2_;
167 double fRec104[2];
168 double fRec103[3];
169 double fRec102[3];
170 double fRec101[3];
171 FAUSTFLOAT fslider13;
172 FAUSTFLOAT *fslider13_;
173 FAUSTFLOAT fslider14;
174 FAUSTFLOAT *fslider14_;
175 double fRec114[2];
176 FAUSTFLOAT fslider15;
177 FAUSTFLOAT *fslider15_;
178 double fVec40[2048];
179 double fRec113[2];
180 double fRec116[2];
181 double fVec41[2048];
182 double fRec115[2];
183 double fRec118[2];
184 double fVec42[2048];
185 double fRec117[2];
186 double fRec120[2];
187 double fVec43[2048];
188 double fRec119[2];
189 double fRec122[2];
190 double fVec44[2048];
191 double fRec121[2];
192 double fRec124[2];
193 double fVec45[2048];
194 double fRec123[2];
195 double fRec126[2];
196 double fVec46[2048];
197 double fRec125[2];
198 double fRec128[2];
199 double fVec47[2048];
200 double fRec127[2];
201 double fVec48[1024];
202 double fRec111[2];
203 double fVec49[512];
204 double fRec109[2];
205 double fVec50[512];
206 double fRec107[2];
207 double fVec51[256];
208 double fRec105[2];
209 double fRec97[2];
210 int iRec98[2];
211 double fRec99[2];
212 FAUSTFLOAT fbargraph3;
213 FAUSTFLOAT *fbargraph3_;
214 double fRec137[2];
215 double fRec136[3];
216 double fRec135[3];
217 double fRec134[3];
218 double fRec133[3];
219 FAUSTFLOAT fslider16;
220 FAUSTFLOAT *fslider16_;
221 FAUSTFLOAT fslider17;
222 FAUSTFLOAT *fslider17_;
223 double fRec147[2];
224 FAUSTFLOAT fslider18;
225 FAUSTFLOAT *fslider18_;
226 double fVec52[2048];
227 double fRec146[2];
228 double fRec149[2];
229 double fVec53[2048];
230 double fRec148[2];
231 double fRec151[2];
232 double fVec54[2048];
233 double fRec150[2];
234 double fRec153[2];
235 double fVec55[2048];
236 double fRec152[2];
237 double fRec155[2];
238 double fVec56[2048];
239 double fRec154[2];
240 double fRec157[2];
241 double fVec57[2048];
242 double fRec156[2];
243 double fRec159[2];
244 double fVec58[2048];
245 double fRec158[2];
246 double fRec161[2];
247 double fVec59[2048];
248 double fRec160[2];
249 double fVec60[1024];
250 double fRec144[2];
251 double fVec61[512];
252 double fRec142[2];
253 double fVec62[512];
254 double fRec140[2];
255 double fVec63[256];
256 double fRec138[2];
257 double fRec129[2];
258 int iRec130[2];
259 double fRec131[2];
260 FAUSTFLOAT fbargraph4;
261 FAUSTFLOAT *fbargraph4_;
262 void connect(uint32_t port,void* data);
263 void clear_state_f();
264 void init(uint32_t samplingFreq);
265 void compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0);
266
267 static void clear_state_f_static(PluginLV2*);
268 static void init_static(uint32_t samplingFreq, PluginLV2*);
269 static void compute_static(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0, PluginLV2*);
270 static void del_instance(PluginLV2 *p);
271 static void connect_static(uint32_t port,void* data, PluginLV2 *p);
272 public:
273 Dsp();
274 ~Dsp();
275 };
276
277
278
279 Dsp::Dsp()
280 : PluginLV2() {
281 version = PLUGINLV2_VERSION;
282 id = "mbe";
283 name = N_("MultiBand Reverb");
284 mono_audio = compute_static;
285 stereo_audio = 0;
286 set_samplerate = init_static;
287 activate_plugin = 0;
288 connect_ports = connect_static;
289 clear_state = clear_state_f_static;
290 delete_instance = del_instance;
291 }
292
293 Dsp::~Dsp() {
294 }
295
296 inline void Dsp::clear_state_f()
297 {
298 for (int i=0; i<2; i++) fVec0[i] = 0;
299 for (int i=0; i<2; i++) fRec11[i] = 0;
300 for (int i=0; i<3; i++) fRec10[i] = 0;
301 for (int i=0; i<2; i++) fVec1[i] = 0;
302 for (int i=0; i<2; i++) fRec9[i] = 0;
303 for (int i=0; i<3; i++) fRec8[i] = 0;
304 for (int i=0; i<2; i++) fVec2[i] = 0;
305 for (int i=0; i<2; i++) fRec7[i] = 0;
306 for (int i=0; i<3; i++) fRec6[i] = 0;
307 for (int i=0; i<2; i++) fVec3[i] = 0;
308 for (int i=0; i<2; i++) fRec5[i] = 0;
309 for (int i=0; i<3; i++) fRec4[i] = 0;
310 for (int i=0; i<2; i++) fRec21[i] = 0;
311 for (int i=0; i<2048; i++) fVec4[i] = 0;
312 for (int i=0; i<2; i++) fRec20[i] = 0;
313 for (int i=0; i<2; i++) fRec23[i] = 0;
314 for (int i=0; i<2048; i++) fVec5[i] = 0;
315 for (int i=0; i<2; i++) fRec22[i] = 0;
316 for (int i=0; i<2; i++) fRec25[i] = 0;
317 for (int i=0; i<2048; i++) fVec6[i] = 0;
318 for (int i=0; i<2; i++) fRec24[i] = 0;
319 for (int i=0; i<2; i++) fRec27[i] = 0;
320 for (int i=0; i<2048; i++) fVec7[i] = 0;
321 for (int i=0; i<2; i++) fRec26[i] = 0;
322 for (int i=0; i<2; i++) fRec29[i] = 0;
323 for (int i=0; i<2048; i++) fVec8[i] = 0;
324 for (int i=0; i<2; i++) fRec28[i] = 0;
325 for (int i=0; i<2; i++) fRec31[i] = 0;
326 for (int i=0; i<2048; i++) fVec9[i] = 0;
327 for (int i=0; i<2; i++) fRec30[i] = 0;
328 for (int i=0; i<2; i++) fRec33[i] = 0;
329 for (int i=0; i<2048; i++) fVec10[i] = 0;
330 for (int i=0; i<2; i++) fRec32[i] = 0;
331 for (int i=0; i<2; i++) fRec35[i] = 0;
332 for (int i=0; i<2048; i++) fVec11[i] = 0;
333 for (int i=0; i<2; i++) fRec34[i] = 0;
334 for (int i=0; i<1024; i++) fVec12[i] = 0;
335 for (int i=0; i<2; i++) fRec18[i] = 0;
336 for (int i=0; i<512; i++) fVec13[i] = 0;
337 for (int i=0; i<2; i++) fRec16[i] = 0;
338 for (int i=0; i<512; i++) fVec14[i] = 0;
339 for (int i=0; i<2; i++) fRec14[i] = 0;
340 for (int i=0; i<256; i++) fVec15[i] = 0;
341 for (int i=0; i<2; i++) fRec12[i] = 0;
342 for (int i=0; i<2; i++) fRec0[i] = 0;
343 for (int i=0; i<2; i++) iRec1[i] = 0;
344 for (int i=0; i<2; i++) fRec2[i] = 0;
345 for (int i=0; i<2; i++) fRec41[i] = 0;
346 for (int i=0; i<3; i++) fRec40[i] = 0;
347 for (int i=0; i<2; i++) fRec51[i] = 0;
348 for (int i=0; i<2048; i++) fVec16[i] = 0;
349 for (int i=0; i<2; i++) fRec50[i] = 0;
350 for (int i=0; i<2; i++) fRec53[i] = 0;
351 for (int i=0; i<2048; i++) fVec17[i] = 0;
352 for (int i=0; i<2; i++) fRec52[i] = 0;
353 for (int i=0; i<2; i++) fRec55[i] = 0;
354 for (int i=0; i<2048; i++) fVec18[i] = 0;
355 for (int i=0; i<2; i++) fRec54[i] = 0;
356 for (int i=0; i<2; i++) fRec57[i] = 0;
357 for (int i=0; i<2048; i++) fVec19[i] = 0;
358 for (int i=0; i<2; i++) fRec56[i] = 0;
359 for (int i=0; i<2; i++) fRec59[i] = 0;
360 for (int i=0; i<2048; i++) fVec20[i] = 0;
361 for (int i=0; i<2; i++) fRec58[i] = 0;
362 for (int i=0; i<2; i++) fRec61[i] = 0;
363 for (int i=0; i<2048; i++) fVec21[i] = 0;
364 for (int i=0; i<2; i++) fRec60[i] = 0;
365 for (int i=0; i<2; i++) fRec63[i] = 0;
366 for (int i=0; i<2048; i++) fVec22[i] = 0;
367 for (int i=0; i<2; i++) fRec62[i] = 0;
368 for (int i=0; i<2; i++) fRec65[i] = 0;
369 for (int i=0; i<2048; i++) fVec23[i] = 0;
370 for (int i=0; i<2; i++) fRec64[i] = 0;
371 for (int i=0; i<1024; i++) fVec24[i] = 0;
372 for (int i=0; i<2; i++) fRec48[i] = 0;
373 for (int i=0; i<512; i++) fVec25[i] = 0;
374 for (int i=0; i<2; i++) fRec46[i] = 0;
375 for (int i=0; i<512; i++) fVec26[i] = 0;
376 for (int i=0; i<2; i++) fRec44[i] = 0;
377 for (int i=0; i<256; i++) fVec27[i] = 0;
378 for (int i=0; i<2; i++) fRec42[i] = 0;
379 for (int i=0; i<2; i++) fRec36[i] = 0;
380 for (int i=0; i<2; i++) iRec37[i] = 0;
381 for (int i=0; i<2; i++) fRec38[i] = 0;
382 for (int i=0; i<2; i++) fRec72[i] = 0;
383 for (int i=0; i<3; i++) fRec71[i] = 0;
384 for (int i=0; i<3; i++) fRec70[i] = 0;
385 for (int i=0; i<2; i++) fRec82[i] = 0;
386 for (int i=0; i<2048; i++) fVec28[i] = 0;
387 for (int i=0; i<2; i++) fRec81[i] = 0;
388 for (int i=0; i<2; i++) fRec84[i] = 0;
389 for (int i=0; i<2048; i++) fVec29[i] = 0;
390 for (int i=0; i<2; i++) fRec83[i] = 0;
391 for (int i=0; i<2; i++) fRec86[i] = 0;
392 for (int i=0; i<2048; i++) fVec30[i] = 0;
393 for (int i=0; i<2; i++) fRec85[i] = 0;
394 for (int i=0; i<2; i++) fRec88[i] = 0;
395 for (int i=0; i<2048; i++) fVec31[i] = 0;
396 for (int i=0; i<2; i++) fRec87[i] = 0;
397 for (int i=0; i<2; i++) fRec90[i] = 0;
398 for (int i=0; i<2048; i++) fVec32[i] = 0;
399 for (int i=0; i<2; i++) fRec89[i] = 0;
400 for (int i=0; i<2; i++) fRec92[i] = 0;
401 for (int i=0; i<2048; i++) fVec33[i] = 0;
402 for (int i=0; i<2; i++) fRec91[i] = 0;
403 for (int i=0; i<2; i++) fRec94[i] = 0;
404 for (int i=0; i<2048; i++) fVec34[i] = 0;
405 for (int i=0; i<2; i++) fRec93[i] = 0;
406 for (int i=0; i<2; i++) fRec96[i] = 0;
407 for (int i=0; i<2048; i++) fVec35[i] = 0;
408 for (int i=0; i<2; i++) fRec95[i] = 0;
409 for (int i=0; i<1024; i++) fVec36[i] = 0;
410 for (int i=0; i<2; i++) fRec79[i] = 0;
411 for (int i=0; i<512; i++) fVec37[i] = 0;
412 for (int i=0; i<2; i++) fRec77[i] = 0;
413 for (int i=0; i<512; i++) fVec38[i] = 0;
414 for (int i=0; i<2; i++) fRec75[i] = 0;
415 for (int i=0; i<256; i++) fVec39[i] = 0;
416 for (int i=0; i<2; i++) fRec73[i] = 0;
417 for (int i=0; i<2; i++) fRec66[i] = 0;
418 for (int i=0; i<2; i++) iRec67[i] = 0;
419 for (int i=0; i<2; i++) fRec68[i] = 0;
420 for (int i=0; i<2; i++) fRec104[i] = 0;
421 for (int i=0; i<3; i++) fRec103[i] = 0;
422 for (int i=0; i<3; i++) fRec102[i] = 0;
423 for (int i=0; i<3; i++) fRec101[i] = 0;
424 for (int i=0; i<2; i++) fRec114[i] = 0;
425 for (int i=0; i<2048; i++) fVec40[i] = 0;
426 for (int i=0; i<2; i++) fRec113[i] = 0;
427 for (int i=0; i<2; i++) fRec116[i] = 0;
428 for (int i=0; i<2048; i++) fVec41[i] = 0;
429 for (int i=0; i<2; i++) fRec115[i] = 0;
430 for (int i=0; i<2; i++) fRec118[i] = 0;
431 for (int i=0; i<2048; i++) fVec42[i] = 0;
432 for (int i=0; i<2; i++) fRec117[i] = 0;
433 for (int i=0; i<2; i++) fRec120[i] = 0;
434 for (int i=0; i<2048; i++) fVec43[i] = 0;
435 for (int i=0; i<2; i++) fRec119[i] = 0;
436 for (int i=0; i<2; i++) fRec122[i] = 0;
437 for (int i=0; i<2048; i++) fVec44[i] = 0;
438 for (int i=0; i<2; i++) fRec121[i] = 0;
439 for (int i=0; i<2; i++) fRec124[i] = 0;
440 for (int i=0; i<2048; i++) fVec45[i] = 0;
441 for (int i=0; i<2; i++) fRec123[i] = 0;
442 for (int i=0; i<2; i++) fRec126[i] = 0;
443 for (int i=0; i<2048; i++) fVec46[i] = 0;
444 for (int i=0; i<2; i++) fRec125[i] = 0;
445 for (int i=0; i<2; i++) fRec128[i] = 0;
446 for (int i=0; i<2048; i++) fVec47[i] = 0;
447 for (int i=0; i<2; i++) fRec127[i] = 0;
448 for (int i=0; i<1024; i++) fVec48[i] = 0;
449 for (int i=0; i<2; i++) fRec111[i] = 0;
450 for (int i=0; i<512; i++) fVec49[i] = 0;
451 for (int i=0; i<2; i++) fRec109[i] = 0;
452 for (int i=0; i<512; i++) fVec50[i] = 0;
453 for (int i=0; i<2; i++) fRec107[i] = 0;
454 for (int i=0; i<256; i++) fVec51[i] = 0;
455 for (int i=0; i<2; i++) fRec105[i] = 0;
456 for (int i=0; i<2; i++) fRec97[i] = 0;
457 for (int i=0; i<2; i++) iRec98[i] = 0;
458 for (int i=0; i<2; i++) fRec99[i] = 0;
459 for (int i=0; i<2; i++) fRec137[i] = 0;
460 for (int i=0; i<3; i++) fRec136[i] = 0;
461 for (int i=0; i<3; i++) fRec135[i] = 0;
462 for (int i=0; i<3; i++) fRec134[i] = 0;
463 for (int i=0; i<3; i++) fRec133[i] = 0;
464 for (int i=0; i<2; i++) fRec147[i] = 0;
465 for (int i=0; i<2048; i++) fVec52[i] = 0;
466 for (int i=0; i<2; i++) fRec146[i] = 0;
467 for (int i=0; i<2; i++) fRec149[i] = 0;
468 for (int i=0; i<2048; i++) fVec53[i] = 0;
469 for (int i=0; i<2; i++) fRec148[i] = 0;
470 for (int i=0; i<2; i++) fRec151[i] = 0;
471 for (int i=0; i<2048; i++) fVec54[i] = 0;
472 for (int i=0; i<2; i++) fRec150[i] = 0;
473 for (int i=0; i<2; i++) fRec153[i] = 0;
474 for (int i=0; i<2048; i++) fVec55[i] = 0;
475 for (int i=0; i<2; i++) fRec152[i] = 0;
476 for (int i=0; i<2; i++) fRec155[i] = 0;
477 for (int i=0; i<2048; i++) fVec56[i] = 0;
478 for (int i=0; i<2; i++) fRec154[i] = 0;
479 for (int i=0; i<2; i++) fRec157[i] = 0;
480 for (int i=0; i<2048; i++) fVec57[i] = 0;
481 for (int i=0; i<2; i++) fRec156[i] = 0;
482 for (int i=0; i<2; i++) fRec159[i] = 0;
483 for (int i=0; i<2048; i++) fVec58[i] = 0;
484 for (int i=0; i<2; i++) fRec158[i] = 0;
485 for (int i=0; i<2; i++) fRec161[i] = 0;
486 for (int i=0; i<2048; i++) fVec59[i] = 0;
487 for (int i=0; i<2; i++) fRec160[i] = 0;
488 for (int i=0; i<1024; i++) fVec60[i] = 0;
489 for (int i=0; i<2; i++) fRec144[i] = 0;
490 for (int i=0; i<512; i++) fVec61[i] = 0;
491 for (int i=0; i<2; i++) fRec142[i] = 0;
492 for (int i=0; i<512; i++) fVec62[i] = 0;
493 for (int i=0; i<2; i++) fRec140[i] = 0;
494 for (int i=0; i<256; i++) fVec63[i] = 0;
495 for (int i=0; i<2; i++) fRec138[i] = 0;
496 for (int i=0; i<2; i++) fRec129[i] = 0;
497 for (int i=0; i<2; i++) iRec130[i] = 0;
498 for (int i=0; i<2; i++) fRec131[i] = 0;
499 }
500
501 void Dsp::clear_state_f_static(PluginLV2 *p)
502 {
503 static_cast<Dsp*>(p)->clear_state_f();
504 }
505
506 inline void Dsp::init(uint32_t samplingFreq)
507 {
508 fSamplingFreq = samplingFreq;
509 iConst0 = min(192000, max(1, fSamplingFreq));
510 fConst1 = (1.0 / double(iConst0));
511 fConst2 = (3.141592653589793 / double(iConst0));
512 IOTA = 0;
513 clear_state_f();
514 }
515
516 void Dsp::init_static(uint32_t samplingFreq, PluginLV2 *p)
517 {
518 static_cast<Dsp*>(p)->init(samplingFreq);
519 }
520
521 void always_inline Dsp::compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0)
522 {
523 #define fslider0 (*fslider0_)
524 #define fslider1 (*fslider1_)
525 #define fslider2 (*fslider2_)
526 #define fslider3 (*fslider3_)
527 #define fslider4 (*fslider4_)
528 #define fslider5 (*fslider5_)
529 #define fslider6 (*fslider6_)
530 #define fbargraph0 (*fbargraph0_)
531 #define fslider7 (*fslider7_)
532 #define fslider8 (*fslider8_)
533 #define fslider9 (*fslider9_)
534 #define fbargraph1 (*fbargraph1_)
535 #define fslider10 (*fslider10_)
536 #define fslider11 (*fslider11_)
537 #define fslider12 (*fslider12_)
538 #define fbargraph2 (*fbargraph2_)
539 #define fslider13 (*fslider13_)
540 #define fslider14 (*fslider14_)
541 #define fslider15 (*fslider15_)
542 #define fbargraph3 (*fbargraph3_)
543 #define fslider16 (*fslider16_)
544 #define fslider17 (*fslider17_)
545 #define fslider18 (*fslider18_)
546 #define fbargraph4 (*fbargraph4_)
547 double fSlow0 = tan((fConst2 * double(fslider0)));
548 double fSlow1 = (1.0 / faustpower<2>(fSlow0));
549 double fSlow2 = (2 * (1 - fSlow1));
550 double fSlow3 = (1.0 / fSlow0);
551 double fSlow4 = (1 + ((fSlow3 - 1.0000000000000004) / fSlow0));
552 double fSlow5 = (1 + ((fSlow3 + 1.0000000000000004) / fSlow0));
553 double fSlow6 = (1.0 / fSlow5);
554 double fSlow7 = tan((fConst2 * double(fslider1)));
555 double fSlow8 = (1.0 / faustpower<2>(fSlow7));
556 double fSlow9 = (2 * (1 - fSlow8));
557 double fSlow10 = (1.0 / fSlow7);
558 double fSlow11 = (1 + ((fSlow10 - 1.0000000000000004) / fSlow7));
559 double fSlow12 = (1 + ((fSlow10 + 1.0000000000000004) / fSlow7));
560 double fSlow13 = (1.0 / fSlow12);
561 double fSlow14 = tan((fConst2 * double(fslider2)));
562 double fSlow15 = (1.0 / faustpower<2>(fSlow14));
563 double fSlow16 = (2 * (1 - fSlow15));
564 double fSlow17 = (1.0 / fSlow14);
565 double fSlow18 = (1 + ((fSlow17 - 1.0000000000000004) / fSlow14));
566 double fSlow19 = (1 + ((fSlow17 + 1.0000000000000004) / fSlow14));
567 double fSlow20 = (1.0 / fSlow19);
568 double fSlow21 = tan((fConst2 * double(fslider3)));
569 double fSlow22 = (1.0 / faustpower<2>(fSlow21));
570 double fSlow23 = (2 * (1 - fSlow22));
571 double fSlow24 = (1.0 / fSlow21);
572 double fSlow25 = (1 + ((fSlow24 - 1.0000000000000004) / fSlow21));
573 double fSlow26 = (1 + ((1.0000000000000004 + fSlow24) / fSlow21));
574 double fSlow27 = (1.0 / fSlow26);
575 double fSlow28 = (1 + fSlow24);
576 double fSlow29 = (1.0 / fSlow28);
577 double fSlow30 = (0 - ((1 - fSlow24) / fSlow28));
578 double fSlow31 = (1 + fSlow17);
579 double fSlow32 = (1.0 / fSlow31);
580 double fSlow33 = (0 - ((1 - fSlow17) / fSlow31));
581 double fSlow34 = (1 + fSlow10);
582 double fSlow35 = (1.0 / fSlow34);
583 double fSlow36 = (0 - ((1 - fSlow10) / fSlow34));
584 double fSlow37 = (1 + fSlow3);
585 double fSlow38 = (1.0 / fSlow37);
586 double fSlow39 = (0 - ((1 - fSlow3) / fSlow37));
587 double fSlow40 = double(fslider4);
588 double fSlow41 = (1 - (0.01 * fSlow40));
589 double fSlow42 = ((fSlow41 + (fSlow40 * (0.00015 + (0.01 * fSlow41)))) / fSlow5);
590 double fSlow43 = double(fslider5);
591 double fSlow44 = (1 - fSlow43);
592 double fSlow45 = (0.7 + (0.28 * double(fslider6)));
593 double fSlow46 = (0.00015 * (fSlow40 / fSlow5));
594 double fSlow47 = (0 - fSlow3);
595 double fSlow48 = (1.0 / (fSlow0 * fSlow12));
596 double fSlow49 = (2 * (0 - fSlow1));
597 double fSlow50 = double(fslider7);
598 double fSlow51 = (1 - (0.01 * fSlow50));
599 double fSlow52 = ((fSlow51 + (fSlow50 * (0.00015 + (0.01 * fSlow51)))) / fSlow5);
600 double fSlow53 = double(fslider8);
601 double fSlow54 = (1 - fSlow53);
602 double fSlow55 = (0.7 + (0.28 * double(fslider9)));
603 double fSlow56 = (0.00015 * (fSlow50 / fSlow5));
604 double fSlow57 = (1 + ((fSlow3 - 1.0) / fSlow0));
605 double fSlow58 = (1.0 / (1 + ((1.0 + fSlow3) / fSlow0)));
606 double fSlow59 = (0 - fSlow10);
607 double fSlow60 = (1.0 / (fSlow7 * fSlow19));
608 double fSlow61 = (2 * (0 - fSlow8));
609 double fSlow62 = double(fslider10);
610 double fSlow63 = (1 - (0.01 * fSlow62));
611 double fSlow64 = (fSlow63 + (fSlow62 * (0.00015 + (0.01 * fSlow63))));
612 double fSlow65 = double(fslider11);
613 double fSlow66 = (1 - fSlow65);
614 double fSlow67 = (0.7 + (0.28 * double(fslider12)));
615 double fSlow68 = (0.00015 * fSlow62);
616 double fSlow69 = (1 + ((fSlow10 - 1.0) / fSlow7));
617 double fSlow70 = (1.0 / (1 + ((1.0 + fSlow10) / fSlow7)));
618 double fSlow71 = (0 - fSlow17);
619 double fSlow72 = (1.0 / (fSlow14 * fSlow26));
620 double fSlow73 = (2 * (0 - fSlow15));
621 double fSlow74 = double(fslider13);
622 double fSlow75 = (1 - (0.01 * fSlow74));
623 double fSlow76 = (fSlow75 + (fSlow74 * (0.00015 + (0.01 * fSlow75))));
624 double fSlow77 = double(fslider14);
625 double fSlow78 = (1 - fSlow77);
626 double fSlow79 = (0.7 + (0.28 * double(fslider15)));
627 double fSlow80 = (0.00015 * fSlow74);
628 double fSlow81 = (1 + ((fSlow17 - 1.0) / fSlow14));
629 double fSlow82 = (1.0 / (1 + ((1.0 + fSlow17) / fSlow14)));
630 double fSlow83 = (0 - fSlow24);
631 double fSlow84 = (2 * (0 - fSlow22));
632 double fSlow85 = double(fslider16);
633 double fSlow86 = (1 - (0.01 * fSlow85));
634 double fSlow87 = (fSlow86 + (fSlow85 * (0.00015 + (0.01 * fSlow86))));
635 double fSlow88 = double(fslider17);
636 double fSlow89 = (1 - fSlow88);
637 double fSlow90 = (0.7 + (0.28 * double(fslider18)));
638 double fSlow91 = (0.00015 * fSlow85);
639 for (int i=0; i<count; i++) {
640 double fTemp0 = (double)input0[i];
641 fVec0[0] = fTemp0;
642 fRec11[0] = ((fSlow30 * fRec11[1]) + (fSlow29 * (fVec0[0] + fVec0[1])));
643 fRec10[0] = (fRec11[0] - (fSlow27 * ((fSlow25 * fRec10[2]) + (fSlow23 * fRec10[1]))));
644 double fTemp1 = (fRec10[2] + (fRec10[0] + (2 * fRec10[1])));
645 double fTemp2 = (fSlow27 * fTemp1);
646 fVec1[0] = fTemp2;
647 fRec9[0] = ((fSlow33 * fRec9[1]) + (fSlow32 * (fVec1[0] + fVec1[1])));
648 fRec8[0] = (fRec9[0] - (fSlow20 * ((fSlow18 * fRec8[2]) + (fSlow16 * fRec8[1]))));
649 double fTemp3 = (fRec8[2] + (fRec8[0] + (2 * fRec8[1])));
650 double fTemp4 = (fSlow20 * fTemp3);
651 fVec2[0] = fTemp4;
652 fRec7[0] = ((fSlow36 * fRec7[1]) + (fSlow35 * (fVec2[0] + fVec2[1])));
653 fRec6[0] = (fRec7[0] - (fSlow13 * ((fSlow11 * fRec6[2]) + (fSlow9 * fRec6[1]))));
654 double fTemp5 = (fRec6[2] + (fRec6[0] + (2 * fRec6[1])));
655 double fTemp6 = (fSlow13 * fTemp5);
656 fVec3[0] = fTemp6;
657 fRec5[0] = ((fSlow39 * fRec5[1]) + (fSlow38 * (fVec3[0] + fVec3[1])));
658 fRec4[0] = (fRec5[0] - (fSlow6 * ((fSlow4 * fRec4[2]) + (fSlow2 * fRec4[1]))));
659 double fTemp7 = (fRec4[2] + (fRec4[0] + (2 * fRec4[1])));
660 fRec21[0] = ((fSlow43 * fRec21[1]) + (fSlow44 * fRec20[1]));
661 double fTemp8 = (fSlow46 * fTemp7);
662 fVec4[IOTA&2047] = (fTemp8 + (fSlow45 * fRec21[0]));
663 fRec20[0] = fVec4[(IOTA-1640)&2047];
664 fRec23[0] = ((fSlow43 * fRec23[1]) + (fSlow44 * fRec22[1]));
665 fVec5[IOTA&2047] = (fTemp8 + (fSlow45 * fRec23[0]));
666 fRec22[0] = fVec5[(IOTA-1580)&2047];
667 fRec25[0] = ((fSlow43 * fRec25[1]) + (fSlow44 * fRec24[1]));
668 fVec6[IOTA&2047] = (fTemp8 + (fSlow45 * fRec25[0]));
669 fRec24[0] = fVec6[(IOTA-1514)&2047];
670 fRec27[0] = ((fSlow43 * fRec27[1]) + (fSlow44 * fRec26[1]));
671 fVec7[IOTA&2047] = (fTemp8 + (fSlow45 * fRec27[0]));
672 fRec26[0] = fVec7[(IOTA-1445)&2047];
673 fRec29[0] = ((fSlow43 * fRec29[1]) + (fSlow44 * fRec28[1]));
674 fVec8[IOTA&2047] = (fTemp8 + (fSlow45 * fRec29[0]));
675 fRec28[0] = fVec8[(IOTA-1379)&2047];
676 fRec31[0] = ((fSlow43 * fRec31[1]) + (fSlow44 * fRec30[1]));
677 fVec9[IOTA&2047] = (fTemp8 + (fSlow45 * fRec31[0]));
678 fRec30[0] = fVec9[(IOTA-1300)&2047];
679 fRec33[0] = ((fSlow43 * fRec33[1]) + (fSlow44 * fRec32[1]));
680 fVec10[IOTA&2047] = (fTemp8 + (fSlow45 * fRec33[0]));
681 fRec32[0] = fVec10[(IOTA-1211)&2047];
682 fRec35[0] = ((fSlow43 * fRec35[1]) + (fSlow44 * fRec34[1]));
683 fVec11[IOTA&2047] = (fTemp8 + (fSlow45 * fRec35[0]));
684 fRec34[0] = fVec11[(IOTA-1139)&2047];
685 double fTemp9 = (((((((fRec34[0] + fRec32[0]) + fRec30[0]) + fRec28[0]) + fRec26[0]) + fRec24[0]) + fRec22[0]) + fRec20[0]);
686 fVec12[IOTA&1023] = (fTemp9 + (0.5 * fRec18[1]));
687 fRec18[0] = fVec12[(IOTA-579)&1023];
688 double fRec19 = (0 - (fTemp9 - fRec18[1]));
689 fVec13[IOTA&511] = (fRec19 + (0.5 * fRec16[1]));
690 fRec16[0] = fVec13[(IOTA-464)&511];
691 double fRec17 = (fRec16[1] - fRec19);
692 fVec14[IOTA&511] = (fRec17 + (0.5 * fRec14[1]));
693 fRec14[0] = fVec14[(IOTA-364)&511];
694 double fRec15 = (fRec14[1] - fRec17);
695 fVec15[IOTA&255] = (fRec15 + (0.5 * fRec12[1]));
696 fRec12[0] = fVec15[(IOTA-248)&255];
697 double fRec13 = (fRec12[1] - fRec15);
698 double fTemp10 = (fRec13 + (fSlow42 * fTemp7));
699 double fRec3 = max(fConst1, fabs(fTemp10));
700 int iTemp11 = int((iRec1[1] < 4096));
701 fRec0[0] = ((iTemp11)?max(fRec0[1], fRec3):fRec3);
702 iRec1[0] = ((iTemp11)?(1 + iRec1[1]):1);
703 fRec2[0] = ((iTemp11)?fRec2[1]:fRec0[1]);
704 fbargraph0 = fRec2[0];
705 fRec41[0] = ((fSlow39 * fRec41[1]) + (fSlow38 * ((fSlow48 * fTemp5) + (fSlow47 * fVec3[1]))));
706 fRec40[0] = (fRec41[0] - (fSlow6 * ((fSlow4 * fRec40[2]) + (fSlow2 * fRec40[1]))));
707 double fTemp12 = (((fSlow1 * fRec40[0]) + (fSlow49 * fRec40[1])) + (fSlow1 * fRec40[2]));
708 fRec51[0] = ((fSlow53 * fRec51[1]) + (fSlow54 * fRec50[1]));
709 double fTemp13 = (fSlow56 * fTemp12);
710 fVec16[IOTA&2047] = (fTemp13 + (fSlow55 * fRec51[0]));
711 fRec50[0] = fVec16[(IOTA-1640)&2047];
712 fRec53[0] = ((fSlow53 * fRec53[1]) + (fSlow54 * fRec52[1]));
713 fVec17[IOTA&2047] = (fTemp13 + (fSlow55 * fRec53[0]));
714 fRec52[0] = fVec17[(IOTA-1580)&2047];
715 fRec55[0] = ((fSlow53 * fRec55[1]) + (fSlow54 * fRec54[1]));
716 fVec18[IOTA&2047] = (fTemp13 + (fSlow55 * fRec55[0]));
717 fRec54[0] = fVec18[(IOTA-1514)&2047];
718 fRec57[0] = ((fSlow53 * fRec57[1]) + (fSlow54 * fRec56[1]));
719 fVec19[IOTA&2047] = (fTemp13 + (fSlow55 * fRec57[0]));
720 fRec56[0] = fVec19[(IOTA-1445)&2047];
721 fRec59[0] = ((fSlow53 * fRec59[1]) + (fSlow54 * fRec58[1]));
722 fVec20[IOTA&2047] = (fTemp13 + (fSlow55 * fRec59[0]));
723 fRec58[0] = fVec20[(IOTA-1379)&2047];
724 fRec61[0] = ((fSlow53 * fRec61[1]) + (fSlow54 * fRec60[1]));
725 fVec21[IOTA&2047] = (fTemp13 + (fSlow55 * fRec61[0]));
726 fRec60[0] = fVec21[(IOTA-1300)&2047];
727 fRec63[0] = ((fSlow53 * fRec63[1]) + (fSlow54 * fRec62[1]));
728 fVec22[IOTA&2047] = (fTemp13 + (fSlow55 * fRec63[0]));
729 fRec62[0] = fVec22[(IOTA-1211)&2047];
730 fRec65[0] = ((fSlow53 * fRec65[1]) + (fSlow54 * fRec64[1]));
731 fVec23[IOTA&2047] = (fTemp13 + (fSlow55 * fRec65[0]));
732 fRec64[0] = fVec23[(IOTA-1139)&2047];
733 double fTemp14 = (((((((fRec64[0] + fRec62[0]) + fRec60[0]) + fRec58[0]) + fRec56[0]) + fRec54[0]) + fRec52[0]) + fRec50[0]);
734 fVec24[IOTA&1023] = (fTemp14 + (0.5 * fRec48[1]));
735 fRec48[0] = fVec24[(IOTA-579)&1023];
736 double fRec49 = (0 - (fTemp14 - fRec48[1]));
737 fVec25[IOTA&511] = (fRec49 + (0.5 * fRec46[1]));
738 fRec46[0] = fVec25[(IOTA-464)&511];
739 double fRec47 = (fRec46[1] - fRec49);
740 fVec26[IOTA&511] = (fRec47 + (0.5 * fRec44[1]));
741 fRec44[0] = fVec26[(IOTA-364)&511];
742 double fRec45 = (fRec44[1] - fRec47);
743 fVec27[IOTA&255] = (fRec45 + (0.5 * fRec42[1]));
744 fRec42[0] = fVec27[(IOTA-248)&255];
745 double fRec43 = (fRec42[1] - fRec45);
746 double fTemp15 = (fRec43 + (fSlow52 * fTemp12));
747 double fRec39 = max(fConst1, fabs(fTemp15));
748 int iTemp16 = int((iRec37[1] < 4096));
749 fRec36[0] = ((iTemp16)?max(fRec36[1], fRec39):fRec39);
750 iRec37[0] = ((iTemp16)?(1 + iRec37[1]):1);
751 fRec38[0] = ((iTemp16)?fRec38[1]:fRec36[1]);
752 fbargraph1 = fRec38[0];
753 double fTemp17 = (fSlow2 * fRec70[1]);
754 fRec72[0] = ((fSlow36 * fRec72[1]) + (fSlow35 * ((fSlow60 * fTemp3) + (fSlow59 * fVec2[1]))));
755 fRec71[0] = (fRec72[0] - (fSlow13 * ((fSlow11 * fRec71[2]) + (fSlow9 * fRec71[1]))));
756 fRec70[0] = ((fSlow13 * (((fSlow8 * fRec71[0]) + (fSlow61 * fRec71[1])) + (fSlow8 * fRec71[2]))) - (fSlow58 * ((fSlow57 * fRec70[2]) + fTemp17)));
757 double fTemp18 = (fRec70[2] + (fSlow58 * (fTemp17 + (fSlow57 * fRec70[0]))));
758 fRec82[0] = ((fSlow65 * fRec82[1]) + (fSlow66 * fRec81[1]));
759 double fTemp19 = (fSlow68 * fTemp18);
760 fVec28[IOTA&2047] = (fTemp19 + (fSlow67 * fRec82[0]));
761 fRec81[0] = fVec28[(IOTA-1640)&2047];
762 fRec84[0] = ((fSlow65 * fRec84[1]) + (fSlow66 * fRec83[1]));
763 fVec29[IOTA&2047] = (fTemp19 + (fSlow67 * fRec84[0]));
764 fRec83[0] = fVec29[(IOTA-1580)&2047];
765 fRec86[0] = ((fSlow65 * fRec86[1]) + (fSlow66 * fRec85[1]));
766 fVec30[IOTA&2047] = (fTemp19 + (fSlow67 * fRec86[0]));
767 fRec85[0] = fVec30[(IOTA-1514)&2047];
768 fRec88[0] = ((fSlow65 * fRec88[1]) + (fSlow66 * fRec87[1]));
769 fVec31[IOTA&2047] = (fTemp19 + (fSlow67 * fRec88[0]));
770 fRec87[0] = fVec31[(IOTA-1445)&2047];
771 fRec90[0] = ((fSlow65 * fRec90[1]) + (fSlow66 * fRec89[1]));
772 fVec32[IOTA&2047] = (fTemp19 + (fSlow67 * fRec90[0]));
773 fRec89[0] = fVec32[(IOTA-1379)&2047];
774 fRec92[0] = ((fSlow65 * fRec92[1]) + (fSlow66 * fRec91[1]));
775 fVec33[IOTA&2047] = (fTemp19 + (fSlow67 * fRec92[0]));
776 fRec91[0] = fVec33[(IOTA-1300)&2047];
777 fRec94[0] = ((fSlow65 * fRec94[1]) + (fSlow66 * fRec93[1]));
778 fVec34[IOTA&2047] = (fTemp19 + (fSlow67 * fRec94[0]));
779 fRec93[0] = fVec34[(IOTA-1211)&2047];
780 fRec96[0] = ((fSlow65 * fRec96[1]) + (fSlow66 * fRec95[1]));
781 fVec35[IOTA&2047] = (fTemp19 + (fSlow67 * fRec96[0]));
782 fRec95[0] = fVec35[(IOTA-1139)&2047];
783 double fTemp20 = (((((((fRec95[0] + fRec93[0]) + fRec91[0]) + fRec89[0]) + fRec87[0]) + fRec85[0]) + fRec83[0]) + fRec81[0]);
784 fVec36[IOTA&1023] = (fTemp20 + (0.5 * fRec79[1]));
785 fRec79[0] = fVec36[(IOTA-579)&1023];
786 double fRec80 = (0 - (fTemp20 - fRec79[1]));
787 fVec37[IOTA&511] = (fRec80 + (0.5 * fRec77[1]));
788 fRec77[0] = fVec37[(IOTA-464)&511];
789 double fRec78 = (fRec77[1] - fRec80);
790 fVec38[IOTA&511] = (fRec78 + (0.5 * fRec75[1]));
791 fRec75[0] = fVec38[(IOTA-364)&511];
792 double fRec76 = (fRec75[1] - fRec78);
793 fVec39[IOTA&255] = (fRec76 + (0.5 * fRec73[1]));
794 fRec73[0] = fVec39[(IOTA-248)&255];
795 double fRec74 = (fRec73[1] - fRec76);
796 double fTemp21 = (fRec74 + (fSlow64 * fTemp18));
797 double fRec69 = max(fConst1, fabs(fTemp21));
798 int iTemp22 = int((iRec67[1] < 4096));
799 fRec66[0] = ((iTemp22)?max(fRec66[1], fRec69):fRec69);
800 iRec67[0] = ((iTemp22)?(1 + iRec67[1]):1);
801 fRec68[0] = ((iTemp22)?fRec68[1]:fRec66[1]);
802 fbargraph2 = fRec68[0];
803 double fTemp23 = (fSlow2 * fRec101[1]);
804 double fTemp24 = (fSlow9 * fRec102[1]);
805 fRec104[0] = ((fSlow33 * fRec104[1]) + (fSlow32 * ((fSlow72 * fTemp1) + (fSlow71 * fVec1[1]))));
806 fRec103[0] = (fRec104[0] - (fSlow20 * ((fSlow18 * fRec103[2]) + (fSlow16 * fRec103[1]))));
807 fRec102[0] = ((fSlow20 * (((fSlow15 * fRec103[0]) + (fSlow73 * fRec103[1])) + (fSlow15 * fRec103[2]))) - (fSlow70 * ((fSlow69 * fRec102[2]) + fTemp24)));
808 fRec101[0] = ((fRec102[2] + (fSlow70 * (fTemp24 + (fSlow69 * fRec102[0])))) - (fSlow58 * ((fSlow57 * fRec101[2]) + fTemp23)));
809 double fTemp25 = (fRec101[2] + (fSlow58 * (fTemp23 + (fSlow57 * fRec101[0]))));
810 fRec114[0] = ((fSlow77 * fRec114[1]) + (fSlow78 * fRec113[1]));
811 double fTemp26 = (fSlow80 * fTemp25);
812 fVec40[IOTA&2047] = (fTemp26 + (fSlow79 * fRec114[0]));
813 fRec113[0] = fVec40[(IOTA-1640)&2047];
814 fRec116[0] = ((fSlow77 * fRec116[1]) + (fSlow78 * fRec115[1]));
815 fVec41[IOTA&2047] = (fTemp26 + (fSlow79 * fRec116[0]));
816 fRec115[0] = fVec41[(IOTA-1580)&2047];
817 fRec118[0] = ((fSlow77 * fRec118[1]) + (fSlow78 * fRec117[1]));
818 fVec42[IOTA&2047] = (fTemp26 + (fSlow79 * fRec118[0]));
819 fRec117[0] = fVec42[(IOTA-1514)&2047];
820 fRec120[0] = ((fSlow77 * fRec120[1]) + (fSlow78 * fRec119[1]));
821 fVec43[IOTA&2047] = (fTemp26 + (fSlow79 * fRec120[0]));
822 fRec119[0] = fVec43[(IOTA-1445)&2047];
823 fRec122[0] = ((fSlow77 * fRec122[1]) + (fSlow78 * fRec121[1]));
824 fVec44[IOTA&2047] = (fTemp26 + (fSlow79 * fRec122[0]));
825 fRec121[0] = fVec44[(IOTA-1379)&2047];
826 fRec124[0] = ((fSlow77 * fRec124[1]) + (fSlow78 * fRec123[1]));
827 fVec45[IOTA&2047] = (fTemp26 + (fSlow79 * fRec124[0]));
828 fRec123[0] = fVec45[(IOTA-1300)&2047];
829 fRec126[0] = ((fSlow77 * fRec126[1]) + (fSlow78 * fRec125[1]));
830 fVec46[IOTA&2047] = (fTemp26 + (fSlow79 * fRec126[0]));
831 fRec125[0] = fVec46[(IOTA-1211)&2047];
832 fRec128[0] = ((fSlow77 * fRec128[1]) + (fSlow78 * fRec127[1]));
833 fVec47[IOTA&2047] = (fTemp26 + (fSlow79 * fRec128[0]));
834 fRec127[0] = fVec47[(IOTA-1139)&2047];
835 double fTemp27 = (((((((fRec127[0] + fRec125[0]) + fRec123[0]) + fRec121[0]) + fRec119[0]) + fRec117[0]) + fRec115[0]) + fRec113[0]);
836 fVec48[IOTA&1023] = (fTemp27 + (0.5 * fRec111[1]));
837 fRec111[0] = fVec48[(IOTA-579)&1023];
838 double fRec112 = (0 - (fTemp27 - fRec111[1]));
839 fVec49[IOTA&511] = (fRec112 + (0.5 * fRec109[1]));
840 fRec109[0] = fVec49[(IOTA-464)&511];
841 double fRec110 = (fRec109[1] - fRec112);
842 fVec50[IOTA&511] = (fRec110 + (0.5 * fRec107[1]));
843 fRec107[0] = fVec50[(IOTA-364)&511];
844 double fRec108 = (fRec107[1] - fRec110);
845 fVec51[IOTA&255] = (fRec108 + (0.5 * fRec105[1]));
846 fRec105[0] = fVec51[(IOTA-248)&255];
847 double fRec106 = (fRec105[1] - fRec108);
848 double fTemp28 = (fRec106 + (fSlow76 * fTemp25));
849 double fRec100 = max(fConst1, fabs(fTemp28));
850 int iTemp29 = int((iRec98[1] < 4096));
851 fRec97[0] = ((iTemp29)?max(fRec97[1], fRec100):fRec100);
852 iRec98[0] = ((iTemp29)?(1 + iRec98[1]):1);
853 fRec99[0] = ((iTemp29)?fRec99[1]:fRec97[1]);
854 fbargraph3 = fRec99[0];
855 double fTemp30 = (fSlow2 * fRec133[1]);
856 double fTemp31 = (fSlow9 * fRec134[1]);
857 double fTemp32 = (fSlow16 * fRec135[1]);
858 fRec137[0] = ((fSlow30 * fRec137[1]) + (fSlow29 * ((fSlow24 * fVec0[0]) + (fSlow83 * fVec0[1]))));
859 fRec136[0] = (fRec137[0] - (fSlow27 * ((fSlow25 * fRec136[2]) + (fSlow23 * fRec136[1]))));
860 fRec135[0] = ((fSlow27 * (((fSlow22 * fRec136[0]) + (fSlow84 * fRec136[1])) + (fSlow22 * fRec136[2]))) - (fSlow82 * ((fSlow81 * fRec135[2]) + fTemp32)));
861 fRec134[0] = ((fRec135[2] + (fSlow82 * (fTemp32 + (fSlow81 * fRec135[0])))) - (fSlow70 * ((fSlow69 * fRec134[2]) + fTemp31)));
862 fRec133[0] = ((fRec134[2] + (fSlow70 * (fTemp31 + (fSlow69 * fRec134[0])))) - (fSlow58 * ((fSlow57 * fRec133[2]) + fTemp30)));
863 double fTemp33 = (fRec133[2] + (fSlow58 * (fTemp30 + (fSlow57 * fRec133[0]))));
864 fRec147[0] = ((fSlow88 * fRec147[1]) + (fSlow89 * fRec146[1]));
865 double fTemp34 = (fSlow91 * fTemp33);
866 fVec52[IOTA&2047] = (fTemp34 + (fSlow90 * fRec147[0]));
867 fRec146[0] = fVec52[(IOTA-1640)&2047];
868 fRec149[0] = ((fSlow88 * fRec149[1]) + (fSlow89 * fRec148[1]));
869 fVec53[IOTA&2047] = (fTemp34 + (fSlow90 * fRec149[0]));
870 fRec148[0] = fVec53[(IOTA-1580)&2047];
871 fRec151[0] = ((fSlow88 * fRec151[1]) + (fSlow89 * fRec150[1]));
872 fVec54[IOTA&2047] = (fTemp34 + (fSlow90 * fRec151[0]));
873 fRec150[0] = fVec54[(IOTA-1514)&2047];
874 fRec153[0] = ((fSlow88 * fRec153[1]) + (fSlow89 * fRec152[1]));
875 fVec55[IOTA&2047] = (fTemp34 + (fSlow90 * fRec153[0]));
876 fRec152[0] = fVec55[(IOTA-1445)&2047];
877 fRec155[0] = ((fSlow88 * fRec155[1]) + (fSlow89 * fRec154[1]));
878 fVec56[IOTA&2047] = (fTemp34 + (fSlow90 * fRec155[0]));
879 fRec154[0] = fVec56[(IOTA-1379)&2047];
880 fRec157[0] = ((fSlow88 * fRec157[1]) + (fSlow89 * fRec156[1]));
881 fVec57[IOTA&2047] = (fTemp34 + (fSlow90 * fRec157[0]));
882 fRec156[0] = fVec57[(IOTA-1300)&2047];
883 fRec159[0] = ((fSlow88 * fRec159[1]) + (fSlow89 * fRec158[1]));
884 fVec58[IOTA&2047] = (fTemp34 + (fSlow90 * fRec159[0]));
885 fRec158[0] = fVec58[(IOTA-1211)&2047];
886 fRec161[0] = ((fSlow88 * fRec161[1]) + (fSlow89 * fRec160[1]));
887 fVec59[IOTA&2047] = (fTemp34 + (fSlow90 * fRec161[0]));
888 fRec160[0] = fVec59[(IOTA-1139)&2047];
889 double fTemp35 = (((((((fRec160[0] + fRec158[0]) + fRec156[0]) + fRec154[0]) + fRec152[0]) + fRec150[0]) + fRec148[0]) + fRec146[0]);
890 fVec60[IOTA&1023] = (fTemp35 + (0.5 * fRec144[1]));
891 fRec144[0] = fVec60[(IOTA-579)&1023];
892 double fRec145 = (0 - (fTemp35 - fRec144[1]));
893 fVec61[IOTA&511] = (fRec145 + (0.5 * fRec142[1]));
894 fRec142[0] = fVec61[(IOTA-464)&511];
895 double fRec143 = (fRec142[1] - fRec145);
896 fVec62[IOTA&511] = (fRec143 + (0.5 * fRec140[1]));
897 fRec140[0] = fVec62[(IOTA-364)&511];
898 double fRec141 = (fRec140[1] - fRec143);
899 fVec63[IOTA&255] = (fRec141 + (0.5 * fRec138[1]));
900 fRec138[0] = fVec63[(IOTA-248)&255];
901 double fRec139 = (fRec138[1] - fRec141);
902 double fTemp36 = (fRec139 + (fSlow87 * fTemp33));
903 double fRec132 = max(fConst1, fabs(fTemp36));
904 int iTemp37 = int((iRec130[1] < 4096));
905 fRec129[0] = ((iTemp37)?max(fRec129[1], fRec132):fRec132);
906 iRec130[0] = ((iTemp37)?(1 + iRec130[1]):1);
907 fRec131[0] = ((iTemp37)?fRec131[1]:fRec129[1]);
908 fbargraph4 = fRec131[0];
909 output0[i] = (FAUSTFLOAT)((((fTemp36 + fTemp28) + fTemp21) + fTemp15) + fTemp10);
910 // post processing
911 fRec131[1] = fRec131[0];
912 iRec130[1] = iRec130[0];
913 fRec129[1] = fRec129[0];
914 fRec138[1] = fRec138[0];
915 fRec140[1] = fRec140[0];
916 fRec142[1] = fRec142[0];
917 fRec144[1] = fRec144[0];
918 fRec160[1] = fRec160[0];
919 fRec161[1] = fRec161[0];
920 fRec158[1] = fRec158[0];
921 fRec159[1] = fRec159[0];
922 fRec156[1] = fRec156[0];
923 fRec157[1] = fRec157[0];
924 fRec154[1] = fRec154[0];
925 fRec155[1] = fRec155[0];
926 fRec152[1] = fRec152[0];
927 fRec153[1] = fRec153[0];
928 fRec150[1] = fRec150[0];
929 fRec151[1] = fRec151[0];
930 fRec148[1] = fRec148[0];
931 fRec149[1] = fRec149[0];
932 fRec146[1] = fRec146[0];
933 fRec147[1] = fRec147[0];
934 fRec133[2] = fRec133[1]; fRec133[1] = fRec133[0];
935 fRec134[2] = fRec134[1]; fRec134[1] = fRec134[0];
936 fRec135[2] = fRec135[1]; fRec135[1] = fRec135[0];
937 fRec136[2] = fRec136[1]; fRec136[1] = fRec136[0];
938 fRec137[1] = fRec137[0];
939 fRec99[1] = fRec99[0];
940 iRec98[1] = iRec98[0];
941 fRec97[1] = fRec97[0];
942 fRec105[1] = fRec105[0];
943 fRec107[1] = fRec107[0];
944 fRec109[1] = fRec109[0];
945 fRec111[1] = fRec111[0];
946 fRec127[1] = fRec127[0];
947 fRec128[1] = fRec128[0];
948 fRec125[1] = fRec125[0];
949 fRec126[1] = fRec126[0];
950 fRec123[1] = fRec123[0];
951 fRec124[1] = fRec124[0];
952 fRec121[1] = fRec121[0];
953 fRec122[1] = fRec122[0];
954 fRec119[1] = fRec119[0];
955 fRec120[1] = fRec120[0];
956 fRec117[1] = fRec117[0];
957 fRec118[1] = fRec118[0];
958 fRec115[1] = fRec115[0];
959 fRec116[1] = fRec116[0];
960 fRec113[1] = fRec113[0];
961 fRec114[1] = fRec114[0];
962 fRec101[2] = fRec101[1]; fRec101[1] = fRec101[0];
963 fRec102[2] = fRec102[1]; fRec102[1] = fRec102[0];
964 fRec103[2] = fRec103[1]; fRec103[1] = fRec103[0];
965 fRec104[1] = fRec104[0];
966 fRec68[1] = fRec68[0];
967 iRec67[1] = iRec67[0];
968 fRec66[1] = fRec66[0];
969 fRec73[1] = fRec73[0];
970 fRec75[1] = fRec75[0];
971 fRec77[1] = fRec77[0];
972 fRec79[1] = fRec79[0];
973 fRec95[1] = fRec95[0];
974 fRec96[1] = fRec96[0];
975 fRec93[1] = fRec93[0];
976 fRec94[1] = fRec94[0];
977 fRec91[1] = fRec91[0];
978 fRec92[1] = fRec92[0];
979 fRec89[1] = fRec89[0];
980 fRec90[1] = fRec90[0];
981 fRec87[1] = fRec87[0];
982 fRec88[1] = fRec88[0];
983 fRec85[1] = fRec85[0];
984 fRec86[1] = fRec86[0];
985 fRec83[1] = fRec83[0];
986 fRec84[1] = fRec84[0];
987 fRec81[1] = fRec81[0];
988 fRec82[1] = fRec82[0];
989 fRec70[2] = fRec70[1]; fRec70[1] = fRec70[0];
990 fRec71[2] = fRec71[1]; fRec71[1] = fRec71[0];
991 fRec72[1] = fRec72[0];
992 fRec38[1] = fRec38[0];
993 iRec37[1] = iRec37[0];
994 fRec36[1] = fRec36[0];
995 fRec42[1] = fRec42[0];
996 fRec44[1] = fRec44[0];
997 fRec46[1] = fRec46[0];
998 fRec48[1] = fRec48[0];
999 fRec64[1] = fRec64[0];
1000 fRec65[1] = fRec65[0];
1001 fRec62[1] = fRec62[0];
1002 fRec63[1] = fRec63[0];
1003 fRec60[1] = fRec60[0];
1004 fRec61[1] = fRec61[0];
1005 fRec58[1] = fRec58[0];
1006 fRec59[1] = fRec59[0];
1007 fRec56[1] = fRec56[0];
1008 fRec57[1] = fRec57[0];
1009 fRec54[1] = fRec54[0];
1010 fRec55[1] = fRec55[0];
1011 fRec52[1] = fRec52[0];
1012 fRec53[1] = fRec53[0];
1013 fRec50[1] = fRec50[0];
1014 fRec51[1] = fRec51[0];
1015 fRec40[2] = fRec40[1]; fRec40[1] = fRec40[0];
1016 fRec41[1] = fRec41[0];
1017 fRec2[1] = fRec2[0];
1018 iRec1[1] = iRec1[0];
1019 fRec0[1] = fRec0[0];
1020 fRec12[1] = fRec12[0];
1021 fRec14[1] = fRec14[0];
1022 fRec16[1] = fRec16[0];
1023 fRec18[1] = fRec18[0];
1024 fRec34[1] = fRec34[0];
1025 fRec35[1] = fRec35[0];
1026 fRec32[1] = fRec32[0];
1027 fRec33[1] = fRec33[0];
1028 fRec30[1] = fRec30[0];
1029 fRec31[1] = fRec31[0];
1030 fRec28[1] = fRec28[0];
1031 fRec29[1] = fRec29[0];
1032 fRec26[1] = fRec26[0];
1033 fRec27[1] = fRec27[0];
1034 fRec24[1] = fRec24[0];
1035 fRec25[1] = fRec25[0];
1036 fRec22[1] = fRec22[0];
1037 fRec23[1] = fRec23[0];
1038 fRec20[1] = fRec20[0];
1039 IOTA = IOTA+1;
1040 fRec21[1] = fRec21[0];
1041 fRec4[2] = fRec4[1]; fRec4[1] = fRec4[0];
1042 fRec5[1] = fRec5[0];
1043 fVec3[1] = fVec3[0];
1044 fRec6[2] = fRec6[1]; fRec6[1] = fRec6[0];
1045 fRec7[1] = fRec7[0];
1046 fVec2[1] = fVec2[0];
1047 fRec8[2] = fRec8[1]; fRec8[1] = fRec8[0];
1048 fRec9[1] = fRec9[0];
1049 fVec1[1] = fVec1[0];
1050 fRec10[2] = fRec10[1]; fRec10[1] = fRec10[0];
1051 fRec11[1] = fRec11[0];
1052 fVec0[1] = fVec0[0];
1053 }
1054 #undef fslider0
1055 #undef fslider1
1056 #undef fslider2
1057 #undef fslider3
1058 #undef fslider4
1059 #undef fslider5
1060 #undef fslider6
1061 #undef fbargraph0
1062 #undef fslider7
1063 #undef fslider8
1064 #undef fslider9
1065 #undef fbargraph1
1066 #undef fslider10
1067 #undef fslider11
1068 #undef fslider12
1069 #undef fbargraph2
1070 #undef fslider13
1071 #undef fslider14
1072 #undef fslider15
1073 #undef fbargraph3
1074 #undef fslider16
1075 #undef fslider17
1076 #undef fslider18
1077 #undef fbargraph4
1078 }
1079
1080 void __rt_func Dsp::compute_static(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0, PluginLV2 *p)
1081 {
1082 static_cast<Dsp*>(p)->compute(count, input0, output0);
1083 }
1084
1085
1086 void Dsp::connect(uint32_t port,void* data)
1087 {
1088 switch ((PortIndex)port)
1089 {
1090 case ROOMSIZE1:
1091 fslider6_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1092 break;
1093 case ROOMSIZE2:
1094 fslider9_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1095 break;
1096 case ROOMSIZE3:
1097 fslider12_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1098 break;
1099 case ROOMSIZE4:
1100 fslider15_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1101 break;
1102 case ROOMSIZE5:
1103 fslider18_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1104 break;
1105 case CROSSOVER_B1_B2:
1106 fslider0_ = (float*)data; // , 8e+01, 2e+01, 2e+04, 1.08
1107 break;
1108 case CROSSOVER_B2_B3:
1109 fslider1_ = (float*)data; // , 2.1e+02, 2e+01, 2e+04, 1.08
1110 break;
1111 case CROSSOVER_B3_B4:
1112 fslider2_ = (float*)data; // , 1.7e+03, 2e+01, 2e+04, 1.08
1113 break;
1114 case CROSSOVER_B4_B5:
1115 fslider3_ = (float*)data; // , 5e+03, 2e+01, 2e+04, 1.08
1116 break;
1117 case DAMP1:
1118 fslider5_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1119 break;
1120 case DAMP2:
1121 fslider8_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1122 break;
1123 case DAMP3:
1124 fslider11_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1125 break;
1126 case DAMP4:
1127 fslider14_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1128 break;
1129 case DAMP5:
1130 fslider17_ = (float*)data; // , 0.5, 0.0, 1.0, 0.025
1131 break;
1132 case V1:
1133 fbargraph0_ = (float*)data; // , -70.0, -70.0, 4.0, 0.00001
1134 break;
1135 case V2:
1136 fbargraph1_ = (float*)data; // , -70.0, -70.0, 4.0, 0.00001
1137 break;
1138 case V3:
1139 fbargraph2_ = (float*)data; // , -70.0, -70.0, 4.0, 0.00001
1140 break;
1141 case V4:
1142 fbargraph3_ = (float*)data; // , -70.0, -70.0, 4.0, 0.00001
1143 break;
1144 case V5:
1145 fbargraph4_ = (float*)data; // , -70.0, -70.0, 4.0, 0.00001
1146 break;
1147 case WET_DRY1:
1148 fslider4_ = (float*)data; // , 5e+01, 0.0, 1e+02, 1.0
1149 break;
1150 case WET_DRY2:
1151 fslider7_ = (float*)data; // , 5e+01, 0.0, 1e+02, 1.0
1152 break;
1153 case WET_DRY3:
1154 fslider10_ = (float*)data; // , 5e+01, 0.0, 1e+02, 1.0
1155 break;
1156 case WET_DRY4:
1157 fslider13_ = (float*)data; // , 5e+01, 0.0, 1e+02, 1.0
1158 break;
1159 case WET_DRY5:
1160 fslider16_ = (float*)data; // , 5e+01, 0.0, 1e+02, 1.0
1161 break;
1162 default:
1163 break;
1164 }
1165 }
1166
1167 void Dsp::connect_static(uint32_t port,void* data, PluginLV2 *p)
1168 {
1169 static_cast<Dsp*>(p)->connect(port, data);
1170 }
1171
1172
1173 PluginLV2 *plugin() {
1174 return new Dsp();
1175 }
1176
1177 void Dsp::del_instance(PluginLV2 *p)
1178 {
1179 delete static_cast<Dsp*>(p);
1180 }
1181
1182 /*
1183 typedef enum
1184 {
1185 ROOMSIZE1,
1186 ROOMSIZE2,
1187 ROOMSIZE3,
1188 ROOMSIZE4,
1189 ROOMSIZE5,
1190 CROSSOVER_B1_B2,
1191 CROSSOVER_B2_B3,
1192 CROSSOVER_B3_B4,
1193 CROSSOVER_B4_B5,
1194 DAMP1,
1195 DAMP2,
1196 DAMP3,
1197 DAMP4,
1198 DAMP5,
1199 V1,
1200 V2,
1201 V3,
1202 V4,
1203 V5,
1204 WET_DRY1,
1205 WET_DRY2,
1206 WET_DRY3,
1207 WET_DRY4,
1208 WET_DRY5,
1209 } PortIndex;
1210 */
1211
1212 } // end namespace mbreverb
0 /*
1 * Copyright (C) 2012 Hermann Meyer, Andreas Degert, Pete Shorthose, Steve Poskitt
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 * --------------------------------------------------------------------------
17 */
18
19
20 #include "widget.h"
21
22 #include <iostream>
23 #include <iomanip>
24
25 #define max(x, y) (((x) > (y)) ? (x) : (y))
26
27 /* @get controller by port
28 * this function is used by make_selector() make_controller_box()
29 * set_value() and on_value_changed()
30 * so controller widgets needs only here asined to a port,
31 * and all functions which need acess to the controller widget pointer
32 * can receive them by port number
33 */
34
35 Gtk::Widget* Widget::get_controller_by_port(uint32_t port_index)
36 {
37 switch ((PortIndex)port_index )
38 {
39 case ROOMSIZE1:
40 return &m_smallknob[1];
41 case ROOMSIZE2:
42 return &m_smallknob[2];
43 case ROOMSIZE3:
44 return &m_smallknob[3];
45 case ROOMSIZE4:
46 return &m_smallknob[4];
47 case ROOMSIZE5:
48 return &m_smallknob[5];
49 case DAMP1:
50 return &m_smallknob[6];
51 case DAMP2:
52 return &m_smallknob[7];
53 case DAMP3:
54 return &m_smallknob[8];
55 case DAMP4:
56 return &m_smallknob[9];
57 case DAMP5:
58 return &m_smallknob[10];
59 case CROSSOVER_B1_B2:
60 return &m_smallknob[11];
61 case CROSSOVER_B2_B3:
62 return &m_smallknob[12];
63 case CROSSOVER_B3_B4:
64 return &m_smallknob[13];
65 case CROSSOVER_B4_B5:
66 return &m_smallknob[14];
67 case WET_DRY1:
68 return &m_smallknob[15];
69 case WET_DRY2:
70 return &m_smallknob[16];
71 case WET_DRY3:
72 return &m_smallknob[17];
73 case WET_DRY4:
74 return &m_smallknob[18];
75 case WET_DRY5:
76 return &m_smallknob[19];
77 default:
78 return NULL;
79 }
80 }
81
82 Widget::Widget(Glib::ustring plugname):
83 plug_name(plugname)
84 {
85 m_fr[0].set_label("BAND 1");
86 m_fr[0].add(m_lbox[0]);
87 m_fr[1].set_label("BAND 2");
88 m_fr[1].add(m_lbox[1]);
89 m_fr[2].set_label("BAND 3");
90 m_fr[2].add(m_lbox[2]);
91 m_fr[3].set_label("BAND 4");
92 m_fr[3].add(m_lbox[3]);
93 m_fr[4].set_label("BAND 5");
94 m_fr[4].add(m_lbox[4]);
95 // m_fr[5].set_label("OUT");
96 m_fr[6].set_label("BAND PASS");
97 // create controllers for port name
98 make_controller_box(&m_vbox[1], "ROOMSIZE", 0.0, 1.0, 0.025 , ROOMSIZE1, false);
99 make_controller_box(&m_vbox[2], "ROOMSIZE", 0.0, 1.0, 0.025 , ROOMSIZE2, false);
100 make_controller_box(&m_vbox[3], "ROOMSIZE", 0.0, 1.0, 0.025 , ROOMSIZE3, false);
101 make_controller_box(&m_vbox[4], "ROOMSIZE", 0.0, 1.0, 0.025 , ROOMSIZE4, false);
102 make_controller_box(&m_vbox[5], "ROOMSIZE", 0.0, 1.0, 0.025 , ROOMSIZE5, false);
103
104 make_controller_box(&m_vbox[1], "DAMP", 0.0, 1.0, 0.025 , DAMP1, false);
105 make_controller_box(&m_vbox[2], "DAMP", 0.0, 1.0, 0.025 , DAMP2, false);
106 make_controller_box(&m_vbox[3], "DAMP", 0.0, 1.0, 0.025 , DAMP3, false);
107 make_controller_box(&m_vbox[4], "DAMP", 0.0, 1.0, 0.025 , DAMP4, false);
108 make_controller_box(&m_vbox[5], "DAMP", 0.0, 1.0, 0.025 , DAMP5, false);
109
110 make_controller_box(&m_vbox[1], "DRY/WET", 0.0, 1e+02, 1.0 , WET_DRY1, false);
111 make_controller_box(&m_vbox[2], "DRY/WET", 0.0, 1e+02, 1.0 , WET_DRY2, false);
112 make_controller_box(&m_vbox[3], "DRY/WET", 0.0, 1e+02, 1.0 , WET_DRY3, false);
113 make_controller_box(&m_vbox[4], "DRY/WET", 0.0, 1e+02, 1.0 , WET_DRY4, false);
114 make_controller_box(&m_vbox[5], "DRY/WET", 0.0, 1e+02, 1.0 , WET_DRY5, false);
115
116 make_log_controller_box(&m_vbox[7], "LOW PASS \n B1><B2",
117 2e+01, 2e+04, 1.08 , CROSSOVER_B1_B2, true);
118 make_log_controller_box(&m_vbox[8], "CROSSOVER \n B2><B3",
119 2e+01, 2e+04, 1.08 , CROSSOVER_B2_B3, true);
120 make_log_controller_box(&m_vbox[9], "CROSSOVER \n B3><B4 ",
121 2e+01, 2e+04, 1.08 , CROSSOVER_B3_B4, true);
122 make_log_controller_box(&m_vbox[10], "HIGH PASS \n B4><B5",
123 2e+01, 2e+04, 1.08 , CROSSOVER_B4_B5, true);
124
125 // set propertys for the main paintbox holding the skin
126 m_paintbox[0].set_border_width(10);
127 m_paintbox[0].set_spacing(6);
128 m_paintbox[0].set_homogeneous(false);
129 m_paintbox[0].set_name(plug_name);
130 m_paintbox[0].property_paint_func() = "gxhead_expose";
131 add(m_paintbox[0]);
132
133 for (uint32_t i = 0;i<5;i++) {
134 fastmeter[i].set_hold_count(12);
135 fastmeter[i].set_property("dimen",5);
136 m_paintbox[i+1].property_paint_func() = "RackBox_expose";
137 m_paintbox[i+1].set_name(plug_name);
138 m_paintbox[i+1].set_border_width(5);
139 m_paintbox[i+1].pack_start(fastmeter[i]);
140 }
141
142 // set a vertical box in the paintbox
143 m_vbox[11].set_border_width(14);
144 m_vbox[12].set_border_width(14);
145 m_hbox[2].set_border_width(4);
146 m_paintbox[0].pack_start(m_vbox[0]);
147 // box for the controllers
148 m_hbox[0].set_spacing(4);
149 m_hbox[0].set_border_width(4);
150 m_hbox[0].set_homogeneous(false);
151 m_vbox[0].pack_start(m_hbox[0]);
152 m_fr[6].add(m_hbox[1]);
153 m_vbox[0].pack_start(m_fr[6]);
154 m_vbox[0].pack_start(m_hbox[2]);
155 // put boxed controllers into controller box
156 m_hbox[0].pack_start(m_vbox[11], Gtk::PACK_EXPAND_PADDING);
157 m_hbox[0].pack_start(m_fr[0]);
158 m_lbox[0].pack_start(m_vbox[1]);
159 m_lbox[0].pack_start(m_paintbox[1],Gtk::PACK_SHRINK);
160 m_hbox[0].pack_start(m_fr[1]);
161 m_lbox[1].pack_start(m_vbox[2]);
162 m_lbox[1].pack_start(m_paintbox[2],Gtk::PACK_SHRINK);
163 m_hbox[0].pack_start(m_fr[2]);
164 m_lbox[2].pack_start(m_vbox[3]);
165 m_lbox[2].pack_start(m_paintbox[3],Gtk::PACK_SHRINK);
166 m_hbox[0].pack_start(m_fr[3]);
167 m_lbox[3].pack_start(m_vbox[4]);
168 m_lbox[3].pack_start(m_paintbox[4],Gtk::PACK_SHRINK);
169 m_hbox[0].pack_start(m_fr[4]);
170 m_lbox[4].pack_start(m_vbox[5]);
171 m_lbox[4].pack_start(m_paintbox[5],Gtk::PACK_SHRINK);
172 // m_hbox[0].pack_start(m_fr[5]);
173 // m_fr[5].add(m_vbox[6]);
174 m_hbox[0].pack_start(m_vbox[12], Gtk::PACK_EXPAND_PADDING);
175 // put boxed controllers into controller box
176 m_hbox[1].pack_start(m_vbox[13], Gtk::PACK_EXPAND_PADDING);
177 m_hbox[1].pack_start(m_vbox[7]);
178 m_hbox[1].pack_start(m_vbox[8]);
179 m_hbox[1].pack_start(m_vbox[9]);
180 m_hbox[1].pack_start(m_vbox[10]);
181 m_hbox[1].pack_start(m_vbox[14], Gtk::PACK_EXPAND_PADDING);
182
183 set_app_paintable(true);
184 show_all();
185 }
186
187 Widget::~Widget()
188 {
189
190 }
191
192 // create selectors from gxwmm
193 void Widget::make_selector(Glib::ustring labela,
194 Glib::ustring tables[],
195 size_t _size,
196 float min, float digits,
197 PortIndex port_name)
198 {
199 Gxw::Selector *regler = static_cast<Gxw::Selector*>
200 (get_controller_by_port(port_name));
201 if (regler)
202 {
203 float max = static_cast<float>(_size+1);
204
205 Gtk::TreeModelColumn<Glib::ustring> label;
206 Gtk::TreeModelColumnRecord rec;
207 rec.add(label);
208 Glib::RefPtr<Gtk::ListStore> ls = Gtk::ListStore::create(rec);
209
210 for (uint32_t i = 0 ; i< _size; ++i) {
211 ls->append()->set_value(0, tables[i]);
212 }
213 regler->set_model(ls);
214 regler->set_has_tooltip();
215 regler->set_tooltip_text(labela);
216 regler->cp_configure("SELECTOR", labela, min, max, digits);
217 regler->cp_set_var("no_log");
218 regler->set_show_value(false);
219 regler->set_name(plug_name);
220 regler->signal_value_changed().connect(sigc::bind(sigc::mem_fun(
221 *this, &Widget::on_value_changed), port_name));
222 }
223 }
224
225 // create stackboxes with controllers for port name
226 void Widget::make_controller_box(Gtk::Box *box,
227 Glib::ustring label,
228 float min, float max,
229 float digits,
230 PortIndex port_name,
231 bool show_value)
232 {
233 Gxw::Regler *regler = static_cast<Gxw::Regler*>(
234 get_controller_by_port(port_name));
235 if (regler)
236 {
237 Gtk::Label* pr = new Gtk::Label(label, 0);
238 pr->set_name("amplabel");
239 // use label images instead simple string labes
240 /*Glib::ustring label_image = GX_LV2_STYLE_DIR;
241 label_image += "/";
242 label_image += label;
243 label_image += "-label.png";
244 Gtk::Image *pr = new Gtk::Image(label_image);*/
245
246 Gtk::VBox* b1 = new Gtk::VBox();
247 box->pack_start( *Gtk::manage(b1), Gtk::PACK_EXPAND_PADDING);
248 box->pack_start( *Gtk::manage(pr),Gtk::PACK_SHRINK);
249 regler->cp_configure("KNOB", label, min, max, digits);
250 regler->cp_set_var("no_log");
251 regler->set_show_value(show_value);
252 regler->set_name(plug_name);
253 box->pack_start(*regler,Gtk::PACK_SHRINK);
254 Gtk::VBox* b2 = new Gtk::VBox();
255 box->pack_start( *Gtk::manage(b2), Gtk::PACK_EXPAND_PADDING);
256 regler->signal_value_changed().connect(sigc::bind(sigc::mem_fun(
257 *this, &Widget::on_value_changed), port_name));
258 }
259 }
260
261 Glib::ustring logarithmic_format_value(double v, int prec) {
262 if (v < -4) {
263 return Glib::ustring::format(std::setprecision(prec+1), pow(10.0,v));
264 } else {
265 return Glib::ustring::format(std::fixed, std::setprecision(prec-floor(v)), pow(10.0,v));
266 }
267 }
268
269 int logarithmic_input_value(gpointer obj, gpointer nv)
270 {
271 GtkEntry *entry = GTK_ENTRY(obj);
272 double *new_val = static_cast<double*>(nv);
273 gchar *err = NULL;
274 *new_val = g_strtod(gtk_entry_get_text(entry), &err);
275 if (*err)
276 return GTK_INPUT_ERROR;
277 else {
278 *new_val = log10(*new_val);
279 return TRUE;
280 }
281 }
282
283 // create stackboxes with controllers for port name
284 void Widget::make_log_controller_box(Gtk::Box *box,
285 Glib::ustring label,
286 float min, float max,
287 float digits,
288 PortIndex port_name,
289 bool show_value)
290 {
291 Gxw::Regler *regler = static_cast<Gxw::Regler*>(
292 get_controller_by_port(port_name));
293 if (regler)
294 {
295 Gtk::Label* pr = new Gtk::Label(label, 0);
296 pr->set_name("amplabel");
297
298 Gtk::VBox* b1 = new Gtk::VBox();
299 box->pack_start( *Gtk::manage(b1), Gtk::PACK_EXPAND_PADDING);
300 box->pack_start( *Gtk::manage(pr),Gtk::PACK_SHRINK);
301
302 double up = log10(max);
303 double step = log10(digits);
304 regler->cp_configure("", label, log10(min), up, step);
305 int prec = 0;
306 float d = log10((digits-1)*max);
307 if (up > 0) {
308 prec = up;
309 if (d < 0) {
310 prec -= floor(d);
311 }
312 } else if (d < 0) {
313 prec = -floor(d);
314 }
315 regler->signal_format_value().connect(
316 sigc::bind(
317 sigc::ptr_fun(logarithmic_format_value),
318 prec));
319 regler->signal_input_value().connect(
320 sigc::ptr_fun(logarithmic_input_value));
321
322 regler->set_show_value(show_value);
323 regler->set_name(plug_name);
324 box->pack_start(*regler,Gtk::PACK_SHRINK);
325 Gtk::VBox* b2 = new Gtk::VBox();
326 box->pack_start( *Gtk::manage(b2), Gtk::PACK_EXPAND_PADDING);
327 regler->signal_value_changed().connect(sigc::bind(sigc::mem_fun(
328 *this, &Widget::on_value_changed), port_name));
329 }
330 }
331
332 // create stackboxes with switch controller for port name
333 void Widget::make_switch_box(Gtk::Box *box,
334 Glib::ustring label,
335 PortIndex port_name)
336 {
337 Gxw::Switch *regler = static_cast<Gxw::Switch*>(
338 get_controller_by_port(port_name));
339 if (regler)
340 {
341 Gtk::Label* pr = new Gtk::Label(label, 0);
342 pr->set_name("amplabel");
343 // use label images instead simple string labes
344 /*Glib::ustring label_image = GX_LV2_STYLE_DIR;
345 label_image += "/"+plug_name+"-";
346 label_image += label;
347 label_image += "-label.png";
348 Gtk::Image *pr = new Gtk::Image(label_image);*/
349
350 regler->cp_configure("switch", label, 0, 1, 1);
351 regler->cp_set_var("no_log");
352 regler->set_name(plug_name);
353 regler->set_base_name( "button" );
354 Gtk::VBox* b1 = new Gtk::VBox();
355 box->pack_start( *Gtk::manage(b1), Gtk::PACK_EXPAND_PADDING);
356 box->pack_start( *Gtk::manage(pr),Gtk::PACK_SHRINK);
357 box->pack_start(*regler,Gtk::PACK_SHRINK);
358 Gtk::VBox* b2 = new Gtk::VBox();
359 box->pack_start( *Gtk::manage(b2), Gtk::PACK_EXPAND_PADDING);
360 regler->signal_toggled().connect(sigc::bind(sigc::mem_fun(
361 *this, &Widget::on_value_changed), port_name));
362 }
363 }
364
365 // receive controller value changes from host and set them to controller
366 void Widget::set_value(uint32_t port_index,
367 uint32_t format,
368 const void * buffer)
369 {
370 if ( format == 0 )
371 {
372 Gxw::Regler *regler = static_cast<Gxw::Regler*>(
373 get_controller_by_port(port_index));
374 float value = *static_cast<const float*>(buffer);
375 if (regler) {
376 Glib::ustring v = regler->cp_get_var();
377 if (v.empty()) {
378 regler->cp_set_value(log10(value));
379 } else {
380 regler->cp_set_value(value);
381 }
382 }
383 if (port_index == V1) refresh_meter_level(0,value);
384 else if (port_index == V2) refresh_meter_level(1,value);
385 else if (port_index == V3) refresh_meter_level(2,value);
386 else if (port_index == V4) refresh_meter_level(3,value);
387 else if (port_index == V5) refresh_meter_level(4,value);
388 }
389 }
390
391 // write (UI) controller value changes to the host->engine
392 void Widget::on_value_changed(uint32_t port_index)
393 {
394 Gxw::Regler *regler = static_cast<Gxw::Regler*>(
395 get_controller_by_port(port_index));
396 if (regler)
397 {
398 float value = regler->cp_get_value();
399 Glib::ustring v = regler->cp_get_var();
400 if (v.empty()) {
401 //fprintf(stderr,"value set %f\n get %f\n",value,pow(10.0,value));
402 value = pow(10.0,value);
403 write_function(controller, port_index, sizeof(float), 0,
404 static_cast<const void*>(&value));
405 } else {
406 write_function(controller, port_index, sizeof(float), 0,
407 static_cast<const void*>(&value));
408 }
409 }
410 }
411
412 void Widget::refresh_meter_level(int m, float new_level) {
413 fastmeter[m].set_by_power(new_level);
414 }
0 /*
1 * Copyright (C) 2012 Hermann Meyer, Andreas Degert, Pete Shorthose, Steve Poskitt
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 * --------------------------------------------------------------------------
17 */
18
19 #pragma once
20
21 #ifndef SRC_HEADERS_WIDGET_H_
22 #define SRC_HEADERS_WIDGET_H_
23
24 #include <gtkmm.h>
25 #include <gxwmm.h>
26 #include "gx_mbreverb.h"
27 #include "../config.h" // for GX_STYLE_DIR
28 // LV2UI stuff
29 #include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
30
31
32 class Widget : public Gtk::HBox
33 {
34 private:
35 Gtk::Widget* get_controller_by_port(uint32_t port_index);
36
37 void refresh_meter_level(int meter,float new_level);
38
39 void on_value_changed(uint32_t port_index);
40
41 void make_controller_box(Gtk::Box *box,
42 Glib::ustring label,
43 float min, float max,
44 float digits,
45 PortIndex port_name,
46 bool show_value);
47
48 void make_log_controller_box(Gtk::Box *box,
49 Glib::ustring label,
50 float min, float max,
51 float digits,
52 PortIndex port_name,
53 bool show_value);
54
55 void make_selector(Glib::ustring label,
56 Glib::ustring tables[],
57 size_t _size,
58 float min, float digits,
59 PortIndex port_name);
60
61 void make_switch_box(Gtk::Box *box,
62 Glib::ustring label,
63 PortIndex port_name);
64
65 void set_value(uint32_t port_index,
66 uint32_t format,
67 const void * buffer);
68 public:
69
70 // public Lv2 communication stuff
71 LV2UI_Controller controller;
72 LV2UI_Write_Function write_function;
73 static void set_value_static(uint32_t port_index,
74 uint32_t buffer_size,
75 uint32_t format,
76 const void * buffer, Widget *self)
77 {
78 self->set_value(port_index,format,buffer);
79 }
80
81 Widget(Glib::ustring plugname);
82 ~Widget();
83
84 protected:
85 Glib::ustring plug_name;
86 Gtk::VBox m_vbox[15];
87 Gtk::HBox m_hbox[3];
88 Gtk::HBox m_lbox[5];
89 Gtk::Frame m_fr[7];
90
91 Gxw::SmallKnob m_smallknob[20];
92 Gxw::FastMeter fastmeter[5];
93 Gxw::PaintBox m_paintbox[6];
94 };
95
96 #endif //SRC_HEADERS_WIDGET_H_
0 #!/usr/bin/env python
1 # encoding: utf-8
2
3 import sys, os, TaskGen, ctypes, wscript_helper
4
5 def configure(conf):
6 pass
7
8 def build(bld):
9 bundle = 'gx_mbreverb.lv2'
10
11 src = ['gx_mbreverb.cpp'
12 ]
13 incl = ['../faust','./', '../DSP']
14 lib = []
15 if sys.platform.startswith("linux"):
16 lib.append('dl')
17 uselib = ['LV2CORE']
18 cxxflag =[]
19 if not bld.env['OPT'] and bld.env['SSE2']:
20 cxxflag = [ "-msse2", "-mfpmath=sse"]
21 lv2_effects = bld(
22 features='cxx cshlib ',
23 includes = incl,
24 lib = lib,
25 uselib = uselib,
26 obj_ext = '_14.o',
27 cxxflags = cxxflag,
28 defines = ["LV2_SO"],
29 target = 'gx_mbreverb',
30 source = src,
31 install_path = '${LV2DIR}/%s' % bundle,
32 chmod = 0o755,
33 )
34 lv2_effects.env['shlib_PATTERN'] = '%s.so'
35
36 if not bld.env['NOLV2GUI']:
37 uselib_local5 = []
38 libpath5 = []
39 lib5 = []
40 incl5 = ['../../../libgxwmm','../../../libgxw','../']
41 if sys.platform.startswith("linux"):
42 lib5.append('dl')
43 if bld.env["GX_LIB_SHARED"]:
44 lib5 += ['gxwmm','gxw']
45 libpath5 += [bld.path.find_dir("../../../libgxw/gxw").bldpath(bld.env),
46 bld.path.find_dir("../../../libgxwmm/gxwmm").bldpath(bld.env)]
47 else:
48 uselib_local5 += ['gxwmm','gxw']
49
50 lv2_effetcs_gui = bld(
51 features='cxx cshlib ',
52 includes = incl5,
53 lib = lib5,
54 uselib = 'LV2CORE GTKMM',
55 libpath = libpath5,
56 uselib_local = uselib_local5,
57 linkflags = '-Wl,-z,nodelete',
58 defines = ["LV2_GUI"],
59 target = 'gx_mbreverb_gui',
60 source = 'widget.cpp gx_mbreverb_gui.cpp',
61 install_path = '${LV2DIR}/%s' % bundle,
62 chmod = 0o755,
63 )
64 lv2_effetcs_gui.env['shlib_PATTERN'] = '%s.so'
65
66 install_path = '${LV2DIR}/%s' % bundle,
67 bld.install_files('${LV2DIR}/gx_mbreverb.lv2', 'manifest.ttl')
68 bld.install_files('${LV2DIR}/gx_mbreverb.lv2', 'gx_mbreverb.ttl')
69
70 bld.install_files('${LV2DIR}/gx_mbreverb.lv2/', bld.path.ant_glob('modgui/**/*'), relative_trick=True)
116116 lv2:default 0.5 ;
117117 lv2:minimum 0.0 ;
118118 lv2:maximum 1.0 ;
119 ];
120 mod:gui [
121 a mod:Gui;
122 mod:resourcesDirectory <modgui>;
123 mod:iconTemplate <modgui/icon-gxroom_simulator.html>;
124 mod:templateData <modgui/data-gxroom_simulator.json>;
125 mod:screenshot <modgui/screenshot-gxroom_simulator.png>;
126 mod:thumbnail <modgui/thumb-gxroom_simulator.png>;
127 ].
119 ] .
128120
129121 <http://guitarix.sourceforge.net/plugins/gx_room_simulator_#gui>
130122 a guiext:GtkUI;
189189 lv2:default 2.0 ;
190190 lv2:minimum 1.0 ;
191191 lv2:maximum 8.0 ;
192 ];
193 mod:gui [
194 a mod:Gui;
195 mod:resourcesDirectory <modgui>;
196 mod:iconTemplate <modgui/icon-gxshimmizita.html>;
197 mod:templateData <modgui/data-gxshimmizita.json>;
198 mod:screenshot <modgui/screenshot-gxshimmizita.png>;
199 mod:thumbnail <modgui/thumb-gxshimmizita.png>;
200 ].
192 ] .
132132 lv2:default 1.0 ;
133133 lv2:minimum 0.25 ;
134134 lv2:maximum 5.0 ;
135 ];
136 mod:gui [
137 a mod:Gui;
138 mod:resourcesDirectory <modgui>;
139 mod:iconTemplate <modgui/icon-gxswitched_tremolo.html>;
140 mod:templateData <modgui/data-gxswitched_tremolo.json>;
141 mod:screenshot <modgui/screenshot-gxswitched_tremolo.png>;
142 mod:thumbnail <modgui/thumb-gxswitched_tremolo.png>;
143 ].
135 ] .
444444 if (bpm > 0) frames_period = sample_set/ bpm;
445445 else frames_period = 0;
446446 }
447 vu_adapter->mono_audio(static_cast<int>(n_samples), input, input, vu_adapter);
448447 lhcut->mono_audio(static_cast<int>(n_samples), input, output, lhcut);
449448 tuner& self = *static_cast<tuner*>(tuner_adapter);
450449 if (fabs(threshold - *(threshold_))>0.1)
454453 }
455454 tuner_adapter->mono_audio(static_cast<int>(n_samples), output, output, tuner_adapter);
456455 *(freq) = self.get_freq(self);
456 vu_adapter->mono_audio(static_cast<int>(n_samples), output, output, vu_adapter);
457457
458458 // MIDI
459459 if (fastnote != *(fastnote_)) {
4242 FREQ,
4343 REFFREQ,
4444 TUNEMODE,
45 TEMPERAMENT,
4546 THRESHOLD,
4647 MAXL,
4748 RESET,
146146 a lv2:InputPort ,
147147 lv2:ControlPort ;
148148 lv2:index 3 ;
149 lv2:symbol "TEMPERAMENT" ;
150 lv2:name "TEMPERAMENT";
151 lv2:default 0 ;
152 lv2:minimum 0 ;
153 lv2:maximum 2 ;
154 ] , [
155 a lv2:InputPort ,
156 lv2:ControlPort ;
157 lv2:index 4 ;
149158 lv2:symbol "THRESHOLD" ;
150159 lv2:name "THRESHOLD";
151160 lv2:default -50 ;
153162 lv2:maximum 4 ;
154163 ] , [
155164 a lv2:ControlPort, lv2:OutputPort ;
156 lv2:index 4 ;
165 lv2:index 5 ;
157166 lv2:symbol "MAXL" ;
158167 lv2:name "MAXL";
159168 lv2:default 0.0 ;
162171 ] , [
163172 a lv2:InputPort ,
164173 lv2:ControlPort ;
165 lv2:index 5 ;
174 lv2:index 6 ;
166175 lv2:symbol "RESET" ;
167176 lv2:name "RESET";
168177 lv2:default 1 ;
171180 ] , [
172181 a lv2:InputPort ,
173182 lv2:ControlPort ;
174 lv2:index 6 ;
183 lv2:index 7 ;
175184 lv2:symbol "LEVEL" ;
176185 lv2:name "LEVEL";
177 lv2:default -20 ;
186 lv2:default -45 ;
178187 lv2:minimum -60 ;
179188 lv2:maximum 4 ;
180189 ] , [
181190 a lv2:InputPort ,
182191 lv2:ControlPort ;
183 lv2:index 7 ;
192 lv2:index 8 ;
184193 lv2:symbol "CHANNEL" ;
185194 lv2:name "CHANNELL";
186195 lv2:portProperty lv2:integer;
208217 ] , [
209218 a lv2:InputPort ,
210219 lv2:ControlPort ;
211 lv2:index 8 ;
220 lv2:index 9 ;
212221 lv2:symbol "MIDI_ON" ;
213222 lv2:name "MIDI_ON";
214223 lv2:portProperty lv2:integer;
218227 ] , [
219228 a lv2:InputPort ,
220229 lv2:ControlPort ;
221 lv2:index 9 ;
230 lv2:index 10 ;
222231 lv2:symbol "FASTNOTE" ;
223232 lv2:name "FASTNOTE";
224233 lv2:portProperty lv2:integer;
228237 ] , [
229238 a lv2:InputPort ,
230239 lv2:ControlPort ;
231 lv2:index 10 ;
240 lv2:index 11 ;
232241 lv2:symbol "PITCHBEND" ;
233242 lv2:name "PITCHBEND";
234243 lv2:portProperty lv2:integer;
238247 ] , [
239248 a lv2:InputPort ,
240249 lv2:ControlPort ;
241 lv2:index 11 ;
250 lv2:index 12 ;
242251 lv2:symbol "SINGLENOTE" ;
243252 lv2:name "SINGLENOTE";
244253 lv2:portProperty lv2:integer;
247256 lv2:maximum 1 ;
248257 ] , [
249258 a lv2:ControlPort, lv2:InputPort ;
250 lv2:index 12 ;
259 lv2:index 13 ;
251260 lv2:symbol "BPM" ;
252261 lv2:name "BPM";
253262 lv2:portProperty lv2:integer;
256265 lv2:maximum 360.0 ;
257266 ] , [
258267 a lv2:ControlPort, lv2:InputPort ;
259 lv2:index 13 ;
268 lv2:index 14 ;
260269 lv2:symbol "VELOCITY" ;
261270 lv2:name "VELOCITY";
262271 lv2:portProperty lv2:integer;
266275 ] , [
267276 a lv2:InputPort ,
268277 lv2:ControlPort ;
269 lv2:index 14 ;
278 lv2:index 15 ;
270279 lv2:symbol "VERIFY" ;
271280 lv2:name "VERIFY";
272281 lv2:portProperty lv2:integer;
276285 ] , [
277286 a lv2:InputPort ,
278287 lv2:ControlPort ;
279 lv2:index 15 ;
288 lv2:index 16 ;
280289 lv2:symbol "GATE" ;
281290 lv2:name "GATE";
282291 lv2:portProperty lv2:integer;
286295 ] , [
287296 a lv2:InputPort ,
288297 lv2:ControlPort ;
289 lv2:index 16 ;
298 lv2:index 17 ;
290299 lv2:symbol "SYNTHFREQ" ;
291300 lv2:name "SYNTHFREQ";
292301 lv2:default 220 ;
295304 ] , [
296305 a lv2:InputPort ,
297306 lv2:ControlPort ;
298 lv2:index 17 ;
307 lv2:index 18 ;
299308 lv2:symbol "GAIN" ;
300309 lv2:name "GAIN";
301310 lv2:default 1 ;
307316 atom:bufferType atom:Sequence ;
308317 atom:supports midi:MidiEvent ;
309318 lv2:designation lv2:control ;
310 lv2:index 18 ;
319 lv2:index 19 ;
311320 lv2:symbol "midi_out" ;
312321 lv2:name "MIDI Out"
313322 ] , [
314323 a lv2:AudioPort ,
315324 lv2:OutputPort ;
316 lv2:index 19 ;
325 lv2:index 20 ;
317326 lv2:symbol "out" ;
318327 lv2:name "Out" ;
319328 ] , [
320329 a lv2:AudioPort ,
321330 lv2:InputPort ;
322 lv2:index 20 ;
331 lv2:index 21 ;
323332 lv2:symbol "in" ;
324333 lv2:name "In" ;
325334 ].
3636 return &m_bigknob;
3737 case TUNEMODE:
3838 return &tuner_tuning;
39 case TEMPERAMENT:
40 return &tuner_temperament;
3941 case THRESHOLD:
4042 return &m_bigknob1;
4143 case LEVEL:
4648 return &m_switch;
4749 case FASTNOTE:
4850 return &m_switch1;
49 case PITCHBEND:
51 case PITCHBEND:
5052 return &m_switch2;
5153 case SINGLENOTE:
5254 return &m_switch3;
7779 static const size_t _size = sizeof(modes) / sizeof(modes[0]);
7880 make_selector("Tunning Modes", modes, _size, 0, 1.0, TUNEMODE);
7981 m_vbox8.pack_start(tuner_tuning);
82 Glib::ustring temperament_modes[] = {"12-TET","19-TET", "31-TET"};
83 static const size_t _size2 = sizeof(temperament_modes) / sizeof(modes[0]);
84 make_selector("Tunning Scale", temperament_modes, _size2, 0, 1.0, TEMPERAMENT);
85 m_vbox8.pack_start(tuner_temperament);
8086 m_vbox8.set_spacing(2);
8187 make_switch_box(&m_hbox_, "", "FAST DETECTION", FASTNOTE);
8288 m_vbox8.pack_start(m_vbox4);
328334 if (port_index == FREQ) m_tuner.set_freq(value);
329335 if (port_index == REFFREQ) m_tuner.set_reference_pitch(value);
330336 if (port_index == TUNEMODE) set_tuning(value);
337 if (port_index == TEMPERAMENT) set_temperament();
331338 if (port_index == MAXL) refresh_meter_level(value);
332339
333340 }
344351 write_function(controller, port_index, sizeof(float), 0,
345352 static_cast<const void*>(&value));
346353 if (port_index == TUNEMODE) set_tuning(value);
354 if (port_index == TEMPERAMENT) set_temperament();
347355 if (port_index == REFFREQ) m_tuner.set_reference_pitch(value);
348356 }
349357
354362 }
355363
356364 //////////////////////// Special Stuff for Tuner and VU-Meter //////////
365
366 void Widget::set_temperament() {
367 m_tuner.set_temperament(tuner_temperament.cp_get_value());
368 set_tuning(tuner_tuning.cp_get_value());
369 }
357370
358371 void Widget::set_tuning(float mode_) {
359372 static struct TuningTab {
423436 if (mode > 0) {
424437 m_tuner.set_display_flat(tuning_tab[mode-1].flat);
425438 for (int i = 0; i < 6; ++i) {
426 m_tuner.push_note(tuning_tab[mode-1].notes[i]);
439 m_tuner.push_note(tuning_tab[mode-1].notes[i], 69, 12);
427440 }
428441 } else {
429442 m_tuner.set_display_flat(false);
3939
4040 void on_value_changed(uint32_t port_index);
4141 void set_tuning(float value);
42 void set_temperament();
4243 void make_controller_box(Gtk::Box *box,
4344 Glib::ustring label,
4445 float min, float max,
110111 Gxw::HSlider m_bigknob4;
111112 Gxw::RackTuner m_tuner;
112113 Gxw::Selector tuner_tuning;
114 Gxw::Selector tuner_temperament;
113115 Gxw::Selector select1;
114116 Gxw::FastMeter fastmeter;
115117 Gxw::LevelSlider levelslider;
8787 'gx_digital_delay.lv2',
8888 'gx_digital_delay_st.lv2',
8989 'gx_livelooper.lv2',
90 'gx_mbreverb.lv2',
9091 ]
9192
9293 return subdirs
44 import("guitarix.lib");
55 msec = SR/1000.0;
66 interp = 100*msec;
7 N = int( 2^18);
7 N = int( 2^19);
88 gain = vslider("gain", 0, -20, 20, 0.1) : db2linear : smoothi(0.999);
9 d = vslider("delay", 0, 0, 5000, 10)*msec;
9 d = tempo(hslider("bpm[name:delay (bpm)][tooltip:Delay in Beats per Minute]",120,24,360,1));
10 //d = vslider("delay", 0, 0, 5000, 10)*msec;
1011 process = _ <: _ + gain * sdelay(N, interp,d) :> _;
00 // -----delay
11 b.openHorizontalhideBox("");
2 b.create_master_slider(PARAM("delay"), _(" delay "));
2 b.create_master_slider(PARAM("bpm"), _(" delay (bpm) "));
33 b.closeBox();
44 b.openVerticalBox("");
55 {
66 b.openHorizontalTableBox("");
77 {
8 b.create_small_rackknobr(PARAM("delay"), _(" delay "));
8 b.create_small_rackknobr(PARAM("bpm"), _(" delay (bpm) "));
99 b.create_small_rackknob(PARAM("gain"), _(" gain "));
1010 }
1111 b.closeBox();
11 declare name "Digital Delay";
22 declare category "Echo / Delay";
33 declare description "Digital Delay";
4
54
65 import("music.lib");
76 import("guitarix.lib");
3736 tact = hslider("notes[name:tact][enum:Dotted 1/2 note|1/2 note|1/2 note triplets|
3837 Dotted 1/4 note|1/4 note|1/4 note triplets|Dotted 1/8 note|1/8 note|1/8 note triplets|
3938 Dotted 1/16 note|1/16 note|1/16 note triplets|Dotted 1/32 note|1/32 note|1/32 note triplets|
40 Dotted 1/64 note|1/64 note|1/64 note triplets][tooltip:note setting for bpm]",5,1,18,1);
39 Dotted 1/64 note|1/64 note|1/64 note triplets][tooltip:note setting for bpm]",4,0,17,1);
4140
4241 interp = 100*SR/1000.0;
4342 N = int( 2^19 ) ;
1010 import("effect.lib");
1111 import("filter.lib");
1212
13 t = vslider("time", 1, 1, 2000, 1);
13 //t = vslider("time", 1, 1, 2000, 1);
14 t = tempo(hslider("bpm[name:time (bpm)][tooltip:Echo in Beats per Minute]",120,24,360,1));
1415 release = vslider("percent", 0, 0, 100, 0.1)/100.0 : smooth(0.999);
16 N = int( 2^19);
1517 interp = 100*millisec;
16 echo1 = +~(sdelay(131072, interp, int(t*millisec)-1) * (release));
18 echo1 = +~(sdelay(N, interp, int(t)-1) * (release));
1719 process = echo1;
55 {
66 b.openHorizontalTableBox("");
77 {
8 b.create_small_rackknobr(PARAM("time"), _(" time "));
8 b.create_small_rackknobr(PARAM("bpm"), _(" time (bpm) "));
99 b.create_small_rackknob(PARAM("percent"), " % ");
1010 }
1111 b.closeBox();
1313 dmax = 2048;
1414 dflange = 0.001 * SR * hslider("flange delay [unit:ms]", 10, 0, 20, 0.01);
1515 odflange = 0.001 * SR * hslider("flange delay offset [unit:ms]", 1, 0, 20, 0.01);
16 freq = hslider("LFO freq [unit:Hz]", 0.2, 0, 5, 0.01);
16 //freq = hslider("LFO freq [unit:Hz]", 0.2, 0, 5, 0.01);
17 freq = hslider("lfobpm[name:LFO freq (bpm)][unit:bpm][tooltip:LFO in Beats per Minute]",24,24,360,1)/60;
1718 depth = hslider("depth", 1, 0, 1, 0.01);
1819 fb = hslider("feedback gain", 0, 0, 1, 0.01);
1920 invert = checkbox("invert[enum:linear|invert]");
1616 lfol = component("oscillator.lib").oscrs;
1717 dflange = 0.001 * SR * 10.0;
1818 odflange = 0.001 * SR * 1.0;
19 freq = hslider("freq [unit:Hz]", 0.2, 0, 5, 0.01);
19 //freq = hslider("freq [unit:Hz]", 0.2, 0, 5, 0.01);
20 freq = hslider("lfobpm[name:LFO freq (bpm)][unit:bpm][tooltip:LFO in Beats per Minute]",24,24,360,1)/60;
2021 level = hslider("level [unit:dB]", 0, -60, 10, 0.1) : db2linear;
2122 curdel = odflange+dflange*(1 + lfol(freq))/2;
2223 };
55 b.openHorizontalBox("");
66 {
77 b.create_small_rackknobr(PARAM("level"), _("level"));
8 b.create_small_rackknob(PARAM("freq"), _("speed"));
8 b.create_small_rackknob(PARAM("lfobpm"), _("LFO freq (bpm)"));
99 b.create_small_rackknob(PARAM("wet_dry"), _("dry/wet"));
1010 }
1111 b.closeBox();
1616 b.create_small_rackknob(PARAM("depth"), _(" depth "));
1717 b.create_small_rackknob(PARAM("flange delay"), _(" delay "));
1818 b.create_small_rackknob(PARAM("flange delay offset"), _(" delay offset"));
19 b.create_small_rackknob(PARAM("LFO freq"), _(" LFO "));
19 b.create_small_rackknob(PARAM("lfobpm"), _(" LFO freq (bpm)"));
2020 }
2121 b.closeBox();
2222 b.insertSpacer();
4545 phaser_stereogx = *(level),*(level) : phaser_stereo(Notches,width,frqmin,fratio,frqmax,freq,mdepth,fb,invert)
4646 with {
4747 Notches = 4;
48 freq = hslider("Speed [unit:Hz] ", 0.5, 0, 10, 0.01);
48 //freq = hslider("Speed [unit:Hz] ", 0.5, 0, 10, 0.01);
49 freq = hslider("lfobpm[name:Speed (bpm)][tooltip:Speed in Beats per Minute]",30,24,360,1)/60;
4950
5051 depth = hslider("depth", 1, 0, 1, 0.01);
5152 fb = hslider("feedback gain", 0, 0, 1, 0.01);
77 phaser_monogx = *(level): component("phaser.dsp").phaser_mono(Notches,0,width,frqmin,fratio,frqmax,freq,mdepth,fb,invert)
88 with {
99 Notches = 4;
10 freq = hslider("Speed [unit:Hz] ", 0.5, 0, 10, 0.01);
10 //freq = hslider("Speed [unit:Hz] ", 0.5, 0, 10, 0.01);
11 freq = hslider("lfobpm[name:Speed (bpm)][tooltip:Speed in Beats per Minute]",30,24,360,1)/60;
1112
1213 depth = 1 ;//hslider("depth", 1, 0, 1, 0.01);
1314 fb = 0.5 ;//hslider("feedback gain", 0, 0, 1, 0.01);
55 b.openHorizontalBox("");
66 {
77 b.create_small_rackknobr(PARAM("level"), _("level"));
8 b.create_small_rackknob(PARAM("Speed"), _("speed"));
8 b.create_small_rackknob(PARAM("lfobpm"), _("speed (bpm)"));
99 b.create_small_rackknob(PARAM("wet_dry"), _("dry/wet"));
1010 }
1111 b.closeBox();
1818 b.create_small_rackknob(PARAM("NotchFreq"), _("freq"));
1919 b.create_small_rackknob(PARAM("MaxNotch1Freq"), _("max Hz"));
2020 b.create_small_rackknob(PARAM("MinNotch1Freq"), _("min Hz"));
21 b.create_small_rackknob(PARAM("Speed"), _("speed"));
21 b.create_small_rackknob(PARAM("lfobpm"), _("speed (bpm)"));
2222 }
2323 b.closeBox();
2424 b.insertSpacer();
66
77 lfol = component("oscillator.lib").oscrs; // sine for left channel
88
9 freq = hslider("LFO freq [unit:Hz]", 0.2, 0, 5, 0.01);
9 //freq = hslider("LFO freq [unit:Hz]", 0.2, 0, 5, 0.01);
10 freq = hslider("lfobpm[name:LFO freq (bpm)][tooltip:LFO in Beats per Minute]",24,24,360,1)/60;
1011 pingpong = checkbox("invert[enum:linear|pingpong]");
1112 l_gain = vslider("l_gain", 0, -20, 20, 0.1) : db2linear : smoothi(0.999);
1213 r_gain = vslider("r_gain", 0, -20, 20, 0.1) : db2linear : smoothi(0.999);
13 d = vslider("l_delay", 0, 0, 5000, 10)*msec;
14 r = vslider("r_delay", 0, 0, 5000, 10)*msec;
14 d = tempo(hslider("lbpm[name:delay (bpm)][tooltip:Delay in Beats per Minute]",120,24,360,1));
15 r = tempo(hslider("rbpm[name:delay (bpm)][tooltip:Delay in Beats per Minute]",120,24,360,1));
16 //d = vslider("l_delay", 0, 0, 5000, 10)*msec;
17 //r = vslider("r_delay", 0, 0, 5000, 10)*msec;
1518 process = (_ <: _ + l_gain*(1-(pingpong*lfol(freq))) * sdelay(262144, 1024, d) :> _),
1619 (_ <: _ + r_gain*(1-(pingpong*(-1*lfol(freq)))) * sdelay(262144, 1024, r) :> _);
1720
33 b.openHorizontalBox("");
44 {
55 b.create_small_rackknob(PARAM("l_gain"), _("left gain"));
6 b.create_small_rackknob(PARAM("l_delay"), _("left delay"));
6 b.create_small_rackknob(PARAM("lbpm"), _("left delay (bpm)"));
77 b.openVerticalBox("");
88 {
9 b.create_small_rackknobr(PARAM("LFO freq"), _("LFO"));
9 b.create_small_rackknobr(PARAM("lfobpm"), _("LFO (bpm)"));
1010 b.insertSpacer();
11 b.create_selector(PARAM("invert"), 0);
11 b.create_selector(PARAM("invert"), _("mode"));
1212 b.openFrameBox("");
1313 b.closeBox();
1414 }
1515 b.closeBox();
1616 b.create_small_rackknob(PARAM("r_gain"), _("right gain"));
17 b.create_small_rackknob(PARAM("r_delay"), _("right delay"));
17 b.create_small_rackknob(PARAM("rbpm"), _("right delay (bpm)"));
1818 }
1919 b.closeBox();
77
88 lfol = component("oscillator.lib").oscrs; // sine for left channel
99
10 freq = hslider("LFO freq [unit:Hz]", 0.2, 0, 5, 0.01);
10 //freq = hslider("LFO freq [unit:Hz]", 0.2, 0, 5, 0.01);
11 freq = hslider("lfobpm[name:LFO freq (bpm)][tooltip:LFO in Beats per Minute]",24,24,360,1)/60;
1112 pingpong = checkbox("invert[enum:linear|pingpong]");
1213
13 tl = vslider("time_l", 1, 1, 2000, 1);
14 //tl = vslider("time_l", 1, 1, 2000, 1);
1415 releasel = vslider("percent_l", 0, 0, 100, 0.1);
15 tr = vslider("time_r", 1, 1, 2000, 1);
16 //tr = vslider("time_r", 1, 1, 2000, 1);
1617 releaser = vslider("percent_r", 0, 0, 100, 0.1);
18 tl = tempo(hslider("lbpm[name:time (bpm)][tooltip:Echo in Beats per Minute]",120,24,360,1));
19 tr = tempo(hslider("rbpm[name:time (bpm)][tooltip:Echo in Beats per Minute]",120,24,360,1));
20 N = int( 2^19);
1721
18 echo1 = +~(sdelay(131072, 1024, int(tl*millisec)-1) * ((releasel/100.0)*(1-(lfol(freq)*pingpong))) );
19 echo2 = +~(sdelay(131072, 1024, int(tr*millisec)-1) * ((releaser/100.0)*(1-((-1*lfol(freq))*pingpong))) );
22 echo1 = +~(sdelay(N, 1024, int(tl)-1) * ((releasel/100.0)*(1-(lfol(freq)*pingpong))) );
23 echo2 = +~(sdelay(N, 1024, int(tr)-1) * ((releaser/100.0)*(1-((-1*lfol(freq))*pingpong))) );
2024 process = echo1,echo2;
1010 b.closeBox();
1111 b.openVerticalBox("");
1212 {
13 b.create_small_rackknob(PARAM("time_l"), _("left time"));
13 b.create_small_rackknob(PARAM("lbpm"), _("left time (bpm)"));
1414 b.insertSpacer();
1515 }
1616 b.closeBox();
1717 b.openVerticalBox("");
1818 {
19 b.create_small_rackknobr(PARAM("LFO freq"), _("LFO"));
19 b.create_small_rackknobr(PARAM("lfobpm"), _("LFO (bpm)"));
2020 b.insertSpacer();
2121 b.create_selector(PARAM("invert"), 0);
2222 b.openFrameBox("");
3131 b.closeBox();
3232 b.openVerticalBox("");
3333 {
34 b.create_small_rackknob(PARAM("time_r"), _("right time"));
34 b.create_small_rackknob(PARAM("rbpm"), _("right time (bpm)"));
3535 b.insertSpacer();
3636 }
3737 b.closeBox();
1212 float fConst1;
1313 float fConst2;
1414 FAUSTFLOAT fslider0;
15 float fConst3;
15 int iConst3;
1616 float fRec0[2];
1717 float fRec1[2];
1818 float fRec2[2];
7070
7171 inline void Dsp::clear_state_f()
7272 {
73 for (int i=0; i<262144; i++) fVec0[i] = 0;
73 for (int i=0; i<524288; i++) fVec0[i] = 0;
7474 for (int i=0; i<2; i++) fRec0[i] = 0;
7575 for (int i=0; i<2; i++) fRec1[i] = 0;
7676 for (int i=0; i<2; i++) fRec2[i] = 0;
9090 iConst0 = min(192000, max(1, fSamplingFreq));
9191 fConst1 = (1e+01f / float(iConst0));
9292 fConst2 = (0 - fConst1);
93 fConst3 = (0.001f * iConst0);
93 iConst3 = (60 * iConst0);
9494 }
9595
9696 void Dsp::init_static(unsigned int samplingFreq, PluginDef *p)
100100
101101 void Dsp::mem_alloc()
102102 {
103 if (!fVec0) fVec0 = new float[262144];
103 if (!fVec0) fVec0 = new float[524288];
104104 mem_allocated = true;
105105 }
106106
130130
131131 void always_inline Dsp::compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0)
132132 {
133 float fSlow0 = (fConst3 * float(fslider0));
133 float fSlow0 = (float(iConst3) / float(fslider0));
134134 float fSlow1 = (0.0010000000000000009f * powf(10,(0.05f * float(fslider1))));
135135 for (int i=0; i<count; i++) {
136136 float fTemp0 = (float)input0[i];
137 fVec0[IOTA&262143] = fTemp0;
137 fVec0[IOTA&524287] = fTemp0;
138138 float fTemp1 = ((int((fRec0[1] != 0.0f)))?((int(((fRec1[1] > 0.0f) & (fRec1[1] < 1.0f))))?fRec0[1]:0):((int(((fRec1[1] == 0.0f) & (fSlow0 != fRec2[1]))))?fConst1:((int(((fRec1[1] == 1.0f) & (fSlow0 != fRec3[1]))))?fConst2:0)));
139139 fRec0[0] = fTemp1;
140140 fRec1[0] = max(0.0f, min(1.0f, (fRec1[1] + fTemp1)));
141141 fRec2[0] = ((int(((fRec1[1] >= 1.0f) & (fRec3[1] != fSlow0))))?fSlow0:fRec2[1]);
142142 fRec3[0] = ((int(((fRec1[1] <= 0.0f) & (fRec2[1] != fSlow0))))?fSlow0:fRec3[1]);
143143 fRec4[0] = ((0.999f * fRec4[1]) + fSlow1);
144 output0[i] = (FAUSTFLOAT)(fVec0[IOTA&262143] + (fRec4[0] * (((1.0f - fRec1[0]) * fVec0[(IOTA-int((int(fRec2[0]) & 262143)))&262143]) + (fRec1[0] * fVec0[(IOTA-int((int(fRec3[0]) & 262143)))&262143]))));
144 output0[i] = (FAUSTFLOAT)(fVec0[IOTA&524287] + (fRec4[0] * (((1.0f - fRec1[0]) * fVec0[(IOTA-int((int(fRec2[0]) & 524287)))&524287]) + (fRec1[0] * fVec0[(IOTA-int((int(fRec3[0]) & 524287)))&524287]))));
145145 // post processing
146146 fRec4[1] = fRec4[0];
147147 fRec3[1] = fRec3[0];
159159
160160 int Dsp::register_par(const ParamReg& reg)
161161 {
162 reg.registerVar("delay.delay","","S","",&fslider0, 0.0f, 0.0f, 5e+03f, 1e+01f);
162 reg.registerVar("delay.bpm",N_("delay (bpm)"),"S",N_("Delay in Beats per Minute"),&fslider0, 1.2e+02f, 24.0f, 3.6e+02f, 1.0f);
163163 reg.registerVar("delay.gain","","S","",&fslider1, 0.0f, -2e+01f, 2e+01f, 0.1f);
164164 return 0;
165165 }
175175 #define PARAM(p) ("delay" "." p)
176176 // -----delay
177177 b.openHorizontalhideBox("");
178 b.create_master_slider(PARAM("delay"), _(" delay "));
178 b.create_master_slider(PARAM("bpm"), _(" delay (bpm) "));
179179 b.closeBox();
180180 b.openVerticalBox("");
181181 {
182182 b.openHorizontalTableBox("");
183183 {
184 b.create_small_rackknobr(PARAM("delay"), _(" delay "));
184 b.create_small_rackknobr(PARAM("bpm"), _(" delay (bpm) "));
185185 b.create_small_rackknob(PARAM("gain"), _(" gain "));
186186 }
187187 b.closeBox();
455455 static const value_pair fslider4_values[] = {{"plain"},{"presence"},{"tape"},{"tape2"},{0}};
456456 reg.registerEnumVar("dide.mode","","S","",fslider4_values,&fslider4, 0.0f, 0.0f, 3.0f, 1.0f);
457457 static const value_pair fslider5_values[] = {{"Dotted 1/2 note"},{"1/2 note"},{"1/2 note triplets"},{" Dotted 1/4 note"},{"1/4 note"},{"1/4 note triplets"},{"Dotted 1/8 note"},{"1/8 note"},{"1/8 note triplets"},{" Dotted 1/16 note"},{"1/16 note"},{"1/16 note triplets"},{"Dotted 1/32 note"},{"1/32 note"},{"1/32 note triplets"},{" Dotted 1/64 note"},{"1/64 note"},{"1/64 note triplets"},{0}};
458 reg.registerEnumVar("dide.notes",N_("tact"),"S",N_("note setting for bpm"),fslider5_values,&fslider5, 5.0f, 1.0f, 18.0f, 1.0f);
458 reg.registerEnumVar("dide.notes",N_("tact"),"S",N_("note setting for bpm"),fslider5_values,&fslider5, 4.0f, 0.0f, 17.0f, 1.0f);
459459 return 0;
460460 }
461461
582582 static const value_pair fslider4_values[] = {{"plain"},{"presence"},{"tape"},{"tape2"},{0}};
583583 reg.registerEnumVar("didest.mode","","S","",fslider4_values,&fslider4, 0.0f, 0.0f, 3.0f, 1.0f);
584584 static const value_pair fslider5_values[] = {{"Dotted 1/2 note"},{"1/2 note"},{"1/2 note triplets"},{" Dotted 1/4 note"},{"1/4 note"},{"1/4 note triplets"},{"Dotted 1/8 note"},{"1/8 note"},{"1/8 note triplets"},{" Dotted 1/16 note"},{"1/16 note"},{"1/16 note triplets"},{"Dotted 1/32 note"},{"1/32 note"},{"1/32 note triplets"},{" Dotted 1/64 note"},{"1/64 note"},{"1/64 note triplets"},{0}};
585 reg.registerEnumVar("didest.notes",N_("tact"),"S",N_("note setting for bpm"),fslider5_values,&fslider5, 5.0f, 1.0f, 18.0f, 1.0f);
585 reg.registerEnumVar("didest.notes",N_("tact"),"S",N_("note setting for bpm"),fslider5_values,&fslider5, 4.0f, 0.0f, 17.0f, 1.0f);
586586 return 0;
587587 }
588588
1010 float fConst1;
1111 float fConst2;
1212 FAUSTFLOAT fslider0;
13 float fConst3;
13 int iConst3;
1414 float fRec1[2];
1515 float fRec2[2];
1616 int iRec3[2];
7575 for (int i=0; i<2; i++) iRec3[i] = 0;
7676 for (int i=0; i<2; i++) iRec4[i] = 0;
7777 for (int i=0; i<2; i++) fRec5[i] = 0;
78 for (int i=0; i<262144; i++) fRec0[i] = 0;
78 for (int i=0; i<1048576; i++) fRec0[i] = 0;
7979 }
8080
8181 void Dsp::clear_state_f_static(PluginDef *p)
8989 iConst0 = min(192000, max(1, fSamplingFreq));
9090 fConst1 = (1e+01f / float(iConst0));
9191 fConst2 = (0 - fConst1);
92 fConst3 = (0.001f * iConst0);
92 iConst3 = (60 * iConst0);
9393 IOTA = 0;
9494 }
9595
100100
101101 void Dsp::mem_alloc()
102102 {
103 if (!fRec0) fRec0 = new float[262144];
103 if (!fRec0) fRec0 = new float[1048576];
104104 mem_allocated = true;
105105 }
106106
130130
131131 void always_inline Dsp::compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0)
132132 {
133 int iSlow0 = (int((fConst3 * float(fslider0))) - 1);
133 int iSlow0 = (int((float(iConst3) / float(fslider0))) - 1);
134134 float fSlow1 = (1.000000000000001e-05f * float(fslider1));
135135 for (int i=0; i<count; i++) {
136136 float fTemp0 = ((int((fRec1[1] != 0.0f)))?((int(((fRec2[1] > 0.0f) & (fRec2[1] < 1.0f))))?fRec1[1]:0):((int(((fRec2[1] == 0.0f) & (iSlow0 != iRec3[1]))))?fConst1:((int(((fRec2[1] == 1.0f) & (iSlow0 != iRec4[1]))))?fConst2:0)));
139139 iRec3[0] = ((int(((fRec2[1] >= 1.0f) & (iRec4[1] != iSlow0))))?iSlow0:iRec3[1]);
140140 iRec4[0] = ((int(((fRec2[1] <= 0.0f) & (iRec3[1] != iSlow0))))?iSlow0:iRec4[1]);
141141 fRec5[0] = ((0.999f * fRec5[1]) + fSlow1);
142 fRec0[IOTA&262143] = ((float)input0[i] + (fRec5[0] * (((1.0f - fRec2[0]) * fRec0[(IOTA-int((1 + int((int(iRec3[0]) & 131071)))))&262143]) + (fRec2[0] * fRec0[(IOTA-int((1 + int((int(iRec4[0]) & 131071)))))&262143]))));
143 output0[i] = (FAUSTFLOAT)fRec0[(IOTA-0)&262143];
142 fRec0[IOTA&1048575] = ((float)input0[i] + (fRec5[0] * (((1.0f - fRec2[0]) * fRec0[(IOTA-int((1 + int((int(iRec3[0]) & 524287)))))&1048575]) + (fRec2[0] * fRec0[(IOTA-int((1 + int((int(iRec4[0]) & 524287)))))&1048575]))));
143 output0[i] = (FAUSTFLOAT)fRec0[(IOTA-0)&1048575];
144144 // post processing
145145 IOTA = IOTA+1;
146146 fRec5[1] = fRec5[0];
158158
159159 int Dsp::register_par(const ParamReg& reg)
160160 {
161 reg.registerVar("echo.bpm",N_("time (bpm)"),"S",N_("Echo in Beats per Minute"),&fslider0, 1.2e+02f, 24.0f, 3.6e+02f, 1.0f);
161162 reg.registerVar("echo.percent","","S","",&fslider1, 0.0f, 0.0f, 1e+02f, 0.1f);
162 reg.registerVar("echo.time","","S","",&fslider0, 1.0f, 1.0f, 2e+03f, 1.0f);
163163 return 0;
164164 }
165165
180180 {
181181 b.openHorizontalTableBox("");
182182 {
183 b.create_small_rackknobr(PARAM("time"), _(" time "));
183 b.create_small_rackknobr(PARAM("bpm"), _(" time (bpm) "));
184184 b.create_small_rackknob(PARAM("percent"), " % ");
185185 }
186186 b.closeBox();
8686 fSamplingFreq = samplingFreq;
8787 IOTA = 0;
8888 iConst0 = min(192000, max(1, fSamplingFreq));
89 fConst1 = (6.283185307179586 / double(iConst0));
89 fConst1 = (0.10471975511965977 / double(iConst0));
9090 clear_state_f();
9191 }
9292
144144
145145 int Dsp::register_par(const ParamReg& reg)
146146 {
147 reg.registerVar("flanger.LFO freq","","S","",&fslider2, 0.2, 0.0, 5.0, 0.01);
148147 reg.registerVar("flanger.depth","","S","",&fslider5, 1.0, 0.0, 1.0, 0.01);
149148 reg.registerVar("flanger.feedback gain","","S","",&fslider1, 0.0, 0.0, 1.0, 0.01);
150149 reg.registerVar("flanger.flange delay","","S","",&fslider3, 1e+01, 0.0, 2e+01, 0.01);
152151 static const value_pair fcheckbox0_values[] = {{"linear"},{"invert"},{0}};
153152 reg.registerEnumVar("flanger.invert","","B","",fcheckbox0_values,&fcheckbox0, 0.0, 0.0, 1.0, 1.0);
154153 reg.registerVar("flanger.level","","S","",&fslider0, 0.0, -6e+01, 1e+01, 0.1);
154 reg.registerVar("flanger.lfobpm",N_("LFO freq (bpm)"),"S",N_("LFO in Beats per Minute"),&fslider2, 24.0, 24.0, 3.6e+02, 1.0);
155155 return 0;
156156 }
157157
183183 b.create_small_rackknob(PARAM("depth"), _(" depth "));
184184 b.create_small_rackknob(PARAM("flange delay"), _(" delay "));
185185 b.create_small_rackknob(PARAM("flange delay offset"), _(" delay offset"));
186 b.create_small_rackknob(PARAM("LFO freq"), _(" LFO "));
186 b.create_small_rackknob(PARAM("lfobpm"), _(" LFO freq (bpm)"));
187187 }
188188 b.closeBox();
189189 b.insertSpacer();
7878 fSamplingFreq = samplingFreq;
7979 IOTA = 0;
8080 iConst0 = min(192000, max(1, fSamplingFreq));
81 fConst1 = (6.283185307179586 / double(iConst0));
81 fConst1 = (0.10471975511965977 / double(iConst0));
8282 clear_state_f();
8383 }
8484
125125
126126 int Dsp::register_par(const ParamReg& reg)
127127 {
128 reg.registerVar("flanger_mono.freq","","S","",&fslider2, 0.2, 0.0, 5.0, 0.01);
129128 reg.registerVar("flanger_mono.level","","S","",&fslider0, 0.0, -6e+01, 1e+01, 0.1);
129 reg.registerVar("flanger_mono.lfobpm",N_("LFO freq (bpm)"),"S",N_("LFO in Beats per Minute"),&fslider2, 24.0, 24.0, 3.6e+02, 1.0);
130130 reg.registerVar("flanger_mono.wet_dry",N_("wet/dry"),"S",N_("percentage of processed signal in output signal"),&fslider1, 1e+02, 0.0, 1e+02, 1.0);
131131 return 0;
132132 }
148148 b.openHorizontalBox("");
149149 {
150150 b.create_small_rackknobr(PARAM("level"), _("level"));
151 b.create_small_rackknob(PARAM("freq"), _("speed"));
151 b.create_small_rackknob(PARAM("lfobpm"), _("LFO freq (bpm)"));
152152 b.create_small_rackknob(PARAM("wet_dry"), _("dry/wet"));
153153 }
154154 b.closeBox();
101101 fSamplingFreq = samplingFreq;
102102 iConst0 = min(192000, max(1, fSamplingFreq));
103103 fConst1 = (1.0f / float(iConst0));
104 fConst2 = (6.283185307179586f / float(iConst0));
104 fConst2 = (0.10471975511965977f / float(iConst0));
105105 clear_state_f();
106106 }
107107
188188 reg.registerVar("phaser.MinNotch1Freq","","S","",&fslider5, 1e+02f, 2e+01f, 5e+03f, 1.0f);
189189 reg.registerVar("phaser.Notch width","","S","",&fslider3, 1e+03f, 1e+01f, 5e+03f, 1.0f);
190190 reg.registerVar("phaser.NotchFreq","","S","",&fslider7, 1.5f, 1.1f, 4.0f, 0.01f);
191 reg.registerVar("phaser.Speed","","S","",&fslider4, 0.5f, 0.0f, 1e+01f, 0.01f);
192191 static const value_pair fcheckbox0_values[] = {{"direct "},{" vibrato"},{0}};
193192 reg.registerEnumVar("phaser.VibratoMode","","B","",fcheckbox0_values,&fcheckbox0, 0.0, 0.0, 1.0, 1.0);
194193 reg.registerVar("phaser.depth","","S","",&fslider0, 1.0f, 0.0f, 1.0f, 0.01f);
196195 static const value_pair fcheckbox1_values[] = {{"linear"},{"invert"},{0}};
197196 reg.registerEnumVar("phaser.invert","","B","",fcheckbox1_values,&fcheckbox1, 0.0, 0.0, 1.0, 1.0);
198197 reg.registerVar("phaser.level","","S","",&fslider2, 0.0f, -6e+01f, 1e+01f, 0.1f);
198 reg.registerVar("phaser.lfobpm",N_("Speed (bpm)"),"S",N_("Speed in Beats per Minute"),&fslider4, 3e+01f, 24.0f, 3.6e+02f, 1.0f);
199199 return 0;
200200 }
201201
229229 b.create_small_rackknob(PARAM("NotchFreq"), _("freq"));
230230 b.create_small_rackknob(PARAM("MaxNotch1Freq"), _("max Hz"));
231231 b.create_small_rackknob(PARAM("MinNotch1Freq"), _("min Hz"));
232 b.create_small_rackknob(PARAM("Speed"), _("speed"));
232 b.create_small_rackknob(PARAM("lfobpm"), _("speed (bpm)"));
233233 }
234234 b.closeBox();
235235 b.insertSpacer();
9191 iConst0 = min(192000, max(1, fSamplingFreq));
9292 fConst1 = expf((0 - (3141.592653589793f / float(iConst0))));
9393 fConst2 = faustpower<2>(fConst1);
94 fConst3 = (6.283185307179586f / float(iConst0));
94 fConst3 = (0.10471975511965977f / float(iConst0));
9595 fConst4 = (2.0f / float(iConst0));
9696 fConst5 = (0 - (2 * fConst1));
9797 fConst6 = (4.0f / float(iConst0));
149149
150150 int Dsp::register_par(const ParamReg& reg)
151151 {
152 reg.registerVar("phaser_mono.Speed","","S","",&fslider2, 0.5f, 0.0f, 1e+01f, 0.01f);
153152 reg.registerVar("phaser_mono.level","","S","",&fslider0, 0.0f, -6e+01f, 1e+01f, 0.1f);
153 reg.registerVar("phaser_mono.lfobpm",N_("Speed (bpm)"),"S",N_("Speed in Beats per Minute"),&fslider2, 3e+01f, 24.0f, 3.6e+02f, 1.0f);
154154 reg.registerVar("phaser_mono.wet_dry",N_("wet/dry"),"S",N_("percentage of processed signal in output signal"),&fslider1, 1e+02f, 0.0f, 1e+02f, 1.0f);
155155 return 0;
156156 }
172172 b.openHorizontalBox("");
173173 {
174174 b.create_small_rackknobr(PARAM("level"), _("level"));
175 b.create_small_rackknob(PARAM("Speed"), _("speed"));
175 b.create_small_rackknob(PARAM("lfobpm"), _("speed (bpm)"));
176176 b.create_small_rackknob(PARAM("wet_dry"), _("dry/wet"));
177177 }
178178 b.closeBox();
1111 int iVec1[2];
1212 FAUSTFLOAT fslider0;
1313 int iConst0;
14 float fConst1;
14 int iConst1;
1515 float fRec0[2];
1616 float fRec1[2];
1717 float fRec2[2];
110110 fSamplingFreq = samplingFreq;
111111 IOTA = 0;
112112 iConst0 = min(192000, max(1, fSamplingFreq));
113 fConst1 = (0.001f * iConst0);
114 fConst2 = (6.283185307179586f / float(iConst0));
113 iConst1 = (60 * iConst0);
114 fConst2 = (0.10471975511965977f / float(iConst0));
115115 }
116116
117117 void Dsp::init_static(unsigned int samplingFreq, PluginDef *p)
153153
154154 void always_inline Dsp::compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *input1, FAUSTFLOAT *output0, FAUSTFLOAT *output1)
155155 {
156 float fSlow0 = (fConst1 * float(fslider0));
156 float fSlow0 = (float(iConst1) / float(fslider0));
157157 float fSlow1 = (fConst2 * float(fslider1));
158158 float fSlow2 = cosf(fSlow1);
159159 float fSlow3 = sinf(fSlow1);
160160 float fSlow4 = (0 - fSlow3);
161161 float fSlow5 = float(fcheckbox0);
162162 float fSlow6 = (0.0010000000000000009f * powf(10,(0.05f * float(fslider2))));
163 float fSlow7 = (fConst1 * float(fslider3));
163 float fSlow7 = (float(iConst1) / float(fslider3));
164164 float fSlow8 = (0.0010000000000000009f * powf(10,(0.05f * float(fslider4))));
165165 for (int i=0; i<count; i++) {
166166 float fTemp0 = (float)input0[i];
209209
210210 int Dsp::register_par(const ParamReg& reg)
211211 {
212 reg.registerVar("stereodelay.LFO freq","","S","",&fslider1, 0.2f, 0.0f, 5.0f, 0.01f);
213212 static const value_pair fcheckbox0_values[] = {{"linear"},{"pingpong"},{0}};
214213 reg.registerEnumVar("stereodelay.invert","","B","",fcheckbox0_values,&fcheckbox0, 0.0, 0.0, 1.0, 1.0);
215 reg.registerVar("stereodelay.l_delay","","S","",&fslider0, 0.0f, 0.0f, 5e+03f, 1e+01f);
216214 reg.registerVar("stereodelay.l_gain","","S","",&fslider2, 0.0f, -2e+01f, 2e+01f, 0.1f);
217 reg.registerVar("stereodelay.r_delay","","S","",&fslider3, 0.0f, 0.0f, 5e+03f, 1e+01f);
215 reg.registerVar("stereodelay.lbpm",N_("delay (bpm)"),"S",N_("Delay in Beats per Minute"),&fslider0, 1.2e+02f, 24.0f, 3.6e+02f, 1.0f);
216 reg.registerVar("stereodelay.lfobpm",N_("LFO freq (bpm)"),"S",N_("LFO in Beats per Minute"),&fslider1, 24.0f, 24.0f, 3.6e+02f, 1.0f);
218217 reg.registerVar("stereodelay.r_gain","","S","",&fslider4, 0.0f, -2e+01f, 2e+01f, 0.1f);
218 reg.registerVar("stereodelay.rbpm",N_("delay (bpm)"),"S",N_("Delay in Beats per Minute"),&fslider3, 1.2e+02f, 24.0f, 3.6e+02f, 1.0f);
219219 return 0;
220220 }
221221
234234 b.openHorizontalBox("");
235235 {
236236 b.create_small_rackknob(PARAM("l_gain"), _("left gain"));
237 b.create_small_rackknob(PARAM("l_delay"), _("left delay"));
237 b.create_small_rackknob(PARAM("lbpm"), _("left delay (bpm)"));
238238 b.openVerticalBox("");
239239 {
240 b.create_small_rackknobr(PARAM("LFO freq"), _("LFO"));
240 b.create_small_rackknobr(PARAM("lfobpm"), _("LFO (bpm)"));
241241 b.insertSpacer();
242 b.create_selector(PARAM("invert"), 0);
242 b.create_selector(PARAM("invert"), _("mode"));
243243 b.openFrameBox("");
244244 b.closeBox();
245245 }
246246 b.closeBox();
247247 b.create_small_rackknob(PARAM("r_gain"), _("right gain"));
248 b.create_small_rackknob(PARAM("r_delay"), _("right delay"));
248 b.create_small_rackknob(PARAM("rbpm"), _("right delay (bpm)"));
249249 }
250250 b.closeBox();
251251
1414 float fRec2[2];
1515 FAUSTFLOAT fcheckbox0;
1616 FAUSTFLOAT fslider1;
17 float fConst2;
17 int iConst2;
1818 float fRec3[2];
1919 float fRec4[2];
2020 int iRec5[2];
8888 for (int i=0; i<2; i++) fRec4[i] = 0;
8989 for (int i=0; i<2; i++) iRec5[i] = 0;
9090 for (int i=0; i<2; i++) iRec6[i] = 0;
91 for (int i=0; i<262144; i++) fRec0[i] = 0;
91 for (int i=0; i<1048576; i++) fRec0[i] = 0;
9292 for (int i=0; i<2; i++) fRec8[i] = 0;
9393 for (int i=0; i<2; i++) fRec9[i] = 0;
9494 for (int i=0; i<2; i++) iRec10[i] = 0;
9595 for (int i=0; i<2; i++) iRec11[i] = 0;
96 for (int i=0; i<262144; i++) fRec7[i] = 0;
96 for (int i=0; i<1048576; i++) fRec7[i] = 0;
9797 }
9898
9999 void Dsp::clear_state_f_static(PluginDef *p)
105105 {
106106 fSamplingFreq = samplingFreq;
107107 iConst0 = min(192000, max(1, fSamplingFreq));
108 fConst1 = (6.283185307179586f / float(iConst0));
109 fConst2 = (0.001f * iConst0);
108 fConst1 = (0.10471975511965977f / float(iConst0));
109 iConst2 = (60 * iConst0);
110110 IOTA = 0;
111111 }
112112
117117
118118 void Dsp::mem_alloc()
119119 {
120 if (!fRec0) fRec0 = new float[262144];
121 if (!fRec7) fRec7 = new float[262144];
120 if (!fRec0) fRec0 = new float[1048576];
121 if (!fRec7) fRec7 = new float[1048576];
122122 mem_allocated = true;
123123 }
124124
154154 float fSlow2 = sinf(fSlow0);
155155 float fSlow3 = (0 - fSlow2);
156156 float fSlow4 = float(fcheckbox0);
157 int iSlow5 = (int((fConst2 * float(fslider1))) - 1);
157 int iSlow5 = (int((float(iConst2) / float(fslider1))) - 1);
158158 float fSlow6 = (0.01f * float(fslider2));
159 int iSlow7 = (int((fConst2 * float(fslider3))) - 1);
159 int iSlow7 = (int((float(iConst2) / float(fslider3))) - 1);
160160 float fSlow8 = (0.01f * float(fslider4));
161161 for (int i=0; i<count; i++) {
162162 iVec0[0] = 1;
167167 fRec4[0] = max(0.0f, min(1.0f, (fRec4[1] + fTemp0)));
168168 iRec5[0] = ((int(((fRec4[1] >= 1.0f) & (iRec6[1] != iSlow5))))?iSlow5:iRec5[1]);
169169 iRec6[0] = ((int(((fRec4[1] <= 0.0f) & (iRec5[1] != iSlow5))))?iSlow5:iRec6[1]);
170 fRec0[IOTA&262143] = ((float)input0[i] + (fSlow6 * ((((1.0f - fRec4[0]) * fRec0[(IOTA-int((1 + int((int(iRec5[0]) & 131071)))))&262143]) + (fRec4[0] * fRec0[(IOTA-int((1 + int((int(iRec6[0]) & 131071)))))&262143])) * (1 - (fSlow4 * fRec1[0])))));
171 output0[i] = (FAUSTFLOAT)fRec0[(IOTA-0)&262143];
170 fRec0[IOTA&1048575] = ((float)input0[i] + (fSlow6 * ((((1.0f - fRec4[0]) * fRec0[(IOTA-int((1 + int((int(iRec5[0]) & 524287)))))&1048575]) + (fRec4[0] * fRec0[(IOTA-int((1 + int((int(iRec6[0]) & 524287)))))&1048575])) * (1 - (fSlow4 * fRec1[0])))));
171 output0[i] = (FAUSTFLOAT)fRec0[(IOTA-0)&1048575];
172172 float fTemp1 = ((int((fRec8[1] != 0.0f)))?((int(((fRec9[1] > 0.0f) & (fRec9[1] < 1.0f))))?fRec8[1]:0):((int(((fRec9[1] == 0.0f) & (iSlow7 != iRec10[1]))))?0.0009765625f:((int(((fRec9[1] == 1.0f) & (iSlow7 != iRec11[1]))))?-0.0009765625f:0)));
173173 fRec8[0] = fTemp1;
174174 fRec9[0] = max(0.0f, min(1.0f, (fRec9[1] + fTemp1)));
175175 iRec10[0] = ((int(((fRec9[1] >= 1.0f) & (iRec11[1] != iSlow7))))?iSlow7:iRec10[1]);
176176 iRec11[0] = ((int(((fRec9[1] <= 0.0f) & (iRec10[1] != iSlow7))))?iSlow7:iRec11[1]);
177 fRec7[IOTA&262143] = ((float)input1[i] + (fSlow8 * ((((1.0f - fRec9[0]) * fRec7[(IOTA-int((1 + int((int(iRec10[0]) & 131071)))))&262143]) + (fRec9[0] * fRec7[(IOTA-int((1 + int((int(iRec11[0]) & 131071)))))&262143])) * (1 - (fSlow4 * (0 - fRec1[0]))))));
178 output1[i] = (FAUSTFLOAT)fRec7[(IOTA-0)&262143];
177 fRec7[IOTA&1048575] = ((float)input1[i] + (fSlow8 * ((((1.0f - fRec9[0]) * fRec7[(IOTA-int((1 + int((int(iRec10[0]) & 524287)))))&1048575]) + (fRec9[0] * fRec7[(IOTA-int((1 + int((int(iRec11[0]) & 524287)))))&1048575])) * (1 - (fSlow4 * (0 - fRec1[0]))))));
178 output1[i] = (FAUSTFLOAT)fRec7[(IOTA-0)&1048575];
179179 // post processing
180180 iRec11[1] = iRec11[0];
181181 iRec10[1] = iRec10[0];
199199
200200 int Dsp::register_par(const ParamReg& reg)
201201 {
202 reg.registerVar("stereoecho.LFO freq","","S","",&fslider0, 0.2f, 0.0f, 5.0f, 0.01f);
203202 static const value_pair fcheckbox0_values[] = {{"linear"},{"pingpong"},{0}};
204203 reg.registerEnumVar("stereoecho.invert","","B","",fcheckbox0_values,&fcheckbox0, 0.0, 0.0, 1.0, 1.0);
204 reg.registerVar("stereoecho.lbpm",N_("time (bpm)"),"S",N_("Echo in Beats per Minute"),&fslider1, 1.2e+02f, 24.0f, 3.6e+02f, 1.0f);
205 reg.registerVar("stereoecho.lfobpm",N_("LFO freq (bpm)"),"S",N_("LFO in Beats per Minute"),&fslider0, 24.0f, 24.0f, 3.6e+02f, 1.0f);
205206 reg.registerVar("stereoecho.percent_l","","S","",&fslider2, 0.0f, 0.0f, 1e+02f, 0.1f);
206207 reg.registerVar("stereoecho.percent_r","","S","",&fslider4, 0.0f, 0.0f, 1e+02f, 0.1f);
207 reg.registerVar("stereoecho.time_l","","S","",&fslider1, 1.0f, 1.0f, 2e+03f, 1.0f);
208 reg.registerVar("stereoecho.time_r","","S","",&fslider3, 1.0f, 1.0f, 2e+03f, 1.0f);
208 reg.registerVar("stereoecho.rbpm",N_("time (bpm)"),"S",N_("Echo in Beats per Minute"),&fslider3, 1.2e+02f, 24.0f, 3.6e+02f, 1.0f);
209209 return 0;
210210 }
211211
231231 b.closeBox();
232232 b.openVerticalBox("");
233233 {
234 b.create_small_rackknob(PARAM("time_l"), _("left time"));
235 b.insertSpacer();
236 }
237 b.closeBox();
238 b.openVerticalBox("");
239 {
240 b.create_small_rackknobr(PARAM("LFO freq"), _("LFO"));
234 b.create_small_rackknob(PARAM("lbpm"), _("left time (bpm)"));
235 b.insertSpacer();
236 }
237 b.closeBox();
238 b.openVerticalBox("");
239 {
240 b.create_small_rackknobr(PARAM("lfobpm"), _("LFO (bpm)"));
241241 b.insertSpacer();
242242 b.create_selector(PARAM("invert"), 0);
243243 b.openFrameBox("");
252252 b.closeBox();
253253 b.openVerticalBox("");
254254 {
255 b.create_small_rackknob(PARAM("time_r"), _("right time"));
255 b.create_small_rackknob(PARAM("rbpm"), _("right time (bpm)"));
256256 b.insertSpacer();
257257 }
258258 b.closeBox();
260260 <property name="visible">True</property>
261261 <property name="can_focus">True</property>
262262 <property name="receives_default">True</property>
263 <property name="use_action_appearance">False</property>
264263 <property name="relief">none</property>
265264 <property name="yalign">0.69999998807907104</property>
266265 <property name="var_id">amp.bass_boost.on_off</property>
325324 <property name="visible">True</property>
326325 <property name="can_focus">True</property>
327326 <property name="receives_default">True</property>
328 <property name="use_action_appearance">False</property>
329327 <property name="relief">none</property>
330328 <property name="yalign">0.69999998807907104</property>
331329 <property name="var_id">con.on_off</property>
390388 <property name="visible">True</property>
391389 <property name="can_focus">True</property>
392390 <property name="receives_default">True</property>
393 <property name="use_action_appearance">False</property>
394391 <property name="relief">none</property>
395392 <property name="yalign">0.69999998807907104</property>
396393 <property name="var_id">amp.feed_on_off</property>
550547 <property name="visible">True</property>
551548 <property name="can_focus">False</property>
552549 <property name="receives_default">True</property>
553 <property name="use_action_appearance">False</property>
554550 </object>
555551 </child>
556552 </object>
723719 <child>
724720 <placeholder/>
725721 </child>
722 <child>
723 <placeholder/>
724 </child>
725 <child>
726 <placeholder/>
727 </child>
728 <child>
729 <placeholder/>
730 </child>
731 <child>
732 <placeholder/>
733 </child>
734 <child>
735 <placeholder/>
736 </child>
737 <child>
738 <placeholder/>
739 </child>
740 <child>
741 <placeholder/>
742 </child>
743 <child>
744 <placeholder/>
745 </child>
746 <child>
747 <placeholder/>
748 </child>
749 <child>
750 <placeholder/>
751 </child>
752 <child>
753 <placeholder/>
754 </child>
755 <child>
756 <placeholder/>
757 </child>
758 <child>
759 <placeholder/>
760 </child>
761 <child>
762 <placeholder/>
763 </child>
764 <child>
765 <placeholder/>
766 </child>
767 <child>
768 <placeholder/>
769 </child>
770 <child>
771 <placeholder/>
772 </child>
773 <child>
774 <placeholder/>
775 </child>
726776 </object>
727777 </child>
728778 </object>
827877 </child>
828878 </object>
829879 </child>
880 </object>
881 <object class="GtkListStore" id="bank_combo_liststore">
882 <columns>
883 <!-- column-name gchararray1 -->
884 <column type="gchararray"/>
885 </columns>
886 </object>
887 <object class="GtkListStore" id="bank_liststore">
888 <columns>
889 <!-- column-name gchararray1 -->
890 <column type="gchararray"/>
891 <!-- column-name GdkPixbuf1 -->
892 <column type="GdkPixbuf"/>
893 <!-- column-name GdkPixbuf2 -->
894 <column type="GdkPixbuf"/>
895 <!-- column-name GdkPixbuf3 -->
896 <column type="GdkPixbuf"/>
897 <!-- column-name gint1 -->
898 <column type="gint"/>
899 </columns>
900 </object>
901 <object class="GtkListStore" id="target_liststore">
902 <columns>
903 <!-- column-name gchararray1 -->
904 <column type="gchararray"/>
905 </columns>
830906 </object>
831907 <object class="GtkWindow" id="MainWindow">
832908 <property name="can_focus">False</property>
859935 <property name="visible">True</property>
860936 <property name="can_focus">True</property>
861937 <property name="receives_default">True</property>
862 <property name="use_action_appearance">False</property>
863938 <child>
864939 <object class="GtkLabel" id="label5:barbuttonlabel">
865940 <property name="visible">True</property>
883958 <property name="visible">True</property>
884959 <property name="can_focus">True</property>
885960 <property name="receives_default">True</property>
886 <property name="use_action_appearance">False</property>
887961 <child>
888962 <object class="GtkLabel" id="label6:barbuttonlabel">
889963 <property name="visible">True</property>
907981 <property name="visible">True</property>
908982 <property name="can_focus">True</property>
909983 <property name="receives_default">True</property>
910 <property name="use_action_appearance">False</property>
911984 <child>
912985 <object class="GtkLabel" id="label4:barbuttonlabel">
913986 <property name="visible">True</property>
9311004 <property name="visible">True</property>
9321005 <property name="can_focus">True</property>
9331006 <property name="receives_default">True</property>
934 <property name="use_action_appearance">False</property>
9351007 <child>
9361008 <object class="GtkLabel" id="label1:barbuttonlabel">
9371009 <property name="visible">True</property>
9551027 <property name="visible">True</property>
9561028 <property name="can_focus">True</property>
9571029 <property name="receives_default">True</property>
958 <property name="use_action_appearance">False</property>
9591030 <child>
9601031 <object class="GtkLabel" id="label7:barbuttonlabel">
9611032 <property name="visible">True</property>
9791050 <property name="visible">True</property>
9801051 <property name="can_focus">True</property>
9811052 <property name="receives_default">True</property>
982 <property name="use_action_appearance">False</property>
9831053 <child>
9841054 <object class="GtkImage" id="image2">
9851055 <property name="height_request">10</property>
10001070 <property name="visible">True</property>
10011071 <property name="can_focus">True</property>
10021072 <property name="receives_default">True</property>
1003 <property name="use_action_appearance">False</property>
10041073 <child>
10051074 <object class="GtkImage" id="image1">
10061075 <property name="height_request">10</property>
10211090 <property name="visible">True</property>
10221091 <property name="can_focus">True</property>
10231092 <property name="receives_default">True</property>
1024 <property name="use_action_appearance">False</property>
10251093 <child>
10261094 <object class="GtkLabel" id="label3:barbuttonlabel">
10271095 <property name="visible">True</property>
11401208 <property name="visible">True</property>
11411209 <property name="can_focus">True</property>
11421210 <property name="receives_default">True</property>
1143 <property name="use_action_appearance">False</property>
11441211 <child>
11451212 <object class="GtkLabel" id="label6:rack_slider">
11461213 <property name="visible">True</property>
11471214 <property name="can_focus">False</property>
1148 <property name="label" translatable="no">▶</property>
1215 <property name="label">▶</property>
11491216 </object>
11501217 </child>
11511218 </object>
12151282 <property name="visible">True</property>
12161283 <property name="can_focus">True</property>
12171284 <property name="receives_default">True</property>
1218 <property name="use_action_appearance">False</property>
12191285 <property name="relief">none</property>
12201286 <property name="var_id">noise_gate.on_off</property>
12211287 <property name="base_name">switchit</property>
12981364 <property name="visible">True</property>
12991365 <property name="can_focus">True</property>
13001366 <property name="receives_default">True</property>
1301 <property name="use_action_appearance">False</property>
13021367 <property name="relief">none</property>
13031368 <property name="var_id">shaper.on_off</property>
13041369 <property name="base_name">switchit</property>
13811446 <property name="visible">True</property>
13821447 <property name="can_focus">True</property>
13831448 <property name="receives_default">True</property>
1384 <property name="use_action_appearance">False</property>
13851449 <property name="relief">none</property>
13861450 <property name="var_id">amp.on_off</property>
13871451 <property name="base_name">switchit</property>
14641528 <property name="visible">True</property>
14651529 <property name="can_focus">True</property>
14661530 <property name="receives_default">True</property>
1467 <property name="use_action_appearance">False</property>
14681531 <property name="relief">none</property>
14691532 <property name="var_id">amp.clip.on_off</property>
14701533 <property name="base_name">switchit</property>
15271590 <property name="visible">True</property>
15281591 <property name="can_focus">True</property>
15291592 <property name="receives_default">True</property>
1530 <property name="use_action_appearance">False</property>
15311593 <child>
15321594 <object class="GtkLabel" id="label7:rack_slider">
15331595 <property name="visible">True</property>
15341596 <property name="can_focus">False</property>
1535 <property name="label" translatable="no">▼</property>
1597 <property name="label">▼</property>
15361598 </object>
15371599 </child>
15381600 </object>
16111673 <property name="visible">True</property>
16121674 <property name="can_focus">True</property>
16131675 <property name="receives_default">True</property>
1614 <property name="use_action_appearance">False</property>
16151676 <property name="relief">none</property>
16161677 <property name="var_id">ui.racktuner</property>
16171678 <property name="base_name">switchit</property>
16361697 <property name="sensitive">False</property>
16371698 <property name="can_focus">True</property>
16381699 <property name="receives_default">True</property>
1639 <property name="use_action_appearance">False</property>
16401700 </object>
16411701 <packing>
16421702 <property name="expand">False</property>
17361796 <property name="position">2</property>
17371797 </packing>
17381798 </child>
1799 <child>
1800 <object class="GxSelector" id="tuner_temperament">
1801 <property name="visible">True</property>
1802 <property name="can_focus">True</property>
1803 <property name="receives_default">True</property>
1804 <property name="var_id">racktuner.temperament</property>
1805 </object>
1806 <packing>
1807 <property name="expand">True</property>
1808 <property name="fill">True</property>
1809 <property name="position">3</property>
1810 </packing>
1811 </child>
17391812 </object>
17401813 <packing>
17411814 <property name="expand">False</property>
17681841 <property name="sensitive">False</property>
17691842 <property name="can_focus">True</property>
17701843 <property name="receives_default">True</property>
1771 <property name="use_action_appearance">False</property>
17721844 </object>
17731845 </child>
17741846 </object>
18131885 <property name="visible">True</property>
18141886 <property name="can_focus">True</property>
18151887 <property name="receives_default">True</property>
1816 <property name="use_action_appearance">False</property>
18171888 <property name="relief">none</property>
18181889 <property name="var_id">midi_out.on_off</property>
18191890 <property name="base_name">minitoggle</property>
18431914 <property name="sensitive">False</property>
18441915 <property name="can_focus">True</property>
18451916 <property name="receives_default">True</property>
1846 <property name="use_action_appearance">False</property>
18471917 </object>
18481918 </child>
18491919 </object>
18871957 <property name="visible">True</property>
18881958 <property name="can_focus">True</property>
18891959 <property name="receives_default">True</property>
1890 <property name="use_action_appearance">False</property>
18911960 <child>
18921961 <object class="GtkLabel" id="label12">
18931962 <property name="visible">True</property>
19191988 <property name="sensitive">False</property>
19201989 <property name="can_focus">True</property>
19211990 <property name="receives_default">True</property>
1922 <property name="use_action_appearance">False</property>
19231991 </object>
19241992 </child>
19251993 </object>
19512019 <property name="visible">True</property>
19522020 <property name="can_focus">True</property>
19532021 <property name="receives_default">True</property>
1954 <property name="use_action_appearance">False</property>
19552022 <child>
19562023 <object class="GtkLabel" id="label:rack_slider">
19572024 <property name="visible">True</property>
19582025 <property name="can_focus">False</property>
1959 <property name="label" translatable="no">▶</property>
2026 <property name="label">▶</property>
19602027 </object>
19612028 </child>
19622029 </object>
20212088 <property name="visible">True</property>
20222089 <property name="can_focus">True</property>
20232090 <property name="receives_default">True</property>
2024 <property name="use_action_appearance">False</property>
20252091 <property name="relief">none</property>
20262092 <property name="var_id">midi_out.on_off</property>
20272093 <property name="base_name">switchit</property>
20462112 <property name="sensitive">False</property>
20472113 <property name="can_focus">True</property>
20482114 <property name="receives_default">True</property>
2049 <property name="use_action_appearance">False</property>
20502115 </object>
20512116 <packing>
20522117 <property name="expand">False</property>
20962161 <property name="visible">True</property>
20972162 <property name="can_focus">True</property>
20982163 <property name="receives_default">True</property>
2099 <property name="use_action_appearance">False</property>
21002164 <property name="relief">none</property>
21012165 <property name="var_id">midi_out.channel_2.on_off</property>
21022166 <property name="base_name">switch</property>
21112175 <property name="visible">True</property>
21122176 <property name="can_focus">True</property>
21132177 <property name="receives_default">True</property>
2114 <property name="use_action_appearance">False</property>
21152178 <property name="relief">none</property>
21162179 <property name="var_id">midi_out.channel_3.on_off</property>
21172180 <property name="base_name">switch</property>
21752238 <property name="visible">True</property>
21762239 <property name="can_focus">True</property>
21772240 <property name="receives_default">True</property>
2178 <property name="use_action_appearance">False</property>
21792241 <property name="relief">none</property>
21802242 <property name="var_id">midi_out.midistat1</property>
21812243 <property name="base_name">led</property>
21902252 <property name="visible">True</property>
21912253 <property name="can_focus">True</property>
21922254 <property name="receives_default">True</property>
2193 <property name="use_action_appearance">False</property>
21942255 <property name="relief">none</property>
21952256 <property name="var_id">midi_out.midistat2</property>
21962257 <property name="base_name">led</property>
22072268 <property name="visible">True</property>
22082269 <property name="can_focus">True</property>
22092270 <property name="receives_default">True</property>
2210 <property name="use_action_appearance">False</property>
22112271 <property name="relief">none</property>
22122272 <property name="var_id">midi_out.midistat3</property>
22132273 <property name="base_name">led</property>
22242284 <property name="visible">True</property>
22252285 <property name="can_focus">True</property>
22262286 <property name="receives_default">True</property>
2227 <property name="use_action_appearance">False</property>
22282287 <property name="relief">none</property>
22292288 <property name="var_id">midi_out.midistat</property>
22302289 <property name="base_name">led</property>
22392298 <child>
22402299 <placeholder/>
22412300 </child>
2301 <child>
2302 <placeholder/>
2303 </child>
22422304 </object>
22432305 <packing>
22442306 <property name="expand">False</property>
24422504 <property name="visible">True</property>
24432505 <property name="can_focus">True</property>
24442506 <property name="receives_default">True</property>
2445 <property name="use_action_appearance">False</property>
24462507 <property name="relief">none</property>
24472508 <property name="var_id">midi_out.channel_1.autogain</property>
24482509 <property name="base_name">minitoggle</property>
25562617 <property name="visible">True</property>
25572618 <property name="can_focus">True</property>
25582619 <property name="receives_default">True</property>
2559 <property name="use_action_appearance">False</property>
25602620 <property name="relief">none</property>
25612621 <property name="var_id">midi_out.channel_1.auto_pitch</property>
25622622 <property name="base_name">minitoggle</property>
27802840 <property name="visible">True</property>
27812841 <property name="can_focus">True</property>
27822842 <property name="receives_default">True</property>
2783 <property name="use_action_appearance">False</property>
27842843 <property name="relief">none</property>
27852844 <property name="var_id">midi_out.channel_2.autogain</property>
27862845 <property name="base_name">minitoggle</property>
28942953 <property name="visible">True</property>
28952954 <property name="can_focus">True</property>
28962955 <property name="receives_default">True</property>
2897 <property name="use_action_appearance">False</property>
28982956 <property name="relief">none</property>
28992957 <property name="var_id">midi_out.channel_2.auto_pitch</property>
29002958 <property name="base_name">minitoggle</property>
31183176 <property name="visible">True</property>
31193177 <property name="can_focus">True</property>
31203178 <property name="receives_default">True</property>
3121 <property name="use_action_appearance">False</property>
31223179 <property name="relief">none</property>
31233180 <property name="var_id">midi_out.channel_3.autogain</property>
31243181 <property name="base_name">minitoggle</property>
32323289 <property name="visible">True</property>
32333290 <property name="can_focus">True</property>
32343291 <property name="receives_default">True</property>
3235 <property name="use_action_appearance">False</property>
32363292 <property name="relief">none</property>
32373293 <property name="var_id">midi_out.channel_3.auto_pitch</property>
32383294 <property name="base_name">minitoggle</property>
33003356 </child>
33013357 <child>
33023358 <object class="GtkRadioButton" id="channel1_button">
3303 <property name="label" translatable="no">1</property>
3359 <property name="label">1</property>
33043360 <property name="visible">True</property>
33053361 <property name="can_focus">True</property>
33063362 <property name="receives_default">False</property>
3307 <property name="use_action_appearance">False</property>
33083363 <property name="active">True</property>
33093364 <property name="draw_indicator">True</property>
33103365 </object>
33163371 </child>
33173372 <child>
33183373 <object class="GtkRadioButton" id="channel2_button">
3319 <property name="label" translatable="no">2</property>
3374 <property name="label">2</property>
33203375 <property name="visible">True</property>
33213376 <property name="can_focus">True</property>
33223377 <property name="receives_default">False</property>
3323 <property name="use_action_appearance">False</property>
33243378 <property name="draw_indicator">True</property>
33253379 <property name="group">channel1_button</property>
33263380 </object>
33323386 </child>
33333387 <child>
33343388 <object class="GtkRadioButton" id="channel3_button">
3335 <property name="label" translatable="no">3</property>
3389 <property name="label">3</property>
33363390 <property name="visible">True</property>
33373391 <property name="can_focus">True</property>
33383392 <property name="receives_default">False</property>
3339 <property name="use_action_appearance">False</property>
33403393 <property name="draw_indicator">True</property>
33413394 <property name="group">channel1_button</property>
33423395 </object>
35873640 <property name="sensitive">False</property>
35883641 <property name="can_focus">True</property>
35893642 <property name="receives_default">True</property>
3590 <property name="use_action_appearance">False</property>
35913643 </object>
35923644 </child>
35933645 </object>
36183670 <property name="visible">True</property>
36193671 <property name="can_focus">True</property>
36203672 <property name="receives_default">True</property>
3621 <property name="use_action_appearance">False</property>
36223673 <child>
36233674 <object class="GtkLabel" id="label8:rack_slider">
36243675 <property name="visible">True</property>
36253676 <property name="can_focus">False</property>
3626 <property name="label" translatable="no">▼</property>
3677 <property name="label">▼</property>
36273678 </object>
36283679 </child>
36293680 </object>
36413692 <property name="visible">True</property>
36423693 <property name="can_focus">True</property>
36433694 <property name="receives_default">True</property>
3644 <property name="use_action_appearance">False</property>
36453695 <child>
36463696 <object class="GtkLabel" id="label8">
36473697 <property name="visible">True</property>
38423892 <property name="visible">True</property>
38433893 <property name="can_focus">True</property>
38443894 <property name="receives_default">True</property>
3845 <property name="use_action_appearance">False</property>
38463895 </object>
38473896 <packing>
38483897 <property name="expand">False</property>
38563905 <property name="visible">True</property>
38573906 <property name="can_focus">True</property>
38583907 <property name="receives_default">True</property>
3859 <property name="use_action_appearance">False</property>
38603908 </object>
38613909 <packing>
38623910 <property name="expand">False</property>
38703918 <property name="visible">True</property>
38713919 <property name="can_focus">True</property>
38723920 <property name="receives_default">True</property>
3873 <property name="use_action_appearance">False</property>
38743921 </object>
38753922 <packing>
38763923 <property name="expand">False</property>
38843931 <property name="visible">True</property>
38853932 <property name="can_focus">True</property>
38863933 <property name="receives_default">True</property>
3887 <property name="use_action_appearance">False</property>
38883934 </object>
38893935 <packing>
38903936 <property name="expand">False</property>
41734219 <property name="visible">True</property>
41744220 <property name="can_focus">True</property>
41754221 <property name="receives_default">True</property>
4176 <property name="use_action_appearance">False</property>
41774222 <child>
41784223 <object class="GtkLabel" id="label2:barbuttonlabel">
41794224 <property name="visible">True</property>
42954340 </object>
42964341 </child>
42974342 </object>
4298 <object class="GtkListStore" id="bank_combo_liststore">
4299 <columns>
4300 <!-- column-name gchararray1 -->
4301 <column type="gchararray"/>
4302 </columns>
4303 </object>
4304 <object class="GtkListStore" id="bank_liststore">
4305 <columns>
4306 <!-- column-name gchararray1 -->
4307 <column type="gchararray"/>
4308 <!-- column-name GdkPixbuf1 -->
4309 <column type="GdkPixbuf"/>
4310 <!-- column-name GdkPixbuf2 -->
4311 <column type="GdkPixbuf"/>
4312 <!-- column-name GdkPixbuf3 -->
4313 <column type="GdkPixbuf"/>
4314 <!-- column-name gint1 -->
4315 <column type="gint"/>
4316 </columns>
4317 </object>
4318 <object class="GtkListStore" id="target_liststore">
4319 <columns>
4320 <!-- column-name gchararray1 -->
4321 <column type="gchararray"/>
4322 </columns>
4323 </object>
43244343 </interface>
2121 <property name="can_focus">False</property>
2222 <property name="layout_style">end</property>
2323 <child>
24 <object class="GtkButton" id="button3">
25 <property name="label">gtk-delete</property>
24 <object class="GtkButton" id="button6">
25 <property name="label">gtk-help</property>
2626 <property name="visible">True</property>
2727 <property name="can_focus">True</property>
2828 <property name="receives_default">True</property>
29 <property name="use_action_appearance">False</property>
3029 <property name="use_stock">True</property>
3130 </object>
3231 <packing>
3635 </packing>
3736 </child>
3837 <child>
39 <object class="GtkButton" id="button2">
40 <property name="label">gtk-cancel</property>
41 <property name="visible">True</property>
42 <property name="can_focus">True</property>
43 <property name="can_default">True</property>
38 <object class="GtkButton" id="button3">
39 <property name="label">gtk-delete</property>
40 <property name="visible">True</property>
41 <property name="can_focus">True</property>
4442 <property name="receives_default">True</property>
45 <property name="use_action_appearance">False</property>
4643 <property name="use_stock">True</property>
4744 </object>
4845 <packing>
5249 </packing>
5350 </child>
5451 <child>
55 <object class="GtkButton" id="button1">
56 <property name="label">gtk-ok</property>
52 <object class="GtkButton" id="button2">
53 <property name="label">gtk-cancel</property>
5754 <property name="visible">True</property>
5855 <property name="can_focus">True</property>
5956 <property name="can_default">True</property>
60 <property name="has_default">True</property>
6157 <property name="receives_default">True</property>
62 <property name="use_action_appearance">False</property>
6358 <property name="use_stock">True</property>
6459 </object>
6560 <packing>
6661 <property name="expand">False</property>
6762 <property name="fill">False</property>
6863 <property name="position">2</property>
64 </packing>
65 </child>
66 <child>
67 <object class="GtkButton" id="button1">
68 <property name="label">gtk-ok</property>
69 <property name="visible">True</property>
70 <property name="can_focus">True</property>
71 <property name="can_default">True</property>
72 <property name="has_default">True</property>
73 <property name="receives_default">True</property>
74 <property name="use_stock">True</property>
75 </object>
76 <packing>
77 <property name="expand">False</property>
78 <property name="fill">False</property>
79 <property name="position">3</property>
6980 </packing>
7081 </child>
7182 </object>
218229 <packing>
219230 <property name="left_attach">1</property>
220231 <property name="right_attach">2</property>
221 <property name="x_options"></property>
232 <property name="x_options"/>
222233 </packing>
223234 </child>
224235 <child>
246257 <property name="visible">True</property>
247258 <property name="can_focus">True</property>
248259 <property name="receives_default">False</property>
249 <property name="use_action_appearance">False</property>
250260 <property name="draw_indicator">True</property>
251261 </object>
252262 <packing>
296306 </object>
297307 </child>
298308 <action-widgets>
309 <action-widget response="-11">button6</action-widget>
299310 <action-widget response="1">button3</action-widget>
300311 <action-widget response="-6">button2</action-widget>
301312 <action-widget response="-5">button1</action-widget>
302313 </action-widgets>
314 </object>
315 <object class="GtkImage" id="image1">
316 <property name="visible">True</property>
317 <property name="can_focus">False</property>
318 <property name="stock">gtk-delete</property>
319 </object>
320 <object class="GtkListStore" id="liststore1">
321 <columns>
322 <!-- column-name Midi -->
323 <column type="gint"/>
324 <!-- column-name Midi1 -->
325 <column type="gchararray"/>
326 <!-- column-name Group -->
327 <column type="gchararray"/>
328 <!-- column-name Parameter -->
329 <column type="gchararray"/>
330 <!-- column-name Type -->
331 <column type="gchararray"/>
332 <!-- column-name lower -->
333 <column type="gchararray"/>
334 <!-- column-name upper -->
335 <column type="gchararray"/>
336 <!-- column-name id -->
337 <column type="gchararray"/>
338 </columns>
303339 </object>
304340 <object class="GtkDialog" id="MidiControllerTable">
305341 <property name="can_focus">False</property>
324360 <property name="visible">True</property>
325361 <property name="can_focus">True</property>
326362 <property name="receives_default">True</property>
327 <property name="use_action_appearance">False</property>
328363 <property name="image">image1</property>
329364 <property name="use_underline">True</property>
330365 </object>
340375 <property name="visible">True</property>
341376 <property name="can_focus">True</property>
342377 <property name="receives_default">True</property>
343 <property name="use_action_appearance">False</property>
344378 <property name="use_stock">True</property>
345379 </object>
346380 <packing>
522556 controller settings.
523557 MIDI controller settings are always saved and loaded with the
524558 main session.</property>
525 <property name="use_action_appearance">False</property>
526559 <property name="use_underline">True</property>
527560 <property name="draw_indicator">True</property>
528561 </object>
549582 <action-widget response="-7">button5</action-widget>
550583 </action-widgets>
551584 </object>
552 <object class="GtkImage" id="image1">
553 <property name="visible">True</property>
554 <property name="can_focus">False</property>
555 <property name="stock">gtk-delete</property>
556 </object>
557 <object class="GtkListStore" id="liststore1">
558 <columns>
559 <!-- column-name Midi -->
560 <column type="gint"/>
561 <!-- column-name Midi1 -->
562 <column type="gchararray"/>
563 <!-- column-name Group -->
564 <column type="gchararray"/>
565 <!-- column-name Parameter -->
566 <column type="gchararray"/>
567 <!-- column-name Type -->
568 <column type="gchararray"/>
569 <!-- column-name lower -->
570 <column type="gchararray"/>
571 <!-- column-name upper -->
572 <column type="gchararray"/>
573 <!-- column-name id -->
574 <column type="gchararray"/>
575 </columns>
576 </object>
577585 </interface>
3838 static double always_inline B2N(int ta, double beat) {
3939 double beatta = beat;
4040 switch(ta) {
41 case(0):
41 case(0):
42 beatta *=3.0;
4243 break;
4344 case(1):
44 beatta *=3.0;
45 beatta *=2.0;
4546 break;
4647 case(2):
47 beatta *=2.0;
48 beatta *=1.3333;
4849 break;
4950 case(3):
50 beatta *=1.3333;
51 beatta *=1.5;
5152 break;
5253 case(4):
53 beatta *=1.5;
54 beatta =beat;
5455 break;
5556 case(5):
56 beatta =beat;
57 beatta *=0.6666;
5758 break;
5859 case(6):
59 beatta *=0.6666;
60 beatta *=0.75;
6061 break;
6162 case(7):
62 beatta *=0.75;
63 beatta *=0.5;
6364 break;
6465 case(8):
65 beatta *=0.5;
66 beatta *=0.333;
6667 break;
6768 case(9):
68 beatta *=0.333;
69 beatta *=0.45;
6970 break;
7071 case(10):
71 beatta *=0.45;
72 beatta *=0.25;
7273 break;
7374 case(11):
74 beatta *=0.25;
75 beatta *=0.1666;
7576 break;
7677 case(12):
77 beatta *=0.1666;
78 beatta *=0.1875;
7879 break;
7980 case(13):
80 beatta *=0.1875;
81 beatta *=0.125;
8182 break;
8283 case(14):
83 beatta *=0.125;
84 beatta *=0.083334;
8485 break;
8586 case(15):
86 beatta *=0.083334;
87 beatta *=0.09375;
8788 break;
8889 case(16):
89 beatta *=0.09375;
90 beatta *=0.0625;
9091 break;
9192 case(17):
92 beatta *=0.0625;
93 break;
94 case(18):
9593 beatta *=0.041666;
9694 break;
9795 default:
384384 if (pl->get_pdef()->register_params) {
385385 pmap.set_replace_mode(true);
386386 gx_engine::ParamRegImpl preg(&pmap);
387 // FIXME we need to register on_off parameters new when ui is changed
388 bool state = pl->get_on_off();
389 pluginlist.rescueParameter(pl, pmap);
390 pl->set_on_off(state);
387391 preg.plugin = pl->get_pdef();
388392 pl->get_pdef()->register_params(preg);
389393 pmap.set_replace_mode(false);
644644 if (!self.engine.mono_chain.is_stopped()) {
645645 self.check_overload();
646646 }
647 self.transport_state = jack_transport_query (self.client, &self.current);
647648 // gx_head DSP computing
648649 self.engine.mono_chain.process(
649650 nframes,
653654 // midi input processing
654655 if (self.ports.midi_input.port) {
655656 self.engine.controller_map.compute_midi_in(
656 jack_port_get_buffer(self.ports.midi_input.port, nframes));
657 }
657 jack_port_get_buffer(self.ports.midi_input.port, nframes), arg);
658 }
659 // jack transport support
660 if ( self.transport_state != self.old_transport_state) {
661 self.engine.controller_map.process_trans(self.transport_state);
662 self.old_transport_state = self.transport_state;
663 }
658664 }
659665 gx_system::measure_pause();
660666 self.engine.mono_chain.post_rt_finished();
5959 {11, "Expression"},
6060 {12, "Effect Control 1"},
6161 {13, "Effect Control 2"},
62
63 {22, "Midi Beat Clock"},
64 {23, "Clock start/stop"},
65 {24, "Jack Transport"},
6266
6367 {32, "Bank Select LSB"},
6468
276280 }
277281 }
278282 } else {
283 //fprintf(stderr,"%s \n",param->id().c_str());
284 //fprintf(stderr,"%f \n",(127.*log10f(double(n+1.)))/2.1072);
285 // fprintf(stderr,"%f \n",double(n * double(double(n+1.)/128)));
286
279287 ret = param->midi_set(n, 127, _lower, _upper);
280288 }
281289 return ret;
282290 }
283291
292 bool MidiController::set_trans(int n, int last_value) {
293 bool ret = false;
294 if (strcmp(param->id().c_str(), "engine.mute")==0) {
295 if ( n == 0) n = 127;
296 else n = 0;
297 }
298 ret = param->midi_set(n, 127, _lower, _upper);
299 return ret;
300 }
301
302 bool MidiController::set_bpm(int n, int last_value) {
303 bool ret = false;
304 if (toggle) {
305 bool s_o = (2*last_value > 360);
306 bool s_n = (2*n > 360);
307 if (!s_o && s_n) {
308 if (param->on_off_value()) {
309 ret = param->midi_set_bpm(0, 360, _lower, _upper);
310 } else {
311 ret = param->midi_set_bpm(360, 360, _lower, _upper);
312 }
313 }
314 } else {
315 ret = param->midi_set_bpm(n, 360, _lower, _upper);
316 }
317 return ret;
318 }
284319
285320 /****************************************************************
286321 ** class ControllerArray
350385 return false;
351386 }
352387
388
389 /****************************************************************
390 ** class MidiClockToBpm
391 */
392
393
394 MidiClockToBpm::MidiClockToBpm()
395 : time1(0),
396 time_diff(0),
397 collect(0),
398 collect_(0),
399 bpm(0),
400 bpm_new(0),
401 ret(false) {}
402
403 unsigned int MidiClockToBpm::rounded(float f) {
404 if (f >= 0x1.0p23) return (unsigned int) f;
405 return (unsigned int) (f + 0.49999997f);
406 }
407
408 bool MidiClockToBpm::time_to_bpm(double time, unsigned int* bpm_) {
409 ret = false;
410 // if time drift to far, reset bpm detection.
411 if ((time-time1)> (1.05*time_diff) || (time-time1)*1.05 < (time_diff)) {
412 bpm = 0;
413 collect = 0;
414 collect_ = 0;
415 } else {
416 bpm_new = ((1000000000. / (time-time1) / 24) * 60);
417 bpm += bpm_new;
418 collect++;
419
420 if (collect >= (bpm_new*bpm_new*0.0002)+1) {
421 bpm = (bpm/collect);
422 if (collect_>=2) {
423 (*bpm_) = rounded(min(360.,max(24.,bpm)));
424 collect_ = 0;
425 ret = true;
426 }
427 collect_++;
428 collect = 1;
429 }
430 }
431 time_diff = time-time1;
432 time1 = time;
433 return ret;
434 }
435
353436 /****************************************************************
354437 ** class MidiControllerList
355438 */
359442 last_midi_control_value(),
360443 last_midi_control(-2),
361444 program_change(-1),
445 time0(0),
446 bpm_(9),
447 mp(),
362448 pgm_chg(),
363449 changed(),
364450 new_program(),
470556 }
471557 }
472558 MidiControllerList::set_last_midi_control_value(ctr, val);
559 }
560
561 void MidiControllerList::set_bpm_val(unsigned int val) {
562 if (get_config_mode()) {
563 last_midi_control = 22;
564 } else {
565 midi_controller_list& ctr_list = map[22];
566 for (midi_controller_list::iterator i = ctr_list.begin(); i != ctr_list.end(); ++i) {
567 i->set_bpm(val, get_last_midi_control_value(22));
568 }
569 }
570 MidiControllerList::set_last_midi_control_value(22, val);
473571 }
474572
475573 void MidiControllerList::set_controller_array(const ControllerArray& m) {
512610 }
513611 }
514612
613 void MidiControllerList::process_trans(int transport_state) {
614 unsigned int val = 0;
615 switch (transport_state) {
616 case JackTransportStopped:
617 val = 0;
618 break;
619 case JackTransportRolling:
620 val = 127;
621 break;
622 case JackTransportStarting:
623 val = 127;
624 break;
625 default:
626 return;
627 }
628 if (get_config_mode()) {
629 last_midi_control = 24;
630 } else {
631 midi_controller_list& ctr_list = map[24];
632 for (midi_controller_list::iterator i = ctr_list.begin(); i != ctr_list.end(); ++i) {
633 i->set_trans(val, get_last_midi_control_value(24));
634 }
635 }
636 MidiControllerList::set_last_midi_control_value(24, val);
637 }
638
515639 // ----- jack process callback for the midi input
516 void MidiControllerList::compute_midi_in(void* midi_input_port_buf) {
640 void MidiControllerList::compute_midi_in(void* midi_input_port_buf, void *arg) {
517641 jack_midi_event_t in_event;
518642 jack_nframes_t event_count = jack_midi_get_event_count(midi_input_port_buf);
519643 unsigned int i;
524648 pgm_chg();
525649 } else if ((in_event.buffer[0] & 0xf0) == 0xb0) { // controller
526650 set_ctr_val(in_event.buffer[1], in_event.buffer[2]);
651 } else if ((in_event.buffer[0] ) > 0xf0) { // midi clock
652 if ((in_event.buffer[0] ) == 0xf8) { // midi beat clock
653 clock_gettime(CLOCK_MONOTONIC, &ts1);
654 gx_jack::GxJack& jack = *static_cast<gx_jack::GxJack*>(arg);
655 static unsigned int sr = jack.get_jack_sr();
656 time0 = (ts1.tv_sec*1000000000.0)+(ts1.tv_nsec)+
657 (1000000000.0/(double)(sr/(double)in_event.time));
658 if (mp.time_to_bpm(time0, &bpm_)) {
659 set_bpm_val(bpm_);
660 }
661 } else if ((in_event.buffer[0] ) == 0xfa) { // midi clock start
662 set_ctr_val(23, 127);
663 } else if ((in_event.buffer[0] ) == 0xfb) { // midi clock continue
664 // set_ctr_val(23, 127);
665 } else if ((in_event.buffer[0] ) == 0xfc) { // midi clock stop
666 set_ctr_val(23, 0);
667 } else if ((in_event.buffer[0] ) == 0xf2) { // midi clock position
668 // not implemented
669 // set_ctr_val(24,(in_event.buffer[2]<<7) | in_event.buffer[1]);
670 }
527671 }
528672 }
529673 }
668812 return false;
669813 }
670814
815 bool Parameter::midi_set_bpm(float n, float high, float llimit, float ulimit) {
816 assert(false);
817 return false;
818 }
819
671820 void Parameter::trigger_changed() {
672821 assert(false);
673822 }
8801029 case Continuous:
8811030 assert(n >= 0 && n <= high);
8821031 v = llimit + (n / high) * (ulimit - llimit);
1032 break;
1033 case Switch:
1034 v = (2*n > high ? 1.0 : 0.0);
1035 break;
1036 case Enum:
1037 v = lower + min(n, upper-lower);
1038 break;
1039 default:
1040 assert(false);
1041 return false;
1042 }
1043 if (v != *value) {
1044 *value = v;
1045 return true;
1046 }
1047 return false;
1048 }
1049
1050 bool FloatParameter::midi_set_bpm(float n, float high, float llimit, float ulimit) {
1051 float v;
1052 switch (c_type) {
1053 case Continuous:
1054 assert(n >= 0 && n <= high);
1055 if (high <= ulimit) {
1056 v = max(llimit,min(ulimit,n));
1057 } else {
1058 v = llimit + (n / high) * (ulimit - llimit);
1059 }
8831060 break;
8841061 case Switch:
8851062 v = (2*n > high ? 1.0 : 0.0);
584584 }
585585 }
586586
587 void PluginList::rescueParameter(Plugin *pl, ParamMap& param) {
588 PluginDef *pdef = pl->get_pdef();
589 string s = pdef->id;
590 param.unregister(pl->p_on_off);
591 pl->p_on_off = param.reg_par(s+".on_off",N_("on/off"), (bool*)0, !(pdef->flags & (PGN_GUI|PGN_ALTERNATIVE)));
592 if (!(pdef->load_ui || (pdef->flags & PGN_GUI))) {
593 pl->p_on_off->setSavable(false);
594 }
595 pl->p_on_off->signal_changed_bool().connect(
596 sigc::hide(sigc::mem_fun(seq, &EngineControl::set_rack_changed)));
597 }
598
587599 void PluginList::registerParameter(Plugin *pl, ParamMap& param, ParamRegImpl& preg) {
588600 pl->register_vars(param, seq);
589601 PluginDef *pd = pl->get_pdef();
10201020 return true;
10211021 }
10221022
1023 void LadspaLoader::set_plugins(pluginarray& new_plugins) {
1023 void LadspaLoader::change_plugins(pluginarray& new_plugins) {
10241024 for (pluginarray::iterator i = plugins.begin(); i != plugins.end(); ++i) {
10251025 delete *i;
10261026 }
1027 plugins = new_plugins;
1028 }
1029
1030 void LadspaLoader::set_plugins(pluginarray& new_plugins) {
1031 //for (pluginarray::iterator i = plugins.begin(); i != plugins.end(); ++i) {
1032 //delete *i;
1033 //}
10271034 plugins = new_plugins;
10281035 }
10291036
220220 case RESPONSE_DELETE:
221221 m->machine.midi_deleteParameter(m->param);
222222 break;
223 case GTK_RESPONSE_HELP:
224 static string midiconnecthelp;
225 if (midiconnecthelp.empty()) {
226 midiconnecthelp +=_("\n Guitarix:Midi learn \n");
227 midiconnecthelp +=
228 _(" Just move your midi controller to connect it \n"
229 " with the selected guitarix Controller. \n"
230 " As soon the Midi Controller is detected, \n"
231 " you will see the Controller Number in the \n"
232 " Midi Controller Number field. Press 'OK' to connect it, \n"
233 " or move a other Midi controller. \n"
234 " A exception is the MIDI BEAT CLOCK, \n"
235 " which isn't a Controller itself,\n"
236 " but could be used here to sync BPM controllers \n"
237 " with external devices. \n"
238 " To use it, you must insert '22' as Midi Controller Number \n"
239 " \n"
240 " The same is true for the MIDI CLOCK start/stop function, \n"
241 " which could be used to switch effects on/off. \n"
242 " To use it, you must insert '23' as Midi Controller Number. \n\n"
243 " Also Jack Transport is supported and can be used to control \n"
244 " switch controllers (on/off) by connect then to \n"
245 " Midi Controller Number '24'. \n"
246
247 "");
248
249 }
250
251 gx_gui::gx_message_popup(midiconnecthelp.c_str());
252 return;
253 break;
223254 }
224255 gtk_widget_destroy(m->dialog);
225256 }
358389 if (nctl == -1) {
359390 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), RESPONSE_DELETE, FALSE);
360391 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), GTK_RESPONSE_OK, FALSE);
392 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), GTK_RESPONSE_HELP, TRUE);
361393 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
362394 }
363395 machine.midi_set_config_mode(true, nctl);
264264 sigc::mem_fun(*this, &GxUiRadioMenu::on_changed));
265265 action = act;
266266 }
267 //fprintf(stderr, "%s \n", p->value_id);
267268 }
268269 s.append(postfix);
269270 uimanager->add_ui_from_string(s);
503504 bld->find_widget("tuner_mode", tuner_mode);
504505 bld->find_widget("tuner_reference_pitch", tuner_reference_pitch);
505506 bld->find_widget("tuner_tuning", tuner_tuning);
507 bld->find_widget("tuner_temperament", tuner_temperament);
506508 bld->find_widget("racktuner", racktuner);
507509 bld->find_widget("ampdetail_compress:effect_reset", ampdetail_compress);
508510 bld->find_widget("ampdetail_expand:effect_reset", ampdetail_expand);
17031705 }
17041706 } else {
17051707 assert(c == gx_engine::PluginChange::update || c == gx_engine::PluginChange::update_category);
1708 //if (!pui->plugin->get_box_visible())
1709 bool state = pui->plugin->get_on_off();
17061710 pui->update_rackbox();
1711 pui->plugin->set_on_off(state);
17071712 if (c == gx_engine::PluginChange::update_category) {
17081713 pui->unset_ui_merge_id(uimanager);
17091714 pui->group = add_plugin_category(pui->get_category());
18171822 Glib::ustring actionname = Glib::ustring::compose("Plugin_%1", pui->get_id());
18181823 const char *tp = (pui->get_type() == PLUGIN_TYPE_MONO ? "Mono" : "Stereo");
18191824 pui->set_ui_merge_id(uimanager->add_ui_from_string(Glib::ustring::compose(ui_template, tp, groupname, actionname)));
1825 //fprintf(stderr, "%s : %s : %s \n", tp, group, pui->get_name());
18201826 return actionname;
18211827 }
18221828
20622068 if (mode > 0) {
20632069 tuner.set_display_flat(tuning_tab[mode-1].flat);
20642070 for (int i = 0; i < 6; ++i) {
2065 tuner.push_note(tuning_tab[mode-1].notes[i]);
2071 tuner.push_note(tuning_tab[mode-1].notes[i], 69, 12);
20662072 }
20672073 } else {
20682074 tuner.set_display_flat(false);
20692075 }
2076 }
2077
2078 void MainWindow::setup_tuner_temperament(Gxw::RackTuner& tuner) {
2079 tuner.set_temperament(tuner_temperament->get_value());
2080 set_tuning(tuner);
2081
20702082 }
20712083
20722084 void MainWindow::setup_tuner(Gxw::RackTuner& tuner) {
20842096 sigc::mem_fun(*tuner_reference_pitch, &Gxw::Wheel::get_value)));
20852097 tuner_tuning->signal_value_changed().connect(
20862098 sigc::bind(sigc::mem_fun(*this, &MainWindow::set_tuning), sigc::ref(tuner)));
2099 tuner_temperament->signal_value_changed().connect(
2100 sigc::bind(sigc::mem_fun(*this, &MainWindow::setup_tuner_temperament), sigc::ref(tuner)));
2101
20872102 }
20882103
20892104 bool MainWindow::on_toggle_mute(GdkEventButton* ev) {
28212836 } else {
28222837 gtk_rc_parse(
28232838 (options.get_style_filepath("clear.rc")).c_str());
2839 make_icons();
28242840 }
28252841
28262842 // call some action functions to sync state
117117 {"Augmented Fourths"},{"Slow Motion"},{"Admiral"},{"Buzzard"},{"Face"},{"Four and Twenty"},{"Ostrich"},{"Capo 200"},
118118 {"Balalaika"},{"Cittern One"},{"Cittern Two"},{"Dobro"},{"Lefty"},{"Mandoguitar"},{"Rusty Cage"},{"Hardcore"}, {0}};
119119 pmap.reg_non_midi_enum_par("racktuner.tuning", "Tuning", tuning_labels, (int*)0, false, 0);
120 static const value_pair tuning_temperament[] = {{"12-ET"},{"19-ET"},{"31-ET"}, {0}};
121 pmap.reg_non_midi_enum_par("racktuner.temperament", "Temperament", tuning_temperament, (int*)0, false, 0);
120122 pmap.reg_par_non_preset("racktuner.scale_lim", "Limit", 0, 3.0, 1.0, 10.0, 1.0);
121123 pmap.reg_par_non_preset("ui.tuner_reference_pitch", "?Tuner Reference Pitch", 0, 440, 427, 453, 0.1);
122124 //pmap.reg_par("racktuner.scale_lim", "Limit", &scale_lim, 3.0, 1.0, 10.0, 1.0); FIXME add in detail view?
169169 if (*i == rackbox) {
170170 break;
171171 }
172 display(false,false);
172173 delete rackbox;
173 rackbox = main.add_rackbox(*this, plugin->get_plug_visible(), n, false);
174 rackbox = 0;
175 display(true,false);
176 //rackbox = main.add_rackbox(*this, plugin->get_plug_visible(), n, false);
174177 } else {
175178 delete rackbox;
176179 rackbox = 0;
586586 pluginarray::iterator end() { return plugins.end(); }
587587 pluginarray::iterator find(plugdesc* desc);
588588 void set_plugins(pluginarray& new_plugins);
589 void change_plugins(pluginarray& new_plugins);
589590 void update_instance(PluginDef *pdef, plugdesc *pdesc);
590591 static std::string get_ladspa_filename(unsigned long uid)
591592 { return "ladspa"+gx_system::to_string(uid)+".js"; }
157157
158158 jack_client_t* client;
159159 jack_client_t* client_insert;
160
161 jack_position_t current;
162 jack_transport_state_t transport_state;
163 jack_transport_state_t old_transport_state;
160164
161165 jack_nframes_t get_jack_sr() { return jack_sr; }
162166 jack_nframes_t get_jack_bs() { return jack_bs; }
635635 Gxw::Selector *tuner_mode;
636636 Gxw::Wheel *tuner_reference_pitch;
637637 Gxw::Selector *tuner_tuning;
638 Gxw::Selector *tuner_temperament;
638639 Gxw::RackTuner *racktuner;
639640 Gtk::Button *ampdetail_compress;
640641 Gtk::Button *ampdetail_expand;
719720 void on_engine_state_change(gx_engine::GxEngineState state);
720721 void set_new_skin(const Glib::ustring& skin_name);
721722 void set_tuning(Gxw::RackTuner& tuner);
723 void setup_tuner_temperament(Gxw::RackTuner& tuner);
722724 void setup_tuner(Gxw::RackTuner& tuner);
723725 bool on_toggle_mute(GdkEventButton* ev);
724726 void on_msg_level_changed();
106106 enum ctrl_type { None, Continuous, Switch, Enum };
107107 private:
108108 virtual bool midi_set(float n, float high, float llimit, float ulimit); //RT
109 virtual bool midi_set_bpm(float n, float high, float llimit, float ulimit); //RT
109110 virtual void trigger_changed();
110111 friend class MidiController;
111112 protected:
222223 class ParameterV<float>: public Parameter {
223224 private:
224225 virtual bool midi_set(float n, float high, float llimit, float ulimit); //RT
226 virtual bool midi_set_bpm(float n, float high, float llimit, float ulimit); //RT
225227 virtual void trigger_changed();
226228 protected:
227229 float json_value;
675677 Parameter& getParameter() const { return *param; }
676678 static MidiController *readJSON(gx_system::JsonParser& jp, ParamMap& param);
677679 bool set_midi(int n, int last_value); //RT
680 bool set_bpm(int n, int last_value); //RT
681 bool set_trans(int n, int last_value); //RT
678682 void set(float v, float high) { param->midi_set(v, high, _lower, _upper); }
679683 void trigger_changed() { param->trigger_changed(); }
680684 void writeJSON(gx_system::JsonWriter& jw) const;
686690 **
687691 ** MidiControllerList
688692 **/
693
694
695 class MidiClockToBpm {
696 private:
697 double time1;
698 double time_diff;
699 int collect;
700 int collect_;
701 double bpm;
702 double bpm_new;
703 bool ret;
704
705 public:
706 MidiClockToBpm();
707 ~MidiClockToBpm() {}
708 unsigned int rounded(float f);
709 bool time_to_bpm(double time, unsigned int* bpm_);
710 };
711
689712
690713 class ControllerArray: public vector<midi_controller_list> {
691714 public:
705728 int last_midi_control_value[ControllerArray::array_size]; //RT
706729 int last_midi_control; //RT
707730 volatile gint program_change; //RT
731 timespec ts1;
732 double time0;
733 unsigned int bpm_;
734 MidiClockToBpm mp;
708735 Glib::Dispatcher pgm_chg;
709736 sigc::signal<void> changed;
710737 sigc::signal<void,int> new_program;
721748 int get_current_control() { return last_midi_control; }
722749 void set_current_control(int ctl) { last_midi_control = ctl; }
723750 void set_ctr_val(int ctr, int val); //RT
751 void set_bpm_val(unsigned int val); //RT
724752 void deleteParameter(Parameter& param);
725753 void modifyCurrent(Parameter& param, float lower, float upper, bool toggle);
726754 int param2controller(Parameter& param, const MidiController** p) {
734762 void remove_controlled_parameters(paramlist& plist, const ControllerArray *m);
735763 sigc::signal<void>& signal_changed() { return changed; }
736764 sigc::signal<void,int>& signal_new_program() { return new_program; }
737 void compute_midi_in(void* midi_input_port_buf); //RT
765 void compute_midi_in(void* midi_input_port_buf, void *arg); //RT
766 void process_trans(int transport_state); //RT
738767 void update_from_controller(int ctr);
739768 void update_from_controllers();
740769 sigc::signal<void, int, int>& signal_midi_value_changed() { return midi_value_changed; }
171171 void registerPlugin(Plugin *pl, ParamMap& param, ParameterGroups& groups);
172172 void unregisterGroup(PluginDef *pd, ParameterGroups& groups);
173173 void unregisterParameter(Plugin *pl, ParamMap& param);
174 void rescueParameter(Plugin *pl, ParamMap& param);
174175 void unregisterPlugin(Plugin *pl, ParamMap& param, ParameterGroups& groups);
175176 void registerAllPlugins(ParamMap& param, ParameterGroups& groups);
176177 void ordered_mono_list(list<Plugin*>& mono, int mode);
178178 old_stdout = sys.stdout
179179 capturer = StringIO.StringIO()
180180 sys.stdout = capturer
181 args = [1, self.scale5.get_value()*1e3]
181 args = [1, 1.5*1e3]
182182 c.show_vk0(args)
183183 sys.stdout = old_stdout
184184 output1 = capturer.getvalue().replace('\n','')
185 self.labelvk01.set_text("Ri(%s) Rk(%s) vk0(%s) \nRi(%s) Rk(%s) vk0(%s)" %
186 (self.scale6.get_value(),self.scale5.get_value() ,output1, self.scale7.get_value(),self.scale5.get_value() ,output) )
185 c = Circuit(self.tube.get_active_text(), self.func.get_active_text())
186 self.set_param(c)
187 old_stdout = sys.stdout
188 capturer = StringIO.StringIO()
189 sys.stdout = capturer
190 args = [1, 0.8*1e3]
191 c.show_vk0(args)
192 sys.stdout = old_stdout
193 output2 = capturer.getvalue().replace('\n','')
194 self.labelvk01.set_text("Ri(%s) Rk(%s) vk0(%s) \nRi(%s) Rk(1.5) vk0(%s) Ri(%s) Rk(0.8) vk0(%s)" %
195 (self.scale6.get_value(),self.scale5.get_value() ,output, self.scale7.get_value(), output1, self.scale7.get_value(), output2) )
187196
188197 def on_table_progress(self):
189198 script_dir = sys.path[0]
2323 use_2to3 = True
2424
2525 # used by waf dist and waf build
26 VERSION='0.31.0'
26 VERSION='0.32.1'
2727 APPNAME='guitarix'
2828
2929 good_faust_versions = ['0.9.58','0.9.65']