Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e802d05ad3 | ||
|
|
95f4ad698a | ||
|
|
9f3bdd002d | ||
|
|
0cfcd806b1 | ||
|
|
c0ac97d4e2 | ||
|
|
84e9ab0e01 | ||
|
|
2c6afe730d | ||
|
|
79912510b4 | ||
|
|
8bdeea7728 | ||
|
|
22de8a00ab | ||
|
|
5cf9c021d8 | ||
|
|
2d4798abf7 | ||
|
|
e427e6f4d3 | ||
|
|
886f01c1e4 | ||
|
|
1c4ff62baa | ||
|
|
edbea6ff43 | ||
|
|
c4b1fbff77 | ||
|
|
68d05bd1db | ||
|
|
73f9a21a02 | ||
|
|
66c5a966a6 | ||
|
|
e7ce11164b | ||
|
|
f95804026c | ||
|
|
5c5d0b3709 | ||
|
|
146745829f | ||
|
|
a207b8ec62 | ||
|
|
a38ab64870 |
68
HACKING
Normal file
68
HACKING
Normal file
@@ -0,0 +1,68 @@
|
||||
In general everything brings down to figure out:
|
||||
-ID
|
||||
-Position
|
||||
-Possible value range
|
||||
|
||||
There seems to be two possible ways to figure that out.
|
||||
1) Use USB sniffer together with X-Edit
|
||||
Once you set up X-Edit and usb sniffer, set some option.
|
||||
USB sniffer should report something like this being sent to device:
|
||||
(all numbers here are hex)
|
||||
04 F0 00 00 04 10 00 5E 04 02 41 00 04 30 09 00 07 00 34 F7
|
||||
|
||||
To get SysEx command out of it, remove every 4th byte, so we have:
|
||||
F0 00 00 10 00 5E 02 41 00 30 09 00 00 34 F7
|
||||
|
||||
SysEx message format seems to be formed like this:
|
||||
magic bytes - F0 00 00 10 00 5E 02 41
|
||||
status byte - in this example 00
|
||||
ID - in this example 30 09
|
||||
Position - in this example 00
|
||||
Value - in this example 00 (can be more bytes long, see below)
|
||||
Checksum - to calculate it, XOR all bytes, and then XOR it with 07
|
||||
Every message ends with F7
|
||||
|
||||
Status byte bits explained:
|
||||
7th - ???
|
||||
6th - if active add 80 to ID
|
||||
5th - ???
|
||||
4th - is active when value will start with length
|
||||
In such case value can be something like:
|
||||
01 12 or 02 12 34 or 03 12 34 56
|
||||
and proper values are:
|
||||
01 - 12
|
||||
02 - 1234
|
||||
03 - 123456
|
||||
3rd - when 4th bit is also active, and first value byte is 01
|
||||
then add 80 to value
|
||||
2nd - when 4th bit is also active, and first value byte is 02
|
||||
then add 80 to value
|
||||
1st - when 4th bit is also active, and first value byte is 03
|
||||
then add 80 to value
|
||||
|
||||
So for above example:
|
||||
ID = 3009 (hex) = 12297 (decimal)
|
||||
Position = 0
|
||||
One of possible values is 0. Usually value range is 0 to 99,
|
||||
albeit in some cases it's different - you have to check what values can
|
||||
X-Edit assign (there doesn't seem to be any sanity check in firmware)
|
||||
This is especially needed for IDs that set some effect type.
|
||||
|
||||
2) Save preset patch
|
||||
Patches seem to be simple XML files.
|
||||
Every parameter is written like this:
|
||||
<Param>
|
||||
<ID>65</ID>
|
||||
<Position>2</Position>
|
||||
<Value>0</Value>
|
||||
<Name>Pickup Enable</Name>
|
||||
<Text>Off</Text>
|
||||
</Param>
|
||||
ID is ID, Position is Position and Value is one of possible values.
|
||||
To get all possible values you can:
|
||||
do
|
||||
change value to next one possible in X-Edit
|
||||
(for example next effect type)
|
||||
save new patch
|
||||
check patch file and note the change
|
||||
while you don't have all possible values
|
||||
6
Makefile
6
Makefile
@@ -9,8 +9,8 @@ LIBS = `pkg-config --libs glib-2.0 gtk+-2.0 alsa`
|
||||
|
||||
all: gdigi
|
||||
|
||||
gdigi: gdigi.o tests.o gui.o
|
||||
$(CC) $(LIBS) $(OFLAG) gdigi gdigi.o tests.o gui.o
|
||||
gdigi: gdigi.o tests.o gui.o effects.o
|
||||
$(CC) $(LIBS) $(OFLAG) gdigi gdigi.o tests.o gui.o effects.o
|
||||
|
||||
gdigi.o: gdigi.c
|
||||
|
||||
@@ -18,6 +18,8 @@ tests.o: tests.c
|
||||
|
||||
gui.o: gui.c
|
||||
|
||||
effects.o: effects.c
|
||||
|
||||
clean:
|
||||
rm *.o
|
||||
|
||||
|
||||
3
TODO
3
TODO
@@ -1,11 +1,10 @@
|
||||
-figure out all magic commands
|
||||
-make complete gui
|
||||
-amp/cabinet models
|
||||
-expression pedal options
|
||||
-audio setup options
|
||||
-tone library
|
||||
-effects library
|
||||
-effects level
|
||||
-handling presets (loading, saving, exporting/importing to/from xml patches)
|
||||
-buildsystem
|
||||
-figure out how to get current device settings, start gui with proper values
|
||||
-fix expression pedal settings (possible types depend on active preset)
|
||||
|
||||
485
effects.c
Normal file
485
effects.c
Normal file
@@ -0,0 +1,485 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Tomasz Moń <desowin@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; under version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#include "gdigi.h"
|
||||
#include "effects.h"
|
||||
|
||||
static EffectSettings wah_settings[] = {
|
||||
{"Wah min", 0.0, 99.0, WAH_MIN, WAH_POSITION_MIN_MAX},
|
||||
{"Wah max", 0.0, 99.0, WAH_MAX, WAH_POSITION_MIN_MAX},
|
||||
{"Wah level", 0.0, 12.0, WAH_LEVEL, WAH_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings comp_digi_settings[] = {
|
||||
{"Compressor sustain", 0.0, 99.0, COMP_SUSTAIN, COMP_POSITION},
|
||||
{"Compressor tone", 0.0, 99.0, COMP_TONE, COMP_POSITION},
|
||||
{"Compressor attack", 0.0, 99.0, COMP_ATTACK, COMP_POSITION},
|
||||
{"Compressor level", 0.0, 99.0, COMP_LEVEL, COMP_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings comp_cs_settings[] = {
|
||||
{"Compressor sustain", 0.0, 99.0, COMP_SUSTAIN, COMP_POSITION},
|
||||
{"Compressor attack", 0.0, 99.0, COMP_ATTACK, COMP_POSITION},
|
||||
{"Compressor level", 0.0, 99.0, COMP_LEVEL, COMP_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_screamer_settings[] = {
|
||||
{"Screamer drive", 0.0, 99.0, DIST_SCREAMER_DRIVE, DIST_POSITION},
|
||||
{"Screamer tone", 0.0, 99.0, DIST_SCREAMER_TONE, DIST_POSITION},
|
||||
{"Screamer level", 0.0, 99.0, DIST_SCREAMER_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_808_settings[] = {
|
||||
{"808 overdrive", 0.0, 99.0, DIST_808_OVERDRIVE, DIST_POSITION},
|
||||
{"808 tone", 0.0, 99.0, DIST_808_TONE, DIST_POSITION},
|
||||
{"808 level", 0.0, 99.0, DIST_808_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_guyod_settings[] = {
|
||||
{"GuyOD drive", 0.0, 99.0, DIST_GUYOD_DRIVE, DIST_POSITION},
|
||||
{"GuyOD level", 0.0, 99.0, DIST_GUYOD_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_dod250_settings[] = {
|
||||
{"DOD250 gain", 0.0, 99.0, DIST_DOD250_GAIN, DIST_POSITION},
|
||||
{"DOD250 level", 0.0, 99.0, DIST_DOD250_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_rodent_settings[] = {
|
||||
{"Rodent dist", 0.0, 99.0, DIST_RODENT_DIST, DIST_POSITION},
|
||||
{"Rodent filter", 0.0, 99.0, DIST_RODENT_FILTER, DIST_POSITION},
|
||||
{"Rodent level", 0.0, 99.0, DIST_RODENT_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_mx_settings[] = {
|
||||
{"MX dist", 0.0, 99.0, DIST_MX_DIST, DIST_POSITION},
|
||||
{"MX output", 0.0, 99.0, DIST_MX_OUTPUT, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_ds_settings[] = {
|
||||
{"DS gain", 0.0, 99.0, DIST_DS_GAIN, DIST_POSITION},
|
||||
{"DS tone", 0.0, 99.0, DIST_DS_TONE, DIST_POSITION},
|
||||
{"DS level", 0.0, 99.0, DIST_DS_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_grunge_settings[] = {
|
||||
{"Grunge", 0.0, 99.0, DIST_GRUNGE_GRUNGE, DIST_POSITION},
|
||||
{"Grunge face", 0.0, 99.0, DIST_GRUNGE_FACE, DIST_POSITION},
|
||||
{"Grunge loud", 0.0, 99.0, DIST_GRUNGE_LOUD, DIST_POSITION},
|
||||
{"Grunge butt", 0.0, 99.0, DIST_GRUNGE_BUTT, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_zone_settings[] = {
|
||||
{"Zone gain", 0.0, 99.0, DIST_ZONE_GAIN, DIST_POSITION},
|
||||
{"Zone low", 0.0, 99.0, DIST_ZONE_LOW, DIST_POSITION},
|
||||
{"Zone mid level", 0.0, 99.0, DIST_ZONE_MID_LVL, DIST_POSITION},
|
||||
{"Zone mid freq", 0.0, 99.0, DIST_ZONE_MID_FREQ, DIST_POSITION},
|
||||
{"Zone high", 0.0, 99.0, DIST_ZONE_HIGH, DIST_POSITION},
|
||||
{"Zone level", 0.0, 99.0, DIST_ZONE_LEVEL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_death_settings[] = {
|
||||
{"Death low", 0.0, 99.0, DIST_DEATH_LOW, DIST_POSITION},
|
||||
{"Death mid", 0.0, 99.0, DIST_DEATH_MID, DIST_POSITION},
|
||||
{"Death high", 0.0, 99.0, DIST_DEATH_HIGH, DIST_POSITION},
|
||||
{"Death level", 0.0, 99.0, DIST_DEATH_LVL, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_gonk_settings[] = {
|
||||
{"Gonk gonk", 0.0, 99.0, DIST_GONK_GONK, DIST_POSITION},
|
||||
{"Gonk smear", 0.0, 99.0, DIST_GONK_SMEAR, DIST_POSITION},
|
||||
{"Gonk suck", 0.0, 99.0, DIST_GONK_SUCK, DIST_POSITION},
|
||||
{"Gonk heave", 0.0, 99.0, DIST_GONK_HEAVE, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_fuzzy_settings[] = {
|
||||
{"Fuzzy fuzz", 0.0, 99.0, DIST_FUZZY_FUZZ, DIST_POSITION},
|
||||
{"Fuzzy volume", 0.0, 99.0, DIST_FUZZY_VOLUME, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings dist_mp_settings[] = {
|
||||
{"MP sustain", 0.0, 99.0, DIST_MP_SUSTAIN, DIST_POSITION},
|
||||
{"MP tone", 0.0, 99.0, DIST_MP_TONE, DIST_POSITION},
|
||||
{"MP volume", 0.0, 99.0, DIST_MP_VOLUME, DIST_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings eq_settings[] = {
|
||||
{"EQ gain", 0.0, 99.0, AMP_GAIN, AMP_POSITION},
|
||||
{"EQ level", 0.0, 99.0, AMP_LEVEL, AMP_POSITION},
|
||||
// TODO: make those display propertly (display range -12 to 12)
|
||||
{"EQ bass", 0.0, 24.0, EQ_BASS, EQ_POSITION},
|
||||
{"EQ mid", 0.0, 24.0, EQ_MID, EQ_POSITION},
|
||||
{"EQ treble", 0.0, 24.0, EQ_TREBLE, EQ_POSITION},
|
||||
// TODO: make this display propertly (display range 300 to 5000)
|
||||
{"EQ mid Hz", 0.0, 4700.0, EQ_MID_HZ, EQ_POSITION},
|
||||
// TODO: make this display propertly (display range 500 to 8000)
|
||||
{"EQ treb Hz", 0.0, 7500.0, EQ_TREBLE_HZ, EQ_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings noisegate_gate_settings[] = {
|
||||
{"Gate treshold", 0.0, 99.0, NOISEGATE_GATE_TRESHOLD, NOISEGATE_POSITION},
|
||||
{"Gate attack", 0.0, 99.0, NOISEGATE_ATTACK, NOISEGATE_POSITION},
|
||||
{"Gate release", 0.0, 99.0, NOISEGATE_RELEASE, NOISEGATE_POSITION},
|
||||
{"Gate attn", 0.0, 99.0, NOISEGATE_ATTN, NOISEGATE_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings noisegate_swell_settings[] = {
|
||||
{"Swell sens", 0.0, 99.0, NOISEGATE_SWELL_SENS, NOISEGATE_POSITION},
|
||||
{"Swell attack", 0.0, 99.0, NOISEGATE_ATTACK, NOISEGATE_POSITION},
|
||||
{"Swell release", 0.0, 99.0, NOISEGATE_RELEASE, NOISEGATE_POSITION},
|
||||
{"Swell attn", 0.0, 99.0, NOISEGATE_ATTN, NOISEGATE_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_ce_settings[] = {
|
||||
{"CE chorus speed", 0.0, 99.0, CE_CHORUS_SPEED, CHORUSFX_POSITION},
|
||||
{"CE chorus depth", 0.0, 99.0, CE_CHORUS_DEPTH, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_dual_settings[] = {
|
||||
{"Dual chorus speed", 0.0, 99.0, DUAL_CHORUS_SPEED, CHORUSFX_POSITION},
|
||||
{"Dual chorus depth", 0.0, 99.0, DUAL_CHORUS_DEPTH, CHORUSFX_POSITION},
|
||||
{"Dual chorus level", 0.0, 99.0, DUAL_CHORUS_LEVEL, CHORUSFX_POSITION},
|
||||
// TODO: DUAL_CHORUS_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_multi_settings[] = {
|
||||
{"Multi chorus speed", 0.0, 99.0, MULTI_CHORUS_SPEED, CHORUSFX_POSITION},
|
||||
{"Multi chorus depth", 0.0, 99.0, MULTI_CHORUS_DEPTH, CHORUSFX_POSITION},
|
||||
{"Multi chorus level", 0.0, 99.0, MULTI_CHORUS_LEVEL, CHORUSFX_POSITION},
|
||||
// TODO: MULTI_CHORUS_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_flanger_settings[] = {
|
||||
{"Flanger speed", 0.0, 99.0, FLANGER_SPEED, CHORUSFX_POSITION},
|
||||
{"Flanger depth", 0.0, 99.0, FLANGER_DEPTH, CHORUSFX_POSITION},
|
||||
{"Flanger regen", 0.0, 99.0, FLANGER_REGEN, CHORUSFX_POSITION},
|
||||
{"Flanger level", 0.0, 99.0, FLANGER_LEVEL, CHORUSFX_POSITION},
|
||||
// TODO: FLANGER_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_mxr_flanger_settings[] = {
|
||||
{"MXR flanger speed", 0.0, 99.0, MXR_FLANGER_SPEED, CHORUSFX_POSITION},
|
||||
{"MXR flanger width", 0.0, 99.0, MXR_FLANGER_WIDTH, CHORUSFX_POSITION},
|
||||
{"MXR flanger regen", 0.0, 99.0, MXR_FLANGER_REGEN, CHORUSFX_POSITION},
|
||||
{"MXR flanger manual", 0.0, 99.0, MXR_FLANGER_MANUAL, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_phaser_settings[] = {
|
||||
{"Phaser speed", 0.0, 99.0, PHASER_SPEED, CHORUSFX_POSITION},
|
||||
{"Phaser depth", 0.0, 99.0, PHASER_DEPTH, CHORUSFX_POSITION},
|
||||
{"Phaser regen", 0.0, 99.0, PHASER_REGEN, CHORUSFX_POSITION},
|
||||
{"Phaser level", 0.0, 99.0, PHASER_LEVEL, CHORUSFX_POSITION},
|
||||
// TODO: PHASER_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_vibrato_settings[] = {
|
||||
{"Vibrato speed", 0.0, 99.0, VIBRATO_SPEED, CHORUSFX_POSITION},
|
||||
{"Vibrato depth", 0.0, 99.0, VIBRATO_DEPTH, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_rotary_settings[] = {
|
||||
{"Rotary speed", 0.0, 99.0, ROTARY_SPEED, CHORUSFX_POSITION},
|
||||
{"Rotary intensity", 0.0, 99.0, ROTARY_INTENSITY, CHORUSFX_POSITION},
|
||||
{"Rotary doppler", 0.0, 99.0, ROTARY_DOPPLER, CHORUSFX_POSITION},
|
||||
{"Rotary crossover", 0.0, 99.0, ROTARY_CROSSOVER, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_vibropan_settings[] = {
|
||||
{"Vibropan speed", 0.0, 99.0, VIBROPAN_SPEED, CHORUSFX_POSITION},
|
||||
{"Vibropan depth", 0.0, 99.0, VIBROPAN_DEPTH, CHORUSFX_POSITION},
|
||||
{"Vibropan vibra", 0.0, 99.0, VIBROPAN_VIBRA, CHORUSFX_POSITION},
|
||||
// TODO: VIBROPAN_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_tremolo_settings[] = {
|
||||
{"Tremolo speed", 0.0, 99.0, TREMOLO_SPEED, CHORUSFX_POSITION},
|
||||
{"Tremolo depth", 0.0, 99.0, TREMOLO_DEPTH, CHORUSFX_POSITION},
|
||||
// TODO: TREMOLO_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_panner_settings[] = {
|
||||
{"Panner speed", 0.0, 99.0, PANNER_SPEED, CHORUSFX_POSITION},
|
||||
{"Panner depth", 0.0, 99.0, PANNER_DEPTH, CHORUSFX_POSITION},
|
||||
// TODO: PANNER_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_envelope_settings[] = {
|
||||
{"Envelope sensitivity", 0.0, 99.0, ENVELOPE_SENSITIVITY, CHORUSFX_POSITION},
|
||||
{"Envelope range", 0.0, 99.0, ENVELOPE_RANGE, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_autoya_settings[] = {
|
||||
{"AutoYa speed", 0.0, 99.0, AUTOYA_SPEED, CHORUSFX_POSITION},
|
||||
{"AutoYa intensity", 0.0, 99.0, AUTOYA_INTENSITY, CHORUSFX_POSITION},
|
||||
{"AutoYa range", 0.0, 49.0, AUTOYA_RANGE, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_yaya_settings[] = {
|
||||
{"YaYa pedal", 0.0, 99.0, YAYA_PEDAL, CHORUSFX_POSITION},
|
||||
{"YaYa intensity", 0.0, 99.0, YAYA_INTENSITY, CHORUSFX_POSITION},
|
||||
{"YaYa range", 0.0, 49.0, YAYA_RANGE, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_step_filter_settings[] = {
|
||||
{"Step filter speed", 0.0, 99.0, STEP_FILTER_SPEED, CHORUSFX_POSITION},
|
||||
{"Step filter intensity", 0.0, 99.0, STEP_FILTER_INTENSITY, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_whammy_settings[] = {
|
||||
{"Whammy pedal", 0.0, 99.0, WHAMMY_PEDAL, CHORUSFX_POSITION},
|
||||
{"Whammy mix", 0.0, 99.0, WHAMMY_MIX, CHORUSFX_POSITION},
|
||||
//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,
|
||||
// WHAMMY_M3_MA, WHAMMY_2ND_MA3, WHAMMY_3RD_4TH, WHAMMY_4TH_5TH,
|
||||
// WHAMMY_5TH_OCT, WHAMMY_HOCT_UP, WHAMMY_HOCT_DN, WHAMMY_OCT_UD
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_pitch_shift_settings[] = {
|
||||
// TODO: make this display propertly (display range -24 to 24)
|
||||
{"Pitch amount", 0.0, 48.0, PITCH_AMOUNT, CHORUSFX_POSITION},
|
||||
{"Pitch mix", 0.0, 99.0, PITCH_MIX, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_detune_settings[] = {
|
||||
{"Detune amount", 0.0, 48.0, DETUNE_AMOUNT, CHORUSFX_POSITION},
|
||||
{"Detune level", 0.0, 99.0, DETUNE_LEVEL, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings chorusfx_ips_settings[] = {
|
||||
// TODO: IPS_SHIFT_AMOUNT with valid options:
|
||||
// IPS_7TH_DN, IPS_6TH_DN, IPS_5TH_DN, IPS_4TH_DN, IPS_3RD_DN,
|
||||
// IPS_2ND_DN, IPS_2ND_UP, IPS_3RD_UP, IPS_4TH_UP, IPS_5TH_UP,
|
||||
// IPS_6TH_UP, IPS_7TH_UP, IPS_OCT_U
|
||||
|
||||
// TODO: IPS_KEY with valid options:
|
||||
// IPS_E, IPS_F, IPS_GB, IPS_G, IPS_AB, IPS_A, IPS_BB, IPS_B,
|
||||
// IPS_C, IPS_DD, IPS_D, IPS_EB
|
||||
|
||||
// TODO: IPS_SCALE with valid options:
|
||||
// IPS_MAJOR, IPS_MINOR, IPS_DORIA, IPS_MIXLYD, IPS_LYDIAN, IPS_HMINO
|
||||
|
||||
{"IPS level", 0.0, 99.0, IPS_LEVEL, CHORUSFX_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_analog_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay analog level", 0.0, 99.0, ANALOG_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay analog repeats", 0.0, 100.0, ANALOG_REPEATS, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_digital_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay digital level", 0.0, 99.0, DIGITAL_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay digital repeats", 0.0, 100.0, DIGITAL_REPEATS, DELAY_POSITION},
|
||||
{"Delay digital ducker thresh", 0.0, 99.0, DIGITAL_DUCKER_THRESH, DELAY_POSITION},
|
||||
{"Delay digital ducker level", 0.0, 99.0, DIGITAL_DUCKER_LEVEL, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_modulated_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay modulated level", 0.0, 99.0, MODULATED_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay modulated repeats", 0.0, 100.0, MODULATED_REPEATS, DELAY_POSITION},
|
||||
{"Delay modulated depth", 0.0, 99.0, MODULATED_DEPTH, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_pong_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay pong level", 0.0, 99.0, PONG_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay pong repeats", 0.0, 100.0, PONG_REPEATS, DELAY_POSITION},
|
||||
{"Delay pong ducker thresh", 0.0, 99.0, PONG_DUCKER_THRESH, DELAY_POSITION},
|
||||
{"Delay pong ducker level", 0.0, 99.0, PONG_DUCKER_LEVEL, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings delay_tape_settings[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", 0.0, 139.0, DELAY_TIME, DELAY_POSITION},
|
||||
{"Delay tape level", 0.0, 99.0, TAPE_LEVEL, DELAY_POSITION},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay tape repeats", 0.0, 100.0, TAPE_REPEATS, DELAY_POSITION},
|
||||
{"Delay tape wow", 0.0, 99.0, TAPE_WOW, DELAY_POSITION},
|
||||
{"Delay tape flutter", 0.0, 99.0, TAPE_FLUTTER, DELAY_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_twin_settings[] = {
|
||||
{"Twin reverb", 0.0, 99.0, TWIN_REVERB, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_lex_ambience_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, LEX_AMBIENCE_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, LEX_AMBIENCE_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, LEX_AMBIENCE_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, LEX_AMBIENCE_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_lex_studio_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, LEX_STUDIO_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, LEX_STUDIO_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, LEX_STUDIO_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, LEX_STUDIO_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_lex_room_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, LEX_ROOM_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, LEX_ROOM_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, LEX_ROOM_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, LEX_ROOM_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_lex_hall_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, LEX_HALL_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, LEX_HALL_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, LEX_HALL_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, LEX_HALL_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectSettings reverb_emt240_plate_settings[] = {
|
||||
{"Predelay", 0.0, 15.0, EMT240_PLATE_PREDELAY, REVERB_POSITION},
|
||||
{"Decay", 0.0, 99.0, EMT240_PLATE_DECAY, REVERB_POSITION},
|
||||
{"Liveliness", 0.0, 99.0, EMT240_PLATE_LIVELINESS, REVERB_POSITION},
|
||||
{"Level", 0.0, 99.0, EMT240_PLATE_LEVEL, REVERB_POSITION},
|
||||
};
|
||||
|
||||
static EffectGroup wah_group[] = {
|
||||
{WAH_TYPE_CRY, "Cry wah", WAH_TYPE, WAH_POSITION, wah_settings, G_N_ELEMENTS(wah_settings)},
|
||||
{WAH_TYPE_FULLRANGE, "Fullrange wah", WAH_TYPE, WAH_POSITION, wah_settings, G_N_ELEMENTS(wah_settings)},
|
||||
{WAH_TYPE_CLYDE, "Clyde wah", WAH_TYPE, WAH_POSITION, wah_settings, G_N_ELEMENTS(wah_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup comp_group[] = {
|
||||
{COMP_TYPE_DIGI, "Digital compressor", COMP_TYPE, COMP_POSITION, comp_digi_settings, G_N_ELEMENTS(comp_digi_settings)},
|
||||
{COMP_TYPE_CS, "CS compressor", COMP_TYPE, COMP_POSITION, comp_cs_settings, G_N_ELEMENTS(comp_cs_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup dist_group[] = {
|
||||
{DIST_TYPE_SCREAMER, "Screamer", DIST_TYPE, DIST_POSITION, dist_screamer_settings, G_N_ELEMENTS(dist_screamer_settings)},
|
||||
{DIST_TYPE_808, "808", DIST_TYPE, DIST_POSITION, dist_808_settings, G_N_ELEMENTS(dist_808_settings)},
|
||||
{DIST_TYPE_GUYOD, "GuyOD", DIST_TYPE, DIST_POSITION, dist_guyod_settings, G_N_ELEMENTS(dist_guyod_settings)},
|
||||
{DIST_TYPE_DOD250, "DOD250", DIST_TYPE, DIST_POSITION, dist_dod250_settings, G_N_ELEMENTS(dist_dod250_settings)},
|
||||
{DIST_TYPE_RODENT, "Rodent", DIST_TYPE, DIST_POSITION, dist_rodent_settings, G_N_ELEMENTS(dist_rodent_settings)},
|
||||
{DIST_TYPE_MX, "MX", DIST_TYPE, DIST_POSITION, dist_mx_settings, G_N_ELEMENTS(dist_mx_settings)},
|
||||
{DIST_TYPE_DS, "DS", DIST_TYPE, DIST_POSITION, dist_ds_settings, G_N_ELEMENTS(dist_ds_settings)},
|
||||
{DIST_TYPE_GRUNGE, "Grunge", DIST_TYPE, DIST_POSITION, dist_grunge_settings, G_N_ELEMENTS(dist_grunge_settings)},
|
||||
{DIST_TYPE_ZONE, "Zone", DIST_TYPE, DIST_POSITION, dist_zone_settings, G_N_ELEMENTS(dist_zone_settings)},
|
||||
{DIST_TYPE_DEATH, "Death", DIST_TYPE, DIST_POSITION, dist_death_settings, G_N_ELEMENTS(dist_death_settings)},
|
||||
{DIST_TYPE_GONK, "Gonk", DIST_TYPE, DIST_POSITION, dist_gonk_settings, G_N_ELEMENTS(dist_gonk_settings)},
|
||||
{DIST_TYPE_FUZZY, "Fuzzy", DIST_TYPE, DIST_POSITION, dist_fuzzy_settings, G_N_ELEMENTS(dist_fuzzy_settings)},
|
||||
{DIST_TYPE_MP, "MP", DIST_TYPE, DIST_POSITION, dist_mp_settings, G_N_ELEMENTS(dist_mp_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup noisegate_group[] = {
|
||||
{NOISEGATE_GATE, "Gate", NOISEGATE_TYPE, NOISEGATE_POSITION, noisegate_gate_settings, G_N_ELEMENTS(noisegate_gate_settings)},
|
||||
{NOISEGATE_SWELL, "Swell", NOISEGATE_TYPE, NOISEGATE_POSITION, noisegate_swell_settings, G_N_ELEMENTS(noisegate_swell_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup chorusfx_group[] = {
|
||||
{CHORUS_TYPE_CE, "CE Chorus", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_ce_settings, G_N_ELEMENTS(chorusfx_ce_settings)},
|
||||
{CHORUS_TYPE_DUAL, "Dual Chorus", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_dual_settings, G_N_ELEMENTS(chorusfx_dual_settings)},
|
||||
{CHORUS_TYPE_MULTI, "Multi Chorus", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_multi_settings, G_N_ELEMENTS(chorusfx_multi_settings)},
|
||||
{CHORUS_TYPE_FLANGER, "Flanger", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_flanger_settings, G_N_ELEMENTS(chorusfx_flanger_settings)},
|
||||
{CHORUS_TYPE_MXR_FLANGER, "MXR FLANGER", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_mxr_flanger_settings, G_N_ELEMENTS(chorusfx_mxr_flanger_settings)},
|
||||
{CHORUS_TYPE_PHASER, "Phaser", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_phaser_settings, G_N_ELEMENTS(chorusfx_phaser_settings)},
|
||||
{CHORUS_TYPE_VIBRATO, "Vibrato", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_vibrato_settings, G_N_ELEMENTS(chorusfx_vibrato_settings)},
|
||||
{CHORUS_TYPE_ROTARY, "Rotary", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_rotary_settings, G_N_ELEMENTS(chorusfx_rotary_settings)},
|
||||
{CHORUS_TYPE_VIBROPAN, "Vibropan", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_vibropan_settings, G_N_ELEMENTS(chorusfx_vibropan_settings)},
|
||||
{CHORUS_TYPE_TREMOLO, "Tremolo", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_tremolo_settings, G_N_ELEMENTS(chorusfx_tremolo_settings)},
|
||||
{CHORUS_TYPE_PANNER, "Panner", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_panner_settings, G_N_ELEMENTS(chorusfx_panner_settings)},
|
||||
{CHORUS_TYPE_ENVELOPE, "Envelope", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_envelope_settings, G_N_ELEMENTS(chorusfx_envelope_settings)},
|
||||
{CHORUS_TYPE_AUTOYA, "AutoYa", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_autoya_settings, G_N_ELEMENTS(chorusfx_autoya_settings)},
|
||||
{CHORUS_TYPE_YAYA, "YaYa", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_yaya_settings, G_N_ELEMENTS(chorusfx_yaya_settings)},
|
||||
{CHORUS_TYPE_STEP_FILTER, "Step Filter", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_step_filter_settings, G_N_ELEMENTS(chorusfx_step_filter_settings)},
|
||||
{CHORUS_TYPE_WHAMMY, "Whammy", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_whammy_settings, G_N_ELEMENTS(chorusfx_whammy_settings)},
|
||||
{CHORUS_TYPE_PITCH_SHIFT, "Pitch Shift", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_pitch_shift_settings, G_N_ELEMENTS(chorusfx_pitch_shift_settings)},
|
||||
{CHORUS_TYPE_DETUNE, "Detune", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_detune_settings, G_N_ELEMENTS(chorusfx_detune_settings)},
|
||||
{CHORUS_TYPE_IPS, "IPS", CHORUSFX_TYPE, CHORUSFX_POSITION, chorusfx_ips_settings, G_N_ELEMENTS(chorusfx_ips_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup delay_group[] = {
|
||||
{DELAY_TYPE_ANALOG, "Analog", DELAY_TYPE, DELAY_POSITION, delay_analog_settings, G_N_ELEMENTS(delay_analog_settings)},
|
||||
{DELAY_TYPE_DIGITAL, "Digital", DELAY_TYPE, DELAY_POSITION, delay_digital_settings, G_N_ELEMENTS(delay_digital_settings)},
|
||||
{DELAY_TYPE_MODULATED, "Modulated", DELAY_TYPE, DELAY_POSITION, delay_modulated_settings, G_N_ELEMENTS(delay_modulated_settings)},
|
||||
{DELAY_TYPE_PONG, "Pong", DELAY_TYPE, DELAY_POSITION, delay_pong_settings, G_N_ELEMENTS(delay_pong_settings)},
|
||||
{DELAY_TYPE_TAPE, "Tape", DELAY_TYPE, DELAY_POSITION, delay_tape_settings, G_N_ELEMENTS(delay_tape_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup reverb_group[] = {
|
||||
{REVERB_TYPE_TWIN, "Twin", REVERB_TYPE, REVERB_POSITION, reverb_twin_settings, G_N_ELEMENTS(reverb_twin_settings)},
|
||||
{REVERB_TYPE_LEX_AMBIENCE, "Lexicon ambience", REVERB_TYPE, REVERB_POSITION, reverb_lex_ambience_settings, G_N_ELEMENTS(reverb_lex_ambience_settings)},
|
||||
{REVERB_TYPE_LEX_STUDIO, "Lexicon studio", REVERB_TYPE, REVERB_POSITION, reverb_lex_studio_settings, G_N_ELEMENTS(reverb_lex_studio_settings)},
|
||||
{REVERB_TYPE_LEX_ROOM, "Lexicon room", REVERB_TYPE, REVERB_POSITION, reverb_lex_room_settings, G_N_ELEMENTS(reverb_lex_room_settings)},
|
||||
{REVERB_TYPE_LEX_HALL, "Lexicon hall", REVERB_TYPE, REVERB_POSITION, reverb_lex_hall_settings, G_N_ELEMENTS(reverb_lex_hall_settings)},
|
||||
{REVERB_TYPE_EMT240_PLATE, "EMT240 Plate", REVERB_TYPE, REVERB_POSITION, reverb_emt240_plate_settings, G_N_ELEMENTS(reverb_emt240_plate_settings)},
|
||||
};
|
||||
|
||||
static EffectGroup eq_group[] = {
|
||||
{EQ_TYPE_BRIGHT, "Bright", EQ_TYPE, EQ_POSITION, eq_settings, G_N_ELEMENTS(eq_settings)},
|
||||
{EQ_TYPE_MIDBOOST, "Mid Boost", EQ_TYPE, EQ_POSITION, eq_settings, G_N_ELEMENTS(eq_settings)},
|
||||
{EQ_TYPE_SCOOP, "Scoop", EQ_TYPE, EQ_POSITION, eq_settings, G_N_ELEMENTS(eq_settings)},
|
||||
{EQ_TYPE_WARM, "Warm", EQ_TYPE, EQ_POSITION, eq_settings, G_N_ELEMENTS(eq_settings)},
|
||||
};
|
||||
|
||||
static Effect wah_effect[] = {
|
||||
{"Wah", WAH_ON_OFF, WAH_POSITION, wah_group, G_N_ELEMENTS(wah_group)},
|
||||
};
|
||||
|
||||
static Effect comp_effect[] = {
|
||||
{"Compressor", COMP_ON_OFF, COMP_POSITION, comp_group, G_N_ELEMENTS(comp_group)},
|
||||
};
|
||||
|
||||
static Effect dist_effect[] = {
|
||||
{"Distortion", DIST_ON_OFF, DIST_POSITION, dist_group, G_N_ELEMENTS(dist_group)},
|
||||
};
|
||||
|
||||
static Effect noisegate_effect[] = {
|
||||
{"Noisegate", NOISEGATE_ON_OFF, NOISEGATE_POSITION, noisegate_group, G_N_ELEMENTS(noisegate_group)},
|
||||
};
|
||||
|
||||
static Effect chorusfx_effect[] = {
|
||||
{"Chorus/FX", CHORUSFX_ON_OFF, CHORUSFX_POSITION, chorusfx_group, G_N_ELEMENTS(chorusfx_group)},
|
||||
};
|
||||
|
||||
static Effect delay_effect[] = {
|
||||
{"Delay", DELAY_ON_OFF, DELAY_POSITION, delay_group, G_N_ELEMENTS(delay_group)},
|
||||
};
|
||||
|
||||
static Effect reverb_effect[] = {
|
||||
{"Reverb", REVERB_ON_OFF, REVERB_POSITION, reverb_group, G_N_ELEMENTS(reverb_group)},
|
||||
};
|
||||
|
||||
static Effect eq_effect[] = {
|
||||
{"EQ", EQ_ON_OFF, EQ_POSITION, eq_group, G_N_ELEMENTS(eq_group)},
|
||||
};
|
||||
|
||||
EffectList effects[] = {
|
||||
{wah_effect, G_N_ELEMENTS(wah_effect)},
|
||||
{eq_effect, G_N_ELEMENTS(eq_effect)},
|
||||
{comp_effect, G_N_ELEMENTS(comp_effect)},
|
||||
{dist_effect, G_N_ELEMENTS(dist_effect)},
|
||||
{noisegate_effect, G_N_ELEMENTS(noisegate_effect)},
|
||||
{chorusfx_effect, G_N_ELEMENTS(chorusfx_effect)},
|
||||
{delay_effect, G_N_ELEMENTS(delay_effect)},
|
||||
{reverb_effect, G_N_ELEMENTS(reverb_effect)},
|
||||
};
|
||||
|
||||
int n_effects = G_N_ELEMENTS(effects);
|
||||
47
effects.h
Normal file
47
effects.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Tomasz Moń <desowin@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; under version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#include <glib/gtypes.h>
|
||||
|
||||
typedef struct {
|
||||
char *label; /* Parameter name */
|
||||
gdouble min; /* Parameter minumum value */
|
||||
gdouble max; /* Parameter maximum value */
|
||||
guint option; /* ID (to set parameter) */
|
||||
guint position; /* position */
|
||||
} EffectSettings;
|
||||
|
||||
typedef struct {
|
||||
guint id; /* value (type) */
|
||||
gchar *label; /* Effect name */
|
||||
guint option; /* ID (to set effect type) */
|
||||
guint position; /* position */
|
||||
EffectSettings *settings; /* possible parameters */
|
||||
gint settings_amt; /* possible parameters length */
|
||||
} EffectGroup;
|
||||
|
||||
typedef struct {
|
||||
char *label; /* Base effect name */
|
||||
guint option; /* ID (to set effect on/off) */
|
||||
guint position; /* position */
|
||||
EffectGroup *group; /* possible effect types */
|
||||
gint group_amt; /* possible effect types length */
|
||||
} Effect;
|
||||
|
||||
typedef struct {
|
||||
Effect *effect; /* list of supported effects */
|
||||
gint amt; /* list of supported effects length */
|
||||
} EffectList;
|
||||
855
gdigi.c
855
gdigi.c
@@ -22,36 +22,9 @@
|
||||
#include "gdigi.h"
|
||||
#include "gui.h"
|
||||
|
||||
#define TIMEOUT 1000
|
||||
|
||||
char buf[255];
|
||||
|
||||
static snd_rawmidi_t *output;
|
||||
static char *device = "hw:1,0,0";
|
||||
|
||||
/*
|
||||
static char magic[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x7F, 0x7F, 0x04, 0x7F, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x6E, 0xF7, 0x00}; // causes COMAND to be displayed on device?
|
||||
static char presets_user[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x21, 0x00, 0x07, 0x01, 0x6C, 0xF7}; // this command seems to query user presets?
|
||||
static char presets_system[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x21, 0x00, 0x07, 0x00, 0x6D, 0xF7}; // this command seems to query system presets?
|
||||
|
||||
static char magic4[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x2B, 0x00, 0x04, 0x00, 0x01, 0x77, 0x05, 0xF7, 0x00, 0x00};
|
||||
static char magic5[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x3A, 0x00, 0x04, 0x00, 0x01, 0x77, 0x05, 0xF7, 0x00, 0x00};
|
||||
|
||||
|
||||
// xedit calls those after calling hbsc pickup change
|
||||
static char magic12[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x3A, 0x00, 0x04, 0x00, 0x01, 0x77, 0x05, 0xF7, 0x00, 0x00};
|
||||
static char magic13[] = {0x07, 0x41, 0x73, 0xF7, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x7E, 0x00, 0x04, 0x00, 0x01, 0x77, 0x05, 0xF7, 0x00, 0x00};
|
||||
|
||||
// xedit calls those after calling schb pickup change
|
||||
static char magic22[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x41, 0x00, 0x04, 0x00, 0x01, 0x77, 0x05, 0xF7, 0x00, 0x00};
|
||||
static char magic23[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x3A, 0x00, 0x04, 0x00, 0x01, 0x77, 0x05, 0xF7, 0x00, 0x00};
|
||||
static char magic24[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x3B, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x6E, 0xF7, 0x00};
|
||||
|
||||
// seems to be called after changing dist type
|
||||
static char magic8[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x3A, 0x00, 0x04, 0x00, 0x01, 0x77, 0x05, 0xF7, 0x00, 0x00};
|
||||
// X-edit also calls 2 different commands, but those seems to vary each time
|
||||
*/
|
||||
|
||||
/*
|
||||
calculate checksum
|
||||
array - the command to set over usb
|
||||
@@ -62,14 +35,21 @@ char calculate_checksum(gchar *array, int length, int check)
|
||||
{
|
||||
int x;
|
||||
char checksum;
|
||||
checksum = 0;
|
||||
|
||||
checksum = 0x07;
|
||||
|
||||
for (x = 0; x<length; x++) {
|
||||
if (x == check) continue;
|
||||
checksum ^= array[x];
|
||||
}
|
||||
|
||||
return checksum;
|
||||
}
|
||||
|
||||
/*
|
||||
opens MIDI device
|
||||
Returns TRUE on error
|
||||
*/
|
||||
gboolean open_device()
|
||||
{
|
||||
int err;
|
||||
@@ -88,194 +68,86 @@ gboolean open_device()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void send_data(char *data, int lenght)
|
||||
void send_data(char *data, int length)
|
||||
{
|
||||
if (output == NULL)
|
||||
open_device();
|
||||
|
||||
snd_rawmidi_write(output, data, lenght);
|
||||
snd_rawmidi_write(output, data, length);
|
||||
}
|
||||
|
||||
void check_preset(struct usb_dev_handle *handle)
|
||||
/*
|
||||
id - ID as found in preset file
|
||||
position - Position as found in preset file
|
||||
value - Value as found in preset file
|
||||
*/
|
||||
void set_option(guint id, guint position, guint value)
|
||||
{
|
||||
/*static char magic3[] = {0x04, 0xF0, 0x00, 0x00, 0x04, 0x10, 0x00, 0x5E, 0x04, 0x02, 0x2A, 0x00, 0x04, 0x04, 0x00, 0x62, 0x05, 0xF7, 0x00, 0x00}; // seems to query active preset
|
||||
static char option[] = {0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41,
|
||||
0x00, 0x00, 0x00, /* ID */
|
||||
0x00, /* position */
|
||||
0x00, /* value length (not necesarry) */
|
||||
0x00, 0x00, 0x00, /* value (can be either 1, 2 or 3 bytes) */
|
||||
0x00, /* checksum */ 0xF7};
|
||||
|
||||
int i;
|
||||
i = usb_bulk_write(handle, 4, magic3, sizeof(magic3), TIMEOUT);
|
||||
option[8] = ((id & 0x80) >> 2);
|
||||
|
||||
// UGLY - have to figure out reply formatting
|
||||
do {
|
||||
i = read_device(handle, 12);
|
||||
if (i==12) {
|
||||
if (buf[0]==0x04 && buf[1]==0x20 && buf[2]==0x03 && buf[3]==0x14 && buf[4]==0x04 &&
|
||||
buf[6]==0x02 && buf[7]==0x20 && buf[8]==0x04 && buf[9]==0x04 && buf[10]==0x14)
|
||||
printf("Wah min: %d\nWah max: %d\n", buf[5], buf[11]);
|
||||
if (buf[0]==0x04 && buf[1]==0x00 && buf[2]==0x05 && buf[3]==0x03 && buf[4]==0x04 &&
|
||||
buf[5]==0x11 && buf[7]==0x00 && buf[8]==0x04 && buf[9]==0x41 && buf[10]==0x04)
|
||||
printf("Wah level: %d\nCompressor status (0-off, 1-on): %d\n", buf[6], buf[11]);
|
||||
if (buf[0]==0x04 && buf[1]==0x04 && buf[2]==0x11 && buf[4]==0x04 && buf[5]==0x00 &&
|
||||
buf[6]==0x53 && // we want to display this only for CS compressor
|
||||
//buf[6]==0x53 (for CS comp) buf[6]==0x51 (for digi comp)
|
||||
buf[7]==0x04 && buf[8]==0x04 && buf[10]==0x00 && buf[11]==0x52)
|
||||
printf("Compressor sustain: %d\nCompressor attack: %d\n", buf[3], buf[9]);
|
||||
if (buf[0]==0x04 && buf[1]==0x08 && buf[2]==0x04 && buf[4]==0x04 && buf[5]==0x09 && buf[6]==0x01 &&
|
||||
buf[7]==0x06 && buf[8]==0x04 && buf[9]==0x01 && buf[10]==0x09 && buf[11]==0x51) // CS comp
|
||||
printf("Compressor level: %d\n", buf[3]);
|
||||
if (buf[0]==0x04 && buf[1]==0x08 && buf[2]==0x04 && buf[4]==0x04 && buf[5]==0x00 && buf[6]==0x53 &&
|
||||
buf[7]==0x04 && buf[8]==0x04 && buf[9]==0x00 && buf[10]==0x09 && buf[11]==0x45) // digi comp
|
||||
printf("Compressor level: %d\n", buf[3]);
|
||||
if (buf[0]==0x04 && buf[1]==0x04 && buf[2]==0x11 && buf[4]==0x04 && buf[5]==0x00 &&
|
||||
buf[6]==0x51 && buf[7]==0x04 && buf[8]==0x04 && buf[10]==0x00 && buf[11]==0x52)
|
||||
printf("Compressor sustain: %d\nCompressor tone: %d\n", buf[3], buf[9]);
|
||||
if (buf[0]==0x04 && buf[1]==0x00 && buf[2]==0x4f && buf[3]==0x2A && buf[4]==0x04 && buf[5]==0x04 &&
|
||||
buf[6]==0x02 && buf[7]==0x00 && buf[8]==0x04 && buf[10]==0x00 && buf[11]==0x50)
|
||||
printf("Compressor (43-DigiComp 44-CS): %02x\n", buf[9]);
|
||||
if (buf[0]==0x04 && buf[1]==0x03 && buf[3]==0x00 && buf[4]==0x04 && buf[5]==0x00 && buf[6]==0x03 &&
|
||||
buf[7]==0x50 && buf[8]==0x04 && buf[9]==0x02 && buf[10]==0x00)
|
||||
printf("Wah status (0-off, 1-on): %d\nWah type (4-crywah, 5-fulrng, 6-clyde): %d\n", buf[2], buf[11]);
|
||||
if (buf[0]==0x04 && buf[1]==0x08 && buf[2]==0x04 && buf[4]==0x04 && buf[5]==0x00 &&
|
||||
buf[6]==0x53 && buf[7]==0x04 && buf[8]==0x04 && buf[10]==0x09 && buf[11]==0x45)
|
||||
printf("Compressor level: %d\nCompressor attack (X-Edit only for DigiComp): %d\n", buf[3], buf[9]);
|
||||
}
|
||||
} while (i > 0);*/
|
||||
}
|
||||
option[9] = ((id & 0xFF00) >> 8);
|
||||
option[10] = ((id & 0x007F));
|
||||
|
||||
/* level = 0 to 99 */
|
||||
void set_wah_min(int level)
|
||||
{
|
||||
static char set_min[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x20, 0x03, 0x14, 0x00 /* level */, 0x00 /* checksum */, 0xF7};
|
||||
option[11] = position;
|
||||
|
||||
set_min[13] = level;
|
||||
set_min[14] = calculate_checksum(set_min, sizeof(set_min), 14) ^ 0x07;
|
||||
if (value < 0x80) {
|
||||
// [12] = value, [13] - checksum, [14] = 0xF7
|
||||
option[12] = value;
|
||||
|
||||
send_data(set_min, sizeof(set_min));
|
||||
}
|
||||
option[14] = 0xF7;
|
||||
option[13] = calculate_checksum(option, 15, 13);
|
||||
|
||||
/* level = 0 to 99 */
|
||||
void set_wah_max(int level)
|
||||
{
|
||||
static char set_max[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x20, 0x04, 0x14, 0x00 /* level */, 0x00 /* checksum */, 0xF7};
|
||||
send_data(option, 15);
|
||||
} else if (value <= 0xFF) {
|
||||
option[8] |= 0x08; // there'll be length before value
|
||||
if (((value & 0x80) >> 7) == 1)
|
||||
option[8] |= 0x04;
|
||||
|
||||
set_max[13] = level;
|
||||
set_max[14] = calculate_checksum(set_max, sizeof(set_max), 14) ^ 0x07;
|
||||
option[12] = 0x01;
|
||||
// [13] = value, [14] - checksum, [15] = 0xF7
|
||||
option[13] = (value & 0x007F);
|
||||
|
||||
send_data(set_max, sizeof(set_max));
|
||||
}
|
||||
option[15] = 0xF7;
|
||||
option[14] = calculate_checksum(option, 16, 14);
|
||||
|
||||
/* level = 0 to 12 */
|
||||
void set_wah_level(int level)
|
||||
{
|
||||
static char set_level[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x00, 0x05, 0x03, 0x00 /* level */, 0x00 /* checksum */, 0xF7};
|
||||
send_data(option, 16);
|
||||
} else if (value <= 0xFFFF) {
|
||||
option[8] |= 0x08; // there'll be length before value
|
||||
if (((value & 0x80) >> 7) == 1)
|
||||
option[8] |= 0x02;
|
||||
|
||||
set_level[13] = level;
|
||||
set_level[14] = calculate_checksum(set_level, sizeof(set_level), 14) ^ 0x07;
|
||||
option[12] = 0x02;
|
||||
|
||||
send_data(set_level, sizeof(set_level));
|
||||
}
|
||||
option[13] = ((value & 0xFF00) >> 8);
|
||||
option[14] = ((value & 0x007F));
|
||||
|
||||
void set_wah_type(int type)
|
||||
{
|
||||
static char set_type[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x2C, 0x00, 0x00, 0x03, 0x01, 0x00 /* type */, 0x00 /* confirm */, 0xF7};
|
||||
option[16] = 0xF7;
|
||||
option[15] = calculate_checksum(option, 17, 15);
|
||||
|
||||
switch (type) {
|
||||
case WAH_TYPE_CRY: set_type[14] = 4; break;
|
||||
case WAH_TYPE_FULLRANGE: set_type[14] = 5; break;
|
||||
case WAH_TYPE_CLYDE: set_type[14] = 6; break;
|
||||
default: break;
|
||||
send_data(option, 17);
|
||||
} else if (value <= 0xFFFFFF) {
|
||||
option[8] |= 0x08; // there'll be length before value
|
||||
if (((value & 0x80) >> 7) == 1)
|
||||
option[8] |= 0x01;
|
||||
|
||||
option[12] = 0x03;
|
||||
|
||||
option[13] = ((value & 0xFF0000) >> 16);
|
||||
option[14] = ((value & 0x00FF00) >> 8);
|
||||
option[15] = ((value & 0x00007F));
|
||||
|
||||
option[17] = 0xF7;
|
||||
option[16] = calculate_checksum(option, 18, 16);
|
||||
|
||||
send_data(option, 18);
|
||||
}
|
||||
|
||||
set_type[15] = calculate_checksum(set_type, sizeof(set_type), 15) ^ 0x07;
|
||||
|
||||
send_data(set_type, sizeof(set_type));
|
||||
}
|
||||
|
||||
void set_wah_on_off(gboolean val)
|
||||
{
|
||||
static char set_wah[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x00, 0x01, 0x03, 0x00 /* on/off */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
if (val == FALSE) { /* turn wah off */
|
||||
set_wah[13] = 0;
|
||||
} else { /* turn wah on */
|
||||
set_wah[13] = 1;
|
||||
}
|
||||
|
||||
set_wah[14] = calculate_checksum(set_wah, sizeof(set_wah), 14) ^ 0x07;
|
||||
|
||||
send_data(set_wah, sizeof(set_wah));
|
||||
}
|
||||
|
||||
/* level = 0 to 99 */
|
||||
void set_comp_sustain(int level)
|
||||
{
|
||||
static char set_sust[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x00, 0x50, 0x04, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_sust[13] = level;
|
||||
set_sust[14] = calculate_checksum(set_sust, sizeof(set_sust), 14) ^ 0x07;
|
||||
|
||||
send_data(set_sust, sizeof(set_sust));
|
||||
}
|
||||
|
||||
/* level = 0 to 99, available only in digi comp */
|
||||
void set_comp_tone(int level)
|
||||
{
|
||||
static char set_tone[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x00, 0x51, 0x04, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_tone[13] = level;
|
||||
set_tone[14] = calculate_checksum(set_tone, sizeof(set_tone), 14) ^ 0x07;
|
||||
|
||||
send_data(set_tone, sizeof(set_tone));
|
||||
}
|
||||
|
||||
/* level = 0 to 99 */
|
||||
void set_comp_attack(int level)
|
||||
{
|
||||
static char set_attack[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x00, 0x53, 0x04, 0x00 /* value */, 0x00 /* checksum */, 0xf7};
|
||||
|
||||
set_attack[13] = level;
|
||||
set_attack[14] = calculate_checksum(set_attack, sizeof(set_attack), 14) ^ 0x07;
|
||||
|
||||
send_data(set_attack, sizeof(set_attack));
|
||||
}
|
||||
|
||||
/* level = 0 to 99 */
|
||||
void set_comp_level(int level)
|
||||
{
|
||||
static char set_level[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x00, 0x52, 0x04, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_level[13] = level;
|
||||
set_level[14] = calculate_checksum(set_level, sizeof(set_level), 14) ^ 0x07;
|
||||
|
||||
send_data(set_level, sizeof(set_level));
|
||||
}
|
||||
|
||||
void set_comp_type(int type)
|
||||
{
|
||||
static char set_type[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x2C, 0x00, 0x4F, 0x04, 0x01, 0x00 /* type */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
switch (type) {
|
||||
case COMP_TYPE_DIGI: set_type[14] = 0x43; break;
|
||||
case COMP_TYPE_CS: set_type[14] = 0x44; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
set_type[15] = calculate_checksum(set_type, sizeof(set_type), 15) ^ 0x07;
|
||||
|
||||
send_data(set_type, sizeof(set_type));
|
||||
}
|
||||
|
||||
void set_comp_on_off(gboolean val)
|
||||
{
|
||||
static char set_comp[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x00, 0x41, 0x04, 0x00 /* on/off */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
if (val == FALSE) { /* turn comp off */
|
||||
set_comp[13] = 0;
|
||||
} else { /* turn comp on */
|
||||
set_comp[13] = 1;
|
||||
}
|
||||
|
||||
set_comp[14] = calculate_checksum(set_comp, sizeof(set_comp), 14) ^ 0x07;
|
||||
|
||||
send_data(set_comp, sizeof(set_comp));
|
||||
}
|
||||
|
||||
/* x = 0 to 60 */
|
||||
@@ -284,7 +156,7 @@ void switch_user_preset(int x)
|
||||
static char switch_preset[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x39, 0x00, 0x01 /* bank = user */, 0x00 /* no */, 0x04, 0x00, 0x00, 0x01, 0x00 /* confirm */, 0xF7};
|
||||
|
||||
switch_preset[11] = x;
|
||||
switch_preset[16] = calculate_checksum(switch_preset, sizeof(switch_preset), 16) ^ 0x07;
|
||||
switch_preset[16] = calculate_checksum(switch_preset, sizeof(switch_preset), 16);
|
||||
|
||||
send_data(switch_preset, sizeof(switch_preset));
|
||||
}
|
||||
@@ -295,600 +167,15 @@ void switch_system_preset(int x)
|
||||
static char switch_preset[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x39, 0x00, 0x00 /* bank = system */, 0x00 /* no */, 0x04, 0x00, 0x00, 0x01, 0x00 /* confirm */, 0xF7};
|
||||
|
||||
switch_preset[11] = x;
|
||||
switch_preset[16] = calculate_checksum(switch_preset, sizeof(switch_preset), 16) ^ 0x07;
|
||||
switch_preset[16] = calculate_checksum(switch_preset, sizeof(switch_preset), 16);
|
||||
|
||||
send_data(switch_preset, sizeof(switch_preset));
|
||||
}
|
||||
|
||||
void set_pickup_type(int type)
|
||||
{
|
||||
static char pickup[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x00, 0x40, 0x02, 0x00 /* type1 */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
switch (type) {
|
||||
case PICKUP_TYPE_HB_SC: pickup[13] = 0x42; break;
|
||||
case PICKUP_TYPE_SC_HB: pickup[13] = 0x41; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
pickup[14] = calculate_checksum(pickup, sizeof(pickup), 14) ^ 0x07;
|
||||
|
||||
send_data(pickup, sizeof(pickup));
|
||||
}
|
||||
|
||||
void set_pickup_on_off(gboolean val)
|
||||
{
|
||||
static char set_pickup[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x00, 0x41, 0x02, 0x00 /* on/off */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
if (val == FALSE) { /* turn pickup off */
|
||||
set_pickup[13] = 0;
|
||||
} else { /* turn pickup on */
|
||||
set_pickup[13] = 1;
|
||||
}
|
||||
|
||||
set_pickup[14] = calculate_checksum(set_pickup, sizeof(set_pickup), 14) ^ 0x07;
|
||||
|
||||
send_data(set_pickup, sizeof(set_pickup));
|
||||
}
|
||||
|
||||
void set_dist_type(int type)
|
||||
{
|
||||
static char set_dist[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x28, 0x09, 0x00, 0x06, 0x02, 0x05, 0x00 /* type1 */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
switch (type) {
|
||||
case DIST_TYPE_SCREAMER: set_dist[15] = 0x00; break;
|
||||
case DIST_TYPE_808: set_dist[15] = 0x0C; break;
|
||||
case DIST_TYPE_GUYOD: set_dist[15] = 0x05; break;
|
||||
case DIST_TYPE_DOD250: set_dist[15] = 0x03; break;
|
||||
case DIST_TYPE_RODENT: set_dist[15] = 0x01; break;
|
||||
case DIST_TYPE_MX: set_dist[15] = 0x0B; break;
|
||||
case DIST_TYPE_DS: set_dist[15] = 0x02; break;
|
||||
case DIST_TYPE_GRUNGE: set_dist[15] = 0x07; break;
|
||||
case DIST_TYPE_ZONE: set_dist[15] = 0x09; break;
|
||||
case DIST_TYPE_DEATH: set_dist[15] = 0x0E; break;
|
||||
case DIST_TYPE_GONK: set_dist[15] = 0x0D; break;
|
||||
case DIST_TYPE_FUZZY: set_dist[15] = 0x08; break;
|
||||
case DIST_TYPE_MP: set_dist[15] = 0x04; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
set_dist[16] = calculate_checksum(set_dist, sizeof(set_dist), 16) ^ 0x07;
|
||||
|
||||
send_data(set_dist, sizeof(set_dist));
|
||||
}
|
||||
|
||||
void set_dist_option(char 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};
|
||||
|
||||
set_option[11] = option;
|
||||
set_option[13] = value;
|
||||
set_option[14] = calculate_checksum(set_option, sizeof(set_option), 14) ^ 0x07;
|
||||
|
||||
send_data(set_option, sizeof(set_option));
|
||||
}
|
||||
|
||||
void set_dist_on_off(gboolean val)
|
||||
{
|
||||
static char set_dist[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x09, 0x01, 0x06, 0x00 /* on/off */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
if (val == FALSE) { /* turn dist off */
|
||||
set_dist[13] = 0;
|
||||
} else { /* turn dist on */
|
||||
set_dist[13] = 1;
|
||||
}
|
||||
|
||||
set_dist[14] = calculate_checksum(set_dist, sizeof(set_dist), 14) ^ 0x07;
|
||||
|
||||
send_data(set_dist, sizeof(set_dist));
|
||||
}
|
||||
|
||||
/* level = 0 to 99 */
|
||||
void set_preset_level(int level)
|
||||
{
|
||||
static char set_level[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x0A, 0x42, 0x12, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_level[13] = level;
|
||||
set_level[14] = calculate_checksum(set_level, sizeof(set_level), 14) ^ 0x07;
|
||||
|
||||
send_data(set_level, sizeof(set_level));
|
||||
}
|
||||
|
||||
void set_eq_type(int type)
|
||||
{
|
||||
static char set_eq[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x2A, 0x0C, 0x02, 0x18, 0x02, 0x05, 0x00 /* type1 */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
switch (type) {
|
||||
case EQ_TYPE_BRIGHT: set_eq[15] = 0x42; break;
|
||||
case EQ_TYPE_MIDBOOST: set_eq[15] = 0x40; break;
|
||||
case EQ_TYPE_SCOOP: set_eq[15] = 0x41; break;
|
||||
case EQ_TYPE_WARM: set_eq[15] = 0x43; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
set_eq[16] = calculate_checksum(set_eq, sizeof(set_eq), 16) ^ 0x07;
|
||||
|
||||
send_data(set_eq, sizeof(set_eq));
|
||||
}
|
||||
|
||||
/* x = 0 to 99 */
|
||||
void set_eq_gain(int x)
|
||||
{
|
||||
static char set_gain[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x09, 0x41, 0x08, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_gain[13] = x;
|
||||
set_gain[14] = calculate_checksum(set_gain, sizeof(set_gain), 14) ^ 0x07;
|
||||
|
||||
send_data(set_gain, sizeof(set_gain));
|
||||
}
|
||||
|
||||
/* x = 0 to 99 */
|
||||
void set_eq_level(int x)
|
||||
{
|
||||
static char set_level[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x09, 0x42, 0x08, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_level[13] = x;
|
||||
set_level[14] = calculate_checksum(set_level, sizeof(set_level), 14) ^ 0x07;
|
||||
|
||||
send_data(set_level, sizeof(set_level));
|
||||
}
|
||||
|
||||
/* x = 0x00 (-12dB) to 0x18 (12dB) */
|
||||
void set_eq_bass(int x)
|
||||
{
|
||||
static char set_bass[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x0C, 0x03, 0x18, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_bass[13] = x;
|
||||
set_bass[14] = calculate_checksum(set_bass, sizeof(set_bass), 14) ^ 0x07;
|
||||
|
||||
send_data(set_bass, sizeof(set_bass));
|
||||
}
|
||||
|
||||
/* x = 0x00 (-12dB) to 0x18 (12dB) */
|
||||
void set_eq_mid(int x)
|
||||
{
|
||||
static char set_mid[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x0C, 0x04, 0x18, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_mid[13] = x;
|
||||
set_mid[14] = calculate_checksum(set_mid, sizeof(set_mid), 14) ^ 0x07;
|
||||
|
||||
send_data(set_mid, sizeof(set_mid));
|
||||
}
|
||||
|
||||
/*
|
||||
x = 0 to 4700 (which transforms into 300-5000 Hz)
|
||||
device itself will accept higher value, but X-Edit allows only 300-5000Hz
|
||||
*/
|
||||
void set_eq_mid_hz(int x)
|
||||
{
|
||||
if (x <= 0x7F) {
|
||||
static char set_hz[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x0C, 0x06, 0x18, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_hz[13] = x;
|
||||
set_hz[14] = calculate_checksum(set_hz, sizeof(set_hz), 14) ^ 0x07;
|
||||
|
||||
send_data(set_hz, sizeof(set_hz));
|
||||
} else {
|
||||
x -= 0x80;
|
||||
if (x <= 0x7F) {
|
||||
static char set_hz[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x2C, 0x0C, 0x06, 0x18, 0x01, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_hz[14] = x;
|
||||
set_hz[15] = calculate_checksum(set_hz, sizeof(set_hz), 15) ^ 0x07;
|
||||
|
||||
send_data(set_hz, sizeof(set_hz));
|
||||
} else {
|
||||
x -= 0x80;
|
||||
int a, b, c;
|
||||
a = 0x28;
|
||||
b = 0x01;
|
||||
c = 0;
|
||||
while (x > 0x7F) {
|
||||
c++;
|
||||
if ((c % 2) == 0) {
|
||||
a ^= 0x02; b++;
|
||||
} else {
|
||||
a ^= 0x02;
|
||||
}
|
||||
|
||||
x -= 0x80;
|
||||
}
|
||||
|
||||
static char set_hz[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00 /* a */, 0x0C, 0x06, 0x18, 0x02, 0x00 /* b */, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_hz[9] = a;
|
||||
set_hz[14] = b;
|
||||
set_hz[15] = x;
|
||||
set_hz[16] = calculate_checksum(set_hz, sizeof(set_hz), 16) ^ 0x07;
|
||||
|
||||
send_data(set_hz, sizeof(set_hz));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* x = 0x00 (-12dB) to 0x18 (12dB) */
|
||||
void set_eq_treble(int x)
|
||||
{
|
||||
static char set_treble[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x0C, 0x05, 0x18, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_treble[13] = x;
|
||||
set_treble[14] = calculate_checksum(set_treble, sizeof(set_treble), 14) ^ 0x07;
|
||||
|
||||
send_data(set_treble, sizeof(set_treble));
|
||||
}
|
||||
|
||||
/*
|
||||
x = 0 to 7500 (which transforms into 500-8000 Hz)
|
||||
device itself will accept higher value, but X-Edit allows only 500-8000Hz
|
||||
*/
|
||||
void set_eq_treb_hz(int x)
|
||||
{
|
||||
if (x <= 0x7F) {
|
||||
static char set_hz[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x0C, 0x0B, 0x18, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_hz[13] = x;
|
||||
set_hz[14] = calculate_checksum(set_hz, sizeof(set_hz), 14) ^ 0x07;
|
||||
|
||||
send_data(set_hz, sizeof(set_hz));
|
||||
} else {
|
||||
x -= 0x80;
|
||||
if (x <= 0x7F) {
|
||||
static char set_hz[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x2C, 0x0C, 0x0B, 0x18, 0x01, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_hz[14] = x;
|
||||
set_hz[15] = calculate_checksum(set_hz, sizeof(set_hz), 15) ^ 0x07;
|
||||
|
||||
send_data(set_hz, sizeof(set_hz));
|
||||
} else {
|
||||
x -= 0x80;
|
||||
int a, b, c;
|
||||
a = 0x28;
|
||||
b = 0x01;
|
||||
c = 0;
|
||||
while (x > 0x7F) {
|
||||
c++;
|
||||
if ((c % 2) == 0) {
|
||||
a ^= 0x02; b++;
|
||||
} else {
|
||||
a ^= 0x02;
|
||||
}
|
||||
|
||||
x -= 0x80;
|
||||
}
|
||||
|
||||
static char set_hz[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00 /* a */, 0x0C, 0x0B, 0x18, 0x02, 0x00 /* b */, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_hz[9] = a;
|
||||
set_hz[14] = b;
|
||||
set_hz[15] = x;
|
||||
set_hz[16] = calculate_checksum(set_hz, sizeof(set_hz), 16) ^ 0x07;
|
||||
|
||||
send_data(set_hz, sizeof(set_hz));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void set_eq_on_off(gboolean val)
|
||||
{
|
||||
static char set_eq[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x0C, 0x0C, 0x18, 0x00 /* on/off */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
if (val == FALSE) { /* turn eq off */
|
||||
set_eq[13] = 0;
|
||||
} else { /* turn eq on */
|
||||
set_eq[13] = 1;
|
||||
}
|
||||
|
||||
set_eq[14] = calculate_checksum(set_eq, sizeof(set_eq), 14) ^ 0x07;
|
||||
|
||||
send_data(set_eq, sizeof(set_eq));
|
||||
}
|
||||
|
||||
void set_noisegate_type(int type)
|
||||
{
|
||||
static char set_type[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x28, 0x02, 0x40, 0x0C, 0x02, 0x03, 0x00 /* type1 */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
switch (type) {
|
||||
case NOISEGATE_GATE: set_type[15] = 0; break;
|
||||
case NOISEGATE_SWELL: set_type[15] = 1; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
set_type[16] = calculate_checksum(set_type, sizeof(set_type), 16) ^ 0x07;
|
||||
|
||||
send_data(set_type, sizeof(set_type));
|
||||
}
|
||||
|
||||
/* x = 0 to 99 */
|
||||
void set_gate_option(char 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};
|
||||
|
||||
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_noisegate_on_off(gboolean val)
|
||||
{
|
||||
static char set_gate[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x02, 0x41, 0x0C, 0x00 /* on/off */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
if (val == FALSE) { /* turn noisegate off */
|
||||
set_gate[13] = 0;
|
||||
} else { /* turn noisegate on */
|
||||
set_gate[13] = 1;
|
||||
}
|
||||
|
||||
set_gate[14] = calculate_checksum(set_gate, sizeof(set_gate), 14) ^ 0x07;
|
||||
|
||||
send_data(set_gate, sizeof(set_gate));
|
||||
}
|
||||
|
||||
void set_chorusfx_option(char 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};
|
||||
|
||||
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_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;
|
||||
|
||||
send_data(set_option, sizeof(set_option));
|
||||
}
|
||||
|
||||
void set_chorusfx_type(int type)
|
||||
{
|
||||
static char set_type[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00 /* type */, 0x03, 0x00, 0x0E, 0x02, 0x00 /* type */, 0x00 /* type1 */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
switch (type) {
|
||||
case CHORUS_TYPE_CE: set_type[9] = 0x08; set_type[15] = 0x7B; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_DUAL: set_type[9] = 0x08; set_type[15] = 0x79; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_MULTI: set_type[9] = 0x08; set_type[15] = 0x7A; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_FLANGER: set_type[9] = 0x08; set_type[15] = 0x7D; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_MXR_FLANGER: set_type[9] = 0x08; set_type[15] = 0x7F; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_PHASER: set_type[9] = 0x0A; set_type[15] = 0x01; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_VIBRATO: set_type[9] = 0x08; set_type[15] = 0x60; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_ROTARY: set_type[9] = 0x08; set_type[15] = 0x61; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_VIBROPAN: set_type[9] = 0x0A; set_type[15] = 0x0F; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_TREMOLO: set_type[9] = 0x08; set_type[15] = 0x5E; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_PANNER: set_type[9] = 0x08; set_type[15] = 0x5F; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_ENVELOPE: set_type[9] = 0x0A; set_type[15] = 0x0A; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_AUTOYA: set_type[9] = 0x0A; set_type[15] = 0x0B; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_YAYA: set_type[9] = 0x0A; set_type[15] = 0x0C; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_STEP_FILTER: set_type[9] = 0x0A; set_type[15] = 0x0D; set_type[14] = 0x03; break;
|
||||
case CHORUS_TYPE_WHAMMY: set_type[9] = 0x08; set_type[15] = 0x40; set_type[14] = 0x05; break;
|
||||
case CHORUS_TYPE_PITCH_SHIFT: set_type[9] = 0x08; set_type[15] = 0x43; set_type[14] = 0x05; break;
|
||||
case CHORUS_TYPE_DETUNE: set_type[9] = 0x08; set_type[15] = 0x42; set_type[14] = 0x05; break;
|
||||
case CHORUS_TYPE_IPS: set_type[9] = 0x08; set_type[15] = 0x41; set_type[14] = 0x05; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
set_type[16] = calculate_checksum(set_type, sizeof(set_type), 16) ^ 0x07;
|
||||
|
||||
send_data(set_type, sizeof(set_type));
|
||||
}
|
||||
|
||||
void set_chorusfx_on_off(gboolean val)
|
||||
{
|
||||
static char set_chorus[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x03, 0x01, 0x0E, 0x00 /* on/off */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
if (val == FALSE) { /* turn chorusfx off */
|
||||
set_chorus[13] = 0;
|
||||
} else { /* turn chorusfx on */
|
||||
set_chorus[13] = 1;
|
||||
}
|
||||
|
||||
set_chorus[14] = calculate_checksum(set_chorus, sizeof(set_chorus), 14) ^ 0x07;
|
||||
|
||||
send_data(set_chorus, sizeof(set_chorus));
|
||||
}
|
||||
|
||||
/* x = 0 to 139 */
|
||||
void set_delay_time(int x)
|
||||
{
|
||||
if (x <= 0x7F) {
|
||||
static char set_time[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x07, 0x60, 0x0F, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_time[13] = x;
|
||||
set_time[14] = calculate_checksum(set_time, sizeof(set_time), 14) ^ 0x07;
|
||||
|
||||
send_data(set_time, sizeof(set_time));
|
||||
} else {
|
||||
static char set_time[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x0C, 0x07, 0x60, 0x0F, 0x01, 0x00 /* value */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
set_time[14] = x - 0x80;
|
||||
set_time[15] = calculate_checksum(set_time, sizeof(set_time), 15) ^ 0x07;
|
||||
|
||||
send_data(set_time, sizeof(set_time));
|
||||
}
|
||||
}
|
||||
|
||||
void set_delay_type(int type)
|
||||
{
|
||||
static char set_type[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x08, 0x07, 0x40, 0x0F, 0x02, 0x04, 0x00 /* type1 */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
switch (type) {
|
||||
case DELAY_TYPE_ANALOG: set_type[15] = 0x16; break;
|
||||
case DELAY_TYPE_DIGITAL: set_type[15] = 0x15; break;
|
||||
case DELAY_TYPE_MODULATED: set_type[15] = 0x17; break;
|
||||
case DELAY_TYPE_PONG: set_type[15] = 0x18; break;
|
||||
case DELAY_TYPE_TAPE: set_type[15] = 0x19; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
set_type[16] = calculate_checksum(set_type, sizeof(set_type), 16) ^ 0x07;
|
||||
|
||||
send_data(set_type, sizeof(set_type));
|
||||
}
|
||||
|
||||
void set_delay_option(char 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};
|
||||
|
||||
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_delay_on_off(gboolean val)
|
||||
{
|
||||
static char set_delay[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x00, 0x07, 0x41, 0x0F, 0x00 /* on/off */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
if (val == FALSE) { /* turn delay off */
|
||||
set_delay[13] = 0;
|
||||
} else { /* turn delay on */
|
||||
set_delay[13] = 1;
|
||||
}
|
||||
|
||||
set_delay[14] = calculate_checksum(set_delay, sizeof(set_delay), 14) ^ 0x07;
|
||||
|
||||
send_data(set_delay, sizeof(set_delay));
|
||||
}
|
||||
|
||||
/* x = 0 to 15 (predelay), otherwise 0 to 99 */
|
||||
void set_reverb_option(char 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};
|
||||
|
||||
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_reverb_type(int type)
|
||||
{
|
||||
static char set_type[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x28, 0x07, 0x00, 0x10, 0x02, 0x04, 0x00 /* type1 */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
switch (type) {
|
||||
case REVERB_TYPE_TWIN: set_type[15] = 0x7A; break;
|
||||
case REVERB_TYPE_LEX_AMBIENCE: set_type[15] = 0x7E; break;
|
||||
case REVERB_TYPE_LEX_STUDIO: set_type[15] = 0x7D; break;
|
||||
case REVERB_TYPE_LEX_ROOM: set_type[15] = 0x7C; break;
|
||||
case REVERB_TYPE_LEX_HALL: set_type[15] = 0x7B; break;
|
||||
case REVERB_TYPE_EMT240_PLATE: set_type[15] = 0x7F; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
set_type[16] = calculate_checksum(set_type, sizeof(set_type), 16) ^ 0x07;
|
||||
|
||||
send_data(set_type, sizeof(set_type));
|
||||
}
|
||||
|
||||
void set_reverb_on_off(gboolean val)
|
||||
{
|
||||
static char set_reverb[] = {0x00, 0xF0, 0x00, 0x00, 0x10, 0x00, 0x5E, 0x02, 0x41, 0x20, 0x07, 0x01, 0x10, 0x00 /* on/off */, 0x00 /* checksum */, 0xF7};
|
||||
|
||||
if (val == FALSE) { /* turn reverb off */
|
||||
set_reverb[13] = 0;
|
||||
} else { /* turn reverb on */
|
||||
set_reverb[13] = 1;
|
||||
}
|
||||
|
||||
set_reverb[14] = calculate_checksum(set_reverb, sizeof(set_reverb), 14) ^ 0x07;
|
||||
|
||||
send_data(set_reverb, sizeof(set_reverb));
|
||||
set_option(PRESET_LEVEL, PRESET_POSITION, level);
|
||||
}
|
||||
|
||||
/* x = 0 to 59 (preset number) */
|
||||
@@ -915,7 +202,7 @@ void set_preset_name(int x, gchar *name)
|
||||
set_name[12+a+b] = 0x00;
|
||||
|
||||
set_name[12+a+2+b] = 0xF7;
|
||||
set_name[12+a+1+b] = calculate_checksum(set_name, 12+a+3+b, 12+a+1+b) ^ 0x07;
|
||||
set_name[12+a+1+b] = calculate_checksum(set_name, 12+a+3+b, 12+a+1+b);
|
||||
|
||||
send_data(set_name, 13+a+3+b);
|
||||
}
|
||||
|
||||
568
gdigi.h
568
gdigi.h
@@ -14,205 +14,258 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses>.
|
||||
*/
|
||||
|
||||
#include <usb.h>
|
||||
#include <glib.h>
|
||||
|
||||
enum {
|
||||
WAH_TYPE_CRY = 0,
|
||||
WAH_TYPE_FULLRANGE,
|
||||
WAH_TYPE_CLYDE
|
||||
WAH_TYPE_CRY = 132,
|
||||
WAH_TYPE_FULLRANGE = 133,
|
||||
WAH_TYPE_CLYDE = 134
|
||||
};
|
||||
|
||||
#define WAH_POSITION_MIN_MAX 20
|
||||
|
||||
#define WAH_MIN 8195
|
||||
#define WAH_MAX 8196
|
||||
|
||||
#define WAH_TYPE 128
|
||||
#define WAH_ON_OFF 129
|
||||
#define WAH_POSITION 3
|
||||
|
||||
#define WAH_LEVEL 133
|
||||
|
||||
enum {
|
||||
COMP_TYPE_DIGI = 0,
|
||||
COMP_TYPE_CS
|
||||
COMP_TYPE_DIGI = 195,
|
||||
COMP_TYPE_CS = 196
|
||||
};
|
||||
|
||||
#define COMP_TYPE 207
|
||||
#define COMP_ON_OFF 193
|
||||
#define COMP_POSITION 4
|
||||
|
||||
#define COMP_SUSTAIN 208
|
||||
#define COMP_TONE 209
|
||||
#define COMP_ATTACK 211
|
||||
#define COMP_LEVEL 210
|
||||
|
||||
enum {
|
||||
PICKUP_TYPE_HB_SC = 0,
|
||||
PICKUP_TYPE_SC_HB
|
||||
PICKUP_TYPE_HB_SC = 66,
|
||||
PICKUP_TYPE_SC_HB = 65
|
||||
};
|
||||
|
||||
#define PICKUP_TYPE 64
|
||||
#define PICKUP_ON_OFF 65
|
||||
#define PICKUP_POSITION 2
|
||||
|
||||
enum {
|
||||
DIST_TYPE_SCREAMER = 0,
|
||||
DIST_TYPE_808,
|
||||
DIST_TYPE_GUYOD,
|
||||
DIST_TYPE_DOD250,
|
||||
DIST_TYPE_RODENT,
|
||||
DIST_TYPE_MX,
|
||||
DIST_TYPE_DS,
|
||||
DIST_TYPE_GRUNGE,
|
||||
DIST_TYPE_ZONE,
|
||||
DIST_TYPE_DEATH,
|
||||
DIST_TYPE_GONK,
|
||||
DIST_TYPE_FUZZY,
|
||||
DIST_TYPE_MP
|
||||
DIST_TYPE_SCREAMER = 1280,
|
||||
DIST_TYPE_808 = 1292,
|
||||
DIST_TYPE_GUYOD = 1285,
|
||||
DIST_TYPE_DOD250 = 1283,
|
||||
DIST_TYPE_RODENT = 1281,
|
||||
DIST_TYPE_MX = 1291,
|
||||
DIST_TYPE_DS = 1282,
|
||||
DIST_TYPE_GRUNGE = 1287,
|
||||
DIST_TYPE_ZONE = 1289,
|
||||
DIST_TYPE_DEATH = 1294,
|
||||
DIST_TYPE_GONK = 1293,
|
||||
DIST_TYPE_FUZZY = 1288,
|
||||
DIST_TYPE_MP = 1284
|
||||
};
|
||||
|
||||
#define DIST_SCREAMER_DRIVE 0x02
|
||||
#define DIST_SCREAMER_TONE 0x03
|
||||
#define DIST_SCREAMER_LVL 0x04
|
||||
#define DIST_808_OVERDRIVE 0x29
|
||||
#define DIST_808_TONE 0x2A
|
||||
#define DIST_808_LVL 0x2B
|
||||
#define DIST_GUYOD_DRIVE 0x10
|
||||
#define DIST_GUYOD_LVL 0x11
|
||||
#define DIST_DOD250_GAIN 0x0B
|
||||
#define DIST_DOD250_LVL 0x0C
|
||||
#define DIST_RODENT_DIST 0x05
|
||||
#define DIST_RODENT_FILTER 0x06
|
||||
#define DIST_RODENT_LVL 0x07
|
||||
#define DIST_MX_DIST 0x24
|
||||
#define DIST_MX_OUTPUT 0x25
|
||||
#define DIST_DS_GAIN 0x08
|
||||
#define DIST_DS_TONE 0x09
|
||||
#define DIST_DS_LVL 0x0A
|
||||
#define DIST_GRUNGE_GRUNGE 0x16
|
||||
#define DIST_GRUNGE_FACE 0x18
|
||||
#define DIST_GRUNGE_LOUD 0x19
|
||||
#define DIST_GRUNGE_BUTT 0x17
|
||||
#define DIST_ZONE_GAIN 0x1C
|
||||
#define DIST_ZONE_LOW 0x1F
|
||||
#define DIST_ZONE_MID_LVL 0x1E
|
||||
#define DIST_ZONE_MID_FREQ 0x1D
|
||||
#define DIST_ZONE_HIGH 0x20
|
||||
#define DIST_ZONE_LEVEL 0x21
|
||||
#define DIST_DEATH_LOW 0x2D
|
||||
#define DIST_DEATH_MID 0x2C
|
||||
#define DIST_DEATH_HIGH 0x2F
|
||||
#define DIST_DEATH_LVL 0x2E
|
||||
#define DIST_GONK_GONK 0x30
|
||||
#define DIST_GONK_SMEAR 0x27
|
||||
#define DIST_GONK_SUCK 0x26
|
||||
#define DIST_GONK_HEAVE 0x28
|
||||
#define DIST_FUZZY_FUZZ 0x1A
|
||||
#define DIST_FUZZY_VOLUME 0x1B
|
||||
#define DIST_MP_SUSTAIN 0x0D
|
||||
#define DIST_MP_TONE 0x0E
|
||||
#define DIST_MP_VOLUME 0x0F
|
||||
#define DIST_TYPE 2432
|
||||
#define DIST_ON_OFF 2433
|
||||
#define DIST_POSITION 6
|
||||
|
||||
#define DIST_SCREAMER_DRIVE 2434
|
||||
#define DIST_SCREAMER_TONE 2435
|
||||
#define DIST_SCREAMER_LVL 2436
|
||||
#define DIST_808_OVERDRIVE 2473
|
||||
#define DIST_808_TONE 2474
|
||||
#define DIST_808_LVL 2475
|
||||
#define DIST_GUYOD_DRIVE 2448
|
||||
#define DIST_GUYOD_LVL 2449
|
||||
#define DIST_DOD250_GAIN 2443
|
||||
#define DIST_DOD250_LVL 2444
|
||||
#define DIST_RODENT_DIST 2437
|
||||
#define DIST_RODENT_FILTER 2438
|
||||
#define DIST_RODENT_LVL 2439
|
||||
#define DIST_MX_DIST 2468
|
||||
#define DIST_MX_OUTPUT 2469
|
||||
#define DIST_DS_GAIN 2440
|
||||
#define DIST_DS_TONE 2441
|
||||
#define DIST_DS_LVL 2442
|
||||
#define DIST_GRUNGE_GRUNGE 2454
|
||||
#define DIST_GRUNGE_FACE 2456
|
||||
#define DIST_GRUNGE_LOUD 2457
|
||||
#define DIST_GRUNGE_BUTT 2455
|
||||
#define DIST_ZONE_GAIN 2460
|
||||
#define DIST_ZONE_LOW 2463
|
||||
#define DIST_ZONE_MID_LVL 2462
|
||||
#define DIST_ZONE_MID_FREQ 2461
|
||||
#define DIST_ZONE_HIGH 2464
|
||||
#define DIST_ZONE_LEVEL 2465
|
||||
#define DIST_DEATH_LOW 2477
|
||||
#define DIST_DEATH_MID 2476
|
||||
#define DIST_DEATH_HIGH 2479
|
||||
#define DIST_DEATH_LVL 2478
|
||||
#define DIST_GONK_GONK 2480
|
||||
#define DIST_GONK_SMEAR 2471
|
||||
#define DIST_GONK_SUCK 2470
|
||||
#define DIST_GONK_HEAVE 2472
|
||||
#define DIST_FUZZY_FUZZ 2458
|
||||
#define DIST_FUZZY_VOLUME 2459
|
||||
#define DIST_MP_SUSTAIN 2445
|
||||
#define DIST_MP_TONE 2446
|
||||
#define DIST_MP_VOLUME 2447
|
||||
|
||||
#define PRESET_POSITION 18
|
||||
#define PRESET_LEVEL 2626
|
||||
|
||||
enum {
|
||||
EQ_TYPE_BRIGHT = 0,
|
||||
EQ_TYPE_MIDBOOST,
|
||||
EQ_TYPE_SCOOP,
|
||||
EQ_TYPE_WARM
|
||||
EQ_TYPE_BRIGHT = 1474,
|
||||
EQ_TYPE_MIDBOOST = 1472,
|
||||
EQ_TYPE_SCOOP = 1473,
|
||||
EQ_TYPE_WARM = 1475
|
||||
};
|
||||
|
||||
#define AMP_POSITION 8
|
||||
|
||||
#define AMP_GAIN 2497
|
||||
#define AMP_LEVEL 2498
|
||||
|
||||
#define EQ_TYPE 3202
|
||||
#define EQ_ON_OFF 3212
|
||||
#define EQ_POSITION 24
|
||||
|
||||
#define EQ_BASS 3203
|
||||
#define EQ_MID 3204
|
||||
#define EQ_MID_HZ 3206
|
||||
#define EQ_TREBLE 3205
|
||||
#define EQ_TREBLE_HZ 3211
|
||||
|
||||
enum {
|
||||
NOISEGATE_GATE = 0,
|
||||
NOISEGATE_SWELL
|
||||
NOISEGATE_GATE = 768,
|
||||
NOISEGATE_SWELL = 769
|
||||
};
|
||||
|
||||
#define NOISEGATE_TYPE 704
|
||||
#define NOISEGATE_ON_OFF 705
|
||||
#define NOISEGATE_POSITION 12
|
||||
|
||||
/* available only in Gate mode */
|
||||
#define NOISEGATE_GATE_TRESHOLD 0x46
|
||||
#define NOISEGATE_GATE_TRESHOLD 710
|
||||
/* available only in Swell mode */
|
||||
#define NOISEGATE_SWELL_SENS 0x47
|
||||
#define NOISEGATE_SWELL_SENS 711
|
||||
/* available in both Gate and Swell modes */
|
||||
#define NOISEGATE_ATTACK 0x48
|
||||
#define NOISEGATE_RELEASE 0x49
|
||||
#define NOISEGATE_ATTN 0x4A
|
||||
#define NOISEGATE_ATTACK 712
|
||||
#define NOISEGATE_RELEASE 713
|
||||
#define NOISEGATE_ATTN 714
|
||||
|
||||
enum {
|
||||
CHORUS_TYPE_CE = 0,
|
||||
CHORUS_TYPE_DUAL,
|
||||
CHORUS_TYPE_MULTI,
|
||||
CHORUS_TYPE_FLANGER,
|
||||
CHORUS_TYPE_MXR_FLANGER,
|
||||
CHORUS_TYPE_PHASER,
|
||||
CHORUS_TYPE_VIBRATO,
|
||||
CHORUS_TYPE_ROTARY,
|
||||
CHORUS_TYPE_VIBROPAN,
|
||||
CHORUS_TYPE_TREMOLO,
|
||||
CHORUS_TYPE_PANNER,
|
||||
CHORUS_TYPE_ENVELOPE,
|
||||
CHORUS_TYPE_AUTOYA,
|
||||
CHORUS_TYPE_YAYA,
|
||||
CHORUS_TYPE_STEP_FILTER,
|
||||
CHORUS_TYPE_WHAMMY,
|
||||
CHORUS_TYPE_PITCH_SHIFT,
|
||||
CHORUS_TYPE_DETUNE,
|
||||
CHORUS_TYPE_IPS
|
||||
CHORUS_TYPE_CE = 0x37B,
|
||||
CHORUS_TYPE_DUAL = 0x379,
|
||||
CHORUS_TYPE_MULTI = 0x37a,
|
||||
CHORUS_TYPE_FLANGER = 0x37d,
|
||||
CHORUS_TYPE_MXR_FLANGER = 0x37f,
|
||||
CHORUS_TYPE_PHASER = 0x381,
|
||||
CHORUS_TYPE_VIBRATO = 0x360,
|
||||
CHORUS_TYPE_ROTARY = 0x361,
|
||||
CHORUS_TYPE_VIBROPAN = 0x38f,
|
||||
CHORUS_TYPE_TREMOLO = 0x35e,
|
||||
CHORUS_TYPE_PANNER = 0x35f,
|
||||
CHORUS_TYPE_ENVELOPE = 0x38a,
|
||||
CHORUS_TYPE_AUTOYA = 0x38b,
|
||||
CHORUS_TYPE_YAYA = 0x38c,
|
||||
CHORUS_TYPE_STEP_FILTER = 0x38d,
|
||||
CHORUS_TYPE_WHAMMY = 0x540,
|
||||
CHORUS_TYPE_PITCH_SHIFT = 0x543,
|
||||
CHORUS_TYPE_DETUNE = 0x542,
|
||||
CHORUS_TYPE_IPS = 0x541
|
||||
};
|
||||
|
||||
#define CE_CHORUS_SPEED 0x45
|
||||
#define CE_CHORUS_DEPTH 0x46
|
||||
#define CHORUSFX_TYPE 768
|
||||
#define CHORUSFX_ON_OFF 769
|
||||
#define CHORUSFX_POSITION 14
|
||||
|
||||
#define DUAL_CHORUS_SPEED 0x45
|
||||
#define DUAL_CHORUS_DEPTH 0x46
|
||||
#define DUAL_CHORUS_LEVEL 0x44
|
||||
#define DUAL_CHORUS_WAVE 0x48
|
||||
#define CE_CHORUS_SPEED 837
|
||||
#define CE_CHORUS_DEPTH 838
|
||||
|
||||
#define MULTI_CHORUS_SPEED 0x45
|
||||
#define MULTI_CHORUS_DEPTH 0x46
|
||||
#define MULTI_CHORUS_WAVE 0x48
|
||||
#define MULTI_CHORUS_LEVEL 0x44
|
||||
#define DUAL_CHORUS_SPEED 837
|
||||
#define DUAL_CHORUS_DEPTH 838
|
||||
#define DUAL_CHORUS_LEVEL 836
|
||||
#define DUAL_CHORUS_WAVE 840
|
||||
|
||||
#define FLANGER_SPEED 0x06
|
||||
#define FLANGER_DEPTH 0x07
|
||||
#define FLANGER_REGEN 0x08
|
||||
#define FLANGER_LEVEL 0x05
|
||||
#define FLANGER_WAVE 0x09
|
||||
#define MULTI_CHORUS_SPEED 837
|
||||
#define MULTI_CHORUS_DEPTH 838
|
||||
#define MULTI_CHORUS_WAVE 840
|
||||
#define MULTI_CHORUS_LEVEL 836
|
||||
|
||||
#define MXR_FLANGER_SPEED 0x06
|
||||
#define MXR_FLANGER_WIDTH 0x12
|
||||
#define MXR_FLANGER_REGEN 0x08
|
||||
#define MXR_FLANGER_MANUAL 0x15
|
||||
#define FLANGER_SPEED 902
|
||||
#define FLANGER_DEPTH 903
|
||||
#define FLANGER_REGEN 904
|
||||
#define FLANGER_LEVEL 901
|
||||
#define FLANGER_WAVE 905
|
||||
|
||||
#define PHASER_SPEED 0x42
|
||||
#define PHASER_DEPTH 0x43
|
||||
#define PHASER_REGEN 0x46
|
||||
#define PHASER_LEVEL 0x45
|
||||
#define PHASER_WAVE 0x47
|
||||
#define MXR_FLANGER_SPEED 902
|
||||
#define MXR_FLANGER_WIDTH 914
|
||||
#define MXR_FLANGER_REGEN 904
|
||||
#define MXR_FLANGER_MANUAL 917
|
||||
|
||||
#define VIBRATO_SPEED 0x04
|
||||
#define VIBRATO_DEPTH 0x05
|
||||
#define PHASER_SPEED 962
|
||||
#define PHASER_DEPTH 963
|
||||
#define PHASER_REGEN 966
|
||||
#define PHASER_LEVEL 965
|
||||
#define PHASER_WAVE 967
|
||||
|
||||
#define ROTARY_SPEED 0x42
|
||||
#define ROTARY_INTENSITY 0x44
|
||||
#define ROTARY_DOPPLER 0x46
|
||||
#define ROTARY_CROSSOVER 0x47
|
||||
#define VIBRATO_SPEED 1284
|
||||
#define VIBRATO_DEPTH 1285
|
||||
|
||||
#define VIBROPAN_SPEED 0x22
|
||||
#define VIBROPAN_DEPTH 0x23
|
||||
#define VIBROPAN_VIBRA 0x24
|
||||
#define VIBROPAN_WAVE 0x25
|
||||
#define ROTARY_SPEED 1346
|
||||
#define ROTARY_INTENSITY 1348
|
||||
#define ROTARY_DOPPLER 1350
|
||||
#define ROTARY_CROSSOVER 1351
|
||||
|
||||
#define TREMOLO_SPEED 0x04
|
||||
#define TREMOLO_DEPTH 0x03
|
||||
#define TREMOLO_WAVE 0x05
|
||||
#define VIBROPAN_SPEED 1314
|
||||
#define VIBROPAN_DEPTH 1315
|
||||
#define VIBROPAN_VIBRA 1316
|
||||
#define VIBROPAN_WAVE 1317
|
||||
|
||||
#define PANNER_SPEED 0x44
|
||||
#define PANNER_DEPTH 0x43
|
||||
#define PANNER_WAVE 0x45
|
||||
#define TREMOLO_SPEED 1156
|
||||
#define TREMOLO_DEPTH 1155
|
||||
#define TREMOLO_WAVE 1157
|
||||
|
||||
#define ENVELOPE_SENSITIVITY 0x46
|
||||
#define ENVELOPE_RANGE 0x45
|
||||
#define PANNER_SPEED 1220
|
||||
#define PANNER_DEPTH 1219
|
||||
#define PANNER_WAVE 1221
|
||||
|
||||
#define AUTOYA_SPEED 0x46
|
||||
#define AUTOYA_INTENSITY 0x4A
|
||||
#define AUTOYA_RANGE 0x4B
|
||||
#define ENVELOPE_SENSITIVITY 1606
|
||||
#define ENVELOPE_RANGE 1605
|
||||
|
||||
#define YAYA_PEDAL 0x02
|
||||
#define YAYA_INTENSITY 0x09
|
||||
#define YAYA_RANGE 0x0A
|
||||
#define AUTOYA_SPEED 1478
|
||||
#define AUTOYA_INTENSITY 1482
|
||||
#define AUTOYA_RANGE 1483
|
||||
|
||||
#define STEP_FILTER_SPEED 0x42
|
||||
#define STEP_FILTER_INTENSITY 0x43
|
||||
#define YAYA_PEDAL 1410
|
||||
#define YAYA_INTENSITY 1417
|
||||
#define YAYA_RANGE 1418
|
||||
|
||||
#define WHAMMY_AMOUNT 0x05
|
||||
#define WHAMMY_PEDAL 0x03
|
||||
#define WHAMMY_MIX 0x04
|
||||
#define STEP_FILTER_SPEED 3010
|
||||
#define STEP_FILTER_INTENSITY 3011
|
||||
|
||||
#define PITCH_AMOUNT 0x42
|
||||
#define PITCH_MIX 0x51
|
||||
#define WHAMMY_AMOUNT 1797
|
||||
#define WHAMMY_PEDAL 1795
|
||||
#define WHAMMY_MIX 1796
|
||||
|
||||
#define DETUNE_AMOUNT 0x04
|
||||
#define DETUNE_LEVEL 0x03
|
||||
#define PITCH_AMOUNT 1730
|
||||
#define PITCH_MIX 1745
|
||||
|
||||
#define IPS_SHIFT_AMOUNT 0x42
|
||||
#define IPS_KEY 0x44
|
||||
#define IPS_SCALE 0x43
|
||||
#define IPS_LEVEL 0x45
|
||||
#define DETUNE_AMOUNT 1668
|
||||
#define DETUNE_LEVEL 1667
|
||||
|
||||
#define IPS_SHIFT_AMOUNT 2754
|
||||
#define IPS_KEY 2756
|
||||
#define IPS_SCALE 2755
|
||||
#define IPS_LEVEL 2757
|
||||
|
||||
/* DUAL_CHORUS_WAVE, MULTI_CHORUS_WAVE, FLANGER_WAVE, PHASER_WAVE,
|
||||
VIBROPAN_WAVE, TREMOLO_WAVE, PANNER_WAVE valid values */
|
||||
@@ -277,118 +330,135 @@ enum {
|
||||
#define IPS_HMINO 0x05
|
||||
|
||||
enum {
|
||||
DELAY_TYPE_ANALOG = 0,
|
||||
DELAY_TYPE_DIGITAL,
|
||||
DELAY_TYPE_MODULATED,
|
||||
DELAY_TYPE_PONG,
|
||||
DELAY_TYPE_TAPE
|
||||
DELAY_TYPE_ANALOG = 1046,
|
||||
DELAY_TYPE_DIGITAL = 1045,
|
||||
DELAY_TYPE_MODULATED = 1047,
|
||||
DELAY_TYPE_PONG = 1048,
|
||||
DELAY_TYPE_TAPE = 1049
|
||||
};
|
||||
|
||||
#define ANALOG_LEVEL 0x44
|
||||
#define ANALOG_REPEATS 0x47
|
||||
#define DELAY_TYPE 1856
|
||||
#define DELAY_ON_OFF 1857
|
||||
#define DELAY_POSITION 15
|
||||
|
||||
#define DIGITAL_LEVEL 0x44
|
||||
#define DIGITAL_REPEATS 0x47
|
||||
#define DIGITAL_DUCKER_THRESH 0x61
|
||||
#define DIGITAL_DUCKER_LEVEL 0x62
|
||||
#define DELAY_TIME 1888
|
||||
|
||||
#define MODULATED_LEVEL 0x44
|
||||
#define MODULATED_REPEATS 0x47
|
||||
#define MODULATED_DEPTH 0x51
|
||||
#define ANALOG_LEVEL 1860
|
||||
#define ANALOG_REPEATS 1863
|
||||
|
||||
#define PONG_LEVEL 0x44
|
||||
#define PONG_REPEATS 0x47
|
||||
#define PONG_DUCKER_THRESH 0x61
|
||||
#define PONG_DUCKER_LEVEL 0x62
|
||||
#define DIGITAL_LEVEL 1860
|
||||
#define DIGITAL_REPEATS 1863
|
||||
#define DIGITAL_DUCKER_THRESH 1889
|
||||
#define DIGITAL_DUCKER_LEVEL 1890
|
||||
|
||||
#define TAPE_LEVEL 0x44
|
||||
#define TAPE_REPEATS 0x47
|
||||
#define TAPE_WOW 0x63
|
||||
#define TAPE_FLUTTER 0x64
|
||||
#define MODULATED_LEVEL 1860
|
||||
#define MODULATED_REPEATS 1863
|
||||
#define MODULATED_DEPTH 1873
|
||||
|
||||
#define PONG_LEVEL 1860
|
||||
#define PONG_REPEATS 1863
|
||||
#define PONG_DUCKER_THRESH 1889
|
||||
#define PONG_DUCKER_LEVEL 1890
|
||||
|
||||
#define TAPE_LEVEL 1860
|
||||
#define TAPE_REPEATS 1863
|
||||
#define TAPE_WOW 1891
|
||||
#define TAPE_FLUTTER 1892
|
||||
|
||||
enum {
|
||||
REVERB_TYPE_TWIN = 0,
|
||||
REVERB_TYPE_LEX_AMBIENCE,
|
||||
REVERB_TYPE_LEX_STUDIO,
|
||||
REVERB_TYPE_LEX_ROOM,
|
||||
REVERB_TYPE_LEX_HALL,
|
||||
REVERB_TYPE_EMT240_PLATE
|
||||
REVERB_TYPE_TWIN = 1146,
|
||||
REVERB_TYPE_LEX_AMBIENCE = 1150,
|
||||
REVERB_TYPE_LEX_STUDIO = 1149,
|
||||
REVERB_TYPE_LEX_ROOM = 1148,
|
||||
REVERB_TYPE_LEX_HALL = 1147,
|
||||
REVERB_TYPE_EMT240_PLATE = 1151
|
||||
};
|
||||
|
||||
#define TWIN_REVERB 0x05
|
||||
#define REVERB_TYPE 1920
|
||||
#define REVERB_ON_OFF 1921
|
||||
#define REVERB_POSITION 16
|
||||
|
||||
#define LEX_AMBIENCE_PREDELAY 0x02
|
||||
#define LEX_AMBIENCE_DECAY 0x07
|
||||
#define LEX_AMBIENCE_LIVELINESS 0x0D
|
||||
#define LEX_AMBIENCE_LEVEL 0x05
|
||||
#define TWIN_REVERB 1925
|
||||
|
||||
#define LEX_STUDIO_PREDELAY 0x02
|
||||
#define LEX_STUDIO_DECAY 0x07
|
||||
#define LEX_STUDIO_LIVELINESS 0x0D
|
||||
#define LEX_STUDIO_LEVEL 0x05
|
||||
#define LEX_AMBIENCE_PREDELAY 1922
|
||||
#define LEX_AMBIENCE_DECAY 1927
|
||||
#define LEX_AMBIENCE_LIVELINESS 1933
|
||||
#define LEX_AMBIENCE_LEVEL 1925
|
||||
|
||||
#define LEX_ROOM_PREDELAY 0x02
|
||||
#define LEX_ROOM_DECAY 0x07
|
||||
#define LEX_ROOM_LIVELINESS 0x0D
|
||||
#define LEX_ROOM_LEVEL 0x05
|
||||
#define LEX_STUDIO_PREDELAY 1922
|
||||
#define LEX_STUDIO_DECAY 1927
|
||||
#define LEX_STUDIO_LIVELINESS 1933
|
||||
#define LEX_STUDIO_LEVEL 1925
|
||||
|
||||
#define LEX_HALL_PREDELAY 0x02
|
||||
#define LEX_HALL_DECAY 0x07
|
||||
#define LEX_HALL_LIVELINESS 0x0D
|
||||
#define LEX_HALL_LEVEL 0x05
|
||||
#define LEX_ROOM_PREDELAY 1922
|
||||
#define LEX_ROOM_DECAY 1927
|
||||
#define LEX_ROOM_LIVELINESS 1933
|
||||
#define LEX_ROOM_LEVEL 1925
|
||||
|
||||
#define EMT240_PLATE_PREDELAY 0x02
|
||||
#define EMT240_PLATE_DECAY 0x07
|
||||
#define EMT240_PLATE_LIVELINESS 0x0D
|
||||
#define EMT240_PLATE_LEVEL 0x05
|
||||
#define LEX_HALL_PREDELAY 1922
|
||||
#define LEX_HALL_DECAY 1927
|
||||
#define LEX_HALL_LIVELINESS 1933
|
||||
#define LEX_HALL_LEVEL 1925
|
||||
|
||||
void set_wah_min(int level);
|
||||
void set_wah_max(int level);
|
||||
void set_wah_level(int level);
|
||||
void set_wah_type(int type);
|
||||
void set_wah_on_off(gboolean val);
|
||||
void set_comp_sustain(int level);
|
||||
void set_comp_tone(int level);
|
||||
void set_comp_attack(int level);
|
||||
void set_comp_level(int level);
|
||||
void set_comp_type(int type);
|
||||
void set_comp_on_off(gboolean val);
|
||||
#define EMT240_PLATE_PREDELAY 1922
|
||||
#define EMT240_PLATE_DECAY 1927
|
||||
#define EMT240_PLATE_LIVELINESS 1933
|
||||
#define EMT240_PLATE_LEVEL 1925
|
||||
|
||||
enum {
|
||||
EXP_TYPE_NONE = 0,
|
||||
EXP_TYPE_PICKUP_ENABLE = 131137,
|
||||
EXP_TYPE_PIKCUP_TYPE = 131136,
|
||||
EXP_TYPE_COMP_ENABLE = 262337,
|
||||
EXP_TYPE_COMP_SUST = 262352,
|
||||
EXP_TYPE_COMP_TONE = 262353,
|
||||
EXP_TYPE_COMP_LEVEL = 262354,
|
||||
EXP_TYPE_COMP_ATTACK = 262355,
|
||||
EXP_TYPE_DIST_ENABLE = 395649,
|
||||
EXP_TYPE_DIST_DISTORTION = 395653,
|
||||
EXP_TYPE_DIST_FILTER = 395654,
|
||||
EXP_TYPE_DIST_VOLUME = 395655,
|
||||
EXP_TYPE_AMP_ENABLE = 524553,
|
||||
EXP_TYPE_AMP_GAIN = 526785,
|
||||
EXP_TYPE_AMP_LEVEL = 526786,
|
||||
EXP_TYPE_EQ_ENABLE = 1576076,
|
||||
EXP_TYPE_EQ_BASS = 1576067,
|
||||
EXP_TYPE_EQ_MID = 1576068,
|
||||
EXP_TYPE_EQ_TREB = 1576069,
|
||||
EXP_TYPE_GATE_ENABLE = 787137,
|
||||
EXP_TYPE_GATE_THRESHOLD = 787142,
|
||||
EXP_TYPE_GATE_ATTACK = 787144,
|
||||
EXP_TYPE_GATE_RELEASE = 787145,
|
||||
EXP_TYPE_GATE_ATTN = 787146,
|
||||
EXP_TYPE_CHORUSFX_ENABLE = 918273,
|
||||
EXP_TYPE_PHASER_SPEED = 918466,
|
||||
EXP_TYPE_PHASER_DEPTH = 918467,
|
||||
EXP_TYPE_PHASER_REGEN = 918470,
|
||||
EXP_TYPE_PHASER_WAVEFORM = 918471,
|
||||
EXP_TYPE_PHASER_LEVEL = 918469,
|
||||
EXP_TYPE_DELAY_ENABLE = 984897,
|
||||
EXP_TYPE_DELAY_TIME = 984928,
|
||||
EXP_TYPE_DELAY_REPEATS = 984903,
|
||||
EXP_TYPE_DELAY_LEVEL = 984900,
|
||||
EXP_TYPE_DELAY_DUCK_THRESH = 984929,
|
||||
EXP_TYPE_DELAY_DUCK_LEVEL = 984930,
|
||||
EXP_TYPE_REVERB_ENABLE = 1050497,
|
||||
EXP_TYPE_REVERB_LEVEL = 1050501,
|
||||
EXP_TYPE_VOLUME_PRE_FX = 854594,
|
||||
EXP_TYPE_VOLUME_POST_FX = 1116738
|
||||
};
|
||||
|
||||
#define EXP_TYPE 8194
|
||||
#define EXP_POSITION 19
|
||||
|
||||
#define EXP_MIN 8195
|
||||
#define EXP_MAX 8196
|
||||
|
||||
#define USB_POSITION 0
|
||||
#define USB_AUDIO_PLAYBACK_MIX 12297
|
||||
#define USB_AUDIO_LEVEL 12307
|
||||
|
||||
void set_option(guint id, guint position, guint value);
|
||||
void switch_user_preset(int x);
|
||||
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_on_off(gboolean val);
|
||||
void set_preset_level(int level);
|
||||
void set_eq_type(int type);
|
||||
void set_eq_gain(int x);
|
||||
void set_eq_level(int x);
|
||||
void set_eq_bass(int x);
|
||||
void set_eq_mid(int x);
|
||||
void set_eq_mid_hz(int x);
|
||||
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_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_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_on_off(gboolean val);
|
||||
void set_reverb_option(char option, int x);
|
||||
void set_reverb_type(int type);
|
||||
void set_reverb_on_off(gboolean val);
|
||||
|
||||
614
gui.c
614
gui.c
@@ -16,380 +16,29 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gdigi.h"
|
||||
#include "gui.h"
|
||||
#include "effects.h"
|
||||
|
||||
void value_changed_cb(GtkSpinButton *spinbutton, void (*callback)(int))
|
||||
extern EffectList effects[];
|
||||
extern int n_effects;
|
||||
|
||||
void value_changed_option_cb(GtkSpinButton *spinbutton, EffectSettings *setting)
|
||||
{
|
||||
g_return_if_fail(setting != NULL);
|
||||
|
||||
int val = gtk_spin_button_get_value_as_int(spinbutton);
|
||||
callback(val);
|
||||
set_option(setting->option, setting->position, val);
|
||||
}
|
||||
|
||||
void value_changed_option_cb(GtkSpinButton *spinbutton, void (*callback)(char, int))
|
||||
void toggled_cb(GtkToggleButton *button, Effect *effect)
|
||||
{
|
||||
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);
|
||||
g_return_if_fail(effect != NULL);
|
||||
|
||||
guint val = gtk_toggle_button_get_active(button);
|
||||
set_option(effect->option, effect->position, val);
|
||||
}
|
||||
|
||||
void toggled_cb(GtkToggleButton *button, void (*callback)(gboolean))
|
||||
{
|
||||
gboolean val = gtk_toggle_button_get_active(button);
|
||||
callback(val);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
char *label;
|
||||
void (*callback)(int);
|
||||
void (*callback_with_option)(char, int);
|
||||
gdouble min;
|
||||
gdouble max;
|
||||
gint option;
|
||||
} SettingsWidget;
|
||||
|
||||
static SettingsWidget wah_widgets[] = {
|
||||
{"Wah min", set_wah_min, NULL, 0.0, 99.0},
|
||||
{"Wah max", set_wah_max, NULL, 0.0, 99.0},
|
||||
{"Wah level", set_wah_level, NULL, 0.0, 12.0},
|
||||
};
|
||||
|
||||
static SettingsWidget comp_digi_widgets[] = {
|
||||
{"Compressor sustain", set_comp_sustain, NULL, 0.0, 99.0},
|
||||
{"Compressor tone", set_comp_tone, NULL, 0.0, 99.0},
|
||||
{"Compressor attack", set_comp_attack, NULL, 0.0, 99.0},
|
||||
{"Compressor level", set_comp_level, NULL, 0.0, 99.0},
|
||||
};
|
||||
|
||||
static SettingsWidget comp_cs_widgets[] = {
|
||||
{"Compressor sustain", set_comp_sustain, NULL, 0.0, 99.0},
|
||||
{"Compressor attack", set_comp_attack, NULL, 0.0, 99.0},
|
||||
{"Compressor level", set_comp_level, NULL, 0.0, 99.0},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_screamer_widgets[] = {
|
||||
{"Screamer drive", NULL, set_dist_option, 0.0, 99.0, DIST_SCREAMER_DRIVE},
|
||||
{"Screamer tone", NULL, set_dist_option, 0.0, 99.0, DIST_SCREAMER_TONE},
|
||||
{"Screamer level", NULL, set_dist_option, 0.0, 99.0, DIST_SCREAMER_LVL},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_808_widgets[] = {
|
||||
{"808 overdrive", NULL, set_dist_option, 0.0, 99.0, DIST_808_OVERDRIVE},
|
||||
{"808 tone", NULL, set_dist_option, 0.0, 99.0, DIST_808_TONE},
|
||||
{"808 level", NULL, set_dist_option, 0.0, 99.0, DIST_808_LVL},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_guyod_widgets[] = {
|
||||
{"GuyOD drive", NULL, set_dist_option, 0.0, 99.0, DIST_GUYOD_DRIVE},
|
||||
{"GuyOD level", NULL, set_dist_option, 0.0, 99.0, DIST_GUYOD_LVL},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_dod250_widgets[] = {
|
||||
{"DOD250 gain", NULL, set_dist_option, 0.0, 99.0, DIST_DOD250_GAIN},
|
||||
{"DOD250 level", NULL, set_dist_option, 0.0, 99.0, DIST_DOD250_LVL},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_rodent_widgets[] = {
|
||||
{"Rodent dist", NULL, set_dist_option, 0.0, 99.0, DIST_RODENT_DIST},
|
||||
{"Rodent filter", NULL, set_dist_option, 0.0, 99.0, DIST_RODENT_FILTER},
|
||||
{"Rodent level", NULL, set_dist_option, 0.0, 99.0, DIST_RODENT_LVL},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_mx_widgets[] = {
|
||||
{"MX dist", NULL, set_dist_option, 0.0, 99.0, DIST_MX_DIST},
|
||||
{"MX output", NULL, set_dist_option, 0.0, 99.0, DIST_MX_OUTPUT},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_ds_widgets[] = {
|
||||
{"DS gain", NULL, set_dist_option, 0.0, 99.0, DIST_DS_GAIN},
|
||||
{"DS tone", NULL, set_dist_option, 0.0, 99.0, DIST_DS_TONE},
|
||||
{"DS level", NULL, set_dist_option, 0.0, 99.0, DIST_DS_LVL},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_grunge_widgets[] = {
|
||||
{"Grunge", NULL, set_dist_option, 0.0, 99.0, DIST_GRUNGE_GRUNGE},
|
||||
{"Grunge face", NULL, set_dist_option, 0.0, 99.0, DIST_GRUNGE_FACE},
|
||||
{"Grunge loud", NULL, set_dist_option, 0.0, 99.0, DIST_GRUNGE_LOUD},
|
||||
{"Grunge butt", NULL, set_dist_option, 0.0, 99.0, DIST_GRUNGE_BUTT},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_zone_widgets[] = {
|
||||
{"Zone gain", NULL, set_dist_option, 0.0, 99.0, DIST_ZONE_GAIN},
|
||||
{"Zone low", NULL, set_dist_option, 0.0, 99.0, DIST_ZONE_LOW},
|
||||
{"Zone mid level", NULL, set_dist_option, 0.0, 99.0, DIST_ZONE_MID_LVL},
|
||||
{"Zone mid freq", NULL, set_dist_option, 0.0, 99.0, DIST_ZONE_MID_FREQ},
|
||||
{"Zone high", NULL, set_dist_option, 0.0, 99.0, DIST_ZONE_HIGH},
|
||||
{"Zone level", NULL, set_dist_option, 0.0, 99.0, DIST_ZONE_LEVEL},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_death_widgets[] = {
|
||||
{"Death low", NULL, set_dist_option, 0.0, 99.0, DIST_DEATH_LOW},
|
||||
{"Death mid", NULL, set_dist_option, 0.0, 99.0, DIST_DEATH_MID},
|
||||
{"Death high", NULL, set_dist_option, 0.0, 99.0, DIST_DEATH_HIGH},
|
||||
{"Death level", NULL, set_dist_option, 0.0, 99.0, DIST_DEATH_LVL},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_gonk_widgets[] = {
|
||||
{"Gonk gonk", NULL, set_dist_option, 0.0, 99.0, DIST_GONK_GONK},
|
||||
{"Gonk smear", NULL, set_dist_option, 0.0, 99.0, DIST_GONK_SMEAR},
|
||||
{"Gonk suck", NULL, set_dist_option, 0.0, 99.0, DIST_GONK_SUCK},
|
||||
{"Gonk heave", NULL, set_dist_option, 0.0, 99.0, DIST_GONK_HEAVE},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_fuzzy_widgets[] = {
|
||||
{"Fuzzy fuzz", NULL, set_dist_option, 0.0, 99.0, DIST_FUZZY_FUZZ},
|
||||
{"Fuzzy volume", NULL, set_dist_option, 0.0, 99.0, DIST_FUZZY_VOLUME},
|
||||
};
|
||||
|
||||
static SettingsWidget dist_mp_widgets[] = {
|
||||
{"MP sustain", NULL, set_dist_option, 0.0, 99.0, DIST_MP_SUSTAIN},
|
||||
{"MP tone", NULL, set_dist_option, 0.0, 99.0, DIST_MP_TONE},
|
||||
{"MP volume", NULL, set_dist_option, 0.0, 99.0, DIST_MP_VOLUME},
|
||||
};
|
||||
|
||||
static SettingsWidget eq_widgets[] = {
|
||||
{"EQ gain", set_eq_gain, NULL, 0.0, 99.0},
|
||||
{"EQ level", set_eq_level, NULL, 0.0, 99.0},
|
||||
// TODO: make those display propertly (display range -12 to 12)
|
||||
{"EQ bass", set_eq_bass, NULL, 0.0, 24.0},
|
||||
{"EQ mid", set_eq_mid, NULL, 0.0, 24.0},
|
||||
{"EQ treble", set_eq_treble, NULL, 0.0, 24.0},
|
||||
// TODO: make this display propertly (display range 300 to 5000)
|
||||
{"EQ mid Hz", set_eq_mid_hz, NULL, 0.0, 4700.0},
|
||||
// TODO: make this display propertly (display range 500 to 8000)
|
||||
{"EQ treb Hz", set_eq_treb_hz, NULL, 0.0, 7500.0},
|
||||
};
|
||||
|
||||
static SettingsWidget noisegate_gate_widgets[] = {
|
||||
{"Gate treshold", NULL, set_gate_option, 0.0, 99.0, NOISEGATE_GATE_TRESHOLD},
|
||||
{"Gate attack", NULL, set_gate_option, 0.0, 99.0, NOISEGATE_ATTACK},
|
||||
{"Gate release", NULL, set_gate_option, 0.0, 99.0, NOISEGATE_RELEASE},
|
||||
{"Gate attn", NULL, set_gate_option, 0.0, 99.0, NOISEGATE_ATTN},
|
||||
};
|
||||
|
||||
static SettingsWidget noisegate_swell_widgets[] = {
|
||||
{"Swell sens", NULL, set_gate_option, 0.0, 99.0, NOISEGATE_SWELL_SENS},
|
||||
{"Swell attack", NULL, set_gate_option, 0.0, 99.0, NOISEGATE_ATTACK},
|
||||
{"Swell release", NULL, set_gate_option, 0.0, 99.0, NOISEGATE_RELEASE},
|
||||
{"Swell attn", NULL, set_gate_option, 0.0, 99.0, NOISEGATE_ATTN},
|
||||
};
|
||||
|
||||
static SettingsWidget chorusfx_ce_widgets[] = {
|
||||
{"CE chorus speed", NULL, set_chorusfx_option, 0.0, 99.0, CE_CHORUS_SPEED},
|
||||
{"CE chorus depth", NULL, set_chorusfx_option, 0.0, 99.0, CE_CHORUS_DEPTH},
|
||||
};
|
||||
|
||||
static SettingsWidget chorusfx_dual_widgets[] = {
|
||||
{"Dual chorus speed", NULL, set_chorusfx_option, 0.0, 99.0, DUAL_CHORUS_SPEED},
|
||||
{"Dual chorus depth", NULL, set_chorusfx_option, 0.0, 99.0, DUAL_CHORUS_DEPTH},
|
||||
{"Dual chorus level", NULL, set_chorusfx_option, 0.0, 99.0, DUAL_CHORUS_LEVEL},
|
||||
// TODO: DUAL_CHORUS_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
static SettingsWidget chorusfx_multi_widgets[] = {
|
||||
{"Multi chorus speed", NULL, set_chorusfx_option, 0.0, 99.0, MULTI_CHORUS_SPEED},
|
||||
{"Multi chorus depth", NULL, set_chorusfx_option, 0.0, 99.0, MULTI_CHORUS_DEPTH},
|
||||
{"Multi chorus level", NULL, set_chorusfx_option, 0.0, 99.0, MULTI_CHORUS_LEVEL},
|
||||
// TODO: MULTI_CHORUS_WAVE with valid options WAVE_TRI, WAVE_SINE, WAVE_SQUARE
|
||||
};
|
||||
|
||||
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},
|
||||
// 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},
|
||||
};
|
||||
|
||||
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},
|
||||
// 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},
|
||||
};
|
||||
|
||||
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},
|
||||
};
|
||||
|
||||
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},
|
||||
// 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},
|
||||
// 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},
|
||||
// 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},
|
||||
};
|
||||
|
||||
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},
|
||||
};
|
||||
|
||||
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},
|
||||
};
|
||||
|
||||
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},
|
||||
};
|
||||
|
||||
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},
|
||||
//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,
|
||||
// WHAMMY_M3_MA, WHAMMY_2ND_MA3, WHAMMY_3RD_4TH, WHAMMY_4TH_5TH,
|
||||
// WHAMMY_5TH_OCT, WHAMMY_HOCT_UP, WHAMMY_HOCT_DN, WHAMMY_OCT_UD
|
||||
};
|
||||
|
||||
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},
|
||||
};
|
||||
|
||||
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},
|
||||
};
|
||||
|
||||
static SettingsWidget chorusfx_ips_widgets[] = {
|
||||
// TODO: IPS_SHIFT_AMOUNT with valid options:
|
||||
// IPS_7TH_DN, IPS_6TH_DN, IPS_5TH_DN, IPS_4TH_DN, IPS_3RD_DN,
|
||||
// IPS_2ND_DN, IPS_2ND_UP, IPS_3RD_UP, IPS_4TH_UP, IPS_5TH_UP,
|
||||
// IPS_6TH_UP, IPS_7TH_UP, IPS_OCT_U
|
||||
|
||||
// TODO: IPS_KEY with valid options:
|
||||
// IPS_E, IPS_F, IPS_GB, IPS_G, IPS_AB, IPS_A, IPS_BB, IPS_B,
|
||||
// IPS_C, IPS_DD, IPS_D, IPS_EB
|
||||
|
||||
// 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},
|
||||
};
|
||||
|
||||
static SettingsWidget delay_analog_widgets[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", set_delay_time, NULL, 0.0, 139.0},
|
||||
{"Delay analog level", NULL, set_delay_option, 0.0, 99.0, ANALOG_LEVEL},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay analog repeats", NULL, set_delay_option, 0.0, 100.0, ANALOG_REPEATS},
|
||||
};
|
||||
|
||||
static SettingsWidget delay_digital_widgets[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", set_delay_time, NULL, 0.0, 139.0},
|
||||
{"Delay digital level", NULL, set_delay_option, 0.0, 99.0, DIGITAL_LEVEL},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay digital repeats", NULL, set_delay_option, 0.0, 100.0, DIGITAL_REPEATS},
|
||||
{"Delay digital ducker thresh", NULL, set_delay_option, 0.0, 99.0, DIGITAL_DUCKER_THRESH},
|
||||
{"Delay digital ducker level", NULL, set_delay_option, 0.0, 99.0, DIGITAL_DUCKER_LEVEL},
|
||||
};
|
||||
|
||||
static SettingsWidget delay_modulated_widgets[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", set_delay_time, NULL, 0.0, 139.0},
|
||||
{"Delay modulated level", NULL, set_delay_option, 0.0, 99.0, MODULATED_LEVEL},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay modulated repeats", NULL, set_delay_option, 0.0, 100.0, MODULATED_REPEATS},
|
||||
{"Delay modulated depth", NULL, set_delay_option, 0.0, 99.0, MODULATED_DEPTH},
|
||||
};
|
||||
|
||||
static SettingsWidget delay_pong_widgets[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", set_delay_time, NULL, 0.0, 139.0},
|
||||
{"Delay pong level", NULL, set_delay_option, 0.0, 99.0, PONG_LEVEL},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay pong repeats", NULL, set_delay_option, 0.0, 100.0, PONG_REPEATS},
|
||||
{"Delay pong ducker thresh", NULL, set_delay_option, 0.0, 99.0, PONG_DUCKER_THRESH},
|
||||
{"Delay pong ducker level", NULL, set_delay_option, 0.0, 99.0, PONG_DUCKER_LEVEL},
|
||||
};
|
||||
|
||||
static SettingsWidget delay_tape_widgets[] = {
|
||||
// TODO: make this display propertly (10 msec to 5 sec)
|
||||
{"Delay time", set_delay_time, NULL, 0.0, 139.0},
|
||||
{"Delay tape level", NULL, set_delay_option, 0.0, 99.0, TAPE_LEVEL},
|
||||
// TODO: make last value display propertly
|
||||
{"Delay tape repeats", NULL, set_delay_option, 0.0, 100.0, TAPE_REPEATS},
|
||||
{"Delay tape wow", NULL, set_delay_option, 0.0, 99.0, TAPE_WOW},
|
||||
{"Delay tape flutter", NULL, set_delay_option, 0.0, 99.0, TAPE_FLUTTER},
|
||||
};
|
||||
|
||||
static SettingsWidget reverb_twin_widgets[] = {
|
||||
{"Twin reverb", NULL, set_reverb_option, 0.0, 99.0, TWIN_REVERB},
|
||||
};
|
||||
|
||||
static SettingsWidget reverb_lex_ambience_widgets[] = {
|
||||
{"Predelay", NULL, set_reverb_option, 0.0, 15.0, LEX_AMBIENCE_PREDELAY},
|
||||
{"Decay", NULL, set_reverb_option, 0.0, 99.0, LEX_AMBIENCE_DECAY},
|
||||
{"Liveliness", NULL, set_reverb_option, 0.0, 99.0, LEX_AMBIENCE_LIVELINESS},
|
||||
{"Level", NULL, set_reverb_option, 0.0, 99.0, LEX_AMBIENCE_LEVEL},
|
||||
};
|
||||
|
||||
static SettingsWidget reverb_lex_studio_widgets[] = {
|
||||
{"Predelay", NULL, set_reverb_option, 0.0, 15.0, LEX_STUDIO_PREDELAY},
|
||||
{"Decay", NULL, set_reverb_option, 0.0, 99.0, LEX_STUDIO_DECAY},
|
||||
{"Liveliness", NULL, set_reverb_option, 0.0, 99.0, LEX_STUDIO_LIVELINESS},
|
||||
{"Level", NULL, set_reverb_option, 0.0, 99.0, LEX_STUDIO_LEVEL},
|
||||
};
|
||||
|
||||
static SettingsWidget reverb_lex_room_widgets[] = {
|
||||
{"Predelay", NULL, set_reverb_option, 0.0, 15.0, LEX_ROOM_PREDELAY},
|
||||
{"Decay", NULL, set_reverb_option, 0.0, 99.0, LEX_ROOM_DECAY},
|
||||
{"Liveliness", NULL, set_reverb_option, 0.0, 99.0, LEX_ROOM_LIVELINESS},
|
||||
{"Level", NULL, set_reverb_option, 0.0, 99.0, LEX_ROOM_LEVEL},
|
||||
};
|
||||
|
||||
static SettingsWidget reverb_lex_hall_widgets[] = {
|
||||
{"Predelay", NULL, set_reverb_option, 0.0, 15.0, LEX_HALL_PREDELAY},
|
||||
{"Decay", NULL, set_reverb_option, 0.0, 99.0, LEX_HALL_DECAY},
|
||||
{"Liveliness", NULL, set_reverb_option, 0.0, 99.0, LEX_HALL_LIVELINESS},
|
||||
{"Level", NULL, set_reverb_option, 0.0, 99.0, LEX_HALL_LEVEL},
|
||||
};
|
||||
|
||||
static SettingsWidget reverb_emt240_plate_widgets[] = {
|
||||
{"Predelay", NULL, set_reverb_option, 0.0, 15.0, EMT240_PLATE_PREDELAY},
|
||||
{"Decay", NULL, set_reverb_option, 0.0, 99.0, EMT240_PLATE_DECAY},
|
||||
{"Liveliness", NULL, set_reverb_option, 0.0, 99.0, EMT240_PLATE_LIVELINESS},
|
||||
{"Level", NULL, set_reverb_option, 0.0, 99.0, EMT240_PLATE_LEVEL},
|
||||
};
|
||||
|
||||
GtkWidget *create_table(SettingsWidget *widgets, gint amt)
|
||||
GtkWidget *create_table(EffectSettings *settings, gint amt)
|
||||
{
|
||||
GtkWidget *table, *label, *widget;
|
||||
GtkObject *adj;
|
||||
@@ -398,16 +47,10 @@ GtkWidget *create_table(SettingsWidget *widgets, gint amt)
|
||||
table = gtk_table_new(2, amt, FALSE);
|
||||
|
||||
for (x = 0; x<amt; x++) {
|
||||
label = gtk_label_new(widgets[x].label);
|
||||
adj = gtk_adjustment_new(0.0, widgets[x].min, widgets[x].max, 1.0, 1.0, 1.0);
|
||||
label = gtk_label_new(settings[x].label);
|
||||
adj = gtk_adjustment_new(0.0, settings[x].min, settings[x].max, 1.0, 1.0, 1.0);
|
||||
widget = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 1.0, 0);
|
||||
if (widgets[x].callback)
|
||||
g_signal_connect(G_OBJECT(widget), "value-changed", G_CALLBACK(value_changed_cb), widgets[x].callback);
|
||||
|
||||
if (widgets[x].callback_with_option) {
|
||||
g_object_set_data(G_OBJECT(widget), "option_id", GINT_TO_POINTER(widgets[x].option));
|
||||
g_signal_connect(G_OBJECT(widget), "value-changed", G_CALLBACK(value_changed_option_cb), widgets[x].callback_with_option);
|
||||
}
|
||||
g_signal_connect(G_OBJECT(widget), "value-changed", G_CALLBACK(value_changed_option_cb), &settings[x]);
|
||||
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, x, x+1, GTK_SHRINK, GTK_SHRINK, 2, 2);
|
||||
gtk_table_attach(GTK_TABLE(table), widget, 1, 2, x, x+1, GTK_SHRINK, GTK_SHRINK, 2, 2);
|
||||
@@ -416,193 +59,105 @@ GtkWidget *create_table(SettingsWidget *widgets, gint amt)
|
||||
return table;
|
||||
}
|
||||
|
||||
GtkWidget *create_on_off_button(const gchar *label, gboolean state, void (*callback)(int))
|
||||
GtkWidget *create_on_off_button(Effect *effect)
|
||||
{
|
||||
GtkWidget *button = gtk_toggle_button_new_with_label(label);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), state);
|
||||
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(toggled_cb), callback);
|
||||
GtkWidget *button = gtk_toggle_button_new_with_label(effect->label);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
|
||||
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(toggled_cb), effect);
|
||||
return button;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
gint id;
|
||||
gchar *label;
|
||||
void (*callback)(int);
|
||||
SettingsWidget *widgets;
|
||||
gint widgets_amt;
|
||||
GtkWidget *child; /* child widget - set inside create_widget_container */
|
||||
} WidgetContainer;
|
||||
gint id; /* effect group ID (value) */
|
||||
gint option; /* option ID */
|
||||
gint position; /* position */
|
||||
GtkWidget *child; /* child widget */
|
||||
} EffectSettingsGroup;
|
||||
|
||||
static WidgetContainer wah_container[] = {
|
||||
{WAH_TYPE_CRY, "Cry wah", set_wah_type, wah_widgets, G_N_ELEMENTS(wah_widgets), NULL},
|
||||
{WAH_TYPE_FULLRANGE, "Fullrange wah", set_wah_type, wah_widgets, G_N_ELEMENTS(wah_widgets), NULL},
|
||||
{WAH_TYPE_CLYDE, "Clyde wah", set_wah_type, wah_widgets, G_N_ELEMENTS(wah_widgets), NULL},
|
||||
};
|
||||
void effect_settings_group_free(EffectSettingsGroup *group)
|
||||
{
|
||||
/* destroy widget without parent */
|
||||
if (gtk_widget_get_parent(group->child) == NULL)
|
||||
gtk_widget_destroy(group->child);
|
||||
|
||||
static WidgetContainer comp_container[] = {
|
||||
{COMP_TYPE_DIGI, "Digital compressor", set_comp_type, comp_digi_widgets, G_N_ELEMENTS(comp_digi_widgets), NULL},
|
||||
{COMP_TYPE_CS, "CS compressor", set_comp_type, comp_cs_widgets, G_N_ELEMENTS(comp_cs_widgets), NULL},
|
||||
};
|
||||
g_object_unref(group->child);
|
||||
g_free(group);
|
||||
}
|
||||
|
||||
static WidgetContainer dist_container[] = {
|
||||
{DIST_TYPE_SCREAMER, "Screamer", set_dist_type, dist_screamer_widgets, G_N_ELEMENTS(dist_screamer_widgets), NULL},
|
||||
{DIST_TYPE_808, "808", set_dist_type, dist_808_widgets, G_N_ELEMENTS(dist_808_widgets), NULL},
|
||||
{DIST_TYPE_GUYOD, "GuyOD", set_dist_type, dist_guyod_widgets, G_N_ELEMENTS(dist_guyod_widgets), NULL},
|
||||
{DIST_TYPE_DOD250, "DOD250", set_dist_type, dist_dod250_widgets, G_N_ELEMENTS(dist_dod250_widgets), NULL},
|
||||
{DIST_TYPE_RODENT, "Rodent", set_dist_type, dist_rodent_widgets, G_N_ELEMENTS(dist_rodent_widgets), NULL},
|
||||
{DIST_TYPE_MX, "MX", set_dist_type, dist_mx_widgets, G_N_ELEMENTS(dist_mx_widgets), NULL},
|
||||
{DIST_TYPE_DS, "DS", set_dist_type, dist_ds_widgets, G_N_ELEMENTS(dist_ds_widgets), NULL},
|
||||
{DIST_TYPE_GRUNGE, "Grunge", set_dist_type, dist_grunge_widgets, G_N_ELEMENTS(dist_grunge_widgets), NULL},
|
||||
{DIST_TYPE_ZONE, "Zone", set_dist_type, dist_zone_widgets, G_N_ELEMENTS(dist_zone_widgets), NULL},
|
||||
{DIST_TYPE_DEATH, "Death", set_dist_type, dist_death_widgets, G_N_ELEMENTS(dist_death_widgets), NULL},
|
||||
{DIST_TYPE_GONK, "Gonk", set_dist_type, dist_gonk_widgets, G_N_ELEMENTS(dist_gonk_widgets), NULL},
|
||||
{DIST_TYPE_FUZZY, "Fuzzy", set_dist_type, dist_fuzzy_widgets, G_N_ELEMENTS(dist_fuzzy_widgets), NULL},
|
||||
{DIST_TYPE_MP, "MP", set_dist_type, dist_mp_widgets, G_N_ELEMENTS(dist_mp_widgets), NULL},
|
||||
};
|
||||
|
||||
static WidgetContainer noisegate_container[] = {
|
||||
{NOISEGATE_GATE, "Gate", set_noisegate_type, noisegate_gate_widgets, G_N_ELEMENTS(noisegate_gate_widgets), NULL},
|
||||
{NOISEGATE_SWELL, "Swell", set_noisegate_type, noisegate_swell_widgets, G_N_ELEMENTS(noisegate_swell_widgets), NULL},
|
||||
};
|
||||
|
||||
static WidgetContainer chorusfx_container[] = {
|
||||
{CHORUS_TYPE_CE, "CE Chorus", set_chorusfx_type, chorusfx_ce_widgets, G_N_ELEMENTS(chorusfx_ce_widgets), NULL},
|
||||
{CHORUS_TYPE_DUAL, "Dual Chorus", set_chorusfx_type, chorusfx_dual_widgets, G_N_ELEMENTS(chorusfx_dual_widgets), NULL},
|
||||
{CHORUS_TYPE_MULTI, "Multi Chorus", set_chorusfx_type, chorusfx_multi_widgets, G_N_ELEMENTS(chorusfx_multi_widgets), NULL},
|
||||
{CHORUS_TYPE_FLANGER, "Flanger", set_chorusfx_type, chorusfx_flanger_widgets, G_N_ELEMENTS(chorusfx_flanger_widgets), NULL},
|
||||
{CHORUS_TYPE_MXR_FLANGER, "MXR FLANGER", set_chorusfx_type, chorusfx_mxr_flanger_widgets, G_N_ELEMENTS(chorusfx_mxr_flanger_widgets), NULL},
|
||||
{CHORUS_TYPE_PHASER, "Phaser", set_chorusfx_type, chorusfx_phaser_widgets, G_N_ELEMENTS(chorusfx_phaser_widgets), NULL},
|
||||
{CHORUS_TYPE_VIBRATO, "Vibrato", set_chorusfx_type, chorusfx_vibrato_widgets, G_N_ELEMENTS(chorusfx_vibrato_widgets), NULL},
|
||||
{CHORUS_TYPE_ROTARY, "Rotary", set_chorusfx_type, chorusfx_rotary_widgets, G_N_ELEMENTS(chorusfx_rotary_widgets), NULL},
|
||||
{CHORUS_TYPE_VIBROPAN, "Vibropan", set_chorusfx_type, chorusfx_vibropan_widgets, G_N_ELEMENTS(chorusfx_vibropan_widgets), NULL},
|
||||
{CHORUS_TYPE_TREMOLO, "Tremolo", set_chorusfx_type, chorusfx_tremolo_widgets, G_N_ELEMENTS(chorusfx_tremolo_widgets), NULL},
|
||||
{CHORUS_TYPE_PANNER, "Panner", set_chorusfx_type, chorusfx_panner_widgets, G_N_ELEMENTS(chorusfx_panner_widgets), NULL},
|
||||
{CHORUS_TYPE_ENVELOPE, "Envelope", set_chorusfx_type, chorusfx_envelope_widgets, G_N_ELEMENTS(chorusfx_envelope_widgets), NULL},
|
||||
{CHORUS_TYPE_AUTOYA, "AutoYa", set_chorusfx_type, chorusfx_autoya_widgets, G_N_ELEMENTS(chorusfx_autoya_widgets), NULL},
|
||||
{CHORUS_TYPE_YAYA, "YaYa", set_chorusfx_type, chorusfx_yaya_widgets, G_N_ELEMENTS(chorusfx_yaya_widgets), NULL},
|
||||
{CHORUS_TYPE_STEP_FILTER, "Step Filter", set_chorusfx_type, chorusfx_step_filter_widgets, G_N_ELEMENTS(chorusfx_step_filter_widgets), NULL},
|
||||
{CHORUS_TYPE_WHAMMY, "Whammy", set_chorusfx_type, chorusfx_whammy_widgets, G_N_ELEMENTS(chorusfx_whammy_widgets), NULL},
|
||||
{CHORUS_TYPE_PITCH_SHIFT, "Pitch Shift", set_chorusfx_type, chorusfx_pitch_shift_widgets, G_N_ELEMENTS(chorusfx_pitch_shift_widgets), NULL},
|
||||
{CHORUS_TYPE_DETUNE, "Detune", set_chorusfx_type, chorusfx_detune_widgets, G_N_ELEMENTS(chorusfx_detune_widgets), NULL},
|
||||
{CHORUS_TYPE_IPS, "IPS", set_chorusfx_type, chorusfx_ips_widgets, G_N_ELEMENTS(chorusfx_ips_widgets), NULL},
|
||||
};
|
||||
|
||||
static WidgetContainer delay_container[] = {
|
||||
{DELAY_TYPE_ANALOG, "Analog", set_delay_type, delay_analog_widgets, G_N_ELEMENTS(delay_analog_widgets), NULL},
|
||||
{DELAY_TYPE_DIGITAL, "Digital", set_delay_type, delay_digital_widgets, G_N_ELEMENTS(delay_digital_widgets), NULL},
|
||||
{DELAY_TYPE_MODULATED, "Modulated", set_delay_type, delay_modulated_widgets, G_N_ELEMENTS(delay_modulated_widgets), NULL},
|
||||
{DELAY_TYPE_PONG, "Pong", set_delay_type, delay_pong_widgets, G_N_ELEMENTS(delay_pong_widgets), NULL},
|
||||
{DELAY_TYPE_TAPE, "Tape", set_delay_type, delay_tape_widgets, G_N_ELEMENTS(delay_tape_widgets), NULL},
|
||||
};
|
||||
|
||||
static WidgetContainer reverb_container[] = {
|
||||
{REVERB_TYPE_TWIN, "Twin", set_reverb_type, reverb_twin_widgets, G_N_ELEMENTS(reverb_twin_widgets), NULL},
|
||||
{REVERB_TYPE_LEX_AMBIENCE, "Lexicon ambience", set_reverb_type, reverb_lex_ambience_widgets, G_N_ELEMENTS(reverb_lex_ambience_widgets), NULL},
|
||||
{REVERB_TYPE_LEX_STUDIO, "Lexicon studio", set_reverb_type, reverb_lex_studio_widgets, G_N_ELEMENTS(reverb_lex_studio_widgets), NULL},
|
||||
{REVERB_TYPE_LEX_ROOM, "Lexicon room", set_reverb_type, reverb_lex_room_widgets, G_N_ELEMENTS(reverb_lex_room_widgets), NULL},
|
||||
{REVERB_TYPE_LEX_HALL, "Lexicon hall", set_reverb_type, reverb_lex_hall_widgets, G_N_ELEMENTS(reverb_lex_hall_widgets), NULL},
|
||||
{REVERB_TYPE_EMT240_PLATE, "EMT240 Plate", set_reverb_type, reverb_emt240_plate_widgets, G_N_ELEMENTS(reverb_emt240_plate_widgets), NULL},
|
||||
};
|
||||
|
||||
static WidgetContainer eq_container[] = {
|
||||
{EQ_TYPE_BRIGHT, "Bright", set_eq_type, eq_widgets, G_N_ELEMENTS(eq_widgets), NULL},
|
||||
{EQ_TYPE_MIDBOOST, "Mid Boost", set_eq_type, eq_widgets, G_N_ELEMENTS(eq_widgets), NULL},
|
||||
{EQ_TYPE_SCOOP, "Scoop", set_eq_type, eq_widgets, G_N_ELEMENTS(eq_widgets), NULL},
|
||||
{EQ_TYPE_WARM, "Warm", set_eq_type, eq_widgets, G_N_ELEMENTS(eq_widgets), NULL},
|
||||
};
|
||||
|
||||
void combo_box_changed_cb(GtkComboBox *widget, WidgetContainer *widgets)
|
||||
void combo_box_changed_cb(GtkComboBox *widget, gpointer data)
|
||||
{
|
||||
GtkWidget *child;
|
||||
GtkWidget *vbox;
|
||||
EffectSettingsGroup *settings = NULL;
|
||||
gchar *name = NULL;
|
||||
gint x;
|
||||
g_object_get(G_OBJECT(widget), "active", &x, NULL);
|
||||
|
||||
vbox = g_object_get_data(G_OBJECT(widget), "vbox");
|
||||
|
||||
if (x != -1) {
|
||||
widgets[x].callback(widgets[x].id);
|
||||
name = g_strdup_printf("SettingsGroup%d", x);
|
||||
settings = g_object_get_data(G_OBJECT(widget), name);
|
||||
g_free(name);
|
||||
|
||||
if (settings != NULL)
|
||||
set_option(settings->option, settings->position, settings->id);
|
||||
|
||||
child = g_object_get_data(G_OBJECT(widget), "active_child");
|
||||
if (child != NULL) {
|
||||
gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(gtk_widget_get_parent(vbox))), child);
|
||||
}
|
||||
gtk_container_add(GTK_CONTAINER(gtk_widget_get_parent(gtk_widget_get_parent(vbox))), widgets[x].child);
|
||||
gtk_container_add(GTK_CONTAINER(gtk_widget_get_parent(gtk_widget_get_parent(vbox))), settings->child);
|
||||
gtk_widget_show_all(gtk_widget_get_parent(gtk_widget_get_parent(vbox)));
|
||||
g_object_set_data(G_OBJECT(widget), "active_child", widgets[x].child);
|
||||
g_object_set_data(G_OBJECT(widget), "active_child", settings->child);
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget *create_widget_container(WidgetContainer *widgets, gint amt)
|
||||
GtkWidget *create_widget_container(EffectGroup *group, gint amt)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *combo_box = NULL;
|
||||
EffectSettingsGroup *settings = NULL;
|
||||
gchar *name = NULL;
|
||||
gint x;
|
||||
gint cmbox_no = -1;
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, 0);
|
||||
|
||||
for (x = 0; x<amt; x++) {
|
||||
if (widgets[x].label) {
|
||||
if (group[x].label) {
|
||||
if (combo_box == NULL) {
|
||||
combo_box = gtk_combo_box_new_text();
|
||||
gtk_container_add(GTK_CONTAINER(vbox), combo_box);
|
||||
g_signal_connect(G_OBJECT(combo_box), "changed", G_CALLBACK(combo_box_changed_cb), widgets);
|
||||
g_signal_connect(G_OBJECT(combo_box), "changed", G_CALLBACK(combo_box_changed_cb), group);
|
||||
g_object_set_data(G_OBJECT(combo_box), "vbox", vbox);
|
||||
}
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), widgets[x].label);
|
||||
}
|
||||
widget = create_table(widgets[x].widgets, widgets[x].widgets_amt);
|
||||
widgets[x].child = widget;
|
||||
g_object_ref(widget);
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), group[x].label);
|
||||
cmbox_no++;
|
||||
|
||||
if (widgets[x].label == NULL && widgets[x].id == -1)
|
||||
widget = create_table(group[x].settings, group[x].settings_amt);
|
||||
g_object_ref_sink(widget);
|
||||
|
||||
settings = g_malloc(sizeof(EffectSettingsGroup));
|
||||
settings->id = group[x].id;
|
||||
settings->option = group[x].option;
|
||||
settings->position = group[x].position;
|
||||
settings->child = widget;
|
||||
|
||||
name = g_strdup_printf("SettingsGroup%d", cmbox_no);
|
||||
g_object_set_data_full(G_OBJECT(combo_box), name, settings, ((GDestroyNotify)effect_settings_group_free));
|
||||
g_free(name);
|
||||
} else {
|
||||
widget = create_table(group[x].settings, group[x].settings_amt);
|
||||
gtk_container_add(GTK_CONTAINER(vbox), widget);
|
||||
}
|
||||
}
|
||||
|
||||
return vbox;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
char *label;
|
||||
gboolean value;
|
||||
void (*callback)(gboolean);
|
||||
WidgetContainer *widgets;
|
||||
gint widgets_amt;
|
||||
} VBoxWidget;
|
||||
|
||||
static VBoxWidget wah_vbox[] = {
|
||||
{"Wah", FALSE, set_wah_on_off, wah_container, G_N_ELEMENTS(wah_container)},
|
||||
};
|
||||
|
||||
static VBoxWidget comp_vbox[] = {
|
||||
{"Compressor", FALSE, set_comp_on_off, comp_container, G_N_ELEMENTS(comp_container)},
|
||||
};
|
||||
|
||||
static VBoxWidget dist_vbox[] = {
|
||||
{"Distortion", FALSE, set_dist_on_off, dist_container, G_N_ELEMENTS(dist_container)},
|
||||
};
|
||||
|
||||
static VBoxWidget noisegate_vbox[] = {
|
||||
{"Noisegate", FALSE, set_noisegate_on_off, noisegate_container, G_N_ELEMENTS(noisegate_container)},
|
||||
};
|
||||
|
||||
static VBoxWidget chorusfx_vbox[] = {
|
||||
{"Chorus/FX", FALSE, set_chorusfx_on_off, chorusfx_container, G_N_ELEMENTS(chorusfx_container)},
|
||||
};
|
||||
|
||||
static VBoxWidget delay_vbox[] = {
|
||||
{"Delay", FALSE, set_delay_on_off, delay_container, G_N_ELEMENTS(delay_container)},
|
||||
};
|
||||
|
||||
static VBoxWidget reverb_vbox[] = {
|
||||
{"Reverb", FALSE, set_reverb_on_off, reverb_container, G_N_ELEMENTS(reverb_container)},
|
||||
};
|
||||
|
||||
static VBoxWidget eq_vbox[] = {
|
||||
{"EQ", FALSE, set_eq_on_off, eq_container, G_N_ELEMENTS(eq_container)},
|
||||
};
|
||||
|
||||
GtkWidget *create_vbox(VBoxWidget *widgets, gint amt)
|
||||
GtkWidget *create_vbox(Effect *widgets, gint amt)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
@@ -616,10 +171,10 @@ GtkWidget *create_vbox(VBoxWidget *widgets, gint amt)
|
||||
gtk_box_set_homogeneous(GTK_BOX(hbox), TRUE);
|
||||
|
||||
for (x = 0; x<amt; x++) {
|
||||
widget = create_on_off_button(widgets[x].label, widgets[x].value, widgets[x].callback);
|
||||
widget = create_on_off_button(&widgets[x]);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 2);
|
||||
|
||||
table = create_widget_container(widgets[x].widgets, widgets[x].widgets_amt);
|
||||
table = create_widget_container(widgets[x].group, widgets[x].group_amt);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 2);
|
||||
}
|
||||
|
||||
@@ -627,42 +182,25 @@ GtkWidget *create_vbox(VBoxWidget *widgets, gint amt)
|
||||
return vbox;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
VBoxWidget *widget;
|
||||
gint amt;
|
||||
} VBoxes;
|
||||
|
||||
static VBoxes vboxes[] = {
|
||||
{wah_vbox, G_N_ELEMENTS(wah_vbox)},
|
||||
{eq_vbox, G_N_ELEMENTS(eq_vbox)},
|
||||
{comp_vbox, G_N_ELEMENTS(comp_vbox)},
|
||||
{dist_vbox, G_N_ELEMENTS(dist_vbox)},
|
||||
{noisegate_vbox, G_N_ELEMENTS(noisegate_vbox)},
|
||||
{chorusfx_vbox, G_N_ELEMENTS(chorusfx_vbox)},
|
||||
{delay_vbox, G_N_ELEMENTS(delay_vbox)},
|
||||
{reverb_vbox, G_N_ELEMENTS(reverb_vbox)},
|
||||
};
|
||||
|
||||
void create_window()
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *widget;
|
||||
gint x, amt;
|
||||
gint x;
|
||||
|
||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER(window), vbox);
|
||||
|
||||
amt = G_N_ELEMENTS(vboxes);
|
||||
for (x = 0; x<amt; x++) {
|
||||
for (x = 0; x<n_effects; x++) {
|
||||
if ((x % 2) == 0) {
|
||||
hbox = gtk_hbox_new(TRUE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 2);
|
||||
}
|
||||
widget = create_vbox(vboxes[x].widget, vboxes[x].amt);
|
||||
widget = create_vbox(effects[x].effect, effects[x].amt);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user