Added controllers for mod-wheel, foot, breath and aftertouch.

pull/1/head
Holger Wirtz 8 years ago
parent c74b2b6635
commit d425065b31
  1. 28
      src/dexed.cpp
  2. 40
      src/msfa/controllers.h

@ -555,7 +555,7 @@ void Dexed::ProcessMidiMessage(const uint8_t *buf, uint32_t buf_size) {
// setCurrentProgram(buf[1]);
// break;
// aftertouch
// channel aftertouch
case 0xd0 :
TRACE("MIDI aftertouch 0xd0 event: %d %d",buf[1]);
controllers.aftertouch_cc = buf[1];
@ -684,12 +684,6 @@ void Dexed::onParam(uint8_t param_num,float param_val)
_param_change_counter++;
if(param_num==165)
{
int32_t tune=param_val*0x4000;
controllers.masterTune=(tune<<11)*(1.0/12);
}
if(param_num==144 || param_num==134)
panic();
@ -706,28 +700,32 @@ void Dexed::onParam(uint8_t param_num,float param_val)
controllers.values_[kControllerPitchStep]=data[param_num];
break;
case 157:
controllers.values_[kControllerModRange]=data[param_num];
controllers.wheel.setRange(data[param_num]);
break;
case 158:
controllers.values_[kControllerModAssign]=data[param_num];
controllers.wheel.setConfig(data[param_num]);
break;
case 159:
controllers.values_[kControllerFootRange]=data[param_num];
controllers.foot.setRange(data[param_num]);
break;
case 160:
controllers.values_[kControllerFootAssign]=data[param_num];
controllers.foot.setConfig(data[param_num]);
break;
case 161:
controllers.values_[kControllerBreathRange]=data[param_num];
controllers.breath.setRange(data[param_num]);
break;
case 162:
controllers.values_[kControllerBreathAssign]=data[param_num];
controllers.breath.setConfig(data[param_num]);
break;
case 163:
controllers.values_[kControllerATRange]=data[param_num];
controllers.at.setRange(data[param_num]);
break;
case 164:
controllers.values_[kControllerATAssign]=data[param_num];
controllers.at.setConfig(data[param_num]);
break;
case 165:
int32_t tune=param_val*0x4000;
controllers.masterTune=(tune<<11)*(1.0/12);
break;
}

@ -31,23 +31,11 @@
const int kControllerPitch = 0;
const int kControllerPitchRange = 1;
const int kControllerPitchStep = 2;
const int kControllerMod = 4;
const int kControllerModRange = 5;
const int kControllerModAssign = 6;
const int kControllerFoot = 7;
const int kControllerFootRange = 8;
const int kControllerFootAssign = 9;
const int kControllerBreath = 10;
const int kControllerBreathRange = 11;
const int kControllerBreathAssign = 12;
const int kControllerAT = 13;
const int kControllerATRange = 14;
const int kControllerATAssign = 15;
class FmCore;
struct FmMod {
int range;
uint8_t range;
bool pitch;
bool amp;
bool eg;
@ -59,18 +47,22 @@ struct FmMod {
eg = false;
}
void parseConfig(const char *cfg) {
int r = 0, p = 0, a = 0, e = 0;
sscanf(cfg, "%d %d %d %d", &r, &p, &a, &e);
range = r < 0 && r > 127 ? 0 : r;
pitch = p != 0;
amp = a != 0;
eg = e != 0;
public:
void setRange(uint8_t r) {
//range = r < 0 && r > 127 ? 0 : r;
range = r < 0 && r > 100 ? 0 : r;
}
void setConfig(char *cfg) {
snprintf(cfg, 13, "%d %d %d %d", range, pitch, amp, eg);
void setConfig(uint8_t assign) {
if(assign & 1)
pitch=true;
if(assign & (1<<1))
amp=true;
if(assign & (1<<2))
eg=true;
}
};

Loading…
Cancel
Save