Class CoreMIDI


  • public final class CoreMIDI
    extends java.lang.Object
    • Field Detail

      • kMIDIObjectType_ExternalMask

        public static final int kMIDIObjectType_ExternalMask
        See Also:
        Constant Field Values
      • MIDIChannelsWholePort

        public static final byte MIDIChannelsWholePort
        All MIDI-CI methods involving a channel number use 0x7f to mean "the whole port", i.e. all channels.
        See Also:
        Constant Field Values
    • Method Detail

      • MIDIClientCreate

        public static int MIDIClientCreate​(@NotNull
                                           @NotNull CFStringRef name,
                                           @Nullable
                                           @Nullable CoreMIDI.Function_MIDIClientCreate notifyProc,
                                           @Nullable
                                           @Nullable org.moe.natj.general.ptr.VoidPtr notifyRefCon,
                                           @NotNull
                                           @NotNull org.moe.natj.general.ptr.IntPtr outClient)
        [@function] MIDIClientCreate Creates a MIDIClient object. Note that notifyProc will always be called on the run loop which was current when MIDIClientCreate was first called. API-Since: 4.2
        Parameters:
        name - The client's name.
        notifyProc - An optional (may be NULL) callback function through which the client will receive notifications of changes to the system.
        notifyRefCon - A refCon passed back to notifyRefCon
        outClient - On successful return, points to the newly-created MIDIClientRef.
        Returns:
        An OSStatus result code.
      • MIDIClientCreateWithBlock

        public static int MIDIClientCreateWithBlock​(@NotNull
                                                    @NotNull CFStringRef name,
                                                    @NotNull
                                                    @NotNull org.moe.natj.general.ptr.IntPtr outClient,
                                                    @Nullable
                                                    @Nullable CoreMIDI.Block_MIDIClientCreateWithBlock notifyBlock)
        [@function] MIDIClientCreateWithBlock Creates a MIDIClient object. Note that notifyBlock is called on a thread chosen by the implementation. Thread-safety is the block's responsibility. API-Since: 9.0
        Parameters:
        name - The client's name.
        outClient - On successful return, points to the newly-created MIDIClientRef.
        notifyBlock - An optional (may be NULL) block via which the client will receive notifications of changes to the system.
        Returns:
        An OSStatus result code.
      • MIDIClientDispose

        public static int MIDIClientDispose​(int client)
        [@function] MIDIClientDispose Disposes a MIDIClient object. It is not essential to call this function; the CoreMIDI framework will automatically dispose all MIDIClients when an application terminates. However, if this method is called to dispose the last/only MIDIClient owned by an application, the MIDI server may exit if there are no other MIDIClients remaining in the system, causing all subsequent calls to MIDIClientCreate and MIDIClientCreateWithBlock by that application to fail. For this reason, disposing all of an application's MIDIClients is strongly discouraged. API-Since: 4.2
        Parameters:
        client - The client to dispose.
        Returns:
        An OSStatus result code.
      • MIDIInputPortCreate

        @Deprecated
        public static int MIDIInputPortCreate​(int client,
                                              @NotNull
                                              @NotNull CFStringRef portName,
                                              @NotNull
                                              @NotNull CoreMIDI.Function_MIDIInputPortCreate readProc,
                                              @Nullable
                                              @Nullable org.moe.natj.general.ptr.VoidPtr refCon,
                                              @NotNull
                                              @NotNull org.moe.natj.general.ptr.IntPtr outPort)
        Deprecated.
        [@function] MIDIInputPortCreate Creates an input port through which the client may receive incoming MIDI messages from any MIDI source. After creating a port, use MIDIPortConnectSource to establish an input connection from any number of sources to your port. readProc will be called on a separate high-priority thread owned by CoreMIDI. API-Since: 4.2 Deprecated-Since: 100000.0
        Parameters:
        client - The client to own the newly-created port.
        portName - The name of the port.
        readProc - The MIDIReadProc which will be called with incoming MIDI, from sources connected to this port.
        refCon - The refCon passed to readHook.
        outPort - On successful return, points to the newly-created MIDIPort.
        Returns:
        An OSStatus result code.
      • MIDIInputPortCreateWithBlock

        @Deprecated
        public static int MIDIInputPortCreateWithBlock​(int client,
                                                       @NotNull
                                                       @NotNull CFStringRef portName,
                                                       @NotNull
                                                       @NotNull org.moe.natj.general.ptr.IntPtr outPort,
                                                       @NotNull
                                                       @NotNull CoreMIDI.Block_MIDIInputPortCreateWithBlock readBlock)
        Deprecated.
        [@function] MIDIInputPortCreateWithBlock Creates an input port through which the client may receive incoming MIDI messages from any MIDI source. After creating a port, use MIDIPortConnectSource to establish an input connection from any number of sources to your port. readBlock will be called on a separate high-priority thread owned by CoreMIDI. API-Since: 9.0 Deprecated-Since: 100000.0
        Parameters:
        client - The client to own the newly-created port.
        portName - The name of the port.
        outPort - On successful return, points to the newly-created MIDIPort.
        readBlock - The MIDIReadBlock which will be called with incoming MIDI, from sources connected to this port.
        Returns:
        An OSStatus result code.
      • MIDIOutputPortCreate

        public static int MIDIOutputPortCreate​(int client,
                                               @NotNull
                                               @NotNull CFStringRef portName,
                                               @NotNull
                                               @NotNull org.moe.natj.general.ptr.IntPtr outPort)
        [@function] MIDIOutputPortCreate Creates an output port through which the client may send outgoing MIDI messages to any MIDI destination. Output ports provide a mechanism for MIDI merging. CoreMIDI assumes that each output port will be responsible for sending only a single MIDI stream to each destination, although a single port may address all of the destinations in the system. Multiple output ports are only necessary when an application is capable of directing multiple simultaneous MIDI streams to the same destination. API-Since: 4.2
        Parameters:
        client - The client to own the newly-created port
        portName - The name of the port.
        outPort - On successful return, points to the newly-created MIDIPort.
        Returns:
        An OSStatus result code.
      • MIDIPortDispose

        public static int MIDIPortDispose​(int port)
        [@function] MIDIPortDispose Disposes a MIDIPort object. It is not usually necessary to call this function; when an application's MIDIClient's are automatically disposed at termination, or explicitly, via MIDIClientDispose, the client's ports are automatically disposed at that time. API-Since: 4.2
        Parameters:
        port - The port to dispose.
        Returns:
        An OSStatus result code.
      • MIDIPortConnectSource

        public static int MIDIPortConnectSource​(int port,
                                                int source,
                                                @Nullable
                                                @Nullable org.moe.natj.general.ptr.VoidPtr connRefCon)
        [@function] MIDIPortConnectSource Establishes a connection from a source to a client's input port.
        Parameters:
        port - The port to which to create the connection. This port's readProc is called with incoming MIDI from the source.
        source - The source from which to create the connection.
        connRefCon - This refCon is passed to the port's MIDIReadProc or MIDIReadBlock, as a way to identify the source.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIPortDisconnectSource

        public static int MIDIPortDisconnectSource​(int port,
                                                   int source)
        [@function] MIDIPortDisconnectSource Closes a previously-established source-to-input port connection.
        Parameters:
        port - The port whose connection is being closed.
        source - The source from which to close a connection to the specified port.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIGetNumberOfDevices

        public static long MIDIGetNumberOfDevices()
        [@function] MIDIGetNumberOfDevices Returns the number of devices in the system.
        Returns:
        The number of devices in the system, or 0 if an error occurred. API-Since: 4.2
      • MIDIGetDevice

        public static int MIDIGetDevice​(long deviceIndex0)
        [@function] MIDIGetDevice Returns one of the devices in the system. Use this to enumerate the devices in the system. To enumerate the entities in the system, you can walk through the devices, then walk through the devices' entities. Note: If a client iterates through the devices and entities in the system, it will not ever visit any virtual sources and destinations created by other clients. Also, a device iteration will return devices which are "offline" (were present in the past but are not currently present), while iterations through the system's sources and destinations will not include the endpoints of offline devices. Thus clients should usually use MIDIGetNumberOfSources, MIDIGetSource, MIDIGetNumberOfDestinations and MIDIGetDestination, rather iterating through devices and entities to locate endpoints. API-Since: 4.2
        Parameters:
        deviceIndex0 - The index (0...MIDIGetNumberOfDevices()-1) of the device to return.
        Returns:
        A reference to a device, or NULL if an error occurred.
      • MIDIDeviceGetNumberOfEntities

        public static long MIDIDeviceGetNumberOfEntities​(int device)
        [@function] MIDIDeviceGetNumberOfEntities Returns the number of entities in a given device.
        Parameters:
        device - The device being queried.
        Returns:
        The number of entities the device contains, or 0 if an error occurred. API-Since: 4.2
      • MIDIDeviceGetEntity

        public static int MIDIDeviceGetEntity​(int device,
                                              long entityIndex0)
        [@function] MIDIDeviceGetEntity Returns one of a given device's entities.
        Parameters:
        device - The device being queried.
        entityIndex0 - The index (0...MIDIDeviceGetNumberOfEntities(device)-1) of the entity to return
        Returns:
        A reference to an entity, or NULL if an error occurred. API-Since: 4.2
      • MIDIEntityGetNumberOfSources

        public static long MIDIEntityGetNumberOfSources​(int entity)
        [@function] MIDIEntityGetNumberOfSources Returns the number of sources in a given entity.
        Parameters:
        entity - The entity being queried
        Returns:
        The number of sources the entity contains, or 0 if an error occurred. API-Since: 4.2
      • MIDIEntityGetSource

        public static int MIDIEntityGetSource​(int entity,
                                              long sourceIndex0)
        [@function] MIDIEntityGetSource Returns one of a given entity's sources.
        Parameters:
        entity - The entity being queried.
        sourceIndex0 - The index (0...MIDIEntityGetNumberOfSources(entity)-1) of the source to return
        Returns:
        A reference to a source, or NULL if an error occurred. API-Since: 4.2
      • MIDIEntityGetNumberOfDestinations

        public static long MIDIEntityGetNumberOfDestinations​(int entity)
        [@function] MIDIEntityGetNumberOfDestinations Returns the number of destinations in a given entity.
        Parameters:
        entity - The entity being queried
        Returns:
        The number of destinations the entity contains, or 0 if an error occurred. API-Since: 4.2
      • MIDIEntityGetDestination

        public static int MIDIEntityGetDestination​(int entity,
                                                   long destIndex0)
        [@function] MIDIEntityGetDestination Returns one of a given entity's destinations.
        Parameters:
        entity - The entity being queried.
        destIndex0 - The index (0...MIDIEntityGetNumberOfDestinations(entity) - 1) of the destination to return
        Returns:
        A reference to a destination, or NULL if an error occurred. API-Since: 4.2
      • MIDIEntityGetDevice

        public static int MIDIEntityGetDevice​(int inEntity,
                                              @Nullable
                                              @Nullable org.moe.natj.general.ptr.IntPtr outDevice)
        [@function] MIDIEntityGetDevice Returns an entity's device.
        Parameters:
        inEntity - The entity being queried.
        outDevice - On successful return, the entity's owning device. API-Since: 4.2
      • MIDIGetNumberOfSources

        public static long MIDIGetNumberOfSources()
        [@function] MIDIGetNumberOfSources Returns the number of sources in the system.
        Returns:
        The number of sources in the system, or 0 if an error occurred. API-Since: 4.2
      • MIDIGetSource

        public static int MIDIGetSource​(long sourceIndex0)
        [@function] MIDIGetSource Returns one of the sources in the system.
        Parameters:
        sourceIndex0 - The index (0...MIDIGetNumberOfSources()-1) of the source to return
        Returns:
        A reference to a source, or NULL if an error occurred. API-Since: 4.2
      • MIDIGetNumberOfDestinations

        public static long MIDIGetNumberOfDestinations()
        [@function] MIDIGetNumberOfDestinations Returns the number of destinations in the system.
        Returns:
        The number of destinations in the system, or 0 if an error occurred. API-Since: 4.2
      • MIDIGetDestination

        public static int MIDIGetDestination​(long destIndex0)
        [@function] MIDIGetDestination Returns one of the destinations in the system.
        Parameters:
        destIndex0 - The index (0...MIDIGetNumberOfDestinations()-1) of the destination to return
        Returns:
        A reference to a destination, or NULL if an error occurred. API-Since: 4.2
      • MIDIEndpointGetEntity

        public static int MIDIEndpointGetEntity​(int inEndpoint,
                                                @Nullable
                                                @Nullable org.moe.natj.general.ptr.IntPtr outEntity)
        [@function] MIDIEndpointGetEntity Returns an endpoint's entity. Virtual sources and destinations don't have entities. API-Since: 4.2
        Parameters:
        inEndpoint - The endpoint being queried.
        outEntity - On exit, the endpoint's owning entity, or NULL if none.
      • MIDIDestinationCreate

        @Deprecated
        public static int MIDIDestinationCreate​(int client,
                                                @NotNull
                                                @NotNull CFStringRef name,
                                                @NotNull
                                                @NotNull CoreMIDI.Function_MIDIDestinationCreate readProc,
                                                @Nullable
                                                @Nullable org.moe.natj.general.ptr.VoidPtr refCon,
                                                @NotNull
                                                @NotNull org.moe.natj.general.ptr.IntPtr outDest)
        Deprecated.
        [@function] MIDIDestinationCreate Creates a virtual destination in a client. The specified readProc gets called when clients send MIDI to your virtual destination. Drivers need not call this; when they create devices and entities, sources and destinations are created at that time. After creating a virtual destination, it's a good idea to assign it the same unique ID it had the last time your application created it. (Although you should be prepared for this to fail in the unlikely event of a collision.) This will permit other clients to retain persistent references to your virtual destination more easily. See the discussion of kMIDIPropertyAdvanceScheduleTimeMuSec for notes about the relationship between when a sender sends MIDI to the destination and when it is received. API-Since: 4.2 Deprecated-Since: 100000.0
        Parameters:
        client - The client owning the virtual destination.
        name - The name of the virtual destination.
        readProc - The MIDIReadProc to be called when a client sends MIDI to the virtual destination.
        refCon - The refCon to be passed to the readProc.
        outDest - On successful return, a pointer to the newly-created destination.
        Returns:
        An OSStatus result code.
      • MIDIDestinationCreateWithBlock

        @Deprecated
        public static int MIDIDestinationCreateWithBlock​(int client,
                                                         @NotNull
                                                         @NotNull CFStringRef name,
                                                         @NotNull
                                                         @NotNull org.moe.natj.general.ptr.IntPtr outDest,
                                                         @NotNull
                                                         @NotNull CoreMIDI.Block_MIDIDestinationCreateWithBlock readBlock)
        Deprecated.
        [@function] MIDIDestinationCreateWithBlock Creates a virtual destination in a client. The specified readBlock gets called when clients send MIDI to your virtual destination. Drivers need not call this; when they create devices and entities, sources and destinations are created at that time. After creating a virtual destination, it's a good idea to assign it the same unique ID it had the last time your application created it. (Although you should be prepared for this to fail in the unlikely event of a collision.) This will permit other clients to retain persistent references to your virtual destination more easily. See the discussion of kMIDIPropertyAdvanceScheduleTimeMuSec for notes about the relationship between when a sender sends MIDI to the destination and when it is received. API-Since: 9.0 Deprecated-Since: 100000.0
        Parameters:
        client - The client owning the virtual destination.
        name - The name of the virtual destination.
        outDest - On successful return, a pointer to the newly-created destination.
        readBlock - The MIDIReadBlock to be called when a client sends MIDI to the virtual destination.
        Returns:
        An OSStatus result code.
      • MIDISourceCreate

        @Deprecated
        public static int MIDISourceCreate​(int client,
                                           @NotNull
                                           @NotNull CFStringRef name,
                                           @NotNull
                                           @NotNull org.moe.natj.general.ptr.IntPtr outSrc)
        Deprecated.
        [@function] MIDISourceCreate Creates a virtual source in a client. Drivers need not call this; when they create devices and entities, sources and destinations are created at that time. After creating a virtual source, use MIDIReceived to transmit MIDI messages from your virtual source to any clients connected to the virtual source. After creating a virtual source, it's a good idea to assign it the same unique ID it had the last time your application created it. (Although you should be prepared for this to fail in the unlikely event of a collision.) This will permit other clients to retain persistent references to your virtual source more easily. API-Since: 4.2 Deprecated-Since: 100000.0
        Parameters:
        client - The client owning the virtual source.
        name - The name of the virtual source.
        outSrc - On successful return, a pointer to the newly-created source.
        Returns:
        An OSStatus result code.
      • MIDIEndpointDispose

        public static int MIDIEndpointDispose​(int endpt)
        [@function] MIDIEndpointDispose Disposes a virtual source or destination your client created.
        Parameters:
        endpt - The endpoint to be disposed.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIGetNumberOfExternalDevices

        public static long MIDIGetNumberOfExternalDevices()
        [@function] MIDIGetNumberOfExternalDevices Returns the number of external MIDI devices in the system. External MIDI devices are MIDI devices connected to driver endpoints via a standard MIDI cable. Their presence is completely optional, only when a UI (such as Audio MIDI Setup) adds them. API-Since: 4.2
        Returns:
        The number of external devices in the system, or 0 if an error occurred.
      • MIDIGetExternalDevice

        public static int MIDIGetExternalDevice​(long deviceIndex0)
        [@function] MIDIGetExternalDevice Returns one of the external devices in the system. Use this to enumerate the external devices in the system. API-Since: 4.2
        Parameters:
        deviceIndex0 - The index (0...MIDIGetNumberOfDevices()-1) of the device to return.
        Returns:
        A reference to a device, or NULL if an error occurred.
      • MIDIObjectGetIntegerProperty

        public static int MIDIObjectGetIntegerProperty​(int obj,
                                                       @NotNull
                                                       @NotNull CFStringRef propertyID,
                                                       @NotNull
                                                       @NotNull org.moe.natj.general.ptr.IntPtr outValue)
        [@function] MIDIObjectGetIntegerProperty Gets an object's integer-type property. (See the MIDIObjectRef documentation for information about properties.) API-Since: 4.2
        Parameters:
        obj - The object whose property is to be returned.
        propertyID - Name of the property to return.
        outValue - On successful return, the value of the property.
        Returns:
        An OSStatus result code.
      • MIDIObjectSetIntegerProperty

        public static int MIDIObjectSetIntegerProperty​(int obj,
                                                       @NotNull
                                                       @NotNull CFStringRef propertyID,
                                                       int value)
        [@function] MIDIObjectSetIntegerProperty Sets an object's integer-type property. (See the MIDIObjectRef documentation for information about properties.) API-Since: 4.2
        Parameters:
        obj - The object whose property is to be altered.
        propertyID - Name of the property to set.
        value - New value of the property.
        Returns:
        An OSStatus result code.
      • MIDIObjectGetStringProperty

        public static int MIDIObjectGetStringProperty​(int obj,
                                                      @NotNull
                                                      @NotNull CFStringRef propertyID,
                                                      @NotNull
                                                      @NotNull org.moe.natj.general.ptr.Ptr<CFStringRef> str)
        [@function] MIDIObjectGetStringProperty Gets an object's string-type property. (See the MIDIObjectRef documentation for information about properties.) API-Since: 4.2
        Parameters:
        obj - The object whose property is to be returned.
        propertyID - Name of the property to return.
        str - On successful return, the value of the property.
        Returns:
        An OSStatus result code.
      • MIDIObjectSetStringProperty

        public static int MIDIObjectSetStringProperty​(int obj,
                                                      @NotNull
                                                      @NotNull CFStringRef propertyID,
                                                      @NotNull
                                                      @NotNull CFStringRef str)
        [@function] MIDIObjectSetStringProperty Sets an object's string-type property. (See the MIDIObjectRef documentation for information about properties.) API-Since: 4.2
        Parameters:
        obj - The object whose property is to be altered.
        propertyID - Name of the property to set.
        str - New value of the property.
        Returns:
        An OSStatus result code.
      • MIDIObjectGetDataProperty

        public static int MIDIObjectGetDataProperty​(int obj,
                                                    @NotNull
                                                    @NotNull CFStringRef propertyID,
                                                    @NotNull
                                                    @NotNull org.moe.natj.general.ptr.Ptr<CFDataRef> outData)
        [@function] MIDIObjectGetDataProperty Gets an object's data-type property. (See the MIDIObjectRef documentation for information about properties.)
        Parameters:
        obj - The object whose property is to be returned.
        propertyID - Name of the property to return.
        outData - On successful return, the value of the property.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIObjectSetDataProperty

        public static int MIDIObjectSetDataProperty​(int obj,
                                                    @NotNull
                                                    @NotNull CFStringRef propertyID,
                                                    @NotNull
                                                    @NotNull CFDataRef data)
        [@function] MIDIObjectSetDataProperty Sets an object's data-type property. (See the MIDIObjectRef documentation for information about properties.) API-Since: 4.2
        Parameters:
        obj - The object whose property is to be altered.
        propertyID - Name of the property to set.
        data - New value of the property.
        Returns:
        An OSStatus result code.
      • MIDIObjectGetDictionaryProperty

        public static int MIDIObjectGetDictionaryProperty​(int obj,
                                                          @NotNull
                                                          @NotNull CFStringRef propertyID,
                                                          @NotNull
                                                          @NotNull org.moe.natj.general.ptr.Ptr<CFDictionaryRef> outDict)
        [@function] MIDIObjectGetDictionaryProperty Gets an object's dictionary-type property. (See the MIDIObjectRef documentation for information about properties.) API-Since: 4.2
        Parameters:
        obj - The object whose property is to be returned.
        propertyID - Name of the property to return.
        outDict - On successful return, the value of the property.
        Returns:
        An OSStatus result code.
      • MIDIObjectSetDictionaryProperty

        public static int MIDIObjectSetDictionaryProperty​(int obj,
                                                          @NotNull
                                                          @NotNull CFStringRef propertyID,
                                                          @NotNull
                                                          @NotNull CFDictionaryRef dict)
        [@function] MIDIObjectSetDictionaryProperty Sets an object's dictionary-type property. (See the MIDIObjectRef documentation for information about properties.) API-Since: 4.2
        Parameters:
        obj - The object whose property is to be altered.
        propertyID - Name of the property to set.
        dict - New value of the property.
        Returns:
        An OSStatus result code.
      • MIDIObjectGetProperties

        public static int MIDIObjectGetProperties​(int obj,
                                                  @NotNull
                                                  @NotNull org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> outProperties,
                                                  byte deep)
        [@function] MIDIObjectGetProperties Gets all of an object's properties. Returns a CFPropertyList of all of an object's properties. The property list may be a dictionary or an array. Dictionaries map property names (CFString) to values, which may be CFNumber, CFString, or CFData. Arrays are arrays of such values. Properties which an object inherits from its owning object (if any) are not included. API-Since: 4.2
        Parameters:
        obj - The object whose properties are to be returned.
        outProperties - On successful return, the object's properties.
        deep - true if the object's child objects are to be included (e.g. a device's entities, or an entity's endpoints).
        Returns:
        An OSStatus result code.
      • MIDIObjectRemoveProperty

        public static int MIDIObjectRemoveProperty​(int obj,
                                                   @NotNull
                                                   @NotNull CFStringRef propertyID)
        [@function] MIDIObjectRemoveProperty Removes an object's property.
        Parameters:
        obj - The object whose property is to be removed.
        propertyID - The property to be removed.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIObjectFindByUniqueID

        public static int MIDIObjectFindByUniqueID​(int inUniqueID,
                                                   @Nullable
                                                   @Nullable org.moe.natj.general.ptr.IntPtr outObject,
                                                   @Nullable
                                                   @Nullable org.moe.natj.general.ptr.IntPtr outObjectType)
        [@function] MIDIObjectFindByUniqueID Locates a device, external device, entity, or endpoint by its uniqueID.
        Parameters:
        inUniqueID - The uniqueID of the object to search for. (This should be the result of an earlier call to MIDIObjectGetIntegerProperty for the property kMIDIPropertyUniqueID).
        outObject - The returned object, or 0 if the object was not found or an error occurred. This should be cast to the appropriate type (MIDIDeviceRef, MIDIEntityRef, MIDIEndpointRef), according to *outObjectType.
        outObjectType - On exit, the type of object which was found; undefined if none found.
        Returns:
        An OSStatus error code, including kMIDIObjectNotFound if there is no object with the specified uniqueID. API-Since: 4.2
      • MIDISend

        @Deprecated
        public static int MIDISend​(int port,
                                   int dest,
                                   @NotNull
                                   @NotNull MIDIPacketList pktlist)
        Deprecated.
        [@function] MIDISend Sends MIDI to a destination. Events with future timestamps are scheduled for future delivery. CoreMIDI performs any needed MIDI merging. API-Since: 4.2 Deprecated-Since: 100000.0
        Parameters:
        port - The output port through which the MIDI is to be sent.
        dest - The destination to receive the events.
        pktlist - The MIDI events to be sent.
        Returns:
        An OSStatus result code.
      • MIDISendSysex

        public static int MIDISendSysex​(@NotNull
                                        @NotNull MIDISysexSendRequest request)
        [@function] MIDISendSysex Sends a single system-exclusive event, asynchronously. request->data must point to a single MIDI system-exclusive message, or portion thereof. API-Since: 4.2
        Parameters:
        request - Contains the destination, and a pointer to the MIDI data to be sent.
        Returns:
        An OSStatus result code.
      • MIDIReceived

        @Deprecated
        public static int MIDIReceived​(int src,
                                       @NotNull
                                       @NotNull MIDIPacketList pktlist)
        Deprecated.
        [@function] MIDIReceived Distributes incoming MIDI from a source to the client input ports which are connected to that source. Drivers should call this function when receiving MIDI from a source. Clients which have created virtual sources, using MIDISourceCreate, should call this function when the source is generating MIDI. Unlike MIDISend(), a timestamp of 0 is not equivalent to "now"; the driver or virtual source is responsible for putting proper timestamps in the packets. API-Since: 4.2 Deprecated-Since: 100000.0
        Parameters:
        src - The source which is transmitting MIDI.
        pktlist - The MIDI events to be transmitted.
        Returns:
        An OSStatus result code.
      • MIDIFlushOutput

        public static int MIDIFlushOutput​(int dest)
        [@function] MIDIFlushOutput Unschedules previously-sent packets. Clients may use MIDIFlushOutput to cancel the sending of packets that were previously scheduled for future delivery. API-Since: 4.2
        Parameters:
        dest - All pending events scheduled to be sent to this destination are unscheduled. If NULL, the operation applies to all destinations.
      • MIDIRestart

        public static int MIDIRestart()
        [@function] MIDIRestart Stops and restarts MIDI I/O. This is useful for forcing CoreMIDI to ask its drivers to rescan for hardware.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIPacketNext

        @NotNull
        public static @NotNull MIDIPacket MIDIPacketNext​(@NotNull
                                                         @NotNull MIDIPacket pkt)
        [@function] MIDIPacketNext Advances a MIDIPacket pointer to the MIDIPacket which immediately follows it in memory if it is part of a MIDIPacketList.
        Parameters:
        pkt - A pointer to a MIDIPacket in a MIDIPacketList.
        Returns:
        The subsequent packet in the MIDIPacketList.
      • MIDIPacketListInit

        @NotNull
        @Deprecated
        public static @NotNull MIDIPacket MIDIPacketListInit​(@NotNull
                                                             @NotNull MIDIPacketList pktlist)
        Deprecated.
        [@function] MIDIPacketListInit Prepares a MIDIPacketList to be built up dynamically.
        Parameters:
        pktlist - The packet list to be initialized.
        Returns:
        A pointer to the first MIDIPacket in the packet list. API-Since: 4.2 Deprecated-Since: 100000.0
      • MIDIPacketListAdd

        @NotNull
        @Deprecated
        public static @NotNull MIDIPacket MIDIPacketListAdd​(@NotNull
                                                            @NotNull MIDIPacketList pktlist,
                                                            long listSize,
                                                            @NotNull
                                                            @NotNull MIDIPacket curPacket,
                                                            long time,
                                                            long nData,
                                                            @NotNull
                                                            @NotNull java.lang.String data)
        Deprecated.
        [@function] MIDIPacketListAdd Adds a MIDI event to a MIDIPacketList. The maximum size of a packet list is 65536 bytes. Large sysex messages must be sent in smaller packet lists. API-Since: 4.2 Deprecated-Since: 100000.0
        Parameters:
        pktlist - The packet list to which the event is to be added.
        listSize - The size, in bytes, of the packet list.
        curPacket - A packet pointer returned by a previous call to MIDIPacketListInit or MIDIPacketListAdd for this packet list.
        time - The new event's time.
        nData - The length of the new event, in bytes.
        data - The new event. May be a single MIDI event, or a partial sys-ex event. Running status is not permitted.
        Returns:
        Returns null if there was not room in the packet for the event; otherwise returns a packet pointer which should be passed as curPacket in a subsequent call to this function.
      • MIDIDeviceAddEntity

        @Deprecated
        public static int MIDIDeviceAddEntity​(int device,
                                              @NotNull
                                              @NotNull CFStringRef name,
                                              byte embedded,
                                              long numSourceEndpoints,
                                              long numDestinationEndpoints,
                                              @NotNull
                                              @NotNull org.moe.natj.general.ptr.IntPtr newEntity)
        Deprecated.
        ----------------------------------------------------------------------------- [@function] MIDIDeviceAddEntity Drivers call this function to specify one of the entities that comprise a device. Non-drivers may call this function as of CoreMIDI 1.1 to add entities to external devices.
        Parameters:
        device - The device to which an entity is to be added.
        name - The name of the new entity.
        embedded - True if this entity is inside the device, false if the entity simply consists of external connectors to which other devices can be attached.
        numSourceEndpoints - The number of source endpoints the entity has.
        numDestinationEndpoints - The number of destination endpoints the entity has.
        newEntity - On successful return, points to the newly-created entity.
        Returns:
        An OSStatus result code. API-Since: 4.2 Deprecated-Since: 100000.0
      • MIDIDeviceRemoveEntity

        public static int MIDIDeviceRemoveEntity​(int device,
                                                 int entity)
        ----------------------------------------------------------------------------- [@function] MIDIDeviceRemoveEntity Drivers may call this function to remove one of a device's entities. New for CoreMIDI 1.1.
        Parameters:
        device - The device from which an entity is to be removed.
        entity - The entity to be removed.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIEntityAddOrRemoveEndpoints

        public static int MIDIEntityAddOrRemoveEndpoints​(int entity,
                                                         long numSourceEndpoints,
                                                         long numDestinationEndpoints)
        ----------------------------------------------------------------------------- [@function] MIDIEntityAddOrRemoveEndpoints Drivers and configuration editors may call this function to add to or remove an entity's endpoints. New for CoreMIDI 1.3. The MIDIProtocolID of new endpoints is initially the same as that of the entity.
        Parameters:
        entity - The entity whose endpoints are to be manipulated.
        numSourceEndpoints - The desired new number of source endpoints.
        numDestinationEndpoints - The desired new number of destination endpoints.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDISetupAddDevice

        public static int MIDISetupAddDevice​(int device)
        ----------------------------------------------------------------------------- [@function] MIDISetupAddDevice Adds a driver-owner MIDI device to the current MIDISetup Only MIDI drivers may make this call; it is in this header file only for consistency with MIDISetupRemoveDevice. New for CoreMIDI 1.1.
        Parameters:
        device - The device to be added. API-Since: 4.2
      • MIDISetupRemoveDevice

        public static int MIDISetupRemoveDevice​(int device)
        ----------------------------------------------------------------------------- [@function] MIDISetupRemoveDevice Removes a driver-owned MIDI device from the current MIDISetup Generally this should only be called from a studio configuration editor, to remove a device which is offline and which the user has specified as being permanently missing. Instead of removing devices from the setup, drivers should set the device's kMIDIPropertyOffline to 1 so that if the device reappears later, none of its properties are lost. New for CoreMIDI 1.1.
        Parameters:
        device - The device to be added. API-Since: 4.2
      • MIDISetupAddExternalDevice

        public static int MIDISetupAddExternalDevice​(int device)
        ----------------------------------------------------------------------------- [@function] MIDISetupAddExternalDevice Adds an external MIDI device to the current MIDISetup Useful for a studio configuration editor. New for CoreMIDI 1.1.
        Parameters:
        device - The device to be added. API-Since: 4.2
      • MIDISetupRemoveExternalDevice

        public static int MIDISetupRemoveExternalDevice​(int device)
        ----------------------------------------------------------------------------- [@function] MIDISetupRemoveExternalDevice Removes an external MIDI device from the current MIDISetup Useful for a studio configuration editor. New for CoreMIDI 1.1.
        Parameters:
        device - The device to be removed. API-Since: 4.2
      • MIDIExternalDeviceCreate

        public static int MIDIExternalDeviceCreate​(@NotNull
                                                   @NotNull CFStringRef name,
                                                   @NotNull
                                                   @NotNull CFStringRef manufacturer,
                                                   @NotNull
                                                   @NotNull CFStringRef model,
                                                   @NotNull
                                                   @NotNull org.moe.natj.general.ptr.IntPtr outDevice)
        ----------------------------------------------------------------------------- [@function] MIDIExternalDeviceCreate Create a new external MIDI device. Non-drivers may call this function as of CoreMIDI 1.1, to create external devices. The new device is not added to the current MIDISetupRef; to do this, use MIDISetupAddExternalDevice.
        Parameters:
        name - The name of the new device.
        manufacturer - The name of the device's manufacturer.
        model - The device's model name.
        outDevice - On successful return, points to the newly-created device.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIThruConnectionParamsSize

        public static long MIDIThruConnectionParamsSize​(@NotNull
                                                        @NotNull MIDIThruConnectionParams ptr)
        [@defined] MIDIThruConnectionParamsSize Returns the size of a MIDIThruConnectionParams. Accounts for the variable-length elements in the structure and returns its true size in bytes.
      • MIDIThruConnectionParamsInitialize

        public static void MIDIThruConnectionParamsInitialize​(@NotNull
                                                              @NotNull MIDIThruConnectionParams inConnectionParams)
        [@function] MIDIThruConnectionParamsInitialize Fills a MIDIThruConnectionParams with default values.
        Parameters:
        inConnectionParams - The struct to be initialized. This convenience function fills the connection structure with default values: no endpoints, no transformations (mostly zeroes except for the channel map). Then, just filling in the source and adding one destination will create a simple, unmodified thru connection. API-Since: 4.2
      • MIDIThruConnectionCreate

        public static int MIDIThruConnectionCreate​(@Nullable
                                                   @Nullable CFStringRef inPersistentOwnerID,
                                                   @NotNull
                                                   @NotNull CFDataRef inConnectionParams,
                                                   @NotNull
                                                   @NotNull org.moe.natj.general.ptr.IntPtr outConnection)
        [@function] MIDIThruConnectionCreate Creates a thru connection.
        Parameters:
        inPersistentOwnerID - If null, then the connection is marked as owned by the client and will be automatically disposed with the client. if it is non-null, then it should be a unique identifier, e.g. "com.mycompany.MyCoolProgram".
        inConnectionParams - A MIDIThruConnectionParams contained in a CFDataRef.
        outConnection - On successful return, a reference to the newly-created connection.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIThruConnectionDispose

        public static int MIDIThruConnectionDispose​(int connection)
        [@function] MIDIThruConnectionDispose Disposes a thru connection.
        Parameters:
        connection - The connection to be disposed
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIThruConnectionGetParams

        public static int MIDIThruConnectionGetParams​(int connection,
                                                      @NotNull
                                                      @NotNull org.moe.natj.general.ptr.Ptr<CFDataRef> outConnectionParams)
        [@function] MIDIThruConnectionGetParams Obtains a thru connection's MIDIThruConnectionParams.
        Parameters:
        connection - The connection to be disposed.
        outConnectionParams - On successful return, the connection's MIDIThruConnectionParams in a CFDataRef
        Returns:
        An OSStatus result code. The returned CFDataRef contains a MIDIThruConnectionParams structure. The caller is responsible for releasing it. API-Since: 4.2
      • MIDIThruConnectionSetParams

        public static int MIDIThruConnectionSetParams​(int connection,
                                                      @NotNull
                                                      @NotNull CFDataRef inConnectionParams)
        [@function] MIDIThruConnectionSetParams Alters a thru connection's MIDIThruConnectionParams.
        Parameters:
        connection - The connection to be modified.
        inConnectionParams - The connection's new MIDIThruConnectionParams in a CFDataRef
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIThruConnectionFind

        public static int MIDIThruConnectionFind​(@NotNull
                                                 @NotNull CFStringRef inPersistentOwnerID,
                                                 @NotNull
                                                 @NotNull org.moe.natj.general.ptr.Ptr<CFDataRef> outConnectionList)
        [@function] MIDIThruConnectionFind Returns all of the persistent thru connections created by a client.
        Parameters:
        inPersistentOwnerID - The ID of the owner whose connections are to be returned.
        outConnectionList - On successful return, a CFDataRef containing an array of MIDIThruConnectionRef's.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIDeviceCreate

        public static int MIDIDeviceCreate​(@Nullable
                                           @Nullable org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.Ptr<MIDIDriverInterface>> owner,
                                           @NotNull
                                           @NotNull CFStringRef name,
                                           @NotNull
                                           @NotNull CFStringRef manufacturer,
                                           @NotNull
                                           @NotNull CFStringRef model,
                                           @NotNull
                                           @NotNull org.moe.natj.general.ptr.IntPtr outDevice)
        ----------------------------------------------------------------------------- [@function] MIDIDeviceCreate Drivers call this function to create new MIDIDevice objects corresponding to the hardware that is present. Non-drivers may call this function as of CoreMIDI 1.1, to create external devices.
        Parameters:
        owner - The driver creating the device. NULL if a non-driver.
        name - The name of the new device.
        manufacturer - The name of the device's manufacturer.
        model - The device's model name.
        outDevice - On successful return, points to the newly-created device.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIDeviceDispose

        public static int MIDIDeviceDispose​(int device)
        [@function] MIDIDeviceDispose Drivers may call this function to dispose MIDIDevice objects which have not yet been added to the system via MIDISetupAddDevice. Once a device has been added to the system with MIDISetupAddDevice, the driver must not use this call to destroy it; it must use MIDISetupRemoveDevice to do so. Non-drivers do not have access to this function; they must call MIDISetupAddDevice and MIDISetupRemoveDevice.
        Parameters:
        device - The device to be disposed.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIDeviceListGetNumberOfDevices

        public static long MIDIDeviceListGetNumberOfDevices​(int devList)
        ----------------------------------------------------------------------------- [@function] MIDIDeviceListGetNumberOfDevices Returns the number of devices in a device list.
        Parameters:
        devList - The device list.
        Returns:
        The number of devices in the list, or 0 if an error occurred. API-Since: 4.2
      • MIDIDeviceListGetDevice

        public static int MIDIDeviceListGetDevice​(int devList,
                                                  long index0)
        ----------------------------------------------------------------------------- [@function] MIDIDeviceListGetDevice Return one of the devices in a device list.
        Parameters:
        devList - The device list.
        index0 - The index (0...MIDIDeviceListGetNumberOfDevices()-1) of the device to return.
        Returns:
        A reference to a device, or NULL if an error occurred. API-Since: 4.2
      • MIDIDeviceListAddDevice

        public static int MIDIDeviceListAddDevice​(int devList,
                                                  int dev)
        ----------------------------------------------------------------------------- [@function] MIDIDeviceListAddDevice Add a device to a device list.
        Parameters:
        devList - The device list.
        dev - The device to add to the list.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIDeviceListDispose

        public static int MIDIDeviceListDispose​(int devList)
        ----------------------------------------------------------------------------- [@function] MIDIDeviceListDispose Dispose a device list, but not the contained devices.
        Parameters:
        devList - The device list to be disposed.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIEndpointSetRefCons

        public static int MIDIEndpointSetRefCons​(int endpt,
                                                 @Nullable
                                                 @Nullable org.moe.natj.general.ptr.VoidPtr ref1,
                                                 @Nullable
                                                 @Nullable org.moe.natj.general.ptr.VoidPtr ref2)
        ----------------------------------------------------------------------------- [@function] MIDIEndpointSetRefCons Drivers need an efficient way to translate from a MIDIEndpoint (source or destination) to their own internal data structures corresponding to that endpoint. This function provides a way for the driver to assign its own refCons to endpoints. These refCons are passed back to the driver in its Send() and Flush() methods. RefCons are not persistent (i.e. they are not saved as part of a MIDISetup). They need to be re-initialized in each call to Start(). A typical use is to use one refCon to refer to a device, and a second to refer to a port on the device.
        Parameters:
        endpt - The endpoint whose refCons are to be set
        ref1 - The first refCon.
        ref2 - The second refCon.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIEndpointGetRefCons

        public static int MIDIEndpointGetRefCons​(int endpt,
                                                 @Nullable
                                                 @Nullable org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.VoidPtr> ref1,
                                                 @Nullable
                                                 @Nullable org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.VoidPtr> ref2)
        ----------------------------------------------------------------------------- [@function] MIDIEndpointGetRefCons Obtain the refCons assigned to the endpoints
        Parameters:
        endpt - The endpoint whose refCons are to be return
        ref1 - On exit, the first refCon.
        ref2 - On exit, the second refCon.
        Returns:
        An OSStatus result code. API-Since: 4.2
      • MIDIGetDriverIORunLoop

        @NotNull
        public static @NotNull CFRunLoopRef MIDIGetDriverIORunLoop()
        ----------------------------------------------------------------------------- [@function] MIDIGetDriverIORunLoop Drivers typically need to receive asynchronous I/O completion callbacks on a high-priority thread. To save drivers from the trouble of creating their own threads for this purpose, and to make efficient use of system resources, the MIDIServer provides a thread which drivers may use. Drivers should do as little work as possible in this thread; typically, just dequeueing and encoding output packets, and decoding input packets into MIDIPacketLists to be passed to MIDIReceived. This is a realtime-priority thread and shouldn't be used for anything other than I/O. For lower-priority tasks, drivers can use the runloop which was current when they were constructed.
        Returns:
        The CFRunLoopRef of the server's driver I/O thread. API-Since: 4.2
      • MIDIGetDriverDeviceList

        public static int MIDIGetDriverDeviceList​(@NotNull
                                                  @NotNull org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.Ptr<MIDIDriverInterface>> driver)
        ----------------------------------------------------------------------------- [@function] MIDIGetDriverDeviceList Returns the list of devices which are in the current MIDISetup and which were created/owned by the specified driver. The returned device list should be disposed (using MIDIDeviceListDispose) by the caller.
        Parameters:
        driver - The driver whose devices are to be returned.
        Returns:
        The requested device list. API-Since: 4.2
      • kMIDIPropertyName

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyName()
        [@constant] kMIDIPropertyName device/entity/endpoint property, string Devices, entities, and endpoints may all have names. The recommended way to display an endpoint's name is to ask for the endpoint name, and display only that name if it is unique. If it is non-unique, prepend the device name. A setup editor may allow the user to set the names of both driver-owned and external devices. API-Since: 4.2
      • kMIDIPropertyManufacturer

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyManufacturer()
        [@constant] kMIDIPropertyManufacturer device/endpoint property, string Drivers should set this property on their devices. Setup editors may allow the user to set this property on external devices. Creators of virtual endpoints may set this property on their endpoints. API-Since: 4.2
      • kMIDIPropertyModel

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyModel()
        [@constant] kMIDIPropertyModel device/endpoint property, string Drivers should set this property on their devices. Setup editors may allow the user to set this property on external devices. Creators of virtual endpoints may set this property on their endpoints. API-Since: 4.2
      • kMIDIPropertyUniqueID

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyUniqueID()
        [@constant] kMIDIPropertyUniqueID devices, entities, endpoints all have unique ID's, integer The system assigns unique ID's to all objects. Creators of virtual endpoints may set this property on their endpoints, though doing so may fail if the chosen ID is not unique. API-Since: 4.2
      • kMIDIPropertyDeviceID

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyDeviceID()
        [@constant] kMIDIPropertyDeviceID device/entity property, integer The entity's system-exclusive ID, in user-visible form Drivers may set this property on their devices or entities. Setup editors may allow the user to set this property on external devices. API-Since: 4.2
      • kMIDIPropertyReceiveChannels

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyReceiveChannels()
        [@constant] kMIDIPropertyReceiveChannels endpoint property, integer The value is a bitmap of channels on which the object receives: 1=ch 1, 2=ch 2, 4=ch 3 ... 0x8000=ch 16. Drivers may set this property on their entities or endpoints. Setup editors may allow the user to set this property on external endpoints. Virtual destination may set this property on their endpoints. API-Since: 4.2
      • kMIDIPropertyTransmitChannels

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyTransmitChannels()
        [@constant] kMIDIPropertyTransmitChannels endpoint property, integer The value is a bitmap of channels on which the object transmits: 1=ch 1, 2=ch 2, 4=ch 3 ... 0x8000=ch 16. API-Since: 4.2
      • kMIDIPropertyMaxSysExSpeed

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyMaxSysExSpeed()
        [@constant] kMIDIPropertyMaxSysExSpeed device/entity/endpoint property, integer Set by the owning driver; should not be touched by other clients. The value is the maximum rate, in bytes/second, at which sysex messages may be sent reliably to this object. (The default value is 3125, as with MIDI 1.0) API-Since: 4.2
      • kMIDIPropertyAdvanceScheduleTimeMuSec

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyAdvanceScheduleTimeMuSec()
        [@constant] kMIDIPropertyAdvanceScheduleTimeMuSec device/entity/endpoint property, integer Set by the owning driver; should not be touched by other clients. If it is non-zero, then it is a recommendation of how many microseconds in advance clients should schedule output. Clients should treat this value as a minimum. For devices with a non-zero advance schedule time, drivers will receive outgoing messages to the device at the time they are sent by the client, via MIDISend, and the driver is responsible for scheduling events to be played at the right times according to their timestamps. As of CoreMIDI 1.3, this property may also be set on virtual destinations (but only the creator of the destination should do so). When a client sends to a virtual destination with an advance schedule time of 0, the virtual destination receives its messages at their scheduled delivery time. If a virtual destination has a non-zero advance schedule time, it receives timestamped messages as soon as they are sent, and must do its own internal scheduling of received events. API-Since: 4.2
      • kMIDIPropertyIsEmbeddedEntity

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyIsEmbeddedEntity()
        [@constant] kMIDIPropertyIsEmbeddedEntity entity/endpoint property, integer 0 if there are external MIDI connectors, 1 if not. API-Since: 4.2
      • kMIDIPropertyIsBroadcast

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyIsBroadcast()
        [@constant] kMIDIPropertyIsBroadcast entity/endpoint property, integer 1 if the endpoint broadcasts messages to all of the other endpoints in the device, 0 if not. Set by the owning driver; should not be touched by other clients. API-Since: 4.2
      • kMIDIPropertySingleRealtimeEntity

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertySingleRealtimeEntity()
        [@constant] kMIDIPropertySingleRealtimeEntity device property, integer Some MIDI interfaces cannot route MIDI realtime messages to individual outputs; they are broadcast. On such devices the inverse is usually also true -- incoming realtime messages cannot be identified as originating from any particular source. When this property is set on a driver device, it signifies the 0-based index of the entity on which incoming realtime messages from the device will appear to have originated from. API-Since: 4.2
      • kMIDIPropertyConnectionUniqueID

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyConnectionUniqueID()
        [@constant] kMIDIPropertyConnectionUniqueID device/entity/endpoint property, integer or CFDataRef UniqueID of an external device/entity/endpoint attached to this one. As of Mac OS X 10.3, Audio MIDI Setup maintains endpoint-to-external endpoint connections (in 10.2, it connected devices to devices). The property is non-existant or 0 if there is no connection. Beginning with CoreMIDI 1.3 (Mac OS X 10.2), this property may also be a CFDataRef containing an array of big-endian SInt32's, to allow specifying that a driver object connects to multiple external objects (via MIDI thru-ing or splitting). This property may also exist for external devices/entities/endpoints, in which case it signifies a MIDI Thru connection to another external device/entity/endpoint (again, it is strongly recommended that it be an endpoint). API-Since: 4.2
      • kMIDIPropertyOffline

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyOffline()
        [@constant] kMIDIPropertyOffline device/entity/endpoint property, integer 1 = device is offline (is temporarily absent), 0 = present. Set by the owning driver, on the device; should not be touched by other clients. Property is inherited from the device by its entities and endpoints. API-Since: 4.2
      • kMIDIPropertyPrivate

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyPrivate()
        [@constant] kMIDIPropertyPrivate device/entity/endpoint property, integer 1 = endpoint is private, hidden from other clients. May be set on a device or entity, but they will still appear in the API; only affects whether the owned endpoints are hidden. API-Since: 4.2
      • kMIDIPropertyDriverOwner

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyDriverOwner()
        [@constant] kMIDIPropertyDriverOwner device/entity/endpoint property, string Name of the driver that owns a device. Set by the owning driver, on the device; should not be touched by other clients. Property is inherited from the device by its entities and endpoints. API-Since: 4.2
      • kMIDIPropertyNameConfiguration

        @NotNull
        @Deprecated
        public static @NotNull CFStringRef kMIDIPropertyNameConfiguration()
        Deprecated.
        [@constant] kMIDIPropertyNameConfiguration device/entity/endpoint property, CFDictionary This specifies the device's current patch, note and control name values using the MIDINameDocument XML format. This specification requires the use of higher-level, OS-specific constructs outside of the specification to fully define the current names for a device. The MIDINameConfiguration property is implementated as a CFDictionary: key "master" maps to a CFDataRef containing an AliasHandle referring to the device's master name document. This is deprecated as of Mac OS X 10.10. key "masterDocumentPath" maps to a CFStringRef containing the filesystem path to the device's master name document. (This is new as of Mac OS X 10.10, but since the CoreMIDI implementation does not parse this dictionary, the convention can be safely ported to earlier versions of Mac OS X.) key "banks" maps to a CFDictionaryRef. This dictionary's keys are CFStringRef names of patchBank elements in the master document, and its values are each a CFDictionaryRef: key "file" maps to a CFDataRef containing an AliasHandle to a document containing patches that override those in the master document, and key "patchNameList" maps to a CFStringRef which is the name of the patchNameList element in the overriding document. key "currentChannelNameSets" maps to a 16-element CFArrayRef, each element of which is a CFStringRef of the name of the current mode for each of the 16 MIDI channels. key "currentDeviceMode" maps to a CFStringRef containing the name of the device's mode. Clients setting this property must take particular care to preserve dictionary values other than the ones they are interested in changing and to properly structure the dictionary. API-Since: 4.2 Deprecated-Since: 13.0
      • kMIDIPropertyImage

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyImage()
        [@constant] kMIDIPropertyImage device property, CFStringRef which is a full POSIX path to a device or external device's icon, stored in any standard graphic file format such as JPEG, GIF, PNG and TIFF are all acceptable. (See CFURL for functions to convert between POSIX paths and other ways of specifying files.) The image's maximum size should be 128x128. Drivers should set the icon on the devices they add. A studio setup editor should allow the user to choose icons for external devices. API-Since: 4.2
      • kMIDIPropertyDriverVersion

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyDriverVersion()
        [@constant] kMIDIPropertyDriverVersion device/entity/endpoint property, integer, returns the driver version API of the owning driver (only for driver- owned devices). Drivers need not set this property; applications should not write to it. API-Since: 4.2
      • kMIDIPropertySupportsGeneralMIDI

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertySupportsGeneralMIDI()
        [@constant] kMIDIPropertySupportsGeneralMIDI device/entity property, integer (0/1). Indicates whether the device or entity implements the General MIDI specification. API-Since: 4.2
      • kMIDIPropertySupportsMMC

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertySupportsMMC()
        [@constant] kMIDIPropertySupportsMMC device/entity property, integer (0/1). Indicates whether the device or entity implements the MIDI Machine Control portion of the MIDI specification. API-Since: 4.2
      • kMIDIPropertyCanRoute

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyCanRoute()
        [@constant] kMIDIPropertyCanRoute device/entity property, integer (0/1). Indicates whether the device or entity can route MIDI messages to or from other external MIDI devices (as with MIDI patch bays). This should NOT be set on devices which are controlled by drivers. API-Since: 4.2
      • kMIDIPropertyReceivesClock

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyReceivesClock()
        [@constant] kMIDIPropertyReceivesClock device/entity property, integer (0/1). Indicates whether the device or entity responds to MIDI beat clock messages. API-Since: 4.2
      • kMIDIPropertyReceivesMTC

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyReceivesMTC()
        [@constant] kMIDIPropertyReceivesMTC device/entity property, integer (0/1). Indicates whether the device or entity responds to MIDI Time Code messages. API-Since: 4.2
      • kMIDIPropertyReceivesNotes

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyReceivesNotes()
        [@constant] kMIDIPropertyReceivesNotes device/entity property, integer (0/1). Indicates whether the device or entity responds to MIDI Note On messages. API-Since: 4.2
      • kMIDIPropertyReceivesProgramChanges

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyReceivesProgramChanges()
        [@constant] kMIDIPropertyReceivesProgramChanges device/entity property, integer (0/1). Indicates whether the device or entity responds to MIDI program change messages. API-Since: 4.2
      • kMIDIPropertyReceivesBankSelectMSB

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyReceivesBankSelectMSB()
        [@constant] kMIDIPropertyReceivesBankSelectMSB device/entity property, integer (0/1). Indicates whether the device or entity responds to MIDI bank select MSB messages (control 0). API-Since: 4.2
      • kMIDIPropertyReceivesBankSelectLSB

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyReceivesBankSelectLSB()
        [@constant] kMIDIPropertyReceivesBankSelectLSB device/entity property, integer (0/1). Indicates whether the device or entity responds to MIDI bank select LSB messages (control 32). API-Since: 4.2
      • kMIDIPropertyTransmitsClock

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyTransmitsClock()
        [@constant] kMIDIPropertyTransmitsClock device/entity property, integer (0/1). Indicates whether the device or entity transmits MIDI beat clock messages. API-Since: 4.2
      • kMIDIPropertyTransmitsMTC

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyTransmitsMTC()
        [@constant] kMIDIPropertyTransmitsMTC device/entity property, integer (0/1). Indicates whether the device or entity transmits MIDI Time Code messages. API-Since: 4.2
      • kMIDIPropertyTransmitsNotes

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyTransmitsNotes()
        [@constant] kMIDIPropertyTransmitsNotes device/entity property, integer (0/1). Indicates whether the device or entity transmits MIDI note messages. API-Since: 4.2
      • kMIDIPropertyTransmitsProgramChanges

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyTransmitsProgramChanges()
        [@constant] kMIDIPropertyTransmitsProgramChanges device/entity property, integer (0/1). Indicates whether the device or entity transmits MIDI program change messages. API-Since: 4.2
      • kMIDIPropertyTransmitsBankSelectMSB

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyTransmitsBankSelectMSB()
        [@constant] kMIDIPropertyTransmitsBankSelectMSB device/entity property, integer (0/1). Indicates whether the device or entity transmits MIDI bank select MSB messages (control 0). API-Since: 4.2
      • kMIDIPropertyTransmitsBankSelectLSB

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyTransmitsBankSelectLSB()
        [@constant] kMIDIPropertyTransmitsBankSelectLSB device/entity property, integer (0/1). Indicates whether the device or entity transmits MIDI bank select LSB messages (control 32). API-Since: 4.2
      • kMIDIPropertyPanDisruptsStereo

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyPanDisruptsStereo()
        [@constant] kMIDIPropertyPanDisruptsStereo device/entity property, integer (0/1). Indicates whether the MIDI pan messages (control 10), when sent to the device or entity, cause undesirable effects when playing stereo sounds (e.g. converting the signal to mono). API-Since: 4.2
      • kMIDIPropertyIsSampler

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyIsSampler()
        [@constant] kMIDIPropertyIsSampler device/entity property, integer (0/1). Indicates whether the device or entity plays audio samples in response to MIDI note messages. API-Since: 4.2
      • kMIDIPropertyIsDrumMachine

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyIsDrumMachine()
        [@constant] kMIDIPropertyIsDrumMachine device/entity property, integer (0/1). Indicates whether the device or entity's sound presets tend to be collections of non-transposable samples (e.g. drum kits). API-Since: 4.2
      • kMIDIPropertyIsMixer

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyIsMixer()
        [@constant] kMIDIPropertyIsMixer device/entity property, integer (0/1). Indicates whether the device or entity mixes external audio signals, controlled by MIDI messages. API-Since: 4.2
      • kMIDIPropertyIsEffectUnit

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyIsEffectUnit()
        [@constant] kMIDIPropertyIsEffectUnit device/entity property, integer (0/1). Indicates whether the device or entity is primarily a MIDI-controlled audio effect unit (i.e. does not generate sound on its own). API-Since: 4.2
      • kMIDIPropertyMaxReceiveChannels

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyMaxReceiveChannels()
        [@constant] kMIDIPropertyMaxReceiveChannels device/entity property, integer (0-16). Indicates the maximum number of MIDI channels on which a device may simultaneously receive MIDI Channel Messages. Common values are 0 (devices which only respond to System Messages), 1 (non-multitimbral devices), and 16 (fully multitimbral devices). Other values are possible, for example devices which are multi-timbral but have fewer than 16 "parts". API-Since: 4.2
      • kMIDIPropertyMaxTransmitChannels

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyMaxTransmitChannels()
        [@constant] kMIDIPropertyMaxTransmitChannels device/entity property, integer (0/1). Indicates the maximum number of MIDI channels on which a device may simultaneously transmit MIDI Channel Messages. Common values are 0, 1 and 16. API-Since: 4.2
      • kMIDIPropertyDriverDeviceEditorApp

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyDriverDeviceEditorApp()
        [@constant] kMIDIPropertyDriverDeviceEditorApp device property, string, contains the full path to an application which knows how to configure this driver-owned devices. Drivers may set this property on their owned devices. Applications must not write to it. API-Since: 4.2
      • kMIDIPropertySupportsShowControl

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertySupportsShowControl()
        [@constant] kMIDIPropertySupportsShowControl device/entity property, integer (0/1). Indicates whether the device implements the MIDI Show Control specification. API-Since: 4.2
      • kMIDIPropertyDisplayName

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyDisplayName()
        [@constant] kMIDIPropertyDisplayName device/entity/endpoint property, string. Provides the Apple-recommended user-visible name for an endpoint, by combining the device and endpoint names. For objects other than endpoints, the display name is the same as the name. API-Since: 4.2
      • MIDINetworkBonjourServiceType

        @NotNull
        public static @NotNull java.lang.String MIDINetworkBonjourServiceType()
        This is the Bonjour service type. API-Since: 4.2
      • MIDINetworkNotificationContactsDidChange

        @NotNull
        public static @NotNull java.lang.String MIDINetworkNotificationContactsDidChange()
        These are NSNotifications posted by MIDINetworkSession objects. MIDINetworkNotificationContactsDidChange signifies that the list of contacts changed. MIDINetworkNotificationSessionDidChange signifies that other aspects of the session changed, such as the connection list, connection policy, etc. API-Since: 4.2
      • MIDINetworkNotificationSessionDidChange

        @NotNull
        public static @NotNull java.lang.String MIDINetworkNotificationSessionDidChange()
        API-Since: 4.2
      • kMIDIPropertyNameConfigurationDictionary

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyNameConfigurationDictionary()
        [@constant] kMIDIPropertyNameConfigurationDictionary device/entity/endpoint property, CFDictionary This specifies the device's current patch, note and control name values using the MIDINameDocument XML format. This specification requires the use of higher-level, OS-specific constructs outside of the specification to fully define the current names for a device. The MIDINameConfiguration property is implementated as a CFDictionary: key "masterDocumentPath" maps to a CFStringRef containing the filesystem path to the device's master name document. key "banks" maps to a CFDictionaryRef. This dictionary's keys are CFStringRef names of patchBank elements in the master document, and its values are each a CFDictionaryRef: key "file" maps to a CFDataRef containing URL bookmark data to a document containing patches that override those in the master document, and key "patchNameList" maps to a CFStringRef which is the name of the patchNameList element in the overriding document. key "currentChannelNameSets" maps to a 16-element CFArrayRef, each element of which is a CFStringRef of the name of the current mode for each of the 16 MIDI channels. key "currentDeviceMode" maps to a CFStringRef containing the name of the device's mode. Clients setting this property must take particular care to preserve dictionary values other than the ones they are interested in changing and to properly structure the dictionary. API-Since: 13.0
      • MIDIInputPortCreateWithProtocol

        public static int MIDIInputPortCreateWithProtocol​(int client,
                                                          @NotNull
                                                          @NotNull CFStringRef portName,
                                                          int protocol,
                                                          @NotNull
                                                          @NotNull org.moe.natj.general.ptr.IntPtr outPort,
                                                          @NotNull
                                                          @NotNull CoreMIDI.Block_MIDIInputPortCreateWithProtocol receiveBlock)
        [@function] MIDIInputPortCreateWithProtocol Creates an input port through which the client may receive incoming MIDI messages from any MIDI source. After creating a port, use MIDIPortConnectSource to establish an input connection from any number of sources to your port. readBlock will be called on a separate high-priority thread owned by CoreMIDI. API-Since: 14.0
        Parameters:
        client - The client to own the newly-created port.
        portName - The name of the port.
        protocol - The MIDI protocol variant to be delivered to this port. The system will automatically convert to this protocol as needed.
        outPort - On successful return, points to the newly-created MIDIPort.
        receiveBlock - The MIDIReceiveBlock which will be called with incoming MIDI, from sources connected to this port.
        Returns:
        An OSStatus result code.
      • MIDIDestinationCreateWithProtocol

        public static int MIDIDestinationCreateWithProtocol​(int client,
                                                            @NotNull
                                                            @NotNull CFStringRef name,
                                                            int protocol,
                                                            @NotNull
                                                            @NotNull org.moe.natj.general.ptr.IntPtr outDest,
                                                            @NotNull
                                                            @NotNull CoreMIDI.Block_MIDIDestinationCreateWithProtocol readBlock)
        [@function] MIDIDestinationCreateWithProtocol Creates a virtual destination in a client. The specified readBlock gets called when clients send MIDI to your virtual destination. Drivers need not call this; when they create devices and entities, sources and destinations are created at that time. After creating a virtual destination, it's a good idea to assign it the same unique ID it had the last time your application created it. (Although you should be prepared for this to fail in the unlikely event of a collision.) This will permit other clients to retain persistent references to your virtual destination more easily. See the discussion of kMIDIPropertyAdvanceScheduleTimeMuSec for notes about the relationship between when a sender sends MIDI to the destination and when it is received. API-Since: 14.0
        Parameters:
        client - The client owning the virtual destination.
        name - The name of the virtual destination.
        protocol - The MIDI protocol variant to be delivered to this destination. The system will automatically convert to this protocol as needed.
        outDest - On successful return, a pointer to the newly-created destination.
        readBlock - The MIDIReceiveBlock to be called when a client sends MIDI to the virtual destination.
        Returns:
        An OSStatus result code.
      • MIDISourceCreateWithProtocol

        public static int MIDISourceCreateWithProtocol​(int client,
                                                       @NotNull
                                                       @NotNull CFStringRef name,
                                                       int protocol,
                                                       @NotNull
                                                       @NotNull org.moe.natj.general.ptr.IntPtr outSrc)
        [@function] MIDISourceCreateWithProtocol Creates a virtual source in a client. Drivers need not call this; when they create devices and entities, sources and destinations are created at that time. After creating a virtual source, use MIDIReceivedEventList to transmit MIDI messages from your virtual source to any clients connected to the virtual source. After creating a virtual source, it's a good idea to assign it the same unique ID it had the last time your application created it. (Although you should be prepared for this to fail in the unlikely event of a collision.) This will permit other clients to retain persistent references to your virtual source more easily. API-Since: 14.0
        Parameters:
        client - The client owning the virtual source.
        name - The name of the virtual source.
        protocol - The MIDI protocol variant to be sent from this source. The system will automatically convert from this protocol to the protocol of the destination as needed.
        outSrc - On successful return, a pointer to the newly-created source.
        Returns:
        An OSStatus result code.
      • MIDISendEventList

        public static int MIDISendEventList​(int port,
                                            int dest,
                                            @NotNull
                                            @NotNull MIDIEventList evtlist)
        [@function] MIDISendEventList Sends MIDI to a destination. Events with future timestamps are scheduled for future delivery. CoreMIDI performs any needed MIDI merging. API-Since: 14.0
        Parameters:
        port - The output port through which the MIDI is to be sent.
        dest - The destination to receive the events.
        evtlist - The MIDI events to be sent.
        Returns:
        An OSStatus result code.
      • MIDIReceivedEventList

        public static int MIDIReceivedEventList​(int src,
                                                @NotNull
                                                @NotNull MIDIEventList evtlist)
        [@function] MIDIReceivedEventList Distributes incoming MIDI from a source to the client input ports which are connected to that source. Drivers should call this function when receiving MIDI from a source. Clients which have created virtual sources, using MIDISourceCreateWithProtocol, should call this function when the source is generating MIDI. Unlike MIDISendEventList(), a timestamp of 0 is not equivalent to "now"; the driver or virtual source is responsible for putting proper timestamps in the packets. API-Since: 14.0
        Parameters:
        src - The source which is transmitting MIDI.
        evtlist - The MIDI events to be transmitted.
        Returns:
        An OSStatus result code.
      • MIDIEventPacketNext

        @NotNull
        public static @NotNull MIDIEventPacket MIDIEventPacketNext​(@NotNull
                                                                   @NotNull MIDIEventPacket pkt)
        [@function] MIDIEventPacketNext Advances a MIDIEventPacket pointer to the MIDIEventPacket which immediately follows it in memory if it is part of a MIDIEventList.
        Parameters:
        pkt - A pointer to a MIDIEventPacket in a MIDIEventList.
        Returns:
        The subsequent packet in the MIDIEventList.
      • MIDIEventListInit

        @NotNull
        public static @NotNull MIDIEventPacket MIDIEventListInit​(@NotNull
                                                                 @NotNull MIDIEventList evtlist,
                                                                 int protocol)
        [@function] MIDIEventListInit Prepares a MIDIEventList to be built up dynamically.
        Parameters:
        evtlist - The event list to be initialized.
        Returns:
        A pointer to the first MIDIEventPacket in the event list. API-Since: 14.0
      • MIDIEventListAdd

        @NotNull
        public static @NotNull MIDIEventPacket MIDIEventListAdd​(@NotNull
                                                                @NotNull MIDIEventList evtlist,
                                                                long listSize,
                                                                @NotNull
                                                                @NotNull MIDIEventPacket curPacket,
                                                                long time,
                                                                long wordCount,
                                                                @NotNull
                                                                @NotNull org.moe.natj.general.ptr.ConstIntPtr words)
        [@function] MIDIEventListAdd Adds a MIDI event to a MIDIEventList. The maximum size of a event list is 65536 bytes. Large sysex messages must be sent in smaller event lists. Note that events must use the same protocol as was passed to MIDIEventListInit(). API-Since: 14.0
        Parameters:
        evtlist - The event list to which the event is to be added.
        listSize - The capacity, in bytes, of the event list.
        curPacket - A packet pointer returned by a previous call to MIDIEventListInit or MIDIEventListAdd for this packet list.
        time - The new event's time.
        wordCount - The number of valid MIDI 32-bit words which follow, in data.
        words - The new event. May be a single MIDI event, or a partial sys-ex event. Running status is not permitted.
        Returns:
        Returns null if there was not room in the packet for the event; otherwise returns a packet pointer which should be passed as curPacket in a subsequent call to this function.
      • MIDIDeviceNewEntity

        public static int MIDIDeviceNewEntity​(int device,
                                              @NotNull
                                              @NotNull CFStringRef name,
                                              int protocol,
                                              byte embedded,
                                              long numSourceEndpoints,
                                              long numDestinationEndpoints,
                                              @NotNull
                                              @NotNull org.moe.natj.general.ptr.IntPtr newEntity)
        ----------------------------------------------------------------------------- [@function] MIDIDeviceNewEntity Drivers call this function to specify one of the entities that comprise a device. Non-drivers may call this function as of macOS 10.16 & iOS 14 to add entities to external devices.
        Parameters:
        device - The device to which an entity is to be added.
        name - The name of the new entity.
        protocol - The MIDI protocol variant used by the sources and destinations that comprise this entity.
        embedded - True if this entity is inside the device, false if the entity simply consists of external connectors to which other devices can be attached.
        numSourceEndpoints - The number of source endpoints the entity has.
        numDestinationEndpoints - The number of destination endpoints the entity has.
        newEntity - On successful return, points to the newly-created entity.
        Returns:
        An OSStatus result code. API-Since: 14.0
      • MIDIMessageTypeForUPWord

        public static int MIDIMessageTypeForUPWord​(int word)
      • MIDI1UPChannelVoiceMessage

        public static int MIDI1UPChannelVoiceMessage​(byte group,
                                                     byte status,
                                                     byte channel,
                                                     byte data1,
                                                     byte data2)
        MIDI 1.0 Universal MIDI Packet (MIDI-1UP) Channel Voice Message generalized structure Word0: [aaaa][bbbb][cccc][dddd][0eeeeeee][0fffffff] a: Universal MIDI Packet Message Type (0x2 for all voice messages) b: Channel group number c: MIDI status d: MIDI channel e: MIDI note number f: Velocity The following set of functions will correctly construct voice channel messages as MIDI-1UP.
      • MIDI1UPNoteOff

        public static int MIDI1UPNoteOff​(byte group,
                                         byte channel,
                                         byte noteNumber,
                                         byte velocity)
      • MIDI1UPNoteOn

        public static int MIDI1UPNoteOn​(byte group,
                                        byte channel,
                                        byte noteNumber,
                                        byte velocity)
      • MIDI1UPControlChange

        public static int MIDI1UPControlChange​(byte group,
                                               byte channel,
                                               byte index,
                                               byte data)
      • MIDI1UPPitchBend

        public static int MIDI1UPPitchBend​(byte group,
                                           byte channel,
                                           byte lsb,
                                           byte msb)
      • MIDI1UPSystemCommon

        public static int MIDI1UPSystemCommon​(byte group,
                                              byte status,
                                              byte byte1,
                                              byte byte2)
      • MIDI2ChannelVoiceMessage

        public static MIDIMessage_64 MIDI2ChannelVoiceMessage​(byte group,
                                                              byte status,
                                                              byte channel,
                                                              char index,
                                                              int value)
        MIDI 2.0 Channel Voice Message generalized structure Word0: [aaaa][bbbb][cccc][dddd][eeeeeeeeeeeeeeee] Word1: [nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn] a: Message Type (type 4 for all voice messages) b: Channel group number c: MIDI status d: MIDI channel e: "Index" -- the contents of this field vary based on message type n: Data payload The following set of functions will correctly construct voice channel messages as two 32-bit words.
      • MIDI2NoteOn

        public static MIDIMessage_64 MIDI2NoteOn​(byte group,
                                                 byte channel,
                                                 byte noteNumber,
                                                 byte attributeType,
                                                 char attributeData,
                                                 char velocity)
      • MIDI2NoteOff

        public static MIDIMessage_64 MIDI2NoteOff​(byte group,
                                                  byte channel,
                                                  byte noteNumber,
                                                  byte attributeType,
                                                  char attributeData,
                                                  char velocity)
      • MIDI2PolyPressure

        public static MIDIMessage_64 MIDI2PolyPressure​(byte group,
                                                       byte channel,
                                                       byte noteNumber,
                                                       int value)
      • MIDI2RegisteredPNC

        public static MIDIMessage_64 MIDI2RegisteredPNC​(byte group,
                                                        byte channel,
                                                        byte noteNumber,
                                                        byte index,
                                                        int value)
      • MIDI2AssignablePNC

        public static MIDIMessage_64 MIDI2AssignablePNC​(byte group,
                                                        byte channel,
                                                        byte noteNumber,
                                                        byte index,
                                                        int value)
      • MIDI2PerNoteManagment

        public static MIDIMessage_64 MIDI2PerNoteManagment​(byte group,
                                                           byte channel,
                                                           byte noteNumber,
                                                           boolean detachPNCs,
                                                           boolean resetPNCsToDefault)
      • MIDI2ControlChange

        public static MIDIMessage_64 MIDI2ControlChange​(byte group,
                                                        byte channel,
                                                        byte index,
                                                        int value)
      • MIDI2RegisteredControl

        public static MIDIMessage_64 MIDI2RegisteredControl​(byte group,
                                                            byte channel,
                                                            byte bank,
                                                            byte index,
                                                            int value)
      • MIDI2AssignableControl

        public static MIDIMessage_64 MIDI2AssignableControl​(byte group,
                                                            byte channel,
                                                            byte bank,
                                                            byte index,
                                                            int value)
      • MIDI2RelRegisteredControl

        public static MIDIMessage_64 MIDI2RelRegisteredControl​(byte group,
                                                               byte channel,
                                                               byte bank,
                                                               byte index,
                                                               int value)
      • MIDI2RelAssignableControl

        public static MIDIMessage_64 MIDI2RelAssignableControl​(byte group,
                                                               byte channel,
                                                               byte bank,
                                                               byte index,
                                                               int value)
      • MIDI2ProgramChange

        public static MIDIMessage_64 MIDI2ProgramChange​(byte group,
                                                        byte channel,
                                                        boolean bankIsValid,
                                                        byte program,
                                                        byte bank_msb,
                                                        byte bank_lsb)
      • MIDI2ChannelPressure

        public static MIDIMessage_64 MIDI2ChannelPressure​(byte group,
                                                          byte channel,
                                                          int value)
      • MIDI2PitchBend

        public static MIDIMessage_64 MIDI2PitchBend​(byte group,
                                                    byte channel,
                                                    int value)
      • MIDI2PerNotePitchBend

        public static MIDIMessage_64 MIDI2PerNotePitchBend​(byte group,
                                                           byte channel,
                                                           byte noteNumber,
                                                           int value)
      • kMIDIPropertyProtocolID

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyProtocolID()
        constant kMIDIPropertyProtocolID device/entity/endpoint property (UMP-native), MIDIProtocolID. Indicates the native protocol in which the endpoint communicates. The value is set by the system on endpoints, when they are created. Drivers may dynamically change the protocol of an endpoint as a result of a MIDI-CI negotiation, by setting this property on the endpoint. Clients can observe changes to this property. API-Since: 14.0
      • MIDI1UPSysEx

        public static MIDIMessage_64 MIDI1UPSysEx​(byte group,
                                                  byte status,
                                                  byte bytesUsed,
                                                  byte byte1,
                                                  byte byte2,
                                                  byte byte3,
                                                  byte byte4,
                                                  byte byte5,
                                                  byte byte6)
      • MIDI1UPSysExArray

        public static MIDIMessage_64 MIDI1UPSysExArray​(byte group,
                                                       byte status,
                                                       java.lang.String begin,
                                                       java.lang.String end)
      • MIDIEventListForEachEvent

        public static void MIDIEventListForEachEvent​(MIDIEventList evtlist,
                                                     CoreMIDI.Function_MIDIEventListForEachEvent visitor,
                                                     org.moe.natj.general.ptr.VoidPtr visitorContext)
        [@typedef] MIDIEventListForEachEvent Parses UMPs from a MIDIEventList. MIDIEventListForEachEvent iterates over all UMPs in the provided MIDIEventList. It parses each UMP and fills a MIDIUniversalMessage struct. It calls the provided visitor on each of these UMPs. In case of an unknown UMP the raw UMP words will be provided.
        Parameters:
        evtlist - The MIDIEventList which is to be parsed.
        visitor - The visitor that is called on each UMP in evtlist.
        visitorContext - A context for the visitor that is passed to it when being called. API-Since: 15.0
      • MIDIBluetoothDriverActivateAllConnections

        public static int MIDIBluetoothDriverActivateAllConnections()
        [@function] MIDIBluetoothDriverActivateAllConnections Promotes all active CoreBluetooth connections to peripherals' Bluetooth LE MIDI service into online MIDI devices capable of I/O. To programmatically establish a Bluetooth MIDI driver connection to a LE MIDI peripheral, the following steps must be completed in order. 1. Using CoreBluetooth API, scan for the peripheral's advertised LE MIDI service. 2. Using CoreBluetooth API, connect to the desired advertised peripheral. 3. Upon successful connection, call MIDIBluetoothDriverActivateAllConnections. 4. Using CoreMIDI API, confirm the peripheral's registration by locating its MIDIDeviceRef. 5. If present, CoreMIDI now owns a connection the peripheral. 6. Using CoreBluetooth API, disconnect from the peripheral now managed by CoreMIDI. API-Since: 16.0
        Returns:
        An OSStatus result code.
      • MIDIBluetoothDriverDisconnect

        public static int MIDIBluetoothDriverDisconnect​(@NotNull
                                                        @NotNull CFStringRef uuid)
        [@function] MIDIBluetoothDriverDisconnect Disconnects the Bluetooth MIDI driver from a BLE MIDI peripheral. If a CoreMIDI is connected to a BLE MIDI peripheral with the supplied UUID, it will disconnect. API-Since: 16.0
        Parameters:
        uuid - A string representation of the CoreBluetooth UUI for a connected peripheral.
        Returns:
        An OSStatus result code.
      • MIDISendUMPSysex

        public static int MIDISendUMPSysex​(@NotNull
                                           @NotNull MIDISysexSendRequestUMP umpRequest)
        [@function] MIDISendUMPSysEx Sends a single UMP system-exclusive event, asynchronously. request->words must point to a single MIDI system-exclusive message, or portion thereof. API-Since: 17.0
        Parameters:
        umpRequest - Contains the destination, and a pointer to the MIDI data to be sent.
        Returns:
        An OSStatus result code.
      • MIDISendUMPSysex8

        public static int MIDISendUMPSysex8​(@NotNull
                                            @NotNull MIDISysexSendRequestUMP umpRequest)
        [@function] MIDISendUMPSysEx8 Sends single system-exclusive 8-bit event, asynchronously. request->data must point to a single MIDI system-exclusive message, or portion thereof. API-Since: 17.0
        Parameters:
        umpRequest - Contains the destination, and a pointer to the 8-bit system-exclusive data to be sent.
        Returns:
        An OSStatus result code.
      • MIDIEventPacketSysexBytesForGroup

        public static int MIDIEventPacketSysexBytesForGroup​(@NotNull
                                                            @NotNull MIDIEventPacket pkt,
                                                            byte groupIndex,
                                                            @NotNull
                                                            @NotNull org.moe.natj.general.ptr.Ptr<CFDataRef> outData)
        [@function] MIDIEventPacketSysexBytesForGroup Gets MIDI 1.0 SysEx bytes on the indicated group. pkt must contain a single MIDI system-exclusive message on groupIndex, or portion thereof. API-Since: 17.0
        Parameters:
        pkt - A MIDIEventPacket containing UMP system-exclusive data.
        groupIndex - The target group index, 0 to 15.
        outData - When successful, a CFDataRef byte stream of extracted system-exclusive data.
        Returns:
        An OSStatus result code.
      • kMIDIPropertyUMPActiveGroupBitmap

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyUMPActiveGroupBitmap()
        constant kMIDIPropertyUMPActiveGroupBitmap entity and endpoint property (UMP-native), 16-bit unsigned integer. If present, describes which groups are currently active and available for message transmission. The most significant bit represents group 16, and the least significant bit represents group 1. If a driver sets this property on a UMP-native endpoint provided for legacy MIDI 1.0 compatibility, only a single bit of the bitfield may be used. As a convenience, MIDI messages sent to a driver- created destination provided for legacy MIDI 1.0 compatibility will have all messages converted to the supported group prior to delivery. Any UMP-native endpoint lacking this property and subsequently defined property kMIDIPropertyCanTransmitGroupless is assumed to handle/transmit all UMP traffic. API-Since: 17.0
      • kMIDIPropertyUMPCanTransmitGroupless

        @NotNull
        public static @NotNull CFStringRef kMIDIPropertyUMPCanTransmitGroupless()
        constant kMIDIPropertyUMPCanTransmitGroupless entity and endpoint property (UMP-native), integer. If this property is present and set to 1, the referenced MIDI object is or has (an) endpoint/endpoints capable of transmitting UMP messages with no group (e.g., message type 0 and message type F). API-Since: 17.0