coremidi

Calculating CoreMIDI Pitch Bend Values For iOS?

送分小仙女□ 提交于 2019-11-30 16:56:43
I need to hand assemble 14bit MIDI Pitch Bend values from raw UInt16 values in iOS. I'm wondering if anybody out there has had a chance to come up with an elegant solution? Here's where I'm at - I'll get a chance to test this probably later today, but if I hear back before then, great: First, some MIDI preliminaries for anybody curious. MIDI Pitch Bend is broken up into one Status Byte followed by two Data Bytes (it's a 14bit controller), these two Data Bytes are associated with their Status Byte by both leading with a Zero status bit , MIDI Spec has them appearing in the order of MSB -> LSB

ios - mixing midi files, each with own sound font

这一生的挚爱 提交于 2019-11-30 10:07:20
I'm looking for a way to mix 2 or more midi files, each with their own sound font files. I've found the following code for one file and tried to do multiple music players but i guess that shouldn't be the right approach. Also i get some weird pop sound every second. So is there any other way, maybe without the musicplayer and musicsequence methods, using only au units? Here's the code i found in another thread: -(void) playMusic:(NSString*) name { NSString *presetURLPath = [[NSBundle mainBundle] pathForResource:@"GortsMiniPianoJ1" ofType:@"SF2"]; NSURL * presetURL = [NSURL fileURLWithPath

How to use CoreMIDI on iOS?

戏子无情 提交于 2019-11-30 07:01:41
I have been unable to find much information on CoreMIDI for iOS. Is it even possible to play a MIDI sound by sending a message to the device itself. Does the iPhone or iPad have a MIDI device installed or do you have to have a device connected to interface with? You should give a look at pete goodliffe's blog and he generously provides an example project. It helped me a lot to start programming CoreMIDI. Now about your questions, on iOS, mostly CoreMIDI network sessions are used. The participants to a same "Network Session" send messages to each others. For example, you configure a network

Calculating CoreMIDI Pitch Bend Values For iOS?

自闭症网瘾萝莉.ら 提交于 2019-11-30 00:32:08
问题 I need to hand assemble 14bit MIDI Pitch Bend values from raw UInt16 values in iOS. I'm wondering if anybody out there has had a chance to come up with an elegant solution? Here's where I'm at - I'll get a chance to test this probably later today, but if I hear back before then, great: First, some MIDI preliminaries for anybody curious. MIDI Pitch Bend is broken up into one Status Byte followed by two Data Bytes (it's a 14bit controller), these two Data Bytes are associated with their Status

Why doesn't this simple CoreMIDI program produce MIDI output?

江枫思渺然 提交于 2019-11-29 22:24:32
Here is an extremely simple CoreMIDI OS X application that sends MIDI data. The problem is that it doesn't work. It compiles fine, and runs. It reports no errors, and does not crash. The Source created becomes visible in MIDI Monitor. However, no MIDI data comes out . Could somebody let me know what I'm doing wrong here? #include <CoreMIDI/CoreMIDI.h> int main(int argc, char *args[]) { MIDIClientRef theMidiClient; MIDIEndpointRef midiOut; MIDIPortRef outPort; char pktBuffer[1024]; MIDIPacketList* pktList = (MIDIPacketList*) pktBuffer; MIDIPacket *pkt; Byte midiDataToSend[] = {0x91, 0x3c, 0x40}

ios - mixing midi files, each with own sound font

南笙酒味 提交于 2019-11-29 15:29:28
问题 I'm looking for a way to mix 2 or more midi files, each with their own sound font files. I've found the following code for one file and tried to do multiple music players but i guess that shouldn't be the right approach. Also i get some weird pop sound every second. So is there any other way, maybe without the musicplayer and musicsequence methods, using only au units? Here's the code i found in another thread: -(void) playMusic:(NSString*) name { NSString *presetURLPath = [[NSBundle

Why doesn't this simple CoreMIDI program produce MIDI output?

老子叫甜甜 提交于 2019-11-28 17:36:08
问题 Here is an extremely simple CoreMIDI OS X application that sends MIDI data. The problem is that it doesn't work. It compiles fine, and runs. It reports no errors, and does not crash. The Source created becomes visible in MIDI Monitor. However, no MIDI data comes out . Could somebody let me know what I'm doing wrong here? #include <CoreMIDI/CoreMIDI.h> int main(int argc, char *args[]) { MIDIClientRef theMidiClient; MIDIEndpointRef midiOut; MIDIPortRef outPort; char pktBuffer[1024];

Using Swift CFunctionPointer to pass a callback to CoreMIDI API

荒凉一梦 提交于 2019-11-27 04:38:42
It may be that this is actually not possible currently, which would be unfortunate. I'm trying to call the CoreMIDI API to set up a MIDI input. This is what I'm trying to do in Swift: var midiClient = MIDIClientRef() var inputPort = MIDIEndpointRef() var status: OSStatus func readProc(packetList: UnsafePointer<MIDIPacketList>, readProcRefCon: UnsafeMutablePointer<Void>, srcConnRefCon: UnsafeMutablePointer<Void>) -> Void { } status = MIDIClientCreate("MIDI client", nil, nil, &midiClient); status = MIDIDestinationCreate(midiClient, "MIDI input", readProc, nil, &inputPort); But I get this error: