MIKMIDINoteEvent
Objective-C
@interface MIKMIDINoteEvent : MIKMIDIEvent
Swift
class MIKMIDINoteEvent : MIKMIDIEvent
A MIDI note event.
-
Convenience method for creating a new MIKMIDINoteEvent.
Declaration
Objective-C
+ (nonnull instancetype)noteEventWithTimeStamp:(MusicTimeStamp)timeStamp note:(UInt8)note velocity:(UInt8)velocity duration:(Float32)duration channel:(UInt8)channel;
Swift
convenience init(timeStamp: MusicTimeStamp, note: UInt8, velocity: UInt8, duration: Float32, channel: UInt8)
Parameters
timeStamp
A MusicTimeStamp value indicating the timestamp for the event.
note
The note number for the event, from 0 to 127. 60 is middle C.
velocity
A number from 0-127 specifying the velocity of the note.
duration
The duration of the event in MusicTimeStamp units.
channel
The channel on which the MIDI event should be sent.
Return Value
An initialized MIKMIDINoteEvent instance, or nil if an error occurred.
-
Convenience method for creating a new MIKMIDINoteEvent from a CoreMIDI MIDINoteMessage struct.
Declaration
Objective-C
+ (nonnull instancetype)noteEventWithTimeStamp:(MusicTimeStamp)timeStamp message:(MIDINoteMessage)message;
Swift
convenience init(timeStamp: MusicTimeStamp, message: MIDINoteMessage)
Parameters
timeStamp
A MusicTimeStamp value indicating the timestamp for the event.
message
A MIDINoteMessage struct containing properties for the event.
Return Value
A new MIKMIDINoteEvent instance, or nil if there is an error.
-
The MIDI note number for the event.
Declaration
Objective-C
@property (nonatomic, readonly) UInt8 note;
Swift
var note: UInt8 { get }
-
The initial velocity of the event.
Declaration
Objective-C
@property (nonatomic, readonly) UInt8 velocity;
Swift
var velocity: UInt8 { get }
-
The channel for the MIDI event.
Declaration
Objective-C
@property (nonatomic, readonly) UInt8 channel;
Swift
var channel: UInt8 { get }
-
The release velocity of the event. Use 0 if you don’t want to specify a particular value.
Declaration
Objective-C
@property (nonatomic, readonly) UInt8 releaseVelocity;
Swift
var releaseVelocity: UInt8 { get }
-
The duration of the event in MusicTimeStamp units.
Declaration
Objective-C
@property (nonatomic, readonly) Float32 duration;
Swift
var duration: Float32 { get }
-
The time stamp at the end of the notes duration. This is simply the event’s timeStamp + duration.
Declaration
Objective-C
@property (nonatomic, readonly) MusicTimeStamp endTimeStamp;
Swift
var endTimeStamp: MusicTimeStamp { get }
-
The frequency of the MIDI note. Based on an equal tempered scale with a 440Hz A5.
Declaration
Objective-C
@property (nonatomic, readonly) float frequency;
Swift
var frequency: Float { get }
-
The note letter of the MIDI note. Notes that correspond to a “black key” on the piano will always be presented as sharp.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull noteLetter;
Swift
var noteLetter: String { get }
-
The note letter and octave of the MIDI note. 0 is considered to be the first octave, so the note C0 is equal to MIDI note 0.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull noteLetterAndOctave;
Swift
var noteLetterAndOctave: String { get }