Threaded build nominally working
This commit is contained in:
parent
96152fd3ed
commit
f9527898df
26 changed files with 1237 additions and 1090 deletions
65
amp.cpp
65
amp.cpp
|
|
@ -1,84 +1,83 @@
|
||||||
|
|
||||||
#include "amp.h"
|
#include "amp.h"
|
||||||
#include "mustang.h"
|
#include "magic.h"
|
||||||
#include "constants.h"
|
|
||||||
|
|
||||||
int
|
int
|
||||||
AmpCC::continuous_control( int parm5, int parm6, int parm7, int value ) {
|
AmpCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
|
||||||
Mustang::Cmd cmd;
|
cmd[2] = 0x02;
|
||||||
cmd.state_index = AMP_STATE;
|
memcpy( cmd + 3, model, 2 );
|
||||||
cmd.parm2 = 0x02;
|
cmd[5] = parm5;
|
||||||
cmd.parm5 = parm5;
|
cmd[6] = parm6;
|
||||||
cmd.parm6 = parm6;
|
cmd[7] = parm7;
|
||||||
cmd.parm7 = parm7;
|
|
||||||
cmd.value = value;
|
|
||||||
|
|
||||||
return amp->continuous_control( cmd );
|
unsigned short magic = magic_values[value];
|
||||||
|
cmd[9] = magic & 0xff;
|
||||||
|
cmd[10] = (magic >> 8) & 0xff;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
AmpCC::discrete_control( int parm5, int parm6, int parm7, int value ) {
|
AmpCC::discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
|
||||||
Mustang::Cmd cmd;
|
cmd[2] = 0x02;
|
||||||
cmd.state_index = AMP_STATE;
|
memcpy( cmd + 3, model, 2 );
|
||||||
cmd.parm2 = 0x02;
|
cmd[5] = parm5;
|
||||||
cmd.parm5 = parm5;
|
cmd[6] = parm6;
|
||||||
cmd.parm6 = parm6;
|
cmd[7] = parm7;
|
||||||
cmd.parm7 = parm7;
|
|
||||||
cmd.value = value;
|
|
||||||
|
|
||||||
return amp->discrete_control( cmd );
|
cmd[9] = value;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
AmpCC::dispatch( int cc, int value ) {
|
AmpCC::dispatch( int cc, int value, unsigned char *cmd ) {
|
||||||
|
|
||||||
switch( cc ) {
|
switch( cc ) {
|
||||||
case 69:
|
case 69:
|
||||||
// Gain
|
// Gain
|
||||||
return cc69( value );
|
return cc69( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 70:
|
case 70:
|
||||||
// Channel volume
|
// Channel volume
|
||||||
return cc70( value );
|
return cc70( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 71:
|
case 71:
|
||||||
// Treble
|
// Treble
|
||||||
return cc71( value );
|
return cc71( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 72:
|
case 72:
|
||||||
// Mid
|
// Mid
|
||||||
return cc72( value );
|
return cc72( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 73:
|
case 73:
|
||||||
// Bass
|
// Bass
|
||||||
return cc73( value );
|
return cc73( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 74:
|
case 74:
|
||||||
// Sag
|
// Sag
|
||||||
return cc74( value );
|
return cc74( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 75:
|
case 75:
|
||||||
// Bias
|
// Bias
|
||||||
return cc75( value );
|
return cc75( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 76:
|
case 76:
|
||||||
// Noise Gate
|
// Noise Gate
|
||||||
return cc76( value );
|
return cc76( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 77:
|
case 77:
|
||||||
// Cabinet
|
// Cabinet
|
||||||
return cc77( value );
|
return cc77( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 78:
|
case 78:
|
||||||
// Presence / Gain2 / Cut
|
// Presence / Gain2 / Cut
|
||||||
return cc78( value );
|
return cc78( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 79:
|
case 79:
|
||||||
// Blend / Master Volume
|
// Blend / Master Volume
|
||||||
return cc79( value );
|
return cc79( value, cmd );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
102
amp.h
102
amp.h
|
|
@ -21,10 +21,8 @@ protected:
|
||||||
unsigned char model[2];
|
unsigned char model[2];
|
||||||
unsigned char slot;
|
unsigned char slot;
|
||||||
|
|
||||||
// Only base class is friend of Mustang, so forward calls from
|
int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd );
|
||||||
// derived classes through these methods.
|
int discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd );
|
||||||
int continuous_control( int parm5, int parm6, int parm7, int value );
|
|
||||||
int discrete_control( int parm5, int parm6, int parm7, int value );
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AmpCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
AmpCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
||||||
|
|
@ -34,50 +32,50 @@ public:
|
||||||
memcpy( this->model, model, 2 );
|
memcpy( this->model, model, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int dispatch( int cc, int value );
|
int dispatch( int cc, int value, unsigned char *cmd );
|
||||||
const unsigned char *getModel( void ) { return model;}
|
const unsigned char *getModel( void ) { return model;}
|
||||||
const unsigned char getSlot( void ) { return slot;}
|
const unsigned char getSlot( void ) { return slot;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Gain
|
// Gain
|
||||||
virtual int cc69( int value ) { return continuous_control( 0x01, 0x01, 0x0c, value );}
|
virtual int cc69( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x0c, value, cmd );}
|
||||||
// Ch. Volume
|
// Ch. Volume
|
||||||
virtual int cc70( int value ) { return continuous_control( 0x00, 0x00, 0x0c, value );}
|
virtual int cc70( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x0c, value, cmd );}
|
||||||
// Treble
|
// Treble
|
||||||
virtual int cc71( int value ) { return continuous_control( 0x04, 0x04, 0x0c, value );}
|
virtual int cc71( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x0c, value, cmd );}
|
||||||
// Mid
|
// Mid
|
||||||
virtual int cc72( int value ) { return continuous_control( 0x05, 0x05, 0x0c, value );}
|
virtual int cc72( int value, unsigned char *cmd ) { return continuous_control( 0x05, 0x05, 0x0c, value, cmd );}
|
||||||
// Bass
|
// Bass
|
||||||
virtual int cc73( int value ) { return continuous_control( 0x06, 0x06, 0x0c, value );}
|
virtual int cc73( int value, unsigned char *cmd ) { return continuous_control( 0x06, 0x06, 0x0c, value, cmd );}
|
||||||
// Sag
|
// Sag
|
||||||
virtual int cc74( int value ) {
|
virtual int cc74( int value, unsigned char *cmd ) {
|
||||||
if ( value > 2 ) return 0;
|
if ( value <= 2 ) return discrete_control( 0x13, 0x13, 0x8f, value, cmd );
|
||||||
else return discrete_control( 0x13, 0x13, 0x8f, value );
|
else return -1;
|
||||||
}
|
}
|
||||||
// Bias
|
// Bias
|
||||||
virtual int cc75( int value ) { return continuous_control( 0x0a, 0x0a, 0x0d, value );}
|
virtual int cc75( int value, unsigned char *cmd ) { return continuous_control( 0x0a, 0x0a, 0x0d, value, cmd );}
|
||||||
// Noise Gate
|
// Noise Gate
|
||||||
virtual int cc76( int value ) {
|
virtual int cc76( int value, unsigned char *cmd ) {
|
||||||
if ( value > 4 ) return 0;
|
if ( value <= 4 ) return discrete_control( 0x0f, 0x0f, 0x90, value, cmd );
|
||||||
else return discrete_control( 0x0f, 0x0f, 0x90, value );
|
else return -1;
|
||||||
}
|
}
|
||||||
// Cabinet
|
// Cabinet
|
||||||
virtual int cc77( int value ) {
|
virtual int cc77( int value, unsigned char *cmd ) {
|
||||||
if ( value > 12 ) return 0;
|
if ( value <= 12 ) return discrete_control( 0x11, 0x11, 0x8e, value, cmd );
|
||||||
else return discrete_control( 0x11, 0x11, 0x8e, value );
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dummy in base class
|
// Dummy in base class
|
||||||
virtual int cc78( int value ) { return 0;}
|
virtual int cc78( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc79( int value ) { return 0;}
|
virtual int cc79( int value, unsigned char *cmd ) { return -1;}
|
||||||
|
|
||||||
// Noise Gate Custom Threshold
|
// Noise Gate Custom Threshold
|
||||||
virtual int cc90( int value ) {
|
virtual int cc90( int value, unsigned char *cmd ) {
|
||||||
if ( value > 9 ) return 0;
|
if ( value <= 9 ) return discrete_control( 0x10, 0x10, 0x86, value, cmd );
|
||||||
else return discrete_control( 0x10, 0x10, 0x86, value );
|
else return -1;
|
||||||
}
|
}
|
||||||
// Noise Gate Custom Depth
|
// Noise Gate Custom Depth
|
||||||
virtual int cc91( int value ) { return continuous_control( 0x09, 0x09, 0x0c, value );}
|
virtual int cc91( int value, unsigned char *cmd ) { return continuous_control( 0x09, 0x09, 0x0c, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -89,9 +87,9 @@ public:
|
||||||
AmpCC1( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
AmpCC1( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Presence
|
// Presence
|
||||||
virtual int cc78( int value ) { return continuous_control( 0x07, 0x07, 0x0c, value );}
|
virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x07, 0x07, 0x0c, value, cmd );}
|
||||||
// Blend
|
// Blend
|
||||||
virtual int cc79( int value ) { return continuous_control( 0x02, 0x02, 0x0c, value );}
|
virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x0c, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -102,9 +100,9 @@ public:
|
||||||
AmpCC2( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
AmpCC2( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Gain2
|
// Gain2
|
||||||
virtual int cc78( int value ) { return continuous_control( 0x02, 0x02, 0x0c, value );}
|
virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x0c, value, cmd );}
|
||||||
// Master Volume
|
// Master Volume
|
||||||
virtual int cc79( int value ) { return continuous_control( 0x03, 0x03, 0x0c, value );}
|
virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0c, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -115,9 +113,9 @@ public:
|
||||||
AmpCC3( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
AmpCC3( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Cut
|
// Cut
|
||||||
virtual int cc78( int value ) { return continuous_control( 0x07, 0x07, 0x0c, value );}
|
virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x07, 0x07, 0x0c, value, cmd );}
|
||||||
// Master Volume
|
// Master Volume
|
||||||
virtual int cc79( int value ) { return continuous_control( 0x03, 0x03, 0x0c, value );}
|
virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0c, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -131,9 +129,9 @@ public:
|
||||||
AmpCC4( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
AmpCC4( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Presence
|
// Presence
|
||||||
virtual int cc78( int value ) { return continuous_control( 0x07, 0x07, 0x0c, value );}
|
virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x07, 0x07, 0x0c, value, cmd );}
|
||||||
// Master Volume
|
// Master Volume
|
||||||
virtual int cc79( int value ) { return continuous_control( 0x03, 0x03, 0x0c, value );}
|
virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0c, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -144,11 +142,11 @@ public:
|
||||||
AmpCC5( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
AmpCC5( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// No sag / bias
|
// No sag / bias
|
||||||
virtual int cc74( int value ) { return 0;}
|
virtual int cc74( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc75( int value ) { return 0;}
|
virtual int cc75( int value, unsigned char *cmd ) { return -1;}
|
||||||
// No pres / master
|
// No pres / master
|
||||||
virtual int cc78( int value ) { return 0;}
|
virtual int cc78( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc79( int value ) { return 0;}
|
virtual int cc79( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -156,10 +154,10 @@ private:
|
||||||
//
|
//
|
||||||
class AmpCC6 : public AmpCC {
|
class AmpCC6 : public AmpCC {
|
||||||
public:
|
public:
|
||||||
AmpCC6( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
AmpCC6( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {;}
|
||||||
private:
|
private:
|
||||||
// Master Volume
|
// Master Volume
|
||||||
virtual int cc79( int value ) { return continuous_control( 0x03, 0x03, 0x0c, value );}
|
virtual int cc79( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0c, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -170,7 +168,7 @@ public:
|
||||||
AmpCC7( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
AmpCC7( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Presence
|
// Presence
|
||||||
virtual int cc78( int value ) { return continuous_control( 0x07, 0x07, 0x0c, value );}
|
virtual int cc78( int value, unsigned char *cmd ) { return continuous_control( 0x07, 0x07, 0x0c, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -180,17 +178,17 @@ class NullAmpCC : public AmpCC {
|
||||||
public:
|
public:
|
||||||
NullAmpCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
NullAmpCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : AmpCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
virtual int cc69( int value ) { return 0;}
|
virtual int cc69( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc70( int value ) { return 0;}
|
virtual int cc70( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc71( int value ) { return 0;}
|
virtual int cc71( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc72( int value ) { return 0;}
|
virtual int cc72( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc73( int value ) { return 0;}
|
virtual int cc73( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc74( int value ) { return 0;}
|
virtual int cc74( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc75( int value ) { return 0;}
|
virtual int cc75( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc76( int value ) { return 0;}
|
virtual int cc76( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc77( int value ) { return 0;}
|
virtual int cc77( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc78( int value ) { return 0;}
|
virtual int cc78( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc79( int value ) { return 0;}
|
virtual int cc79( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "amp_models.h"
|
#include "amp_models.h"
|
||||||
|
|
||||||
|
const unsigned char null_amp_id[] = { 0x00, 0x00 };
|
||||||
|
|
||||||
const unsigned char f57_deluxe_id[] = { 0x67, 0x00 };
|
const unsigned char f57_deluxe_id[] = { 0x67, 0x00 };
|
||||||
const unsigned char f59_bassman_id[] = { 0x64, 0x00 };
|
const unsigned char f59_bassman_id[] = { 0x64, 0x00 };
|
||||||
const unsigned char f57_champ_id[] = { 0x7c, 0x00 };
|
const unsigned char f57_champ_id[] = { 0x7c, 0x00 };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef AMP_MODELS_H
|
#ifndef AMP_MODELS_H
|
||||||
#define AMP_MODELS_H
|
#define AMP_MODELS_H
|
||||||
|
|
||||||
|
extern const unsigned char null_amp_id[];
|
||||||
|
|
||||||
extern const unsigned char f57_deluxe_id[];
|
extern const unsigned char f57_deluxe_id[];
|
||||||
extern const unsigned char f59_bassman_id[];
|
extern const unsigned char f59_bassman_id[];
|
||||||
extern const unsigned char f57_champ_id[];
|
extern const unsigned char f57_champ_id[];
|
||||||
|
|
|
||||||
21
constants.h
21
constants.h
|
|
@ -13,18 +13,10 @@
|
||||||
#define MI_II_V2 0x0014
|
#define MI_II_V2 0x0014
|
||||||
#define MIII_IV_V_V2 0x0016
|
#define MIII_IV_V_V2 0x0016
|
||||||
|
|
||||||
#define DSP 2
|
|
||||||
#define PATCH_SLOT 4
|
|
||||||
#define EFFECT 16
|
|
||||||
#define FXSLOT 18
|
#define FXSLOT 18
|
||||||
|
|
||||||
// direct control fields
|
|
||||||
#define FAMILY 2
|
|
||||||
#define ACTIVE_INVERT 3
|
|
||||||
|
|
||||||
// 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 AMP_STATE 0
|
#define AMP_STATE 0
|
||||||
|
|
@ -34,19 +26,6 @@
|
||||||
#define REVERB_STATE 4
|
#define REVERB_STATE 4
|
||||||
#define PEDAL_STATE 5
|
#define PEDAL_STATE 5
|
||||||
|
|
||||||
// DSP Category
|
|
||||||
#define AMP_DSP 5
|
|
||||||
#define STOMP_DSP 6
|
|
||||||
#define MOD_DSP 7
|
|
||||||
#define DELAY_DSP 8
|
|
||||||
#define REVERB_DSP 9
|
|
||||||
|
|
||||||
// DSP Family (used for direct parm set) - Effectively DSP - 3
|
|
||||||
#define STOMP_FAM 3
|
|
||||||
#define MOD_FAM 4
|
|
||||||
#define DELAY_FAM 5
|
|
||||||
#define REVERB_FAM 6
|
|
||||||
|
|
||||||
// Reverb model id values
|
// Reverb model id values
|
||||||
#define SM_HALL_ID 0x0024
|
#define SM_HALL_ID 0x0024
|
||||||
#define LG_HALL_ID 0x003a
|
#define LG_HALL_ID 0x003a
|
||||||
|
|
|
||||||
53
delay.cpp
53
delay.cpp
|
|
@ -1,62 +1,61 @@
|
||||||
|
|
||||||
#include "delay.h"
|
#include "delay.h"
|
||||||
#include "mustang.h"
|
#include "magic.h"
|
||||||
#include "constants.h"
|
|
||||||
|
|
||||||
int
|
int
|
||||||
DelayCC::continuous_control( int parm5, int parm6, int parm7, int value ) {
|
DelayCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
|
||||||
Mustang::Cmd cmd;
|
cmd[2] = 0x05;
|
||||||
cmd.state_index = DELAY_STATE;
|
memcpy( cmd + 3, model, 2 );
|
||||||
cmd.parm2 = 0x05;
|
cmd[5] = parm5;
|
||||||
cmd.parm5 = parm5;
|
cmd[6] = parm6;
|
||||||
cmd.parm6 = parm6;
|
cmd[7] = parm7;
|
||||||
cmd.parm7 = parm7;
|
|
||||||
cmd.value = value;
|
|
||||||
|
|
||||||
return amp->continuous_control( cmd );
|
unsigned short magic = magic_values[value];
|
||||||
|
cmd[9] = magic & 0xff;
|
||||||
|
cmd[10] = (magic >> 8) & 0xff;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
DelayCC::discrete_control( int parm5, int parm6, int parm7, int value ) {
|
DelayCC::discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
|
||||||
Mustang::Cmd cmd;
|
cmd[2] = 0x05;
|
||||||
cmd.state_index = DELAY_STATE;
|
memcpy( cmd + 3, model, 2 );
|
||||||
cmd.parm2 = 0x05;
|
cmd[5] = parm5;
|
||||||
cmd.parm5 = parm5;
|
cmd[6] = parm6;
|
||||||
cmd.parm6 = parm6;
|
cmd[7] = parm7;
|
||||||
cmd.parm7 = parm7;
|
|
||||||
cmd.value = value;
|
|
||||||
|
|
||||||
return amp->discrete_control( cmd );
|
cmd[9] = value;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
DelayCC::dispatch( int cc, int value ) {
|
DelayCC::dispatch( int cc, int value, unsigned char *cmd ) {
|
||||||
|
|
||||||
switch ( cc ) {
|
switch ( cc ) {
|
||||||
case 49:
|
case 49:
|
||||||
// Level
|
// Level
|
||||||
return cc49( value );
|
return cc49( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 50:
|
case 50:
|
||||||
// Delay Time
|
// Delay Time
|
||||||
return cc50( value );
|
return cc50( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 51:
|
case 51:
|
||||||
// Feedback / FFdbk
|
// Feedback / FFdbk
|
||||||
return cc51( value );
|
return cc51( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 52:
|
case 52:
|
||||||
// Brightness / Frequency / Release / RFdbk / Flutter
|
// Brightness / Frequency / Release / RFdbk / Flutter
|
||||||
return cc52( value );
|
return cc52( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 53:
|
case 53:
|
||||||
// Attenuation / Resonance / Mode / Stereo / Threshold
|
// Attenuation / Resonance / Mode / Stereo / Threshold
|
||||||
// Tone / Brightness / Separation
|
// Tone / Brightness / Separation
|
||||||
return cc53( value );
|
return cc53( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 54:
|
case 54:
|
||||||
// Input Level / Stereo / Brightness
|
// Input Level / Stereo / Brightness
|
||||||
return cc54( value );
|
return cc54( value, cmd );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
100
delay.h
100
delay.h
|
|
@ -14,8 +14,8 @@ protected:
|
||||||
unsigned char model[2];
|
unsigned char model[2];
|
||||||
unsigned char slot;
|
unsigned char slot;
|
||||||
|
|
||||||
int continuous_control( int parm5, int parm6, int parm7, int value );
|
int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd );
|
||||||
int discrete_control( int parm5, int parm6, int parm7, int value );
|
int discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
DelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
||||||
|
|
@ -25,20 +25,20 @@ public:
|
||||||
memcpy( this->model, model, 2 );
|
memcpy( this->model, model, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int dispatch( int cc, int value );
|
int dispatch( int cc, int value, unsigned char *cmd );
|
||||||
const unsigned char *getModel( void ) { return model;}
|
const unsigned char *getModel( void ) { return model;}
|
||||||
const unsigned char getSlot( void ) { return slot;}
|
const unsigned char getSlot( void ) { return slot;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc49( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc49( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Delay Time
|
// Delay Time
|
||||||
virtual int cc50( int value ) { return continuous_control( 0x01, 0x01, 0x06, value );}
|
virtual int cc50( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x06, value, cmd );}
|
||||||
|
|
||||||
virtual int cc51( int value ) = 0;
|
virtual int cc51( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc52( int value ) = 0;
|
virtual int cc52( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc53( int value ) = 0;
|
virtual int cc53( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc54( int value ) = 0;
|
virtual int cc54( int value, unsigned char *cmd ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -47,13 +47,13 @@ public:
|
||||||
MonoDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
MonoDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc51( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Brightness
|
// Brightness
|
||||||
virtual int cc52( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Attenuation
|
// Attenuation
|
||||||
virtual int cc53( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
// no-op
|
// no-op
|
||||||
virtual int cc54( int value ) { return 0;}
|
virtual int cc54( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -62,13 +62,13 @@ public:
|
||||||
EchoFilterCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
EchoFilterCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc51( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Frequency
|
// Frequency
|
||||||
virtual int cc52( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Resonance
|
// Resonance
|
||||||
virtual int cc53( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
// Input Level
|
// Input Level
|
||||||
virtual int cc54( int value ) { return continuous_control( 0x05, 0x05, 0x01, value );}
|
virtual int cc54( int value, unsigned char *cmd ) { return continuous_control( 0x05, 0x05, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -77,18 +77,18 @@ public:
|
||||||
MultitapDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
MultitapDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Delay Time
|
// Delay Time
|
||||||
virtual int cc50( int value ) { return continuous_control( 0x01, 0x01, 0x08, value );}
|
virtual int cc50( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x08, value, cmd );}
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc51( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Brightness
|
// Brightness
|
||||||
virtual int cc52( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Mode
|
// Mode
|
||||||
virtual int cc53( int value ) {
|
virtual int cc53( int value, unsigned char *cmd ) {
|
||||||
if ( value > 3 ) return 0;
|
if ( value > 3 ) return -1;
|
||||||
else return discrete_control( 0x04, 0x04, 0x8b, value );
|
else return discrete_control( 0x04, 0x04, 0x8b, value, cmd );
|
||||||
}
|
}
|
||||||
// no-op
|
// no-op
|
||||||
virtual int cc54( int value ) { return 0;}
|
virtual int cc54( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -97,13 +97,13 @@ public:
|
||||||
PingPongDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
PingPongDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc51( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Brightness
|
// Brightness
|
||||||
virtual int cc52( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Stereo
|
// Stereo
|
||||||
virtual int cc53( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
// no-op
|
// no-op
|
||||||
virtual int cc54( int value ) { return 0;}
|
virtual int cc54( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -112,13 +112,13 @@ public:
|
||||||
DuckingDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
DuckingDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc51( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Release
|
// Release
|
||||||
virtual int cc52( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Threshold
|
// Threshold
|
||||||
virtual int cc53( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
// no-op
|
// no-op
|
||||||
virtual int cc54( int value ) { return 0;}
|
virtual int cc54( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -127,13 +127,13 @@ public:
|
||||||
ReverseDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
ReverseDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// FFdbk
|
// FFdbk
|
||||||
virtual int cc51( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// RFdbk
|
// RFdbk
|
||||||
virtual int cc52( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Tone
|
// Tone
|
||||||
virtual int cc53( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
// no-op
|
// no-op
|
||||||
virtual int cc54( int value ) { return 0;}
|
virtual int cc54( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -142,13 +142,13 @@ public:
|
||||||
TapeDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
TapeDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc51( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Flutter
|
// Flutter
|
||||||
virtual int cc52( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Brightness
|
// Brightness
|
||||||
virtual int cc53( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
// Stereo
|
// Stereo
|
||||||
virtual int cc54( int value ) { return continuous_control( 0x05, 0x05, 0x01, value );}
|
virtual int cc54( int value, unsigned char *cmd ) { return continuous_control( 0x05, 0x05, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -157,13 +157,13 @@ public:
|
||||||
StereoTapeDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
StereoTapeDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc51( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc51( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Flutter
|
// Flutter
|
||||||
virtual int cc52( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc52( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Separation
|
// Separation
|
||||||
virtual int cc53( int value ) { return continuous_control( 0x04, 0x05, 0x01, value );}
|
virtual int cc53( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x05, 0x01, value, cmd );}
|
||||||
// Brightness
|
// Brightness
|
||||||
virtual int cc54( int value ) { return continuous_control( 0x05, 0x04, 0x01, value );}
|
virtual int cc54( int value, unsigned char *cmd ) { return continuous_control( 0x05, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -171,12 +171,12 @@ class NullDelayCC : public DelayCC {
|
||||||
public:
|
public:
|
||||||
NullDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
NullDelayCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : DelayCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
virtual int cc49( int value ) { return 0;}
|
virtual int cc49( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc50( int value ) { return 0;}
|
virtual int cc50( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc51( int value ) { return 0;}
|
virtual int cc51( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc52( int value ) { return 0;}
|
virtual int cc52( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc53( int value ) { return 0;}
|
virtual int cc53( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc54( int value ) { return 0;}
|
virtual int cc54( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "delay_models.h"
|
#include "delay_models.h"
|
||||||
|
|
||||||
|
const unsigned char null_dly_id[] = { 0x00, 0x00 };
|
||||||
|
|
||||||
const unsigned char mono_dly_id[] = { 0x16, 0x00 };
|
const unsigned char mono_dly_id[] = { 0x16, 0x00 };
|
||||||
const unsigned char mono_filter_id[] = { 0x43, 0x00 };
|
const unsigned char mono_filter_id[] = { 0x43, 0x00 };
|
||||||
const unsigned char st_filter_id[] = { 0x48, 0x00 };
|
const unsigned char st_filter_id[] = { 0x48, 0x00 };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef DELAY_MODELS_H
|
#ifndef DELAY_MODELS_H
|
||||||
#define DELAY_MODELS_H
|
#define DELAY_MODELS_H
|
||||||
|
|
||||||
|
extern const unsigned char null_dly_id[];
|
||||||
|
|
||||||
extern const unsigned char mono_dly_id[];
|
extern const unsigned char mono_dly_id[];
|
||||||
extern const unsigned char mono_filter_id[];
|
extern const unsigned char mono_filter_id[];
|
||||||
extern const unsigned char st_filter_id[];
|
extern const unsigned char st_filter_id[];
|
||||||
|
|
|
||||||
25
magic.cpp
Normal file
25
magic.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Magic values for direct conditioning of Mustang analog controls
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "magic.h"
|
||||||
|
|
||||||
|
unsigned short magic_values[] = {
|
||||||
|
0x0000, 0x01e1, 0x036a, 0x04f3, 0x067c, 0x085d, 0x0a69, 0x0fdf,
|
||||||
|
0x100b, 0x129a, 0x1555, 0x178d, 0x199a, 0x1af7, 0x1c80, 0x1fbe,
|
||||||
|
0x2016, 0x21cb, 0x2354, 0x2486, 0x263b, 0x2873, 0x29fc, 0x2f9e,
|
||||||
|
0x30a4, 0x3333, 0x3514, 0x36f4, 0x3826, 0x39db, 0x3b64, 0x3fd4,
|
||||||
|
0x402b, 0x41e0, 0x43ed, 0x45f9, 0x47ae, 0x490b, 0x4ac0, 0x4f88,
|
||||||
|
0x500b, 0x5217, 0x547b, 0x5604, 0x57e4, 0x5999, 0x5ba6, 0x5fea,
|
||||||
|
0x6041, 0x6279, 0x642e, 0x6692, 0x6872, 0x6a53, 0x6c33, 0x6ff5,
|
||||||
|
0x7020, 0x7201, 0x7439, 0x7619, 0x7851, 0x79af, 0x7b90, 0x7fff,
|
||||||
|
0x8083, 0x8237, 0x8418, 0x8624, 0x8805, 0x898e, 0x8b9a, 0x8f87,
|
||||||
|
0x900a, 0x926e, 0x947a, 0x96de, 0x9893, 0x9a1c, 0x9b4e, 0x9f92,
|
||||||
|
0xa041, 0xa24d, 0xa42e, 0xa5e3, 0xa7ef, 0xa9d0, 0xab59, 0xaf9d,
|
||||||
|
0xb020, 0xb201, 0xb38a, 0xb56a, 0xb74b, 0xb957, 0xbb38, 0xbfff,
|
||||||
|
0xc057, 0xc28f, 0xc51e, 0xc72a, 0xc888, 0xca68, 0xcc75, 0xcfb3,
|
||||||
|
0xd00a, 0xd168, 0xd2f1, 0xd4a6, 0xd686, 0xd8be, 0xdacb, 0xdfe9,
|
||||||
|
0xe041, 0xe221, 0xe3d6, 0xe5e2, 0xe7ef, 0xe978, 0xeb84, 0xeff4,
|
||||||
|
0xf077, 0xf40d, 0xf56a, 0xf74b, 0xf9da, 0xfbe6, 0xfe4a, 0xffff
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
31
magic.h
31
magic.h
|
|
@ -4,35 +4,6 @@
|
||||||
#ifndef _MAGIC_H
|
#ifndef _MAGIC_H
|
||||||
#define _MAGIC_H
|
#define _MAGIC_H
|
||||||
|
|
||||||
unsigned short magic_values[] = {
|
extern unsigned short magic_values[];
|
||||||
0x0000, 0x013b, 0x02ef, 0x036a, 0x04a4, 0x0659, 0x06d4, 0x080e, 0x0a3d, 0x0b78,
|
|
||||||
0x0bf2, 0x0d2d, 0x0da7, 0x0ee2, 0x0f5c, 0x1111, 0x124c, 0x12c6, 0x1400, 0x147b,
|
|
||||||
0x1630, 0x176a, 0x17e5, 0x191f, 0x1999, 0x1ad4, 0x1b4e, 0x1c89, 0x1d03, 0x1e3e,
|
|
||||||
0x1eb8, 0x1ff3, 0x206d, 0x21a8, 0x2222, 0x235d, 0x23d7, 0x2511, 0x258c, 0x26c6,
|
|
||||||
0x2741, 0x287b, 0x28f6, 0x2a30, 0x2aaa, 0x2be5, 0x2c5f, 0x2d9a, 0x2e14, 0x2f4f,
|
|
||||||
0x2fc9, 0x3104, 0x317e, 0x32b9, 0x3333, 0x346e, 0x34e8, 0x3622, 0x369d, 0x37d7,
|
|
||||||
0x3852, 0x398c, 0x3a07, 0x3b41, 0x3bbb, 0x3cf6, 0x3d70, 0x3eab, 0x3f25, 0x4060,
|
|
||||||
0x40da, 0x4215, 0x428f, 0x43ca, 0x4444, 0x457f, 0x45f9, 0x4733, 0x47ae, 0x48e8,
|
|
||||||
0x4963, 0x4a9d, 0x4b18, 0x4c52, 0x4ccc, 0x4e07, 0x4e81, 0x4fbc, 0x5036, 0x5171,
|
|
||||||
0x51eb, 0x5326, 0x53a0, 0x54db, 0x5555, 0x5690, 0x570a, 0x5844, 0x58bf, 0x59f9,
|
|
||||||
0x5a74, 0x5bae, 0x5c29, 0x5d63, 0x5dde, 0x5f18, 0x5f92, 0x60cd, 0x6282, 0x62fc,
|
|
||||||
0x6437, 0x64b1, 0x65ec, 0x6666, 0x67a1, 0x681b, 0x6955, 0x69d0, 0x6b0a, 0x6b85,
|
|
||||||
0x6cbf, 0x6d3a, 0x6e74, 0x6eef, 0x7029, 0x70a3, 0x71de, 0x7258, 0x7393, 0x740d,
|
|
||||||
0x7548, 0x75c2, 0x76fd, 0x7777, 0x78b2, 0x792c, 0x7a66, 0x7ae1, 0x7c1b, 0x7c96,
|
|
||||||
0x7dd0, 0x7e4b, 0x7f85, 0x8000, 0x813a, 0x81b4, 0x82ef, 0x8369, 0x84a4, 0x851e,
|
|
||||||
0x8659, 0x86d3, 0x880e, 0x8888, 0x89c3, 0x8a3d, 0x8bf2, 0x8d2c, 0x8da7, 0x8ee1,
|
|
||||||
0x9096, 0x9111, 0x924b, 0x92c5, 0x947a, 0x962f, 0x97e4, 0x9b4e, 0x9d03, 0x9eb8,
|
|
||||||
0xa06d, 0xa222, 0xa3d6, 0xa58b, 0xa740, 0xa8f5, 0xaaaa, 0xac5f, 0xafc9, 0xb17e,
|
|
||||||
0xb333, 0xb4e7, 0xb851, 0xba06, 0xbbbb, 0xbd70, 0xbf25, 0xc0da, 0xc28f, 0xc444,
|
|
||||||
0xc5f8, 0xc962, 0xcb17, 0xcccc, 0xce81, 0xd036, 0xd1eb, 0xd3a0, 0xd555, 0xd709,
|
|
||||||
0xd8be, 0xda73, 0xdc28, 0xdddd, 0xdf92, 0xe147, 0xe2fc, 0xe4b1, 0xe666, 0xe81a,
|
|
||||||
0xe9cf, 0xeb84, 0xf0a3, 0xf258, 0xf5c2, 0xf92b, 0xfae0, 0xfe4a, 0xffff
|
|
||||||
};
|
|
||||||
|
|
||||||
// Max index in array
|
|
||||||
unsigned magic_max = 218;
|
|
||||||
|
|
||||||
// Scale MIDI CC value to array index
|
|
||||||
double magic_scale_factor = 1.711;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
51
mod.cpp
51
mod.cpp
|
|
@ -1,57 +1,56 @@
|
||||||
|
|
||||||
#include "mod.h"
|
#include "mod.h"
|
||||||
#include "mustang.h"
|
#include "magic.h"
|
||||||
#include "constants.h"
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ModCC::continuous_control( int parm5, int parm6, int parm7, int value ) {
|
ModCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
|
||||||
Mustang::Cmd cmd;
|
cmd[2] = 0x04;
|
||||||
cmd.state_index = MOD_STATE;
|
memcpy( cmd + 3, model, 2 );
|
||||||
cmd.parm2 = 0x04;
|
cmd[5] = parm5;
|
||||||
cmd.parm5 = parm5;
|
cmd[6] = parm6;
|
||||||
cmd.parm6 = parm6;
|
cmd[7] = parm7;
|
||||||
cmd.parm7 = parm7;
|
|
||||||
cmd.value = value;
|
|
||||||
|
|
||||||
return amp->continuous_control( cmd );
|
unsigned short magic = magic_values[value];
|
||||||
|
cmd[9] = magic & 0xff;
|
||||||
|
cmd[10] = (magic >> 8) & 0xff;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ModCC::discrete_control( int parm5, int parm6, int parm7, int value ) {
|
ModCC::discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
|
||||||
Mustang::Cmd cmd;
|
cmd[2] = 0x04;
|
||||||
cmd.state_index = MOD_STATE;
|
memcpy( cmd + 3, model, 2 );
|
||||||
cmd.parm2 = 0x04;
|
cmd[5] = parm5;
|
||||||
cmd.parm5 = parm5;
|
cmd[6] = parm6;
|
||||||
cmd.parm6 = parm6;
|
cmd[7] = parm7;
|
||||||
cmd.parm7 = parm7;
|
|
||||||
cmd.value = value;
|
|
||||||
|
|
||||||
return amp->discrete_control( cmd );
|
cmd[9] = value;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ModCC::dispatch( int cc, int value ) {
|
ModCC::dispatch( int cc, int value, unsigned char *cmd ) {
|
||||||
|
|
||||||
switch ( cc ) {
|
switch ( cc ) {
|
||||||
case 39:
|
case 39:
|
||||||
// Level / Mix
|
// Level / Mix
|
||||||
return cc39( value );
|
return cc39( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 40:
|
case 40:
|
||||||
// Rate / Rotor / Freq / Pitch
|
// Rate / Rotor / Freq / Pitch
|
||||||
return cc40( value );
|
return cc40( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 41:
|
case 41:
|
||||||
// Depth / Duty Cycle / Resonance / Detune / Heel Freq
|
// Depth / Duty Cycle / Resonance / Detune / Heel Freq
|
||||||
return cc41( value );
|
return cc41( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 42:
|
case 42:
|
||||||
// Delay / Fdbk / LFO / Min Freq / Feedback / Toe Freq
|
// Delay / Fdbk / LFO / Min Freq / Feedback / Toe Freq
|
||||||
return cc42( value );
|
return cc42( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 43:
|
case 43:
|
||||||
// LR Phase / Release / Tri Shape / PreDelay / High Q
|
// LR Phase / Release / Tri Shape / PreDelay / High Q
|
||||||
return cc43( value );
|
return cc43( value, cmd );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
150
mod.h
150
mod.h
|
|
@ -14,8 +14,8 @@ protected:
|
||||||
unsigned char model[2];
|
unsigned char model[2];
|
||||||
unsigned char slot;
|
unsigned char slot;
|
||||||
|
|
||||||
int continuous_control( int parm5, int parm6, int parm7, int value );
|
int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd );
|
||||||
int discrete_control( int parm5, int parm6, int parm7, int value );
|
int discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ModCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
ModCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
||||||
|
|
@ -25,16 +25,16 @@ public:
|
||||||
memcpy( this->model, model, 2 );
|
memcpy( this->model, model, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int dispatch( int cc, int value );
|
int dispatch( int cc, int value, unsigned char *cmd );
|
||||||
const unsigned char *getModel( void ) { return model;}
|
const unsigned char *getModel( void ) { return model;}
|
||||||
const unsigned char getSlot( void ) { return slot;}
|
const unsigned char getSlot( void ) { return slot;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual int cc39( int value ) = 0;
|
virtual int cc39( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc40( int value ) = 0;
|
virtual int cc40( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc41( int value ) = 0;
|
virtual int cc41( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc42( int value ) = 0;
|
virtual int cc42( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc43( int value ) = 0;
|
virtual int cc43( int value, unsigned char *cmd ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -43,15 +43,15 @@ public:
|
||||||
ChorusCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
ChorusCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Rate
|
// Rate
|
||||||
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x10, value );}
|
virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x10, value, cmd );}
|
||||||
// Depth
|
// Depth
|
||||||
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Avg Delay
|
// Avg Delay
|
||||||
virtual int cc42( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// LR Phase
|
// LR Phase
|
||||||
virtual int cc43( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -60,15 +60,15 @@ public:
|
||||||
FlangerCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
FlangerCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Rate
|
// Rate
|
||||||
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x10, value );}
|
virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x10, value, cmd );}
|
||||||
// Depth
|
// Depth
|
||||||
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc42( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// LR Phase
|
// LR Phase
|
||||||
virtual int cc43( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -77,15 +77,15 @@ public:
|
||||||
VibratoneCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
VibratoneCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Rotor Speed
|
// Rotor Speed
|
||||||
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x0f, value );}
|
virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x0f, value, cmd );}
|
||||||
// Depth
|
// Depth
|
||||||
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc42( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// LR Phase
|
// LR Phase
|
||||||
virtual int cc43( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -94,15 +94,15 @@ public:
|
||||||
TremCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
TremCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Rotor Speed
|
// Rotor Speed
|
||||||
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x0e, value );}
|
virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x0e, value, cmd );}
|
||||||
// Duty Cycle
|
// Duty Cycle
|
||||||
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Attack / LFO Clip
|
// Attack / LFO Clip
|
||||||
virtual int cc42( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Release / Tri Shape
|
// Release / Tri Shape
|
||||||
virtual int cc43( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -111,18 +111,18 @@ public:
|
||||||
RingModCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
RingModCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Freq
|
// Freq
|
||||||
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Depth
|
// Depth
|
||||||
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// LFO Depth
|
// LFO Depth
|
||||||
virtual int cc42( int value ) {
|
virtual int cc42( int value, unsigned char *cmd ) {
|
||||||
if ( value > 1 ) return 0;
|
if ( value > 1 ) return -1;
|
||||||
else return discrete_control( 0x03, 0x03, 0x8c, value );
|
else return discrete_control( 0x03, 0x03, 0x8c, value, cmd );
|
||||||
}
|
}
|
||||||
// LFO Phase
|
// LFO Phase
|
||||||
virtual int cc43( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -131,15 +131,15 @@ public:
|
||||||
StepFilterCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
StepFilterCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Rate
|
// Rate
|
||||||
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x10, value );}
|
virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x10, value, cmd );}
|
||||||
// Resonance
|
// Resonance
|
||||||
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Min Freq
|
// Min Freq
|
||||||
virtual int cc42( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Max Freq
|
// Max Freq
|
||||||
virtual int cc43( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -148,17 +148,17 @@ public:
|
||||||
PhaserCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
PhaserCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Rate
|
// Rate
|
||||||
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x10, value );}
|
virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x10, value, cmd );}
|
||||||
// Depth
|
// Depth
|
||||||
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc42( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// LFO Shape
|
// LFO Shape
|
||||||
virtual int cc43( int value ) {
|
virtual int cc43( int value, unsigned char *cmd ) {
|
||||||
if ( value > 1 ) return 0;
|
if ( value > 1 ) return -1;
|
||||||
else return discrete_control( 0x04, 0x04, 0x8c, value );
|
else return discrete_control( 0x04, 0x04, 0x8c, value, cmd );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -168,15 +168,15 @@ public:
|
||||||
PitchShifterCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
PitchShifterCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Pitch
|
// Pitch
|
||||||
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Detune
|
// Detune
|
||||||
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Feedback
|
// Feedback
|
||||||
virtual int cc42( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Predelay
|
// Predelay
|
||||||
virtual int cc43( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Wah + Touch Wah
|
// Wah + Touch Wah
|
||||||
|
|
@ -185,17 +185,17 @@ public:
|
||||||
ModWahCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
ModWahCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Mix
|
// Mix
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Freq
|
// Freq
|
||||||
virtual int cc40( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc40( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Heel Freq
|
// Heel Freq
|
||||||
virtual int cc41( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc41( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Toe Freq
|
// Toe Freq
|
||||||
virtual int cc42( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc42( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Hi-Q
|
// Hi-Q
|
||||||
virtual int cc43( int value ) {
|
virtual int cc43( int value, unsigned char *cmd ) {
|
||||||
if ( value > 1 ) return 0;
|
if ( value > 1 ) return -1;
|
||||||
else return discrete_control( 0x04, 0x04, 0x81, value );
|
else return discrete_control( 0x04, 0x04, 0x81, value, cmd );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -205,24 +205,24 @@ public:
|
||||||
DiatonicShiftCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
DiatonicShiftCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Mix
|
// Mix
|
||||||
virtual int cc39( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc39( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Pitch
|
// Pitch
|
||||||
virtual int cc40( int value ) {
|
virtual int cc40( int value, unsigned char *cmd ) {
|
||||||
if ( value > 0x15 ) return 0;
|
if ( value > 0x15 ) return -1;
|
||||||
else return discrete_control( 0x01, 0x0b, 0x98, value );
|
else return discrete_control( 0x01, 0x0b, 0x98, value, cmd );
|
||||||
}
|
}
|
||||||
// Key
|
// Key
|
||||||
virtual int cc41( int value ) {
|
virtual int cc41( int value, unsigned char *cmd ) {
|
||||||
if ( value > 0x0b ) return 0;
|
if ( value > 0x0b ) return -1;
|
||||||
else return discrete_control( 0x02, 0x02, 0x99, value );
|
else return discrete_control( 0x02, 0x02, 0x99, value, cmd );
|
||||||
}
|
}
|
||||||
// Scale
|
// Scale
|
||||||
virtual int cc42( int value ) {
|
virtual int cc42( int value, unsigned char *cmd ) {
|
||||||
if ( value > 8 ) return 0;
|
if ( value > 8 ) return -1;
|
||||||
else return discrete_control( 0x03, 0x03, 0x9a, value );
|
else return discrete_control( 0x03, 0x03, 0x9a, value, cmd );
|
||||||
}
|
}
|
||||||
// Tone
|
// Tone
|
||||||
virtual int cc43( int value ) { return continuous_control( 0x04, 0x07, 0x01, value );}
|
virtual int cc43( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x07, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -230,11 +230,11 @@ class NullModCC : public ModCC {
|
||||||
public:
|
public:
|
||||||
NullModCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
NullModCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ModCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
virtual int cc39( int value ) { return 0;}
|
virtual int cc39( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc40( int value ) { return 0;}
|
virtual int cc40( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc41( int value ) { return 0;}
|
virtual int cc41( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc42( int value ) { return 0;}
|
virtual int cc42( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc43( int value ) { return 0;}
|
virtual int cc43( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "mod_models.h"
|
#include "mod_models.h"
|
||||||
|
|
||||||
|
const unsigned char null_mod_id[] = { 0x00, 0x00 };
|
||||||
|
|
||||||
const unsigned char sine_chorus_id[] = { 0x12, 0x00 };
|
const unsigned char sine_chorus_id[] = { 0x12, 0x00 };
|
||||||
const unsigned char tri_chorus_id[] = { 0x13, 0x00 };
|
const unsigned char tri_chorus_id[] = { 0x13, 0x00 };
|
||||||
const unsigned char sine_flange_id[] = { 0x18, 0x00 };
|
const unsigned char sine_flange_id[] = { 0x18, 0x00 };
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
#ifndef MOD_MODELS_H
|
#ifndef MOD_MODELS_H
|
||||||
#define MOD_MODELS_H
|
#define MOD_MODELS_H
|
||||||
|
|
||||||
|
extern const unsigned char null_mod_id[];
|
||||||
|
|
||||||
extern const unsigned char sine_chorus_id[];
|
extern const unsigned char sine_chorus_id[];
|
||||||
extern const unsigned char tri_chorus_id[];
|
extern const unsigned char tri_chorus_id[];
|
||||||
extern const unsigned char sine_flange_id[];
|
extern const unsigned char sine_flange_id[];
|
||||||
|
|
|
||||||
1255
mustang.cpp
1255
mustang.cpp
File diff suppressed because it is too large
Load diff
99
mustang.h
99
mustang.h
|
|
@ -20,37 +20,18 @@ class DelayCC;
|
||||||
class ModCC;
|
class ModCC;
|
||||||
class StompCC;
|
class StompCC;
|
||||||
|
|
||||||
|
|
||||||
class Mustang {
|
class Mustang {
|
||||||
friend class AmpCC;
|
|
||||||
friend class ReverbCC;
|
|
||||||
friend class DelayCC;
|
|
||||||
friend class ModCC;
|
|
||||||
friend class StompCC;
|
|
||||||
|
|
||||||
char preset_names[100][33];
|
|
||||||
unsigned curr_preset_idx;
|
|
||||||
|
|
||||||
unsigned char dsp_parms[6][64];
|
|
||||||
|
|
||||||
unsigned char curr_model[5][2];
|
|
||||||
|
|
||||||
unsigned char execute[64];
|
unsigned char execute[64];
|
||||||
|
|
||||||
static const unsigned char state_prefix[];
|
static const unsigned char state_prefix[];
|
||||||
static const unsigned char parms_done[];
|
|
||||||
|
|
||||||
static const unsigned char tuner_ack[];
|
|
||||||
static const unsigned char tuner_prefix[];
|
static const unsigned char tuner_prefix[];
|
||||||
|
|
||||||
static const unsigned char select_ack[];
|
|
||||||
static const unsigned char cc_ack[];
|
|
||||||
|
|
||||||
libusb_device_handle *usb_io;
|
libusb_device_handle *usb_io;
|
||||||
|
|
||||||
pthread_t worker;
|
pthread_t worker;
|
||||||
|
|
||||||
pthread_mutex_t data_lock = PTHREAD_MUTEX_INITIALIZER;
|
|
||||||
|
|
||||||
pthread_mutex_t shutdown_lock = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t shutdown_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
bool want_shutdown;
|
bool want_shutdown;
|
||||||
|
|
||||||
|
|
@ -66,13 +47,35 @@ class Mustang {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Manage access to each DSP block
|
|
||||||
Condition<bool> dsp_sync[5];
|
|
||||||
|
|
||||||
Condition<bool> preset_names_sync;
|
Condition<bool> preset_names_sync;
|
||||||
|
char preset_names[100][33];
|
||||||
|
unsigned curr_preset_idx;
|
||||||
|
|
||||||
|
// Manage access to each DSP block
|
||||||
|
Condition<bool> dsp_sync[6];
|
||||||
|
unsigned char dsp_parms[6][64];
|
||||||
|
|
||||||
|
// Received {0x1c, 0x01, 0x00, ...}
|
||||||
|
Condition<bool> cc_ack_eom;
|
||||||
|
|
||||||
|
// Received {0x00, 0x00, 0x19, ... }
|
||||||
|
Condition<bool> efx_toggle_sync;
|
||||||
|
static const unsigned char efx_toggle_ack[];
|
||||||
|
|
||||||
// Synchronize init on end of initial parm dump
|
// Synchronize init on end of initial parm dump
|
||||||
Condition<bool> parm_read_sync;
|
Condition<bool> parm_read_sync;
|
||||||
|
static const unsigned char parm_read_ack[];
|
||||||
|
|
||||||
|
// Synchronize on receipt of model change acknowledge
|
||||||
|
Condition<bool> model_change_sync;
|
||||||
|
static const unsigned char model_change_ack[];
|
||||||
|
|
||||||
|
// Synchronize on receipt of control change acknowledge
|
||||||
|
Condition<bool> cc_ack_sync;
|
||||||
|
static const unsigned char cc_ack[];
|
||||||
|
|
||||||
|
Condition<bool> tuner_ack_sync;
|
||||||
|
static const unsigned char tuner_ack[];
|
||||||
|
|
||||||
struct usb_id {
|
struct usb_id {
|
||||||
// product id
|
// product id
|
||||||
|
|
@ -87,30 +90,23 @@ class Mustang {
|
||||||
static const usb_id amp_ids[];
|
static const usb_id amp_ids[];
|
||||||
bool isV2;
|
bool isV2;
|
||||||
|
|
||||||
static void *threadStarter( void * );
|
|
||||||
void handleInput( void );
|
|
||||||
|
|
||||||
bool tuner_active;
|
bool tuner_active;
|
||||||
|
|
||||||
AmpCC * curr_amp;
|
AmpCC * curr_amp;
|
||||||
ReverbCC * curr_reverb;
|
|
||||||
DelayCC * curr_delay;
|
|
||||||
ModCC * curr_mod;
|
|
||||||
StompCC * curr_stomp;
|
StompCC * curr_stomp;
|
||||||
|
ModCC * curr_mod;
|
||||||
|
DelayCC * curr_delay;
|
||||||
|
ReverbCC * curr_reverb;
|
||||||
|
|
||||||
public:
|
static void *threadStarter( void * );
|
||||||
struct Cmd {
|
void handleInput( void );
|
||||||
int state_index;
|
|
||||||
int parm2;
|
|
||||||
int parm5;
|
|
||||||
int parm6;
|
|
||||||
int parm7;
|
|
||||||
int value;
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
int direct_control( unsigned char *cmd );
|
||||||
int continuous_control( const Mustang::Cmd & cmd );
|
|
||||||
int discrete_control( const Mustang::Cmd & cmd );
|
int sendCmd( unsigned char *buffer );
|
||||||
|
int requestDump( void );
|
||||||
|
int executeModelChange( unsigned char *buffer );
|
||||||
|
|
||||||
void updateAmpObj( const unsigned char *data );
|
void updateAmpObj( const unsigned char *data );
|
||||||
void updateStompObj( const unsigned char *data );
|
void updateStompObj( const unsigned char *data );
|
||||||
|
|
@ -132,22 +128,25 @@ public:
|
||||||
int commShutdown( void );
|
int commShutdown( void );
|
||||||
|
|
||||||
int setAmp( int ord );
|
int setAmp( int ord );
|
||||||
int setReverb( int ord );
|
int ampControl( int cc, int value );
|
||||||
int setDelay( int ord );
|
|
||||||
int setMod( int ord );
|
|
||||||
int setStomp( int ord );
|
int setStomp( int ord );
|
||||||
|
int stompControl( int cc, int value );
|
||||||
|
|
||||||
|
int setMod( int ord );
|
||||||
|
int modControl( int cc, int value );
|
||||||
|
|
||||||
|
int setDelay( int ord );
|
||||||
|
int delayControl( int cc, int value );
|
||||||
|
|
||||||
|
int setReverb( int ord );
|
||||||
|
int reverbControl( int cc, int value );
|
||||||
|
|
||||||
int tunerMode( int value );
|
int tunerMode( int value );
|
||||||
|
|
||||||
int patchChange( int );
|
int patchChange( int );
|
||||||
|
|
||||||
int effectToggle( int cc, int value );
|
int effectToggle( int cc, int value );
|
||||||
|
|
||||||
AmpCC * getAmp( void ) { return curr_amp;}
|
|
||||||
ReverbCC * getReverb( void ) { return curr_reverb;}
|
|
||||||
DelayCC * getDelay( void ) { return curr_delay;}
|
|
||||||
ModCC * getMod( void ) { return curr_mod;}
|
|
||||||
StompCC * getStomp( void ) { return curr_stomp;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,26 +7,16 @@
|
||||||
|
|
||||||
#include "mustang.h"
|
#include "mustang.h"
|
||||||
|
|
||||||
#if 0
|
|
||||||
#include "amp.h"
|
|
||||||
#include "reverb.h"
|
|
||||||
#include "delay.h"
|
|
||||||
#include "mod.h"
|
|
||||||
#include "stomp.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static Mustang mustang;
|
static Mustang mustang;
|
||||||
|
|
||||||
static int channel;
|
static int channel;
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
void message_action( double deltatime, std::vector< unsigned char > *message, void *userData ) {
|
void message_action( double deltatime, std::vector< unsigned char > *message, void *userData ) {
|
||||||
#if 0
|
#if 0
|
||||||
unsigned int nBytes = message->size();
|
unsigned int nBytes = message->size();
|
||||||
if ( nBytes > 0 ) {
|
if ( nBytes == 2 ) fprintf( stdout, "%02x %d\n", (int)message->at(0), (int)message->at(1) );
|
||||||
fprintf( stdout, "%02x %d %d\n", (int)message->at(0), (int)message->at(1), (int)message->at(2) );
|
else if ( nBytes == 3 ) fprintf( stdout, "%02x %d %d\n", (int)message->at(0), (int)message->at(1), (int)message->at(2) );
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Is this for us?
|
// Is this for us?
|
||||||
|
|
@ -40,7 +30,7 @@ void message_action( double deltatime, std::vector< unsigned char > *message, vo
|
||||||
case 0xc0: {
|
case 0xc0: {
|
||||||
// Program change
|
// Program change
|
||||||
int bank = (int)(*message)[1];
|
int bank = (int)(*message)[1];
|
||||||
int rc = mustang.load_memory_bank( bank );
|
int rc = mustang.patchChange( bank );
|
||||||
if ( rc ) {
|
if ( rc ) {
|
||||||
fprintf( stderr, "Error: PC#%d failed. RC = %d\n", bank, rc );
|
fprintf( stderr, "Error: PC#%d failed. RC = %d\n", bank, rc );
|
||||||
}
|
}
|
||||||
|
|
@ -59,20 +49,20 @@ void message_action( double deltatime, std::vector< unsigned char > *message, vo
|
||||||
}
|
}
|
||||||
// All EFX toggle
|
// All EFX toggle
|
||||||
else if ( cc == 22 ) {
|
else if ( cc == 22 ) {
|
||||||
rc = mustang.effect_toggle( 23, value );
|
rc = mustang.effectToggle( 23, value );
|
||||||
if ( rc == 0 ) {
|
if ( rc == 0 ) {
|
||||||
rc = mustang.effect_toggle( 24, value );
|
rc = mustang.effectToggle( 24, value );
|
||||||
if ( rc == 0 ) {
|
if ( rc == 0 ) {
|
||||||
rc = mustang.effect_toggle( 25, value );
|
rc = mustang.effectToggle( 25, value );
|
||||||
if ( rc == 0 ) {
|
if ( rc == 0 ) {
|
||||||
rc = mustang.effect_toggle( 26, value );
|
rc = mustang.effectToggle( 26, value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Effects on/off
|
// Effects on/off
|
||||||
else if ( cc >= 23 && cc <= 26 ) {
|
else if ( cc >= 23 && cc <= 26 ) {
|
||||||
rc = mustang.effect_toggle( cc, value );
|
rc = mustang.effectToggle( cc, value );
|
||||||
}
|
}
|
||||||
// Set stomp model
|
// Set stomp model
|
||||||
else if ( cc == 28 ) {
|
else if ( cc == 28 ) {
|
||||||
|
|
@ -80,8 +70,7 @@ void message_action( double deltatime, std::vector< unsigned char > *message, vo
|
||||||
}
|
}
|
||||||
// Stomp CC handler
|
// Stomp CC handler
|
||||||
else if ( cc >= 29 && cc <= 33 ) {
|
else if ( cc >= 29 && cc <= 33 ) {
|
||||||
StompCC *stompObj = mustang.getStomp();
|
rc = mustang.stompControl( cc, value );
|
||||||
rc = stompObj->dispatch( cc, value );
|
|
||||||
}
|
}
|
||||||
// Set mod model
|
// Set mod model
|
||||||
else if ( cc == 38 ) {
|
else if ( cc == 38 ) {
|
||||||
|
|
@ -89,8 +78,7 @@ void message_action( double deltatime, std::vector< unsigned char > *message, vo
|
||||||
}
|
}
|
||||||
// Mod CC handler
|
// Mod CC handler
|
||||||
else if ( cc >= 39 && cc <= 43 ) {
|
else if ( cc >= 39 && cc <= 43 ) {
|
||||||
ModCC *modObj = mustang.getMod();
|
rc = mustang.modControl( cc, value );
|
||||||
rc = modObj->dispatch( cc, value );
|
|
||||||
}
|
}
|
||||||
// Set delay model
|
// Set delay model
|
||||||
else if ( cc == 48 ) {
|
else if ( cc == 48 ) {
|
||||||
|
|
@ -98,8 +86,7 @@ void message_action( double deltatime, std::vector< unsigned char > *message, vo
|
||||||
}
|
}
|
||||||
// Delay CC handler
|
// Delay CC handler
|
||||||
else if ( cc >= 49 && cc <= 54 ) {
|
else if ( cc >= 49 && cc <= 54 ) {
|
||||||
DelayCC *delayObj = mustang.getDelay();
|
rc = mustang.delayControl( cc, value );
|
||||||
rc = delayObj->dispatch( cc, value );
|
|
||||||
}
|
}
|
||||||
// Set reverb model
|
// Set reverb model
|
||||||
else if ( cc == 58 ) {
|
else if ( cc == 58 ) {
|
||||||
|
|
@ -107,8 +94,7 @@ void message_action( double deltatime, std::vector< unsigned char > *message, vo
|
||||||
}
|
}
|
||||||
// Reverb CC handler
|
// Reverb CC handler
|
||||||
else if ( cc >= 59 && cc <= 63 ) {
|
else if ( cc >= 59 && cc <= 63 ) {
|
||||||
ReverbCC *reverbObj = mustang.getReverb();
|
rc = mustang.reverbControl( cc, value );
|
||||||
rc = reverbObj->dispatch( cc, value );
|
|
||||||
}
|
}
|
||||||
// Set amp model
|
// Set amp model
|
||||||
else if ( cc == 68 ) {
|
else if ( cc == 68 ) {
|
||||||
|
|
@ -116,8 +102,7 @@ void message_action( double deltatime, std::vector< unsigned char > *message, vo
|
||||||
}
|
}
|
||||||
// Amp CC Handler
|
// Amp CC Handler
|
||||||
else if ( cc >= 69 && cc <= 79 ) {
|
else if ( cc >= 69 && cc <= 79 ) {
|
||||||
AmpCC *ampObj = mustang.getAmp();
|
rc = mustang.ampControl( cc, value );
|
||||||
rc = ampObj->dispatch( cc, value );
|
|
||||||
}
|
}
|
||||||
if ( rc ) {
|
if ( rc ) {
|
||||||
fprintf( stderr, "Error: CC#%d failed. RC = %d\n", cc, rc );
|
fprintf( stderr, "Error: CC#%d failed. RC = %d\n", cc, rc );
|
||||||
|
|
@ -131,8 +116,6 @@ void message_action( double deltatime, std::vector< unsigned char > *message, vo
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// void errorcallback( RtError::Type type, const std::string & detail, void *userData ) {
|
// void errorcallback( RtError::Type type, const std::string & detail, void *userData ) {
|
||||||
// std::cout << "Error: Code = " << type << ", Msg: " << detail << "\n";
|
// std::cout << "Error: Code = " << type << ", Msg: " << detail << "\n";
|
||||||
// }
|
// }
|
||||||
|
|
@ -166,9 +149,6 @@ int main( int argc, const char **argv ) {
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf( stderr, "Setup done!\n" );
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
RtMidiIn *input_handler = new RtMidiIn();
|
RtMidiIn *input_handler = new RtMidiIn();
|
||||||
|
|
||||||
// See if we have any ports
|
// See if we have any ports
|
||||||
|
|
@ -185,8 +165,6 @@ int main( int argc, const char **argv ) {
|
||||||
// Don't want sysex, timing, active sense
|
// Don't want sysex, timing, active sense
|
||||||
input_handler->ignoreTypes( true, true, true );
|
input_handler->ignoreTypes( true, true, true );
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Block and wait for signal
|
// Block and wait for signal
|
||||||
pause();
|
pause();
|
||||||
|
|
||||||
|
|
@ -199,8 +177,6 @@ int main( int argc, const char **argv ) {
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf( stderr, "Shutdown complete!\n" );
|
|
||||||
|
|
||||||
// delete input_handler;
|
// delete input_handler;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
||||||
34
reverb.cpp
34
reverb.cpp
|
|
@ -1,44 +1,44 @@
|
||||||
|
|
||||||
#include "reverb.h"
|
#include "reverb.h"
|
||||||
#include "mustang.h"
|
#include "magic.h"
|
||||||
#include "constants.h"
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ReverbCC::continuous_control( int parm5, int parm6, int parm7, int value ) {
|
ReverbCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
|
||||||
Mustang::Cmd cmd;
|
cmd[2] = 0x06;
|
||||||
cmd.state_index = REVERB_STATE;
|
memcpy( cmd + 3, model, 2 );
|
||||||
cmd.parm2 = 0x06;
|
cmd[5] = parm5;
|
||||||
cmd.parm5 = parm5;
|
cmd[6] = parm6;
|
||||||
cmd.parm6 = parm6;
|
cmd[7] = parm7;
|
||||||
cmd.parm7 = parm7;
|
|
||||||
cmd.value = value;
|
|
||||||
|
|
||||||
return amp->continuous_control( cmd );
|
unsigned short magic = magic_values[value];
|
||||||
|
cmd[9] = magic & 0xff;
|
||||||
|
cmd[10] = (magic >> 8) & 0xff;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ReverbCC::dispatch( int cc, int value ) {
|
ReverbCC::dispatch( int cc, int value, unsigned char *cmd ) {
|
||||||
|
|
||||||
switch ( cc ) {
|
switch ( cc ) {
|
||||||
case 59:
|
case 59:
|
||||||
// Level
|
// Level
|
||||||
return cc59( value );
|
return cc59( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 60:
|
case 60:
|
||||||
// Decay
|
// Decay
|
||||||
return cc60( value );
|
return cc60( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 61:
|
case 61:
|
||||||
// Dwell
|
// Dwell
|
||||||
return cc61( value );
|
return cc61( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 62:
|
case 62:
|
||||||
// Diffusion
|
// Diffusion
|
||||||
return cc62( value );
|
return cc62( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 63:
|
case 63:
|
||||||
// Tone
|
// Tone
|
||||||
return cc63( value );
|
return cc63( value, cmd );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
24
reverb.h
24
reverb.h
|
|
@ -14,7 +14,7 @@ protected:
|
||||||
unsigned char model[2];
|
unsigned char model[2];
|
||||||
unsigned char slot;
|
unsigned char slot;
|
||||||
|
|
||||||
int continuous_control( int parm5, int parm6, int parm7, int value );
|
int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ReverbCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
ReverbCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
||||||
|
|
@ -24,21 +24,21 @@ public:
|
||||||
memcpy( this->model, model, 2 );
|
memcpy( this->model, model, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int dispatch( int cc, int value );
|
int dispatch( int cc, int value, unsigned char *cmd );
|
||||||
const unsigned char *getModel( void ) { return model;}
|
const unsigned char *getModel( void ) { return model;}
|
||||||
const unsigned char getSlot( void ) { return slot;}
|
const unsigned char getSlot( void ) { return slot;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
int cc59( int value ) { return continuous_control( 0x00, 0x00, 0x0b, value );}
|
int cc59( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x0b, value, cmd );}
|
||||||
// Decay
|
// Decay
|
||||||
int cc60( int value ) { return continuous_control( 0x01, 0x01, 0x0b, value );}
|
int cc60( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x0b, value, cmd );}
|
||||||
// Dwell
|
// Dwell
|
||||||
int cc61( int value ) { return continuous_control( 0x02, 0x02, 0x0b, value );}
|
int cc61( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x0b, value, cmd );}
|
||||||
// Diffusion
|
// Diffusion
|
||||||
int cc62( int value ) { return continuous_control( 0x03, 0x03, 0x0b, value );}
|
int cc62( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x0b, value, cmd );}
|
||||||
// Tone
|
// Tone
|
||||||
int cc63( int value ) { return continuous_control( 0x04, 0x04, 0x0b, value );}
|
int cc63( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x0b, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -46,11 +46,11 @@ class NullReverbCC : public ReverbCC {
|
||||||
public:
|
public:
|
||||||
NullReverbCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ReverbCC(theAmp,model,theSlot) {}
|
NullReverbCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : ReverbCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
int cc59( int value ) { return 0;}
|
int cc59( int value, unsigned char *cmd ) { return -1;}
|
||||||
int cc60( int value ) { return 0;}
|
int cc60( int value, unsigned char *cmd ) { return -1;}
|
||||||
int cc61( int value ) { return 0;}
|
int cc61( int value, unsigned char *cmd ) { return -1;}
|
||||||
int cc62( int value ) { return 0;}
|
int cc62( int value, unsigned char *cmd ) { return -1;}
|
||||||
int cc63( int value ) { return 0;}
|
int cc63( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
4
reverb_models.cpp
Normal file
4
reverb_models.cpp
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#include "reverb_models.h"
|
||||||
|
|
||||||
|
const unsigned char null_reverb_id[] = { 0x00, 0x00 };
|
||||||
|
|
||||||
8
reverb_models.h
Normal file
8
reverb_models.h
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
// -*-c++-*-
|
||||||
|
|
||||||
|
#ifndef REVERB_MODELS_H
|
||||||
|
#define REVERB_MODELS_H
|
||||||
|
|
||||||
|
extern const unsigned char null_reverb_id[];
|
||||||
|
|
||||||
|
#endif
|
||||||
51
stomp.cpp
51
stomp.cpp
|
|
@ -1,57 +1,56 @@
|
||||||
|
|
||||||
#include "stomp.h"
|
#include "stomp.h"
|
||||||
#include "mustang.h"
|
#include "magic.h"
|
||||||
#include "constants.h"
|
|
||||||
|
|
||||||
int
|
int
|
||||||
StompCC::continuous_control( int parm5, int parm6, int parm7, int value ) {
|
StompCC::continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
|
||||||
Mustang::Cmd cmd;
|
cmd[2] = 0x03;
|
||||||
cmd.state_index = STOMP_STATE;
|
memcpy( cmd + 3, model, 2 );
|
||||||
cmd.parm2 = 0x03;
|
cmd[5] = parm5;
|
||||||
cmd.parm5 = parm5;
|
cmd[6] = parm6;
|
||||||
cmd.parm6 = parm6;
|
cmd[7] = parm7;
|
||||||
cmd.parm7 = parm7;
|
|
||||||
cmd.value = value;
|
|
||||||
|
|
||||||
return amp->continuous_control( cmd );
|
unsigned short magic = magic_values[value];
|
||||||
|
cmd[9] = magic & 0xff;
|
||||||
|
cmd[10] = (magic >> 8) & 0xff;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
StompCC::discrete_control( int parm5, int parm6, int parm7, int value ) {
|
StompCC::discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd ) {
|
||||||
Mustang::Cmd cmd;
|
cmd[2] = 0x03;
|
||||||
cmd.state_index = STOMP_STATE;
|
memcpy( cmd + 3, model, 2 );
|
||||||
cmd.parm2 = 0x03;
|
cmd[5] = parm5;
|
||||||
cmd.parm5 = parm5;
|
cmd[6] = parm6;
|
||||||
cmd.parm6 = parm6;
|
cmd[7] = parm7;
|
||||||
cmd.parm7 = parm7;
|
|
||||||
cmd.value = value;
|
|
||||||
|
|
||||||
return amp->discrete_control( cmd );
|
cmd[9] = value;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
StompCC::dispatch( int cc, int value ) {
|
StompCC::dispatch( int cc, int value, unsigned char *cmd ) {
|
||||||
|
|
||||||
switch ( cc ) {
|
switch ( cc ) {
|
||||||
case 29:
|
case 29:
|
||||||
// Level / Mix / Type
|
// Level / Mix / Type
|
||||||
return cc29( value );
|
return cc29( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 30:
|
case 30:
|
||||||
// Gain / Freq / Sens / Thresh
|
// Gain / Freq / Sens / Thresh
|
||||||
return cc30( value );
|
return cc30( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 31:
|
case 31:
|
||||||
// Low / Heel Freq / Octave / Sens / Ratio
|
// Low / Heel Freq / Octave / Sens / Ratio
|
||||||
return cc31( value );
|
return cc31( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
// Mid / Toe Freq / Low / Octave / Attack
|
// Mid / Toe Freq / Low / Octave / Attack
|
||||||
return cc32( value );
|
return cc32( value, cmd );
|
||||||
break;
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
// High / High Q / Peak / Relase
|
// High / High Q / Peak / Relase
|
||||||
return cc33( value );
|
return cc33( value, cmd );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
144
stomp.h
144
stomp.h
|
|
@ -14,8 +14,8 @@ protected:
|
||||||
unsigned char model[2];
|
unsigned char model[2];
|
||||||
unsigned char slot;
|
unsigned char slot;
|
||||||
|
|
||||||
int continuous_control( int parm5, int parm6, int parm7, int value );
|
int continuous_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd );
|
||||||
int discrete_control( int parm5, int parm6, int parm7, int value );
|
int discrete_control( int parm5, int parm6, int parm7, int value, unsigned char *cmd );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
StompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) :
|
||||||
|
|
@ -25,16 +25,16 @@ public:
|
||||||
memcpy( this->model, model, 2 );
|
memcpy( this->model, model, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int dispatch( int cc, int value );
|
int dispatch( int cc, int value, unsigned char *cmd );
|
||||||
const unsigned char *getModel( void ) { return model;}
|
const unsigned char *getModel( void ) { return model;}
|
||||||
const unsigned char getSlot( void ) { return slot;}
|
const unsigned char getSlot( void ) { return slot;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual int cc29( int value ) = 0;
|
virtual int cc29( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc30( int value ) = 0;
|
virtual int cc30( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc31( int value ) = 0;
|
virtual int cc31( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc32( int value ) = 0;
|
virtual int cc32( int value, unsigned char *cmd ) = 0;
|
||||||
virtual int cc33( int value ) = 0;
|
virtual int cc33( int value, unsigned char *cmd ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -43,15 +43,15 @@ public:
|
||||||
OverdriveCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
OverdriveCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Gain
|
// Gain
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Low
|
// Low
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Mid
|
// Mid
|
||||||
virtual int cc32( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// High
|
// High
|
||||||
virtual int cc33( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc33( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -60,17 +60,17 @@ public:
|
||||||
WahCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
WahCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Mix
|
// Mix
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Freq
|
// Freq
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Heel Freq
|
// Heel Freq
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Toe Freq
|
// Toe Freq
|
||||||
virtual int cc32( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// High Q
|
// High Q
|
||||||
virtual int cc33( int value ) {
|
virtual int cc33( int value, unsigned char *cmd ) {
|
||||||
if ( value > 1 ) return 0;
|
if ( value > 1 ) return -1;
|
||||||
else return discrete_control( 0x04, 0x04, 0x81, value );
|
else return discrete_control( 0x04, 0x04, 0x81, value, cmd );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -80,15 +80,15 @@ public:
|
||||||
FuzzCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
FuzzCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Gain
|
// Gain
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Octave
|
// Octave
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Low
|
// Low
|
||||||
virtual int cc32( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// High
|
// High
|
||||||
virtual int cc33( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc33( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -97,15 +97,15 @@ public:
|
||||||
FuzzTouchWahCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
FuzzTouchWahCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Gain
|
// Gain
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Sens
|
// Sens
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Octave
|
// Octave
|
||||||
virtual int cc32( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Peak
|
// Peak
|
||||||
virtual int cc33( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc33( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -114,14 +114,14 @@ public:
|
||||||
SimpleCompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
SimpleCompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Type
|
// Type
|
||||||
virtual int cc29( int value ) {
|
virtual int cc29( int value, unsigned char *cmd ) {
|
||||||
if ( value > 3 ) return 0;
|
if ( value > 3 ) return -1;
|
||||||
else return discrete_control( 0x00, 0x05, 0x92, value );
|
else return discrete_control( 0x00, 0x05, 0x92, value, cmd );
|
||||||
}
|
}
|
||||||
virtual int cc30( int value ) { return 0;}
|
virtual int cc30( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc31( int value ) { return 0;}
|
virtual int cc31( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc32( int value ) { return 0;}
|
virtual int cc32( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc33( int value ) { return 0;}
|
virtual int cc33( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -130,15 +130,15 @@ public:
|
||||||
CompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
CompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Thresh
|
// Thresh
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Ratio
|
// Ratio
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x02, 0x04, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x04, value, cmd );}
|
||||||
// Attack
|
// Attack
|
||||||
virtual int cc32( int value ) { return continuous_control( 0x03, 0x03, 0x01, value );}
|
virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x01, value, cmd );}
|
||||||
// Release
|
// Release
|
||||||
virtual int cc33( int value ) { return continuous_control( 0x04, 0x04, 0x01, value );}
|
virtual int cc33( int value, unsigned char *cmd ) { return continuous_control( 0x04, 0x04, 0x01, value, cmd );}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -147,15 +147,15 @@ public:
|
||||||
RangerCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot) : StompCC(theAmp,model,theSlot) {}
|
RangerCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Gain
|
// Gain
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Lo-Cut
|
// Lo-Cut
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x03, 0x01, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x03, 0x01, value, cmd );}
|
||||||
// Bright
|
// Bright
|
||||||
virtual int cc32( int value ) { return continuous_control( 0x03, 0x02, 0x01, value );}
|
virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x02, 0x01, value, cmd );}
|
||||||
// n/a
|
// n/a
|
||||||
virtual int cc33( int value ) { return 0;}
|
virtual int cc33( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -164,15 +164,15 @@ public:
|
||||||
GreenBoxCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
GreenBoxCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Gain
|
// Gain
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Tone
|
// Tone
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// Bright
|
// Bright
|
||||||
virtual int cc32( int value ) { return continuous_control( 0x03, 0x03, 0x12, value );}
|
virtual int cc32( int value, unsigned char *cmd ) { return continuous_control( 0x03, 0x03, 0x12, value, cmd );}
|
||||||
// n/a
|
// n/a
|
||||||
virtual int cc33( int value ) { return 0;}
|
virtual int cc33( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -181,15 +181,15 @@ public:
|
||||||
OrangeBoxCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
OrangeBoxCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Dist
|
// Dist
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x02, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x02, 0x01, value, cmd );}
|
||||||
// Tone
|
// Tone
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x01, 0x01, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x01, 0x01, value, cmd );}
|
||||||
// n/a
|
// n/a
|
||||||
virtual int cc32( int value ) { return 0;}
|
virtual int cc32( int value, unsigned char *cmd ) { return -1;}
|
||||||
// n/a
|
// n/a
|
||||||
virtual int cc33( int value ) { return 0;}
|
virtual int cc33( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -198,15 +198,15 @@ public:
|
||||||
BlackBoxCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
BlackBoxCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Dist
|
// Dist
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x02, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x02, 0x01, value, cmd );}
|
||||||
// Filter
|
// Filter
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x01, 0x01, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x01, 0x01, value, cmd );}
|
||||||
// n/a
|
// n/a
|
||||||
virtual int cc32( int value ) { return 0;}
|
virtual int cc32( int value, unsigned char *cmd ) { return -1;}
|
||||||
// n/a
|
// n/a
|
||||||
virtual int cc33( int value ) { return 0;}
|
virtual int cc33( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -215,15 +215,15 @@ public:
|
||||||
BigFuzzCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
BigFuzzCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
// Level
|
// Level
|
||||||
virtual int cc29( int value ) { return continuous_control( 0x00, 0x00, 0x01, value );}
|
virtual int cc29( int value, unsigned char *cmd ) { return continuous_control( 0x00, 0x00, 0x01, value, cmd );}
|
||||||
// Tone
|
// Tone
|
||||||
virtual int cc30( int value ) { return continuous_control( 0x01, 0x01, 0x01, value );}
|
virtual int cc30( int value, unsigned char *cmd ) { return continuous_control( 0x01, 0x01, 0x01, value, cmd );}
|
||||||
// Sustain
|
// Sustain
|
||||||
virtual int cc31( int value ) { return continuous_control( 0x02, 0x02, 0x01, value );}
|
virtual int cc31( int value, unsigned char *cmd ) { return continuous_control( 0x02, 0x02, 0x01, value, cmd );}
|
||||||
// n/a
|
// n/a
|
||||||
virtual int cc32( int value ) { return 0;}
|
virtual int cc32( int value, unsigned char *cmd ) { return -1;}
|
||||||
// n/a
|
// n/a
|
||||||
virtual int cc33( int value ) { return 0;}
|
virtual int cc33( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -231,11 +231,11 @@ class NullStompCC : public StompCC {
|
||||||
public:
|
public:
|
||||||
NullStompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
NullStompCC( Mustang * theAmp, const unsigned char *model, const unsigned char theSlot ) : StompCC(theAmp,model,theSlot) {}
|
||||||
private:
|
private:
|
||||||
virtual int cc29( int value ) { return 0;}
|
virtual int cc29( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc30( int value ) { return 0;}
|
virtual int cc30( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc31( int value ) { return 0;}
|
virtual int cc31( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc32( int value ) { return 0;}
|
virtual int cc32( int value, unsigned char *cmd ) { return -1;}
|
||||||
virtual int cc33( int value ) { return 0;}
|
virtual int cc33( int value, unsigned char *cmd ) { return -1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "stomp_models.h"
|
#include "stomp_models.h"
|
||||||
|
|
||||||
|
const unsigned char null_stomp_id[] = { 0x00, 0x00 };
|
||||||
|
|
||||||
const unsigned char overdrive_id[] = { 0x3c, 0x00 };
|
const unsigned char overdrive_id[] = { 0x3c, 0x00 };
|
||||||
const unsigned char wah_id[] = { 0x49, 0x00 };
|
const unsigned char wah_id[] = { 0x49, 0x00 };
|
||||||
const unsigned char touch_wah_id[] = { 0x4a, 0x00 };
|
const unsigned char touch_wah_id[] = { 0x4a, 0x00 };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef STOMP_MODELS_H
|
#ifndef STOMP_MODELS_H
|
||||||
#define STOMP_MODELS_H
|
#define STOMP_MODELS_H
|
||||||
|
|
||||||
|
extern const unsigned char null_stomp_id[];
|
||||||
|
|
||||||
extern const unsigned char overdrive_id[];
|
extern const unsigned char overdrive_id[];
|
||||||
extern const unsigned char wah_id[];
|
extern const unsigned char wah_id[];
|
||||||
extern const unsigned char touch_wah_id[];
|
extern const unsigned char touch_wah_id[];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue