• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CoreMIDI on iPhone 5S
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreMIDI on iPhone 5S


  • Subject: CoreMIDI on iPhone 5S
  • From: Nikolozi Meladze <email@hidden>
  • Date: Wed, 02 Oct 2013 17:18:20 +1000

Hey guys,

I have an app that sends MIDI note information to other synths on the device. Everything works fine on iPhone 5, iPod Touch and iPad mini (all running iOS 7.0.2). However, on iPhone 5S it appears MIDI data is corrupted by the time it gets delivered to a synth running in the background. The synth usually ends up playing 2-3 notes then starts making glitchy sounds and sometimes even crashes.

Anyone else experiencing the same issue? I’ve provided sample code here. It’s basically 4 bar loop playing 8 notes. Again, it works on all the devices except 5S. I tried compiling 32-bit only binaries. It didn’t help. Not sure if I’m doing something wrong or if it’s a bug on iOS.

Cheers
Niko


    MusicTrack musicTrack;
    MusicSequence musicSequence;
    MusicPlayer musicPlayer;

    

    NewMusicSequence(&musicSequence);
    NewMusicPlayer(&musicPlayer);
    MusicPlayerSetSequence(musicPlayer, musicSequence);
    MusicSequenceNewTrack(musicSequence, &musicTrack);

    

    MusicSequenceSetSequenceType(musicSequence, kMusicSequenceType_Beats);

    

    MusicTimeStamp trackLength = 16;
    UInt32 trackLengthSize = sizeof(trackLength);
    MusicTrackSetProperty(musicTrack, kSequenceTrackProperty_TrackLength, &trackLength, trackLengthSize);

    

    //Make it loop forever
    MusicTrackLoopInfo loopInfo;
    loopInfo.loopDuration = trackLength;
    loopInfo.numberOfLoops = 0;
    MusicTrackSetProperty(musicTrack, kSequenceTrackProperty_LoopInfo, &loopInfo, sizeof(loopInfo));

    

    //Add Notes
    for(int i = 0; i < 4; i++) {
        MIDINoteMessage noteMessage;
        noteMessage.channel = 0;
        noteMessage.note = 66 + i;
        noteMessage.velocity = 127;
        noteMessage.releaseVelocity = 0;
        noteMessage.duration = 3.0;
        MusicTimeStamp timestamp = i * 4;
        MusicTrackNewMIDINoteEvent(musicTrack, timestamp, &noteMessage);
    }

    

    for(int i = 0; i < 4; i++) {
        MIDINoteMessage noteMessage;
        noteMessage.channel = 0;
        noteMessage.note = 72 + i;
        noteMessage.velocity = 127;
        noteMessage.releaseVelocity = 0;
        noteMessage.duration = 3.0;
        MusicTimeStamp timestamp = i * 4 + 1;
        MusicTrackNewMIDINoteEvent(musicTrack, timestamp, &noteMessage);
    }

    

    MIDIEndpointRef endpoint = MIDIGetDestination(1);

    

    MusicSequenceSetMIDIEndpoint(musicSequence, endpoint);

    

    MusicPlayerPreroll(musicPlayer);
    MusicPlayerStart(musicPlayer);
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CoreMIDI on iPhone 5S
      • From: Doug Wyatt <email@hidden>
  • Prev by Date: Re: Tracking Client PID via an AudioServerPlugin
  • Next by Date: Setting up SoundConverter
  • Previous by thread: Re: Client Data Format
  • Next by thread: Re: CoreMIDI on iPhone 5S
  • Index(es):
    • Date
    • Thread