Imported Upstream version 0.32.1
Ross Gammon
8 years ago
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 | ||
0 | 15 | guitarix2 (0.31.0) unstable; urgency=low |
1 | 16 | * add GxDigitalDelay.LV2 |
2 | 17 | * add GxRoomSimulation.LV2 |
30 | 30 | PROP_DISPLAY_FLAT, |
31 | 31 | PROP_STREAMING, |
32 | 32 | PROP_TIMESTEP, |
33 | PROP_LIMIT_TIMESTEP | |
33 | PROP_LIMIT_TIMESTEP, | |
34 | PROP_TEMPERAMENT | |
34 | 35 | }; |
35 | 36 | |
36 | 37 | enum { |
121 | 122 | "limit-timestep", P_("In-Limit Time Step"), |
122 | 123 | P_("time interval in msec for refreshing the streaming match display"), |
123 | 124 | 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))); | |
124 | 130 | /* new signals */ |
125 | 131 | signals[FREQUENCY_POLL] = |
126 | 132 | g_signal_new(I_("frequency-poll"), |
140 | 146 | G_TYPE_NONE, 1, G_TYPE_BOOLEAN); |
141 | 147 | } |
142 | 148 | |
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♯♯"}; | |
145 | 153 | static const char *octave[] = {"0","1","2","3","4","5"," "}; |
146 | 154 | |
147 | 155 | static void gx_rack_tuner_init (GxRackTuner *tuner) |
154 | 162 | tuner->timestep = 50; |
155 | 163 | tuner->in_limit_timestep = 8; |
156 | 164 | tuner->n_targets = 0; |
165 | tuner->temperament = 0; | |
157 | 166 | // state |
158 | 167 | tuner->pos = 0.0; |
159 | 168 | tuner->in_limit = FALSE; |
166 | 175 | tuner->in_limit_id = 0; |
167 | 176 | tuner->target_oc = 0; |
168 | 177 | tuner->target_note = 0; |
178 | tuner->target_temperament = 12; | |
169 | 179 | tuner->strng = 0; |
170 | 180 | // caculated layout |
171 | 181 | tuner->led_count = 0; |
230 | 240 | { |
231 | 241 | g_assert(GX_IS_RACK_TUNER(tuner)); |
232 | 242 | tuner->display_flat = display_flat; |
243 | if (tuner->temperament == 0) { | |
233 | 244 | if (display_flat) { |
234 | 245 | tuner->note = note_flat; |
235 | 246 | } else { |
236 | 247 | tuner->note = note_sharp; |
248 | } | |
237 | 249 | } |
238 | 250 | g_object_notify(G_OBJECT(tuner), "display_flat"); |
239 | 251 | } |
270 | 282 | return tuner->in_limit_timestep; |
271 | 283 | } |
272 | 284 | |
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 | ||
273 | 312 | void gx_rack_tuner_clear_notes(GxRackTuner *tuner) |
274 | 313 | { |
275 | 314 | g_assert(GX_IS_RACK_TUNER(tuner)); |
276 | 315 | tuner->n_targets = 0; |
277 | 316 | } |
278 | 317 | |
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) | |
280 | 322 | { |
281 | 323 | g_assert(GX_IS_RACK_TUNER(tuner)); |
282 | 324 | if (tuner->n_targets >= RACKTUNER_MAXTARGETS) { |
283 | 325 | return FALSE; |
284 | 326 | } |
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 ; | |
286 | 330 | return TRUE; |
287 | 331 | } |
288 | 332 | |
318 | 362 | case PROP_LIMIT_TIMESTEP: |
319 | 363 | gx_rack_tuner_set_limit_timestep(tuner, g_value_get_int(value)); |
320 | 364 | break; |
365 | case PROP_TEMPERAMENT: | |
366 | gx_rack_tuner_set_temperament(tuner, g_value_get_int(value)); | |
367 | break; | |
321 | 368 | default: |
322 | 369 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
323 | 370 | break; |
350 | 397 | break; |
351 | 398 | case PROP_LIMIT_TIMESTEP: |
352 | 399 | g_value_set_int(value, tuner->in_limit_timestep); |
400 | break; | |
401 | case PROP_TEMPERAMENT: | |
402 | g_value_set_int(value, tuner->temperament); | |
353 | 403 | break; |
354 | 404 | default: |
355 | 405 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
371 | 421 | if (scale) { |
372 | 422 | *scale = fnote - *note; |
373 | 423 | } |
374 | *oc = int(round(fnoter/12)); | |
424 | *oc = int(round(fnoter/tuner->target_temperament)); | |
375 | 425 | int octsz = sizeof(octave) / sizeof(octave[0]); |
376 | 426 | if (*oc < 0 || *oc >= octsz) { |
377 | 427 | *oc = octsz - 1; |
378 | 428 | } |
379 | *note = *note % 12; | |
429 | *note = *note % tuner->target_temperament; | |
380 | 430 | if (*note < 0) { |
381 | *note += 12; | |
431 | *note += tuner->target_temperament; | |
382 | 432 | } |
383 | 433 | } |
384 | 434 | |
385 | 435 | static void gx_rack_tuner_calc(GxRackTuner *tuner) |
386 | 436 | { |
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); | |
388 | 438 | gx_rack_tuner_pitch_to_note(tuner, fvis, &tuner->indicate_oc, &tuner->vis, &tuner->scale_val); |
389 | 439 | if (tuner->n_targets == 0) { |
390 | 440 | return; |
44 | 44 | gint GSEAL (in_limit_timestep); |
45 | 45 | gint GSEAL (n_targets); |
46 | 46 | gint GSEAL (targets)[RACKTUNER_MAXTARGETS]; |
47 | gint GSEAL (temperament); | |
47 | 48 | // state |
48 | 49 | double GSEAL (pos); // led lighted position |
49 | 50 | gboolean GSEAL (in_limit); |
56 | 57 | guint GSEAL (in_limit_id); |
57 | 58 | gint GSEAL (target_oc); |
58 | 59 | gint GSEAL (target_note); |
60 | gint GSEAL (target_temperament); | |
59 | 61 | gint GSEAL (strng); // number of current string (1 == string with highest pitch) |
60 | 62 | // caculated layout |
61 | 63 | gint GSEAL (led_count); |
88 | 90 | void gx_rack_tuner_set_limit_timestep(GxRackTuner *tuner, gint in_limit_timestep); |
89 | 91 | gint gx_rack_tuner_get_limit_timestep(GxRackTuner *tuner); |
90 | 92 | 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); | |
92 | 96 | |
93 | 97 | GtkWidget *gx_rack_tuner_new(void); |
94 | 98 |
39 | 39 | _WRAP_METHOD(int get_timestep(), gx_rack_tuner_get_timestep) |
40 | 40 | _WRAP_METHOD(void set_limit_timestep(int), gx_rack_tuner_set_limit_timestep) |
41 | 41 | _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) | |
42 | 44 | _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) | |
44 | 46 | _WRAP_SIGNAL(void frequency_poll(), "frequency-poll") |
45 | 47 | _WRAP_SIGNAL(void poll_status_changed(bool), "poll-status-changed") |
46 | 48 | _WRAP_PROPERTY(freq, double) |
50 | 52 | _WRAP_PROPERTY(streaming, bool) |
51 | 53 | _WRAP_PROPERTY(timestep, int) |
52 | 54 | _WRAP_PROPERTY(limit_timestep, int) |
55 | _WRAP_PROPERTY(temperament, int) | |
53 | 56 | }; |
54 | 57 | |
55 | 58 | } // namespace Gxw |
326 | 326 | return gx_rack_tuner_get_limit_timestep(gobj()); |
327 | 327 | } |
328 | 328 | |
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 | ||
329 | 339 | void RackTuner::clear_notes() |
330 | 340 | { |
331 | 341 | gx_rack_tuner_clear_notes(gobj()); |
332 | 342 | } |
333 | 343 | |
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); | |
337 | 347 | } |
338 | 348 | |
339 | 349 | |
444 | 454 | Glib::PropertyProxy_ReadOnly< int > RackTuner::property_limit_timestep() const |
445 | 455 | { |
446 | 456 | 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"); | |
447 | 471 | } |
448 | 472 | #endif //GLIBMM_PROPERTIES_ENABLED |
449 | 473 |
126 | 126 | |
127 | 127 | int get_limit_timestep(); |
128 | 128 | |
129 | void set_temperament(int p1); | |
130 | ||
131 | int get_temperament(); | |
132 | ||
129 | 133 | void clear_notes(); |
130 | 134 | |
131 | void push_note(int p1); | |
135 | void push_note(int p1, int p2, int p3); | |
132 | 136 | |
133 | 137 | /** |
134 | 138 | * @par Slot Prototype: |
287 | 291 | Glib::PropertyProxy_ReadOnly< int > property_limit_timestep() const; |
288 | 292 | #endif //#GLIBMM_PROPERTIES_ENABLED |
289 | 293 | |
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 | |
290 | 313 | |
291 | 314 | }; |
292 | 315 |
6 | 6 | import("guitarix.lib"); |
7 | 7 | |
8 | 8 | |
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 | }; |
17 | 17 | double fConst7; |
18 | 18 | double fConst8; |
19 | 19 | double fConst9; |
20 | double fRec4[2]; | |
21 | double fVec1[2]; | |
20 | 22 | double fConst10; |
21 | double fRec5[2]; | |
22 | double fVec1[2]; | |
23 | double fConst11; | |
24 | double fRec4[2]; | |
25 | 23 | double fRec3[2]; |
26 | double fRec2[3]; | |
24 | double fRec2[2]; | |
27 | 25 | 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]; | |
35 | 27 | void connect(uint32_t port,void* data); |
36 | 28 | void clear_state_f(); |
37 | 29 | void init(uint32_t samplingFreq); |
69 | 61 | inline void Dsp::clear_state_f() |
70 | 62 | { |
71 | 63 | 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; | |
73 | 65 | for (int i=0; i<2; i++) fVec1[i] = 0; |
74 | for (int i=0; i<2; i++) fRec4[i] = 0; | |
75 | 66 | 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; | |
77 | 68 | 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; | |
80 | 70 | } |
81 | 71 | |
82 | 72 | void Dsp::clear_state_f_static(PluginLV2 *p) |
92 | 82 | fConst2 = (2 * (1 - (1.0 / faustpower<2>(fConst1)))); |
93 | 83 | fConst3 = (1.0 / fConst1); |
94 | 84 | 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)); | |
107 | 91 | clear_state_f(); |
108 | 92 | } |
109 | 93 | |
116 | 100 | { |
117 | 101 | for (int i=0; i<count; i++) { |
118 | 102 | 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]); | |
121 | 105 | 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])))); | |
130 | 111 | // post processing |
131 | fRec0[1] = fRec0[0]; | |
132 | fVec2[1] = fVec2[0]; | |
112 | fRec0[2] = fRec0[1]; fRec0[1] = fRec0[0]; | |
133 | 113 | fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; |
134 | fRec2[2] = fRec2[1]; fRec2[1] = fRec2[0]; | |
114 | fRec2[1] = fRec2[0]; | |
135 | 115 | fRec3[1] = fRec3[0]; |
116 | fVec1[1] = fVec1[0]; | |
136 | 117 | fRec4[1] = fRec4[0]; |
137 | fVec1[1] = fVec1[0]; | |
138 | fRec5[1] = fRec5[0]; | |
139 | 118 | iVec0[1] = iVec0[0]; |
140 | 119 | } |
141 | 120 | } |
199 | 199 | lv2:minimum 0 ; |
200 | 200 | lv2:maximum 4096 ; |
201 | 201 | 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 | ] . | |
213 | 203 | |
214 | 204 | <http://guitarix.sourceforge.net/plugins/gx_detune_#gui> |
215 | 205 | a guiext:GtkUI; |
174 | 174 | lv2:scalePoint [rdfs:label "1/64note"; rdf:value 17]; |
175 | 175 | lv2:scalePoint [rdfs:label "1/64notetriplets"; rdf:value 18]; |
176 | 176 | |
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 | ] . | |
186 | 178 | |
187 | 179 | <http://guitarix.sourceforge.net/plugins/gx_digital_delay_#gui> |
188 | 180 | a guiext:GtkUI; |
186 | 186 | lv2:scalePoint [rdfs:label "1/64note"; rdf:value 17]; |
187 | 187 | lv2:scalePoint [rdfs:label "1/64notetriplets"; rdf:value 18]; |
188 | 188 | |
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 | ] . | |
198 | 190 | |
199 | 191 | <http://guitarix.sourceforge.net/plugins/gx_digital_delay_st_#gui> |
200 | 192 | a guiext:GtkUI; |
124 | 124 | mod:gui [ |
125 | 125 | a mod:Gui; |
126 | 126 | 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>; | |
129 | 129 | mod:screenshot <modgui/screenshot-gxduck_delay.png>; |
130 | 130 | mod:thumbnail <modgui/thumb-gxduck_delay.png>; |
131 | 131 | ]. |
161 | 161 | mod:gui [ |
162 | 162 | a mod:Gui; |
163 | 163 | 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>; | |
166 | 166 | mod:screenshot <modgui/screenshot-gxduck_delay_st.png>; |
167 | 167 | mod:thumbnail <modgui/thumb-gxduck_delay_st.png>; |
168 | 168 | ]. |
20 | 20 | { |
21 | 21 | "name": "FEEDBACK", |
22 | 22 | "symbol": "FEEDBACK" |
23 | } | |
23 | }, | |
24 | 24 | { |
25 | 25 | "name": "PINGPONG", |
26 | 26 | "symbol": "PINGPONG" |
27 | } | |
27 | }, | |
28 | 28 | { |
29 | 29 | "name": "RELEASE", |
30 | 30 | "symbol": "RELEASE" |
31 | } | |
31 | }, | |
32 | 32 | { |
33 | 33 | "name": "TIME", |
34 | 34 | "symbol": "TIME" |
465 | 465 | lv2:default 0.0 ; |
466 | 466 | lv2:minimum 0.0 ; |
467 | 467 | 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 | ] . | |
477 | 469 | |
478 | 470 | <http://guitarix.sourceforge.net/plugins/gx_livelooper_#gui> |
479 | 471 | 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) |
116 | 116 | lv2:default 0.5 ; |
117 | 117 | lv2:minimum 0.0 ; |
118 | 118 | 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 | ] . | |
128 | 120 | |
129 | 121 | <http://guitarix.sourceforge.net/plugins/gx_room_simulator_#gui> |
130 | 122 | a guiext:GtkUI; |
189 | 189 | lv2:default 2.0 ; |
190 | 190 | lv2:minimum 1.0 ; |
191 | 191 | 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 | ] . |
132 | 132 | lv2:default 1.0 ; |
133 | 133 | lv2:minimum 0.25 ; |
134 | 134 | 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 | ] . |
444 | 444 | if (bpm > 0) frames_period = sample_set/ bpm; |
445 | 445 | else frames_period = 0; |
446 | 446 | } |
447 | vu_adapter->mono_audio(static_cast<int>(n_samples), input, input, vu_adapter); | |
448 | 447 | lhcut->mono_audio(static_cast<int>(n_samples), input, output, lhcut); |
449 | 448 | tuner& self = *static_cast<tuner*>(tuner_adapter); |
450 | 449 | if (fabs(threshold - *(threshold_))>0.1) |
454 | 453 | } |
455 | 454 | tuner_adapter->mono_audio(static_cast<int>(n_samples), output, output, tuner_adapter); |
456 | 455 | *(freq) = self.get_freq(self); |
456 | vu_adapter->mono_audio(static_cast<int>(n_samples), output, output, vu_adapter); | |
457 | 457 | |
458 | 458 | // MIDI |
459 | 459 | if (fastnote != *(fastnote_)) { |
146 | 146 | a lv2:InputPort , |
147 | 147 | lv2:ControlPort ; |
148 | 148 | 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 ; | |
149 | 158 | lv2:symbol "THRESHOLD" ; |
150 | 159 | lv2:name "THRESHOLD"; |
151 | 160 | lv2:default -50 ; |
153 | 162 | lv2:maximum 4 ; |
154 | 163 | ] , [ |
155 | 164 | a lv2:ControlPort, lv2:OutputPort ; |
156 | lv2:index 4 ; | |
165 | lv2:index 5 ; | |
157 | 166 | lv2:symbol "MAXL" ; |
158 | 167 | lv2:name "MAXL"; |
159 | 168 | lv2:default 0.0 ; |
162 | 171 | ] , [ |
163 | 172 | a lv2:InputPort , |
164 | 173 | lv2:ControlPort ; |
165 | lv2:index 5 ; | |
174 | lv2:index 6 ; | |
166 | 175 | lv2:symbol "RESET" ; |
167 | 176 | lv2:name "RESET"; |
168 | 177 | lv2:default 1 ; |
171 | 180 | ] , [ |
172 | 181 | a lv2:InputPort , |
173 | 182 | lv2:ControlPort ; |
174 | lv2:index 6 ; | |
183 | lv2:index 7 ; | |
175 | 184 | lv2:symbol "LEVEL" ; |
176 | 185 | lv2:name "LEVEL"; |
177 | lv2:default -20 ; | |
186 | lv2:default -45 ; | |
178 | 187 | lv2:minimum -60 ; |
179 | 188 | lv2:maximum 4 ; |
180 | 189 | ] , [ |
181 | 190 | a lv2:InputPort , |
182 | 191 | lv2:ControlPort ; |
183 | lv2:index 7 ; | |
192 | lv2:index 8 ; | |
184 | 193 | lv2:symbol "CHANNEL" ; |
185 | 194 | lv2:name "CHANNELL"; |
186 | 195 | lv2:portProperty lv2:integer; |
208 | 217 | ] , [ |
209 | 218 | a lv2:InputPort , |
210 | 219 | lv2:ControlPort ; |
211 | lv2:index 8 ; | |
220 | lv2:index 9 ; | |
212 | 221 | lv2:symbol "MIDI_ON" ; |
213 | 222 | lv2:name "MIDI_ON"; |
214 | 223 | lv2:portProperty lv2:integer; |
218 | 227 | ] , [ |
219 | 228 | a lv2:InputPort , |
220 | 229 | lv2:ControlPort ; |
221 | lv2:index 9 ; | |
230 | lv2:index 10 ; | |
222 | 231 | lv2:symbol "FASTNOTE" ; |
223 | 232 | lv2:name "FASTNOTE"; |
224 | 233 | lv2:portProperty lv2:integer; |
228 | 237 | ] , [ |
229 | 238 | a lv2:InputPort , |
230 | 239 | lv2:ControlPort ; |
231 | lv2:index 10 ; | |
240 | lv2:index 11 ; | |
232 | 241 | lv2:symbol "PITCHBEND" ; |
233 | 242 | lv2:name "PITCHBEND"; |
234 | 243 | lv2:portProperty lv2:integer; |
238 | 247 | ] , [ |
239 | 248 | a lv2:InputPort , |
240 | 249 | lv2:ControlPort ; |
241 | lv2:index 11 ; | |
250 | lv2:index 12 ; | |
242 | 251 | lv2:symbol "SINGLENOTE" ; |
243 | 252 | lv2:name "SINGLENOTE"; |
244 | 253 | lv2:portProperty lv2:integer; |
247 | 256 | lv2:maximum 1 ; |
248 | 257 | ] , [ |
249 | 258 | a lv2:ControlPort, lv2:InputPort ; |
250 | lv2:index 12 ; | |
259 | lv2:index 13 ; | |
251 | 260 | lv2:symbol "BPM" ; |
252 | 261 | lv2:name "BPM"; |
253 | 262 | lv2:portProperty lv2:integer; |
256 | 265 | lv2:maximum 360.0 ; |
257 | 266 | ] , [ |
258 | 267 | a lv2:ControlPort, lv2:InputPort ; |
259 | lv2:index 13 ; | |
268 | lv2:index 14 ; | |
260 | 269 | lv2:symbol "VELOCITY" ; |
261 | 270 | lv2:name "VELOCITY"; |
262 | 271 | lv2:portProperty lv2:integer; |
266 | 275 | ] , [ |
267 | 276 | a lv2:InputPort , |
268 | 277 | lv2:ControlPort ; |
269 | lv2:index 14 ; | |
278 | lv2:index 15 ; | |
270 | 279 | lv2:symbol "VERIFY" ; |
271 | 280 | lv2:name "VERIFY"; |
272 | 281 | lv2:portProperty lv2:integer; |
276 | 285 | ] , [ |
277 | 286 | a lv2:InputPort , |
278 | 287 | lv2:ControlPort ; |
279 | lv2:index 15 ; | |
288 | lv2:index 16 ; | |
280 | 289 | lv2:symbol "GATE" ; |
281 | 290 | lv2:name "GATE"; |
282 | 291 | lv2:portProperty lv2:integer; |
286 | 295 | ] , [ |
287 | 296 | a lv2:InputPort , |
288 | 297 | lv2:ControlPort ; |
289 | lv2:index 16 ; | |
298 | lv2:index 17 ; | |
290 | 299 | lv2:symbol "SYNTHFREQ" ; |
291 | 300 | lv2:name "SYNTHFREQ"; |
292 | 301 | lv2:default 220 ; |
295 | 304 | ] , [ |
296 | 305 | a lv2:InputPort , |
297 | 306 | lv2:ControlPort ; |
298 | lv2:index 17 ; | |
307 | lv2:index 18 ; | |
299 | 308 | lv2:symbol "GAIN" ; |
300 | 309 | lv2:name "GAIN"; |
301 | 310 | lv2:default 1 ; |
307 | 316 | atom:bufferType atom:Sequence ; |
308 | 317 | atom:supports midi:MidiEvent ; |
309 | 318 | lv2:designation lv2:control ; |
310 | lv2:index 18 ; | |
319 | lv2:index 19 ; | |
311 | 320 | lv2:symbol "midi_out" ; |
312 | 321 | lv2:name "MIDI Out" |
313 | 322 | ] , [ |
314 | 323 | a lv2:AudioPort , |
315 | 324 | lv2:OutputPort ; |
316 | lv2:index 19 ; | |
325 | lv2:index 20 ; | |
317 | 326 | lv2:symbol "out" ; |
318 | 327 | lv2:name "Out" ; |
319 | 328 | ] , [ |
320 | 329 | a lv2:AudioPort , |
321 | 330 | lv2:InputPort ; |
322 | lv2:index 20 ; | |
331 | lv2:index 21 ; | |
323 | 332 | lv2:symbol "in" ; |
324 | 333 | lv2:name "In" ; |
325 | 334 | ]. |
36 | 36 | return &m_bigknob; |
37 | 37 | case TUNEMODE: |
38 | 38 | return &tuner_tuning; |
39 | case TEMPERAMENT: | |
40 | return &tuner_temperament; | |
39 | 41 | case THRESHOLD: |
40 | 42 | return &m_bigknob1; |
41 | 43 | case LEVEL: |
46 | 48 | return &m_switch; |
47 | 49 | case FASTNOTE: |
48 | 50 | return &m_switch1; |
49 | case PITCHBEND: | |
51 | case PITCHBEND: | |
50 | 52 | return &m_switch2; |
51 | 53 | case SINGLENOTE: |
52 | 54 | return &m_switch3; |
77 | 79 | static const size_t _size = sizeof(modes) / sizeof(modes[0]); |
78 | 80 | make_selector("Tunning Modes", modes, _size, 0, 1.0, TUNEMODE); |
79 | 81 | 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); | |
80 | 86 | m_vbox8.set_spacing(2); |
81 | 87 | make_switch_box(&m_hbox_, "", "FAST DETECTION", FASTNOTE); |
82 | 88 | m_vbox8.pack_start(m_vbox4); |
328 | 334 | if (port_index == FREQ) m_tuner.set_freq(value); |
329 | 335 | if (port_index == REFFREQ) m_tuner.set_reference_pitch(value); |
330 | 336 | if (port_index == TUNEMODE) set_tuning(value); |
337 | if (port_index == TEMPERAMENT) set_temperament(); | |
331 | 338 | if (port_index == MAXL) refresh_meter_level(value); |
332 | 339 | |
333 | 340 | } |
344 | 351 | write_function(controller, port_index, sizeof(float), 0, |
345 | 352 | static_cast<const void*>(&value)); |
346 | 353 | if (port_index == TUNEMODE) set_tuning(value); |
354 | if (port_index == TEMPERAMENT) set_temperament(); | |
347 | 355 | if (port_index == REFFREQ) m_tuner.set_reference_pitch(value); |
348 | 356 | } |
349 | 357 | |
354 | 362 | } |
355 | 363 | |
356 | 364 | //////////////////////// 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 | } | |
357 | 370 | |
358 | 371 | void Widget::set_tuning(float mode_) { |
359 | 372 | static struct TuningTab { |
423 | 436 | if (mode > 0) { |
424 | 437 | m_tuner.set_display_flat(tuning_tab[mode-1].flat); |
425 | 438 | 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); | |
427 | 440 | } |
428 | 441 | } else { |
429 | 442 | m_tuner.set_display_flat(false); |
39 | 39 | |
40 | 40 | void on_value_changed(uint32_t port_index); |
41 | 41 | void set_tuning(float value); |
42 | void set_temperament(); | |
42 | 43 | void make_controller_box(Gtk::Box *box, |
43 | 44 | Glib::ustring label, |
44 | 45 | float min, float max, |
110 | 111 | Gxw::HSlider m_bigknob4; |
111 | 112 | Gxw::RackTuner m_tuner; |
112 | 113 | Gxw::Selector tuner_tuning; |
114 | Gxw::Selector tuner_temperament; | |
113 | 115 | Gxw::Selector select1; |
114 | 116 | Gxw::FastMeter fastmeter; |
115 | 117 | Gxw::LevelSlider levelslider; |
87 | 87 | 'gx_digital_delay.lv2', |
88 | 88 | 'gx_digital_delay_st.lv2', |
89 | 89 | 'gx_livelooper.lv2', |
90 | 'gx_mbreverb.lv2', | |
90 | 91 | ] |
91 | 92 | |
92 | 93 | return subdirs |
4 | 4 | import("guitarix.lib"); |
5 | 5 | msec = SR/1000.0; |
6 | 6 | interp = 100*msec; |
7 | N = int( 2^18); | |
7 | N = int( 2^19); | |
8 | 8 | 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; | |
10 | 11 | process = _ <: _ + gain * sdelay(N, interp,d) :> _; |
0 | 0 | // -----delay |
1 | 1 | b.openHorizontalhideBox(""); |
2 | b.create_master_slider(PARAM("delay"), _(" delay ")); | |
2 | b.create_master_slider(PARAM("bpm"), _(" delay (bpm) ")); | |
3 | 3 | b.closeBox(); |
4 | 4 | b.openVerticalBox(""); |
5 | 5 | { |
6 | 6 | b.openHorizontalTableBox(""); |
7 | 7 | { |
8 | b.create_small_rackknobr(PARAM("delay"), _(" delay ")); | |
8 | b.create_small_rackknobr(PARAM("bpm"), _(" delay (bpm) ")); | |
9 | 9 | b.create_small_rackknob(PARAM("gain"), _(" gain ")); |
10 | 10 | } |
11 | 11 | b.closeBox(); |
1 | 1 | declare name "Digital Delay"; |
2 | 2 | declare category "Echo / Delay"; |
3 | 3 | declare description "Digital Delay"; |
4 | ||
5 | 4 | |
6 | 5 | import("music.lib"); |
7 | 6 | import("guitarix.lib"); |
37 | 36 | tact = hslider("notes[name:tact][enum:Dotted 1/2 note|1/2 note|1/2 note triplets| |
38 | 37 | Dotted 1/4 note|1/4 note|1/4 note triplets|Dotted 1/8 note|1/8 note|1/8 note triplets| |
39 | 38 | 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); | |
41 | 40 | |
42 | 41 | interp = 100*SR/1000.0; |
43 | 42 | N = int( 2^19 ) ; |
10 | 10 | import("effect.lib"); |
11 | 11 | import("filter.lib"); |
12 | 12 | |
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)); | |
14 | 15 | release = vslider("percent", 0, 0, 100, 0.1)/100.0 : smooth(0.999); |
16 | N = int( 2^19); | |
15 | 17 | interp = 100*millisec; |
16 | echo1 = +~(sdelay(131072, interp, int(t*millisec)-1) * (release)); | |
18 | echo1 = +~(sdelay(N, interp, int(t)-1) * (release)); | |
17 | 19 | process = echo1; |
5 | 5 | { |
6 | 6 | b.openHorizontalTableBox(""); |
7 | 7 | { |
8 | b.create_small_rackknobr(PARAM("time"), _(" time ")); | |
8 | b.create_small_rackknobr(PARAM("bpm"), _(" time (bpm) ")); | |
9 | 9 | b.create_small_rackknob(PARAM("percent"), " % "); |
10 | 10 | } |
11 | 11 | b.closeBox(); |
13 | 13 | dmax = 2048; |
14 | 14 | dflange = 0.001 * SR * hslider("flange delay [unit:ms]", 10, 0, 20, 0.01); |
15 | 15 | 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; | |
17 | 18 | depth = hslider("depth", 1, 0, 1, 0.01); |
18 | 19 | fb = hslider("feedback gain", 0, 0, 1, 0.01); |
19 | 20 | invert = checkbox("invert[enum:linear|invert]"); |
16 | 16 | lfol = component("oscillator.lib").oscrs; |
17 | 17 | dflange = 0.001 * SR * 10.0; |
18 | 18 | 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; | |
20 | 21 | level = hslider("level [unit:dB]", 0, -60, 10, 0.1) : db2linear; |
21 | 22 | curdel = odflange+dflange*(1 + lfol(freq))/2; |
22 | 23 | }; |
5 | 5 | b.openHorizontalBox(""); |
6 | 6 | { |
7 | 7 | 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)")); | |
9 | 9 | b.create_small_rackknob(PARAM("wet_dry"), _("dry/wet")); |
10 | 10 | } |
11 | 11 | b.closeBox(); |
16 | 16 | b.create_small_rackknob(PARAM("depth"), _(" depth ")); |
17 | 17 | b.create_small_rackknob(PARAM("flange delay"), _(" delay ")); |
18 | 18 | 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)")); | |
20 | 20 | } |
21 | 21 | b.closeBox(); |
22 | 22 | b.insertSpacer(); |
45 | 45 | phaser_stereogx = *(level),*(level) : phaser_stereo(Notches,width,frqmin,fratio,frqmax,freq,mdepth,fb,invert) |
46 | 46 | with { |
47 | 47 | 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; | |
49 | 50 | |
50 | 51 | depth = hslider("depth", 1, 0, 1, 0.01); |
51 | 52 | fb = hslider("feedback gain", 0, 0, 1, 0.01); |
7 | 7 | phaser_monogx = *(level): component("phaser.dsp").phaser_mono(Notches,0,width,frqmin,fratio,frqmax,freq,mdepth,fb,invert) |
8 | 8 | with { |
9 | 9 | 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; | |
11 | 12 | |
12 | 13 | depth = 1 ;//hslider("depth", 1, 0, 1, 0.01); |
13 | 14 | fb = 0.5 ;//hslider("feedback gain", 0, 0, 1, 0.01); |
5 | 5 | b.openHorizontalBox(""); |
6 | 6 | { |
7 | 7 | b.create_small_rackknobr(PARAM("level"), _("level")); |
8 | b.create_small_rackknob(PARAM("Speed"), _("speed")); | |
8 | b.create_small_rackknob(PARAM("lfobpm"), _("speed (bpm)")); | |
9 | 9 | b.create_small_rackknob(PARAM("wet_dry"), _("dry/wet")); |
10 | 10 | } |
11 | 11 | b.closeBox(); |
18 | 18 | b.create_small_rackknob(PARAM("NotchFreq"), _("freq")); |
19 | 19 | b.create_small_rackknob(PARAM("MaxNotch1Freq"), _("max Hz")); |
20 | 20 | 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)")); | |
22 | 22 | } |
23 | 23 | b.closeBox(); |
24 | 24 | b.insertSpacer(); |
6 | 6 | |
7 | 7 | lfol = component("oscillator.lib").oscrs; // sine for left channel |
8 | 8 | |
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; | |
10 | 11 | pingpong = checkbox("invert[enum:linear|pingpong]"); |
11 | 12 | l_gain = vslider("l_gain", 0, -20, 20, 0.1) : db2linear : smoothi(0.999); |
12 | 13 | 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; | |
15 | 18 | process = (_ <: _ + l_gain*(1-(pingpong*lfol(freq))) * sdelay(262144, 1024, d) :> _), |
16 | 19 | (_ <: _ + r_gain*(1-(pingpong*(-1*lfol(freq)))) * sdelay(262144, 1024, r) :> _); |
17 | 20 |
3 | 3 | b.openHorizontalBox(""); |
4 | 4 | { |
5 | 5 | 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)")); | |
7 | 7 | b.openVerticalBox(""); |
8 | 8 | { |
9 | b.create_small_rackknobr(PARAM("LFO freq"), _("LFO")); | |
9 | b.create_small_rackknobr(PARAM("lfobpm"), _("LFO (bpm)")); | |
10 | 10 | b.insertSpacer(); |
11 | b.create_selector(PARAM("invert"), 0); | |
11 | b.create_selector(PARAM("invert"), _("mode")); | |
12 | 12 | b.openFrameBox(""); |
13 | 13 | b.closeBox(); |
14 | 14 | } |
15 | 15 | b.closeBox(); |
16 | 16 | 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)")); | |
18 | 18 | } |
19 | 19 | b.closeBox(); |
7 | 7 | |
8 | 8 | lfol = component("oscillator.lib").oscrs; // sine for left channel |
9 | 9 | |
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; | |
11 | 12 | pingpong = checkbox("invert[enum:linear|pingpong]"); |
12 | 13 | |
13 | tl = vslider("time_l", 1, 1, 2000, 1); | |
14 | //tl = vslider("time_l", 1, 1, 2000, 1); | |
14 | 15 | 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); | |
16 | 17 | 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); | |
17 | 21 | |
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))) ); | |
20 | 24 | process = echo1,echo2; |
10 | 10 | b.closeBox(); |
11 | 11 | b.openVerticalBox(""); |
12 | 12 | { |
13 | b.create_small_rackknob(PARAM("time_l"), _("left time")); | |
13 | b.create_small_rackknob(PARAM("lbpm"), _("left time (bpm)")); | |
14 | 14 | b.insertSpacer(); |
15 | 15 | } |
16 | 16 | b.closeBox(); |
17 | 17 | b.openVerticalBox(""); |
18 | 18 | { |
19 | b.create_small_rackknobr(PARAM("LFO freq"), _("LFO")); | |
19 | b.create_small_rackknobr(PARAM("lfobpm"), _("LFO (bpm)")); | |
20 | 20 | b.insertSpacer(); |
21 | 21 | b.create_selector(PARAM("invert"), 0); |
22 | 22 | b.openFrameBox(""); |
31 | 31 | b.closeBox(); |
32 | 32 | b.openVerticalBox(""); |
33 | 33 | { |
34 | b.create_small_rackknob(PARAM("time_r"), _("right time")); | |
34 | b.create_small_rackknob(PARAM("rbpm"), _("right time (bpm)")); | |
35 | 35 | b.insertSpacer(); |
36 | 36 | } |
37 | 37 | b.closeBox(); |
12 | 12 | float fConst1; |
13 | 13 | float fConst2; |
14 | 14 | FAUSTFLOAT fslider0; |
15 | float fConst3; | |
15 | int iConst3; | |
16 | 16 | float fRec0[2]; |
17 | 17 | float fRec1[2]; |
18 | 18 | float fRec2[2]; |
70 | 70 | |
71 | 71 | inline void Dsp::clear_state_f() |
72 | 72 | { |
73 | for (int i=0; i<262144; i++) fVec0[i] = 0; | |
73 | for (int i=0; i<524288; i++) fVec0[i] = 0; | |
74 | 74 | for (int i=0; i<2; i++) fRec0[i] = 0; |
75 | 75 | for (int i=0; i<2; i++) fRec1[i] = 0; |
76 | 76 | for (int i=0; i<2; i++) fRec2[i] = 0; |
90 | 90 | iConst0 = min(192000, max(1, fSamplingFreq)); |
91 | 91 | fConst1 = (1e+01f / float(iConst0)); |
92 | 92 | fConst2 = (0 - fConst1); |
93 | fConst3 = (0.001f * iConst0); | |
93 | iConst3 = (60 * iConst0); | |
94 | 94 | } |
95 | 95 | |
96 | 96 | void Dsp::init_static(unsigned int samplingFreq, PluginDef *p) |
100 | 100 | |
101 | 101 | void Dsp::mem_alloc() |
102 | 102 | { |
103 | if (!fVec0) fVec0 = new float[262144]; | |
103 | if (!fVec0) fVec0 = new float[524288]; | |
104 | 104 | mem_allocated = true; |
105 | 105 | } |
106 | 106 | |
130 | 130 | |
131 | 131 | void always_inline Dsp::compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0) |
132 | 132 | { |
133 | float fSlow0 = (fConst3 * float(fslider0)); | |
133 | float fSlow0 = (float(iConst3) / float(fslider0)); | |
134 | 134 | float fSlow1 = (0.0010000000000000009f * powf(10,(0.05f * float(fslider1)))); |
135 | 135 | for (int i=0; i<count; i++) { |
136 | 136 | float fTemp0 = (float)input0[i]; |
137 | fVec0[IOTA&262143] = fTemp0; | |
137 | fVec0[IOTA&524287] = fTemp0; | |
138 | 138 | 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))); |
139 | 139 | fRec0[0] = fTemp1; |
140 | 140 | fRec1[0] = max(0.0f, min(1.0f, (fRec1[1] + fTemp1))); |
141 | 141 | fRec2[0] = ((int(((fRec1[1] >= 1.0f) & (fRec3[1] != fSlow0))))?fSlow0:fRec2[1]); |
142 | 142 | fRec3[0] = ((int(((fRec1[1] <= 0.0f) & (fRec2[1] != fSlow0))))?fSlow0:fRec3[1]); |
143 | 143 | 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])))); | |
145 | 145 | // post processing |
146 | 146 | fRec4[1] = fRec4[0]; |
147 | 147 | fRec3[1] = fRec3[0]; |
159 | 159 | |
160 | 160 | int Dsp::register_par(const ParamReg& reg) |
161 | 161 | { |
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); | |
163 | 163 | reg.registerVar("delay.gain","","S","",&fslider1, 0.0f, -2e+01f, 2e+01f, 0.1f); |
164 | 164 | return 0; |
165 | 165 | } |
175 | 175 | #define PARAM(p) ("delay" "." p) |
176 | 176 | // -----delay |
177 | 177 | b.openHorizontalhideBox(""); |
178 | b.create_master_slider(PARAM("delay"), _(" delay ")); | |
178 | b.create_master_slider(PARAM("bpm"), _(" delay (bpm) ")); | |
179 | 179 | b.closeBox(); |
180 | 180 | b.openVerticalBox(""); |
181 | 181 | { |
182 | 182 | b.openHorizontalTableBox(""); |
183 | 183 | { |
184 | b.create_small_rackknobr(PARAM("delay"), _(" delay ")); | |
184 | b.create_small_rackknobr(PARAM("bpm"), _(" delay (bpm) ")); | |
185 | 185 | b.create_small_rackknob(PARAM("gain"), _(" gain ")); |
186 | 186 | } |
187 | 187 | b.closeBox(); |
455 | 455 | static const value_pair fslider4_values[] = {{"plain"},{"presence"},{"tape"},{"tape2"},{0}}; |
456 | 456 | reg.registerEnumVar("dide.mode","","S","",fslider4_values,&fslider4, 0.0f, 0.0f, 3.0f, 1.0f); |
457 | 457 | 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); | |
459 | 459 | return 0; |
460 | 460 | } |
461 | 461 |
582 | 582 | static const value_pair fslider4_values[] = {{"plain"},{"presence"},{"tape"},{"tape2"},{0}}; |
583 | 583 | reg.registerEnumVar("didest.mode","","S","",fslider4_values,&fslider4, 0.0f, 0.0f, 3.0f, 1.0f); |
584 | 584 | 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); | |
586 | 586 | return 0; |
587 | 587 | } |
588 | 588 |
10 | 10 | float fConst1; |
11 | 11 | float fConst2; |
12 | 12 | FAUSTFLOAT fslider0; |
13 | float fConst3; | |
13 | int iConst3; | |
14 | 14 | float fRec1[2]; |
15 | 15 | float fRec2[2]; |
16 | 16 | int iRec3[2]; |
75 | 75 | for (int i=0; i<2; i++) iRec3[i] = 0; |
76 | 76 | for (int i=0; i<2; i++) iRec4[i] = 0; |
77 | 77 | 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; | |
79 | 79 | } |
80 | 80 | |
81 | 81 | void Dsp::clear_state_f_static(PluginDef *p) |
89 | 89 | iConst0 = min(192000, max(1, fSamplingFreq)); |
90 | 90 | fConst1 = (1e+01f / float(iConst0)); |
91 | 91 | fConst2 = (0 - fConst1); |
92 | fConst3 = (0.001f * iConst0); | |
92 | iConst3 = (60 * iConst0); | |
93 | 93 | IOTA = 0; |
94 | 94 | } |
95 | 95 | |
100 | 100 | |
101 | 101 | void Dsp::mem_alloc() |
102 | 102 | { |
103 | if (!fRec0) fRec0 = new float[262144]; | |
103 | if (!fRec0) fRec0 = new float[1048576]; | |
104 | 104 | mem_allocated = true; |
105 | 105 | } |
106 | 106 | |
130 | 130 | |
131 | 131 | void always_inline Dsp::compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *output0) |
132 | 132 | { |
133 | int iSlow0 = (int((fConst3 * float(fslider0))) - 1); | |
133 | int iSlow0 = (int((float(iConst3) / float(fslider0))) - 1); | |
134 | 134 | float fSlow1 = (1.000000000000001e-05f * float(fslider1)); |
135 | 135 | for (int i=0; i<count; i++) { |
136 | 136 | 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))); |
139 | 139 | iRec3[0] = ((int(((fRec2[1] >= 1.0f) & (iRec4[1] != iSlow0))))?iSlow0:iRec3[1]); |
140 | 140 | iRec4[0] = ((int(((fRec2[1] <= 0.0f) & (iRec3[1] != iSlow0))))?iSlow0:iRec4[1]); |
141 | 141 | 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]; | |
144 | 144 | // post processing |
145 | 145 | IOTA = IOTA+1; |
146 | 146 | fRec5[1] = fRec5[0]; |
158 | 158 | |
159 | 159 | int Dsp::register_par(const ParamReg& reg) |
160 | 160 | { |
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); | |
161 | 162 | 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); | |
163 | 163 | return 0; |
164 | 164 | } |
165 | 165 | |
180 | 180 | { |
181 | 181 | b.openHorizontalTableBox(""); |
182 | 182 | { |
183 | b.create_small_rackknobr(PARAM("time"), _(" time ")); | |
183 | b.create_small_rackknobr(PARAM("bpm"), _(" time (bpm) ")); | |
184 | 184 | b.create_small_rackknob(PARAM("percent"), " % "); |
185 | 185 | } |
186 | 186 | b.closeBox(); |
86 | 86 | fSamplingFreq = samplingFreq; |
87 | 87 | IOTA = 0; |
88 | 88 | iConst0 = min(192000, max(1, fSamplingFreq)); |
89 | fConst1 = (6.283185307179586 / double(iConst0)); | |
89 | fConst1 = (0.10471975511965977 / double(iConst0)); | |
90 | 90 | clear_state_f(); |
91 | 91 | } |
92 | 92 | |
144 | 144 | |
145 | 145 | int Dsp::register_par(const ParamReg& reg) |
146 | 146 | { |
147 | reg.registerVar("flanger.LFO freq","","S","",&fslider2, 0.2, 0.0, 5.0, 0.01); | |
148 | 147 | reg.registerVar("flanger.depth","","S","",&fslider5, 1.0, 0.0, 1.0, 0.01); |
149 | 148 | reg.registerVar("flanger.feedback gain","","S","",&fslider1, 0.0, 0.0, 1.0, 0.01); |
150 | 149 | reg.registerVar("flanger.flange delay","","S","",&fslider3, 1e+01, 0.0, 2e+01, 0.01); |
152 | 151 | static const value_pair fcheckbox0_values[] = {{"linear"},{"invert"},{0}}; |
153 | 152 | reg.registerEnumVar("flanger.invert","","B","",fcheckbox0_values,&fcheckbox0, 0.0, 0.0, 1.0, 1.0); |
154 | 153 | 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); | |
155 | 155 | return 0; |
156 | 156 | } |
157 | 157 | |
183 | 183 | b.create_small_rackknob(PARAM("depth"), _(" depth ")); |
184 | 184 | b.create_small_rackknob(PARAM("flange delay"), _(" delay ")); |
185 | 185 | 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)")); | |
187 | 187 | } |
188 | 188 | b.closeBox(); |
189 | 189 | b.insertSpacer(); |
78 | 78 | fSamplingFreq = samplingFreq; |
79 | 79 | IOTA = 0; |
80 | 80 | iConst0 = min(192000, max(1, fSamplingFreq)); |
81 | fConst1 = (6.283185307179586 / double(iConst0)); | |
81 | fConst1 = (0.10471975511965977 / double(iConst0)); | |
82 | 82 | clear_state_f(); |
83 | 83 | } |
84 | 84 | |
125 | 125 | |
126 | 126 | int Dsp::register_par(const ParamReg& reg) |
127 | 127 | { |
128 | reg.registerVar("flanger_mono.freq","","S","",&fslider2, 0.2, 0.0, 5.0, 0.01); | |
129 | 128 | 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); | |
130 | 130 | 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); |
131 | 131 | return 0; |
132 | 132 | } |
148 | 148 | b.openHorizontalBox(""); |
149 | 149 | { |
150 | 150 | 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)")); | |
152 | 152 | b.create_small_rackknob(PARAM("wet_dry"), _("dry/wet")); |
153 | 153 | } |
154 | 154 | b.closeBox(); |
101 | 101 | fSamplingFreq = samplingFreq; |
102 | 102 | iConst0 = min(192000, max(1, fSamplingFreq)); |
103 | 103 | fConst1 = (1.0f / float(iConst0)); |
104 | fConst2 = (6.283185307179586f / float(iConst0)); | |
104 | fConst2 = (0.10471975511965977f / float(iConst0)); | |
105 | 105 | clear_state_f(); |
106 | 106 | } |
107 | 107 | |
188 | 188 | reg.registerVar("phaser.MinNotch1Freq","","S","",&fslider5, 1e+02f, 2e+01f, 5e+03f, 1.0f); |
189 | 189 | reg.registerVar("phaser.Notch width","","S","",&fslider3, 1e+03f, 1e+01f, 5e+03f, 1.0f); |
190 | 190 | 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); | |
192 | 191 | static const value_pair fcheckbox0_values[] = {{"direct "},{" vibrato"},{0}}; |
193 | 192 | reg.registerEnumVar("phaser.VibratoMode","","B","",fcheckbox0_values,&fcheckbox0, 0.0, 0.0, 1.0, 1.0); |
194 | 193 | reg.registerVar("phaser.depth","","S","",&fslider0, 1.0f, 0.0f, 1.0f, 0.01f); |
196 | 195 | static const value_pair fcheckbox1_values[] = {{"linear"},{"invert"},{0}}; |
197 | 196 | reg.registerEnumVar("phaser.invert","","B","",fcheckbox1_values,&fcheckbox1, 0.0, 0.0, 1.0, 1.0); |
198 | 197 | 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); | |
199 | 199 | return 0; |
200 | 200 | } |
201 | 201 | |
229 | 229 | b.create_small_rackknob(PARAM("NotchFreq"), _("freq")); |
230 | 230 | b.create_small_rackknob(PARAM("MaxNotch1Freq"), _("max Hz")); |
231 | 231 | 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)")); | |
233 | 233 | } |
234 | 234 | b.closeBox(); |
235 | 235 | b.insertSpacer(); |
91 | 91 | iConst0 = min(192000, max(1, fSamplingFreq)); |
92 | 92 | fConst1 = expf((0 - (3141.592653589793f / float(iConst0)))); |
93 | 93 | fConst2 = faustpower<2>(fConst1); |
94 | fConst3 = (6.283185307179586f / float(iConst0)); | |
94 | fConst3 = (0.10471975511965977f / float(iConst0)); | |
95 | 95 | fConst4 = (2.0f / float(iConst0)); |
96 | 96 | fConst5 = (0 - (2 * fConst1)); |
97 | 97 | fConst6 = (4.0f / float(iConst0)); |
149 | 149 | |
150 | 150 | int Dsp::register_par(const ParamReg& reg) |
151 | 151 | { |
152 | reg.registerVar("phaser_mono.Speed","","S","",&fslider2, 0.5f, 0.0f, 1e+01f, 0.01f); | |
153 | 152 | 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); | |
154 | 154 | 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); |
155 | 155 | return 0; |
156 | 156 | } |
172 | 172 | b.openHorizontalBox(""); |
173 | 173 | { |
174 | 174 | b.create_small_rackknobr(PARAM("level"), _("level")); |
175 | b.create_small_rackknob(PARAM("Speed"), _("speed")); | |
175 | b.create_small_rackknob(PARAM("lfobpm"), _("speed (bpm)")); | |
176 | 176 | b.create_small_rackknob(PARAM("wet_dry"), _("dry/wet")); |
177 | 177 | } |
178 | 178 | b.closeBox(); |
11 | 11 | int iVec1[2]; |
12 | 12 | FAUSTFLOAT fslider0; |
13 | 13 | int iConst0; |
14 | float fConst1; | |
14 | int iConst1; | |
15 | 15 | float fRec0[2]; |
16 | 16 | float fRec1[2]; |
17 | 17 | float fRec2[2]; |
110 | 110 | fSamplingFreq = samplingFreq; |
111 | 111 | IOTA = 0; |
112 | 112 | 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)); | |
115 | 115 | } |
116 | 116 | |
117 | 117 | void Dsp::init_static(unsigned int samplingFreq, PluginDef *p) |
153 | 153 | |
154 | 154 | void always_inline Dsp::compute(int count, FAUSTFLOAT *input0, FAUSTFLOAT *input1, FAUSTFLOAT *output0, FAUSTFLOAT *output1) |
155 | 155 | { |
156 | float fSlow0 = (fConst1 * float(fslider0)); | |
156 | float fSlow0 = (float(iConst1) / float(fslider0)); | |
157 | 157 | float fSlow1 = (fConst2 * float(fslider1)); |
158 | 158 | float fSlow2 = cosf(fSlow1); |
159 | 159 | float fSlow3 = sinf(fSlow1); |
160 | 160 | float fSlow4 = (0 - fSlow3); |
161 | 161 | float fSlow5 = float(fcheckbox0); |
162 | 162 | float fSlow6 = (0.0010000000000000009f * powf(10,(0.05f * float(fslider2)))); |
163 | float fSlow7 = (fConst1 * float(fslider3)); | |
163 | float fSlow7 = (float(iConst1) / float(fslider3)); | |
164 | 164 | float fSlow8 = (0.0010000000000000009f * powf(10,(0.05f * float(fslider4)))); |
165 | 165 | for (int i=0; i<count; i++) { |
166 | 166 | float fTemp0 = (float)input0[i]; |
209 | 209 | |
210 | 210 | int Dsp::register_par(const ParamReg& reg) |
211 | 211 | { |
212 | reg.registerVar("stereodelay.LFO freq","","S","",&fslider1, 0.2f, 0.0f, 5.0f, 0.01f); | |
213 | 212 | static const value_pair fcheckbox0_values[] = {{"linear"},{"pingpong"},{0}}; |
214 | 213 | 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); | |
216 | 214 | 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); | |
218 | 217 | 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); | |
219 | 219 | return 0; |
220 | 220 | } |
221 | 221 | |
234 | 234 | b.openHorizontalBox(""); |
235 | 235 | { |
236 | 236 | 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)")); | |
238 | 238 | b.openVerticalBox(""); |
239 | 239 | { |
240 | b.create_small_rackknobr(PARAM("LFO freq"), _("LFO")); | |
240 | b.create_small_rackknobr(PARAM("lfobpm"), _("LFO (bpm)")); | |
241 | 241 | b.insertSpacer(); |
242 | b.create_selector(PARAM("invert"), 0); | |
242 | b.create_selector(PARAM("invert"), _("mode")); | |
243 | 243 | b.openFrameBox(""); |
244 | 244 | b.closeBox(); |
245 | 245 | } |
246 | 246 | b.closeBox(); |
247 | 247 | 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)")); | |
249 | 249 | } |
250 | 250 | b.closeBox(); |
251 | 251 |
14 | 14 | float fRec2[2]; |
15 | 15 | FAUSTFLOAT fcheckbox0; |
16 | 16 | FAUSTFLOAT fslider1; |
17 | float fConst2; | |
17 | int iConst2; | |
18 | 18 | float fRec3[2]; |
19 | 19 | float fRec4[2]; |
20 | 20 | int iRec5[2]; |
88 | 88 | for (int i=0; i<2; i++) fRec4[i] = 0; |
89 | 89 | for (int i=0; i<2; i++) iRec5[i] = 0; |
90 | 90 | 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; | |
92 | 92 | for (int i=0; i<2; i++) fRec8[i] = 0; |
93 | 93 | for (int i=0; i<2; i++) fRec9[i] = 0; |
94 | 94 | for (int i=0; i<2; i++) iRec10[i] = 0; |
95 | 95 | 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; | |
97 | 97 | } |
98 | 98 | |
99 | 99 | void Dsp::clear_state_f_static(PluginDef *p) |
105 | 105 | { |
106 | 106 | fSamplingFreq = samplingFreq; |
107 | 107 | 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); | |
110 | 110 | IOTA = 0; |
111 | 111 | } |
112 | 112 | |
117 | 117 | |
118 | 118 | void Dsp::mem_alloc() |
119 | 119 | { |
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]; | |
122 | 122 | mem_allocated = true; |
123 | 123 | } |
124 | 124 | |
154 | 154 | float fSlow2 = sinf(fSlow0); |
155 | 155 | float fSlow3 = (0 - fSlow2); |
156 | 156 | float fSlow4 = float(fcheckbox0); |
157 | int iSlow5 = (int((fConst2 * float(fslider1))) - 1); | |
157 | int iSlow5 = (int((float(iConst2) / float(fslider1))) - 1); | |
158 | 158 | float fSlow6 = (0.01f * float(fslider2)); |
159 | int iSlow7 = (int((fConst2 * float(fslider3))) - 1); | |
159 | int iSlow7 = (int((float(iConst2) / float(fslider3))) - 1); | |
160 | 160 | float fSlow8 = (0.01f * float(fslider4)); |
161 | 161 | for (int i=0; i<count; i++) { |
162 | 162 | iVec0[0] = 1; |
167 | 167 | fRec4[0] = max(0.0f, min(1.0f, (fRec4[1] + fTemp0))); |
168 | 168 | iRec5[0] = ((int(((fRec4[1] >= 1.0f) & (iRec6[1] != iSlow5))))?iSlow5:iRec5[1]); |
169 | 169 | 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]; | |
172 | 172 | 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))); |
173 | 173 | fRec8[0] = fTemp1; |
174 | 174 | fRec9[0] = max(0.0f, min(1.0f, (fRec9[1] + fTemp1))); |
175 | 175 | iRec10[0] = ((int(((fRec9[1] >= 1.0f) & (iRec11[1] != iSlow7))))?iSlow7:iRec10[1]); |
176 | 176 | 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]; | |
179 | 179 | // post processing |
180 | 180 | iRec11[1] = iRec11[0]; |
181 | 181 | iRec10[1] = iRec10[0]; |
199 | 199 | |
200 | 200 | int Dsp::register_par(const ParamReg& reg) |
201 | 201 | { |
202 | reg.registerVar("stereoecho.LFO freq","","S","",&fslider0, 0.2f, 0.0f, 5.0f, 0.01f); | |
203 | 202 | static const value_pair fcheckbox0_values[] = {{"linear"},{"pingpong"},{0}}; |
204 | 203 | 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); | |
205 | 206 | reg.registerVar("stereoecho.percent_l","","S","",&fslider2, 0.0f, 0.0f, 1e+02f, 0.1f); |
206 | 207 | 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); | |
209 | 209 | return 0; |
210 | 210 | } |
211 | 211 | |
231 | 231 | b.closeBox(); |
232 | 232 | b.openVerticalBox(""); |
233 | 233 | { |
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)")); | |
241 | 241 | b.insertSpacer(); |
242 | 242 | b.create_selector(PARAM("invert"), 0); |
243 | 243 | b.openFrameBox(""); |
252 | 252 | b.closeBox(); |
253 | 253 | b.openVerticalBox(""); |
254 | 254 | { |
255 | b.create_small_rackknob(PARAM("time_r"), _("right time")); | |
255 | b.create_small_rackknob(PARAM("rbpm"), _("right time (bpm)")); | |
256 | 256 | b.insertSpacer(); |
257 | 257 | } |
258 | 258 | b.closeBox(); |
260 | 260 | <property name="visible">True</property> |
261 | 261 | <property name="can_focus">True</property> |
262 | 262 | <property name="receives_default">True</property> |
263 | <property name="use_action_appearance">False</property> | |
264 | 263 | <property name="relief">none</property> |
265 | 264 | <property name="yalign">0.69999998807907104</property> |
266 | 265 | <property name="var_id">amp.bass_boost.on_off</property> |
325 | 324 | <property name="visible">True</property> |
326 | 325 | <property name="can_focus">True</property> |
327 | 326 | <property name="receives_default">True</property> |
328 | <property name="use_action_appearance">False</property> | |
329 | 327 | <property name="relief">none</property> |
330 | 328 | <property name="yalign">0.69999998807907104</property> |
331 | 329 | <property name="var_id">con.on_off</property> |
390 | 388 | <property name="visible">True</property> |
391 | 389 | <property name="can_focus">True</property> |
392 | 390 | <property name="receives_default">True</property> |
393 | <property name="use_action_appearance">False</property> | |
394 | 391 | <property name="relief">none</property> |
395 | 392 | <property name="yalign">0.69999998807907104</property> |
396 | 393 | <property name="var_id">amp.feed_on_off</property> |
550 | 547 | <property name="visible">True</property> |
551 | 548 | <property name="can_focus">False</property> |
552 | 549 | <property name="receives_default">True</property> |
553 | <property name="use_action_appearance">False</property> | |
554 | 550 | </object> |
555 | 551 | </child> |
556 | 552 | </object> |
723 | 719 | <child> |
724 | 720 | <placeholder/> |
725 | 721 | </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> | |
726 | 776 | </object> |
727 | 777 | </child> |
728 | 778 | </object> |
827 | 877 | </child> |
828 | 878 | </object> |
829 | 879 | </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> | |
830 | 906 | </object> |
831 | 907 | <object class="GtkWindow" id="MainWindow"> |
832 | 908 | <property name="can_focus">False</property> |
859 | 935 | <property name="visible">True</property> |
860 | 936 | <property name="can_focus">True</property> |
861 | 937 | <property name="receives_default">True</property> |
862 | <property name="use_action_appearance">False</property> | |
863 | 938 | <child> |
864 | 939 | <object class="GtkLabel" id="label5:barbuttonlabel"> |
865 | 940 | <property name="visible">True</property> |
883 | 958 | <property name="visible">True</property> |
884 | 959 | <property name="can_focus">True</property> |
885 | 960 | <property name="receives_default">True</property> |
886 | <property name="use_action_appearance">False</property> | |
887 | 961 | <child> |
888 | 962 | <object class="GtkLabel" id="label6:barbuttonlabel"> |
889 | 963 | <property name="visible">True</property> |
907 | 981 | <property name="visible">True</property> |
908 | 982 | <property name="can_focus">True</property> |
909 | 983 | <property name="receives_default">True</property> |
910 | <property name="use_action_appearance">False</property> | |
911 | 984 | <child> |
912 | 985 | <object class="GtkLabel" id="label4:barbuttonlabel"> |
913 | 986 | <property name="visible">True</property> |
931 | 1004 | <property name="visible">True</property> |
932 | 1005 | <property name="can_focus">True</property> |
933 | 1006 | <property name="receives_default">True</property> |
934 | <property name="use_action_appearance">False</property> | |
935 | 1007 | <child> |
936 | 1008 | <object class="GtkLabel" id="label1:barbuttonlabel"> |
937 | 1009 | <property name="visible">True</property> |
955 | 1027 | <property name="visible">True</property> |
956 | 1028 | <property name="can_focus">True</property> |
957 | 1029 | <property name="receives_default">True</property> |
958 | <property name="use_action_appearance">False</property> | |
959 | 1030 | <child> |
960 | 1031 | <object class="GtkLabel" id="label7:barbuttonlabel"> |
961 | 1032 | <property name="visible">True</property> |
979 | 1050 | <property name="visible">True</property> |
980 | 1051 | <property name="can_focus">True</property> |
981 | 1052 | <property name="receives_default">True</property> |
982 | <property name="use_action_appearance">False</property> | |
983 | 1053 | <child> |
984 | 1054 | <object class="GtkImage" id="image2"> |
985 | 1055 | <property name="height_request">10</property> |
1000 | 1070 | <property name="visible">True</property> |
1001 | 1071 | <property name="can_focus">True</property> |
1002 | 1072 | <property name="receives_default">True</property> |
1003 | <property name="use_action_appearance">False</property> | |
1004 | 1073 | <child> |
1005 | 1074 | <object class="GtkImage" id="image1"> |
1006 | 1075 | <property name="height_request">10</property> |
1021 | 1090 | <property name="visible">True</property> |
1022 | 1091 | <property name="can_focus">True</property> |
1023 | 1092 | <property name="receives_default">True</property> |
1024 | <property name="use_action_appearance">False</property> | |
1025 | 1093 | <child> |
1026 | 1094 | <object class="GtkLabel" id="label3:barbuttonlabel"> |
1027 | 1095 | <property name="visible">True</property> |
1140 | 1208 | <property name="visible">True</property> |
1141 | 1209 | <property name="can_focus">True</property> |
1142 | 1210 | <property name="receives_default">True</property> |
1143 | <property name="use_action_appearance">False</property> | |
1144 | 1211 | <child> |
1145 | 1212 | <object class="GtkLabel" id="label6:rack_slider"> |
1146 | 1213 | <property name="visible">True</property> |
1147 | 1214 | <property name="can_focus">False</property> |
1148 | <property name="label" translatable="no">▶</property> | |
1215 | <property name="label">▶</property> | |
1149 | 1216 | </object> |
1150 | 1217 | </child> |
1151 | 1218 | </object> |
1215 | 1282 | <property name="visible">True</property> |
1216 | 1283 | <property name="can_focus">True</property> |
1217 | 1284 | <property name="receives_default">True</property> |
1218 | <property name="use_action_appearance">False</property> | |
1219 | 1285 | <property name="relief">none</property> |
1220 | 1286 | <property name="var_id">noise_gate.on_off</property> |
1221 | 1287 | <property name="base_name">switchit</property> |
1298 | 1364 | <property name="visible">True</property> |
1299 | 1365 | <property name="can_focus">True</property> |
1300 | 1366 | <property name="receives_default">True</property> |
1301 | <property name="use_action_appearance">False</property> | |
1302 | 1367 | <property name="relief">none</property> |
1303 | 1368 | <property name="var_id">shaper.on_off</property> |
1304 | 1369 | <property name="base_name">switchit</property> |
1381 | 1446 | <property name="visible">True</property> |
1382 | 1447 | <property name="can_focus">True</property> |
1383 | 1448 | <property name="receives_default">True</property> |
1384 | <property name="use_action_appearance">False</property> | |
1385 | 1449 | <property name="relief">none</property> |
1386 | 1450 | <property name="var_id">amp.on_off</property> |
1387 | 1451 | <property name="base_name">switchit</property> |
1464 | 1528 | <property name="visible">True</property> |
1465 | 1529 | <property name="can_focus">True</property> |
1466 | 1530 | <property name="receives_default">True</property> |
1467 | <property name="use_action_appearance">False</property> | |
1468 | 1531 | <property name="relief">none</property> |
1469 | 1532 | <property name="var_id">amp.clip.on_off</property> |
1470 | 1533 | <property name="base_name">switchit</property> |
1527 | 1590 | <property name="visible">True</property> |
1528 | 1591 | <property name="can_focus">True</property> |
1529 | 1592 | <property name="receives_default">True</property> |
1530 | <property name="use_action_appearance">False</property> | |
1531 | 1593 | <child> |
1532 | 1594 | <object class="GtkLabel" id="label7:rack_slider"> |
1533 | 1595 | <property name="visible">True</property> |
1534 | 1596 | <property name="can_focus">False</property> |
1535 | <property name="label" translatable="no">▼</property> | |
1597 | <property name="label">▼</property> | |
1536 | 1598 | </object> |
1537 | 1599 | </child> |
1538 | 1600 | </object> |
1611 | 1673 | <property name="visible">True</property> |
1612 | 1674 | <property name="can_focus">True</property> |
1613 | 1675 | <property name="receives_default">True</property> |
1614 | <property name="use_action_appearance">False</property> | |
1615 | 1676 | <property name="relief">none</property> |
1616 | 1677 | <property name="var_id">ui.racktuner</property> |
1617 | 1678 | <property name="base_name">switchit</property> |
1636 | 1697 | <property name="sensitive">False</property> |
1637 | 1698 | <property name="can_focus">True</property> |
1638 | 1699 | <property name="receives_default">True</property> |
1639 | <property name="use_action_appearance">False</property> | |
1640 | 1700 | </object> |
1641 | 1701 | <packing> |
1642 | 1702 | <property name="expand">False</property> |
1736 | 1796 | <property name="position">2</property> |
1737 | 1797 | </packing> |
1738 | 1798 | </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> | |
1739 | 1812 | </object> |
1740 | 1813 | <packing> |
1741 | 1814 | <property name="expand">False</property> |
1768 | 1841 | <property name="sensitive">False</property> |
1769 | 1842 | <property name="can_focus">True</property> |
1770 | 1843 | <property name="receives_default">True</property> |
1771 | <property name="use_action_appearance">False</property> | |
1772 | 1844 | </object> |
1773 | 1845 | </child> |
1774 | 1846 | </object> |
1813 | 1885 | <property name="visible">True</property> |
1814 | 1886 | <property name="can_focus">True</property> |
1815 | 1887 | <property name="receives_default">True</property> |
1816 | <property name="use_action_appearance">False</property> | |
1817 | 1888 | <property name="relief">none</property> |
1818 | 1889 | <property name="var_id">midi_out.on_off</property> |
1819 | 1890 | <property name="base_name">minitoggle</property> |
1843 | 1914 | <property name="sensitive">False</property> |
1844 | 1915 | <property name="can_focus">True</property> |
1845 | 1916 | <property name="receives_default">True</property> |
1846 | <property name="use_action_appearance">False</property> | |
1847 | 1917 | </object> |
1848 | 1918 | </child> |
1849 | 1919 | </object> |
1887 | 1957 | <property name="visible">True</property> |
1888 | 1958 | <property name="can_focus">True</property> |
1889 | 1959 | <property name="receives_default">True</property> |
1890 | <property name="use_action_appearance">False</property> | |
1891 | 1960 | <child> |
1892 | 1961 | <object class="GtkLabel" id="label12"> |
1893 | 1962 | <property name="visible">True</property> |
1919 | 1988 | <property name="sensitive">False</property> |
1920 | 1989 | <property name="can_focus">True</property> |
1921 | 1990 | <property name="receives_default">True</property> |
1922 | <property name="use_action_appearance">False</property> | |
1923 | 1991 | </object> |
1924 | 1992 | </child> |
1925 | 1993 | </object> |
1951 | 2019 | <property name="visible">True</property> |
1952 | 2020 | <property name="can_focus">True</property> |
1953 | 2021 | <property name="receives_default">True</property> |
1954 | <property name="use_action_appearance">False</property> | |
1955 | 2022 | <child> |
1956 | 2023 | <object class="GtkLabel" id="label:rack_slider"> |
1957 | 2024 | <property name="visible">True</property> |
1958 | 2025 | <property name="can_focus">False</property> |
1959 | <property name="label" translatable="no">▶</property> | |
2026 | <property name="label">▶</property> | |
1960 | 2027 | </object> |
1961 | 2028 | </child> |
1962 | 2029 | </object> |
2021 | 2088 | <property name="visible">True</property> |
2022 | 2089 | <property name="can_focus">True</property> |
2023 | 2090 | <property name="receives_default">True</property> |
2024 | <property name="use_action_appearance">False</property> | |
2025 | 2091 | <property name="relief">none</property> |
2026 | 2092 | <property name="var_id">midi_out.on_off</property> |
2027 | 2093 | <property name="base_name">switchit</property> |
2046 | 2112 | <property name="sensitive">False</property> |
2047 | 2113 | <property name="can_focus">True</property> |
2048 | 2114 | <property name="receives_default">True</property> |
2049 | <property name="use_action_appearance">False</property> | |
2050 | 2115 | </object> |
2051 | 2116 | <packing> |
2052 | 2117 | <property name="expand">False</property> |
2096 | 2161 | <property name="visible">True</property> |
2097 | 2162 | <property name="can_focus">True</property> |
2098 | 2163 | <property name="receives_default">True</property> |
2099 | <property name="use_action_appearance">False</property> | |
2100 | 2164 | <property name="relief">none</property> |
2101 | 2165 | <property name="var_id">midi_out.channel_2.on_off</property> |
2102 | 2166 | <property name="base_name">switch</property> |
2111 | 2175 | <property name="visible">True</property> |
2112 | 2176 | <property name="can_focus">True</property> |
2113 | 2177 | <property name="receives_default">True</property> |
2114 | <property name="use_action_appearance">False</property> | |
2115 | 2178 | <property name="relief">none</property> |
2116 | 2179 | <property name="var_id">midi_out.channel_3.on_off</property> |
2117 | 2180 | <property name="base_name">switch</property> |
2175 | 2238 | <property name="visible">True</property> |
2176 | 2239 | <property name="can_focus">True</property> |
2177 | 2240 | <property name="receives_default">True</property> |
2178 | <property name="use_action_appearance">False</property> | |
2179 | 2241 | <property name="relief">none</property> |
2180 | 2242 | <property name="var_id">midi_out.midistat1</property> |
2181 | 2243 | <property name="base_name">led</property> |
2190 | 2252 | <property name="visible">True</property> |
2191 | 2253 | <property name="can_focus">True</property> |
2192 | 2254 | <property name="receives_default">True</property> |
2193 | <property name="use_action_appearance">False</property> | |
2194 | 2255 | <property name="relief">none</property> |
2195 | 2256 | <property name="var_id">midi_out.midistat2</property> |
2196 | 2257 | <property name="base_name">led</property> |
2207 | 2268 | <property name="visible">True</property> |
2208 | 2269 | <property name="can_focus">True</property> |
2209 | 2270 | <property name="receives_default">True</property> |
2210 | <property name="use_action_appearance">False</property> | |
2211 | 2271 | <property name="relief">none</property> |
2212 | 2272 | <property name="var_id">midi_out.midistat3</property> |
2213 | 2273 | <property name="base_name">led</property> |
2224 | 2284 | <property name="visible">True</property> |
2225 | 2285 | <property name="can_focus">True</property> |
2226 | 2286 | <property name="receives_default">True</property> |
2227 | <property name="use_action_appearance">False</property> | |
2228 | 2287 | <property name="relief">none</property> |
2229 | 2288 | <property name="var_id">midi_out.midistat</property> |
2230 | 2289 | <property name="base_name">led</property> |
2239 | 2298 | <child> |
2240 | 2299 | <placeholder/> |
2241 | 2300 | </child> |
2301 | <child> | |
2302 | <placeholder/> | |
2303 | </child> | |
2242 | 2304 | </object> |
2243 | 2305 | <packing> |
2244 | 2306 | <property name="expand">False</property> |
2442 | 2504 | <property name="visible">True</property> |
2443 | 2505 | <property name="can_focus">True</property> |
2444 | 2506 | <property name="receives_default">True</property> |
2445 | <property name="use_action_appearance">False</property> | |
2446 | 2507 | <property name="relief">none</property> |
2447 | 2508 | <property name="var_id">midi_out.channel_1.autogain</property> |
2448 | 2509 | <property name="base_name">minitoggle</property> |
2556 | 2617 | <property name="visible">True</property> |
2557 | 2618 | <property name="can_focus">True</property> |
2558 | 2619 | <property name="receives_default">True</property> |
2559 | <property name="use_action_appearance">False</property> | |
2560 | 2620 | <property name="relief">none</property> |
2561 | 2621 | <property name="var_id">midi_out.channel_1.auto_pitch</property> |
2562 | 2622 | <property name="base_name">minitoggle</property> |
2780 | 2840 | <property name="visible">True</property> |
2781 | 2841 | <property name="can_focus">True</property> |
2782 | 2842 | <property name="receives_default">True</property> |
2783 | <property name="use_action_appearance">False</property> | |
2784 | 2843 | <property name="relief">none</property> |
2785 | 2844 | <property name="var_id">midi_out.channel_2.autogain</property> |
2786 | 2845 | <property name="base_name">minitoggle</property> |
2894 | 2953 | <property name="visible">True</property> |
2895 | 2954 | <property name="can_focus">True</property> |
2896 | 2955 | <property name="receives_default">True</property> |
2897 | <property name="use_action_appearance">False</property> | |
2898 | 2956 | <property name="relief">none</property> |
2899 | 2957 | <property name="var_id">midi_out.channel_2.auto_pitch</property> |
2900 | 2958 | <property name="base_name">minitoggle</property> |
3118 | 3176 | <property name="visible">True</property> |
3119 | 3177 | <property name="can_focus">True</property> |
3120 | 3178 | <property name="receives_default">True</property> |
3121 | <property name="use_action_appearance">False</property> | |
3122 | 3179 | <property name="relief">none</property> |
3123 | 3180 | <property name="var_id">midi_out.channel_3.autogain</property> |
3124 | 3181 | <property name="base_name">minitoggle</property> |
3232 | 3289 | <property name="visible">True</property> |
3233 | 3290 | <property name="can_focus">True</property> |
3234 | 3291 | <property name="receives_default">True</property> |
3235 | <property name="use_action_appearance">False</property> | |
3236 | 3292 | <property name="relief">none</property> |
3237 | 3293 | <property name="var_id">midi_out.channel_3.auto_pitch</property> |
3238 | 3294 | <property name="base_name">minitoggle</property> |
3300 | 3356 | </child> |
3301 | 3357 | <child> |
3302 | 3358 | <object class="GtkRadioButton" id="channel1_button"> |
3303 | <property name="label" translatable="no">1</property> | |
3359 | <property name="label">1</property> | |
3304 | 3360 | <property name="visible">True</property> |
3305 | 3361 | <property name="can_focus">True</property> |
3306 | 3362 | <property name="receives_default">False</property> |
3307 | <property name="use_action_appearance">False</property> | |
3308 | 3363 | <property name="active">True</property> |
3309 | 3364 | <property name="draw_indicator">True</property> |
3310 | 3365 | </object> |
3316 | 3371 | </child> |
3317 | 3372 | <child> |
3318 | 3373 | <object class="GtkRadioButton" id="channel2_button"> |
3319 | <property name="label" translatable="no">2</property> | |
3374 | <property name="label">2</property> | |
3320 | 3375 | <property name="visible">True</property> |
3321 | 3376 | <property name="can_focus">True</property> |
3322 | 3377 | <property name="receives_default">False</property> |
3323 | <property name="use_action_appearance">False</property> | |
3324 | 3378 | <property name="draw_indicator">True</property> |
3325 | 3379 | <property name="group">channel1_button</property> |
3326 | 3380 | </object> |
3332 | 3386 | </child> |
3333 | 3387 | <child> |
3334 | 3388 | <object class="GtkRadioButton" id="channel3_button"> |
3335 | <property name="label" translatable="no">3</property> | |
3389 | <property name="label">3</property> | |
3336 | 3390 | <property name="visible">True</property> |
3337 | 3391 | <property name="can_focus">True</property> |
3338 | 3392 | <property name="receives_default">False</property> |
3339 | <property name="use_action_appearance">False</property> | |
3340 | 3393 | <property name="draw_indicator">True</property> |
3341 | 3394 | <property name="group">channel1_button</property> |
3342 | 3395 | </object> |
3587 | 3640 | <property name="sensitive">False</property> |
3588 | 3641 | <property name="can_focus">True</property> |
3589 | 3642 | <property name="receives_default">True</property> |
3590 | <property name="use_action_appearance">False</property> | |
3591 | 3643 | </object> |
3592 | 3644 | </child> |
3593 | 3645 | </object> |
3618 | 3670 | <property name="visible">True</property> |
3619 | 3671 | <property name="can_focus">True</property> |
3620 | 3672 | <property name="receives_default">True</property> |
3621 | <property name="use_action_appearance">False</property> | |
3622 | 3673 | <child> |
3623 | 3674 | <object class="GtkLabel" id="label8:rack_slider"> |
3624 | 3675 | <property name="visible">True</property> |
3625 | 3676 | <property name="can_focus">False</property> |
3626 | <property name="label" translatable="no">▼</property> | |
3677 | <property name="label">▼</property> | |
3627 | 3678 | </object> |
3628 | 3679 | </child> |
3629 | 3680 | </object> |
3641 | 3692 | <property name="visible">True</property> |
3642 | 3693 | <property name="can_focus">True</property> |
3643 | 3694 | <property name="receives_default">True</property> |
3644 | <property name="use_action_appearance">False</property> | |
3645 | 3695 | <child> |
3646 | 3696 | <object class="GtkLabel" id="label8"> |
3647 | 3697 | <property name="visible">True</property> |
3842 | 3892 | <property name="visible">True</property> |
3843 | 3893 | <property name="can_focus">True</property> |
3844 | 3894 | <property name="receives_default">True</property> |
3845 | <property name="use_action_appearance">False</property> | |
3846 | 3895 | </object> |
3847 | 3896 | <packing> |
3848 | 3897 | <property name="expand">False</property> |
3856 | 3905 | <property name="visible">True</property> |
3857 | 3906 | <property name="can_focus">True</property> |
3858 | 3907 | <property name="receives_default">True</property> |
3859 | <property name="use_action_appearance">False</property> | |
3860 | 3908 | </object> |
3861 | 3909 | <packing> |
3862 | 3910 | <property name="expand">False</property> |
3870 | 3918 | <property name="visible">True</property> |
3871 | 3919 | <property name="can_focus">True</property> |
3872 | 3920 | <property name="receives_default">True</property> |
3873 | <property name="use_action_appearance">False</property> | |
3874 | 3921 | </object> |
3875 | 3922 | <packing> |
3876 | 3923 | <property name="expand">False</property> |
3884 | 3931 | <property name="visible">True</property> |
3885 | 3932 | <property name="can_focus">True</property> |
3886 | 3933 | <property name="receives_default">True</property> |
3887 | <property name="use_action_appearance">False</property> | |
3888 | 3934 | </object> |
3889 | 3935 | <packing> |
3890 | 3936 | <property name="expand">False</property> |
4173 | 4219 | <property name="visible">True</property> |
4174 | 4220 | <property name="can_focus">True</property> |
4175 | 4221 | <property name="receives_default">True</property> |
4176 | <property name="use_action_appearance">False</property> | |
4177 | 4222 | <child> |
4178 | 4223 | <object class="GtkLabel" id="label2:barbuttonlabel"> |
4179 | 4224 | <property name="visible">True</property> |
4295 | 4340 | </object> |
4296 | 4341 | </child> |
4297 | 4342 | </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> | |
4324 | 4343 | </interface> |
21 | 21 | <property name="can_focus">False</property> |
22 | 22 | <property name="layout_style">end</property> |
23 | 23 | <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> | |
26 | 26 | <property name="visible">True</property> |
27 | 27 | <property name="can_focus">True</property> |
28 | 28 | <property name="receives_default">True</property> |
29 | <property name="use_action_appearance">False</property> | |
30 | 29 | <property name="use_stock">True</property> |
31 | 30 | </object> |
32 | 31 | <packing> |
36 | 35 | </packing> |
37 | 36 | </child> |
38 | 37 | <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> | |
44 | 42 | <property name="receives_default">True</property> |
45 | <property name="use_action_appearance">False</property> | |
46 | 43 | <property name="use_stock">True</property> |
47 | 44 | </object> |
48 | 45 | <packing> |
52 | 49 | </packing> |
53 | 50 | </child> |
54 | 51 | <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> | |
57 | 54 | <property name="visible">True</property> |
58 | 55 | <property name="can_focus">True</property> |
59 | 56 | <property name="can_default">True</property> |
60 | <property name="has_default">True</property> | |
61 | 57 | <property name="receives_default">True</property> |
62 | <property name="use_action_appearance">False</property> | |
63 | 58 | <property name="use_stock">True</property> |
64 | 59 | </object> |
65 | 60 | <packing> |
66 | 61 | <property name="expand">False</property> |
67 | 62 | <property name="fill">False</property> |
68 | 63 | <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> | |
69 | 80 | </packing> |
70 | 81 | </child> |
71 | 82 | </object> |
218 | 229 | <packing> |
219 | 230 | <property name="left_attach">1</property> |
220 | 231 | <property name="right_attach">2</property> |
221 | <property name="x_options"></property> | |
232 | <property name="x_options"/> | |
222 | 233 | </packing> |
223 | 234 | </child> |
224 | 235 | <child> |
246 | 257 | <property name="visible">True</property> |
247 | 258 | <property name="can_focus">True</property> |
248 | 259 | <property name="receives_default">False</property> |
249 | <property name="use_action_appearance">False</property> | |
250 | 260 | <property name="draw_indicator">True</property> |
251 | 261 | </object> |
252 | 262 | <packing> |
296 | 306 | </object> |
297 | 307 | </child> |
298 | 308 | <action-widgets> |
309 | <action-widget response="-11">button6</action-widget> | |
299 | 310 | <action-widget response="1">button3</action-widget> |
300 | 311 | <action-widget response="-6">button2</action-widget> |
301 | 312 | <action-widget response="-5">button1</action-widget> |
302 | 313 | </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> | |
303 | 339 | </object> |
304 | 340 | <object class="GtkDialog" id="MidiControllerTable"> |
305 | 341 | <property name="can_focus">False</property> |
324 | 360 | <property name="visible">True</property> |
325 | 361 | <property name="can_focus">True</property> |
326 | 362 | <property name="receives_default">True</property> |
327 | <property name="use_action_appearance">False</property> | |
328 | 363 | <property name="image">image1</property> |
329 | 364 | <property name="use_underline">True</property> |
330 | 365 | </object> |
340 | 375 | <property name="visible">True</property> |
341 | 376 | <property name="can_focus">True</property> |
342 | 377 | <property name="receives_default">True</property> |
343 | <property name="use_action_appearance">False</property> | |
344 | 378 | <property name="use_stock">True</property> |
345 | 379 | </object> |
346 | 380 | <packing> |
522 | 556 | controller settings. |
523 | 557 | MIDI controller settings are always saved and loaded with the |
524 | 558 | main session.</property> |
525 | <property name="use_action_appearance">False</property> | |
526 | 559 | <property name="use_underline">True</property> |
527 | 560 | <property name="draw_indicator">True</property> |
528 | 561 | </object> |
549 | 582 | <action-widget response="-7">button5</action-widget> |
550 | 583 | </action-widgets> |
551 | 584 | </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> | |
577 | 585 | </interface> |
38 | 38 | static double always_inline B2N(int ta, double beat) { |
39 | 39 | double beatta = beat; |
40 | 40 | switch(ta) { |
41 | case(0): | |
41 | case(0): | |
42 | beatta *=3.0; | |
42 | 43 | break; |
43 | 44 | case(1): |
44 | beatta *=3.0; | |
45 | beatta *=2.0; | |
45 | 46 | break; |
46 | 47 | case(2): |
47 | beatta *=2.0; | |
48 | beatta *=1.3333; | |
48 | 49 | break; |
49 | 50 | case(3): |
50 | beatta *=1.3333; | |
51 | beatta *=1.5; | |
51 | 52 | break; |
52 | 53 | case(4): |
53 | beatta *=1.5; | |
54 | beatta =beat; | |
54 | 55 | break; |
55 | 56 | case(5): |
56 | beatta =beat; | |
57 | beatta *=0.6666; | |
57 | 58 | break; |
58 | 59 | case(6): |
59 | beatta *=0.6666; | |
60 | beatta *=0.75; | |
60 | 61 | break; |
61 | 62 | case(7): |
62 | beatta *=0.75; | |
63 | beatta *=0.5; | |
63 | 64 | break; |
64 | 65 | case(8): |
65 | beatta *=0.5; | |
66 | beatta *=0.333; | |
66 | 67 | break; |
67 | 68 | case(9): |
68 | beatta *=0.333; | |
69 | beatta *=0.45; | |
69 | 70 | break; |
70 | 71 | case(10): |
71 | beatta *=0.45; | |
72 | beatta *=0.25; | |
72 | 73 | break; |
73 | 74 | case(11): |
74 | beatta *=0.25; | |
75 | beatta *=0.1666; | |
75 | 76 | break; |
76 | 77 | case(12): |
77 | beatta *=0.1666; | |
78 | beatta *=0.1875; | |
78 | 79 | break; |
79 | 80 | case(13): |
80 | beatta *=0.1875; | |
81 | beatta *=0.125; | |
81 | 82 | break; |
82 | 83 | case(14): |
83 | beatta *=0.125; | |
84 | beatta *=0.083334; | |
84 | 85 | break; |
85 | 86 | case(15): |
86 | beatta *=0.083334; | |
87 | beatta *=0.09375; | |
87 | 88 | break; |
88 | 89 | case(16): |
89 | beatta *=0.09375; | |
90 | beatta *=0.0625; | |
90 | 91 | break; |
91 | 92 | case(17): |
92 | beatta *=0.0625; | |
93 | break; | |
94 | case(18): | |
95 | 93 | beatta *=0.041666; |
96 | 94 | break; |
97 | 95 | default: |
384 | 384 | if (pl->get_pdef()->register_params) { |
385 | 385 | pmap.set_replace_mode(true); |
386 | 386 | 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); | |
387 | 391 | preg.plugin = pl->get_pdef(); |
388 | 392 | pl->get_pdef()->register_params(preg); |
389 | 393 | pmap.set_replace_mode(false); |
644 | 644 | if (!self.engine.mono_chain.is_stopped()) { |
645 | 645 | self.check_overload(); |
646 | 646 | } |
647 | self.transport_state = jack_transport_query (self.client, &self.current); | |
647 | 648 | // gx_head DSP computing |
648 | 649 | self.engine.mono_chain.process( |
649 | 650 | nframes, |
653 | 654 | // midi input processing |
654 | 655 | if (self.ports.midi_input.port) { |
655 | 656 | 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 | } | |
658 | 664 | } |
659 | 665 | gx_system::measure_pause(); |
660 | 666 | self.engine.mono_chain.post_rt_finished(); |
59 | 59 | {11, "Expression"}, |
60 | 60 | {12, "Effect Control 1"}, |
61 | 61 | {13, "Effect Control 2"}, |
62 | ||
63 | {22, "Midi Beat Clock"}, | |
64 | {23, "Clock start/stop"}, | |
65 | {24, "Jack Transport"}, | |
62 | 66 | |
63 | 67 | {32, "Bank Select LSB"}, |
64 | 68 | |
276 | 280 | } |
277 | 281 | } |
278 | 282 | } 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 | ||
279 | 287 | ret = param->midi_set(n, 127, _lower, _upper); |
280 | 288 | } |
281 | 289 | return ret; |
282 | 290 | } |
283 | 291 | |
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 | } | |
284 | 319 | |
285 | 320 | /**************************************************************** |
286 | 321 | ** class ControllerArray |
350 | 385 | return false; |
351 | 386 | } |
352 | 387 | |
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 | ||
353 | 436 | /**************************************************************** |
354 | 437 | ** class MidiControllerList |
355 | 438 | */ |
359 | 442 | last_midi_control_value(), |
360 | 443 | last_midi_control(-2), |
361 | 444 | program_change(-1), |
445 | time0(0), | |
446 | bpm_(9), | |
447 | mp(), | |
362 | 448 | pgm_chg(), |
363 | 449 | changed(), |
364 | 450 | new_program(), |
470 | 556 | } |
471 | 557 | } |
472 | 558 | 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); | |
473 | 571 | } |
474 | 572 | |
475 | 573 | void MidiControllerList::set_controller_array(const ControllerArray& m) { |
512 | 610 | } |
513 | 611 | } |
514 | 612 | |
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 | ||
515 | 639 | // ----- 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) { | |
517 | 641 | jack_midi_event_t in_event; |
518 | 642 | jack_nframes_t event_count = jack_midi_get_event_count(midi_input_port_buf); |
519 | 643 | unsigned int i; |
524 | 648 | pgm_chg(); |
525 | 649 | } else if ((in_event.buffer[0] & 0xf0) == 0xb0) { // controller |
526 | 650 | 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 | } | |
527 | 671 | } |
528 | 672 | } |
529 | 673 | } |
668 | 812 | return false; |
669 | 813 | } |
670 | 814 | |
815 | bool Parameter::midi_set_bpm(float n, float high, float llimit, float ulimit) { | |
816 | assert(false); | |
817 | return false; | |
818 | } | |
819 | ||
671 | 820 | void Parameter::trigger_changed() { |
672 | 821 | assert(false); |
673 | 822 | } |
880 | 1029 | case Continuous: |
881 | 1030 | assert(n >= 0 && n <= high); |
882 | 1031 | 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 | } | |
883 | 1060 | break; |
884 | 1061 | case Switch: |
885 | 1062 | v = (2*n > high ? 1.0 : 0.0); |
584 | 584 | } |
585 | 585 | } |
586 | 586 | |
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 | ||
587 | 599 | void PluginList::registerParameter(Plugin *pl, ParamMap& param, ParamRegImpl& preg) { |
588 | 600 | pl->register_vars(param, seq); |
589 | 601 | PluginDef *pd = pl->get_pdef(); |
1020 | 1020 | return true; |
1021 | 1021 | } |
1022 | 1022 | |
1023 | void LadspaLoader::set_plugins(pluginarray& new_plugins) { | |
1023 | void LadspaLoader::change_plugins(pluginarray& new_plugins) { | |
1024 | 1024 | for (pluginarray::iterator i = plugins.begin(); i != plugins.end(); ++i) { |
1025 | 1025 | delete *i; |
1026 | 1026 | } |
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 | //} | |
1027 | 1034 | plugins = new_plugins; |
1028 | 1035 | } |
1029 | 1036 |
220 | 220 | case RESPONSE_DELETE: |
221 | 221 | m->machine.midi_deleteParameter(m->param); |
222 | 222 | 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; | |
223 | 254 | } |
224 | 255 | gtk_widget_destroy(m->dialog); |
225 | 256 | } |
358 | 389 | if (nctl == -1) { |
359 | 390 | gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), RESPONSE_DELETE, FALSE); |
360 | 391 | 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); | |
361 | 393 | gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL); |
362 | 394 | } |
363 | 395 | machine.midi_set_config_mode(true, nctl); |
264 | 264 | sigc::mem_fun(*this, &GxUiRadioMenu::on_changed)); |
265 | 265 | action = act; |
266 | 266 | } |
267 | //fprintf(stderr, "%s \n", p->value_id); | |
267 | 268 | } |
268 | 269 | s.append(postfix); |
269 | 270 | uimanager->add_ui_from_string(s); |
503 | 504 | bld->find_widget("tuner_mode", tuner_mode); |
504 | 505 | bld->find_widget("tuner_reference_pitch", tuner_reference_pitch); |
505 | 506 | bld->find_widget("tuner_tuning", tuner_tuning); |
507 | bld->find_widget("tuner_temperament", tuner_temperament); | |
506 | 508 | bld->find_widget("racktuner", racktuner); |
507 | 509 | bld->find_widget("ampdetail_compress:effect_reset", ampdetail_compress); |
508 | 510 | bld->find_widget("ampdetail_expand:effect_reset", ampdetail_expand); |
1703 | 1705 | } |
1704 | 1706 | } else { |
1705 | 1707 | 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(); | |
1706 | 1710 | pui->update_rackbox(); |
1711 | pui->plugin->set_on_off(state); | |
1707 | 1712 | if (c == gx_engine::PluginChange::update_category) { |
1708 | 1713 | pui->unset_ui_merge_id(uimanager); |
1709 | 1714 | pui->group = add_plugin_category(pui->get_category()); |
1817 | 1822 | Glib::ustring actionname = Glib::ustring::compose("Plugin_%1", pui->get_id()); |
1818 | 1823 | const char *tp = (pui->get_type() == PLUGIN_TYPE_MONO ? "Mono" : "Stereo"); |
1819 | 1824 | 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()); | |
1820 | 1826 | return actionname; |
1821 | 1827 | } |
1822 | 1828 | |
2062 | 2068 | if (mode > 0) { |
2063 | 2069 | tuner.set_display_flat(tuning_tab[mode-1].flat); |
2064 | 2070 | 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); | |
2066 | 2072 | } |
2067 | 2073 | } else { |
2068 | 2074 | tuner.set_display_flat(false); |
2069 | 2075 | } |
2076 | } | |
2077 | ||
2078 | void MainWindow::setup_tuner_temperament(Gxw::RackTuner& tuner) { | |
2079 | tuner.set_temperament(tuner_temperament->get_value()); | |
2080 | set_tuning(tuner); | |
2081 | ||
2070 | 2082 | } |
2071 | 2083 | |
2072 | 2084 | void MainWindow::setup_tuner(Gxw::RackTuner& tuner) { |
2084 | 2096 | sigc::mem_fun(*tuner_reference_pitch, &Gxw::Wheel::get_value))); |
2085 | 2097 | tuner_tuning->signal_value_changed().connect( |
2086 | 2098 | 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 | ||
2087 | 2102 | } |
2088 | 2103 | |
2089 | 2104 | bool MainWindow::on_toggle_mute(GdkEventButton* ev) { |
2821 | 2836 | } else { |
2822 | 2837 | gtk_rc_parse( |
2823 | 2838 | (options.get_style_filepath("clear.rc")).c_str()); |
2839 | make_icons(); | |
2824 | 2840 | } |
2825 | 2841 | |
2826 | 2842 | // call some action functions to sync state |
117 | 117 | {"Augmented Fourths"},{"Slow Motion"},{"Admiral"},{"Buzzard"},{"Face"},{"Four and Twenty"},{"Ostrich"},{"Capo 200"}, |
118 | 118 | {"Balalaika"},{"Cittern One"},{"Cittern Two"},{"Dobro"},{"Lefty"},{"Mandoguitar"},{"Rusty Cage"},{"Hardcore"}, {0}}; |
119 | 119 | 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); | |
120 | 122 | pmap.reg_par_non_preset("racktuner.scale_lim", "Limit", 0, 3.0, 1.0, 10.0, 1.0); |
121 | 123 | pmap.reg_par_non_preset("ui.tuner_reference_pitch", "?Tuner Reference Pitch", 0, 440, 427, 453, 0.1); |
122 | 124 | //pmap.reg_par("racktuner.scale_lim", "Limit", &scale_lim, 3.0, 1.0, 10.0, 1.0); FIXME add in detail view? |
169 | 169 | if (*i == rackbox) { |
170 | 170 | break; |
171 | 171 | } |
172 | display(false,false); | |
172 | 173 | 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); | |
174 | 177 | } else { |
175 | 178 | delete rackbox; |
176 | 179 | rackbox = 0; |
586 | 586 | pluginarray::iterator end() { return plugins.end(); } |
587 | 587 | pluginarray::iterator find(plugdesc* desc); |
588 | 588 | void set_plugins(pluginarray& new_plugins); |
589 | void change_plugins(pluginarray& new_plugins); | |
589 | 590 | void update_instance(PluginDef *pdef, plugdesc *pdesc); |
590 | 591 | static std::string get_ladspa_filename(unsigned long uid) |
591 | 592 | { return "ladspa"+gx_system::to_string(uid)+".js"; } |
157 | 157 | |
158 | 158 | jack_client_t* client; |
159 | 159 | 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; | |
160 | 164 | |
161 | 165 | jack_nframes_t get_jack_sr() { return jack_sr; } |
162 | 166 | jack_nframes_t get_jack_bs() { return jack_bs; } |
635 | 635 | Gxw::Selector *tuner_mode; |
636 | 636 | Gxw::Wheel *tuner_reference_pitch; |
637 | 637 | Gxw::Selector *tuner_tuning; |
638 | Gxw::Selector *tuner_temperament; | |
638 | 639 | Gxw::RackTuner *racktuner; |
639 | 640 | Gtk::Button *ampdetail_compress; |
640 | 641 | Gtk::Button *ampdetail_expand; |
719 | 720 | void on_engine_state_change(gx_engine::GxEngineState state); |
720 | 721 | void set_new_skin(const Glib::ustring& skin_name); |
721 | 722 | void set_tuning(Gxw::RackTuner& tuner); |
723 | void setup_tuner_temperament(Gxw::RackTuner& tuner); | |
722 | 724 | void setup_tuner(Gxw::RackTuner& tuner); |
723 | 725 | bool on_toggle_mute(GdkEventButton* ev); |
724 | 726 | void on_msg_level_changed(); |
106 | 106 | enum ctrl_type { None, Continuous, Switch, Enum }; |
107 | 107 | private: |
108 | 108 | 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 | |
109 | 110 | virtual void trigger_changed(); |
110 | 111 | friend class MidiController; |
111 | 112 | protected: |
222 | 223 | class ParameterV<float>: public Parameter { |
223 | 224 | private: |
224 | 225 | 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 | |
225 | 227 | virtual void trigger_changed(); |
226 | 228 | protected: |
227 | 229 | float json_value; |
675 | 677 | Parameter& getParameter() const { return *param; } |
676 | 678 | static MidiController *readJSON(gx_system::JsonParser& jp, ParamMap& param); |
677 | 679 | 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 | |
678 | 682 | void set(float v, float high) { param->midi_set(v, high, _lower, _upper); } |
679 | 683 | void trigger_changed() { param->trigger_changed(); } |
680 | 684 | void writeJSON(gx_system::JsonWriter& jw) const; |
686 | 690 | ** |
687 | 691 | ** MidiControllerList |
688 | 692 | **/ |
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 | ||
689 | 712 | |
690 | 713 | class ControllerArray: public vector<midi_controller_list> { |
691 | 714 | public: |
705 | 728 | int last_midi_control_value[ControllerArray::array_size]; //RT |
706 | 729 | int last_midi_control; //RT |
707 | 730 | volatile gint program_change; //RT |
731 | timespec ts1; | |
732 | double time0; | |
733 | unsigned int bpm_; | |
734 | MidiClockToBpm mp; | |
708 | 735 | Glib::Dispatcher pgm_chg; |
709 | 736 | sigc::signal<void> changed; |
710 | 737 | sigc::signal<void,int> new_program; |
721 | 748 | int get_current_control() { return last_midi_control; } |
722 | 749 | void set_current_control(int ctl) { last_midi_control = ctl; } |
723 | 750 | void set_ctr_val(int ctr, int val); //RT |
751 | void set_bpm_val(unsigned int val); //RT | |
724 | 752 | void deleteParameter(Parameter& param); |
725 | 753 | void modifyCurrent(Parameter& param, float lower, float upper, bool toggle); |
726 | 754 | int param2controller(Parameter& param, const MidiController** p) { |
734 | 762 | void remove_controlled_parameters(paramlist& plist, const ControllerArray *m); |
735 | 763 | sigc::signal<void>& signal_changed() { return changed; } |
736 | 764 | 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 | |
738 | 767 | void update_from_controller(int ctr); |
739 | 768 | void update_from_controllers(); |
740 | 769 | sigc::signal<void, int, int>& signal_midi_value_changed() { return midi_value_changed; } |
171 | 171 | void registerPlugin(Plugin *pl, ParamMap& param, ParameterGroups& groups); |
172 | 172 | void unregisterGroup(PluginDef *pd, ParameterGroups& groups); |
173 | 173 | void unregisterParameter(Plugin *pl, ParamMap& param); |
174 | void rescueParameter(Plugin *pl, ParamMap& param); | |
174 | 175 | void unregisterPlugin(Plugin *pl, ParamMap& param, ParameterGroups& groups); |
175 | 176 | void registerAllPlugins(ParamMap& param, ParameterGroups& groups); |
176 | 177 | void ordered_mono_list(list<Plugin*>& mono, int mode); |
178 | 178 | old_stdout = sys.stdout |
179 | 179 | capturer = StringIO.StringIO() |
180 | 180 | sys.stdout = capturer |
181 | args = [1, self.scale5.get_value()*1e3] | |
181 | args = [1, 1.5*1e3] | |
182 | 182 | c.show_vk0(args) |
183 | 183 | sys.stdout = old_stdout |
184 | 184 | 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) ) | |
187 | 196 | |
188 | 197 | def on_table_progress(self): |
189 | 198 | script_dir = sys.path[0] |