coremidi

How to read the initial state of a MIDI Foot Controller?

流过昼夜 提交于 2021-02-10 19:43:17
问题 I know MIDI allows me to read the state of a MIDI Foot Controller by catching a MIDI Message indicating a Control Change. But what if the user has not touched/changed the control yet? Am I still able to read the state/value? What would be the way to do that? This is my code for catching Midi Messages using OSX CoreMIDI void initMidi() { MIDIClientRef midiClient; MIDIPortRef inputPort; OSStatus status; MIDIEndpointRef src; status = MIDIClientCreate(CFSTR("testing"), NULL, NULL, &midiClient);

Configure Mac OS X MIDI programmatically

痞子三分冷 提交于 2021-01-27 07:48:16
问题 I'm writing a program that converts OSC into MIDI, allowing OSC enabled applications (like touchOSC on my iPhone) to control MIDI enabled applications (Sibelius, Ableton Live and so on). I'm using Python to create an OSC server and convert from OSC to MIDI. To get MIDI to the application in question, I'm outputting MIDI to the Apple IAC driver, which is then enabled as an input within the program in question. Does anyone know of a means to programmatically configure Mac MIDI devices

Calling MusicDeviceMIDIEvent from the audio unit's render thread

余生长醉 提交于 2020-08-26 05:55:27
问题 There's one thing I don't understand about MusicDeviceMIDIEvent . In every single example I ever seen (searched Github and Apple examples) it was always used from the main thread. Now, in order to use the sample offset parameter the documentation states: inOffsetSampleFrame: If you are scheduling the MIDI Event from the audio unit's render thread, then you can supply a sample offset that the audio unit may apply when applying that event in its next audio unit render. This allows you to

Calling MusicDeviceMIDIEvent from the audio unit's render thread

不羁岁月 提交于 2020-08-26 05:54:49
问题 There's one thing I don't understand about MusicDeviceMIDIEvent . In every single example I ever seen (searched Github and Apple examples) it was always used from the main thread. Now, in order to use the sample offset parameter the documentation states: inOffsetSampleFrame: If you are scheduling the MIDI Event from the audio unit's render thread, then you can supply a sample offset that the audio unit may apply when applying that event in its next audio unit render. This allows you to

Calling MusicDeviceMIDIEvent from the audio unit's render thread

◇◆丶佛笑我妖孽 提交于 2020-08-26 05:54:30
问题 There's one thing I don't understand about MusicDeviceMIDIEvent . In every single example I ever seen (searched Github and Apple examples) it was always used from the main thread. Now, in order to use the sample offset parameter the documentation states: inOffsetSampleFrame: If you are scheduling the MIDI Event from the audio unit's render thread, then you can supply a sample offset that the audio unit may apply when applying that event in its next audio unit render. This allows you to

Get iOS Core MIDI client name to show in list of devices

拈花ヽ惹草 提交于 2020-01-23 19:00:47
问题 I have successfully got MIDI in working in my iOS app using Core MIDI. However, if I open up an app which outputs MIDI (for example, the free app Little MIDI Machine) my app does not show up in the list of possible devices (in the case of LMM, in the list named "CoreMIDI Outputs"), even though my app receives the MIDI notes anyway. Other apps do show up by name (i.e. iMS-20) How can I "advertise" my app to other MIDI apps on the same system? 回答1: OK, after messing around for a while I've

MIDINetworkConnection BAD_ACCESS on dealloc (iOS 9)

孤人 提交于 2020-01-06 03:24:23
问题 I've got a strange Network MIDI issue that's arisen in iOS 9 which effectively works like the following: I do a NSNetServiceBrowser scan for wifi midi devices. It finds my macbook and I create a MIDINetworkConnection with the host from the NSNetService and store this in an ivar I do another scan some time later which nils the ivar. This causes a BAD_ACCESS in the internal dealloc of MIDINetworkConnection Stack trace: #0 0x000000019902dbd0 in objc_msgSend () #1 0x0000000184c41698 in

MIDINetworkConnection BAD_ACCESS on dealloc (iOS 9)

邮差的信 提交于 2020-01-06 03:24:13
问题 I've got a strange Network MIDI issue that's arisen in iOS 9 which effectively works like the following: I do a NSNetServiceBrowser scan for wifi midi devices. It finds my macbook and I create a MIDINetworkConnection with the host from the NSNetService and store this in an ivar I do another scan some time later which nils the ivar. This causes a BAD_ACCESS in the internal dealloc of MIDINetworkConnection Stack trace: #0 0x000000019902dbd0 in objc_msgSend () #1 0x0000000184c41698 in

removeConnection results in EXC_BAD_ACCESS

。_饼干妹妹 提交于 2020-01-04 04:33:31
问题 This is Apple's code - (BOOL)removeConnection: (MIDINetworkConnection *)connection; in -[MIDINetworkSession removeConnection:] yet it results in an EXC_BAD_ACCESS . This only happens in iOS 9. Any help or workarounds? 回答1: Yar's answer helped me, except it doesn't cover the case where a disconnection happens from the other device. Instead of storing the objects to an array in removeConnection: I have a manager object that listens to the MIDINetworkNotificationSessionDidChange notification,

Delta calculation between MIDIPackets do not seem to be right

こ雲淡風輕ζ 提交于 2020-01-03 04:03:41
问题 I am trying to read a midi file, and play all the midi events with a synthesizer. The way the synth works is, it has a circular buffer which you write midi data to, and then call GenerateSamples() on it, and it will process that midi data, and give you back the number of samples you want. I'm using AudioToolbox's music player, and have setup a MidiReadProc where I write those midi packets to a buffer, and then have a separate thread polling that buffer, and writing the data to the ring buffer