1
0
Fork 0

Document that plugins need MIDI IO for SysEx

This commit is contained in:
Robbert van der Helm 2023-06-07 21:18:31 +02:00
parent f170b72706
commit bc25d6bf0a
2 changed files with 7 additions and 4 deletions

View file

@ -18,16 +18,17 @@ pub use midi_consts::channel_event::control_change;
/// <https://github.com/rust-lang/rust/issues/26925> /// <https://github.com/rust-lang/rust/issues/26925>
pub type PluginNoteEvent<P> = NoteEvent<<P as Plugin>::SysExMessage>; pub type PluginNoteEvent<P> = NoteEvent<<P as Plugin>::SysExMessage>;
/// Determines which note events a plugin receives. /// Determines which note events a plugin can send and receive.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum MidiConfig { pub enum MidiConfig {
/// The plugin will not have a note input port and will thus not receive any not events. /// The plugin will not have a note input or output port and will thus not receive any not
/// events.
None, None,
/// The plugin receives note on/off/choke events, pressure, and potentially a couple /// The plugin receives note on/off/choke events, pressure, and potentially a couple
/// standardized expression types depending on the plugin standard and host. If the plugin sets /// standardized expression types depending on the plugin standard and host. If the plugin sets
/// up configuration for polyphonic modulation (see [`ClapPlugin`][crate::prelude::ClapPlugin]) /// up configuration for polyphonic modulation (see [`ClapPlugin`][crate::prelude::ClapPlugin])
/// and assigns polyphonic modulation IDs to some of its parameters, then it will also receive /// and assigns polyphonic modulation IDs to some of its parameters, then it will also receive
/// polyphonic modulation events. /// polyphonic modulation events. This level is also needed to be able to send SysEx events.
Basic, Basic,
/// The plugin receives full MIDI CCs as well as pitch bend information. For VST3 plugins this /// The plugin receives full MIDI CCs as well as pitch bend information. For VST3 plugins this
/// involves adding 130*16 parameters to bind to the the 128 MIDI CCs, pitch bend, and channel /// involves adding 130*16 parameters to bind to the the 128 MIDI CCs, pitch bend, and channel

View file

@ -120,7 +120,9 @@ pub trait Plugin: Default + Send + 'static {
/// The plugin's SysEx message type if it supports sending or receiving MIDI SysEx messages, or /// The plugin's SysEx message type if it supports sending or receiving MIDI SysEx messages, or
/// `()` if it does not. This type can be a struct or enum wrapping around one or more message /// `()` if it does not. This type can be a struct or enum wrapping around one or more message
/// types, and the [`SysExMessage`] trait is then used to convert between this type and basic /// types, and the [`SysExMessage`] trait is then used to convert between this type and basic
/// byte buffers. /// byte buffers. The [`MIDI_INPUT`][Self::MIDI_INPUT] and [`MIDI_OUTPUT`][Self::MIDI_OUTPUT]
/// fields need to be set to [`MidiConfig::Basic`] or above to be able to send and receive
/// SysEx.
type SysExMessage: SysExMessage; type SysExMessage: SysExMessage;
/// A type encoding the different background tasks this plugin wants to run, or `()` if it /// A type encoding the different background tasks this plugin wants to run, or `()` if it