├── doc ├── MIDX20_Midi_Spec.pdf ├── bronco_usb_amps_effects.txt └── fender_mustang_protocol.txt ├── reverb_models.cpp ├── reverb_models.h ├── magic.h ├── 60-midi.rules ├── 50-mustang.rules ├── delay_models.h ├── delay_models.cpp ├── README.testing ├── stomp_models.h ├── Makefile ├── stomp_models.cpp ├── mod_models.h ├── mod_models.cpp ├── amp_models.h ├── mustang_bridge ├── reverb.cpp ├── mustang_bridge_stop ├── constants.h ├── amp_models.cpp ├── magic.cpp ├── stomp.cpp ├── mod.cpp ├── install.sh ├── delay.cpp ├── amp.cpp ├── reverb.h ├── mustang_bridge_start ├── mustang.h ├── delay_defaults.h ├── reverb_defaults.h ├── mustang_midi.cpp ├── stomp_defaults.h ├── mod_defaults.h ├── delay.h ├── amp.h ├── amp_defaults.h ├── README.md ├── stomp.h ├── mod.h ├── test.py └── LICENSE /doc/MIDX20_Midi_Spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snhirsch/mustang-midi-bridge/HEAD/doc/MIDX20_Midi_Spec.pdf -------------------------------------------------------------------------------- /reverb_models.cpp: -------------------------------------------------------------------------------- 1 | #include "reverb_models.h" 2 | 3 | const unsigned char null_reverb_id[] = { 0x00, 0x00 }; 4 | 5 | -------------------------------------------------------------------------------- /reverb_models.h: -------------------------------------------------------------------------------- 1 | // -*-c++-*- 2 | 3 | #ifndef REVERB_MODELS_H 4 | #define REVERB_MODELS_H 5 | 6 | extern const unsigned char null_reverb_id[]; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /magic.h: -------------------------------------------------------------------------------- 1 | // Magic values for direct conditioning of Mustang analog controls 2 | // 3 | 4 | #ifndef _MAGIC_H 5 | #define _MAGIC_H 6 | 7 | extern unsigned short magic_values[]; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /60-midi.rules: -------------------------------------------------------------------------------- 1 | # Must customize vendor and product id for your controller 2 | ACTION=="add|change", SUBSYSTEM=="usb", ATTRS{idVendor}=="0763", ATTRS{idProduct}=="0160", RUN+="/bin/bash -c '/bin/echo /usr/local/bin/mustang_bridge_start | /usr/bin/at now'" 3 | ACTION=="remove", ENV{ID_VENDOR_ID}=="0763", ENV{ID_MODEL_ID}=="0160", ENV{DEVTYPE}=="usb_device", RUN+="/usr/local/bin/mustang_bridge_stop" 4 | -------------------------------------------------------------------------------- /50-mustang.rules: -------------------------------------------------------------------------------- 1 | # Cover all known Mustang models 2 | ACTION=="add|change", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="1ed8", ATTRS{idProduct}=="0004|0005|000a|0010|0012|0014|0016", GROUP="plugdev", RUN+="/bin/bash -c '/bin/echo /usr/local/bin/mustang_bridge_start | /usr/bin/at now'" 3 | ACTION=="remove", ENV{ID_VENDOR_ID}=="1ed8", ENV{ID_MODEL_ID}=="0004|0005|000a|0010|0012|0014|0016", ENV{DEVTYPE}=="usb_device", RUN+="/usr/local/bin/mustang_bridge_stop" 4 | 5 | -------------------------------------------------------------------------------- /delay_models.h: -------------------------------------------------------------------------------- 1 | #ifndef DELAY_MODELS_H 2 | #define DELAY_MODELS_H 3 | 4 | extern const unsigned char null_dly_id[]; 5 | 6 | extern const unsigned char mono_dly_id[]; 7 | extern const unsigned char mono_filter_id[]; 8 | extern const unsigned char st_filter_id[]; 9 | extern const unsigned char mtap_dly_id[]; 10 | extern const unsigned char pong_dly_id[]; 11 | extern const unsigned char duck_dly_id[]; 12 | extern const unsigned char reverse_dly_id[]; 13 | extern const unsigned char tape_dly_id[]; 14 | extern const unsigned char st_tape_dly_id[]; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /delay_models.cpp: -------------------------------------------------------------------------------- 1 | #include "delay_models.h" 2 | 3 | const unsigned char null_dly_id[] = { 0x00, 0x00 }; 4 | 5 | const unsigned char mono_dly_id[] = { 0x16, 0x00 }; 6 | const unsigned char mono_filter_id[] = { 0x43, 0x00 }; 7 | const unsigned char st_filter_id[] = { 0x48, 0x00 }; 8 | const unsigned char mtap_dly_id[] = { 0x44, 0x00 }; 9 | const unsigned char pong_dly_id[] = { 0x45, 0x00 }; 10 | const unsigned char duck_dly_id[] = { 0x15, 0x00 }; 11 | const unsigned char reverse_dly_id[] = { 0x46, 0x00 }; 12 | const unsigned char tape_dly_id[] = { 0x2b, 0x00 }; 13 | const unsigned char st_tape_dly_id[] = { 0x2a, 0x00 }; 14 | 15 | -------------------------------------------------------------------------------- /README.testing: -------------------------------------------------------------------------------- 1 | To test, start bridge in virtual input mode and listen to MIDI channel 2 | 1 for messages: 3 | 4 | $ mustang_midi "TestPort" 1 5 | 6 | (Name does not matter, since it needs to be referenced by device id 7 | assigned by Linux MIDI subsystem) 8 | 9 | Then, find device id: 10 | 11 | $ aconnect -o 12 | client 14: 'Midi Through' [type=kernel] 13 | 0 'Midi Through Port-0' 14 | client 128: 'RtMidi Input Client' [type=user] 15 | 0 'TestPort ' 16 | 17 | Given the above, open RtMidi: 18 | 19 | $ test.py "RtMidi Input Client 128:0" 1 [v1 | v2] {test name} 20 | 21 | (Select appropriate amp series and optionally run only a single test) 22 | -------------------------------------------------------------------------------- /stomp_models.h: -------------------------------------------------------------------------------- 1 | #ifndef STOMP_MODELS_H 2 | #define STOMP_MODELS_H 3 | 4 | extern const unsigned char null_stomp_id[]; 5 | 6 | extern const unsigned char overdrive_id[]; 7 | extern const unsigned char wah_id[]; 8 | extern const unsigned char touch_wah_id[]; 9 | extern const unsigned char fuzz_id[]; 10 | extern const unsigned char fuzz_twah_id[]; 11 | extern const unsigned char simple_comp_id[]; 12 | extern const unsigned char comp_id[]; 13 | 14 | // v2 only 15 | extern const unsigned char range_boost_id[]; 16 | extern const unsigned char green_box_id[]; 17 | extern const unsigned char orange_box_id[]; 18 | extern const unsigned char black_box_id[]; 19 | extern const unsigned char big_fuzz_id[]; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | # Newer distributions put rtmidi headers in subdirectory 3 | RTMIDI_INC := $(shell ls -d /usr/include/rtmidi 2>/dev/null | tail -n 1) 4 | ifneq (,$(RTMIDI_INC)) 5 | INCDIRS = -I/usr/include/rtmidi 6 | endif 7 | 8 | SRC = $(wildcard *.cpp) 9 | OBJ = $(subst .cpp,.o,$(SRC)) 10 | DEP = $(subst .cpp,.d,$(SRC)) 11 | 12 | # The -M* switches automatically generate .d dependency files 13 | CPPFLAGS += -MP -MMD $(INCDIRS) 14 | 15 | LDLIBS = -lrtmidi -lusb-1.0 -lpthread 16 | 17 | BIN = mustang_midi 18 | 19 | opt: CXXFLAGS += -O3 -DNDEBUG 20 | opt: $(BIN) 21 | 22 | debug: CXXFLAGS += -g -DDEBUG 23 | debug: $(BIN) 24 | 25 | $(BIN): $(OBJ) 26 | $(CXX) $^ -o $@ $(LDLIBS) 27 | 28 | clean: 29 | rm -f $(DEP) $(OBJ) $(BIN) *~ 30 | 31 | -include $(SRC:.cpp=.d) 32 | 33 | -------------------------------------------------------------------------------- /stomp_models.cpp: -------------------------------------------------------------------------------- 1 | #include "stomp_models.h" 2 | 3 | const unsigned char null_stomp_id[] = { 0x00, 0x00 }; 4 | 5 | const unsigned char overdrive_id[] = { 0x3c, 0x00 }; 6 | const unsigned char wah_id[] = { 0x49, 0x00 }; 7 | const unsigned char touch_wah_id[] = { 0x4a, 0x00 }; 8 | const unsigned char fuzz_id[] = { 0x1a, 0x00 }; 9 | const unsigned char fuzz_twah_id[] = { 0x1c, 0x00 }; 10 | const unsigned char simple_comp_id[] = { 0x88, 0x00 }; 11 | const unsigned char comp_id[] = { 0x07, 0x00 }; 12 | 13 | const unsigned char range_boost_id[] = { 0x03, 0x01 }; 14 | const unsigned char green_box_id[] = { 0xba, 0x00 }; 15 | const unsigned char orange_box_id[] = { 0x10, 0x01 }; 16 | const unsigned char black_box_id[] = { 0x11, 0x01 }; 17 | const unsigned char big_fuzz_id[] = { 0x0f, 0x01 }; 18 | 19 | -------------------------------------------------------------------------------- /mod_models.h: -------------------------------------------------------------------------------- 1 | // -*-c++-*- 2 | 3 | #ifndef MOD_MODELS_H 4 | #define MOD_MODELS_H 5 | 6 | extern const unsigned char null_mod_id[]; 7 | 8 | extern const unsigned char sine_chorus_id[]; 9 | extern const unsigned char tri_chorus_id[]; 10 | extern const unsigned char sine_flange_id[]; 11 | extern const unsigned char tri_flange_id[]; 12 | extern const unsigned char vibratone_id[]; 13 | extern const unsigned char vint_trem_id[]; 14 | extern const unsigned char sine_trem_id[]; 15 | extern const unsigned char ring_mod_id[]; 16 | extern const unsigned char step_filt_id[]; 17 | extern const unsigned char phaser_id[]; 18 | extern const unsigned char pitch_shift_id[]; 19 | // v2 only 20 | extern const unsigned char m_wah_id[]; 21 | extern const unsigned char m_touch_wah_id[]; 22 | extern const unsigned char dia_pitch_id[]; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /mod_models.cpp: -------------------------------------------------------------------------------- 1 | #include "mod_models.h" 2 | 3 | const unsigned char null_mod_id[] = { 0x00, 0x00 }; 4 | 5 | const unsigned char sine_chorus_id[] = { 0x12, 0x00 }; 6 | const unsigned char tri_chorus_id[] = { 0x13, 0x00 }; 7 | const unsigned char sine_flange_id[] = { 0x18, 0x00 }; 8 | const unsigned char tri_flange_id[] = { 0x19, 0x00 }; 9 | const unsigned char vibratone_id[] = { 0x2d, 0x00 }; 10 | const unsigned char vint_trem_id[] = { 0x40, 0x00 }; 11 | const unsigned char sine_trem_id[] = { 0x41, 0x00 }; 12 | const unsigned char ring_mod_id[] = { 0x22, 0x00 }; 13 | const unsigned char step_filt_id[] = { 0x29, 0x00 }; 14 | const unsigned char phaser_id[] = { 0x4f, 0x00 }; 15 | 16 | const unsigned char pitch_shift_id[] = { 0x1f, 0x00 }; 17 | const unsigned char m_wah_id[] = { 0xf4, 0x00 }; 18 | const unsigned char m_touch_wah_id[] = { 0xf5, 0x00 }; 19 | const unsigned char dia_pitch_id[] = { 0x1f, 0x10 }; 20 | -------------------------------------------------------------------------------- /amp_models.h: -------------------------------------------------------------------------------- 1 | #ifndef AMP_MODELS_H 2 | #define AMP_MODELS_H 3 | 4 | extern const unsigned char null_amp_id[]; 5 | 6 | extern const unsigned char f57_deluxe_id[]; 7 | extern const unsigned char f59_bassman_id[]; 8 | extern const unsigned char f57_champ_id[]; 9 | extern const unsigned char f65_deluxe_id[]; 10 | extern const unsigned char f65_princeton_id[]; 11 | extern const unsigned char f65_twin_id[]; 12 | extern const unsigned char f_supersonic_id[]; 13 | extern const unsigned char brit_60s_id[]; 14 | extern const unsigned char brit_70s_id[]; 15 | extern const unsigned char brit_80s_id[]; 16 | extern const unsigned char us_90s_id[]; 17 | extern const unsigned char metal_2k_id[]; 18 | 19 | // v2 only 20 | extern const unsigned char studio_preamp_id[]; 21 | extern const unsigned char f57_twin_id[]; 22 | extern const unsigned char s60s_thrift_id[]; 23 | extern const unsigned char brit_watt_id[]; 24 | extern const unsigned char brit_color_id[]; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /mustang_bridge: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | ### BEGIN INIT INFO 3 | # Provides: mustang_bridge 4 | # Required-Start: mountkernfs 5 | # Required-Stop: 6 | # Default-Start: 2 3 4 5 7 | # Default-Stop: 0 1 6 8 | # Short-Description: Setup /var/run/mustang directory 9 | ### END INIT INFO 10 | 11 | 12 | PATH=/sbin:/usr/sbin:/bin:/usr/bin 13 | 14 | . /lib/init/vars.sh 15 | . /lib/lsb/init-functions 16 | 17 | do_start() { 18 | [ -d /var/run/mustang ] || mkdir /var/run/mustang 19 | if [ -z "$(ls -A -- "/var/run/mustang")" ]; then 20 | touch /var/run/mustang/mustang_0000 21 | fi 22 | } 23 | 24 | case "$1" in 25 | start) 26 | do_start 27 | ;; 28 | restart|reload|force-reload) 29 | echo "Error: argument '$1' not supported" >&2 30 | exit 3 31 | ;; 32 | stop|status) 33 | # No-op 34 | exit 0 35 | ;; 36 | *) 37 | echo "Usage: $0 start|stop" >&2 38 | exit 3 39 | ;; 40 | esac 41 | -------------------------------------------------------------------------------- /reverb.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "reverb.h" 3 | #include "magic.h" 4 | 5 | int 6 | ReverbCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) { 7 | cmd[2] = 0x06; 8 | memcpy( cmd + 3, model, 2 ); 9 | cmd[5] = parm5; 10 | cmd[6] = parm6; 11 | cmd[7] = parm7; 12 | 13 | unsigned short magic = magic_values[value]; 14 | cmd[9] = magic & 0xff; 15 | cmd[10] = (magic >> 8) & 0xff; 16 | return 0; 17 | } 18 | 19 | int 20 | ReverbCC::dispatch( int cc, int value, unsigned char *cmd ) { 21 | 22 | switch ( cc ) { 23 | case 59: 24 | // Level 25 | return cc59( value, cmd ); 26 | break; 27 | case 60: 28 | // Decay 29 | return cc60( value, cmd ); 30 | break; 31 | case 61: 32 | // Dwell 33 | return cc61( value, cmd ); 34 | break; 35 | case 62: 36 | // Diffusion 37 | return cc62( value, cmd ); 38 | break; 39 | case 63: 40 | // Tone 41 | return cc63( value, cmd ); 42 | break; 43 | default: 44 | return 0; 45 | break; 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /mustang_bridge_stop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os 4 | from glob import glob 5 | from syslog import syslog 6 | from string import split 7 | import signal 8 | 9 | pid = os.getpid() 10 | # syslog( "%d: Starting" % pid ) 11 | 12 | rundir = "/var/run/mustang/" 13 | 14 | # Check for pid file 15 | os.chdir( rundir ) 16 | filelist = glob( 'mustang_*' ) 17 | 18 | if len( filelist ) == 1: 19 | lockfile = filelist[0] 20 | oldpid = split( lockfile, '_' )[1] 21 | 22 | # See if the process still exists 23 | # syslog( "%d: Check for path /proc/%s" % (pid, oldpid) ) 24 | if os.path.exists( "/proc/%s" % oldpid ): 25 | # syslog( "%d: Sending sigint to pid %s" % (pid, oldpid) ) 26 | try: 27 | os.kill( int(oldpid), signal.SIGINT ) 28 | except Exception, e: 29 | syslog( "%d: Signal failed: %s" % (pid, e) ) 30 | pass 31 | else: 32 | # syslog( "%d: Signal sent" % pid ) 33 | pass 34 | else: 35 | syslog( "%d: /var/run/mustang is not properly setup" % pid ) 36 | -------------------------------------------------------------------------------- /constants.h: -------------------------------------------------------------------------------- 1 | #ifndef CONSTANTS_H 2 | #define CONSTANTS_H 3 | 4 | // USB vendor id 5 | #define FENDER_VID 0x1ed8 6 | 7 | // USB product ids 8 | #define MI_II_V1 0x0004 9 | #define MIII_IV_V_V1 0x0005 10 | #define M_BRONCO_40 0x000a 11 | #define M_MINI 0x0010 12 | #define M_FLOOR 0x0012 13 | #define MI_II_V2 0x0014 14 | #define MIII_IV_V_V2 0x0016 15 | 16 | #define FXSLOT 18 17 | 18 | // Offset to current device model for any state structure 19 | #define MODEL 16 20 | 21 | // Index into current state structure 22 | #define AMP_STATE 0 23 | #define STOMP_STATE 1 24 | #define MOD_STATE 2 25 | #define DELAY_STATE 3 26 | #define REVERB_STATE 4 27 | #define PEDAL_STATE 5 28 | 29 | // Reverb model id values 30 | #define SM_HALL_ID 0x0024 31 | #define LG_HALL_ID 0x003a 32 | #define SM_ROOM_ID 0x0026 33 | #define LG_ROOM_ID 0x003b 34 | #define SM_PLATE_ID 0x004e 35 | #define LG_PLATE_ID 0x004b 36 | #define AMBIENT_ID 0x004c 37 | #define ARENA_ID 0x004d 38 | #define SPRING_63_ID 0x0021 39 | #define SPRING_65_ID 0x000b 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /amp_models.cpp: -------------------------------------------------------------------------------- 1 | #include "amp_models.h" 2 | 3 | const unsigned char null_amp_id[] = { 0x00, 0x00 }; 4 | 5 | const unsigned char f57_deluxe_id[] = { 0x67, 0x00 }; 6 | const unsigned char f59_bassman_id[] = { 0x64, 0x00 }; 7 | const unsigned char f57_champ_id[] = { 0x7c, 0x00 }; 8 | const unsigned char f65_deluxe_id[] = { 0x53, 0x00 }; 9 | const unsigned char f65_princeton_id[] = { 0x6a, 0x00 }; 10 | const unsigned char f65_twin_id[] = { 0x75, 0x00 }; 11 | const unsigned char f_supersonic_id[] = { 0x72, 0x00 }; 12 | const unsigned char brit_60s_id[] = { 0x61, 0x00 }; 13 | const unsigned char brit_70s_id[] = { 0x79, 0x00 }; 14 | const unsigned char brit_80s_id[] = { 0x5e, 0x00 }; 15 | const unsigned char us_90s_id[] = { 0x5d, 0x00 }; 16 | const unsigned char metal_2k_id[] = { 0x6d, 0x00 }; 17 | 18 | // v2 only 19 | const unsigned char studio_preamp_id[] = { 0xf1, 0x00 }; 20 | const unsigned char f57_twin_id[] = { 0xf6, 0x00 }; 21 | const unsigned char s60s_thrift_id[] = { 0xf9, 0x00 }; 22 | const unsigned char brit_watt_id[] = { 0xff, 0x00 }; 23 | const unsigned char brit_color_id[] = { 0xfc, 0x00 }; 24 | 25 | -------------------------------------------------------------------------------- /magic.cpp: -------------------------------------------------------------------------------- 1 | // Magic values for direct conditioning of Mustang analog controls 2 | // 3 | 4 | #include "magic.h" 5 | 6 | unsigned short magic_values[] = { 7 | 0x0000, 0x01e1, 0x036a, 0x04f3, 0x067c, 0x085d, 0x0a69, 0x0fdf, 8 | 0x100b, 0x129a, 0x1555, 0x178d, 0x199a, 0x1af7, 0x1c80, 0x1fbe, 9 | 0x2016, 0x21cb, 0x2354, 0x2486, 0x263b, 0x2873, 0x29fc, 0x2f9e, 10 | 0x30a4, 0x3333, 0x3514, 0x36f4, 0x3826, 0x39db, 0x3b64, 0x3fd4, 11 | 0x402b, 0x41e0, 0x43ed, 0x45f9, 0x47ae, 0x490b, 0x4ac0, 0x4f88, 12 | 0x500b, 0x5217, 0x547b, 0x5604, 0x57e4, 0x5999, 0x5ba6, 0x5fea, 13 | 0x6041, 0x6279, 0x642e, 0x6692, 0x6872, 0x6a53, 0x6c33, 0x6ff5, 14 | 0x7020, 0x7201, 0x7439, 0x7619, 0x7851, 0x79af, 0x7b90, 0x7fff, 15 | 0x8083, 0x8237, 0x8418, 0x8624, 0x8805, 0x898e, 0x8b9a, 0x8f87, 16 | 0x900a, 0x926e, 0x947a, 0x96de, 0x9893, 0x9a1c, 0x9b4e, 0x9f92, 17 | 0xa041, 0xa24d, 0xa42e, 0xa5e3, 0xa7ef, 0xa9d0, 0xab59, 0xaf9d, 18 | 0xb020, 0xb201, 0xb38a, 0xb56a, 0xb74b, 0xb957, 0xbb38, 0xbfff, 19 | 0xc057, 0xc28f, 0xc51e, 0xc72a, 0xc888, 0xca68, 0xcc75, 0xcfb3, 20 | 0xd00a, 0xd168, 0xd2f1, 0xd4a6, 0xd686, 0xd8be, 0xdacb, 0xdfe9, 21 | 0xe041, 0xe221, 0xe3d6, 0xe5e2, 0xe7ef, 0xe978, 0xeb84, 0xeff4, 22 | 0xf077, 0xf40d, 0xf56a, 0xf74b, 0xf9da, 0xfbe6, 0xfe4a, 0xffff 23 | }; 24 | 25 | 26 | -------------------------------------------------------------------------------- /stomp.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stomp.h" 3 | #include "magic.h" 4 | 5 | int 6 | StompCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) { 7 | cmd[2] = 0x03; 8 | memcpy( cmd + 3, model, 2 ); 9 | cmd[5] = parm5; 10 | cmd[6] = parm6; 11 | cmd[7] = parm7; 12 | 13 | unsigned short magic = magic_values[value]; 14 | cmd[9] = magic & 0xff; 15 | cmd[10] = (magic >> 8) & 0xff; 16 | return 0; 17 | } 18 | 19 | int 20 | StompCC::discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) { 21 | cmd[2] = 0x03; 22 | memcpy( cmd + 3, model, 2 ); 23 | cmd[5] = parm5; 24 | cmd[6] = parm6; 25 | cmd[7] = parm7; 26 | 27 | cmd[9] = value; 28 | return 0; 29 | } 30 | 31 | int 32 | StompCC::dispatch( int cc, int value, unsigned char *cmd ) { 33 | 34 | switch ( cc ) { 35 | case 29: 36 | // Level / Mix / Type 37 | return cc29( value, cmd ); 38 | break; 39 | case 30: 40 | // Gain / Freq / Sens / Thresh 41 | return cc30( value, cmd ); 42 | break; 43 | case 31: 44 | // Low / Heel Freq / Octave / Sens / Ratio 45 | return cc31( value, cmd ); 46 | break; 47 | case 32: 48 | // Mid / Toe Freq / Low / Octave / Attack 49 | return cc32( value, cmd ); 50 | break; 51 | case 33: 52 | // High / High Q / Peak / Relase 53 | return cc33( value, cmd ); 54 | break; 55 | default: 56 | return 0; 57 | break; 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /mod.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "mod.h" 3 | #include "magic.h" 4 | 5 | int 6 | ModCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) { 7 | cmd[2] = 0x04; 8 | memcpy( cmd + 3, model, 2 ); 9 | cmd[5] = parm5; 10 | cmd[6] = parm6; 11 | cmd[7] = parm7; 12 | 13 | unsigned short magic = magic_values[value]; 14 | cmd[9] = magic & 0xff; 15 | cmd[10] = (magic >> 8) & 0xff; 16 | return 0; 17 | } 18 | 19 | int 20 | ModCC::discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) { 21 | cmd[2] = 0x04; 22 | memcpy( cmd + 3, model, 2 ); 23 | cmd[5] = parm5; 24 | cmd[6] = parm6; 25 | cmd[7] = parm7; 26 | 27 | cmd[9] = value; 28 | return 0; 29 | } 30 | 31 | int 32 | ModCC::dispatch( int cc, int value, unsigned char *cmd ) { 33 | 34 | switch ( cc ) { 35 | case 39: 36 | // Level / Mix 37 | return cc39( value, cmd ); 38 | break; 39 | case 40: 40 | // Rate / Rotor / Freq / Pitch 41 | return cc40( value, cmd ); 42 | break; 43 | case 41: 44 | // Depth / Duty Cycle / Resonance / Detune / Heel Freq 45 | return cc41( value, cmd ); 46 | break; 47 | case 42: 48 | // Delay / Fdbk / LFO / Min Freq / Feedback / Toe Freq 49 | return cc42( value, cmd ); 50 | break; 51 | case 43: 52 | // LR Phase / Release / Tri Shape / PreDelay / High Q 53 | return cc43( value, cmd ); 54 | break; 55 | default: 56 | return 0; 57 | break; 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BINDIR=/usr/local/bin 4 | INITDIR=/etc/init.d 5 | UDEVDIR=/etc/udev/rules.d 6 | 7 | if [ ! -f "mustang_midi" ]; then 8 | echo "Must build mustang_midi first!" 9 | exit 1 10 | fi 11 | 12 | if ! `grep -q mustang-user /etc/passwd`; then 13 | echo "Create non-privileged user for MIDI bridge" 14 | useradd -M -s /bin/false -G plugdev,audio mustang-user 15 | fi 16 | 17 | echo "Copy program and support scripts to $BINDIR" 18 | 19 | cp -f mustang_bridge_start $BINDIR 20 | chmod 0755 $BINDIR/mustang_bridge_start 21 | chown root:root $BINDIR/mustang_bridge_start 22 | 23 | cp -f mustang_bridge_stop $BINDIR 24 | chmod 0755 $BINDIR/mustang_bridge_stop 25 | chown root:root $BINDIR/mustang_bridge_stop 26 | 27 | cp -f mustang_midi $BINDIR 28 | chmod 0755 $BINDIR/mustang_midi 29 | chown root:root $BINDIR/mustang_midi 30 | 31 | echo "Copy init script to $INITDIR and register" 32 | 33 | cp -f mustang_bridge $INITDIR 34 | chmod 0755 $INITDIR/mustang_bridge 35 | chown root:root $INITDIR/mustang_bridge 36 | update-rc.d mustang_bridge defaults 37 | 38 | # Run it right now to create the /var/run directory 39 | $INITDIR/mustang_bridge start 40 | 41 | echo "Copy udev rules to $UDEVDIR and refresh system" 42 | 43 | cp -f 50-mustang.rules $UDEVDIR 44 | chmod 0644 $UDEVDIR/50-mustang.rules 45 | chown root:root $UDEVDIR/50-mustang.rules 46 | 47 | cp -f 60-midi.rules $UDEVDIR 48 | chmod 0644 $UDEVDIR/60-midi.rules 49 | chown root:root $UDEVDIR/60-midi.rules 50 | 51 | udevadm control --reload 52 | 53 | echo "Done!" 54 | -------------------------------------------------------------------------------- /delay.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "delay.h" 3 | #include "magic.h" 4 | 5 | int 6 | DelayCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) { 7 | cmd[2] = 0x05; 8 | memcpy( cmd + 3, model, 2 ); 9 | cmd[5] = parm5; 10 | cmd[6] = parm6; 11 | cmd[7] = parm7; 12 | 13 | unsigned short magic = magic_values[value]; 14 | cmd[9] = magic & 0xff; 15 | cmd[10] = (magic >> 8) & 0xff; 16 | return 0; 17 | } 18 | 19 | int 20 | DelayCC::discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) { 21 | cmd[2] = 0x05; 22 | memcpy( cmd + 3, model, 2 ); 23 | cmd[5] = parm5; 24 | cmd[6] = parm6; 25 | cmd[7] = parm7; 26 | 27 | cmd[9] = value; 28 | return 0; 29 | } 30 | 31 | int 32 | DelayCC::dispatch( int cc, int value, unsigned char *cmd ) { 33 | 34 | switch ( cc ) { 35 | case 49: 36 | // Level 37 | return cc49( value, cmd ); 38 | break; 39 | case 50: 40 | // Delay Time 41 | return cc50( value, cmd ); 42 | break; 43 | case 51: 44 | // Feedback / FFdbk 45 | return cc51( value, cmd ); 46 | break; 47 | case 52: 48 | // Brightness / Frequency / Release / RFdbk / Flutter 49 | return cc52( value, cmd ); 50 | break; 51 | case 53: 52 | // Attenuation / Resonance / Mode / Stereo / Threshold 53 | // Tone / Brightness / Separation 54 | return cc53( value, cmd ); 55 | break; 56 | case 54: 57 | // Input Level / Stereo / Brightness 58 | return cc54( value, cmd ); 59 | break; 60 | default: 61 | return 0; 62 | break; 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /amp.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "amp.h" 3 | #include "magic.h" 4 | 5 | int 6 | AmpCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) { 7 | cmd[2] = 0x02; 8 | memcpy( cmd + 3, model, 2 ); 9 | cmd[5] = parm5; 10 | cmd[6] = parm6; 11 | cmd[7] = parm7; 12 | 13 | unsigned short magic = magic_values[value]; 14 | cmd[9] = magic & 0xff; 15 | cmd[10] = (magic >> 8) & 0xff; 16 | return 0; 17 | } 18 | 19 | int 20 | AmpCC::discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) { 21 | cmd[2] = 0x02; 22 | memcpy( cmd + 3, model, 2 ); 23 | cmd[5] = parm5; 24 | cmd[6] = parm6; 25 | cmd[7] = parm7; 26 | 27 | cmd[9] = value; 28 | return 0; 29 | } 30 | 31 | int 32 | AmpCC::dispatch( int cc, int value, unsigned char *cmd ) { 33 | 34 | switch( cc ) { 35 | case 69: 36 | // Gain 37 | return cc69( value, cmd ); 38 | break; 39 | case 70: 40 | // Channel volume 41 | return cc70( value, cmd ); 42 | break; 43 | case 71: 44 | // Treble 45 | return cc71( value, cmd ); 46 | break; 47 | case 72: 48 | // Mid 49 | return cc72( value, cmd ); 50 | break; 51 | case 73: 52 | // Bass 53 | return cc73( value, cmd ); 54 | break; 55 | case 74: 56 | // Sag 57 | return cc74( value, cmd ); 58 | break; 59 | case 75: 60 | // Bias 61 | return cc75( value, cmd ); 62 | break; 63 | case 76: 64 | // Noise Gate 65 | return cc76( value, cmd ); 66 | break; 67 | case 77: 68 | // Cabinet 69 | return cc77( value, cmd ); 70 | break; 71 | case 78: 72 | // Presence / Gain2 / Cut 73 | return cc78( value, cmd ); 74 | break; 75 | case 79: 76 | // Blend / Master Volume 77 | return cc79( value, cmd ); 78 | break; 79 | default: 80 | return -1; 81 | break; 82 | } 83 | } 84 | 85 | -------------------------------------------------------------------------------- /reverb.h: -------------------------------------------------------------------------------- 1 | // -*-c++-*- 2 | 3 | #ifndef _REVERB_H 4 | #define _REVERB_H 5 | 6 | #include 7 | 8 | class Mustang; 9 | 10 | class ReverbCC { 11 | 12 | protected: 13 | Mustang * amp; 14 | unsigned char model[2]; 15 | unsigned char slot; 16 | 17 | int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ); 18 | 19 | public: 20 | ReverbCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : 21 | amp(theAmp), 22 | slot(theSlot) 23 | { 24 | memcpy( this->model, model, 2 ); 25 | } 26 | 27 | int dispatch( int cc, int value, unsigned char *cmd ); 28 | const unsigned char *getModel( void ) { return model;} 29 | const unsigned char getSlot( void ) { return slot;} 30 | 31 | private: 32 | // Level 33 | int cc59( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x0b, value, cmd );} 34 | // Decay 35 | int cc60( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x0b, value, cmd );} 36 | // Dwell 37 | int cc61( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x0b, value, cmd );} 38 | // Diffusion 39 | int cc62( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0b, value, cmd );} 40 | // Tone 41 | int cc63( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x0b, value, cmd );} 42 | }; 43 | 44 | 45 | class NullReverbCC : public ReverbCC { 46 | public: 47 | NullReverbCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ReverbCC(theAmp,model,theSlot) {} 48 | private: 49 | int cc59( int value, unsigned char *cmd ) { return -1;} 50 | int cc60( int value, unsigned char *cmd ) { return -1;} 51 | int cc61( int value, unsigned char *cmd ) { return -1;} 52 | int cc62( int value, unsigned char *cmd ) { return -1;} 53 | int cc63( int value, unsigned char *cmd ) { return -1;} 54 | }; 55 | 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /mustang_bridge_start: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os 4 | import sys 5 | from os.path import expanduser 6 | from pwd import getpwnam 7 | from grp import getgrnam 8 | 9 | import glob 10 | import syslog 11 | from string import split 12 | 13 | import usb.core 14 | 15 | rundir = "/var/run/mustang/" 16 | 17 | # Mustang USB parms 18 | mustang_vid = 0x1ed8 19 | mustang_pids = ( 0x0004, 0x0005, 0x000a, 0x0010, 0x0012, 0x0014, 0x0016 ) 20 | 21 | ####### Start User Edits ######### 22 | 23 | # Controller USB parms 24 | control_vid = 0x0763 25 | control_pid = 0x0160 26 | 27 | # Controller MIDI device 28 | midi_device = 1 29 | 30 | # MIDI listen channel 31 | midi_channel = 1 32 | 33 | ######## End User Edits ########## 34 | 35 | # Look for devices 36 | controller = usb.core.find( idVendor = control_vid, idProduct = control_pid ) 37 | if ( not controller ): 38 | sys.exit( 0 ) 39 | 40 | mustang = False 41 | for pid in mustang_pids: 42 | device = usb.core.find( idVendor = mustang_vid, idProduct = pid ) 43 | if ( device ): 44 | mustang = True 45 | break 46 | 47 | if ( not mustang ): 48 | sys.exit( 0 ) 49 | 50 | pid = os.getpid() 51 | # syslog.syslog( "%d: Starting" % pid ) 52 | 53 | # Look for atomic pid file 54 | os.chdir( rundir ) 55 | filelist = glob.glob( 'mustang_*' ) 56 | if len( filelist ) != 1: 57 | syslog.syslog( "%d: /var/run/mustang is not properly setup" % pid ) 58 | sys.exit( 0 ) 59 | 60 | # Found file. Parse out the PID of the process that created it. 61 | lockfile = filelist[0] 62 | oldpid = split( lockfile, '_' )[1] 63 | 64 | # syslog.syslog( "%d: Check for path /proc/%s" % (pid, oldpid) ) 65 | if not os.path.exists( "/proc/%s" % oldpid ): 66 | # No such process, ok to start ours 67 | # syslog.syslog( "%d: Renaming %s to mustang_%d" % (pid, lockfile, pid) ) 68 | try: 69 | os.rename( lockfile, "mustang_%d" % os.getpid() ) 70 | except Exception, e: 71 | pass 72 | # syslog.syslog( "%d: Unable to rename file" % pid ) 73 | else: 74 | # syslog.syslog( "%d: About to exec" % pid ) 75 | # Drop privileges and start the program 76 | pwObj = getpwnam('mustang-user') 77 | os.setgid( pwObj.pw_gid ) 78 | 79 | # Need secondary groups to access MIDI and USB devices 80 | sec_gids = ( getgrnam('plugdev').gr_gid, getgrnam('audio').gr_gid ) 81 | os.setgroups( sec_gids ) 82 | 83 | os.setuid( pwObj.pw_uid ) 84 | os.execl( "/usr/local/bin/mustang_midi", "mustang_midi", "%s" % midi_device, "%s" % midi_channel ) 85 | -------------------------------------------------------------------------------- /mustang.h: -------------------------------------------------------------------------------- 1 | // -*-c++-*- 2 | 3 | #ifndef MUSTANG2_H 4 | #define MUSTANG2_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "constants.h" 11 | 12 | #define USB_IN 0x81 13 | #define USB_OUT 0x01 14 | 15 | #define USB_TIMEOUT_MS 500 16 | 17 | class AmpCC; 18 | class ReverbCC; 19 | class DelayCC; 20 | class ModCC; 21 | class StompCC; 22 | 23 | 24 | class Mustang { 25 | 26 | // Pre-built 'execute' command 27 | unsigned char execute[64]; 28 | 29 | libusb_device_handle *usb_io; 30 | 31 | // USB listen thread 32 | pthread_t worker; 33 | 34 | // Shutdown request flag 35 | pthread_mutex_t shutdown_lock = PTHREAD_MUTEX_INITIALIZER; 36 | bool want_shutdown; 37 | 38 | template 39 | class Condition { 40 | public: 41 | pthread_mutex_t lock; 42 | pthread_cond_t cond; 43 | T value; 44 | Condition( void ) { 45 | pthread_mutex_init( &(lock), NULL); 46 | pthread_cond_init( &(cond), NULL); 47 | } 48 | }; 49 | 50 | // Identify patch-change ack / DSP parm update 51 | static const unsigned char state_prefix[]; 52 | 53 | // Received {0x1c, 0x01, 0x00, ...} 54 | // --> End of preset select acknowledge stream 55 | Condition pc_ack_sync; 56 | 57 | // Synchronize access to preset names 58 | Condition preset_names_sync; 59 | 60 | // 0-99 = amp preset, 100-111 = mod preset, 112-123 = rev/delay preset 61 | char preset_names[124][33]; 62 | 63 | // Index to current amp preset 64 | unsigned curr_preset_idx; 65 | 66 | // Manage access to each DSP data block and/or associated object. 67 | Condition dsp_sync[6]; 68 | unsigned char dsp_parms[6][64]; 69 | 70 | // Manage data and behavior for specific DSP models 71 | AmpCC * curr_amp; 72 | StompCC * curr_stomp; 73 | ModCC * curr_mod; 74 | DelayCC * curr_delay; 75 | ReverbCC * curr_reverb; 76 | 77 | // Synchronize on end of parm dump 78 | Condition parm_read_sync; 79 | static const unsigned char parm_read_ack[]; 80 | 81 | // Synchronize on receipt of direct control acknowledge 82 | Condition cc_ack_sync; 83 | static const unsigned char cc_ack[]; 84 | 85 | // Received {0x00, 0x00, 0x19, ... } 86 | // --> Acknowledge efx on/off toggle 87 | Condition efx_toggle_sync; 88 | static const unsigned char efx_toggle_ack[]; 89 | 90 | // Synchronize on receipt of model change acknowledge 91 | Condition model_change_sync; 92 | static const unsigned char model_change_ack[]; 93 | 94 | // Sync on tuner on/off ack 95 | Condition tuner_ack_sync; 96 | static const unsigned char tuner_ack[]; 97 | 98 | // Attached device probe structure 99 | struct usb_id { 100 | // product id 101 | int pid; 102 | // magic value for init packet 103 | int init_value; 104 | // v2? 105 | bool isV2; 106 | }; 107 | 108 | static const usb_id amp_ids[]; 109 | bool isV2; 110 | 111 | static void *threadStarter( void * ); 112 | void handleInput( void ); 113 | 114 | int direct_control( unsigned char *cmd ); 115 | 116 | int sendCmd( unsigned char *buffer ); 117 | int requestDump( void ); 118 | int executeModelChange( unsigned char *buffer ); 119 | 120 | void updateAmpObj( const unsigned char *data ); 121 | void updateStompObj( const unsigned char *data ); 122 | void updateReverbObj( const unsigned char *data ); 123 | void updateDelayObj( const unsigned char *data ); 124 | void updateModObj( const unsigned char *data ); 125 | 126 | int checkOrDisableTuner( void ); 127 | 128 | // Check for equality of 2-byte values 129 | inline bool match16(const unsigned char *a, const unsigned char *b) { 130 | return ( 0==memcmp(a,b,2) ); 131 | } 132 | 133 | public: 134 | Mustang( void ); 135 | 136 | int initialize( void ); 137 | int deinitialize( void ); 138 | 139 | int commStart( void ); 140 | int commShutdown( void ); 141 | 142 | int setAmp( int ord ); 143 | int ampControl( int cc, int value ); 144 | 145 | int setStomp( int ord ); 146 | int stompControl( int cc, int value ); 147 | 148 | int setMod( int ord ); 149 | int modControl( int cc, int value ); 150 | 151 | int setDelay( int ord ); 152 | int delayControl( int cc, int value ); 153 | 154 | int setReverb( int ord ); 155 | int reverbControl( int cc, int value ); 156 | 157 | int tunerMode( int value ); 158 | 159 | int patchChange( int ); 160 | 161 | int effectToggle( int cc, int value ); 162 | }; 163 | 164 | 165 | #endif 166 | -------------------------------------------------------------------------------- /delay_defaults.h: -------------------------------------------------------------------------------- 1 | // Default settings for Mustang III (original) delay models 2 | // 3 | // This header is auto-generated from decoded pcap capture. 4 | 5 | static unsigned char delay_none[] = { 6 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 10 | }; 11 | 12 | static unsigned char mono_delay[] = { 13 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x16, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 15 | 0xff, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 16 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 17 | }; 18 | 19 | static unsigned char mono_echo_filter[] = { 20 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x43, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0xff, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 24 | }; 25 | 26 | static unsigned char stereo_echo_filter[] = { 27 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x48, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x80, 0xb3, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 31 | }; 32 | 33 | static unsigned char multitap_delay[] = { 34 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x44, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0xff, 0x80, 0x66, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 38 | }; 39 | 40 | static unsigned char ping_pong_delay[] = { 41 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x45, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0xff, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 45 | }; 46 | 47 | static unsigned char ducking_delay[] = { 48 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x15, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0xff, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 52 | }; 53 | 54 | static unsigned char reverse_delay[] = { 55 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x46, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0xff, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 59 | }; 60 | 61 | static unsigned char tape_delay[] = { 62 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x2b, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x7d, 0x1c, 0x00, 0x63, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 66 | }; 67 | 68 | static unsigned char stereo_tape_delay[] = { 69 | 0x1c, 0x03, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x2a, 0x00, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x7d, 0x88, 0x1c, 0x63, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 73 | }; 74 | 75 | -------------------------------------------------------------------------------- /reverb_defaults.h: -------------------------------------------------------------------------------- 1 | // Default settings for Mustang III (original) reverb models 2 | // 3 | // This header is auto-generated from decoded pcap capture. 4 | 5 | static unsigned char reverb_none[] = { 6 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 10 | }; 11 | 12 | static unsigned char small_hall[] = { 13 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x24, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 15 | 0x6e, 0x5d, 0x6e, 0x80, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 16 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 17 | }; 18 | 19 | static unsigned char large_hall[] = { 20 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x3a, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0x4f, 0x3e, 0x80, 0x05, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 24 | }; 25 | 26 | static unsigned char small_room[] = { 27 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x26, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 31 | }; 32 | 33 | static unsigned char large_room[] = { 34 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x3b, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 38 | }; 39 | 40 | static unsigned char small_plate[] = { 41 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x4e, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 45 | }; 46 | 47 | static unsigned char large_plate[] = { 48 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x4b, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x38, 0x80, 0x91, 0x80, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 52 | }; 53 | 54 | static unsigned char ambient[] = { 55 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x4c, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0xff, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 59 | }; 60 | 61 | static unsigned char arena[] = { 62 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x4d, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0xff, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 66 | }; 67 | 68 | static unsigned char spring_63[] = { 69 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x21, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 73 | }; 74 | 75 | static unsigned char spring_65[] = { 76 | 0x1c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x0b, 0x00, 0x05, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x80, 0x8b, 0x49, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 80 | }; 81 | 82 | -------------------------------------------------------------------------------- /mustang_midi.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "mustang.h" 8 | 9 | // If you see a compiler error complaining about a missing 10 | // symbol 'RtMidiError' you probably have an old version of 11 | // of the library and will need to build with this flag: 12 | // $ make CPPFLAGS=-DRTMIDI_2_0 13 | // 14 | 15 | #ifdef RTMIDI_2_0 16 | # define RT_ERROR RtError 17 | #else 18 | # define RT_ERROR RtMidiError 19 | #endif 20 | 21 | static Mustang mustang; 22 | 23 | static int channel; 24 | 25 | 26 | void message_action( double deltatime, std::vector< unsigned char > *message, void *userData ) { 27 | #if 0 28 | unsigned int nBytes = message->size(); 29 | if ( nBytes == 2 ) fprintf( stdout, "%02x %d\n", (int)message->at(0), (int)message->at(1) ); 30 | else if ( nBytes == 3 ) fprintf( stdout, "%02x %d %d\n", (int)message->at(0), (int)message->at(1), (int)message->at(2) ); 31 | #endif 32 | 33 | // Is this for us? 34 | int msg_channel = (*message)[0] & 0x0f; 35 | if ( msg_channel != channel ) return; 36 | 37 | int msg_type = (*message)[0] & 0xf0; 38 | 39 | switch ( msg_type ) { 40 | 41 | case 0xc0: { 42 | // Program change 43 | int bank = (int)(*message)[1]; 44 | int rc = mustang.patchChange( bank ); 45 | if ( rc ) { 46 | fprintf( stderr, "Error: PC#%d failed. RC = %d\n", bank, rc ); 47 | } 48 | } 49 | break; 50 | 51 | case 0xb0: { 52 | // Control change 53 | int rc = 0; 54 | int cc = (*message)[1]; 55 | int value = (*message)[2]; 56 | 57 | // Tuner toggle 58 | if ( cc == 20 ) { 59 | rc = mustang.tunerMode( value ); 60 | } 61 | // All EFX toggle 62 | else if ( cc == 22 ) { 63 | rc = mustang.effectToggle( 23, value ); 64 | if ( rc == 0 ) { 65 | rc = mustang.effectToggle( 24, value ); 66 | if ( rc == 0 ) { 67 | rc = mustang.effectToggle( 25, value ); 68 | if ( rc == 0 ) { 69 | rc = mustang.effectToggle( 26, value ); 70 | } 71 | } 72 | } 73 | } 74 | // Effects on/off 75 | else if ( cc >= 23 && cc <= 26 ) { 76 | rc = mustang.effectToggle( cc, value ); 77 | } 78 | // Set stomp model 79 | else if ( cc == 28 ) { 80 | rc = mustang.setStomp( value ); 81 | } 82 | // Stomp CC handler 83 | else if ( cc >= 29 && cc <= 33 ) { 84 | rc = mustang.stompControl( cc, value ); 85 | } 86 | // Set mod model 87 | else if ( cc == 38 ) { 88 | rc = mustang.setMod( value ); 89 | } 90 | // Mod CC handler 91 | else if ( cc >= 39 && cc <= 43 ) { 92 | rc = mustang.modControl( cc, value ); 93 | } 94 | // Set delay model 95 | else if ( cc == 48 ) { 96 | rc = mustang.setDelay( value ); 97 | } 98 | // Delay CC handler 99 | else if ( cc >= 49 && cc <= 54 ) { 100 | rc = mustang.delayControl( cc, value ); 101 | } 102 | // Set reverb model 103 | else if ( cc == 58 ) { 104 | rc = mustang.setReverb( value ); 105 | } 106 | // Reverb CC handler 107 | else if ( cc >= 59 && cc <= 63 ) { 108 | rc = mustang.reverbControl( cc, value ); 109 | } 110 | // Set amp model 111 | else if ( cc == 68 ) { 112 | rc = mustang.setAmp( value ); 113 | } 114 | // Amp CC Handler 115 | else if ( cc >= 69 && cc <= 79 ) { 116 | rc = mustang.ampControl( cc, value ); 117 | } 118 | if ( rc ) { 119 | fprintf( stderr, "Error: CC#%d failed. RC = %d\n", cc, rc ); 120 | } 121 | } 122 | break; 123 | 124 | default: 125 | break; 126 | } 127 | 128 | } 129 | 130 | 131 | void usage() { 132 | const char msg[] = 133 | "Usage: mustang_midi \n" 134 | " mustang_midi \n\n" 135 | 136 | " port = 0..n, channel = 1..16\n"; 137 | 138 | fprintf( stderr, msg ); 139 | exit( 1 ); 140 | } 141 | 142 | 143 | int main( int argc, const char **argv ) { 144 | if ( argc != 3 ) usage(); 145 | 146 | RtMidiIn input_handler; 147 | 148 | char *endptr; 149 | 150 | int port = (int) strtol( argv[1], &endptr, 10 ); 151 | if ( endptr == argv[0] ) { 152 | try { 153 | input_handler.openVirtualPort( argv[2] ); 154 | } 155 | catch ( RT_ERROR &error ) { 156 | exit( 1 ); 157 | } 158 | } 159 | else { 160 | if ( port < 0 ) usage(); 161 | try { 162 | input_handler.openPort( port ); 163 | } 164 | catch ( RT_ERROR &error ) { 165 | exit( 1 ); 166 | } 167 | } 168 | 169 | channel = (int) strtol( argv[2], &endptr, 10 ) - 1; 170 | if ( endptr == argv[0] ) usage(); 171 | if ( channel < 0 || channel > 15 ) usage(); 172 | 173 | input_handler.setCallback( &message_action ); 174 | 175 | // Don't want sysex, timing, active sense 176 | input_handler.ignoreTypes( true, true, true ); 177 | 178 | if ( 0 != mustang.initialize() ) { 179 | fprintf( stderr, "Cannot setup USB communication\n" ); 180 | exit( 1 ); 181 | } 182 | if ( 0 != mustang.commStart() ) { 183 | fprintf( stderr, "Thread setup and init failed\n" ); 184 | exit( 1 ); 185 | } 186 | 187 | // Block and wait for signal 188 | pause(); 189 | 190 | if ( 0 != mustang.commShutdown() ) { 191 | fprintf( stderr, "Thread shutdown failed\n" ); 192 | exit( 1 ); 193 | } 194 | if ( 0 != mustang.deinitialize() ) { 195 | fprintf( stderr, "USB shutdown failed\n" ); 196 | exit( 1 ); 197 | } 198 | 199 | // delete input_handler; 200 | return 0; 201 | 202 | } 203 | -------------------------------------------------------------------------------- /stomp_defaults.h: -------------------------------------------------------------------------------- 1 | static unsigned char stomp_none[] = { 2 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 3 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 6 | }; 7 | 8 | static unsigned char overdrive[] = { 9 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x3c, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 13 | }; 14 | 15 | static unsigned char wah[] = { 16 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 17 | 0x49, 0x00, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 18 | 0xff, 0x80, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 20 | }; 21 | 22 | static unsigned char touch_wah[] = { 23 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 24 | 0x4a, 0x00, 0x00, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0xff, 0x80, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 27 | }; 28 | 29 | static unsigned char fuzz[] = { 30 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x1a, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 34 | }; 35 | 36 | // Fuzz Touch Wah in original only! 37 | 38 | static unsigned char fuzz_touch_wah[] = { 39 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x1c, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 43 | }; 44 | 45 | static unsigned char simple_comp[] = { 46 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x88, 0x00, 0x00, 0x08, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 50 | }; 51 | 52 | static unsigned char compressor[] = { 53 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x07, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x8d, 0x0f, 0x4f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 57 | }; 58 | 59 | // V2 Only: 60 | 61 | static unsigned char ranger_boost[] = { 62 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x03, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x64, 0xba, 0x01, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 66 | }; 67 | 68 | static unsigned char green_box[] = { 69 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0xba, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x81, 0xb1, 0x8c, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 73 | }; 74 | 75 | static unsigned char orange_box[] = { 76 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x10, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 80 | }; 81 | 82 | static unsigned char black_box[] = { 83 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 84 | 0x11, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 85 | 0x81, 0x81, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 87 | }; 88 | 89 | static unsigned char big_fuzz[] = { 90 | 0x1c, 0x03, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 91 | 0x0f, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 92 | 0xac, 0xac, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 93 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 94 | }; 95 | 96 | -------------------------------------------------------------------------------- /mod_defaults.h: -------------------------------------------------------------------------------- 1 | static unsigned char mod_none[] = { 2 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 3 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 6 | }; 7 | 8 | static unsigned char sine_chorus[] = { 9 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x12, 0x00, 0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0xff, 0x0e, 0x19, 0x19, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 13 | }; 14 | 15 | static unsigned char triangle_chorus[] = { 16 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 17 | 0x13, 0x00, 0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 18 | 0x5d, 0x0e, 0x19, 0x19, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 20 | }; 21 | 22 | static unsigned char sine_flanger[] = { 23 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 24 | 0x18, 0x00, 0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0xff, 0x0e, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 27 | }; 28 | 29 | static unsigned char triangle_flanger[] = { 30 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x19, 0x00, 0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0xff, 0x00, 0xff, 0x33, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 34 | }; 35 | 36 | static unsigned char vibratone[] = { 37 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x2d, 0x00, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0xf4, 0xff, 0x27, 0xad, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 41 | }; 42 | 43 | static unsigned char vintage_tremolo[] = { 44 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x40, 0x00, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0xdb, 0xad, 0x63, 0xf4, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 48 | }; 49 | 50 | static unsigned char sine_tremolo[] = { 51 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x41, 0x00, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0xdb, 0x99, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 55 | }; 56 | 57 | static unsigned char ring_modulator[] = { 58 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x22, 0x00, 0x04, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0xff, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 62 | }; 63 | 64 | static unsigned char step_filter[] = { 65 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x29, 0x00, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0xff, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 69 | }; 70 | 71 | static unsigned char phaser[] = { 72 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x4f, 0x00, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0xfd, 0x00, 0xfd, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 76 | }; 77 | 78 | static unsigned char pitch_shifter[] = { 79 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 80 | 0x1f, 0x00, 0x04, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 81 | 0xc7, 0x3e, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 82 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 83 | }; 84 | 85 | // V2 Only: 86 | 87 | static unsigned char mod_wah[] = { 88 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 89 | 0xf4, 0x00, 0x04, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 90 | 0xff, 0x81, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 91 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 92 | }; 93 | 94 | static unsigned char mod_touch_wah[] = { 95 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 96 | 0xf5, 0x00, 0x04, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 97 | 0xed, 0x81, 0x07, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 98 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 99 | }; 100 | 101 | static unsigned char diatonic_pitch_shift[] = { 102 | 0x1c, 0x03, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 103 | 0x1f, 0x10, 0x04, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 104 | 0x56, 0x09, 0x04, 0x05, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 105 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 106 | }; 107 | 108 | -------------------------------------------------------------------------------- /delay.h: -------------------------------------------------------------------------------- 1 | // -*-c++-*- 2 | 3 | #ifndef _DELAY_H 4 | #define _DELAY_H 5 | 6 | #include 7 | 8 | class Mustang; 9 | 10 | class DelayCC { 11 | 12 | protected: 13 | Mustang * amp; 14 | unsigned char model[2]; 15 | unsigned char slot; 16 | 17 | int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ); 18 | int discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ); 19 | 20 | public: 21 | DelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : 22 | amp(theAmp), 23 | slot(theSlot) 24 | { 25 | memcpy( this->model, model, 2 ); 26 | } 27 | 28 | int dispatch( int cc, int value, unsigned char *cmd ); 29 | const unsigned char *getModel( void ) { return model;} 30 | const unsigned char getSlot( void ) { return slot;} 31 | 32 | private: 33 | // Level 34 | virtual int cc49( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 35 | // Delay Time 36 | virtual int cc50( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x06, value, cmd );} 37 | 38 | virtual int cc51( int value, unsigned char *cmd ) = 0; 39 | virtual int cc52( int value, unsigned char *cmd ) = 0; 40 | virtual int cc53( int value, unsigned char *cmd ) = 0; 41 | virtual int cc54( int value, unsigned char *cmd ) = 0; 42 | }; 43 | 44 | 45 | class MonoDelayCC : public DelayCC { 46 | public: 47 | MonoDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {} 48 | private: 49 | // Feedback 50 | virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 51 | // Brightness 52 | virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 53 | // Attenuation 54 | virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 55 | // no-op 56 | virtual int cc54( int value, unsigned char *cmd ) { return -1;} 57 | }; 58 | 59 | 60 | class EchoFilterCC : public DelayCC { 61 | public: 62 | EchoFilterCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {} 63 | private: 64 | // Feedback 65 | virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 66 | // Frequency 67 | virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 68 | // Resonance 69 | virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 70 | // Input Level 71 | virtual int cc54( int value, unsigned char *cmd ) { return continuous_control( 0x05, 0x05, 0x01, value, cmd );} 72 | }; 73 | 74 | 75 | class MultitapDelayCC : public DelayCC { 76 | public: 77 | MultitapDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {} 78 | private: 79 | // Delay Time 80 | virtual int cc50( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x08, value, cmd );} 81 | // Feedback 82 | virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 83 | // Brightness 84 | virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 85 | // Mode 86 | virtual int cc53( int value, unsigned char *cmd ) { 87 | if ( value > 3 ) return -1; 88 | else return discrete_control( 0x04, 0x04, 0x8b, value, cmd ); 89 | } 90 | // no-op 91 | virtual int cc54( int value, unsigned char *cmd ) { return -1;} 92 | }; 93 | 94 | 95 | class PingPongDelayCC : public DelayCC { 96 | public: 97 | PingPongDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {} 98 | private: 99 | // Feedback 100 | virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 101 | // Brightness 102 | virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 103 | // Stereo 104 | virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 105 | // no-op 106 | virtual int cc54( int value, unsigned char *cmd ) { return -1;} 107 | }; 108 | 109 | 110 | class DuckingDelayCC : public DelayCC { 111 | public: 112 | DuckingDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {} 113 | private: 114 | // Feedback 115 | virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 116 | // Release 117 | virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 118 | // Threshold 119 | virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 120 | // no-op 121 | virtual int cc54( int value, unsigned char *cmd ) { return -1;} 122 | }; 123 | 124 | 125 | class ReverseDelayCC : public DelayCC { 126 | public: 127 | ReverseDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {} 128 | private: 129 | // FFdbk 130 | virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 131 | // RFdbk 132 | virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 133 | // Tone 134 | virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 135 | // no-op 136 | virtual int cc54( int value, unsigned char *cmd ) { return -1;} 137 | }; 138 | 139 | 140 | class TapeDelayCC : public DelayCC { 141 | public: 142 | TapeDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {} 143 | private: 144 | // Feedback 145 | virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 146 | // Flutter 147 | virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 148 | // Brightness 149 | virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 150 | // Stereo 151 | virtual int cc54( int value, unsigned char *cmd ) { return continuous_control( 0x05, 0x05, 0x01, value, cmd );} 152 | }; 153 | 154 | 155 | class StereoTapeDelayCC : public DelayCC { 156 | public: 157 | StereoTapeDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {} 158 | private: 159 | // Feedback 160 | virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 161 | // Flutter 162 | virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 163 | // Separation 164 | virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x05, 0x01, value, cmd );} 165 | // Brightness 166 | virtual int cc54( int value, unsigned char *cmd ) { return continuous_control( 0x05, 0x04, 0x01, value, cmd );} 167 | }; 168 | 169 | 170 | class NullDelayCC : public DelayCC { 171 | public: 172 | NullDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {} 173 | private: 174 | virtual int cc49( int value, unsigned char *cmd ) { return -1;} 175 | virtual int cc50( int value, unsigned char *cmd ) { return -1;} 176 | virtual int cc51( int value, unsigned char *cmd ) { return -1;} 177 | virtual int cc52( int value, unsigned char *cmd ) { return -1;} 178 | virtual int cc53( int value, unsigned char *cmd ) { return -1;} 179 | virtual int cc54( int value, unsigned char *cmd ) { return -1;} 180 | }; 181 | 182 | 183 | #endif 184 | -------------------------------------------------------------------------------- /amp.h: -------------------------------------------------------------------------------- 1 | // -*-c++-*- 2 | 3 | #ifndef _AMPCC_H 4 | #define _AMPCC_H 5 | 6 | #include 7 | 8 | class Mustang; 9 | 10 | // F57 Deluxe 11 | // F57 Champ 12 | // F65 Deluxe 13 | // F65 Princeton 14 | // 60s Thrift 15 | // 16 | class AmpCC { 17 | 18 | protected: 19 | Mustang * amp; 20 | unsigned char model[2]; 21 | unsigned char slot; 22 | 23 | int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ); 24 | int discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ); 25 | 26 | public: 27 | AmpCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : 28 | amp(theAmp), 29 | slot(theSlot) 30 | { 31 | memcpy( this->model, model, 2 ); 32 | } 33 | 34 | int dispatch( int cc, int value, unsigned char *cmd ); 35 | const unsigned char *getModel( void ) { return model;} 36 | const unsigned char getSlot( void ) { return slot;} 37 | 38 | private: 39 | // Gain 40 | virtual int cc69( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x0c, value, cmd );} 41 | // Ch. Volume 42 | virtual int cc70( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x0c, value, cmd );} 43 | // Treble 44 | virtual int cc71( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x0c, value, cmd );} 45 | // Mid 46 | virtual int cc72( int value, unsigned char *cmd ) { return continuous_control( 0x05, 0x05, 0x0c, value, cmd );} 47 | // Bass 48 | virtual int cc73( int value, unsigned char *cmd ) { return continuous_control( 0x06, 0x06, 0x0c, value, cmd );} 49 | // Sag 50 | virtual int cc74( int value, unsigned char *cmd ) { 51 | if ( value <= 2 ) return discrete_control( 0x13, 0x13, 0x8f, value, cmd ); 52 | else return -1; 53 | } 54 | // Bias 55 | virtual int cc75( int value, unsigned char *cmd ) { return continuous_control( 0x0a, 0x0a, 0x0d, value, cmd );} 56 | // Noise Gate 57 | virtual int cc76( int value, unsigned char *cmd ) { 58 | if ( value <= 4 ) return discrete_control( 0x0f, 0x0f, 0x90, value, cmd ); 59 | else return -1; 60 | } 61 | // Cabinet 62 | virtual int cc77( int value, unsigned char *cmd ) { 63 | if ( value <= 12 ) return discrete_control( 0x11, 0x11, 0x8e, value, cmd ); 64 | else return -1; 65 | } 66 | 67 | // Dummy in base class 68 | virtual int cc78( int value, unsigned char *cmd ) { return -1;} 69 | virtual int cc79( int value, unsigned char *cmd ) { return -1;} 70 | 71 | // Noise Gate Custom Threshold 72 | virtual int cc90( int value, unsigned char *cmd ) { 73 | if ( value <= 9 ) return discrete_control( 0x10, 0x10, 0x86, value, cmd ); 74 | else return -1; 75 | } 76 | // Noise Gate Custom Depth 77 | virtual int cc91( int value, unsigned char *cmd ) { return continuous_control( 0x09, 0x09, 0x0c, value, cmd );} 78 | // Dummy in base class 79 | virtual int cc92( int value, unsigned char *cmd ) { return -1;} 80 | }; 81 | 82 | 83 | // F59 Bassman 84 | // British 70s 85 | // 86 | class AmpCC1 : public AmpCC { 87 | public: 88 | AmpCC1( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {} 89 | private: 90 | // Presence 91 | virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x07, 0x07, 0x0c, value, cmd );} 92 | // Blend 93 | virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x0c, value, cmd );} 94 | }; 95 | 96 | 97 | // Fender Supersonic 98 | // 99 | class AmpCC2 : public AmpCC { 100 | public: 101 | AmpCC2( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {} 102 | private: 103 | // Gain2 104 | virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x0c, value, cmd );} 105 | // Master Volume 106 | virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0c, value, cmd );} 107 | }; 108 | 109 | 110 | // British 60s 111 | // 112 | class AmpCC3 : public AmpCC { 113 | public: 114 | AmpCC3( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {} 115 | private: 116 | // Cut 117 | virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x07, 0x07, 0x0c, value, cmd );} 118 | // Master Volume 119 | virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0c, value, cmd );} 120 | // Bright Switch 121 | virtual int cc92( int value, unsigned char *cmd ) { 122 | // Inverted logic 123 | unsigned char flag; 124 | // 0 --> Bright On 125 | if ( value>63 && value <=127 ) flag = 0; 126 | else flag = 1; 127 | return discrete_control( 0x14, 0x14, 0x8d, value, cmd ); 128 | } 129 | }; 130 | 131 | 132 | // British 80s 133 | // American 90s 134 | // Metal 2000 135 | // British Watt 136 | // 137 | class AmpCC4 : public AmpCC { 138 | public: 139 | AmpCC4( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {} 140 | private: 141 | // Presence 142 | virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x07, 0x07, 0x0c, value, cmd );} 143 | // Master Volume 144 | virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0c, value, cmd );} 145 | }; 146 | 147 | 148 | // Studio Preamp 149 | // 150 | class AmpCC5 : public AmpCC { 151 | public: 152 | AmpCC5( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {} 153 | private: 154 | // No sag / bias 155 | virtual int cc74( int value, unsigned char *cmd ) { return -1;} 156 | virtual int cc75( int value, unsigned char *cmd ) { return -1;} 157 | // No pres / master 158 | virtual int cc78( int value, unsigned char *cmd ) { return -1;} 159 | virtual int cc79( int value, unsigned char *cmd ) { return -1;} 160 | }; 161 | 162 | 163 | // British Color 164 | // 165 | class AmpCC6 : public AmpCC { 166 | public: 167 | AmpCC6( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {;} 168 | private: 169 | // Master Volume 170 | virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0c, value, cmd );} 171 | }; 172 | 173 | 174 | // F57 Twin 175 | // 176 | class AmpCC7 : public AmpCC { 177 | public: 178 | AmpCC7( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {} 179 | private: 180 | // Presence 181 | virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x07, 0x07, 0x0c, value, cmd );} 182 | }; 183 | 184 | 185 | // F65 Twin 186 | // 187 | class AmpCC8 : public AmpCC { 188 | public: 189 | AmpCC8( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {} 190 | private: 191 | // Bright Switch 192 | virtual int cc92( int value, unsigned char *cmd ) { 193 | // Inverted logic 194 | unsigned char flag; 195 | // 0 --> Bright On 196 | if ( value>63 && value <=127 ) flag = 0; 197 | else flag = 1; 198 | return discrete_control( 0x14, 0x14, 0x8d, value, cmd ); 199 | } 200 | }; 201 | 202 | 203 | // Null Amp 204 | // 205 | class NullAmpCC : public AmpCC { 206 | public: 207 | NullAmpCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {} 208 | private: 209 | virtual int cc69( int value, unsigned char *cmd ) { return -1;} 210 | virtual int cc70( int value, unsigned char *cmd ) { return -1;} 211 | virtual int cc71( int value, unsigned char *cmd ) { return -1;} 212 | virtual int cc72( int value, unsigned char *cmd ) { return -1;} 213 | virtual int cc73( int value, unsigned char *cmd ) { return -1;} 214 | virtual int cc74( int value, unsigned char *cmd ) { return -1;} 215 | virtual int cc75( int value, unsigned char *cmd ) { return -1;} 216 | virtual int cc76( int value, unsigned char *cmd ) { return -1;} 217 | virtual int cc77( int value, unsigned char *cmd ) { return -1;} 218 | virtual int cc78( int value, unsigned char *cmd ) { return -1;} 219 | virtual int cc79( int value, unsigned char *cmd ) { return -1;} 220 | }; 221 | 222 | #endif 223 | -------------------------------------------------------------------------------- /amp_defaults.h: -------------------------------------------------------------------------------- 1 | // Default settings for Mustang III (original) amp models 2 | // 3 | // This header is auto-generated from decoded pcap capture. 4 | 5 | static unsigned char amp_none[] = { 6 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 10 | }; 11 | 12 | static unsigned char f57_deluxe[] = { 13 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 15 | 0xaa, 0x99, 0x80, 0x80, 0xbe, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01, 0x01, 0x01, 0x00, 16 | 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 17 | }; 18 | 19 | static unsigned char f59_bassman[] = { 20 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0xaa, 0xa2, 0x80, 0x80, 0x80, 0x7a, 0xa2, 0x91, 0x80, 0x80, 0x80, 0x80, 0x02, 0x02, 0x02, 0x00, 23 | 0x00, 0x02, 0x02, 0x01, 0x00, 0x01, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 24 | }; 25 | 26 | static unsigned char f57_champ[] = { 27 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0xaa, 0xb3, 0x00, 0xff, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0c, 0x0c, 0x0c, 0x00, 30 | 0x00, 0x05, 0x0c, 0x01, 0x00, 0x01, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 31 | }; 32 | 33 | static unsigned char f65_deluxe[] = { 34 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0xaa, 0x71, 0x00, 0xff, 0x91, 0xcf, 0x38, 0x00, 0x00, 0x00, 0x80, 0x00, 0x03, 0x03, 0x03, 0x00, 37 | 0x00, 0x03, 0x03, 0x01, 0x00, 0x01, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 38 | }; 39 | 40 | static unsigned char f65_princeton[] = { 41 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x6a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0xaa, 0x55, 0x00, 0xff, 0x99, 0xcc, 0x4c, 0x80, 0x80, 0x80, 0x80, 0x80, 0x04, 0x04, 0x04, 0x00, 44 | 0x00, 0x04, 0x04, 0x01, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 45 | }; 46 | 47 | static unsigned char f65_twin[] = { 48 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0xaa, 0x55, 0x80, 0x63, 0xb3, 0xbb, 0xaa, 0x80, 0x80, 0x80, 0x80, 0x80, 0x05, 0x05, 0x05, 0x00, 51 | 0x00, 0x09, 0x05, 0x01, 0x00, 0x01, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 52 | }; 53 | 54 | static unsigned char f_supersonic[] = { 55 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0xaa, 0xbb, 0x82, 0x55, 0x99, 0xa2, 0x99, 0x80, 0x80, 0x80, 0x80, 0x80, 0x06, 0x06, 0x06, 0x02, 58 | 0x00, 0x0c, 0x06, 0x01, 0x00, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 59 | }; 60 | 61 | static unsigned char brit_60[] = { 62 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0xaa, 0xa2, 0x80, 0x63, 0x99, 0x80, 0xb0, 0x00, 0x80, 0x80, 0x80, 0x80, 0x07, 0x07, 0x07, 0x00, 65 | 0x00, 0x07, 0x07, 0x01, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 66 | }; 67 | 68 | static unsigned char brit_70[] = { 69 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0xaa, 0xff, 0x80, 0x7d, 0xaa, 0x5b, 0xc4, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0b, 0x0b, 0x0b, 0x01, 72 | 0x00, 0x08, 0x0b, 0x01, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 73 | }; 74 | 75 | static unsigned char brit_80[] = { 76 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0xaa, 0xff, 0x80, 0x7d, 0xaa, 0x5b, 0xc4, 0x80, 0x80, 0x80, 0x80, 0x80, 0x09, 0x09, 0x09, 0x01, 79 | 0x00, 0x06, 0x09, 0x01, 0x00, 0x01, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 80 | }; 81 | 82 | static unsigned char us_90[] = { 83 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 84 | 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 85 | 0xaa, 0x8e, 0x80, 0x66, 0xa4, 0x19, 0xc7, 0x71, 0x80, 0x80, 0x80, 0x80, 0x0a, 0x0a, 0x0a, 0x03, 86 | 0x00, 0x0a, 0x0a, 0x01, 0x00, 0x01, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 87 | }; 88 | 89 | static unsigned char metal_2k[] = { 90 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 91 | 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 92 | 0xaa, 0xa4, 0x80, 0x55, 0x99, 0x4c, 0x91, 0x8e, 0x80, 0x80, 0x80, 0x80, 0x08, 0x08, 0x08, 0x02, 93 | 0x00, 0x08, 0x08, 0x01, 0x00, 0x01, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 94 | }; 95 | 96 | // V2 Only: 97 | 98 | static unsigned char studio_preamp[] = { 99 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 100 | 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 101 | 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x0d, 0x0d, 0x0d, 0x00, 102 | 0x00, 0x00, 0x0d, 0x01, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 103 | }; 104 | 105 | static unsigned char sixties_thrift[] = { 106 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 107 | 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 108 | 0xac, 0x81, 0x81, 0x81, 0xac, 0x81, 0x9d, 0x81, 0x81, 0x81, 0x81, 0x81, 0x0f, 0x0f, 0x0f, 0x00, 109 | 0x00, 0x01, 0x0f, 0x01, 0x00, 0x01, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 110 | }; 111 | 112 | static unsigned char brit_watts[] = { 113 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 114 | 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 115 | 0xba, 0x9d, 0x81, 0xff, 0xba, 0x98, 0xa6, 0x87, 0x81, 0x81, 0x81, 0x81, 0x11, 0x11, 0x11, 0x00, 116 | 0x00, 0x0a, 0x11, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 117 | }; 118 | 119 | static unsigned char brit_color[] = { 120 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 121 | 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 122 | 0xac, 0x8c, 0x81, 0x81, 0x9d, 0x64, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x10, 0x10, 0x10, 0x01, 123 | 0x00, 0x08, 0x10, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 124 | }; 125 | 126 | static unsigned char f57_twin[] = { 127 | 0x1c, 0x03, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 128 | 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 129 | 0xac, 0x4e, 0x81, 0x81, 0xac, 0x7b, 0x9d, 0xbd, 0x81, 0x81, 0x81, 0x81, 0x0e, 0x0e, 0x0e, 0x00, 130 | 0x00, 0x09, 0x0e, 0x01, 0x00, 0x01, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 131 | }; 132 | 133 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mustang-midi-bridge 2 | 3 | This application enables a small computer running Linux to translate 4 | MIDI messages to the proprietary USB protocol used by Fender Mustang 5 | amplifiers. 6 | 7 | # NEW: Fixes for Raspian Stretch distribution! 8 | 9 | Thanks to some valued troubleshooting from the user community, I have 10 | committed a few fixes to mitigate problems on the newer "Stretch" 11 | distribution. All but one are in the code base and should be 12 | backwards compatible with "Jessie", but one requires editing of a 13 | system file. Details can be found in the installation Wiki. 14 | 15 | # Introduction 16 | 17 | Mustang bridge implements about 99% of the published MIDI spec for the 18 | Fender Mustang Floor pedal with extensions to support features added 19 | to the 'v2' series: 20 | 21 | https://github.com/snhirsch/mustang-midi-bridge/blob/master/doc/MIDX20_Midi_Spec.pdf 22 | 23 | Code is developed on a Ubuntu Precise desktop machine, but I routinely 24 | test on a Raspberry Pi 'B' and Beagelbone Green to ensure these remain 25 | viable deployment targets. 26 | 27 | (Due to occasional issues with USB on the RPi I am recommending the 28 | BBG for live performance use - YMMV) 29 | 30 | Special thanks to: 31 | 32 | + The original developer and contributors to 'PLUG' who blazed the 33 | path with reverse-engineering of Fender's communication scheme. 34 | 35 | + Robert Fransson (aka Codesmart) of Primova Sound for feedback and 36 | encouragement and general programming wizardry). And a special 37 | thanks for allowing me to include his nicely formatted MIDI spec (in 38 | doc subdirectory). 39 | 40 | + Robert Heitman of Triton Interactive, author of the Android 41 | 'Remuda' application, who provided valuable insight into the darker 42 | corners of Mustang communication protocol. 43 | 44 | ## For the non-techies 45 | 46 | I have written a Wiki page here: 47 | 48 | https://github.com/snhirsch/mustang-midi-bridge/wiki/Install 49 | 50 | that attempts a detailed walk-through of the installation and build 51 | process on Raspberry Pi or Beaglebone. It's hard to know what level 52 | of detail to hit and suggestions or comments would be appreciated if 53 | I've omitted or glossed over something critical. 54 | 55 | If all this turns out to be too technical, Primova Sound offers a 56 | plug-and-play hardware appliance that will bridge to the Mustang and 57 | also provide a link to the non-MIDI-compliant Roland GP-10 pedal. 58 | 59 | http://www.primovasound.com/ 60 | 61 | Disclaimer: I have no involvement with Primova other than cooperating 62 | with Codesmart to ensure our solutions presented the same MIDI API for 63 | Mustang amp control. And, as an owner of the older MIDX-10 product I 64 | can vouch for the quality of their hardware. 65 | 66 | # Status 67 | 68 | The Mustang Floor MIDI spec is about 99% implemented, with only the 69 | following exceptions: 70 | 71 | + Amp Bypass 72 | 73 | It's possible to turn the amp "off" with CC#68 0, but this mutes 74 | all sound rather than acting as a bypass. It appears that the 75 | combo amps do not support the notion of straight-through routing 76 | without an amplifier modeling block. 77 | 78 | + Pedal Volume 79 | 80 | I'm not sure why this would even be needed, since all continuous 81 | controllers are directly accessible through CC messages. 82 | 83 | + FX Insert 84 | 85 | Not supported on hardware other than Mustang Floor 86 | 87 | + Tap Tempo 88 | 89 | I was not able to find the magic incantation to set tap tempo over 90 | USB (if, indeed, it's even possible). However, this function can 91 | be assigned to one of the Fender foot pedals if you need it at 92 | your feet. Haven't totally given up on this and have an idea for 93 | "faking" it over MIDI. Now I just need the time to code it... 94 | 95 | # Prerequisites 96 | 97 | + For Ubuntu Precise or Debian Jessie the following packages must be 98 | present. Install all but 'pyusb' with 'apt-get' (see below). 99 | 100 | - libasound2 101 | - librtmidi-dev 102 | - libusb-1.0-0-dev 103 | - libjack0 (Precise) 104 | - libjackQ (Jessie) 105 | - at 106 | - python2.7 107 | - python2.7-dev 108 | - python-pip 109 | - pyusb 110 | ``` 111 | NOTE: The python-pip install may segfault at the end, but it doesn't 112 | seem to affect anything. 113 | ``` 114 | 'pyusb' must be installed last using 'pip': 115 | 116 | $ pip install pyusb 117 | 118 | + If you want to run the regression tests, you'll also need: 119 | 120 | - 'Mido' Python MIDI extension 121 | - Python rtmidi extension 122 | 123 | 'mido' and rtmidi are not available as a DEB package and must be 124 | installed using 'pip': 125 | 126 | $ pip install --pre python-rtmidi 127 | 128 | $ pip install mido 129 | 130 | Would appreciate feedback on requirements for other distributions. 131 | 132 | # Build 133 | ``` 134 | $ make 135 | or 136 | $ make CPPFLAGS=-DRTMIDI_2_0 (for older librtmidi) 137 | ``` 138 | 139 | # Configure 140 | 141 | 1. Update ```60-midi.rules``` with the USB VID (vendor id) and PID 142 | (product id) of your controller. Must be on both lines, although the 143 | attribute names are different. 144 | 145 | 2. Edit ```mustang_bridge_start``` to set values marked as user 146 | edits. In addition to setting the VID and PID, you need to specify 147 | the index of the MIDI interface (see note below) and the MIDI channel 148 | you want the bridge to listen on. 149 | 150 | NOTE: I'm not sure about other platforms, but on Linux the MIDI 151 | port number is equivalent to the ALSA card index. I had originally 152 | treated port as 1..n, but since ALSA (and JACK? Not sure..) starts at 153 | 0, this has now been changed. You can find the card index for your 154 | controller by connecting it to the computer and examining the 155 | pseudo-file, e.g.: 156 | 157 | ``` 158 | $ cat /proc/asound/cards 159 | 0 [PCH ]: HDA-Intel - HDA Intel PCH 160 | HDA Intel PCH at 0xf7530000 irq 30 161 | 1 [Interface ]: USB-Audio - USB MS1x1 MIDI Interface 162 | M-Audio USB MS1x1 MIDI Interface at usb-0000:00:14.0-1, full speed 163 | ``` 164 | 165 | To accept MIDI messages from devices behind the M-Audio interface you 166 | would now specify '1' as the MIDI port value. 167 | 168 | # Install 169 | 170 | Run the ```install.sh``` script as root 171 | 172 | # Run 173 | 174 | If you have configured everything correctly, the bridge should start 175 | automatically when both the controller and the Mustang amp are 176 | connected via USB. If either or both are disconnected or shut off, 177 | the bridge will be killed automatically. 178 | 179 | # In case of difficulty 180 | 181 | RPi and BBG are a bit fussy about enumeration of new USB devices. If 182 | you are not getting proper communication, quit the program and try 183 | replugging both the Fender amp and MIDI controller **after** those 184 | devices are powered up. 185 | 186 | I've had success using a passive USB hub with the single USB on the 187 | BBG, but YMMV since most USB<->5Pin MIDI converters draw some degree 188 | of bus power. A powered hub might be necessary in some situations. 189 | 190 | # Recent Changes 191 | 192 | Complete rewrite and restructure of code based on ever-increasing 193 | familiarity with the Mustang communication protocol and API. The 194 | bridge code is now fully mulithreaded. A persistent background thread 195 | is constantly listening to incoming traffic from the amp and updating 196 | shared data as necessary. This greatly increases stability and makes 197 | the bridge tolerant of manual adjustments on the amplifier while 198 | nominally under MIDI control. In particular, it is now possible to 199 | engage the tuner function on the amp without ill side-effects. 200 | 201 | The command line parameter for MIDI controller port is now assumed to 202 | start at 0 rather than 1 in order to match the way Linux ALSA 203 | enumerates devices. 204 | 205 | I have added a runtime framework that starts and stops the program 206 | automatically based on attached MIDI devices. There is a small amount 207 | of customization required to account for your specific amp model and 208 | MIDI controller interface. 209 | 210 | Support added for amp and effects models specific to the Mustang v2 211 | products. 212 | 213 | Added a python script to drive regression testing. Tests require LCD 214 | display for feedback and are not going to be of much use unless you 215 | have a Mustang III, IV or V model. 216 | -------------------------------------------------------------------------------- /stomp.h: -------------------------------------------------------------------------------- 1 | // -*-c++-*- 2 | 3 | #ifndef _STOMP_H 4 | #define _STOMP_H 5 | 6 | #include 7 | 8 | class Mustang; 9 | 10 | class StompCC { 11 | 12 | protected: 13 | Mustang * amp; 14 | unsigned char model[2]; 15 | unsigned char slot; 16 | 17 | int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ); 18 | int discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ); 19 | 20 | public: 21 | StompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : 22 | amp(theAmp), 23 | slot(theSlot) 24 | { 25 | memcpy( this->model, model, 2 ); 26 | } 27 | 28 | int dispatch( int cc, int value, unsigned char *cmd ); 29 | const unsigned char *getModel( void ) { return model;} 30 | const unsigned char getSlot( void ) { return slot;} 31 | 32 | private: 33 | virtual int cc29( int value, unsigned char *cmd ) = 0; 34 | virtual int cc30( int value, unsigned char *cmd ) = 0; 35 | virtual int cc31( int value, unsigned char *cmd ) = 0; 36 | virtual int cc32( int value, unsigned char *cmd ) = 0; 37 | virtual int cc33( int value, unsigned char *cmd ) = 0; 38 | }; 39 | 40 | 41 | class OverdriveCC : public StompCC { 42 | public: 43 | OverdriveCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 44 | private: 45 | // Level 46 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 47 | // Gain 48 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 49 | // Low 50 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 51 | // Mid 52 | virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 53 | // High 54 | virtual int cc33( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 55 | }; 56 | 57 | 58 | class WahCC : public StompCC { 59 | public: 60 | WahCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 61 | private: 62 | // Mix 63 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 64 | // Freq 65 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 66 | // Heel Freq 67 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 68 | // Toe Freq 69 | virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 70 | // High Q 71 | virtual int cc33( int value, unsigned char *cmd ) { 72 | if ( value > 1 ) return -1; 73 | else return discrete_control( 0x04, 0x04, 0x81, value, cmd ); 74 | } 75 | }; 76 | 77 | 78 | class FuzzCC : public StompCC { 79 | public: 80 | FuzzCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 81 | private: 82 | // Level 83 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 84 | // Gain 85 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 86 | // Octave 87 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 88 | // Low 89 | virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 90 | // High 91 | virtual int cc33( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 92 | }; 93 | 94 | 95 | class FuzzTouchWahCC : public StompCC { 96 | public: 97 | FuzzTouchWahCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 98 | private: 99 | // Level 100 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 101 | // Gain 102 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 103 | // Sens 104 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 105 | // Octave 106 | virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 107 | // Peak 108 | virtual int cc33( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 109 | }; 110 | 111 | 112 | class SimpleCompCC : public StompCC { 113 | public: 114 | SimpleCompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 115 | private: 116 | // Type 117 | virtual int cc29( int value, unsigned char *cmd ) { 118 | if ( value > 3 ) return -1; 119 | else return discrete_control( 0x00, 0x05, 0x92, value, cmd ); 120 | } 121 | virtual int cc30( int value, unsigned char *cmd ) { return -1;} 122 | virtual int cc31( int value, unsigned char *cmd ) { return -1;} 123 | virtual int cc32( int value, unsigned char *cmd ) { return -1;} 124 | virtual int cc33( int value, unsigned char *cmd ) { return -1;} 125 | }; 126 | 127 | 128 | class CompCC : public StompCC { 129 | public: 130 | CompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 131 | private: 132 | // Level 133 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 134 | // Thresh 135 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 136 | // Ratio 137 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x04, value, cmd );} 138 | // Attack 139 | virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 140 | // Release 141 | virtual int cc33( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 142 | }; 143 | 144 | 145 | class RangerCC : public StompCC { 146 | public: 147 | RangerCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot) : StompCC(theAmp,model,theSlot) {} 148 | private: 149 | // Level 150 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 151 | // Gain 152 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 153 | // Lo-Cut 154 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x03, 0x01, value, cmd );} 155 | // Bright 156 | virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x02, 0x01, value, cmd );} 157 | // n/a 158 | virtual int cc33( int value, unsigned char *cmd ) { return -1;} 159 | }; 160 | 161 | 162 | class GreenBoxCC : public StompCC { 163 | public: 164 | GreenBoxCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 165 | private: 166 | // Level 167 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 168 | // Gain 169 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 170 | // Tone 171 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 172 | // Bright 173 | virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x12, value, cmd );} 174 | // n/a 175 | virtual int cc33( int value, unsigned char *cmd ) { return -1;} 176 | }; 177 | 178 | 179 | class OrangeBoxCC : public StompCC { 180 | public: 181 | OrangeBoxCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 182 | private: 183 | // Level 184 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 185 | // Dist 186 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x02, 0x01, value, cmd );} 187 | // Tone 188 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x01, 0x01, value, cmd );} 189 | // n/a 190 | virtual int cc32( int value, unsigned char *cmd ) { return -1;} 191 | // n/a 192 | virtual int cc33( int value, unsigned char *cmd ) { return -1;} 193 | }; 194 | 195 | 196 | class BlackBoxCC : public StompCC { 197 | public: 198 | BlackBoxCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 199 | private: 200 | // Level 201 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 202 | // Dist 203 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x02, 0x01, value, cmd );} 204 | // Filter 205 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x01, 0x01, value, cmd );} 206 | // n/a 207 | virtual int cc32( int value, unsigned char *cmd ) { return -1;} 208 | // n/a 209 | virtual int cc33( int value, unsigned char *cmd ) { return -1;} 210 | }; 211 | 212 | 213 | class BigFuzzCC : public StompCC { 214 | public: 215 | BigFuzzCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 216 | private: 217 | // Level 218 | virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 219 | // Tone 220 | virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 221 | // Sustain 222 | virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 223 | // n/a 224 | virtual int cc32( int value, unsigned char *cmd ) { return -1;} 225 | // n/a 226 | virtual int cc33( int value, unsigned char *cmd ) { return -1;} 227 | }; 228 | 229 | 230 | class NullStompCC : public StompCC { 231 | public: 232 | NullStompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {} 233 | private: 234 | virtual int cc29( int value, unsigned char *cmd ) { return -1;} 235 | virtual int cc30( int value, unsigned char *cmd ) { return -1;} 236 | virtual int cc31( int value, unsigned char *cmd ) { return -1;} 237 | virtual int cc32( int value, unsigned char *cmd ) { return -1;} 238 | virtual int cc33( int value, unsigned char *cmd ) { return -1;} 239 | }; 240 | 241 | 242 | #endif 243 | -------------------------------------------------------------------------------- /mod.h: -------------------------------------------------------------------------------- 1 | // -*-c++-*- 2 | 3 | #ifndef _MOD_H 4 | #define _MOD_H 5 | 6 | #include 7 | 8 | class Mustang; 9 | 10 | class ModCC { 11 | 12 | protected: 13 | Mustang * amp; 14 | unsigned char model[2]; 15 | unsigned char slot; 16 | 17 | int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ); 18 | int discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ); 19 | 20 | public: 21 | ModCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : 22 | amp(theAmp), 23 | slot(theSlot) 24 | { 25 | memcpy( this->model, model, 2 ); 26 | } 27 | 28 | int dispatch( int cc, int value, unsigned char *cmd ); 29 | const unsigned char *getModel( void ) { return model;} 30 | const unsigned char getSlot( void ) { return slot;} 31 | 32 | private: 33 | virtual int cc39( int value, unsigned char *cmd ) = 0; 34 | virtual int cc40( int value, unsigned char *cmd ) = 0; 35 | virtual int cc41( int value, unsigned char *cmd ) = 0; 36 | virtual int cc42( int value, unsigned char *cmd ) = 0; 37 | virtual int cc43( int value, unsigned char *cmd ) = 0; 38 | }; 39 | 40 | 41 | class ChorusCC : public ModCC { 42 | public: 43 | ChorusCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 44 | private: 45 | // Level 46 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 47 | // Rate 48 | virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x10, value, cmd );} 49 | // Depth 50 | virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 51 | // Avg Delay 52 | virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 53 | // LR Phase 54 | virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 55 | }; 56 | 57 | 58 | class FlangerCC : public ModCC { 59 | public: 60 | FlangerCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 61 | private: 62 | // Level 63 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 64 | // Rate 65 | virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x10, value, cmd );} 66 | // Depth 67 | virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 68 | // Feedback 69 | virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 70 | // LR Phase 71 | virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 72 | }; 73 | 74 | 75 | class VibratoneCC : public ModCC { 76 | public: 77 | VibratoneCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 78 | private: 79 | // Level 80 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 81 | // Rotor Speed 82 | virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x0f, value, cmd );} 83 | // Depth 84 | virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 85 | // Feedback 86 | virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 87 | // LR Phase 88 | virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 89 | }; 90 | 91 | 92 | class TremCC : public ModCC { 93 | public: 94 | TremCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 95 | private: 96 | // Level 97 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 98 | // Rotor Speed 99 | virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x0e, value, cmd );} 100 | // Duty Cycle 101 | virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 102 | // Attack / LFO Clip 103 | virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 104 | // Release / Tri Shape 105 | virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 106 | }; 107 | 108 | 109 | class RingModCC : public ModCC { 110 | public: 111 | RingModCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 112 | private: 113 | // Level 114 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 115 | // Freq 116 | virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 117 | // Depth 118 | virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 119 | // LFO Depth 120 | virtual int cc42( int value, unsigned char *cmd ) { 121 | if ( value > 1 ) return -1; 122 | else return discrete_control( 0x03, 0x03, 0x8c, value, cmd ); 123 | } 124 | // LFO Phase 125 | virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 126 | }; 127 | 128 | 129 | class StepFilterCC : public ModCC { 130 | public: 131 | StepFilterCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 132 | private: 133 | // Level 134 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 135 | // Rate 136 | virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x10, value, cmd );} 137 | // Resonance 138 | virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 139 | // Min Freq 140 | virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 141 | // Max Freq 142 | virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 143 | }; 144 | 145 | 146 | class PhaserCC : public ModCC { 147 | public: 148 | PhaserCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 149 | private: 150 | // Level 151 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 152 | // Rate 153 | virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x10, value, cmd );} 154 | // Depth 155 | virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 156 | // Feedback 157 | virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 158 | // LFO Shape 159 | virtual int cc43( int value, unsigned char *cmd ) { 160 | if ( value > 1 ) return -1; 161 | else return discrete_control( 0x04, 0x04, 0x8c, value, cmd ); 162 | } 163 | }; 164 | 165 | 166 | class PitchShifterCC : public ModCC { 167 | public: 168 | PitchShifterCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 169 | private: 170 | // Level 171 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 172 | // Pitch 173 | virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 174 | // Detune 175 | virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 176 | // Feedback 177 | virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 178 | // Predelay 179 | virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );} 180 | }; 181 | 182 | // Wah + Touch Wah 183 | class ModWahCC : public ModCC { 184 | public: 185 | ModWahCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 186 | private: 187 | // Mix 188 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 189 | // Freq 190 | virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );} 191 | // Heel Freq 192 | virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );} 193 | // Toe Freq 194 | virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );} 195 | // Hi-Q 196 | virtual int cc43( int value, unsigned char *cmd ) { 197 | if ( value > 1 ) return -1; 198 | else return discrete_control( 0x04, 0x04, 0x81, value, cmd ); 199 | } 200 | }; 201 | 202 | 203 | class DiatonicShiftCC : public ModCC { 204 | public: 205 | DiatonicShiftCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 206 | private: 207 | // Mix 208 | virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );} 209 | // Pitch 210 | virtual int cc40( int value, unsigned char *cmd ) { 211 | if ( value > 0x15 ) return -1; 212 | else return discrete_control( 0x01, 0x0b, 0x98, value, cmd ); 213 | } 214 | // Key 215 | virtual int cc41( int value, unsigned char *cmd ) { 216 | if ( value > 0x0b ) return -1; 217 | else return discrete_control( 0x02, 0x02, 0x99, value, cmd ); 218 | } 219 | // Scale 220 | virtual int cc42( int value, unsigned char *cmd ) { 221 | if ( value > 8 ) return -1; 222 | else return discrete_control( 0x03, 0x03, 0x9a, value, cmd ); 223 | } 224 | // Tone 225 | virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x07, 0x01, value, cmd );} 226 | }; 227 | 228 | 229 | class NullModCC : public ModCC { 230 | public: 231 | NullModCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {} 232 | private: 233 | virtual int cc39( int value, unsigned char *cmd ) { return -1;} 234 | virtual int cc40( int value, unsigned char *cmd ) { return -1;} 235 | virtual int cc41( int value, unsigned char *cmd ) { return -1;} 236 | virtual int cc42( int value, unsigned char *cmd ) { return -1;} 237 | virtual int cc43( int value, unsigned char *cmd ) { return -1;} 238 | }; 239 | 240 | 241 | #endif 242 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # hirsch@z87:~$ aconnect -o 4 | # client 14: 'Midi Through' [type=kernel] 5 | # 0 'Midi Through Port-0' 6 | # client 128: 'RtMidi Input Client' [type=user] 7 | # 0 'TestPort ' 8 | # 9 | # Given the above, open RtMidi as: 'RtMidi Input Client 128:0' 10 | 11 | from time import sleep 12 | import sys 13 | import itertools as it 14 | import mido 15 | mido.set_backend('mido.backends.rtmidi') 16 | 17 | pc = mido.Message('program_change') 18 | cc = mido.Message('control_change') 19 | 20 | # 1 == v1, 2 == v2 21 | type = 0 22 | 23 | def analog_send( outport, sleeptime=0.25 ): 24 | for value in [ 0, 32, 64, 96, 127, 0 ]: 25 | cc.value = value 26 | outport.send( cc ) 27 | sleep( sleeptime ) 28 | 29 | def discrete_send( outport, max ): 30 | for value in it.chain( range(0,max+1), range(0,1) ): 31 | cc.value = value 32 | outport.send( cc ) 33 | sleep( 0.25 ) 34 | 35 | # Screen 1 is the same for all models 36 | def amp_screen1( outport ): 37 | for i in range( 69, 74 ): 38 | cc.control = i 39 | analog_send( outport ) 40 | 41 | # Some variation in screen 2 across models 42 | def amp_screen2( outport, template ): 43 | limit = len(template) 44 | 45 | i = 74 46 | j = 5 47 | while j < limit: 48 | cc.control = i 49 | i += 1 50 | if template[j] == "A": 51 | analog_send( outport ) 52 | elif template[j] == "D": 53 | j += 1 54 | count = int( template[j:j+2] ) 55 | j += 1 56 | discrete_send( outport, count ) 57 | elif template[j] == "-": 58 | pass 59 | j += 1 60 | 61 | # Step through all amp models 62 | def amp_select( outport ): 63 | if type == 2: 64 | max = 18 65 | else: 66 | max = 13 67 | 68 | cc.control = 68 69 | for i in range( 0, max ): 70 | cc.value = i 71 | outport.send( cc ) 72 | sleep( 0.5 ) 73 | 74 | def run_amp_test( struct, outport ): 75 | raw_input( "Hit ENTER to run amp model select test...\n" ) 76 | amp_select( outport ) 77 | 78 | for i in range( 0, len(struct) ): 79 | control_rec = struct[i] 80 | if control_rec[3] and type != 2: 81 | continue 82 | 83 | raw_input( "Hit ENTER to run parm edit check for %s\n" % control_rec[0] ) 84 | cc.control = 68 85 | cc.value = control_rec[1] 86 | outport.send( cc ) 87 | 88 | raw_input( "Enter amp edit mode on Mustang and hit ENTER to proceed...\n" ) 89 | amp_screen1( outport ) 90 | 91 | raw_input( "Step to amp edit screen 2 and hit ENTER...\n" ) 92 | amp_screen2( outport, control_rec[2] ) 93 | 94 | # Step through all reverb models 95 | def reverb_select( outport ): 96 | cc.control = 58 97 | for i in range( 0, 11 ): 98 | cc.value = i 99 | outport.send( cc ) 100 | sleep( 0.5 ) 101 | 102 | def run_reverb_test( outport ): 103 | raw_input( "Hit ENTER to run reverb model select test...\n" ) 104 | reverb_select( outport ) 105 | 106 | raw_input( "Enter Reverb edit mode and hit ENTER...\n" ) 107 | for i in range ( 59, 64 ): 108 | cc.control = i 109 | analog_send( outport ) 110 | sleep( 0.25 ) 111 | 112 | # Step through all delay models 113 | def delay_select( outport ): 114 | cc.control = 48 115 | for i in range( 0, 10 ): 116 | cc.value = i 117 | outport.send( cc ) 118 | sleep( 0.5 ) 119 | 120 | def run_delay_test( struct, outport ): 121 | raw_input( "Hit ENTER to run delay model select test...\n" ) 122 | delay_select( outport ) 123 | 124 | for i in range( 0, len(struct) ): 125 | control_rec = struct[i] 126 | # Skip if not a V2 amp 127 | if control_rec[3] and type != 2: 128 | continue 129 | 130 | raw_input( "Hit ENTER to run parm edit check for %s\n" % control_rec[0] ) 131 | cc.control = 48 132 | cc.value = control_rec[1] 133 | outport.send( cc ) 134 | 135 | raw_input( "Enter delay edit mode on Mustang and hit ENTER to proceed...\n" ) 136 | limit = len(control_rec[2]) 137 | template = control_rec[2] 138 | 139 | i = 49 140 | j = 0 141 | while j < limit: 142 | cc.control = i 143 | i += 1 144 | if template[j] == "A": 145 | analog_send( outport ) 146 | elif template[j] == "D": 147 | j += 1 148 | count = int( template[j:j+2] ) 149 | j += 1 150 | discrete_send( outport, count ) 151 | j += 1 152 | 153 | 154 | # Step through all mod models 155 | def mod_select( outport ): 156 | if type == 2: 157 | max = 15 158 | else: 159 | max = 12 160 | 161 | cc.control = 38 162 | for i in range( 0, max ): 163 | cc.value = i 164 | outport.send( cc ) 165 | sleep( 0.5 ) 166 | 167 | def run_mod_test( struct, outport ): 168 | raw_input( "Hit ENTER to run mod model select test...\n" ) 169 | mod_select( outport ) 170 | 171 | for i in range( 0, len(struct) ): 172 | control_rec = struct[i] 173 | if control_rec[3] and type != 2: 174 | continue 175 | 176 | raw_input( "Hit ENTER to run parm edit check for %s\n" % control_rec[0] ) 177 | cc.control = 38 178 | cc.value = control_rec[1] 179 | outport.send( cc ) 180 | 181 | raw_input( "Enter mod edit mode on Mustang and hit ENTER to proceed...\n" ) 182 | limit = len(control_rec[2]) 183 | template = control_rec[2] 184 | 185 | i = 39 186 | j = 0 187 | while j < limit: 188 | cc.control = i 189 | i += 1 190 | if template[j] == "A": 191 | analog_send( outport ) 192 | elif template[j] == "D": 193 | j += 1 194 | count = int( template[j:j+2] ) 195 | j += 1 196 | discrete_send( outport, count ) 197 | j += 1 198 | 199 | # Step through all stomp models 200 | def stomp_select( outport ): 201 | if type == 2: 202 | max = 13 203 | else: 204 | max = 8 205 | 206 | cc.control = 28 207 | for i in range( 0, max ): 208 | cc.value = i 209 | outport.send( cc ) 210 | sleep( 0.5 ) 211 | 212 | def run_stomp_test( struct, outport ): 213 | raw_input( "Hit ENTER to run stomp model select test...\n" ) 214 | stomp_select( outport ) 215 | 216 | for i in range( 0, len(struct) ): 217 | control_rec = struct[i] 218 | if control_rec[3] and type != 2: 219 | continue 220 | 221 | raw_input( "Hit ENTER to run parm edit check for %s\n" % control_rec[0] ) 222 | cc.control = 28 223 | cc.value = control_rec[1] 224 | outport.send( cc ) 225 | 226 | raw_input( "Enter stomp edit mode on Mustang and hit ENTER to proceed...\n" ) 227 | limit = len(control_rec[2]) 228 | template = control_rec[2] 229 | 230 | i = 29 231 | j = 0 232 | while j < limit: 233 | cc.control = i 234 | i += 1 235 | if template[j] == "A": 236 | analog_send( outport ) 237 | elif template[j] == "D": 238 | j += 1 239 | count = int( template[j:j+2] ) 240 | j += 1 241 | discrete_send( outport, count ) 242 | j += 1 243 | 244 | # Step through program changes 245 | def program_change_test( outport ): 246 | raw_input( "Hit ENTER to run program change test...\n" ) 247 | for i in ( 0, 25, 75, 99, 60, 40, 20, 0 ): 248 | pc.program = i 249 | outport.send( pc ) 250 | sleep( 0.5 ) 251 | 252 | def tuner_test( outport ): 253 | raw_input( "Hit ENTER to select tuner...\n" ) 254 | cc.control = 20 255 | cc.value = 127 256 | outport.send( cc ) 257 | raw_input( "Hit ENTER to deselect tuner...\n" ) 258 | cc.value = 0 259 | outport.send( cc ) 260 | 261 | def bypass_test( outport ): 262 | raw_input( "Hit ENTER to select all effects...\n" ) 263 | cc.control = 22 264 | cc.value = 127 265 | outport.send( cc ) 266 | raw_input( "Hit ENTER to bypass all effects...\n" ) 267 | cc.value = 0 268 | outport.send( cc ) 269 | 270 | 271 | ###################### main ######################## 272 | 273 | args = sys.argv 274 | 275 | if len(args) < 4: 276 | print "Usage: test.py [test_name]\n" 277 | print " Pass test name in {pc, tuner, efxbypass, stomp, mod, reverb, delay, amp} for single test\n" 278 | print " Default is to run all of them if no arg 4 passed\n" 279 | sys.exit( 1 ) 280 | 281 | try: 282 | pc.channel = cc.channel = int( args[2] ) - 1 283 | except ValueError: 284 | print "Arg2 must be numeric!\n" 285 | sys.exit( 1 ) 286 | 287 | if args[3] == "v1": 288 | type = 1 289 | elif args[3] == "v2": 290 | type = 2 291 | else: 292 | print "Arg 3 must be 'v1' or 'v2'" 293 | sys.exit( 1 ) 294 | 295 | single = "all" 296 | if len(args) == 5: 297 | single = args[4] 298 | 299 | outport = mido.open_output( args[1] ) 300 | 301 | if single == "all" or single == "pc": 302 | program_change_test( outport ) 303 | 304 | if single == "all" or single == "tuner": 305 | tuner_test( outport ) 306 | 307 | if single == "all" or single == "efxbypass": 308 | bypass_test( outport ) 309 | 310 | if single == "all" or single == "stomp": 311 | # Model Ctrl v2only 312 | stomp_test = ( 313 | ( "Ranger Boost", 8, "AAAA", True ), 314 | ( "Green Box", 9, "AAAA", True ), 315 | ( "Orange Box", 10, "AAA", True ), 316 | ( "Black Box", 11, "AAA", True ), 317 | ( "Big Fuzz", 12, "AAA", True ), 318 | 319 | ( "Overdrive", 1, "AAAAA", False ), 320 | ( "Wah", 2, "AAAAD01", False ), 321 | ( "Simple Comp", 6, "D03", False ), 322 | ( "Comp", 7, "AAAAA", False ) 323 | ) 324 | run_stomp_test( stomp_test, outport ) 325 | 326 | if single == "all" or single == "mod": 327 | # Model Ctrl v2only 328 | mod_test = ( 329 | ( "Wah", 12, "AAAAD01", True ), 330 | ( "Touch Wah", 13, "AAAAD01", True ), 331 | ( "Dia Shift", 14, "AD21D11D08A", True ), 332 | 333 | ( "Sine Chorus", 1, "AAAAA", False ), 334 | ( "Vibratone", 5, "AAAAA", False ), 335 | ( "Vintage Trem", 6, "AAAAA", False ), 336 | ( "Ring Mod", 8, "AAAD01A", False ), 337 | ( "Phaser", 10, "AAAAD01", False ), 338 | ( "Pitch Shift", 11, "AAAAA", False ) 339 | ) 340 | run_mod_test( mod_test, outport ) 341 | 342 | if single == "all" or single == "reverb": 343 | run_reverb_test( outport ) 344 | 345 | if single == "all" or single == "delay": 346 | # Model Ctrl v2only 347 | delay_test = ( 348 | ( "Mono Delay", 1, "AAAAA", False ), 349 | ( "Mono Echo Filter", 2, "AAAAAA", False ), 350 | ( "Stereo Echo Filter", 3, "AAAAAA", False ), 351 | ( "Multitap", 4, "AAAAD03", False ), 352 | ( "Tape Delay", 8, "AAAAAA", False ), 353 | ( "Stereo Tape Delay", 9, "AAAAAA", False ) 354 | ) 355 | run_delay_test( delay_test, outport ) 356 | 357 | if single == "all" or single == "amp": 358 | # Model, Ctrl v2only 359 | amp_test = ( 360 | ( "Studio Preamp", 13, "AAAAA--D04D12", True ), 361 | # Test custom noise gate and bright switch 362 | ( "Fender 65 Twin", 6, "AAAAAD02AD04D12--D09AD01", False ), 363 | ( "Fender SuperSonic", 7, "AAAAAD02AD04D12AA", False ), 364 | ( "British 60s", 8, "AAAAAD02AD04D12AA", False ), 365 | ( "British 70s", 9, "AAAAAD02AD04D12AA", False ), 366 | ( "British 80s", 10, "AAAAAD02AD04D12AA", False ) 367 | ) 368 | run_amp_test( amp_test, outport ) 369 | 370 | print "All tests complete\n" 371 | -------------------------------------------------------------------------------- /doc/bronco_usb_amps_effects.txt: -------------------------------------------------------------------------------- 1 | Fender Bronco 40 2 | usb sniffed stuff 3 | 4 | 0 1 5 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 7 | 00 | 1c| 03|DSP| 00 | 01| 01| 00 | 8 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 9 | 16 |mod| 00 | 10 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 11 | 32 |vol|gai|ga2|mvl|tre|mid|bas|prs|?? |dep|bis|?? | number |ng | 12 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 13 | 48 |ths|cab|?? |sag|bri| 01|?? | 00 | 14 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 15 | 16 | DSP - for amplifier it is always 5 17 | mod - amplifier model; different for each emulated amp 18 | vol - volume 19 | gai - gain 20 | ga2 - gain 2 21 | mvl - master volume 22 | tre - treble 23 | mid - middle 24 | bas - bass 25 | prs - presence 26 | dep - depth 27 | bis - bias 28 | number - don't know what this is; different for each emulated amp 29 | ng - noise gate; value 0x00 - 0x05 30 | ths - threshold; value 0x00 - 0x09 31 | cab - cabinet; value 0x00 - 0x0c 32 | sag - sag; value 0x00 - 0x02 33 | bri - brightness; value 0x00-0x01 34 | ?? - values which I haven't decoded yet; different for each emulated amp 35 | 36 | After packet with data described above you have to send a packet which will tell the amp to actually apply the settings. This packet have zeroth byte set to "0x1c", first to "0x03" and all other to "0x00". 37 | 4. Setting and clearing effects 38 | 39 | Data format for setting an effect is: 40 | 41 | 0 1 42 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 43 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 44 | 00 | 1c| 03|DSP| 00 | 01| 01| 00 | 45 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 46 | 16 |fxm| 00|slt| ??| ??| ??| 00 | 47 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 48 | 32 |kb1|kb2|kb3|kb4|kb5|kb6| 00 | 49 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 50 | 48 | 00 | 51 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 52 | 53 | DSP - can be either 6, 7, 8 or 9; depends on effect familly 54 | fxm - effect model; independent for each effect 55 | slt - slot; before amp have numbers from 0 to 3, after from 4 to 7 56 | kb1, kb2, kb3, kb4, kb5, kb6 - knobs values; not every time all are used; maximum 57 | value of the knob depends on the effect 58 | ?? - some strange numbers specific for each effect 59 | 60 | If you want to remove the effect send normal effect-setting packet but set "effect model" and knobs fields to zeros. 61 | I haven't tried what happens if you send such packet to DSP 0x05. 62 | "Execute" command for both setting and clearing the effect is the same as for the amp setting. 63 | 5. Saving settings on amplifier 64 | 65 | Saving settings is very easy since you don't have to transmit all the settings which you want to store. You only send a command containing slot number and name for a preset. Data are taken directly from DSPs. 66 | Packet format is: 67 | 68 | 0 1 69 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 70 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 71 | 00 | 1c| 01| 03| 00|SLT| 00| 01| 01| 00 | 72 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 73 | 16 | name | 74 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 75 | 32 | name | 76 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 77 | 48 | 00 | 78 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 79 | 80 | SLT - memory bank to which to save settings; value 0x00 - 0x17 81 | name - name of the preset ended with "\0"; if not all fields are used used the rest 82 | is set to 0x00 83 | 84 | Fender FUSE after saving settings chooses memory bank it just saved. PLUG also does this. 85 | 6. Choosing memory bank 86 | 87 | "Choose memory bank" command looks like this: 88 | 89 | 0 1 90 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 91 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 92 | 00 | 1c| 01| 01| 00|SLT| 00| 01| 00 | 93 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 94 | 16 | 00 | 95 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 96 | 32 | 00 | 97 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 98 | 48 | 00 | 99 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 100 | 101 | SLT - memory bank to choose 102 | 103 | --Change one Value-- 104 | 105 | 00 05 c3 02 96 00 00 00 0c 00 ff ff 00 00 00 00 00 106 | 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 107 | 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 108 | 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 109 | 0 1 110 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 111 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 112 | 00 | 05| c3|dsp|mod| 00|kbn|kbn|efs| 00|vll|val| 00 | 113 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 114 | 16 | 00 | 115 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 116 | 32 | 00 | 117 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 118 | 48 | 00 | 119 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 120 | 121 | 122 | mod model of amp or effect 123 | 124 | dsp dsp model 125 | 02 Amps 126 | 03 StompBox 127 | 04 Mod/Filter 128 | 05 Delay 129 | 06 Reverb 130 | 131 | vll lower bit's of the value mostly second bit eg val:04 vll:44 val:80 vll:00 132 | at cabinet, noise gate,compressor its the value 133 | val value the value of the knob 134 | 135 | efs Effect section 136 | 01 costom 137 | 0c mabe default of the amp 138 | 0d bias 139 | 12 mabe overdrive 140 | 8d Punch, Scoop, Limiter, ultralow knob 141 | 8f sag matched 142 | 86 Noise Gate Thresh 143 | 90 Noise Gate 144 | 93 cabinet 145 | 94 compressor 146 | 147 | kbn Knob number begin by 00 in order to amp data row 148 | efs:0c 149 | 00 vol 150 | 01 gain 151 | 02 blend 152 | 03 153 | 04 treble 154 | 05 mid 155 | 06 bass 156 | 07 Presence 157 | 08 AuralEnhacer 158 | 09 noise gate depth 159 | 1d mid frequency 160 | 161 | efs:01 162 | 17 Level compressor 163 | 18 Thresh 164 | 19 Ratio 165 | 1a Attack 166 | 1b Release 167 | 168 | efs:0d 169 | 0a bias 170 | 171 | efs:12 172 | 1c overdrive blend 173 | 174 | efs:8d 175 | 14 Punch, Scoop, Limiter, ultralow knob 176 | punch vll:fe on 177 | scoop vll:fb on 178 | limiter vll:7f on 179 | ultra low- vll:fd on 180 | ultra low+ vll:fb on 181 | punch and scoop vll:fa on 182 | punch and limiter vll:7e on 183 | scoop and limiter vll:7b on 184 | punch scoop ultra low- vll:f8 on 185 | scoop ultra low- vll:f9 on 186 | punch ultra low- vll:fc on 187 | punch scoop limiter vll:7a on 188 | ulra low- punch limiter vll:7c on 189 | 190 | efs:8f 191 | 13 sag vll:00-02 192 | 193 | efs:86 194 | 10 noise gate thresh vll: 0-9 195 | 196 | efs:90 197 | 0f noise Gate vll: 00= 0ff 01=low 02=mid 03=high 04=super 198 | 199 | efs:93 200 | 11 cabinet vll: 00= off 01=1x10modern 02=2x10modern 03=4x10modern 04=4x10 Hi-Fi 201 | 0d=4x10vintage 05=8x10modern 06=8x10vintage 07=1x12modern 09=4x12modern 202 | 0a=1x15vintage 0b=1x15modern 08=2x15vintage 0c=1x18vintage 203 | 204 | efs:94 205 | 16 compressor vll: 00=off 01=Low1 02=Low2 03=Low3 04-06 =Mid1,2,3 206 | 07-09High1,2,3 0a-0c= Ultra1,2,3 207 | 208 | 209 | USB Gain 210 | 211 | 0000 1c 03 0d 00 00 00 01 01 00 00 00 00 00 00 00 00 212 | 0010 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 213 | 0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 214 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 215 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 216 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 217 | 00 | 1c| c3| 0d| 00| 00|kbn|kbn| 00| 00 | 218 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 219 | 16 |val 00 | 220 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 221 | 32 | 00 | 222 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 223 | 48 | 00 | 224 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 225 | val is the volume of the usb gain 00-ff 226 | 227 | 228 | 229 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 230 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 231 | 00 | 1c| 03|DSP| 00 | 01| 01| 00 | 232 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 233 | 16 |fxm| 00|slt| ??| ??| ??| 00 | 234 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 235 | 32 |vol|gai|ga2|mvl|tre|mid|bas|prs|?? |dep|bis|?? | number |ng | 236 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 237 | 48 |ths|cab|?? |sag|bri| 01|?? | 00 00| 238 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 239 | 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 240 | 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 241 | 242 | DSP - for amplifier it is always 5 243 | mod - amplifier model; different for each emulated amp 244 | vol - volume 245 | gai - gain 246 | ga2 - gain 2 247 | mvl - master volume 248 | tre - treble 249 | mid - middle 250 | bas - bass 251 | prs - presence 252 | dep - depth 253 | bis - bias 254 | number - don't know what this is; different for each emulated amp 255 | ng - noise gate; value 0x00 - 0x05 256 | ths - threshold; value 0x00 - 0x09 257 | cab - cabinet; value 0x00 - 0x0c 258 | sag - sag; value 0x00 - 0x02 259 | bri - brightness; value 0x00-0x01 260 | ?? - values which I haven't decoded yet; different for each emulated amp 261 | 262 | --Amps-- 263 | Fender Rumble 264 | 265 | 0000 1c 03 05 00 00 00 01 01 00 00 00 00 00 00 00 00 266 | 0010 96 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 267 | 0020 e6 00 80 ff 8e 71 80 80 80 80 80 80 01 01 01 01 268 | 0030 00 03 01 01 7f 01 01 80 ff 80 80 80 55 aa 64 00 269 | 270 | 0-10: Gain[0] volume[9] treble[5,5] middle[4,5] mid freq [6] bass[5] 271 | ng: Low -> treshold:0/10 deth:mid bias:mid carbinet:4x10 modern 272 | 273 | 274 | Fender '59 Bassman 275 | 276 | 0000 1c 03 05 00 00 00 01 01 00 00 00 00 00 00 00 00 277 | 0010 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 278 | 0020 e3 47 00 80 63 aa aa 91 80 80 80 80 02 02 02 01 279 | 0030 00 0d 02 01 7f 01 01 80 ff 80 80 80 80 80 97 00 280 | 281 | 282 | Fender Bassman TV 283 | 284 | 0000 1c 03 05 00 00 00 01 01 00 00 00 00 00 00 00 00 285 | 0010 97 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 286 | 0020 e9 aa 80 63 55 55 9c 80 80 80 80 80 03 03 03 00 287 | 0030 00 0a 03 01 7f 01 01 80 ff 80 80 80 ff 80 98 00 288 | 289 | 290 | Fender Bassman 300 291 | 292 | 0000 1c 03 05 00 00 00 01 01 00 00 00 00 00 00 00 00 293 | 0010 98 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 294 | 0020 c7 42 80 80 80 80 80 80 80 80 80 80 04 04 04 01 295 | 0030 00 05 04 01 7f 01 01 80 ff 80 80 80 8e 80 99 00 296 | 297 | 298 | SWR Redhead 299 | 300 | 0000 1c 03 05 00 00 00 01 01 00 00 00 00 00 00 00 00 301 | 0010 99 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 302 | 0020 80 aa 80 ff 80 80 aa 80 63 80 80 80 05 05 05 00 303 | 0030 00 02 05 01 7d 01 01 80 ff 80 80 80 80 80 9a 00 304 | 305 | 306 | Rockin' Peg 307 | 308 | 0000 1c 03 05 00 00 00 01 01 00 00 00 00 00 00 00 00 309 | 0010 9a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 310 | 0020 aa aa 80 ff 9c 47 9c 80 80 80 80 80 06 06 06 01 311 | 0030 00 06 06 01 7e 01 01 80 ff 80 80 80 80 80 9b 00 312 | 313 | 314 | KGB 800 315 | 316 | 0000 1c 03 05 00 00 00 01 01 00 00 00 00 00 00 00 00 317 | 0010 9b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 318 | 0020 f1 aa ff aa 80 80 9c 80 80 80 80 80 07 07 07 00 319 | 0030 00 04 07 01 7b 01 01 80 ff 80 80 80 80 80 bd 00 320 | 321 | 322 | Monster 323 | 324 | 0000 1c 03 05 00 00 00 01 01 00 00 00 00 00 00 00 00 325 | 0010 bd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 326 | 0020 e3 80 80 e3 55 47 aa 80 80 80 80 80 08 08 08 01 327 | 0030 00 09 08 01 7f 01 01 80 ff 80 80 80 42 e3 00 00 328 | 329 | --Effects-- 330 | - 331 | Stomp Box- 332 | 333 | Data format for setting an effect is: 334 | 335 | 0 1 336 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 337 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 338 | 00 | 1c| 03|DSP| 00 | 01| 01| 00 | 339 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 340 | 16 |fxm| 00|slt| ??| ??| ??| 00 | 341 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 342 | 32 |kb1|kb2|kb3|kb4|kb5|kb6| 00 | 343 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 344 | 48 | 00 | 345 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 346 | 00 1c 03 06 00 00 00 01 01 00 00 00 00 00 00 00 00 347 | 10 c6 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 348 | 20 55 aa aa aa 55 80 00 00 00 00 00 00 00 00 00 00 349 | 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 350 | 351 | DSP: 352 | 06 Modern Bass Overdrive 353 | 354 | Knobs: kb1 -kb6 = 00-05 355 | 356 | 00 Level 357 | 01 Drive 358 | 02 Blend 359 | 04 Bass 360 | 05 Trebble 361 | 05 Presence 362 | 363 | 364 | 365 | 366 | 367 | MODERN OD (Overdrive) 368 | 369 | c6: 370 | 371 | Level Drive Blend Bass Treb Pres 372 | 373 | 0000 1c 03 06 00 00 00 01 01 00 00 00 00 00 00 00 00 374 | 0010 c6 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 375 | 0020 55 aa aa aa 55 80 00 00 00 00 00 00 00 00 00 00 376 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 377 | 378 | 379 | 0000 1c 01 06 00 00 00 01 01 00 00 00 00 00 00 00 00 380 | 0010 c6 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 381 | 0020 ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 382 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 383 | 384 | 385 | Overdrive 386 | Level Gain Blend Low Mid High 387 | 388 | 0000 1c 03 06 00 00 00 01 01 00 00 00 00 00 00 00 00 389 | 0010 c3 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 390 | 0020 80 aa 80 80 55 55 00 00 00 00 00 00 00 00 00 00 391 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 392 | 393 | 0000 1c 01 06 00 00 00 01 01 00 00 00 00 00 00 00 00 394 | 0010 c3 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 395 | 0020 ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 396 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 397 | 398 | 399 | Fuzz 400 | Level Gain Oktave Low High Blend 401 | 402 | 0000 1c 03 06 00 00 00 01 01 00 00 00 00 00 00 00 00 403 | 0010 c4 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 404 | 0020 53 aa 00 aa 00 55 00 00 00 00 00 00 00 00 00 00 405 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 406 | 407 | 0000 1c 01 06 00 00 00 01 01 00 00 00 00 00 00 00 00 408 | 0010 c4 00 00 00 08 01 01 00 00 00 00 00 00 00 00 00 409 | 0020 ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 410 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 411 | 412 | 413 | Greenbox 414 | 415 | Level Gain Tone Blend 416 | 417 | 0000 1c 03 06 00 00 00 01 01 00 00 00 00 00 00 00 00 418 | 0010 ba 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 419 | 0020 80 80 80 42 00 00 00 00 00 00 00 00 00 00 00 00 420 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 421 | 422 | 0000 1c 01 06 00 00 00 01 01 00 00 00 00 00 00 00 00 423 | 0010 ba 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 424 | 0020 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 425 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 426 | 427 | 428 | Simple Comp 429 | 430 | Type 00-03 431 | 432 | 0000 1c 03 06 00 00 00 01 01 00 00 00 00 00 00 00 00 433 | 0010 88 00 00 08 08 01 00 00 00 00 00 00 00 00 00 00 434 | 0020 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 435 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 436 | 437 | 0000 1c 01 06 00 00 00 01 01 00 00 00 00 00 00 00 00 438 | 0010 88 00 00 08 08 01 00 00 00 00 00 00 00 00 00 00 439 | 0020 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 440 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 441 | 442 | 443 | --Mod/Filter-- 444 | 445 | Sinus Chorus 446 | 447 | Level Rate Depth AVG DLY LRPhase 448 | 0000 1c 03 07 00 00 00 01 01 00 00 00 00 00 00 00 00 449 | 0010 12 00 00 01 01 01 00 00 00 00 00 00 00 00 00 00 450 | 0020 ff 05 80 05 80 00 00 00 00 00 00 00 00 00 00 00 451 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 452 | 453 | 0000 1c 01 07 00 00 00 01 01 00 00 00 00 00 00 00 00 454 | 0010 12 00 00 01 01 01 00 00 00 00 00 00 00 00 00 00 455 | 0020 ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 456 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 457 | 458 | Triangle Chourus 459 | Level Rate Depth AVGDLY LRPhase 460 | 0000 1c 03 07 00 00 00 01 01 00 00 00 00 00 00 00 00 461 | 0010 13 00 00 01 01 01 00 00 00 00 00 00 00 00 00 00 462 | 0020 ff 0e 19 19 80 00 00 00 00 00 00 00 00 00 00 00 463 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 464 | 465 | 466 | Sin Flanger 467 | Level Rate Depth FDBack LRPhase 468 | 469 | 0000 1c 03 07 00 00 00 01 01 00 00 00 00 00 00 00 00 470 | 0010 18 00 00 01 01 01 00 00 00 00 00 00 00 00 00 00 471 | 0020 ff 0e 80 80 80 00 00 00 00 00 00 00 00 00 00 00 472 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 473 | 474 | 475 | Triangel Flanger 476 | Level Rate Depth FDBack LRPhase 477 | 0000 1c 03 07 00 00 00 01 01 00 00 00 00 00 00 00 00 478 | 0010 19 00 00 01 01 01 00 00 00 00 00 00 00 00 00 00 479 | 0020 ff 00 ff ff 80 00 00 00 00 00 00 00 00 00 00 00 480 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 481 | 482 | 483 | Vibratone 484 | Level Rotor Death FDBack LRPhase 485 | 486 | 0000 1c 03 07 00 00 00 01 01 00 00 00 00 00 00 00 00 487 | 0010 2d 00 00 01 01 01 00 00 00 00 00 00 00 00 00 00 488 | 0020 e3 38 27 ad 82 00 00 00 00 00 00 00 00 00 00 00 489 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 490 | 491 | 492 | Phaser 493 | Level Rate Deph FDBack Shape 494 | 0000 1c 03 07 00 00 00 01 01 00 00 00 00 00 00 00 00 495 | 0010 4f 00 00 01 01 01 00 00 00 00 00 00 00 00 00 00 496 | 0020 ff 11 fd 58 00 00 00 00 00 00 00 00 00 00 00 00 497 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 498 | 499 | 0000 1c 01 07 00 00 00 01 01 00 00 00 00 00 00 00 00 500 | 0010 4f 00 00 01 01 01 00 00 00 00 00 00 00 00 00 00 501 | 0020 ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00 502 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 503 | 504 | 505 | Step Filter 506 | Level Rate Resnnce MinFreq MaxFreq 507 | 508 | 0000 1c 03 07 00 00 00 01 01 00 00 00 00 00 00 00 00 509 | 0010 29 00 00 01 01 01 00 00 00 00 00 00 00 00 00 00 510 | 0020 ff 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 511 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 512 | 513 | 514 | Envelope 515 | Level Mode Type Q Thresh 516 | 517 | 0000 1c 03 07 00 00 00 01 01 00 00 00 00 00 00 00 00 518 | 0010 c5 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 519 | 0020 ff 00 01 80 80 00 00 00 00 00 00 00 00 00 00 00 520 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 521 | 522 | 0000 1c 01 07 00 00 00 01 01 00 00 00 00 00 00 00 00 523 | 0010 c5 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 524 | 0020 ff 03 02 ff ff 00 00 00 00 00 00 00 00 00 00 00 525 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 526 | 527 | 528 | Oktaver 529 | Direct Octave Sizzle 530 | 531 | 0000 1c 03 07 00 00 00 01 01 00 00 00 00 00 00 00 00 532 | 0010 bc 00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 533 | 0020 ff ff 80 00 00 00 00 00 00 00 00 00 00 00 00 00 534 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 535 | 536 | 537 | 538 | --Delay-- 539 | 540 | Mono 541 | Level DLYTime FDBack Bright Attnuat 542 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 543 | 0010 16 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 544 | 0020 ff 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 545 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 546 | 547 | 548 | 549 | Ducking 550 | Level DLYTime DSBack Release Thresh 551 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 552 | 0010 15 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 553 | 0020 ff 3d 6b ff 00 00 00 00 00 00 00 00 00 00 00 00 554 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 555 | 556 | Multitap 557 | Level DLYTime FDBack Bright Mode 558 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 559 | 0010 44 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 560 | 0020 ff 80 00 80 02 00 00 00 00 00 00 00 00 00 00 00 561 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 562 | 563 | 0000 1c 01 08 00 00 00 01 01 00 00 00 00 00 00 00 00 564 | 0010 44 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 565 | 0020 ff ff ff ff 03 00 00 00 00 00 00 00 00 00 00 00 566 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 567 | 568 | 569 | Ping Pong 570 | Level DLYTime FDBack Bright Stereo 571 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 572 | 0010 45 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 573 | 0020 ff 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 574 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 575 | 576 | 577 | Reverse 578 | Level DLYTime FFDBK RFDBK Tone 579 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 580 | 0010 46 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 581 | 0020 ff 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 582 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 583 | 584 | 585 | Tape 586 | Level DLYTime FDBack Flutter Bright Stereo 587 | 588 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 589 | 0010 2b 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 590 | 0020 7d 1c 00 63 80 00 00 00 00 00 00 00 00 00 00 00 591 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 592 | 593 | 594 | Stereo Tape 595 | Level DLYTime FDBack Flutter Separatn Bright 596 | 597 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 598 | 0010 2a 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 599 | 0020 7d 88 1c 63 ff 80 00 00 00 00 00 00 00 00 00 00 600 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 601 | 602 | Mono Echo Filter 603 | Level DLYTime FDBack Freq Resnnce INLVL 604 | 605 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 606 | 0010 43 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 607 | 0020 80 55 55 38 80 ff 00 00 00 00 00 00 00 00 00 00 608 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 609 | 610 | Stereo Echo Filter 611 | Level DLYTime FDBack Freq Resnnce INLVL 612 | 613 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 614 | 0010 48 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00 615 | 0020 80 b3 80 38 80 ff 00 00 00 00 00 00 00 00 00 00 616 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 617 | 618 | 619 | Pitch Shift 620 | Level Pitch Detune FDBack PREDly 621 | 0000 1c 03 08 00 00 00 01 01 00 00 00 00 00 00 00 00 622 | 0010 bb 00 00 01 08 01 00 00 00 00 00 00 00 00 00 00 623 | 0020 c7 3e 80 00 00 00 00 00 00 00 00 00 00 00 00 00 624 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 625 | 626 | 627 | 628 | 629 | --Reverb-- 630 | 631 | Smal Hall 632 | Level Decay DWell Diffuse Tone 633 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 634 | 0010 24 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 635 | 0020 6e 5d 6e 80 91 00 00 00 00 00 00 00 00 00 00 00 636 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 637 | 638 | 639 | Large Hall 640 | Level Decay Dwell Diffusn Tone 641 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 642 | 0010 3a 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 643 | 0020 4f 3e 80 05 b0 00 00 00 00 00 00 00 00 00 00 00 644 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 645 | 646 | 647 | Small Room 648 | Level Decay Dwell Diffusn Tone 649 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 650 | 0010 26 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 651 | 0020 80 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 652 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 653 | 654 | Large Room 655 | Level Decay Dwell Diffusn Tone 656 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 657 | 0010 3b 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 658 | 0020 80 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 659 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 660 | 661 | Small Plate 662 | Level Decay Dwell Diffusn Tone 663 | 664 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 665 | 0010 4e 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 666 | 0020 80 8e 1c 80 80 00 00 00 00 00 00 00 00 00 00 00 667 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 668 | 669 | Large Plate 670 | Level Decay Dwell Diffusn Tone 671 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 672 | 0010 4b 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 673 | 0020 38 80 91 80 b6 00 00 00 00 00 00 00 00 00 00 00 674 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 675 | 676 | 677 | 678 | Ambienete 679 | Level Decay Dwell Diffusn Tone 680 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 681 | 0010 4c 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 682 | 0020 ff 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 683 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 684 | 685 | 686 | 687 | Arena 688 | Level Decay Dwell Diffusn Tone 689 | 690 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 691 | 0010 4d 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 692 | 0020 ff 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 693 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 694 | 695 | 696 | '63 Fender Spring 697 | Level Decay Dwell Diffusn Tone 698 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 699 | 0010 21 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 700 | 0020 80 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 701 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 702 | 703 | 704 | 705 | '65 Fender Spring 706 | Level Decay Dwell Diffusn Tone 707 | 708 | 0000 1c 03 09 00 00 00 01 01 00 00 00 00 00 00 00 00 709 | 0010 0b 00 01 00 08 01 00 00 00 00 00 00 00 00 00 00 710 | 0020 80 8b 49 ff 80 00 00 00 00 00 00 00 00 00 00 00 711 | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | -------------------------------------------------------------------------------- /doc/fender_mustang_protocol.txt: -------------------------------------------------------------------------------- 1 | Technicalities 2 | 3 | Here I want to put all the info I have about how Mustang amp works 4 | under the hood. 5 | 6 | Table of contents 7 | 8 | Overview 9 | Connecting 10 | Setting amp 11 | Setting and clearing effects 12 | Saving settings on amplifier 13 | Choosing memory bank 14 | Captured data 15 | 16 | 1. Overview 17 | 18 | It has five DSPs. One for each effect family and one for amplifier 19 | emulation. DSPs are addressed from 5 to 9. I don't know why first five 20 | addresses are omitted and if this means anything. DSPs with their 21 | functionality are as follows: 22 | 23 | 0x05 - amplifier emulation 24 | 0x06 - stompbox effects 25 | 0x07 - modulation effects 26 | 0x08 - delay effects 27 | 0x09 - reverb effects 28 | 29 | I also have found packets with device address 0x0a but don't know what this is. 30 | 31 | 2. Connecting 32 | 33 | All the transmission between program and amplifier is using USB 34 | interrupt transfer. Endpoint to which you want to send data is 0x01 35 | and USB interface which you want to claim is 0x00. If you want to 36 | receive data from amplifier use endpoint 0x81. 37 | 38 | Each packet carries 64 bytes of data. 39 | 40 | When connecting you should send two packets to the amp and get 41 | response for each of them. First should have value "0xc3" set on the 42 | first position (counting from zero) and second values "0x1a" and 43 | "0x03" on zeroth and first position. 44 | 45 | After that a packet asking for amp's settings is send. The packet is 46 | of form "0xff" on zeroth and "0xc1" on first position. Amplifier 47 | responds to that sending: 48 | 49 | names of all presets in the form: 50 | 51 | packet with name in a form: values "0x1c 0x01 0x04" as first 52 | three bytes, then slot number on forth byte and name encoded 53 | in ASCII on 32 bytes starting from sixteenth 54 | 55 | packet with two first bytes and forth (slot of the preset) the 56 | same as in name packet 57 | 58 | current state of the amp in the form: 59 | 60 | name of the current preset in the form as described above 61 | 62 | amplifiers setting in the form the same as when setting 63 | amplifier's settings (below) except that first byte is not 64 | "0x03" but "0x01" and preset number encoded on the forth byte 65 | 66 | settings of four effects as described below with the same 67 | change to the first byte as in amplifier's settings and preset 68 | number encoded on the forth byte 69 | 70 | setting of some mysterious device with address "0x0a" 71 | 72 | confirmation packet same as in preset names 73 | 74 | names with settings of all presets on the Mod and Dly/Rev knobs 75 | (first all settings for Mod knob then all settings for Dly/Rev 76 | knob) in the form: 77 | 78 | name of the preset in the form: values "0x1c 0x01 0x04" as 79 | first three bytes, value "0x01" for Mod or "0x02" for Dly/Rev 80 | knob on third position, slot number on forth position (counted 81 | from zero), name encoded in ASCII on 24 bytes starting from 82 | sixteenth byte 83 | 84 | settings of the effect in the same form as for setting the 85 | effect (below) except that first byte is "0x01" not "0x03" and 86 | preset number encoded on the forth byte 87 | 88 | This packet is set only when sending Dly/Rev presets Dly/Rev 89 | knob hold settings for two effects so the next packet carries 90 | info about second effect, if effect is not set the packet have 91 | the same form as packet for clearing effect except that first 92 | byte is "0x01" not "0x03" and preset number encoded on the 93 | forth byte 94 | 95 | confirmation packet with values "0x1c 0x01" on zeroth and 96 | first byte, "0x01" or "0x02" depending on the knob on third 97 | byte and preset number encoded on the forth byte 98 | 99 | Wireshark file with whole initialization communication can be found here. 100 | 101 | 3. Setting amp 102 | 103 | Format of data for setting amp is as follow: 104 | 105 | 0 1 106 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 107 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 108 | 00 | 1c| 03|DSP| 00 | 01| 01| 00 | 109 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 110 | 16 |mod| 00 | 111 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 112 | 32 |vol|gai|ga2|mvl|tre|mid|bas|prs|?? |dep|bis|?? | number |ng | 113 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 114 | 48 |ths|cab|?? |sag|bri| 01|?? | 00 | 115 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 116 | 117 | DSP - for amplifier it is always 5 118 | mod - amplifier model; different for each emulated amp 119 | vol - volume 120 | gai - gain 121 | ga2 - gain 2 122 | mvl - master volume 123 | tre - treble 124 | mid - middle 125 | bas - bass 126 | prs - presence 127 | dep - depth 128 | bis - bias 129 | number - don't know what this is; different for each emulated amp 130 | ng - noise gate; value 0x00 - 0x05 131 | ths - threshold; value 0x00 - 0x09 132 | cab - cabinet; value 0x00 - 0x0c 133 | sag - sag; value 0x00 - 0x02 134 | bri - brightness; value 0x00-0x01 135 | ?? - values which I haven't decoded yet; different for each emulated amp 136 | 137 | After packet with data described above you have to send a packet which 138 | will tell the amp to actually apply the settings. This packet have 139 | zeroth byte set to "0x1c", first to "0x03" and all other to "0x00". 140 | 141 | 4. Setting and clearing effects 142 | 143 | Data format for setting an effect is: 144 | 145 | 0 1 146 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 147 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 148 | 00 | 1c| 03|DSP| 00 | 01| 01| 00 | 149 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 150 | 16 |fxm| 00|slt| ??| ??| ??|en | 00 | 151 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 152 | 32 |kb1|kb2|kb3|kb4|kb5|kb6| 00 | 153 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 154 | 48 | 00 | 155 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 156 | 157 | DSP - can be either 6, 7, 8 or 9; depends on effect familly 158 | fxm - effect model; independent for each effect 159 | slt - slot; before amp have numbers from 0 to 3, after from 4 to 7 160 | kb1, kb2, kb3, kb4, kb5, kb6 - knobs values; not every time 161 | all are used; maximum value of the knob depends on the effect 162 | ?? - some strange numbers specific for each effect 163 | en - Effect state (1 = off, 0 = on) 164 | 165 | If you want to remove the effect send normal effect-setting packet but 166 | set "effect model" and knobs fields to zeros. I haven't tried what 167 | happens if you send such packet to DSP 0x05. 168 | 169 | "Execute" command for both setting and clearing the effect is the same 170 | as for the amp setting. 171 | 172 | 5. Saving settings on amplifier 173 | 174 | Saving settings is very easy since you don't have to transmit all the 175 | settings which you want to store. You only send a command containing 176 | slot number and name for a preset. Data are taken directly from DSPs. 177 | 178 | Packet format is: 179 | 180 | 0 1 181 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 182 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 183 | 00 | 1c| 01| 03| 00|SLT| 00| 01| 01| 00 | 184 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 185 | 16 | name | 186 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 187 | 32 | name | 188 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 189 | 48 | 00 | 190 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 191 | 192 | SLT - memory bank to which to save settings; value 0x00 - 0x17 193 | 194 | name - name of the preset ended with "\0"; if not all fields are used 195 | used the rest is set to 0x00 196 | 197 | Fender FUSE after saving settings chooses memory bank it just 198 | saved. PLUG also does this. 199 | 200 | 6. Choosing memory bank 201 | 202 | "Choose memory bank" command looks like this: 203 | 204 | 0 1 205 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 206 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 207 | 00 | 1c| 01| 01| 00|SLT| 00| 01| 00 | 208 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 209 | 16 | 00 | 210 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 211 | 32 | 00 | 212 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 213 | 48 | 00 | 214 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 215 | 216 | SLT - memory bank to choose 217 | 218 | After choosing memory bank amplifier send you settings of that bank. 219 | 220 | 7. Captured data 221 | 222 | Wireshark file with whole initialization communication can be found 223 | here: http://piorekf.org/plug/files/initialization.log And here are 224 | data from captured packets for setting all the amps and effects (only 225 | hex part, the rest are my scribbles): 226 | 227 | AMPLIFIERS: 228 | 229 | fender 57 deluxe: 230 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 231 | 67:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 232 | aa:99:80:80:be:80:80:80 80:80:80:80:01:01:01:00 233 | 00:01:01:01:00:01:53:00 00:00:00:00:00:00:00:00 234 | 0-10: gain[6] volume[7] treble[7.5] middle[5] bass[5] 235 | NG: off -> threshold: 0/10 depth: mid sag: 2/3 bias: mid cabinet: 57dlx 236 | 237 | fender 59 bassman: 238 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 239 | 64:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 240 | aa:a2:80:80:80:7a:a2:91 80:80:80:80:02:02:02:00 241 | 00:02:02:01:00:01:67:00 00:00:00:00:00:00:00:00 242 | 0-10: gain[6.5] volume[7] treble[5] middle[~5] bass[6.5] presence[~6] 243 | 244 | blend: mid NG: off -> threshold: 0/10 depth: mid sag: 2/3 bias: mid 245 | cabinet: bssmn 246 | 247 | fender 57 champ: 248 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 249 | 7c:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 250 | aa:b3:00:ff:80:80:80:80 80:80:80:80:0c:0c:0c:00 251 | 00:05:0c:01:00:01:00:00 00:00:00:00:00:00:00:00 252 | 0-10: gain[7] volume[~7] treble[5] middle[5] bass[5] 253 | NG: off -> threshold: 0/10 depth: mid sag: 2/3 bias: mid cabinet: champ 254 | 255 | fender 65 deluxe reverb: 256 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 257 | 53:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 258 | aa:71:00:ff:91:cf:38:00 00:00:80:00:03:03:03:00 259 | 00:03:03:01:00:01:6a:00 00:00:00:00:00:00:00:00 260 | 261 | 1-10: gain[5] volume[7] treble[6.25] middle[8.75] bass[3] -reverb[~1] 262 | -speed[7] -intensivity[9] 263 | 264 | NG: off -> threshold: 0/10 depth: 0 sag: 2/3 bias: mid cabinet: 65dlx 265 | 266 | fender 65 princeton: 267 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 268 | 6a:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 269 | aa:55:00:ff:99:cc:4c:80 80:80:80:80:04:04:04:00 270 | 00:04:04:01:00:01:61:00 00:00:00:00:00:00:00:00 271 | 272 | 1-10: gain[4] volume[7] treble[6.5] middle[8.5] bass[4] -reverb[5.5] 273 | -speed[7] -intensivity[9] 274 | 275 | NG: off -> threshold: 0/10 depth: mid sag: 2/3 bias: mid cabinet: 276 | 65prn 277 | 278 | fender 65 twin reverb: 279 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 280 | 75:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 281 | aa:55:80:63:b3:bb:aa:80 80:80:80:80:05:05:05:00 282 | 00:09:05:01:00:01:72:00 00:00:00:00:00:00:00:00 283 | 284 | 1-10: +bright gain[4] volume[7] treble[7.5] middle[8] bass[7] 285 | -reverb[5.5] -speed[7] -intensivity[9] 286 | 287 | NG: off -> threshold: 0/10 depth: mid sag: 2/3 bias: mid cabinet: 288 | 65twn 289 | 290 | fender super sonic: 291 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 292 | 72:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 293 | aa:bb:82:55:99:a2:99:80 80:80:80:80:06:06:06:02 294 | 00:0c:06:01:00:01:79:00 00:00:00:00:00:00:00:00 295 | 296 | 1-10: gain[7.5] gain2[5.5] volume[7] treble[6.5] middle[7] bass[6.5] 297 | -reverb[5.5] 298 | 299 | master vol: 33% NG: mid -> threshold: 0/10 depth: mid sag: 2/3 bias: 300 | mid cabinet: ss112 301 | 302 | british 60s: 303 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 304 | 61:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 305 | aa:a2:80:63:99:80:b0:00 80:80:80:80:07:07:07:00 306 | 00:07:07:01:00:01:5e:00 00:00:00:00:00:00:00:00 307 | 308 | 0-10: +bright gain[6.5] volume[7] treble[6] middle[5] bass[7] 309 | -speed[7] -depth[8.75] cut[0] 310 | 311 | NG: off -> threshold: 0/10 depth: mid sag: 2/3 bias: mid cabinet: 312 | 2x12c 313 | 314 | british 70s: 315 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 316 | 79:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 317 | aa:ff:80:7d:aa:5b:c4:80 80:80:80:80:0b:0b:0b:01 318 | 00:08:0b:01:00:01:7c:00 00:00:00:00:00:00:00:00 319 | 320 | 0-10: gain[10] volume[7] treble[7] middle[3] bass[8] presence[5] 321 | 322 | blend: mid NG: low -> threshold: 0/10 depth: mid sag: 2/3 bias: mid 323 | cabinet: 4x12g 324 | 325 | british 80s: 326 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 327 | 5e:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 328 | aa:ff:80:7d:aa:5b:c4:80 80:80:80:80:09:09:09:01 329 | 00:06:09:01:00:01:5d:00 00:00:00:00:00:00:00:00 330 | 331 | 0-10: gain[10] volume[7] treble[7] middle[3] bass[8] presence[5] 332 | 333 | master vol: 50% NG: low -> threshold: 0/10 depth: mid sag: 2/3 bias: 334 | mid cabinet: 4x12m 335 | 336 | american 90s: 337 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 338 | 5d:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 339 | aa:8e:80:66:a4:19:c7:71 80:80:80:80:0a:0a:0a:03 340 | 00:0a:0a:01:00:01:6d:00 00:00:00:00:00:00:00:00 341 | 342 | ?1-10?: gain[~1/2] volume[2/3] treble[2/3] middle[~1/10] bass[3/4] 343 | presence[~1/2] 344 | 345 | master vol: 33% NG: high -> threshold: 0/10 depth: mid sag: 2/3 bias: 346 | mid cabinet: 4x12v 347 | 348 | metal 2000: 349 | 1c:03:05:00:00:00:01:01 00:00:00:00:00:00:00:00 350 | 6d:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 351 | aa:a4:80:55:99:4c:91:8e 80:80:80:80:08:08:08:02 352 | 00:08:08:01:00:01:75:00 00:00:00:00:00:00:00:00 353 | 354 | 0-10: gain[6.5] volume[7] treble[6] middle[3] bass[6] presence[5.5] 355 | 356 | master vol: 33% NG: mid -> threshold: 0/10 depth: mid sag: 2/3 bias: 357 | mid cabinet: 4x12g 358 | 359 | 360 | 361 | EFFECTS: 362 | 363 | overdrive: 364 | 1c:03:06:00:00:00:01:01 00:00:00:00:00:00:00:00 365 | 3c:00:03:00:08:01:00:00 00:00:00:00:00:00:00:00 366 | 80:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 367 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 368 | level gain low mid high 369 | 370 | fixed wah: 371 | 1c:03:06:00:00:00:01:01 00:00:00:00:00:00:00:00 372 | 49:00:03:01:08:01:00:00 00:00:00:00:00:00:00:00 373 | 80:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 374 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 375 | level frequency min frequency max frequency q 376 | 377 | touch wah: 378 | 1c:03:06:00:00:00:01:01 00:00:00:00:00:00:00:00 379 | 4a:00:03:01:08:01:00:00 00:00:00:00:00:00:00:00 380 | 80:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 381 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 382 | level sensivity min frequency max frequency q 383 | 384 | fuzz: 385 | 1c:03:06:00:00:00:01:01 00:00:00:00:00:00:00:00 386 | 1a:00:03:00:08:01:00:00 00:00:00:00:00:00:00:00 387 | 80:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 388 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 389 | level gain octave low high 390 | 391 | fuzz touch wah: 392 | 1c:03:06:00:00:00:01:01 00:00:00:00:00:00:00:00 393 | 1c:00:03:00:08:01:00:00 00:00:00:00:00:00:00:00 394 | 80:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 395 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 396 | level gain sensivity octave peak 397 | 398 | simple comp (1 knob): 399 | 1c:03:06:00:00:00:01:01 00:00:00:00:00:00:00:00 400 | 88:00:03:08:08:01:00:00 00:00:00:00:00:00:00:00 401 | 01:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 402 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 403 | type[0-3] 404 | 405 | compressor: 406 | 1c:03:06:00:00:00:01:01 00:00:00:00:00:00:00:00 407 | 07:00:03:00:08:01:00:00 00:00:00:00:00:00:00:00 408 | 8d:0f:4f:7f:7f:00:00:00 00:00:00:00:00:00:00:00 409 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 410 | level threshhold ratio attack release 411 | 412 | 413 | 414 | sine chorus: 415 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 416 | 12:00:02:01:01:01:00:00 00:00:00:00:00:00:00:00 417 | ff:0e:19:19:80:00:00:00 00:00:00:00:00:00:00:00 418 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 419 | level rate depth average delay lr phase 420 | 421 | triangle chorus: 422 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 423 | 13:00:02:01:01:01:00:00 00:00:00:00:00:00:00:00 424 | 5d:0e:19:19:80:00:00:00 00:00:00:00:00:00:00:00 425 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 426 | level rate depth average delay lr phase 427 | 428 | sine flanger: 429 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 430 | 18:00:02:01:01:01:00:00 00:00:00:00:00:00:00:00 431 | ff:0e:80:80:80:00:00:00 00:00:00:00:00:00:00:00 432 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 433 | level rate depth feedback lr phase 434 | 435 | triangle flanger: 436 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 437 | 19:00:02:01:01:01:00:00 00:00:00:00:00:00:00:00 438 | ff:00:ff:33:41:00:00:00 00:00:00:00:00:00:00:00 439 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 440 | level rate depth feedback lr phase 441 | 442 | vibratone: 443 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 444 | 2d:00:02:01:01:01:00:00 00:00:00:00:00:00:00:00 445 | f4:ff:27:ad:82:00:00:00 00:00:00:00:00:00:00:00 446 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 447 | level rotor depth feedback lr phase 448 | 449 | vintage tremolo: 450 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 451 | 40:00:02:01:01:01:00:00 00:00:00:00:00:00:00:00 452 | db:ad:63:f4:f1:00:00:00 00:00:00:00:00:00:00:00 453 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 454 | level rate duty cycle attack release 455 | 456 | sine tremolo: 457 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 458 | 41:00:02:01:01:01:00:00 00:00:00:00:00:00:00:00 459 | db:99:7d:00:00:00:00:00 00:00:00:00:00:00:00:00 460 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 461 | level rate duty cycle lfo clipping tri shaping 462 | 463 | ring modulator: 464 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 465 | 22:00:02:01:08:01:00:00 00:00:00:00:00:00:00:00 466 | ff:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 467 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 468 | level frequency depth lfo shape[0-1] lfo phase 469 | 470 | step filter: 471 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 472 | 29:00:02:01:01:01:00:00 00:00:00:00:00:00:00:00 473 | ff:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 474 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 475 | level rate resonance min frequency max frequency 476 | 477 | phaser: 478 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 479 | 4f:00:02:01:01:01:00:00 00:00:00:00:00:00:00:00 480 | fd:00:fd:b8:00:00:00:00 00:00:00:00:00:00:00:00 481 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 482 | level rate depth feedback lfo shape[0-1] 483 | 484 | pitch shifter: 485 | 1c:03:07:00:00:00:01:01 00:00:00:00:00:00:00:00 486 | 1f:00:02:01:08:01:00:00 00:00:00:00:00:00:00:00 487 | c7:3e:80:00:00:00:00:00 00:00:00:00:00:00:00:00 488 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 489 | level pitch detune feedback predelay 490 | 491 | 492 | 493 | mono delay: 494 | 1c:03:08:00:00:00:01:01 00:00:00:00:00:00:00:00 495 | 16:00:02:02:01:01:00:00 00:00:00:00:00:00:00:00 496 | ff:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 497 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 498 | level delay time feedback brightness attenuation 499 | 500 | mono echo filter (6 knobs): 501 | 1c:03:08:00:00:00:01:01 00:00:00:00:00:00:00:00 502 | 43:00:02:02:01:01:00:00 00:00:00:00:00:00:00:00 503 | ff:80:80:80:80:80:00:00 00:00:00:00:00:00:00:00 504 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 505 | level delay time feedback frequency ressonance input level 506 | 507 | stereo echo filter (6 knobs): 508 | 1c:03:08:00:00:00:01:01 00:00:00:00:00:00:00:00 509 | 48:00:02:02:01:01:00:00 00:00:00:00:00:00:00:00 510 | 80:b3:80:80:80:80:00:00 00:00:00:00:00:00:00:00 511 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 512 | level delay time feedback frequency ressonance input level 513 | 514 | multitap delay: 515 | 1c:03:08:00:00:00:01:01 00:00:00:00:00:00:00:00 516 | 44:00:02:02:01:01:00:00 00:00:00:00:00:00:00:00 517 | ff:80:66:80:80:00:00:00 00:00:00:00:00:00:00:00 518 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 519 | level delay time feedback brightness attenuation 520 | 521 | ping pong delay: 522 | 1c:03:08:00:00:00:01:01 00:00:00:00:00:00:00:00 523 | 45:00:02:02:01:01:00:00 00:00:00:00:00:00:00:00 524 | ff:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 525 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 526 | level delay time feedback brightness attenuation 527 | 528 | ducking delay: 529 | 1c:03:08:00:00:00:01:01 00:00:00:00:00:00:00:00 530 | 15:00:02:02:01:01:00:00 00:00:00:00:00:00:00:00 531 | ff:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 532 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 533 | level delay time feedback release threshold 534 | 535 | reverse delay: 536 | 1c:03:08:00:00:00:01:01 00:00:00:00:00:00:00:00 537 | 46:00:02:02:01:01:00:00 00:00:00:00:00:00:00:00 538 | ff:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 539 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 540 | level delay time feedback brightness attenuation 541 | 542 | tape delay (6 knobs): 543 | 1c:03:08:00:00:00:01:01 00:00:00:00:00:00:00:00 544 | 2b:00:02:02:01:01:00:00 00:00:00:00:00:00:00:00 545 | 7d:1c:00:63:80:00:00:00 00:00:00:00:00:00:00:00 546 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 547 | level delay time feedback flutter brightness stereo 548 | 549 | stereo tape delay (6 knobs): 550 | 1c:03:08:00:00:00:01:01 00:00:00:00:00:00:00:00 551 | 2a:00:02:02:01:01:00:00 00:00:00:00:00:00:00:00 552 | 7d:88:1c:63:ff:80:00:00 00:00:00:00:00:00:00:00 553 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 554 | level delay time feedback flutter separation brightness 555 | 556 | 557 | 558 | small hall reverb: 559 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 560 | 24:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 561 | 6e:5d:6e:80:91:00:00:00 00:00:00:00:00:00:00:00 562 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 563 | level decay dwell diffusion tone 564 | 565 | large hall reverb: 566 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 567 | 3a:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 568 | 4f:3e:80:05:b0:00:00:00 00:00:00:00:00:00:00:00 569 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 570 | level decay dwell diffusion tone 571 | 572 | small room reverb: 573 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 574 | 26:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 575 | 80:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 576 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 577 | level decay dwell diffusion tone 578 | 579 | large room reverb: 580 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 581 | 3b:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 582 | 80:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 583 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 584 | level decay dwell diffusion tone 585 | 586 | small plate reverb: 587 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 588 | 4e:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 589 | 80:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 590 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 591 | level decay dwell diffusion tone 592 | 593 | large plate reverb: 594 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 595 | 4b:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 596 | 38:80:91:80:b6:00:00:00 00:00:00:00:00:00:00:00 597 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 598 | level decay dwell diffusion tone 599 | 600 | ambient reverb: 601 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 602 | 4c:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 603 | ff:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 604 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 605 | level decay dwell diffusion tone 606 | 607 | arena reverb: 608 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 609 | 4d:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 610 | ff:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 611 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 612 | level decay dwell diffusion tone 613 | 614 | '63 fender spring reverb: 615 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 616 | 21:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 617 | 80:80:80:80:80:00:00:00 00:00:00:00:00:00:00:00 618 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 619 | level decay dwell diffusion tone 620 | 621 | '65 fender spring reverb: 622 | 1c:03:09:00:00:00:01:01 00:00:00:00:00:00:00:00 623 | 0b:00:02:00:08:01:00:00 00:00:00:00:00:00:00:00 624 | 80:8b:49:ff:80:00:00:00 00:00:00:00:00:00:00:00 625 | 00:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 626 | level decay dwell diffusion tone 627 | 628 | ====================================================================== 629 | 630 | Toggling effect on/off: 631 | 632 | 0 1 633 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 634 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 635 | 00 | 19| c3|fam| st|slt| 00 | 636 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 637 | 16 | 00 | 638 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 639 | 32 | 00 | 640 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 641 | 48 | 00 | 642 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 643 | 644 | fam - (3 = stomp, 4 = mod, 5 = delay, 6 = reverb) 645 | st - status (on = 00, off = 01) 646 | slt - slot; before amp have numbers from 0 to 3, after from 4 to 7 647 | 648 | 649 | 1st data packet resported after toggling an effect on or off is: 650 | 651 | 0 1 652 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 653 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 654 | 00 | 1c| 01|DSP| 00 | 01| 01| 00 | 655 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 656 | 16 |fxm| 00|slt| ??| ??| ??| 00 | 657 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 658 | 32 |kb1|kb2|kb3|kb4|kb5|kb6|st | 00 | 659 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 660 | 48 | ? | ? | ? | ? | ? | 00 | 661 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 662 | 663 | efx_family - (3 = stomp, 4 = mod, 5 = delay, 6 = reverb) 664 | fxm - effect model; independent for each effect 665 | slt - slot; before amp have numbers from 0 to 3, after from 4 to 7 666 | 667 | kb1, kb2, kb3, kb4, kb5, kb6 - knobs values; not every time 668 | all are used; maximum value of the knob depends on the effect 669 | 670 | st - Status (on = 00, off = 01) 671 | 672 | This is followed by two more packets whose purpose is unknown. 673 | 674 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------