Skip to content

CoreMIDI iOS xcode13.0 beta1

Rachel Kang edited this page Jul 30, 2021 · 3 revisions

#CoreMIDI.framework

diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIDriver.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIDriver.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIDriver.h	2021-03-16 08:45:01.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIDriver.h	2021-06-02 12:44:31.000000000 -0400
@@ -294,18 +294,19 @@
 /* 43C98C3C-306C-11D5-AF73-003065A8301E */
 
 /*!
-	@define			kMIDIDriverInterfaceXID
+	@define			kMIDIDriverInterface3ID
  
-	@abstract		The UUID for a provisional MIDI driver interface.
+	@abstract		The UUID for version 3 of the MIDI driver interface.
  
-	@discussion		See the description of the MIDIDriverInterface structure for
+	@discussion		This UUID uses UniversalMIDIPacket I/O functions.
+					See the description of the MIDIDriverInterface structure for
 					information about different versions of the MIDI driver interface.
  
 					This provisional driver interface is provided for the purpose of
                     prototyping MIDI 2.0 driver support. This driver interface will be replaced
                     in the future when transport specifications are defined.
 */
-#define kMIDIDriverInterfaceXID \
+#define kMIDIDriverInterface3ID \
 	CFUUIDGetConstantUUIDWithBytes(NULL, 0x2F, 0xD9, 0x4D, 0x0F, 0x8C, 0x2A, 0x48, 0x2A, 0x8A, 0xD8, 0x7D, 0x9E, 0xA3, 0x81, 0xC9, 0xC1)
 /* 2FD94D0F-8C2A-482A-8AD8-7D9EA381C9C1 */
 
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIMessages.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIMessages.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIMessages.h	2021-03-16 08:39:44.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIMessages.h	2021-05-22 07:52:07.000000000 -0400
@@ -28,7 +28,8 @@
 	kMIDIMessageTypeChannelVoice1   =   0x2,	// 1 word - MIDI 1.0
 	kMIDIMessageTypeSysEx           =   0x3,	// 2 words (Data, but primarily SysEx)
 	kMIDIMessageTypeChannelVoice2   =   0x4,	// 2 words - MIDI 2.0
-	kMIDIMessageTypeData128         =   0x5		// 4 words
+	kMIDIMessageTypeData128         =   0x5,	// 4 words
+	kMIDIMessageTypeUnknownF		=	0xF
 	
 	// Sizes of undefined message types:
 	// 6: 1 word
@@ -82,6 +83,7 @@
 	kMIDIStatusContinue				= 0xFB,
 	kMIDIStatusStop					= 0xFC,
 	kMIDIStatusActiveSending		= 0xFE,
+	kMIDIStatusActiveSensing		= kMIDIStatusActiveSending,
 	kMIDIStatusSystemReset			= 0xFF
 };
 
@@ -175,6 +177,22 @@
     return (MIDIMessage_32)((UInt32)((kMIDIMessageTypeSystem << 4) | (group & 0xF)) << 24 | (UInt32)(status) << 16 | (UInt32)(byte1 & 0x7F) << 8 | (UInt32)(byte2 & 0x7F));
 }
 
+CF_INLINE MIDIMessage_64 MIDI1UPSysEx(UInt8 group, UInt8 status, UInt8 bytesUsed, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6) {
+    MIDIMessage_64 sysExOut = {};
+    sysExOut.word0 = (UInt32)((kMIDIMessageTypeSysEx << 4) | (group & 0xF)) << 24 | (UInt32)((status << 4) | (bytesUsed)) << 16 | (UInt32)(byte1 & 0x7F) << 8 | (UInt32)(byte2 & 0x7F);
+    sysExOut.word1 = (UInt32)(byte3 & 0x7F) << 24 | (UInt32)(byte4 & 0x7F) << 16 | (UInt32)(byte5 & 0x7F) << 8 | (UInt32)(byte6 & 0x7F);
+    return sysExOut;
+}
+
+CF_INLINE MIDIMessage_64 MIDI1UPSysExArray(UInt8 group, UInt8 status, const Byte *begin, const Byte *end)
+{
+    Byte arrayCopy[6] = {};
+    int numberOfBytes = end <= begin ? 0 : end - begin;
+    for (int i = 0; i < numberOfBytes; ++i)
+        arrayCopy[i] = *(begin + i);
+    return MIDI1UPSysEx(group, status, numberOfBytes, arrayCopy[0], arrayCopy[1], arrayCopy[2], arrayCopy[3], arrayCopy[4], arrayCopy[5]);
+}
+
 //==================================================================================================
 #pragma mark -
 #pragma mark MIDI 2.0 Message helper functions
Clone this wiki locally