MIKMIDIControlChangeCommand
Objective-C
@interface MIKMIDIControlChangeCommand : MIKMIDIChannelVoiceCommand
Swift
class MIKMIDIControlChangeCommand : MIKMIDIChannelVoiceCommand
A MIDI control change message.
-
Convenience method for creating a standard control change command instance. Can only be used to create a standard 7-bit command.
Declaration
Objective-C
+ (nonnull instancetype) controlChangeCommandWithControllerNumber:(NSUInteger)controllerNumber value:(NSUInteger)sevenBitValue;
Swift
convenience init(controllerNumber: UInt, value sevenBitValue: UInt)
Parameters
controllerNumber
The MIDI control number for the command.
sevenBitValue
The controlValue of the command. Only the lower 7 bits of this are used.
Return Value
An initialized MIKMIDIControlChangeCommand instance.
-
Convenience method for creating a 14-bit control change command instance.
Declaration
Objective-C
+ (nonnull instancetype) fourteenBitControlChangeCommandWithControllerNumber: (NSUInteger)controllerNumber value:(NSUInteger) fourteenBitValue;
Swift
class func fourteenBitControlChangeCommand(withControllerNumber controllerNumber: UInt, value fourteenBitValue: UInt) -> Self
Parameters
controllerNumber
The MIDI control number for the command.
fourteenBitValue
The controlValue of the command. Only the lower 14 bits of this are used.
Return Value
An initialized MIKMIDIControlChangeCommand instance.
-
Convenience method for creating a single, 14-bit control change command from its component messages. The two commands passed into this method must comply with the MIDI specification for 14-bit control change messages.
The MIDI spec allows for 14-bit control change commands. These are actually sent as two sequential commands where the second command has a controller number equal to the first message’s controllerNumber plus 32, and whose value is the least significant 7-bits of the 14-bit value.
Note
This method is used internally by MIKMIDI, to coalesce incoming 14-bit control change commands. it is not generally useful to external users of MIKMIDI. If you’re simply trying to create a new MIKMIDIControlChangeCommand instance, you should use plain alloc/init instead.
Declaration
Objective-C
+ (nullable instancetype) commandByCoalescingMSBCommand: (nonnull MIKMIDIControlChangeCommand *)msbCommand andLSBCommand: (nonnull MIKMIDIControlChangeCommand *)lsbCommand;
Swift
convenience init?(byCoalescingMSBCommand msbCommand: MIKMIDIControlChangeCommand, andLSBCommand lsbCommand: MIKMIDIControlChangeCommand)
Parameters
msbCommand
The command containing the most significant 7 bits of value data (ie. the first command).
lsbCommand
The command containing the least significant 7 bits of value data (ie. the second command).
Return Value
A new, single MIKMIDIControlChangeCommand instance containing 14-bit value data, and whose fourteenBitCommand property is set to YES.
-
Returns a new instance of MIKMIDIControlChangeCommand containing only the most significant 7 bits of the receiver’s controllerValue.
If the receiver is a standard 7-bit control change command, this method returns the same result as calling -copy.
Declaration
Objective-C
- (nonnull MIKMIDIControlChangeCommand *)commandForMostSignificantBits;
Swift
func forMostSignificantBits() -> MIKMIDIControlChangeCommand
Return Value
An instance of MIKMIDIControlChangeCommand whose controllerValue is made up of the most significant 7 bits of the receiver’s controllerValue.
-
Returns a new instance of MIKMIDIControlChangeCommand containing only the least significant 7 bits of the receiver’s fourteenBitValue. This is only meant to be called on 14-bit control change commands (ie. -isFourteenBitCommand returns true)
If the receiver is a standard 7-bit control change command, this method returns nil.
Declaration
Objective-C
- (MIKMIDIControlChangeCommand *_Nullable)commandForLeastSignificantBits;
Swift
func forLeastSignificantBits() -> MIKMIDIControlChangeCommand?
Return Value
An instance of MIKMIDIControlChangeCommand whose controllerValue is made up of the least significant 7 bits of the receiver’s controllerValue.
-
The MIDI control number for the command.
Declaration
Objective-C
@property (nonatomic, readonly) NSUInteger controllerNumber;
Swift
var controllerNumber: UInt { get }
-
The controlValue of the command.
This method returns the same value as -value. Note that this is always a 7-bit (0-127) value, even for a fourteen bit command. To retrieve the 14-bit value, use -fourteenBitValue.
See
-fourteenBitCommandDeclaration
Objective-C
@property (nonatomic, readonly) NSUInteger controllerValue;
Swift
var controllerValue: UInt { get }
-
The 14-bit value of the command.
This property always returns a 14-bit value (ranging from 0-16383). If the receiver is not a 14-bit command (-isFourteenBitCommand returns NO), the 7 least significant bits will always be 0.
Declaration
Objective-C
@property (nonatomic, readonly) NSUInteger fourteenBitValue;
Swift
var fourteenBitValue: UInt { get }
-
YES if the command contains 14-bit value data.
If this property returns YES, -fourteenBitValue will return a precision value in the range 0-16383
See
+commandByCoalescingMSBCommand:andLSBCommand:Declaration
Objective-C
@property (nonatomic, readonly, getter=isFourteenBitCommand) BOOL fourteenBitCommand;
Swift
var isFourteenBitCommand: Bool { get }