Codebase list guitarix / 09c45ea
Imported Upstream version 0.11.1 Ross Gammon 8 years ago
44 changed file(s) with 446 addition(s) and 472 deletion(s). Raw diff Collapse all Expand all
0 guitarix (0.09.0SVN) unstable; urgency=low
1
2 * SVN HEAD
3
4 -- brummer <brummer-@web.de> Fri, 14 May 2010 17:18:15 +0200
0 guitarix (0.11.1) unstable; urgency=low
1 * fix Bug Echo/Chorus/Delay/Slooper dont work
2 * add pre/post processing switch to all mono Effects
3
4 -- brummer <brummer-@web.de> Sun, 24 Aug 2010 15:47:15 +0200
5
6 guitarix (0.11.0) unstable; urgency=low
7 * new version of the impulse response parameter editor. You can
8 now graphically define a gain line to be applied to the IR data,
9 e.g. emphasize a part of the early reflections or damping the
10 reverb tail to make it fit to your guitar sound.
11 * the multi-line distortion effect now has 4 frequency bands and
12 is better optimized
13 * fix regression from version 0.10.0: now the default preset file is
14 created again if it doesn't exist (e.g. in new installations).
15
16 -- Andreas Degert <andreas.degert@googlemail.com> Tue, 03 Aug 2010 22:13:50 +0200
17
18 guitarix (0.10.0) unstable; urgency=low
19
20 * add tonestack models
21 * add 2. amp model
22 * add cabinet impulse response modul
23 * add Patch Info widget
24 * add Preset File Load/Export option
25 * add simple looper
26 * add Oscilloscope and tuner state to main settings
27 * selectable distortion model (multi/single line)
28 * selectable EQ model (fixed/scalable freq)
29 * free mem when not used (delay lines)
30 * reworked Gui
31 * fix varios bugs
32
33 -- brummer <brummer-@web.de> Sun, 11 Jul 2010 07:18:15 +0200
34
35 guitarix (0.09.0) unstable; urgency=low
36
37 * make distortion a multiband distortion
38 * fix bug in resample IR-files
39 * resample IR-files now on-the-fly
40 * add insert point ports to the effect chain
41 * add --optimization flag for configure the build
42 * switch to double precision instead of single precision
43 * fix bug in reconfigure convolver when preset change
44 * add patch from Peder Hedlund, build against gtk-2.12.9 and gcc-4.3.1
45 * add faust 0.9.24 to the "good_faust_versions"
46
47 -- brummer <brummer-@web.de> Sun, 06 Jun 2010 17:18:15 +0200
548
649 guitarix (0.08.0) unstable; urgency=low
750
+0
-271
debian/changelog less more
0 guitarix (0.09.0SVN) unstable; urgency=low
1
2 * SVN HEAD
3
4 -- brummer <brummer-@web.de> Fri, 14 May 2010 17:18:15 +0200
5
6 guitarix (0.08.0) unstable; urgency=low
7
8 * new portmap window
9 * add Quad Filter
10 * add Moog Filter
11 * add Flanger
12 * add new post processing tube3
13 * add two 10 band parametric EQ's
14 * add oversample mode selector
15 * fix some bugs in midi out
16 * reworked tuner interface (show frequency(hz))
17 * add new configure options (see ./waf --help form more info)
18
19 -- Andreas Degert <andreas.degert@googlemail.com> Fri, 14 May 2010 15:18:15 +0200
20
21 guitarix (0.07.1) unstable; urgency=low
22
23 * version check of ~/.guitarix was commented out
24
25 -- Andreas Degert <andreas.degert@googlemail.com> Tue, 29 Mar 2010 22:13:50 +0200
26
27 guitarix (0.07.0) unstable; urgency=low
28
29 * nearly complete reworked source by Andreas Degert
30 * amp and effect units based direct on faust expressions
31 * all faust sources included
32 * new accumulated tuner unit with new interface (analogue Style needle meter)
33 * Midi controller connections could saved with in presets and/or general
34 * a editable Midi controller map is available
35 * new human readable preset style
36 * knobs could be used like sliders (press ctrl + mouse-button
37 and move the mouse horizontal, leave the ctrl and hold mouse-button
38 for fine tune), or like real knobs (turn them around)
39 * convolution unit based on zita-convolver is now integrated in the engine
40 * presets could change with Midi Program Messages
41 * I'm sure I have some things forgotten to mention here.
42
43 -- Andreas Degert <andreas.degert@googlemail.com> Tue, 28 Mar 2010 21:09:25 +0200
44
45 guitarix (0.05.4-1) unstable; urgency=low
46 * performace boost by remove float to int casts from engine
47 * reorder GUI
48
49 -- brummer <brummer-@web.de> Mon, 02 Dec 2009 16:20:56 +0200
50
51 guitarix (0.05.3-1) unstable; urgency=low
52 * quick update to cover renaming of jconv to jconvolver
53
54 -- brummer <brummer-@web.de> Mon, 02 Dec 2009 16:20:56 +0200
55
56 guitarix (0.05.2-1) unstable; urgency=low
57 * varios improvements
58
59 -- brummer <brummer-@web.de> Mon, 30 Nov 2009 13:20:56 +0200
60
61 guitarix (0.05.1-1) unstable; urgency=low
62 * varios improvements
63
64 -- brummer <brummer-@web.de> Mon, 26 Oct 2009 08:24:42 +0200
65
66 guitarix (0.05.0-1) unstable; urgency=low
67 * add keyboard shortcuts
68 * new code structure by James
69 * impruved skin handling
70 * add middle tone control
71 * reworked audio engine
72 * add bypass mode
73 * add logging window
74 * add engine state widget
75
76 -- brummer <brummer-@web.de> Mon, 27 Jul 2009 08:24:42 +0200
77
78 guitarix (0.04.6-1) unstable; urgency=low
79 * switch to waf build system
80 * use boost libary for cmd commands
81 * varios code cleanups by James
82 * new tube model
83 * add scrollwheel controlls
84
85 -- brummer <brummer-@web.de> Wed, 24 Jun 2009 14:24:42 +0200
86
87 guitarix (0.04.5-1) unstable; urgency=low
88 * fix wrong porthandling in dsp
89 * add latency menu by James Warden
90 * impruve midi out
91
92 -- brummer <brummer-@web.de> Thu, 26 May 2009 14:24:42 +0200
93
94 guitarix (0.04.4-1) unstable; urgency=low
95 * switch back to use portbuffer for midi output
96 * add some audio effect's
97 * impruve tuner and midi out
98 * add fix's for makefile/readme/changlog submit by Orcan Ogetbil
99
100 -- brummer <brummer-@web.de> Wed, 21 May 2009 14:24:42 +0200
101
102 guitarix (0.04.3-1) unstable; urgency=low
103 * fix denormals
104
105 -- brummer <brummer-@web.de> Wed, 06 Mar 2009 07:24:42 +0200
106
107 guitarix (0.04.2-1) unstable; urgency=low
108 * bug fix release, fix wrong porthandling
109 * add anti aliase unit
110
111 -- brummer <brummer-@web.de> Tue, 05 Mar 2009 07:24:42 +0200
112
113 guitarix (0.04.1-1) unstable; urgency=low
114 * bug fix (upload the wrong source, sorry)
115
116 -- brummer <brummer-@web.de> Thu, 28 Mar 2009 07:24:42 +0200
117
118 guitarix (0.04.0-1) unstable; urgency=low
119 * add more Oscilloscope modes
120 * fix bug port_registration with jackdmp
121 * set jack_midi_port stable
122 * improve UI
123
124 -- brummer <brummer-@web.de> Thu, 23 Mar 2009 17:24:42 +0200
125
126 guitarix (0.03.9-1) unstable; urgency=low
127 * add Oscilloscope like wave view widget
128 * fix bug in jconv gain settings
129 * set jack_midi_port to be temporarly (off by default)
130 * remove sse and fast-math flags from makefile
131
132 -- brummer <brummer-@web.de> Thu, 26 Mar 2009 18:24:42 +0200
133
134 guitarix (0.03.8-1) unstable; urgency=low
135 * add wave view and select samples widget to the jconv settings
136 * some bugfixe's, some cleanup's
137 * add auto gain correction to Overdrive
138
139 -- brummer <brummer-@web.de> Wed, 18 Mar 2009 11:24:42 +0200
140
141 guitarix (0.03.7-svn-1) unstable; urgency=low
142 * make single ladspa plugins from the inbuild effects
143 * new sorce structure
144
145 -- brummer <brummer-@web.de> Fri, 06 Mar 2009 11:24:42 +0200
146
147 guitarix (0.03.7-1) unstable; urgency=low
148 * rework distortion
149 * bugfix in adjustment call for entry's, reportet by Aurélien Leblond
150
151 -- brummer <brummer-@web.de> Thu, 05 Feb 2009 11:24:42 +0200
152
153 guitarix (0.03.6-1) unstable; urgency=low
154 * add overdrive
155 * make GUI smaler
156
157 -- brummer <brummer-@web.de> Thu, 05 Feb 2009 11:24:42 +0200
158
159 guitarix (0.03.5-1) unstable; urgency=low
160 * change knob pointer
161
162 -- brummer <brummer-@web.de> Wed, 04 Feb 2009 17:24:42 +0200
163
164 guitarix (0.03.4-1) unstable; urgency=low
165 * use knobs, switchs and graphicaly sliders for the interface
166 * set black style as default
167 * make effekts modular
168 * new preamp model
169
170 -- brummer <brummer-@web.de> Wed, 04 Feb 2009 14:24:42 +0200
171
172 guitarix (0.03.3-1) unstable; urgency=low
173 * add resampler for ir.wav files
174 * autoremove white space in ir.wav file names
175 * protected advanced setting widgets for destroy call from window manager
176 * add experimental tuner
177 * add jack midi out port
178 * add pitch tracker/beatdetector to midi converter
179 * add midi controlls for velocity, channel choose, program choose, okatve switch and sensity
180 * add more midi out channels (3), clean up the processing
181 * add controll interface for pitch tracker/beatdetector
182 * add extra tread for midi processing
183 * add system tray icon with menu
184 * add high cpu load sys tray warning and midi send notify
185 * clean up midi process
186 * set midi process to a lower rt level (-20) when run in realtime
187 * add compressor
188 * add midi controlles for volume and auto pichweel
189
190
191 -- brummer <brummer-@web.de> Wed, 14 Dec 2009 14:24:42 +0200
192
193 guitarix (0.03.a-1) unstable; urgency=low
194 * bug fix for jconv wet/dry slider
195 * bug fix for jconv gain settings
196
197 -- brummer <brummer-@web.de> Thu, 03 Dec 2008 16:24:42 +0200
198
199
200 guitarix (0.03.0-1) unstable; urgency=low
201 * add advanced setting widgets to distortion, freeverb, ImpulseResponse and Crybaby
202 * rework the jconv settings window
203 * split code
204
205 -- brummer <brummer-@web.de> Sun, 23 Nov 2008 16:24:42 +0200
206
207 guitarix (0.02.9a-1) unstable; urgency=low
208 * bugfix for the run jconv handling
209 * bugfix a typo in the Makefile for the LADSPAPATH
210 * clean code
211
212 -- brummer <brummer-@web.de> Mon, 10 Nov 2008 13:55:42 +0200
213
214
215 guitarix (0.02.9-1) unstable; urgency=low
216 * add a wet/dry fader for jconv
217 * clean code
218
219 -- brummer <brummer-@web.de> Sat, 08 Nov 2008 13:55:42 +0200
220
221 guitarix (0.02.8-1) unstable; urgency=low
222 * add more settings for jconv
223 * clean code
224
225 -- brummer <brummer-@web.de> Thu, 06 Nov 2008 13:55:42 +0200
226
227 guitarix (0.02.7-1) unstable; urgency=low
228 * add suport for jconv
229 * use jack_capture_gui2 to create the comandline for jack_capture
230 * add preamp
231 * change preset handling to save by name include the jconv settings
232 * rework the distortion funktion
233 * add all effekts to the ladspa plugin
234 * add versioncheck to make sure the saved presets work with new version
235
236 -- brummer <brummer-@web.de> Thu, 02 Nov 2008 13:24:31 +0200
237
238 guitarix (0.02.4-1) unstable; urgency=low
239 * change the gui to expander
240 * add suport for meterbridge
241 * add macro for no see environment
242 * add nogui parameter and options
243 * add record with jack_capture
244 * add feedback and feedforward filter
245 * start to clean the code.
246 * remove the skin option, all colers comes now from Gtk.
247
248 -- brummer <brummer-@web.de> Thu, 05 Aug 2008 13:24:31 +0200
249
250 guitarix (0.02.3-1) unstable; urgency=low
251 * add nogui parameter and options
252 * add record with jack_capture
253 * add feedback and feedforward filter
254 * start to clean the code.
255 * remove the skin option, all colers comes now from Gtk.
256
257 -- brummer <brummer-@web.de> Thu, 03 Aug 2008 13:24:31 +0200
258
259 guitarix (0.02.2-1) unstable; urgency=low
260 * add echo, crybaby and ImpulseResponse
261 * add menu save and load presets
262
263 -- brummer <brummer-@web.de> Thu, 23 Jul 2008 13:24:31 +0200
264
265 guitarix (0.02.1-1) unstable; urgency=low
266 * add Distortion and Freeverb
267 * add skin and gtk.rc file suport
268 * Initial Release.(0.01)
269
270 -- brummer <brummer-@web.de> Thu, 05 Jul 2008 13:24:31 +0200
0 ../changelog
3737 rm -f build-stamp configure-stamp
3838
3939 # Add here commands to clean up after the build process.
40 ./waf clean
40 ./waf distclean
4141
4242 dh_clean
4343
1616 */
1717
1818 #include <gtk/gtk.h>
19 #include <gxw/gxinit.h>
1920 #include "config.h"
2021
2122 /* Catalog init function */
2223 void glade_gx_init (const char *name)
2324 {
25 gxw_init();
2426 gtk_icon_theme_append_search_path(
2527 gtk_icon_theme_get_default(), GX_ICON_DIR);
2628 }
3838 target = 'gladegx',
3939 lib = ["gxw"],
4040 libpath = bld.path.find_dir("../libgxw/gxw").bldpath(bld.env),
41 includes = ['..'],
41 includes = ['..','../libgxw'],
4242 install_path = bld.env["GLADE_MODULES_DIR"],
4343 )
4444
6969 gint slider_width;
7070 gtk_widget_style_get(widget, "slider-width", &slider_width, NULL);
7171 GdkPixbuf *image1 = gdk_pixbuf_copy(image);
72 gdk_pixbuf_copy_area(image, rect->width, 0, slider_width, rect->height, image1, sliderstate, 0);
72 gdk_pixbuf_copy_area(image, rect->width, 0, slider_width, rect->height, image1, (int)(sliderstate), 0);
7373 if (has_focus) {
7474 gdk_pixbuf_saturate_and_pixelate(image1, image1, sat, FALSE);
7575 if (paint_focus) {
8383 g_object_unref(image1);
8484 }
8585
86 static const gint sat = 70.0;
86 static const gdouble sat = 70.0;
8787
8888 static gboolean gx_hslider_expose(GtkWidget *widget, GdkEventExpose *event)
8989 {
103103 break;
104104 case GTK_POS_TOP:
105105 case GTK_POS_BOTTOM:
106 value_rect.x = image_rect.x + sliderstate - (value_rect.width - slider_width)/2;
106 value_rect.x = image_rect.x + (int)sliderstate - (value_rect.width - slider_width)/2;
107107 if (value_rect.x + value_rect.width > widget->allocation.x + widget->allocation.width) {
108108 value_rect.x = widget->allocation.x + widget->allocation.width - value_rect.width;
109109 }
150150 gboolean drag, int state, int button)
151151 {
152152 int linearmode = ((state & GDK_CONTROL_MASK) == 0) ^ jump_to_mouse;
153 GdkRectangle image_rect;
153 GdkRectangle image_rect, value_rect;
154154 GdkPixbuf *pb = gtk_widget_render_icon(widget, icon, GtkIconSize(-1), NULL);
155155 image_rect.width = gdk_pixbuf_get_width(pb);
156156 image_rect.height = gdk_pixbuf_get_height(pb);
157157 g_object_unref(pb);
158158 x += widget->allocation.x;
159159 y += widget->allocation.y;
160 _gx_regler_get_positions(GX_REGLER(widget), &image_rect, NULL);
161 if (!drag && !_approx_in_rectangle(x, y, &image_rect)) {
162 return FALSE;
163 }
164 if (button == 3) {
165 gboolean ret;
166 g_signal_emit_by_name(GX_REGLER(widget), "value-entry", &image_rect, &ret);
167 return FALSE;
160 _gx_regler_get_positions(GX_REGLER(widget), &image_rect, &value_rect);
161 if (!drag) {
162 GdkRectangle *rect = NULL;
163 if (_approx_in_rectangle(x, y, &image_rect)) {
164 if (button == 3) {
165 rect = &image_rect;
166 }
167 } else if (_approx_in_rectangle(x, y, &value_rect)) {
168 if (button == 1 || button == 3) {
169 rect = &value_rect;
170 } else {
171 return FALSE;
172 }
173 } else {
174 return FALSE;
175 }
176 if (rect) {
177 gboolean ret;
178 g_signal_emit_by_name(GX_REGLER(widget), "value-entry", rect, &ret);
179 return FALSE;
180 }
168181 }
169182 static double last_y = 2e20;
170183 GxKnob *knob = GX_KNOB(widget);
516516 /* create a cairo context */
517517 cr = gdk_cairo_create(wi->window);
518518
519 double x0 = wi->allocation.x+1;
520 double y0 = wi->allocation.y+1;
521 double rect_width = wi->allocation.width-2;
522 double rect_height = wi->allocation.height-3;
519 gint x0 = wi->allocation.x+1;
520 gint y0 = wi->allocation.y+1;
521 gint rect_width = wi->allocation.width-2;
522 gint rect_height = wi->allocation.height-3;
523523
524524 stock_image = gtk_widget_render_icon(wi,"guitar",(GtkIconSize)-1,NULL);
525525 _image = gdk_pixbuf_scale_simple(
599599 /* create a cairo context */
600600 cr = gdk_cairo_create(wi->window);
601601
602 double x0 = wi->allocation.x+1;
603 double y0 = wi->allocation.y+1;
604 double rect_width = wi->allocation.width-2;
605 double rect_height = wi->allocation.height-3;
602 gint x0 = wi->allocation.x+1;
603 gint y0 = wi->allocation.y+1;
604 gint rect_width = wi->allocation.width-2;
605 gint rect_height = wi->allocation.height-3;
606606
607607 stock_image = gtk_widget_render_icon(wi,"tribe",(GtkIconSize)-1,NULL);
608608 _image = gdk_pixbuf_scale_simple(
2727 #include <gtk/gtkprivate.h>
2828 #include <gtk/gtkbindings.h>
2929 #include <gtk/gtkmarshal.h>
30
31 #define gtk_widget_get_requisition(w, r) (*r = (w)->requisition)
3032
3133 #define P_(s) (s) // FIXME -> gettext
3234 #define I_(s) (s) // FIXME -> gettext
129131 {
130132 gboolean continue_emission;
131133 gboolean signal_handled;
132
134
133135 signal_handled = g_value_get_boolean (handler_return);
134136 g_value_set_boolean (return_accu, signal_handled);
135137 continue_emission = !signal_handled;
136
138
137139 return continue_emission;
138140 }
139141
143145 {
144146 gboolean continue_emission;
145147 const gchar *str;
146
148
147149 str = g_value_get_string(handler_return);
148150 g_value_set_string(return_accu, str);
149151 continue_emission = str == NULL;
582584 }
583585
584586 static gboolean should_invert(GtkRange *range)
585 {
587 {
586588 if (range->orientation == GTK_ORIENTATION_HORIZONTAL) {
587589 return
588590 (range->inverted && !range->flippable) ||
605607 else
606608 step_back (range);
607609 break;
608
610
609611 case GTK_SCROLL_STEP_UP:
610612 case GTK_SCROLL_STEP_RIGHT:
611613 if (should_invert (range))
613615 else
614616 step_forward (range);
615617 break;
616
617
618
619
618620 case GTK_SCROLL_STEP_BACKWARD:
619621 step_back (range);
620622 break;
621
623
622624 case GTK_SCROLL_STEP_FORWARD:
623625 step_forward (range);
624626 break;
630632 else
631633 page_back (range);
632634 break;
633
635
634636 case GTK_SCROLL_PAGE_UP:
635637 case GTK_SCROLL_PAGE_RIGHT:
636638 if (should_invert (range))
638640 else
639641 page_forward (range);
640642 break;
641
643
642644 case GTK_SCROLL_PAGE_BACKWARD:
643645 page_back (range);
644646 break;
645
647
646648 case GTK_SCROLL_PAGE_FORWARD:
647649 page_forward (range);
648650 break;
742744 gboolean _approx_in_rectangle(gdouble x, gdouble y, GdkRectangle *rect)
743745 {
744746 const int off = 5;
747 if (rect->width == 0 || rect->height == 0) {
748 return FALSE;
749 }
745750 if (x >= rect->x-off && x < rect->x + rect->width + off &&
746751 y >= rect->y-off && y < rect->y + rect->height + off) {
747752 return TRUE;
11731178
11741179 static void gx_regler_init(GxRegler *regler)
11751180 {
1181 GTK_RANGE(regler)->round_digits = 0;
11761182 regler->value_position = GTK_POS_BOTTOM;
11771183 regler->show_value = TRUE;
11781184 regler->value_xalign = 0.5;
1919 #include <gtk/gtk.h>
2020 #include <gtk/gtkprivate.h>
2121 #include <string.h>
22
23 #define gtk_widget_get_requisition(w, r) (*r = (w)->requisition)
2224
2325 #define P_(s) (s) // FIXME -> gettext
2426
166166 float scale = -0.5;
167167 if (tuner->freq) {
168168 float fvis = 12 * log2f(tuner->freq/440.0);
169 int vis = round(fvis);
169 int vis = int(round(fvis));
170170 scale = (fvis-vis) / 2;
171171 vis = vis % 12;
172172 if (vis < 0) {
6262 image_rect.x, image_rect.y, image_rect.width, image_rect.height,
6363 GDK_RGB_DITHER_NORMAL, 0, 0);
6464 gdk_draw_pixbuf(GDK_DRAWABLE(widget->window), widget->style->fg_gc[0],
65 ws, wheelstate + image_rect.width, 0,
65 ws, (int)(wheelstate) + image_rect.width, 0,
6666 image_rect.x, image_rect.y, image_rect.width, image_rect.height,
6767 GDK_RGB_DITHER_NORMAL, 0, 0);
6868 gdk_draw_pixbuf(GDK_DRAWABLE(widget->window), widget->style->fg_gc[0],
6969 wp,0, 0,
70 image_rect.x+smoth_pointer+wheelstate*0.4, image_rect.y,
70 image_rect.x+smoth_pointer+(int)(wheelstate*0.4), image_rect.y,
7171 gdk_pixbuf_get_width(wp), image_rect.height,
7272 GDK_RGB_DITHER_NORMAL, 0, 0);
7373 _gx_regler_display_value(regler, &value_rect);
9292 {
9393 GtkAdjustment *adj = gtk_range_get_adjustment(GTK_RANGE(widget));
9494 GdkPixbuf *wb = gtk_widget_render_icon(widget, "wheel_back", GtkIconSize(-1), NULL);
95 GdkRectangle image_rect;
95 GdkRectangle image_rect, value_rect;
9696 image_rect.width = gdk_pixbuf_get_width(wb);
9797 image_rect.height = gdk_pixbuf_get_height(wb);
9898 x += widget->allocation.x;
9999 y += widget->allocation.y;
100 _gx_regler_get_positions(GX_REGLER(widget), &image_rect, NULL);
101 if (!drag && !_approx_in_rectangle(x, y, &image_rect)) {
102 return FALSE;
103 }
104 if (button == 3) {
105 gboolean ret;
106 g_signal_emit_by_name(GX_REGLER(widget), "value-entry", &image_rect, &ret);
107 return FALSE;
100 _gx_regler_get_positions(GX_REGLER(widget), &image_rect, &value_rect);
101 if (!drag) {
102 GdkRectangle *rect = NULL;
103 if (_approx_in_rectangle(x, y, &image_rect)) {
104 if (button == 3) {
105 rect = &image_rect;
106 }
107 } else if (_approx_in_rectangle(x, y, &value_rect)) {
108 if (button == 1 || button == 3) {
109 rect = &value_rect;
110 } else {
111 return FALSE;
112 }
113 } else {
114 return FALSE;
115 }
116 if (rect) {
117 gboolean ret;
118 g_signal_emit_by_name(GX_REGLER(widget), "value-entry", rect, &ret);
119 return FALSE;
120 }
108121 }
109122 double pos = adj->lower + ((x - image_rect.x)/image_rect.width)* (adj->upper - adj->lower);
110123 gboolean handled;
1616 */
1717
1818 #include <gtk/gtkiconfactory.h>
19 #include "GxIREdit.h"
20 #include "GxRadioButton.h"
21 #include "GxValueDisplay.h"
19 #include "gxinit.h"
2220
2321 #include "gximages.cc"
2422
5654 { NULL, NULL },
5755 };
5856
59 extern "C" void __attribute__ ((constructor)) gxw_init()
57 void gxw_init()
6058 {
6159 g_type_init();
6260 GtkIconFactory *factory = gtk_icon_factory_new();
0 /*
1 * Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 */
17
18 /******************************************************************************
19 part of guitarix, use knobs with Gtk
20 ******************************************************************************/
21
22 #ifndef __GX_RADIO_BUTTON_H__
23 #define __GX_RADIO_BUTTON_H__
24
25 #include <gtk/gtkradiobutton.h>
26 #include "compat2-12.h"
27
28 G_BEGIN_DECLS
29
30 void gxw_init();
31
32 G_END_DECLS
33
34 #endif /* __GX_RADIO_BUTTON_H__ */
4040 #include <gxw/GxMeterScale.h>
4141 #include <gxw/GxGradient.h>
4242 #include <gxw/GxValueDisplay.h>
43 #include <gxw/gxinit.h>
4344
4445 #endif /* __GXW_H__ */
1616 */
1717
1818 #include <gtkmm/main.h>
19 #include <gxw/gxinit.h>
20 #include <gxwmm/init.h>
1921 #include "wrap_init.h"
2022
21 extern "C" void __attribute__ ((constructor)) gxwmm_init()
23 namespace Gxw
2224 {
23 Gtk::Main::init_gtkmm_internals(); //Sets up the g type system and the Glib::wrap() table.
24 Gxw::wrap_init(); //Tells the Glib::wrap() table about the libsomethingmm classes.
25
26 void init()
27 {
28 gxw_init();
29 Gtk::Main::init_gtkmm_internals(); //Sets up the g type system and the Glib::wrap() table.
30 Gxw::wrap_init(); //Tells the Glib::wrap() table about the libsomethingmm classes.
2531 }
32
33 } // namespace Gxw
0 #ifndef GXWMM_INIT_H_INCLUDED
1 #define GXWMM_INIT_H_INCLUDED
2
3 namespace Gxw {
4
5 void init();
6
7 }
8
9 #endif /* GXWMM_INIT_H_INCLUDED */
66
77 }
88
9 #endif
9 #endif /* GXWMM_WRAP_INIT_H_INCLUDED */
1111 target = 'gxw_demo',
1212 uselib = 'GTKMM',
1313 includes = ['.','../libgxw'],
14 linkflags = "-Wl,-u,gxw_init",
1514 install_path = None,
1615 )
1716 if bld.env["GX_LIB_SHARED"]:
00 #include <pygobject.h>
1 #include <gxw/gxinit.h>
12 #define PY_ARRAY_UNIQUE_SYMBOL gxw_ARRAY_API
23 #include <numpy/arrayobject.h>
34
89 {
910 PyObject *m, *d;
1011
12 gxw_init();
1113 init_pygobject ();
1214 import_array();
1315
103103 prog.lib = ["gxw"]
104104 else:
105105 prog.uselib_local = ['gxw']
106 prog.linkflags = ["-Wl,-u,gxw_init"]
44
55 wet = vslider("wet_dry[name:wet/dry][tooltip:percentage of processed signal in output signal]", 100, 0, 100, 1) : /(100);
66 dry = 1 - wet;
7 deltadelay = vslider("diff_delay[name:Delta Delay][tooltip:delay left or right channel by the specified amount (unit: ms)]", 0, -10, 10, 0.01)*millisec;
7 deltadelay = vslider("diff_delay[name:Delta Delay][tooltip:delay left or right channel by the specified amount (unit: ms)]", 0, -10, 10, 0.01)*millisec : smoothi(0.999);
88 gain = vslider("gain[name:Gain][tooltip:gain trim for processed signal (unit: dB)]", 0, -20, 20, 0.1) : db2linear : smoothi(0.999);
9 jbal = vslider("balance[name:Balance][tooltip:left/right trim for processed signal]", 0, -1, 1, 0.1);
10 bal = vslider(".amp.balance[alias]", 0, -1, 1, 0.1);
9 jbal = vslider("balance[name:Balance][tooltip:left/right trim for processed signal]", 0, -1, 1, 0.1): smoothi(0.999);
10 bal = vslider(".amp.balance[alias]", 0, -1, 1, 0.1): smoothi(0.999);
1111
1212 /*
1313 ** We want to move the sound source to the right
55 double fVec0[65536];
66 FAUSTFLOAT fslider1;
77 double fConst0;
8 double fRec0[2];
89 FAUSTFLOAT fslider2;
9 double fRec0[2];
10 double fRec1[2];
1011 FAUSTFLOAT fslider3;
12 double fRec2[2];
1113 FAUSTFLOAT& fslider4 = get_alias("amp.balance");
14 double fRec3[2];
1215 double fVec1[65536];
1316 int fSamplingFreq;
1417
1720 fSamplingFreq = samplingFreq;
1821 IOTA = 0;
1922 for (int i=0; i<65536; i++) fVec0[i] = 0;
20 fConst0 = (0.001 * fSamplingFreq);
23 fConst0 = (1.000000000000001e-06 * fSamplingFreq);
2124 for (int i=0; i<2; i++) fRec0[i] = 0;
25 for (int i=0; i<2; i++) fRec1[i] = 0;
26 for (int i=0; i<2; i++) fRec2[i] = 0;
27 for (int i=0; i<2; i++) fRec3[i] = 0;
2228 for (int i=0; i<65536; i++) fVec1[i] = 0;
2329 }
2430
2733 double fSlow0 = (0.01 * fslider0);
2834 double fSlow1 = (1 - fSlow0);
2935 double fSlow2 = (fConst0 * fslider1);
30 double fSlow3 = ((int((fSlow2 < 0)))?0:fSlow2);
31 int iSlow4 = int(fSlow3);
32 int iSlow5 = int((iSlow4 & 65535));
33 int iSlow6 = (1 + iSlow4);
34 double fSlow7 = (iSlow6 - fSlow3);
35 int iSlow8 = int((int(iSlow6) & 65535));
36 double fSlow9 = (fSlow3 - iSlow4);
37 double fSlow10 = (0.0010000000000000009 * pow(10,(0.05 * fslider2)));
38 double fSlow11 = fslider3;
39 double fSlow12 = (1 - max(0, fSlow11));
40 double fSlow13 = fslider4;
41 double fSlow14 = (1 - max(0, fSlow13));
42 double fSlow15 = ((int((fSlow2 > 0)))?0:(0 - fSlow2));
43 int iSlow16 = int(fSlow15);
44 int iSlow17 = int((iSlow16 & 65535));
45 int iSlow18 = (1 + iSlow16);
46 double fSlow19 = (iSlow18 - fSlow15);
47 int iSlow20 = int((int(iSlow18) & 65535));
48 double fSlow21 = (fSlow15 - iSlow16);
49 double fSlow22 = (1 - max(0, (0 - fSlow11)));
50 double fSlow23 = (1 - max(0, (0 - fSlow13)));
36 double fSlow3 = (0.0010000000000000009 * fslider2);
37 double fSlow4 = (0.0010000000000000009 * pow(10,(0.05 * fslider3)));
38 double fSlow5 = (0.0010000000000000009 * fslider4);
5139 for (int i=0; i<count; i++) {
5240 double fTemp0 = (fSlow0 * (double)input2[i]);
5341 fVec0[IOTA&65535] = fTemp0;
54 fRec0[0] = (fSlow10 + (0.999 * fRec0[1]));
55 output0[i] = (FAUSTFLOAT)(fSlow14 * ((fSlow12 * (fRec0[0] * ((fSlow9 * fVec0[(IOTA-iSlow8)&65535]) + (fSlow7 * fVec0[(IOTA-iSlow5)&65535])))) + (fSlow1 * (double)input0[i])));
56 double fTemp1 = (fSlow0 * (double)input3[i]);
57 fVec1[IOTA&65535] = fTemp1;
58 output1[i] = (FAUSTFLOAT)(fSlow23 * ((fSlow22 * (fRec0[0] * ((fSlow21 * fVec1[(IOTA-iSlow20)&65535]) + (fSlow19 * fVec1[(IOTA-iSlow17)&65535])))) + (fSlow1 * (double)input1[i])));
42 fRec0[0] = (fSlow2 + (0.999 * fRec0[1]));
43 double fTemp1 = ((int((fRec0[0] < 0)))?0:fRec0[0]);
44 int iTemp2 = int(fTemp1);
45 int iTemp3 = (1 + iTemp2);
46 fRec1[0] = (fSlow3 + (0.999 * fRec1[1]));
47 fRec2[0] = (fSlow4 + (0.999 * fRec2[1]));
48 fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
49 output0[i] = (FAUSTFLOAT)((1 - max(0, fRec3[0])) * (((fRec2[0] * (1 - max(0, fRec1[0]))) * (((fTemp1 - iTemp2) * fVec0[(IOTA-int((int(iTemp3) & 65535)))&65535]) + ((iTemp3 - fTemp1) * fVec0[(IOTA-int((iTemp2 & 65535)))&65535]))) + (fSlow1 * (double)input0[i])));
50 double fTemp4 = (fSlow0 * (double)input3[i]);
51 fVec1[IOTA&65535] = fTemp4;
52 double fTemp5 = ((int((fRec0[0] > 0)))?0:(0 - fRec0[0]));
53 int iTemp6 = int(fTemp5);
54 int iTemp7 = (1 + iTemp6);
55 output1[i] = (FAUSTFLOAT)((1 - max(0, (0 - fRec3[0]))) * (((fRec2[0] * (1 - max(0, (0 - fRec1[0])))) * (((fTemp5 - iTemp6) * fVec1[(IOTA-int((int(iTemp7) & 65535)))&65535]) + ((iTemp7 - fTemp5) * fVec1[(IOTA-int((iTemp6 & 65535)))&65535]))) + (fSlow1 * (double)input1[i])));
5956 // post processing
57 fRec3[1] = fRec3[0];
58 fRec2[1] = fRec2[0];
59 fRec1[1] = fRec1[0];
6060 fRec0[1] = fRec0[0];
6161 IOTA = IOTA+1;
6262 }
6565 static struct RegisterParams { RegisterParams(); } RegisterParams;
6666 RegisterParams::RegisterParams()
6767 {
68 registerVar("jconv.balance","Balance","S","left/right trim for processed signal",&fslider3, 0.0, -1.0, 1.0, 0.1);
69 registerVar("jconv.gain","Gain","S","gain trim for processed signal (unit: dB)",&fslider2, 0.0, -2e+01, 2e+01, 0.1);
68 registerVar("jconv.gain","Gain","S","gain trim for processed signal (unit: dB)",&fslider3, 0.0, -2e+01, 2e+01, 0.1);
69 registerVar("jconv.balance","Balance","S","left/right trim for processed signal",&fslider2, 0.0, -1.0, 1.0, 0.1);
7070 registerVar("jconv.diff_delay","Delta Delay","S","delay left or right channel by the specified amount (unit: ms)",&fslider1, 0.0, -1e+01, 1e+01, 0.01);
7171 registerVar("jconv.wet_dry","wet/dry","S","percentage of processed signal in output signal",&fslider0, 1e+02, 0.0, 1e+02, 1.0);
7272 registerInit("jconv", init);
452452 /* create a cairo context */
453453 cr = gdk_cairo_create(wi->window);
454454
455 double x0 = wi->allocation.x+1;
456 double y0 = wi->allocation.y+1;
457 double rect_width = wi->allocation.width-2;
458 double rect_height = wi->allocation.height-3;
455 gint x0 = wi->allocation.x+1;
456 gint y0 = wi->allocation.y+1;
457 gint rect_width = wi->allocation.width-2;
458 gint rect_height = wi->allocation.height-3;
459459
460460 _image = gdk_pixbuf_scale_simple(tribeimage1,rect_width,rect_height,GDK_INTERP_HYPER);
461461
540540 /* create a cairo context */
541541 cr = gdk_cairo_create(wi->window);
542542
543 double x0 = wi->allocation.x+1;
544 double y0 = wi->allocation.y+1;
545 double rect_width = wi->allocation.width-2;
546 double rect_height = wi->allocation.height-3;
543 gint x0 = wi->allocation.x+1;
544 gint y0 = wi->allocation.y+1;
545 gint rect_width = wi->allocation.width-2;
546 gint rect_height = wi->allocation.height-3;
547547
548548 _image = gdk_pixbuf_scale_simple(tribeimage,rect_width,rect_height,GDK_INTERP_HYPER);
549549
594594 /* create a cairo context */
595595 cr = gdk_cairo_create(wi->window);
596596
597 double x0 = wi->allocation.x+1;
598 double y0 = wi->allocation.y;
599 double rect_width = wi->allocation.width-2;
600 double rect_height = wi->allocation.height;
597 gint x0 = wi->allocation.x+1;
598 gint y0 = wi->allocation.y;
599 gint rect_width = wi->allocation.width-2;
600 gint rect_height = wi->allocation.height;
601601
602602 _image = gdk_pixbuf_scale_simple(tribeimage2,rect_width,rect_height,GDK_INTERP_HYPER);
603603
304304 }
305305 }
306306 if (cnt) {
307
307
308308 for (int ichan = 0; ichan < nchan; ichan++) {
309309 int rc;
310310 if (ichan >= audio.chan()) {
6868 ** register audio variables to paramtable
6969 */
7070
71 AudioVariables::AudioVariables()
71 void AudioVariables::register_parameter()
7272 {
7373 static const char *amp_threshold[] = {"off","clip","foldback",0};
7474 registerEnumParam("amp.threshold", "threshold", amp_threshold, &ffuse, 0);
8484 gx_gui::registerParam("freeverb.on_off", "on/off", &fcheckbox6, 0);
8585 gx_gui::registerParam("IR.on_off", "on/off", &fcheckbox8, 0);
8686 gx_gui::registerParam("crybaby.on_off", "on/off", &fcheckbox5, 0);
87 gx_gui::registerParam("echo.on_off", "on/off", &fcheckbox7, 0);
88 gx_gui::registerParam("delay.on_off", "on/off", &fdelay, 0);
89 gx_gui::registerParam("chorus.on_off", "on/off", &fchorus, 0);
87 gx_gui::registerParam("echo.on_off", "on/off", (float*) &fcheckbox7, 0.);
88 gx_gui::registerParam("delay.on_off", "on/off", (float*) &fdelay, 0.);
89 gx_gui::registerParam("chorus.on_off", "on/off", (float*) &fchorus, 0.);
9090 gx_gui::registerParam("compressor.on_off", "on/off", &fcheckboxcom1, 0);
9191 gx_gui::registerParam("tube2.on_off", "on/off", &ftube3, 0);
9292 gx_gui::registerParam("tube3.on_off", "on/off", &ftube3e, 0);
107107 gx_gui::registerParam("moog.on_off", "on/off", &fmoog, 0);
108108 gx_gui::registerParam("biquad.on_off", "on/off", &fbiquad, 0);
109109 gx_gui::registerParam("flanger.on_off", "on/off", &fflanger, 0);
110 gx_gui::registerParam("SampleLooper.on_off", "on/off", &fsloop, 0);
110 gx_gui::registerParam("SampleLooper.on_off", "on/off", (float*) &fsloop, 0.);
111111 gx_gui::registerParam("jconv.on_off", "Run", &gx_jconv::GxJConvSettings::checkbutton7);
112112 static const char *amp_select[] = {"1x","2x", "3x","4x","5x", "6x", "7x", "8x",0};
113113 registerEnumParam("amp.select", "select", amp_select, &upsample_mode, 3);
116116 gx_gui::registerParam("cab.on_off", "Cab-ImpResp", &fcab,0);
117117 static const char *tonestack_model[] = {"default","Bassman","Twin Reverb","Princeton","JCM-800","JCM-2000","M-Lead","M2199","AC-30","Off",0};
118118 registerEnumParam("amp.tonestack.select","select",tonestack_model,&tonestack, 0);
119 static const char *post_pre[] = {"post","pre",0};
120 registerEnumParam("crybaby.pp","select",post_pre,&crybabypp, 0);
121 registerEnumParam("overdrive.pp","select",post_pre,&overdrivepp, 0);
122 registerEnumParam("distortion.pp","select",post_pre,&distortionpp, 0);
123 registerEnumParam("freeverb.pp","select",post_pre,&freeverbpp, 0);
124 registerEnumParam("IR.pp","select",post_pre,&IRpp, 0);
125 registerEnumParam("compressor.pp","select",post_pre,&compressorpp, 0);
126 registerEnumParam("echo.pp","select",post_pre,&echopp, 0);
127 registerEnumParam("delay.pp","select",post_pre,&delaypp, 0);
119128
120129 // only save and restore, no midi control
121130
327336 void compute_insert (int count, float* input1, float* output0, float* output1)
328337 {
329338 // retrieve engine state
330 const GxEngineState estate = (GxEngineState)checky;
339 const GxEngineState estate = checky;
331340
332341 //------------ determine processing type
333342 unsigned short process_type = ZEROIZE_BUFFERS;
387396 void compute (int count, float* input, float* output0)
388397 {
389398 // retrieve engine state
390 const GxEngineState estate = (GxEngineState)checky;
399 const GxEngineState estate = checky;
391400
392401 //------------ determine processing type
393402 unsigned short process_type = ZEROIZE_BUFFERS;
491500 float *ovs_buffer;
492501 if (audio.fupsample) {
493502 // *oversample
494 t_upsample = min(8,audio.upsample_mode+1);
503 t_upsample = min(8,(int)audio.upsample_mode+1);
495504 if (t_upsample != t_upsample_old) {
496505 t_upsample_old = t_upsample;
497506 fupsample_old = audio.fupsample;
505514 distortion1::init(t_upsample * gx_jack::jack_sr);
506515 distortion::init(t_upsample * gx_jack::jack_sr);
507516 }
508 resampTube.up(count, output0, oversample);
517
509518 ovs_sr = t_upsample * gx_jack::jack_sr;
510519 ovs_count = t_upsample * count;
511 ovs_buffer = oversample;
520
512521 } else {
513522 ovs_sr = gx_jack::jack_sr;
514523 ovs_count = count;
515 ovs_buffer = output0;
524
516525 }
517526 if (audio.fupsample != fupsample_old) {
518527 fupsample_old = audio.fupsample;
523532 distortion1::init(ovs_sr);
524533 distortion::init(ovs_sr);
525534 }
535
536
537 for (int m = 0; m < 8; m++) {
538 if (audio.posit0 == m && audio.fcheckbox5 && !audio.fautowah && audio.crybabypp) {
539 crybaby::compute(count, output0, output0);
540 } else if (audio.posit0 == m && audio.fcheckbox5 && audio.fautowah && audio.crybabypp) {
541 autowah::compute(count, output0, output0);
542 } else if (audio.posit5 == m && audio.fcheckboxcom1 && audio.compressorpp) {
543 compressor::compute(count, output0, output0);
544 } else if (audio.posit1 == m && audio.foverdrive4 && audio.overdrivepp) {
545 overdrive::compute(count, output0, output0);
546 } else if (audio.posit2 == m && audio.fcheckbox4 && audio.distortionpp) {
547 if (audio.fupsample) {
548 // 2*oversample
549 //over_sample(count, output0, oversample);
550 resampDist.up(count, output0, oversample);
551 if(audio.witchdistortion) distortion1::compute(ovs_count, oversample, oversample);
552 else distortion::compute(ovs_count, oversample, oversample);
553 resampDist.down(count, oversample, output0);
554 //down_sample(count, oversample, output0);
555 } else {
556 if(audio.witchdistortion) distortion1::compute(count, output0, output0);
557 else distortion::compute(count, output0, output0);
558 }
559 } else if (audio.posit3 == m && audio.fcheckbox6 && audio.freeverbpp) {
560 freeverb::compute(count, output0, output0);
561 } else if (audio.posit6 == m && audio.fcheckbox7 && echo::is_inited() && audio.echopp) {
562 echo::compute(count, output0, output0);
563 } else if (audio.posit4 == m && audio.fcheckbox8 && audio.IRpp) {
564 impulseresponse::compute(count, output0, output0);
565 } else if (audio.posit7 == m && audio.fdelay && delay::is_inited() && audio.delaypp) {
566 delay::compute(count, output0, output0);
567 }
568 }
569
570 if (audio.fupsample) {
571 resampTube.up(count, output0, oversample);
572 ovs_buffer = oversample;
573 } else {
574 ovs_buffer = output0;
575 }
576
526577 if (audio.antialis0) {
527578 AntiAlias::compute(ovs_count, ovs_buffer, ovs_buffer);
528579 }
590641 }
591642
592643 for (int m = 0; m < 8; m++) {
593 if (audio.posit0 == m && audio.fcheckbox5 && !audio.fautowah) {
644 if (audio.posit0 == m && audio.fcheckbox5 && !audio.fautowah && !audio.crybabypp) {
594645 crybaby::compute(count, output0, output0);
595 } else if (audio.posit0 == m && audio.fcheckbox5 && audio.fautowah) {
646 } else if (audio.posit0 == m && audio.fcheckbox5 && audio.fautowah && !audio.crybabypp) {
596647 autowah::compute(count, output0, output0);
597 } else if (audio.posit5 == m && audio.fcheckboxcom1) {
648 } else if (audio.posit5 == m && audio.fcheckboxcom1 && !audio.compressorpp) {
598649 compressor::compute(count, output0, output0);
599 } else if (audio.posit1 == m && audio.foverdrive4) {
650 } else if (audio.posit1 == m && audio.foverdrive4 && !audio.overdrivepp) {
600651 overdrive::compute(count, output0, output0);
601 } else if (audio.posit2 == m && audio.fcheckbox4) {
652 } else if (audio.posit2 == m && audio.fcheckbox4 && !audio.distortionpp) {
602653 if (audio.fupsample) {
603654 // 2*oversample
604655 //over_sample(count, output0, oversample);
611662 if(audio.witchdistortion) distortion1::compute(count, output0, output0);
612663 else distortion::compute(count, output0, output0);
613664 }
614 } else if (audio.posit3 == m && audio.fcheckbox6) {
665 } else if (audio.posit3 == m && audio.fcheckbox6 && !audio.freeverbpp) {
615666 freeverb::compute(count, output0, output0);
616 } else if (audio.posit6 == m && audio.fcheckbox7 && echo::is_inited()) {
667 } else if (audio.posit6 == m && audio.fcheckbox7 && echo::is_inited() && !audio.echopp) {
617668 echo::compute(count, output0, output0);
618 } else if (audio.posit4 == m && audio.fcheckbox8) {
669 } else if (audio.posit4 == m && audio.fcheckbox8 && !audio.IRpp) {
619670 impulseresponse::compute(count, output0, output0);
620 } else if (audio.posit7 == m && audio.fdelay && delay::is_inited()) {
671 } else if (audio.posit7 == m && audio.fdelay && delay::is_inited() && !audio.delaypp) {
621672 delay::compute(count, output0, output0);
622673 }
623674 }
647698 memcpy(output0, input1, count*sizeof(float));
648699 feed::compute(count, output0, output0, output1);
649700
650 if (audio.fchorus and chorus::is_inited()) {
701 if (audio.fchorus && chorus::is_inited()) {
651702 chorus::compute(count, output0, output1, output0, output1);
652703 }
653704 if (audio.fflanger) {
2727 namespace gx_engine
2828 {
2929
30 MidiVariables::MidiVariables()
30 void MidiVariables::register_parameter()
3131 {
3232 gx_gui::registerParam("midi_out.channel_1.velocity", "velocity", &fslider26, 64.f, 0.f, 127.f, 1.f);
3333 gx_gui::registerParam("midi_out.channel_1.volume", "volume", &fslider46, 64.f, 0.f, 127.f, 1.f);
157157 {
158158
159159 // retrieve engine state
160 const GxEngineState estate = (GxEngineState)checky;
160 const GxEngineState estate = checky;
161161
162162 //------------ determine processing type
163163 unsigned short process_type = ZEROIZE_BUFFERS;
100100 const char *name;
101101 } inidef;
102102
103 list<inidef> inilist;
104
105 float& get_alias(const char *id)
103
104 static list<inidef>& get_inilist()
105 {
106 static list<inidef> inilist;
107 return inilist;
108 }
109
110 static list<gx_gui::Parameter*>& get_paramlist()
111 {
112 static list<gx_gui::Parameter*> paramlist;
113 return paramlist;
114 }
115
116 void register_faust_parameters()
117 {
118 list<gx_gui::Parameter*>& paramlist = get_paramlist();
119 for (list<gx_gui::Parameter*>::iterator i = paramlist.begin(); i != paramlist.end(); i++) {
120 gx_gui::parameter_map.insert(*i);
121 }
122 paramlist.clear();
123 }
124
125 static gx_gui::Parameter *find_parameter(const char *id)
126 {
127 list<gx_gui::Parameter*>& paramlist = get_paramlist();
128 for (list<gx_gui::Parameter*>::iterator i = paramlist.begin(); i != paramlist.end(); i++) {
129 if ((*i)->id() == id) {
130 return *i;
131 }
132 }
133 return 0;
134 }
135
136 static float& get_alias(const char *id)
106137 {
107138 static float dummy;
108 if (!gx_gui::parameter_map.hasId(id)) {
139 gx_gui::Parameter *p = find_parameter(id);
140 if (!p) {
109141 gx_system::gx_print_error("engine", string("can't define alias for unknown (or not yet defined) parameter id: ") + id);
110142 return dummy;
111143 } else {
112 return gx_gui::parameter_map[id].getFloat().value;
113 }
114 }
115
116 void registerVar(const char* id, const char* name, const char* tp,
117 const char* tooltip, float* var, float val=0,
118 float low=0, float up=0, float step=0, bool exp=false)
144 return p->getFloat().value;
145 }
146 }
147
148 static void registerVar(const char* id, const char* name, const char* tp,
149 const char* tooltip, float* var, float val=0,
150 float low=0, float up=0, float step=0, bool exp=false)
119151 {
120152 if (!name[0]) {
121153 assert(strrchr(id, '.'));
126158 if (tooltip) {
127159 p->set_desc(tooltip);
128160 }
129 gx_gui::parameter_map.insert(p);
130 }
131
132 void registerEnumVar(const char *id, const char* name, const char* tp,
133 const char* tooltip, const char** values, float *var, float val,
134 float low=0, float up=0, float step=1, bool exp=false)
161 get_paramlist().push_back(p);
162 }
163
164 static void registerEnumVar(const char *id, const char* name, const char* tp,
165 const char* tooltip, const char** values, float *var, float val,
166 float low=0, float up=0, float step=1, bool exp=false)
135167 {
136168 if (!name[0]) {
137169 assert(strrchr(id, '.'));
139171 }
140172 assert(low == 0.0 && step == 1.0);
141173 gx_gui::FloatEnumParameter *p = new gx_gui::FloatEnumParameter(
142 id, name, values, true, *var, val, true, exp);
174 id, name, values, true, *var, (int)round(val), true, exp);
143175 assert(up == p->upper); // calculated by constructor
144 gx_gui::parameter_map.insert(p);
145 }
146
147 inline void registerIntParam(const char*a,const char*b,int*c,int std=0,int lower=0,int upper=1,bool exp=false)
176 get_paramlist().push_back(p);
177 }
178
179 static inline void registerIntParam(const char*a,const char*b,int*c,int std=0,int lower=0,int upper=1,bool exp=false)
148180 {
149 gx_gui::parameter_map.insert(new gx_gui::IntParameter(a,b,gx_gui::Parameter::Enum,true,*c,std,lower,upper,true,exp));
181 get_paramlist().push_back(
182 new gx_gui::IntParameter(a,b,gx_gui::Parameter::Enum,true,*c,std,
183 lower,upper,true,exp));
150184 }
151185
152 void registerInit(const char *name, inifunc f)
186 static void registerInit(const char *name, inifunc f)
153187 {
154188 inidef i;
155189 i.func = f;
156190 i.name = name;
157 inilist.push_back(i);
158 }
159
160 void jack_sync()
191 get_inilist().push_back(i);
192 }
193
194 static void jack_sync()
161195 {
162196 while (sem_wait(&gx_jack::jack_sync_sem) == EINTR);
163197 }
164198
165199 #define max(x,y) (((x)>(y)) ? (x) : (y))
166200 #define min(x,y) (((x)<(y)) ? (x) : (y))
201
202 //FIXME (temporary)hack to support older compiler versions
203 inline float pow(float b, float e) { return ::powf(b, e); }
204 inline double pow(double b, double e){return ::pow(b, e); }
205 inline double pow(double b, int e) { return ::pow(b, (double)e); }
206 inline double pow(int b, double e) { return ::pow((double)b, e); }
207 inline double pow(double b, float e){ return ::pow(b, (double)e); }
208 inline double pow(float b, double e){ return ::pow((double)b, e); }
209 inline float pow(float b, int e) { return ::powf(b, (float) e); }
210 inline float pow(int b, float e) { return ::powf((float)b, e); }
167211
168212 template <int N> inline float faustpower(float x) { return powf(x,N); }
169213 template <int N> inline double faustpower(double x) { return pow(x,N); }
253297 faust_add_callback("delay.on_off", delay::activate);
254298 faust_add_callback("echo.on_off", echo::activate);
255299 faust_add_callback("chorus.on_off", chorus::activate);
300 list<inidef>& inilist = get_inilist();
256301 for (list<inidef>::iterator i = inilist.begin(); i != inilist.end(); i++) {
257302 try {
258303 i->func(samplingFreq);
2727 /* ----- main engine ----- */
2828 namespace gx_engine
2929 {
30 float checky = 1.0;
30 GxEngineState checky = kEngineOn;
3131 float* get_frame = NULL;
3232 float* get_frame1 = NULL;
3333 float* checkfreq = NULL;
7474 /* --------- menu function triggering engine on/off/bypass --------- */
7575 void gx_engine_switch (GtkWidget* widget, gpointer arg)
7676 {
77 gx_engine::GxEngineState estate =
78 (gx_engine::GxEngineState)gx_engine::checky;
77 gx_engine::GxEngineState estate = gx_engine::checky;
7978
8079 switch (estate)
8180 {
104103 );
105104 }
106105
107 gx_engine::checky = (float)estate;
106 gx_engine::checky = estate;
108107 gx_refresh_engine_status_display();
109108 }
110109
111110 /* -------------- refresh engine status display ---------------- */
112111 void gx_refresh_engine_status_display()
113112 {
114 gx_engine::GxEngineState estate =
115 (gx_engine::GxEngineState)gx_engine::checky;
113 gx_engine::GxEngineState estate = gx_engine::checky;
116114
117115 string state;
118116
692692 {
693693 openVerticalBox("compressor");
694694 {
695 create_selector("compressor.pp");
695696 openSpaceBox("");
696697 closeBox();
697698 create_smallknob("compressor.ratio");
749750 //----- overdrive
750751 openVerticalBox("overdrive");
751752 {
753 create_selector("overdrive.pp");
752754 openSpaceBox("");
753755 closeBox();
754756 create_smallknob("overdrive.drive"," drive ");
764766 //----- distortion
765767 openVerticalBox("distortion");
766768 {
769 create_selector("distortion.pp");
767770 create_selector("distortiont.onetwo");
768771 //create_switch(sw_switch, "distortion.onetwo", "");
769772 openVerticalSwitchBox(" ",0, 0, &gx_engine::audio.witchdistortion);
960963 //----- freeverb
961964 openVerticalBox(" freeverb");
962965 {
966 create_selector("freeverb.pp");
963967 openSpaceBox("");
964968 closeBox();
965969 create_smallknob("freeverb.RoomSize");
10081012 //----- IR
10091013 openVerticalBox("IR");
10101014 {
1015 create_selector("IR.pp");
10111016 create_selector("IR.auto_freq");
10121017 openHorizontalBox("");
10131018 {
10951100 //----- crybaby
10961101 openVerticalBox("crybaby");
10971102 {
1103 create_selector("crybaby.pp");
10981104 create_selector("crybaby.autowah");
10991105 //create_switch(sw_minitoggle, "crybaby.autowah"," autowah");
11001106 create_smallknob("crybaby.wah"," wah ");
11711177 //----- echo
11721178 openVerticalBox("echo");
11731179 {
1180 create_selector("echo.pp");
11741181 openSpaceBox("");
11751182 closeBox();
11761183 openHorizontalBox("");
12161223 {
12171224 openVerticalBox("delay");
12181225 {
1226 create_selector("delay.pp");
12191227 openSpaceBox("");
12201228 closeBox();
12211229 openHorizontalBox("");
264264 static gboolean gx_engine_restart(gpointer data)
265265 {
266266 usleep(5);
267 checky = (float)kEngineOn;
267 checky = kEngineOn;
268268 return false;
269269 }
270270
273273 {
274274 // set engine off for one GTK thread cycle to avoid Xrun at startup
275275 gx_gui::g_threads[4] = g_idle_add_full(G_PRIORITY_HIGH_IDLE+20,gx_engine_restart,NULL,NULL);
276 checky = (float)kEngineOff;
276 checky = kEngineOff;
277277
278278 // set autoconnect capture to user capture port
279279 if (!optvar[JACK_INP].empty())
646646 //---- jack buffer size change callback
647647 int gx_jack_buffersize_callback (jack_nframes_t nframes,void* arg)
648648 {
649 GxEngineState estate = (GxEngineState)checky;
649 GxEngineState estate = checky;
650650
651651 // turn off engine
652652 // Note: simply changing checky is enough to "stop" processing
658658 // immediately during the jack_processing of jack cycles.
659659
660660 if (estate != kEngineOff)
661 checky = (float)kEngineOff;
661 checky = kEngineOff;
662662
663663 jack_bs = nframes;
664664
697697 }
698698
699699 // restore previous state
700 checky = (float)estate;
700 checky = estate;
701701 // return 0 to jack
702702 return 0;
703703
3131 * ----------------------------------------------------------------------------
3232 */
3333
34 #include "giomm/init.h"
35 #include "gtkmm/main.h"
34 #include <giomm/init.h>
35 #include <gtkmm/main.h>
36 #include <gxwmm/init.h>
3637 #include "guitarix.h"
3738
3839 using namespace gx_system;
6566 // ----------------------- init basic subsystems ----------------------
6667 Glib::thread_init();
6768 Glib::init();
69 Gxw::init();
6870
6971 // ------ initialize parameter list ------
72 gx_engine::audio.register_parameter();
73 gx_engine::midi.register_parameter();
74 gx_engine::register_faust_parameters();
7075 gx_preset::init();
7176 gx_gui::parameter_map.set_init_values();
7277
106111 // ----------------------- run GTK main loop ----------------------
107112 gx_set_override_options(optvar);
108113 gx_ui::GxUI::updateAllGuis();
114 g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));
115 g_object_set (gtk_settings_get_default (), "gtk-menu-images", TRUE, NULL);
109116 gui->show();
110117
111118 if (gx_jack::client) {
10701070 {
10711071 GtkWidget * scrollbox = gtk_scrolled_window_new(NULL,NULL);
10721072 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrollbox),GTK_POLICY_AUTOMATIC,GTK_POLICY_NEVER);
1073 gtk_widget_set_size_request (scrollbox, 338, -1);
1073 gtk_widget_set_size_request (scrollbox, 358, -1);
10741074 GtkWidget * box = gtk_vbox_new (homogene, 0);
10751075 GtkWidget * box1 = gtk_hbox_new (homogene, 0);
10761076 gtk_container_set_border_width (GTK_CONTAINER (box), 0);
673673 return;
674674 }
675675 jp.check_expect(gx_system::JsonParser::value_string);
676 int up = round(upper);
676 int up = int(round(upper));
677677 int n = 0;
678678 for (; n <= up; n++) {
679679 if (jp.current_value() == value_names[n]) {
234234 // index for keyboard shortcut (can take any list)
235235 vector<GtkMenuItem*>::iterator its;
236236 int pos = 0;
237 for (its = pm_list[lindex].begin() ; its < pm_list[lindex].end(); its++ )
237 for (its = pm_list[lindex].begin() ; its != pm_list[lindex].end(); its++ )
238238 {
239239 pos++;
240240 }
282282 {
283283 vector<string>::iterator its;
284284 int pos = 0;
285 for (its = plist.begin() ; its < plist.end(); its++ )
285 for (its = plist.begin() ; its != plist.end(); its++ )
286286 {
287287 pos++;
288288 if( presname == *its)
297297 vector<string>::iterator its;
298298 vector<GtkMenuItem*>::iterator it = pm_list[lindex].begin();
299299 int pos = 0;
300 for (its = plist.begin() ; its < plist.end(); its++ )
300 for (its = plist.begin() ; its != plist.end(); its++ )
301301 {
302302 pos++;
303303 if( name == *its)
323323 gx_build_preset_list();
324324 }
325325 vector<string>::iterator its;
326 for (its = plist.begin() ; its < plist.end(); its++) {
326 for (its = plist.begin() ; its != plist.end(); its++) {
327327 gx_add_preset_to_menus(*its);
328328 }
329329 }
368368 {
369369 GtkMenuItem* const itemi =
370370 gx_get_preset_item_from_name(LOAD_PRESET_LIST, gx_current_preset);
371 for (it = pm_list[LOAD_PRESET_LIST].begin() ; it < pm_list[LOAD_PRESET_LIST].end(); it++ )
371 for (it = pm_list[LOAD_PRESET_LIST].begin() ; it != pm_list[LOAD_PRESET_LIST].end(); it++ )
372372 {
373373 if( itemi == *it)
374374 break;
400400 {
401401 GtkMenuItem* const itemi =
402402 gx_get_preset_item_from_name(LOAD_PRESET_LIST, gx_current_preset);
403 for (it = pm_list[LOAD_PRESET_LIST].begin() ; it < pm_list[LOAD_PRESET_LIST].end(); it++ )
403 for (it = pm_list[LOAD_PRESET_LIST].begin() ; it != pm_list[LOAD_PRESET_LIST].end(); it++ )
404404 {
405405 if( itemi == *it)
406406 break;
646646 // retrieve preset name
647647 vector<GtkMenuItem*>::iterator it = pm_list[LOAD_PRESET_LIST].begin();
648648 vector<string>::iterator its = plist.begin() ;;
649 for (it = pm_list[LOAD_PRESET_LIST].begin() ; it < pm_list[LOAD_PRESET_LIST].end(); it++ )
649 for (it = pm_list[LOAD_PRESET_LIST].begin() ; it != pm_list[LOAD_PRESET_LIST].end(); it++ )
650650 {
651651 if( menuitem == *it)
652652 break;
816816
817817 vector<GtkMenuItem*>::iterator it;
818818
819 for (it = pm_list[SAVE_PRESET_LIST].begin() ; it < pm_list[LOAD_PRESET_LIST].end(); it++ ) {
819 for (it = pm_list[SAVE_PRESET_LIST].begin() ; it != pm_list[SAVE_PRESET_LIST].end(); it++ ) {
820820 if( menuitem == *it) {
821821 break;
822822 }
854854 vector<string>::iterator its;
855855 vector<GtkMenuItem*>::iterator it = pm_list[SAVE_PRESET_LIST].begin();
856856
857 for (its = plist.begin() ; its < plist.end(); its++ )
857 for (its = plist.begin() ; its != plist.end(); its++ )
858858 {
859859 // found a match
860860 if (presname == *its)
972972 {
973973 vector<string>::iterator its = plist.begin();
974974 vector<GtkMenuItem*>::iterator it = pm_list[RENAME_PRESET_LIST].begin();
975 for (it = pm_list[RENAME_PRESET_LIST].begin() ; it < pm_list[RENAME_PRESET_LIST].end(); it++ )
975 for (it = pm_list[RENAME_PRESET_LIST].begin() ; it != pm_list[RENAME_PRESET_LIST].end(); it++ )
976976 {
977977 if( menuitem == *it)
978978 break;
13251325 {
13261326 s = "";
13271327
1328 int abs_i = abs(double(i));
1329 do
1330 {
1328 int abs_i = abs(i);
1329 do {
13311330 // note: using base 10 since 10 digits (0123456789)
13321331 char c = static_cast<char>(ASCII_START+abs_i%10);
13331332 s.insert(0, &c, 1);
103103 gboolean gx_do_program_change(gpointer arg)
104104 {
105105 int pgm = GPOINTER_TO_INT(arg);
106 gx_engine::GxEngineState estate =
107 (gx_engine::GxEngineState)gx_engine::checky;
106 gx_engine::GxEngineState estate = gx_engine::checky;
108107 if (gx_preset::gx_nth_preset(pgm))
109108 {
110109 if (estate == gx_engine::kEngineBypass)
6363 bool foverdrive4;
6464 bool fcheckbox4;
6565 bool fcheckbox6;
66 bool fcheckbox7;
66 int fcheckbox7;
6767 bool fcheckbox8;
68 bool fdelay;
68 int fdelay;
6969 bool fmultifilter;
7070 bool fboost;
71 bool fchorus;
71 int fchorus;
7272 float ffuse;
7373 bool fdialogbox1;
7474 bool fdialogbox2;
102102 bool ftube3e;
103103 float upsample_mode;
104104 float fampexpand;
105 bool fsloop;
105 int fsloop;
106106 float witchdistortion;
107107 bool fdis1;
108108 bool fcab;
112112 float witchamp;
113113 bool famp2;
114114 int tonestack;
115
116 AudioVariables();
115 int crybabypp;
116 int overdrivepp;
117 int distortionpp;
118 int freeverbpp;
119 int IRpp;
120 int compressorpp;
121 int echopp;
122 int delaypp;
123
124 void register_parameter();
117125 };
118126
119127 extern AudioVariables audio;
178186 float BeatFilter2;
179187 float BeatFilterk;
180188
181 MidiVariables();
189 void register_parameter();
182190 void init(int samplingFreq);
183191 };
184192
198206 inline void turnOnMidi() { audio.midistate = kMidiOn; }
199207
200208 /* function declarations */
209 void register_faust_parameters();
201210 void gx_engine_init( const string *optvar );
202211 void gx_engine_reset();
203212 void faust_init(int samplingFreq);
4343 } GxMidiState;
4444
4545 /* global var declarations */
46 extern float checky;
46 extern GxEngineState checky;
4747 extern float* get_frame;
4848 extern float* get_frame1;
4949 extern float* checkfreq;
5050 {
5151 public:
5252 bool setup(int srcRate, int dstRate, int nchan);
53 int get_max_out_size(int i_size) { return (i_size * ratio_b() + ratio_a() - 1) / ratio_a(); }
53 int get_max_out_size(int i_size) { return (i_size * ratio_b()) / ratio_a() + 1; }
5454 int process(int count, float *input, float *output);
5555 int flush(float *output); // check source for max. output size
5656 };
4848 libpath = [bld.path.find_dir("../libgxw/gxw").bldpath(bld.env),
4949 bld.path.find_dir("../libgxwmm/gxwmm").bldpath(bld.env)]
5050 uselib_local = []
51 linkflags = []
5251 else:
5352 libpath = []
5453 uselib_local = ['gxwmm','gxw']
55 linkflags = ["-Wl,-u,gxw_init,-u,gxwmm_init"]
5654 bld(features = 'cxx cprogram',
5755 includes = incl,
5856 cxxflags= bld.env['CXXFLAGS'],
6260 'GTK2', 'GTKMM', 'GIOMM', 'ZITA_CONVOLVER', 'FFTW3'],
6361 uselib_local = uselib_local,
6462 libpath = libpath,
65 linkflags = linkflags,
6663 target = bld.env['BIN_NAME'],
6764 chmod = 0755,
6865 install_path = bld.env['BINDIR'],
1414 import Configure, Scripting
1515
1616 # used by waf dist and waf build
17 VERSION='0.11.0'
17 VERSION='0.11.1'
1818 APPNAME='guitarix'
1919
20 good_faust_versions = ['0.9.24','0.9.27']
20 good_faust_versions = ['0.9.24','0.9.27','0.9.29']
2121
2222 # these variables are mandatory ('/' are converted automatically)
2323 srcdir = '.'