From a207b8ec6264ee44a02c4f9aca88f968e0fdde59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 20 Feb 2009 22:08:02 +0100 Subject: [PATCH] merge all functions to set chorusfx parameters into one --- gdigi.c | 118 +++---------------------------- gdigi.h | 141 ++++++++++++++++++------------------- gui.c | 94 ++++++++++++------------- tests.c | 210 ++++++++++++++++++++++++++++---------------------------- 4 files changed, 229 insertions(+), 334 deletions(-) diff --git a/gdigi.c b/gdigi.c index e3a8f86..4bc1e15 100644 --- a/gdigi.c +++ b/gdigi.c @@ -356,7 +356,7 @@ void set_dist_type(int type) send_data(set_dist, sizeof(set_dist)); } -void set_dist_option(char option, int value) +void set_dist_option(guint32 option, int value) { static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x09, 0x00 /* option */, 0x06, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; @@ -598,7 +598,7 @@ void set_noisegate_type(int type) } /* x = 0 to 99 */ -void set_gate_option(char option, int x) +void set_gate_option(guint32 option, int x) { static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x02, 0x00 /* option */, 0x0C, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; @@ -624,112 +624,16 @@ void set_noisegate_on_off(gboolean val) send_data(set_gate, sizeof(set_gate)); } -void set_chorusfx_option(char option, int x) +void set_chorusfx_option(guint32 option, int x) { - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x03, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; + static char set_option[] = {0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00 /* option1 */, 0x00 /* option2 */, 0x00 /* option3 */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; + set_option[8] = ((option & 0xFF0000) >> 16); + set_option[9] = ((option & 0x00FF00) >> 8); + set_option[10] = ((option & 0x0000FF)); - send_data(set_option, sizeof(set_option)); -} - -void set_flanger_option(char option, int x) -{ - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x03, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; - - send_data(set_option, sizeof(set_option)); -} - -void set_vibrato_option(char option, int x) -{ - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x05, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; - - send_data(set_option, sizeof(set_option)); -} - -void set_tremolo_option(char option, int x) -{ - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x04, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; - - send_data(set_option, sizeof(set_option)); -} - -void set_envelope_option(char option, int x) -{ - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x06, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; - - send_data(set_option, sizeof(set_option)); -} - -void set_ya_option(char option, int x) -{ - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x05, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; - - send_data(set_option, sizeof(set_option)); -} - -void set_filter_option(char option, int x) -{ - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x0B, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; - - send_data(set_option, sizeof(set_option)); -} - -void set_whammy_option(char option, int x) -{ - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x07, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; - - send_data(set_option, sizeof(set_option)); -} - -void set_pitch_option(char option, int x) -{ - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x06, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; - - send_data(set_option, sizeof(set_option)); -} - -void set_ips_option(char option, int x) -{ - static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x0A, 0x00 /* option */, 0x0E, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; - - set_option[11] = option; - set_option[13] = x; - set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07; + set_option[12] = x; + set_option[13] = calculate_checksum(set_option, sizeof(set_option), 13) ^ 0x07; send_data(set_option, sizeof(set_option)); } @@ -819,7 +723,7 @@ void set_delay_type(int type) send_data(set_type, sizeof(set_type)); } -void set_delay_option(char option, int x) +void set_delay_option(guint32 option, int x) { static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x07, 0x00 /* option */, 0x0F, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; @@ -846,7 +750,7 @@ void set_delay_on_off(gboolean val) } /* x = 0 to 15 (predelay), otherwise 0 to 99 */ -void set_reverb_option(char option, int x) +void set_reverb_option(guint32 option, int x) { static char set_option[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x07, 0x00 /* option */, 0x10, 0x00 /* value */, 0x00 /* checksum */, 0xF7}; diff --git a/gdigi.h b/gdigi.h index d10e1cd..e9056ad 100644 --- a/gdigi.h +++ b/gdigi.h @@ -134,85 +134,85 @@ enum { CHORUS_TYPE_IPS }; -#define CE_CHORUS_SPEED 0x45 -#define CE_CHORUS_DEPTH 0x46 +#define CE_CHORUS_SPEED 0x000345 +#define CE_CHORUS_DEPTH 0x000346 -#define DUAL_CHORUS_SPEED 0x45 -#define DUAL_CHORUS_DEPTH 0x46 -#define DUAL_CHORUS_LEVEL 0x44 -#define DUAL_CHORUS_WAVE 0x48 +#define DUAL_CHORUS_SPEED 0x000345 +#define DUAL_CHORUS_DEPTH 0x000346 +#define DUAL_CHORUS_LEVEL 0x000344 +#define DUAL_CHORUS_WAVE 0x000348 -#define MULTI_CHORUS_SPEED 0x45 -#define MULTI_CHORUS_DEPTH 0x46 -#define MULTI_CHORUS_WAVE 0x48 -#define MULTI_CHORUS_LEVEL 0x44 +#define MULTI_CHORUS_SPEED 0x000345 +#define MULTI_CHORUS_DEPTH 0x000346 +#define MULTI_CHORUS_WAVE 0x000348 +#define MULTI_CHORUS_LEVEL 0x000344 -#define FLANGER_SPEED 0x06 -#define FLANGER_DEPTH 0x07 -#define FLANGER_REGEN 0x08 -#define FLANGER_LEVEL 0x05 -#define FLANGER_WAVE 0x09 +#define FLANGER_SPEED 0x200306 +#define FLANGER_DEPTH 0x200307 +#define FLANGER_REGEN 0x200308 +#define FLANGER_LEVEL 0x200305 +#define FLANGER_WAVE 0x200309 -#define MXR_FLANGER_SPEED 0x06 -#define MXR_FLANGER_WIDTH 0x12 -#define MXR_FLANGER_REGEN 0x08 -#define MXR_FLANGER_MANUAL 0x15 +#define MXR_FLANGER_SPEED 0x200306 +#define MXR_FLANGER_WIDTH 0x200312 +#define MXR_FLANGER_REGEN 0x200308 +#define MXR_FLANGER_MANUAL 0x200315 -#define PHASER_SPEED 0x42 -#define PHASER_DEPTH 0x43 -#define PHASER_REGEN 0x46 -#define PHASER_LEVEL 0x45 -#define PHASER_WAVE 0x47 +#define PHASER_SPEED 0x200342 +#define PHASER_DEPTH 0x200343 +#define PHASER_REGEN 0x200346 +#define PHASER_LEVEL 0x200345 +#define PHASER_WAVE 0x200347 -#define VIBRATO_SPEED 0x04 -#define VIBRATO_DEPTH 0x05 +#define VIBRATO_SPEED 0x000504 +#define VIBRATO_DEPTH 0x000505 -#define ROTARY_SPEED 0x42 -#define ROTARY_INTENSITY 0x44 -#define ROTARY_DOPPLER 0x46 -#define ROTARY_CROSSOVER 0x47 +#define ROTARY_SPEED 0x000542 +#define ROTARY_INTENSITY 0x000544 +#define ROTARY_DOPPLER 0x000546 +#define ROTARY_CROSSOVER 0x000547 -#define VIBROPAN_SPEED 0x22 -#define VIBROPAN_DEPTH 0x23 -#define VIBROPAN_VIBRA 0x24 -#define VIBROPAN_WAVE 0x25 +#define VIBROPAN_SPEED 0x000522 +#define VIBROPAN_DEPTH 0x000523 +#define VIBROPAN_VIBRA 0x000524 +#define VIBROPAN_WAVE 0x000525 -#define TREMOLO_SPEED 0x04 -#define TREMOLO_DEPTH 0x03 -#define TREMOLO_WAVE 0x05 +#define TREMOLO_SPEED 0x200404 +#define TREMOLO_DEPTH 0x200403 +#define TREMOLO_WAVE 0x200405 -#define PANNER_SPEED 0x44 -#define PANNER_DEPTH 0x43 -#define PANNER_WAVE 0x45 +#define PANNER_SPEED 0x200444 +#define PANNER_DEPTH 0x200443 +#define PANNER_WAVE 0x200445 -#define ENVELOPE_SENSITIVITY 0x46 -#define ENVELOPE_RANGE 0x45 +#define ENVELOPE_SENSITIVITY 0x000646 +#define ENVELOPE_RANGE 0x000645 -#define AUTOYA_SPEED 0x46 -#define AUTOYA_INTENSITY 0x4A -#define AUTOYA_RANGE 0x4B +#define AUTOYA_SPEED 0x200546 +#define AUTOYA_INTENSITY 0x20054A +#define AUTOYA_RANGE 0x20054B -#define YAYA_PEDAL 0x02 -#define YAYA_INTENSITY 0x09 -#define YAYA_RANGE 0x0A +#define YAYA_PEDAL 0x200502 +#define YAYA_INTENSITY 0x200509 +#define YAYA_RANGE 0x20050A -#define STEP_FILTER_SPEED 0x42 -#define STEP_FILTER_INTENSITY 0x43 +#define STEP_FILTER_SPEED 0x200B42 +#define STEP_FILTER_INTENSITY 0x200B43 -#define WHAMMY_AMOUNT 0x05 -#define WHAMMY_PEDAL 0x03 -#define WHAMMY_MIX 0x04 +#define WHAMMY_AMOUNT 0x000705 +#define WHAMMY_PEDAL 0x000703 +#define WHAMMY_MIX 0x000704 -#define PITCH_AMOUNT 0x42 -#define PITCH_MIX 0x51 +#define PITCH_AMOUNT 0x200642 +#define PITCH_MIX 0x200651 -#define DETUNE_AMOUNT 0x04 -#define DETUNE_LEVEL 0x03 +#define DETUNE_AMOUNT 0x200604 +#define DETUNE_LEVEL 0x200603 -#define IPS_SHIFT_AMOUNT 0x42 -#define IPS_KEY 0x44 -#define IPS_SCALE 0x43 -#define IPS_LEVEL 0x45 +#define IPS_SHIFT_AMOUNT 0x200A42 +#define IPS_KEY 0x200A44 +#define IPS_SCALE 0x200A43 +#define IPS_LEVEL 0x200A45 /* DUAL_CHORUS_WAVE, MULTI_CHORUS_WAVE, FLANGER_WAVE, PHASER_WAVE, VIBROPAN_WAVE, TREMOLO_WAVE, PANNER_WAVE valid values */ @@ -358,7 +358,7 @@ void switch_system_preset(int x); void set_pickup_type(int type); void set_pickup_on_off(gboolean val); void set_dist_type(int type); -void set_dist_option(char option, int value); +void set_dist_option(guint32 option, int value); void set_dist_on_off(gboolean val); void set_preset_level(int level); void set_eq_type(int type); @@ -371,24 +371,15 @@ void set_eq_treble(int x); void set_eq_treb_hz(int x); void set_eq_on_off(gboolean val); void set_noisegate_type(int type); -void set_gate_option(char option, int x); +void set_gate_option(guint32 option, int x); void set_noisegate_on_off(gboolean val); -void set_chorusfx_option(char option, int x); -void set_flanger_option(char option, int x); -void set_vibrato_option(char option, int x); -void set_tremolo_option(char option, int x); -void set_envelope_option(char option, int x); -void set_ya_option(char option, int x); -void set_filter_option(char option, int x); -void set_whammy_option(char option, int x); -void set_pitch_option(char option, int x); -void set_ips_option(char option, int x); +void set_chorusfx_option(guint32 option, int x); void set_chorusfx_type(int type); void set_chorusfx_on_off(gboolean val); void set_delay_time(int x); void set_delay_type(int type); -void set_delay_option(char option, int x); +void set_delay_option(guint32 option, int x); void set_delay_on_off(gboolean val); -void set_reverb_option(char option, int x); +void set_reverb_option(guint32 option, int x); void set_reverb_type(int type); void set_reverb_on_off(gboolean val); diff --git a/gui.c b/gui.c index 2562068..2410306 100644 --- a/gui.c +++ b/gui.c @@ -23,11 +23,11 @@ void value_changed_cb(GtkSpinButton *spinbutton, void (*callback)(int)) callback(val); } -void value_changed_option_cb(GtkSpinButton *spinbutton, void (*callback)(char, int)) +void value_changed_option_cb(GtkSpinButton *spinbutton, void (*callback)(guint32, int)) { int val = gtk_spin_button_get_value_as_int(spinbutton); - gint option = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(spinbutton), "option_id")); - callback((char)option, val); + guint32 option = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(spinbutton), "option_id")); + callback(option, val); } void toggled_cb(GtkToggleButton *button, void (*callback)(gboolean)) @@ -39,10 +39,10 @@ void toggled_cb(GtkToggleButton *button, void (*callback)(gboolean)) typedef struct { char *label; void (*callback)(int); - void (*callback_with_option)(char, int); + void (*callback_with_option)(guint32, int); gdouble min; gdouble max; - gint option; + guint32 option; } SettingsWidget; static SettingsWidget wah_widgets[] = { @@ -191,84 +191,84 @@ static SettingsWidget chorusfx_multi_widgets[] = { }; static SettingsWidget chorusfx_flanger_widgets[] = { - {"Flanger speed", NULL, set_flanger_option, 0.0, 99.0, FLANGER_SPEED}, - {"Flanger depth", NULL, set_flanger_option, 0.0, 99.0, FLANGER_DEPTH}, - {"Flanger regen", NULL, set_flanger_option, 0.0, 99.0, FLANGER_REGEN}, - {"Flanger level", NULL, set_flanger_option, 0.0, 99.0, FLANGER_LEVEL}, + {"Flanger speed", NULL, set_chorusfx_option, 0.0, 99.0, FLANGER_SPEED}, + {"Flanger depth", NULL, set_chorusfx_option, 0.0, 99.0, FLANGER_DEPTH}, + {"Flanger regen", NULL, set_chorusfx_option, 0.0, 99.0, FLANGER_REGEN}, + {"Flanger level", NULL, set_chorusfx_option, 0.0, 99.0, FLANGER_LEVEL}, // TODO: FLANGER_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE }; static SettingsWidget chorusfx_mxr_flanger_widgets[] = { - {"MXR flanger speed", NULL, set_flanger_option, 0.0, 99.0, MXR_FLANGER_SPEED}, - {"MXR flanger width", NULL, set_flanger_option, 0.0, 99.0, MXR_FLANGER_WIDTH}, - {"MXR flanger regen", NULL, set_flanger_option, 0.0, 99.0, MXR_FLANGER_REGEN}, - {"MXR flanger manual", NULL, set_flanger_option, 0.0, 99.0, MXR_FLANGER_MANUAL}, + {"MXR flanger speed", NULL, set_chorusfx_option, 0.0, 99.0, MXR_FLANGER_SPEED}, + {"MXR flanger width", NULL, set_chorusfx_option, 0.0, 99.0, MXR_FLANGER_WIDTH}, + {"MXR flanger regen", NULL, set_chorusfx_option, 0.0, 99.0, MXR_FLANGER_REGEN}, + {"MXR flanger manual", NULL, set_chorusfx_option, 0.0, 99.0, MXR_FLANGER_MANUAL}, }; static SettingsWidget chorusfx_phaser_widgets[] = { - {"Phaser speed", NULL, set_flanger_option, 0.0, 99.0, PHASER_SPEED}, - {"Phaser depth", NULL, set_flanger_option, 0.0, 99.0, PHASER_DEPTH}, - {"Phaser regen", NULL, set_flanger_option, 0.0, 99.0, PHASER_REGEN}, - {"Phaser level", NULL, set_flanger_option, 0.0, 99.0, PHASER_LEVEL}, + {"Phaser speed", NULL, set_chorusfx_option, 0.0, 99.0, PHASER_SPEED}, + {"Phaser depth", NULL, set_chorusfx_option, 0.0, 99.0, PHASER_DEPTH}, + {"Phaser regen", NULL, set_chorusfx_option, 0.0, 99.0, PHASER_REGEN}, + {"Phaser level", NULL, set_chorusfx_option, 0.0, 99.0, PHASER_LEVEL}, // TODO: PHASER_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE }; static SettingsWidget chorusfx_vibrato_widgets[] = { - {"Vibrato speed", NULL, set_vibrato_option, 0.0, 99.0, VIBRATO_SPEED}, - {"Vibrato depth", NULL, set_vibrato_option, 0.0, 99.0, VIBRATO_DEPTH}, + {"Vibrato speed", NULL, set_chorusfx_option, 0.0, 99.0, VIBRATO_SPEED}, + {"Vibrato depth", NULL, set_chorusfx_option, 0.0, 99.0, VIBRATO_DEPTH}, }; static SettingsWidget chorusfx_rotary_widgets[] = { - {"Rotary speed", NULL, set_vibrato_option, 0.0, 99.0, ROTARY_SPEED}, - {"Rotary intensity", NULL, set_vibrato_option, 0.0, 99.0, ROTARY_INTENSITY}, - {"Rotary doppler", NULL, set_vibrato_option, 0.0, 99.0, ROTARY_DOPPLER}, - {"Rotary crossover", NULL, set_vibrato_option, 0.0, 99.0, ROTARY_CROSSOVER}, + {"Rotary speed", NULL, set_chorusfx_option, 0.0, 99.0, ROTARY_SPEED}, + {"Rotary intensity", NULL, set_chorusfx_option, 0.0, 99.0, ROTARY_INTENSITY}, + {"Rotary doppler", NULL, set_chorusfx_option, 0.0, 99.0, ROTARY_DOPPLER}, + {"Rotary crossover", NULL, set_chorusfx_option, 0.0, 99.0, ROTARY_CROSSOVER}, }; static SettingsWidget chorusfx_vibropan_widgets[] = { - {"Vibropan speed", NULL, set_vibrato_option, 0.0, 99.0, VIBROPAN_SPEED}, - {"Vibropan depth", NULL, set_vibrato_option, 0.0, 99.0, VIBROPAN_DEPTH}, - {"Vibropan vibra", NULL, set_vibrato_option, 0.0, 99.0, VIBROPAN_VIBRA}, + {"Vibropan speed", NULL, set_chorusfx_option, 0.0, 99.0, VIBROPAN_SPEED}, + {"Vibropan depth", NULL, set_chorusfx_option, 0.0, 99.0, VIBROPAN_DEPTH}, + {"Vibropan vibra", NULL, set_chorusfx_option, 0.0, 99.0, VIBROPAN_VIBRA}, // TODO: VIBROPAN_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE }; static SettingsWidget chorusfx_tremolo_widgets[] = { - {"Tremolo speed", NULL, set_tremolo_option, 0.0, 99.0, TREMOLO_SPEED}, - {"Tremolo depth", NULL, set_tremolo_option, 0.0, 99.0, TREMOLO_DEPTH}, + {"Tremolo speed", NULL, set_chorusfx_option, 0.0, 99.0, TREMOLO_SPEED}, + {"Tremolo depth", NULL, set_chorusfx_option, 0.0, 99.0, TREMOLO_DEPTH}, // TODO: TREMOLO_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE }; static SettingsWidget chorusfx_panner_widgets[] = { - {"Panner speed", NULL, set_tremolo_option, 0.0, 99.0, PANNER_SPEED}, - {"Panner depth", NULL, set_tremolo_option, 0.0, 99.0, PANNER_DEPTH}, + {"Panner speed", NULL, set_chorusfx_option, 0.0, 99.0, PANNER_SPEED}, + {"Panner depth", NULL, set_chorusfx_option, 0.0, 99.0, PANNER_DEPTH}, // TODO: PANNER_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE }; static SettingsWidget chorusfx_envelope_widgets[] = { - {"Envelope sensitivity", NULL, set_envelope_option, 0.0, 99.0, ENVELOPE_SENSITIVITY}, - {"Envelope range", NULL, set_envelope_option, 0.0, 99.0, ENVELOPE_RANGE}, + {"Envelope sensitivity", NULL, set_chorusfx_option, 0.0, 99.0, ENVELOPE_SENSITIVITY}, + {"Envelope range", NULL, set_chorusfx_option, 0.0, 99.0, ENVELOPE_RANGE}, }; static SettingsWidget chorusfx_autoya_widgets[] = { - {"AutoYa speed", NULL, set_ya_option, 0.0, 99.0, AUTOYA_SPEED}, - {"AutoYa intensity", NULL, set_ya_option, 0.0, 99.0, AUTOYA_INTENSITY}, - {"AutoYa range", NULL, set_ya_option, 0.0, 49.0, AUTOYA_RANGE}, + {"AutoYa speed", NULL, set_chorusfx_option, 0.0, 99.0, AUTOYA_SPEED}, + {"AutoYa intensity", NULL, set_chorusfx_option, 0.0, 99.0, AUTOYA_INTENSITY}, + {"AutoYa range", NULL, set_chorusfx_option, 0.0, 49.0, AUTOYA_RANGE}, }; static SettingsWidget chorusfx_yaya_widgets[] = { - {"YaYa pedal", NULL, set_ya_option, 0.0, 99.0, YAYA_PEDAL}, - {"YaYa intensity", NULL, set_ya_option, 0.0, 99.0, YAYA_INTENSITY}, - {"YaYa range", NULL, set_ya_option, 0.0, 49.0, YAYA_RANGE}, + {"YaYa pedal", NULL, set_chorusfx_option, 0.0, 99.0, YAYA_PEDAL}, + {"YaYa intensity", NULL, set_chorusfx_option, 0.0, 99.0, YAYA_INTENSITY}, + {"YaYa range", NULL, set_chorusfx_option, 0.0, 49.0, YAYA_RANGE}, }; static SettingsWidget chorusfx_step_filter_widgets[] = { - {"Step filter speed", NULL, set_filter_option, 0.0, 99.0, STEP_FILTER_SPEED}, - {"Step filter intensity", NULL, set_filter_option, 0.0, 99.0, STEP_FILTER_INTENSITY}, + {"Step filter speed", NULL, set_chorusfx_option, 0.0, 99.0, STEP_FILTER_SPEED}, + {"Step filter intensity", NULL, set_chorusfx_option, 0.0, 99.0, STEP_FILTER_INTENSITY}, }; static SettingsWidget chorusfx_whammy_widgets[] = { - {"Whammy pedal", NULL, set_whammy_option, 0.0, 99.0, WHAMMY_PEDAL}, - {"Whammy mix", NULL, set_whammy_option, 0.0, 99.0, WHAMMY_MIX}, + {"Whammy pedal", NULL, set_chorusfx_option, 0.0, 99.0, WHAMMY_PEDAL}, + {"Whammy mix", NULL, set_chorusfx_option, 0.0, 99.0, WHAMMY_MIX}, //TODO: WHAMMY_AMOUNT with valid options: // WHAMMY_OCT_UP, WHAMMY_2OCT_UP, WHAMMY_2ND_DN, WHAMMY_RV_2ND, // WHAMMY_4TH_DN, WHAMMY_OCT_DN, WHAMMY_2OCT_DN, WHAMMY_DIV_BMB, @@ -278,13 +278,13 @@ static SettingsWidget chorusfx_whammy_widgets[] = { static SettingsWidget chorusfx_pitch_shift_widgets[] = { // TODO: make this display propertly (display range -24 to 24) - {"Pitch amount", NULL, set_pitch_option, 0.0, 48.0, PITCH_AMOUNT}, - {"Pitch mix", NULL, set_pitch_option, 0.0, 99.0, PITCH_MIX}, + {"Pitch amount", NULL, set_chorusfx_option, 0.0, 48.0, PITCH_AMOUNT}, + {"Pitch mix", NULL, set_chorusfx_option, 0.0, 99.0, PITCH_MIX}, }; static SettingsWidget chorusfx_detune_widgets[] = { - {"Detune amount", NULL, set_pitch_option, 0.0, 48.0, DETUNE_AMOUNT}, - {"Detune level", NULL, set_pitch_option, 0.0, 99.0, DETUNE_LEVEL}, + {"Detune amount", NULL, set_chorusfx_option, 0.0, 48.0, DETUNE_AMOUNT}, + {"Detune level", NULL, set_chorusfx_option, 0.0, 99.0, DETUNE_LEVEL}, }; static SettingsWidget chorusfx_ips_widgets[] = { @@ -300,7 +300,7 @@ static SettingsWidget chorusfx_ips_widgets[] = { // TODO: IPS_SCALE with valid options: // IPS_MAJOR, IPS_MINOR, IPS_DORIA, IPS_MIXLYD, IPS_LYDIAN, IPS_HMINO - {"IPS level", NULL, set_ips_option, 0.0, 99.0, IPS_LEVEL}, + {"IPS level", NULL, set_chorusfx_option, 0.0, 99.0, IPS_LEVEL}, }; static SettingsWidget delay_analog_widgets[] = { diff --git a/tests.c b/tests.c index 80cbe5c..d39f2da 100644 --- a/tests.c +++ b/tests.c @@ -315,182 +315,182 @@ void test_chorusfx() set_chorusfx_type(CHORUS_TYPE_FLANGER); for (x=0; x<=99; x++) - set_flanger_option(FLANGER_SPEED, x); + set_chorusfx_option(FLANGER_SPEED, x); for (x=0; x<=99; x++) - set_flanger_option(FLANGER_DEPTH, x); + set_chorusfx_option(FLANGER_DEPTH, x); for (x=0; x<=99; x++) - set_flanger_option(FLANGER_REGEN, x); + set_chorusfx_option(FLANGER_REGEN, x); for (x=0; x<=99; x++) - set_flanger_option(FLANGER_LEVEL, x); - set_flanger_option(FLANGER_WAVE, WAVE_TRI); - set_flanger_option(FLANGER_WAVE, WAVE_SINE); - set_flanger_option(FLANGER_WAVE, WAVE_SQUARE); + set_chorusfx_option(FLANGER_LEVEL, x); + set_chorusfx_option(FLANGER_WAVE, WAVE_TRI); + set_chorusfx_option(FLANGER_WAVE, WAVE_SINE); + set_chorusfx_option(FLANGER_WAVE, WAVE_SQUARE); set_chorusfx_type(CHORUS_TYPE_MXR_FLANGER); for (x=0; x<=99; x++) - set_flanger_option(MXR_FLANGER_SPEED, x); + set_chorusfx_option(MXR_FLANGER_SPEED, x); for (x=0; x<=99; x++) - set_flanger_option(MXR_FLANGER_WIDTH, x); + set_chorusfx_option(MXR_FLANGER_WIDTH, x); for (x=0; x<=99; x++) - set_flanger_option(MXR_FLANGER_REGEN, x); + set_chorusfx_option(MXR_FLANGER_REGEN, x); for (x=0; x<=99; x++) - set_flanger_option(MXR_FLANGER_MANUAL, x); + set_chorusfx_option(MXR_FLANGER_MANUAL, x); set_chorusfx_type(CHORUS_TYPE_PHASER); for (x=0; x<=99; x++) - set_flanger_option(PHASER_SPEED, x); + set_chorusfx_option(PHASER_SPEED, x); for (x=0; x<=99; x++) - set_flanger_option(PHASER_DEPTH, x); + set_chorusfx_option(PHASER_DEPTH, x); for (x=0; x<=99; x++) - set_flanger_option(PHASER_REGEN, x); + set_chorusfx_option(PHASER_REGEN, x); for (x=0; x<=99; x++) - set_flanger_option(PHASER_LEVEL, x); - set_flanger_option(PHASER_WAVE, WAVE_TRI); - set_flanger_option(PHASER_WAVE, WAVE_SINE); - set_flanger_option(PHASER_WAVE, WAVE_SQUARE); + set_chorusfx_option(PHASER_LEVEL, x); + set_chorusfx_option(PHASER_WAVE, WAVE_TRI); + set_chorusfx_option(PHASER_WAVE, WAVE_SINE); + set_chorusfx_option(PHASER_WAVE, WAVE_SQUARE); set_chorusfx_type(CHORUS_TYPE_VIBRATO); for (x=0; x<=99; x++) - set_vibrato_option(VIBRATO_SPEED, x); + set_chorusfx_option(VIBRATO_SPEED, x); for (x=0; x<=99; x++) - set_vibrato_option(VIBRATO_DEPTH, x); + set_chorusfx_option(VIBRATO_DEPTH, x); set_chorusfx_type(CHORUS_TYPE_ROTARY); for (x=0; x<=99; x++) - set_vibrato_option(ROTARY_SPEED, x); + set_chorusfx_option(ROTARY_SPEED, x); for (x=0; x<=99; x++) - set_vibrato_option(ROTARY_INTENSITY, x); + set_chorusfx_option(ROTARY_INTENSITY, x); for (x=0; x<=99; x++) - set_vibrato_option(ROTARY_DOPPLER, x); + set_chorusfx_option(ROTARY_DOPPLER, x); for (x=0; x<=99; x++) - set_vibrato_option(ROTARY_CROSSOVER, x); + set_chorusfx_option(ROTARY_CROSSOVER, x); set_chorusfx_type(CHORUS_TYPE_VIBROPAN); for (x=0; x<=99; x++) - set_vibrato_option(VIBROPAN_SPEED, x); + set_chorusfx_option(VIBROPAN_SPEED, x); for (x=0; x<=99; x++) - set_vibrato_option(VIBROPAN_DEPTH, x); + set_chorusfx_option(VIBROPAN_DEPTH, x); for (x=0; x<=99; x++) - set_vibrato_option(VIBROPAN_VIBRA, x); - set_vibrato_option(VIBROPAN_WAVE, WAVE_TRI); - set_vibrato_option(VIBROPAN_WAVE, WAVE_SINE); - set_vibrato_option(VIBROPAN_WAVE, WAVE_SQUARE); + set_chorusfx_option(VIBROPAN_VIBRA, x); + set_chorusfx_option(VIBROPAN_WAVE, WAVE_TRI); + set_chorusfx_option(VIBROPAN_WAVE, WAVE_SINE); + set_chorusfx_option(VIBROPAN_WAVE, WAVE_SQUARE); set_chorusfx_type(CHORUS_TYPE_TREMOLO); for (x=0; x<=99; x++) - set_tremolo_option(TREMOLO_SPEED, x); + set_chorusfx_option(TREMOLO_SPEED, x); for (x=0; x<=99; x++) - set_tremolo_option(TREMOLO_DEPTH, x); - set_tremolo_option(TREMOLO_WAVE, WAVE_TRI); - set_tremolo_option(TREMOLO_WAVE, WAVE_SINE); - set_tremolo_option(TREMOLO_WAVE, WAVE_SQUARE); + set_chorusfx_option(TREMOLO_DEPTH, x); + set_chorusfx_option(TREMOLO_WAVE, WAVE_TRI); + set_chorusfx_option(TREMOLO_WAVE, WAVE_SINE); + set_chorusfx_option(TREMOLO_WAVE, WAVE_SQUARE); set_chorusfx_type(CHORUS_TYPE_PANNER); for (x=0; x<=99; x++) - set_tremolo_option(PANNER_SPEED, x); + set_chorusfx_option(PANNER_SPEED, x); for (x=0; x<=99; x++) - set_tremolo_option(PANNER_DEPTH, x); - set_tremolo_option(PANNER_WAVE, WAVE_TRI); - set_tremolo_option(PANNER_WAVE, WAVE_SINE); - set_tremolo_option(PANNER_WAVE, WAVE_SQUARE); + set_chorusfx_option(PANNER_DEPTH, x); + set_chorusfx_option(PANNER_WAVE, WAVE_TRI); + set_chorusfx_option(PANNER_WAVE, WAVE_SINE); + set_chorusfx_option(PANNER_WAVE, WAVE_SQUARE); set_chorusfx_type(CHORUS_TYPE_ENVELOPE); for (x=0; x<=99; x++) - set_envelope_option(ENVELOPE_SENSITIVITY, x); + set_chorusfx_option(ENVELOPE_SENSITIVITY, x); for (x=0; x<=99; x++) - set_envelope_option(ENVELOPE_RANGE, x); + set_chorusfx_option(ENVELOPE_RANGE, x); set_chorusfx_type(CHORUS_TYPE_AUTOYA); for (x=0; x<=99; x++) - set_ya_option(AUTOYA_SPEED, x); + set_chorusfx_option(AUTOYA_SPEED, x); for (x=0; x<=99; x++) - set_ya_option(AUTOYA_INTENSITY, x); + set_chorusfx_option(AUTOYA_INTENSITY, x); for (x=0; x<=0x31; x++) - set_ya_option(AUTOYA_RANGE, x); + set_chorusfx_option(AUTOYA_RANGE, x); set_chorusfx_type(CHORUS_TYPE_YAYA); for (x=0; x<=99; x++) - set_ya_option(YAYA_PEDAL, x); + set_chorusfx_option(YAYA_PEDAL, x); for (x=0; x<=99; x++) - set_ya_option(YAYA_INTENSITY, x); + set_chorusfx_option(YAYA_INTENSITY, x); for (x=0; x<=0x31; x++) - set_ya_option(YAYA_RANGE, x); + set_chorusfx_option(YAYA_RANGE, x); set_chorusfx_type(CHORUS_TYPE_STEP_FILTER); for (x=0; x<=99; x++) - set_filter_option(STEP_FILTER_SPEED, x); + set_chorusfx_option(STEP_FILTER_SPEED, x); for (x=0; x<=99; x++) - set_filter_option(STEP_FILTER_INTENSITY, x); + set_chorusfx_option(STEP_FILTER_INTENSITY, x); set_chorusfx_type(CHORUS_TYPE_WHAMMY); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_OCT_UP); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_2OCT_UP); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_2ND_DN); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_RV_2ND); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_4TH_DN); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_OCT_DN); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_2OCT_DN); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_DIV_BMB); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_M3_MA); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_2ND_MA3); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_3RD_4TH); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_4TH_5TH); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_5TH_OCT); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_HOCT_UP); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_HOCT_DN); - set_whammy_option(WHAMMY_AMOUNT, WHAMMY_OCT_UD); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_OCT_UP); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_2OCT_UP); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_2ND_DN); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_RV_2ND); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_4TH_DN); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_OCT_DN); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_2OCT_DN); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_DIV_BMB); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_M3_MA); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_2ND_MA3); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_3RD_4TH); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_4TH_5TH); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_5TH_OCT); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_HOCT_UP); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_HOCT_DN); + set_chorusfx_option(WHAMMY_AMOUNT, WHAMMY_OCT_UD); for (x=0; x<=99; x++) - set_whammy_option(WHAMMY_PEDAL, x); + set_chorusfx_option(WHAMMY_PEDAL, x); for (x=0; x<=99; x++) - set_whammy_option(WHAMMY_MIX, x); + set_chorusfx_option(WHAMMY_MIX, x); set_chorusfx_type(CHORUS_TYPE_PITCH_SHIFT); for (x=0; x<=0x30; x++) - set_pitch_option(PITCH_AMOUNT, x); + set_chorusfx_option(PITCH_AMOUNT, x); for (x=0; x<=99; x++) - set_pitch_option(PITCH_MIX, x); + set_chorusfx_option(PITCH_MIX, x); set_chorusfx_type(CHORUS_TYPE_DETUNE); for (x=0; x<=0x30; x++) - set_pitch_option(DETUNE_AMOUNT, x); + set_chorusfx_option(DETUNE_AMOUNT, x); for (x=0; x<=99; x++) - set_pitch_option(DETUNE_LEVEL, x); + set_chorusfx_option(DETUNE_LEVEL, x); set_chorusfx_type(CHORUS_TYPE_IPS); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_OCT_D); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_7TH_DN); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_6TH_DN); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_5TH_DN); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_4TH_DN); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_3RD_DN); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_2ND_DN); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_2ND_UP); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_3RD_UP); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_4TH_UP); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_5TH_UP); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_6TH_UP); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_7TH_UP); - set_ips_option(IPS_SHIFT_AMOUNT, IPS_OCT_U); - set_ips_option(IPS_KEY, IPS_E); - set_ips_option(IPS_KEY, IPS_F); - set_ips_option(IPS_KEY, IPS_GB); - set_ips_option(IPS_KEY, IPS_G); - set_ips_option(IPS_KEY, IPS_AB); - set_ips_option(IPS_KEY, IPS_A); - set_ips_option(IPS_KEY, IPS_BB); - set_ips_option(IPS_KEY, IPS_B); - set_ips_option(IPS_KEY, IPS_C); - set_ips_option(IPS_KEY, IPS_DD); - set_ips_option(IPS_KEY, IPS_D); - set_ips_option(IPS_KEY, IPS_EB); - set_ips_option(IPS_SCALE, IPS_MAJOR); - set_ips_option(IPS_SCALE, IPS_MINOR); - set_ips_option(IPS_SCALE, IPS_DORIA); - set_ips_option(IPS_SCALE, IPS_MIXLYD); - set_ips_option(IPS_SCALE, IPS_LYDIAN); - set_ips_option(IPS_SCALE, IPS_HMINO); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_OCT_D); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_7TH_DN); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_6TH_DN); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_5TH_DN); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_4TH_DN); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_3RD_DN); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_2ND_DN); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_2ND_UP); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_3RD_UP); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_4TH_UP); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_5TH_UP); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_6TH_UP); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_7TH_UP); + set_chorusfx_option(IPS_SHIFT_AMOUNT, IPS_OCT_U); + set_chorusfx_option(IPS_KEY, IPS_E); + set_chorusfx_option(IPS_KEY, IPS_F); + set_chorusfx_option(IPS_KEY, IPS_GB); + set_chorusfx_option(IPS_KEY, IPS_G); + set_chorusfx_option(IPS_KEY, IPS_AB); + set_chorusfx_option(IPS_KEY, IPS_A); + set_chorusfx_option(IPS_KEY, IPS_BB); + set_chorusfx_option(IPS_KEY, IPS_B); + set_chorusfx_option(IPS_KEY, IPS_C); + set_chorusfx_option(IPS_KEY, IPS_DD); + set_chorusfx_option(IPS_KEY, IPS_D); + set_chorusfx_option(IPS_KEY, IPS_EB); + set_chorusfx_option(IPS_SCALE, IPS_MAJOR); + set_chorusfx_option(IPS_SCALE, IPS_MINOR); + set_chorusfx_option(IPS_SCALE, IPS_DORIA); + set_chorusfx_option(IPS_SCALE, IPS_MIXLYD); + set_chorusfx_option(IPS_SCALE, IPS_LYDIAN); + set_chorusfx_option(IPS_SCALE, IPS_HMINO); for (x=0; x<=99; x++) - set_ips_option(IPS_LEVEL, x); + set_chorusfx_option(IPS_LEVEL, x); set_chorusfx_on_off(TRUE); set_chorusfx_on_off(FALSE);