MIKMIDINoteOffCommand

Objective-C

@interface MIKMIDINoteOffCommand : MIKMIDINoteCommand

Swift

class MIKMIDINoteOffCommand : MIKMIDINoteCommand

A MIDI note off message.

  • Convenience method for creating a note off command.

    Declaration

    Objective-C

    + (nonnull instancetype)noteOffCommandWithNote:(NSUInteger)note
                                          velocity:(NSUInteger)velocity
                                           channel:(UInt8)channel
                                         timestamp:(nullable NSDate *)timestamp;

    Swift

    convenience init(note: UInt, velocity: UInt, channel: UInt8, timestamp: Date?)

    Parameters

    note

    The note number for the command. Must be between 0 and 127.

    velocity

    The velocity for the command. Must be between 0 and 127.

    channel

    The channel for the command. Must be between 0 and 15.

    timestamp

    The timestamp for the command. Pass nil to use the current date/time.

    Return Value

    An initialized MIKMIDINoteOffCommand instance.

  • Convenience method for creating a note off command.

    Declaration

    Objective-C

    + (nonnull instancetype)noteOffCommandWithNote:(NSUInteger)note
                                          velocity:(NSUInteger)velocity
                                           channel:(UInt8)channel
                                     midiTimeStamp:(MIDITimeStamp)timestamp;

    Swift

    convenience init(note: UInt, velocity: UInt, channel: UInt8, midiTimeStamp timestamp: MIDITimeStamp)

    Parameters

    note

    The note number for the command. Must be between 0 and 127.

    velocity

    The velocity for the command. Must be between 0 and 127.

    channel

    The channel for the command. Must be between 0 and 15.

    timestamp

    The MIDITimeStamp for the command.

    Return Value

    An initialized MIKMIDINoteOffCommand instance.

  • Convenience method to create a note off command from a note on command with zero velocity, or another note off command.

    Some MIDI devices send a note on message with zero velocity when a key or button is released, instead of sending a note off command. Writing code to deal with this possibility can be somewhat ugly, especially in Swift. Using this method, a note on command can be “transformed” into a note off command if its velocity is zero with a single call, then a single execution path to handle note off commands can be written.

    Note that this method returns nil if the passed in command has a velocity greater than zero.

    Declaration

    Objective-C

    + (instancetype _Nullable)noteOffCommandWithNoteCommand:
        (nonnull MIKMIDINoteCommand *)note;

    Swift

    convenience init?(noteCommand note: MIKMIDINoteCommand)

    Parameters

    note

    An instance of MIKNoteCommand.

    Return Value

    An instance of MIKMIDINoteOffCommand with the same note, channel, and timestamp as note. nil if note is a note on whose velocity is greater than zero.

Unavailable

  • Unavailable

    This is currently undocumented. Documentation contributions are always welcome!

    Declaration

    Objective-C

    + (nonnull instancetype)noteCommandWithNote:(NSUInteger)note
                                       velocity:(NSUInteger)velocity
                                        channel:(UInt8)channel
                                       isNoteOn:(BOOL)isNoteOn
                                      timestamp:(nullable NSDate *)timestamp;
  • Unavailable

    This is currently undocumented. Documentation contributions are always welcome!

    Declaration

    Objective-C

    + (nonnull instancetype)noteCommandWithNote:(NSUInteger)note
                                       velocity:(NSUInteger)velocity
                                        channel:(UInt8)channel
                                       isNoteOn:(BOOL)isNoteOn
                                  midiTimeStamp:(MIDITimeStamp)timestamp;