MIDIReceiver
public protocol MIDIReceiver : AnyObject
Functionality we expect for entities that can receive MIDI messages.
-
The channel the controller listens on. If -1, then it wants msgs from ALL channels
Declaration
Swift
var channel: Int { get }
-
Stop playing note.
Declaration
Swift
func noteOff(note: UInt8)
Parameters
note
the MIDI note to stop
-
Start playing a note.
Declaration
Swift
func noteOn(note: UInt8, velocity: UInt8)
Parameters
note
the MIDI note to play
velocity
the velocity to use when playing
-
Command the keyboard to release any pressed keys
Declaration
Swift
func releaseAllKeys()
-
Update the key pressure of a playing note
Declaration
Swift
func polyphonicKeyPressure(note: UInt8, pressure: UInt8)
Parameters
note
the MIDI note that was previous started
pressure
the new pressure to use
-
Change a controller value
Declaration
Swift
func controlChange(controller: UInt8, value: UInt8)
Parameters
controller
the controller to change
value
the value to use
-
Change the program/preset (0-127)
Declaration
Swift
func programChange(program: UInt8)
Parameters
program
the new program to use
-
Change the whole pressure for the channel. Affects all playing notes.
Declaration
Swift
func channelPressure(pressure: UInt8)
Parameters
pressure
the new pressure to use
-
Update the pitch-bend controller to a new value
Declaration
Swift
func pitchBendChange(value: UInt16)
Parameters
value
the new pitch-bend value to use
-
process(_:
Extension methodwhen: ) Process a collection of MIDI messages for the controller.
Declaration
Swift
public func process(_ msgs: [MIDIMsg], when: MIDITimeStamp)
Parameters
msgs
the MIDIMsg collection