Complete implementation of v2 features

This commit is contained in:
hirsch 2016-07-19 21:24:04 -04:00
parent c8d2d2d0a3
commit e9170b38ff
4 changed files with 206 additions and 48 deletions

46
mod.h
View file

@ -168,6 +168,52 @@ private:
virtual int cc43( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );} virtual int cc43( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
}; };
// Wah + Touch Wah
class ModWahCC : public ModCC {
public:
ModWahCC( Mustang * theAmp ) : ModCC(theAmp) {}
private:
// Mix
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
// Freq
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
// Heel Freq
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
// Toe Freq
virtual int cc42( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
// Hi-Q
virtual int cc43( int value ) {
if ( value > 1 ) return 0;
else return discrete_control( 0x04, 0x04, 0x81, value );
}
};
class DiatonicShiftCC : public ModCC {
public:
DiatonicShiftCC( Mustang * theAmp ) : ModCC(theAmp) {}
private:
// Mix
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
// Pitch
virtual int cc40( int value ) {
if ( value > 0x15 ) return 0;
else return discrete_control( 0x01, 0x0b, 0x98, value );
}
// Key
virtual int cc41( int value ) {
if ( value > 0x0b ) return 0;
else return discrete_control( 0x02, 0x02, 0x99, value );
}
// Scale
virtual int cc42( int value ) {
if ( value > 8 ) return 0;
else return discrete_control( 0x03, 0x03, 0x9a, value );
}
// Tone
virtual int cc43( int value ) { return continuous_control( 0x04, 0x07, 0x01, value );}
};
class NullModCC : public ModCC { class NullModCC : public ModCC {
public: public:

View file

@ -293,7 +293,7 @@ void Mustang::updateAmpObj(void) {
break; break;
} }
if ( (new_amp!=NULL) && (new_amp!=curr_amp) ) { if ( new_amp!=NULL ) {
delete curr_amp; delete curr_amp;
curr_amp = new_amp; curr_amp = new_amp;
} }
@ -319,62 +319,61 @@ void Mustang::updateReverbObj(void) {
void Mustang::updateDelayObj(void) { void Mustang::updateDelayObj(void) {
int curr = curr_state[DELAY_STATE][MODEL]; int curr = curr_state[DELAY_STATE][MODEL];
DelayCC * new_delay = NULL;
switch (curr) { switch (curr) {
case 0: case 0:
break; break;
case MONO_DLY_ID: case MONO_DLY_ID:
delete curr_delay; new_delay = new MonoDelayCC(this);
curr_delay = new MonoDelayCC(this);
break; break;
case MONO_FILTER_ID: case MONO_FILTER_ID:
case ST_FILTER_ID: case ST_FILTER_ID:
delete curr_delay; new_delay = new EchoFilterCC(this);
curr_delay = new EchoFilterCC(this);
break; break;
case MTAP_DLY_ID: case MTAP_DLY_ID:
delete curr_delay; new_delay = new MultitapDelayCC(this);
curr_delay = new MultitapDelayCC(this);
break; break;
case PONG_DLY_ID: case PONG_DLY_ID:
delete curr_delay; new_delay = new PingPongDelayCC(this);
curr_delay = new PingPongDelayCC(this);
break; break;
case DUCK_DLY_ID: case DUCK_DLY_ID:
delete curr_delay; new_delay = new DuckingDelayCC(this);
curr_delay = new DuckingDelayCC(this);
break; break;
case REVERSE_DLY_ID: case REVERSE_DLY_ID:
delete curr_delay; new_delay = new ReverseDelayCC(this);
curr_delay = new ReverseDelayCC(this);
break; break;
case TAPE_DLY_ID: case TAPE_DLY_ID:
delete curr_delay; new_delay = new TapeDelayCC(this);
curr_delay = new TapeDelayCC(this);
break; break;
case ST_TAPE_DLY_ID: case ST_TAPE_DLY_ID:
delete curr_delay; new_delay = new StereoTapeDelayCC(this);
curr_delay = new StereoTapeDelayCC(this);
break; break;
default: default:
fprintf( stderr, "W - Delay id %x not supported yet\n", curr ); fprintf( stderr, "W - Delay id %x not supported yet\n", curr );
break; break;
} }
if ( new_delay!=NULL ) {
delete curr_delay;
curr_delay = new_delay;
}
} }
void Mustang::updateModObj(void) { void Mustang::updateModObj(void) {
int curr = curr_state[MOD_STATE][MODEL]; int curr = curr_state[MOD_STATE][MODEL];
ModCC * new_mod = NULL;
switch (curr) { switch (curr) {
case 0: case 0:
@ -382,97 +381,123 @@ void Mustang::updateModObj(void) {
case SINE_CHORUS_ID: case SINE_CHORUS_ID:
case TRI_CHORUS_ID: case TRI_CHORUS_ID:
delete curr_mod; new_mod = new ChorusCC(this);
curr_mod = new ChorusCC(this);
break; break;
case SINE_FLANGE_ID: case SINE_FLANGE_ID:
case TRI_FLANGE_ID: case TRI_FLANGE_ID:
delete curr_mod; new_mod = new FlangerCC(this);
curr_mod = new FlangerCC(this);
break; break;
case VIBRATONE_ID: case VIBRATONE_ID:
delete curr_mod; new_mod = new VibratoneCC(this);
curr_mod = new VibratoneCC(this);
break; break;
case VINT_TREM_ID: case VINT_TREM_ID:
case SINE_TREM_ID: case SINE_TREM_ID:
delete curr_mod; new_mod = new TremCC(this);
curr_mod = new TremCC(this);
break; break;
case RING_MOD_ID: case RING_MOD_ID:
delete curr_mod; new_mod = new RingModCC(this);
curr_mod = new RingModCC(this);
break; break;
case STEP_FILT_ID: case STEP_FILT_ID:
delete curr_mod; new_mod = new StepFilterCC(this);
curr_mod = new StepFilterCC(this);
break; break;
case PHASER_ID: case PHASER_ID:
delete curr_mod; new_mod = new PhaserCC(this);
curr_mod = new PhaserCC(this);
break; break;
case PITCH_SHIFT_ID: case PITCH_SHIFT_ID:
delete curr_mod; {
curr_mod = new PitchShifterCC(this); int xtra = curr_state[MOD_STATE][MODELX];
if ( xtra == 0 ) new_mod = new PitchShifterCC(this);
else if ( xtra == 0x10 ) new_mod = new DiatonicShiftCC(this);
}
break;
case M_WAH_ID:
case M_TOUCH_WAH_ID:
new_mod = new ModWahCC(this);
break; break;
default: default:
fprintf( stderr, "W - Mod id %x not supported yet\n", curr ); fprintf( stderr, "W - Mod id %x not supported yet\n", curr );
break; break;
} }
if ( new_mod!=NULL ) {
delete curr_mod;
curr_mod = new_mod;
}
} }
void Mustang::updateStompObj(void) { void Mustang::updateStompObj(void) {
int curr = curr_state[STOMP_STATE][MODEL]; int curr = curr_state[STOMP_STATE][MODEL];
StompCC * new_stomp = NULL;
switch (curr) { switch (curr) {
case 0: case 0:
break; break;
case OVERDRIVE_ID: case OVERDRIVE_ID:
delete curr_stomp; new_stomp = new OverdriveCC(this);
curr_stomp = new OverdriveCC(this);
break; break;
case WAH_ID: case WAH_ID:
case TOUCH_WAH_ID: case TOUCH_WAH_ID:
delete curr_stomp; new_stomp = new WahCC(this);
curr_stomp = new WahCC(this);
break; break;
case FUZZ_ID: case FUZZ_ID:
delete curr_stomp; new_stomp = new FuzzCC(this);
curr_stomp = new FuzzCC(this);
break; break;
case FUZZ_TWAH_ID: case FUZZ_TWAH_ID:
delete curr_stomp; new_stomp = new FuzzTouchWahCC(this);
curr_stomp = new FuzzTouchWahCC(this);
break; break;
case SIMPLE_COMP_ID: case SIMPLE_COMP_ID:
delete curr_stomp; new_stomp = new SimpleCompCC(this);
curr_stomp = new SimpleCompCC(this);
break; break;
case COMP_ID: case COMP_ID:
delete curr_stomp; new_stomp = new CompCC(this);
curr_stomp = new CompCC(this); break;
case RANGE_BOOST_ID:
new_stomp = new RangerCC(this);
break;
case GREEN_BOX_ID:
new_stomp = new GreenBoxCC(this);
break;
case ORANGE_BOX_ID:
new_stomp = new OrangeBoxCC(this);
break;
case BLACK_BOX_ID:
new_stomp = new BlackBoxCC(this);
break;
case BIG_FUZZ_ID:
new_stomp = new BigFuzzCC(this);
break; break;
default: default:
fprintf( stderr, "W - Stomp id %x not supported yet\n", curr ); fprintf( stderr, "W - Stomp id %x not supported yet\n", curr );
break; break;
} }
if ( new_stomp!=NULL ) {
delete curr_stomp;
curr_stomp = new_stomp;
}
} }

View file

@ -74,6 +74,7 @@
// Offset to current device model for any state structure // Offset to current device model for any state structure
#define MODEL 16 #define MODEL 16
#define MODELX 17
// Index into current state structure // Index into current state structure
#define PRESET_NAME 0 #define PRESET_NAME 0
@ -152,12 +153,13 @@
#define RING_MOD_ID 0x22 #define RING_MOD_ID 0x22
#define STEP_FILT_ID 0x29 #define STEP_FILT_ID 0x29
#define PHASER_ID 0x4f #define PHASER_ID 0x4f
// Note: Diatonic shifter also uses this as model byte and
// is differentiated by 0x10 in the following 'extra' model byte.
#define PITCH_SHIFT_ID 0x1f #define PITCH_SHIFT_ID 0x1f
// v2 mod only // v2 mod only
#define M_WAH_ID 0xf4 #define M_WAH_ID 0xf4
#define M_TOUCH_WAH_ID 0xf5 #define M_TOUCH_WAH_ID 0xf5
#define DIA_PSHIFT_ID 0x1f
// Stomp model id values // Stomp model id values
#define OVERDRIVE_ID 0x3c #define OVERDRIVE_ID 0x3c

85
stomp.h
View file

@ -131,6 +131,91 @@ private:
}; };
class RangerCC : public StompCC {
public:
RangerCC( Mustang * theAmp ) : StompCC(theAmp) {}
private:
// Level
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
// Gain
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
// Lo-Cut
virtual int cc31( int value ) { return continuous_control( 0x02, 0x03, 0x01, value );}
// Bright
virtual int cc32( int value ) { return continuous_control( 0x03, 0x02, 0x01, value );}
// n/a
virtual int cc33( int value ) { return 0;}
};
class GreenBoxCC : public StompCC {
public:
GreenBoxCC( Mustang * theAmp ) : StompCC(theAmp) {}
private:
// Level
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
// Gain
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
// Tone
virtual int cc31( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
// Bright
virtual int cc32( int value ) { return continuous_control( 0x03, 0x03, 0x12, value );}
// n/a
virtual int cc33( int value ) { return 0;}
};
class OrangeBoxCC : public StompCC {
public:
OrangeBoxCC( Mustang * theAmp ) : StompCC(theAmp) {}
private:
// Level
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
// Dist
virtual int cc30( int value ) { return continuous_control( 0x01, 0x02, 0x01, value );}
// Tone
virtual int cc31( int value ) { return continuous_control( 0x02, 0x01, 0x01, value );}
// n/a
virtual int cc32( int value ) { return 0;}
// n/a
virtual int cc33( int value ) { return 0;}
};
class BlackBoxCC : public StompCC {
public:
BlackBoxCC( Mustang * theAmp ) : StompCC(theAmp) {}
private:
// Level
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
// Dist
virtual int cc30( int value ) { return continuous_control( 0x01, 0x02, 0x01, value );}
// Filter
virtual int cc31( int value ) { return continuous_control( 0x02, 0x01, 0x01, value );}
// n/a
virtual int cc32( int value ) { return 0;}
// n/a
virtual int cc33( int value ) { return 0;}
};
class BigFuzzCC : public StompCC {
public:
BigFuzzCC( Mustang * theAmp ) : StompCC(theAmp) {}
private:
// Level
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
// Tone
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
// Sustain
virtual int cc31( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
// n/a
virtual int cc32( int value ) { return 0;}
// n/a
virtual int cc33( int value ) { return 0;}
};
class NullStompCC : public StompCC { class NullStompCC : public StompCC {
public: public:
NullStompCC( Mustang * theAmp ) : StompCC(theAmp) {} NullStompCC( Mustang * theAmp ) : StompCC(theAmp) {}