prepare for MIDI velocity mapping

This commit is contained in:
tildearrow 2023-12-13 20:44:32 -05:00
parent bdef72666b
commit 69998e2c7e
4 changed files with 21 additions and 2 deletions

View file

@ -48,7 +48,9 @@ enum DivDispatchCmds {
DIV_CMD_ENV_RELEASE,
DIV_CMD_INSTRUMENT, // (ins, force)
DIV_CMD_VOLUME, // (vol)
// TODO: think of possibly moving this
DIV_CMD_GET_VOLUME, // () -> vol
// TODO: move. shouldn't be a command.
DIV_CMD_GET_VOLMAX, // () -> volMax
DIV_CMD_NOTE_PORTA, // (target, speed) -> 2 if target reached
DIV_CMD_PITCH, // (pitch)
@ -589,6 +591,14 @@ class DivDispatch {
*/
virtual bool isVolGlobal();
/**
* map MIDI velocity (from 0 to 127) to chip volume.
* @param ch the chip channel. -1 means N/A.
* @param vel input velocity.
* @return output volume.
*/
virtual int mapVelocity(int ch, unsigned char vel);
/**
* get the lowest note in a portamento.
* @param ch the channel in question.