开发者

How can I generate musical notes on iOS and play them?

开发者 https://www.devze.com 2023-03-28 03:23 出处:网络
I am creating a musical app which generate some music. I already used MIDI functions on Mac to create a MIDI file with MIDI events (unfortunately, I don\'t remember names of those functions).

I am creating a musical app which generate some music. I already used MIDI functions on Mac to create a MIDI file with MIDI events (unfortunately, I don't remember names of those functions).

I am looking for a way to create instrumental notes (MIDI's or anything else) programmatically in order to play them. I also would like to have multiple channels playing those notes at the same time.

I already tried 'SoundBankPlayer' but apparentl开发者_Go百科y, it can't play multiple instruments at the same time.

Have you got an idea?


This answer might be a bit more work than you intended, but you can use PD on iOS to do this. More precisely, you can use libpd for iOS for the synthesis, and then use any number of community-donated patches for the sound you're looking for.


In iOS 5:

MusicSequence, MusicTrack, MusicPlayer will do what you want.

http://developer.apple.com/library/ios/#documentation/AudioToolbox/Reference/MusicSequence_Reference/Reference/reference.html#//apple_ref/doc/uid/TP40009331


Check out AUSampler AudioUnit for iOS, you'll probably have to delve into Core Audio, which has some learning curve. ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号