Record a midi file

Discussion in 'iOS Programming' started by Zelda, Feb 26, 2015.

  1. Zelda macrumors member

    Joined:
    Aug 10, 2014
    #1
    I have an app that creates midi files and would like to convert the midi file to a ringtone or mp3 or acc file.
    I can't find any info to help with my dilemma.
    Is it possible to record a midi file that is being played, using swift code?
    thanks heaps.
    Z
     
  2. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #2
    Not in Swift (yet). You can currently only record what you play on iOS if you use Audio Units to play synthesized midi, and Audio Unit callbacks have to be coded in C (at least partially).

    Look into the documentation on the AUSampler Audio Unit. You may also need to use the AVAssetReader and AVAssetWriter APIs to convert PCM audio samples into an .m4a or .m4r format. It's not simple code. Tons of documentation on Apple's web site, but very little sample code appropriate to what you need.
     
  3. Zelda thread starter macrumors member

    Joined:
    Aug 10, 2014
    #3
    Ok, i will look at your suggestions.
    Very much appreciated.
    Thanks
    Z
     

Share This Page