DJ-TechTools / Midi_Fighter_Twister_Open_Source

95 stars 25 forks source link

FR: Support sending MIDI Program Change #11

Open ericpeters0n opened 3 years ago

ericpeters0n commented 3 years ago

Program Change is just a standard MIDI message!

Status Byte 1100NNNN (where NNNN is Channel in binary)

Data Byte 0PPPPPPP (0 + the new program number)

New to the codebase. Anyone familiar know where this would need to be added?

ericpeters0n commented 3 years ago

Appears a midi_stream_program_change() function similar to this could easily handle the dispatch of the message:

https://github.com/DJ-TechTools/Midi_Fighter_Twister_Open_Source/blob/e7f6c8fd08c962a936e87887ac80428bbdb4652c/src/midi.c#L367

ericpeters0n commented 3 years ago

This would be invoked by e.g. this process_encoder_input_switch function for configured button presses.

https://github.com/DJ-TechTools/Midi_Fighter_Twister_Open_Source/blob/e7f6c8fd08c962a936e87887ac80428bbdb4652c/src/encoders.c#L848