fix velocity input
This commit is contained in:
parent
0208883fa1
commit
39481ab571
|
@ -2185,6 +2185,13 @@ int DivEngine::getMaxVolumeChan(int ch) {
|
||||||
return chan[ch].volMax>>8;
|
return chan[ch].volMax>>8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DivEngine::mapVelocity(int ch, float vel) {
|
||||||
|
if (ch<0) return 0;
|
||||||
|
if (ch>=chans) return 0;
|
||||||
|
if (disCont[dispatchOfChan[ch]].dispatch==NULL) return 0;
|
||||||
|
return disCont[dispatchOfChan[ch]].dispatch->mapVelocity(dispatchChanOfChan[ch],vel);
|
||||||
|
}
|
||||||
|
|
||||||
unsigned char DivEngine::getOrder() {
|
unsigned char DivEngine::getOrder() {
|
||||||
return prevOrder;
|
return prevOrder;
|
||||||
}
|
}
|
||||||
|
|
|
@ -851,6 +851,9 @@ class DivEngine {
|
||||||
// get channel max volume
|
// get channel max volume
|
||||||
int getMaxVolumeChan(int chan);
|
int getMaxVolumeChan(int chan);
|
||||||
|
|
||||||
|
// map MIDI velocity to volume
|
||||||
|
int mapVelocity(int ch, float vel);
|
||||||
|
|
||||||
// get current order
|
// get current order
|
||||||
unsigned char getOrder();
|
unsigned char getOrder();
|
||||||
|
|
||||||
|
|
|
@ -1216,7 +1216,7 @@ void FurnaceGUI::noteInput(int num, int key, int vol) {
|
||||||
if (latchVol!=-1) {
|
if (latchVol!=-1) {
|
||||||
pat->data[cursor.y][3]=MIN(maxVol,latchVol);
|
pat->data[cursor.y][3]=MIN(maxVol,latchVol);
|
||||||
} else if (vol!=-1) {
|
} else if (vol!=-1) {
|
||||||
pat->data[cursor.y][3]=(vol*maxVol)/127;
|
pat->data[cursor.y][3]=e->mapVelocity(cursor.xCoarse,pow((float)vol/127.0f,midiMap.volExp));
|
||||||
}
|
}
|
||||||
if (latchEffect!=-1) pat->data[cursor.y][4]=latchEffect;
|
if (latchEffect!=-1) pat->data[cursor.y][4]=latchEffect;
|
||||||
if (latchEffectVal!=-1) pat->data[cursor.y][5]=latchEffectVal;
|
if (latchEffectVal!=-1) pat->data[cursor.y][5]=latchEffectVal;
|
||||||
|
@ -3776,7 +3776,7 @@ bool FurnaceGUI::loop() {
|
||||||
noteInput(
|
noteInput(
|
||||||
msg.data[0]-12,
|
msg.data[0]-12,
|
||||||
0,
|
0,
|
||||||
midiMap.volInput?((int)(pow((double)msg.data[1]/127.0,midiMap.volExp)*127.0)):-1
|
midiMap.volInput?msg.data[1]:-1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue