Dispatching pitch bend messages in the LV2 code
This commit is contained in:
parent
f012d45a48
commit
90d267c895
1 changed files with 9 additions and 0 deletions
|
|
@ -59,6 +59,7 @@
|
|||
#define CHANNEL_MASK 0x0F
|
||||
#define MIDI_CHANNEL(byte) (byte & CHANNEL_MASK)
|
||||
#define MIDI_STATUS(byte) (byte & ~CHANNEL_MASK)
|
||||
#define PITCH_BUILD_AND_CENTER(first_byte, last_byte) (int)(((unsigned int)last_byte << 7) + (unsigned int)first_byte) - 8192
|
||||
#define MAX_BLOCK_SIZE 8192
|
||||
#define MAX_PATH_SIZE 1024
|
||||
#define MAX_VOICES 256
|
||||
|
|
@ -465,6 +466,14 @@ sfizz_lv2_process_midi_event(sfizz_plugin_t *self, const LV2_Atom_Event *ev)
|
|||
(int)msg[1],
|
||||
msg[2]);
|
||||
break;
|
||||
case LV2_MIDI_MSG_BENDER:
|
||||
lv2_log_note(&self->logger,
|
||||
"[process_midi] Received pitch bend %d on channel %d at time %ld\n", PITCH_BUILD_AND_CENTER(msg[1], msg[2]) , MIDI_CHANNEL(msg[0]), ev->time.frames);
|
||||
sfizz_send_pitch_wheel(self->synth,
|
||||
(int)ev->time.frames,
|
||||
(int)MIDI_CHANNEL(msg[0]),
|
||||
PITCH_BUILD_AND_CENTER(msg[1], msg[2]));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue