MIDI velocity mapping, part 1

This commit is contained in:
tildearrow 2023-12-16 19:37:14 -05:00
parent d37669a8f0
commit 99dd85bcb4
12 changed files with 41 additions and 2 deletions

View file

@ -1372,8 +1372,8 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
}
if (note.on) {
dispatchCmd(DivCommand(DIV_CMD_INSTRUMENT,note.channel,note.ins,1));
if (note.volume>=0) {
int mappedVol=disCont[dispatchOfChan[note.channel]].dispatch->mapVelocity(note.channel,note.volume);
if (note.volume>=0 && !disCont[dispatchOfChan[note.channel]].dispatch->isVolGlobal()) {
int mappedVol=disCont[dispatchOfChan[note.channel]].dispatch->mapVelocity(dispatchChanOfChan[note.channel],note.volume);
logV("dispatching volume (%d -> %d)",note.volume,mappedVol);
dispatchCmd(DivCommand(DIV_CMD_VOLUME,note.channel,mappedVol));
}