2012-09-20 110 views
1

我一直在使用MusicPlayerMusicSequence類播放MIDI文件。但是,我想知道如何爲不同的頻道指定樂器。什麼是MusicPlayer對程序變更事件的默認響應?我可以告訴MusicPlayer某些通道使用某些採樣器嗎?或者是將我自己的功能設置爲MIDI端點的唯一方法,然後使用MusicDeviceMIDIEvent()自己處理演奏音符來指定採樣器?播放多樂器MIDI文件

回答

0

您可以爲MusicSequence中的不同音軌指定不同樂器。 (MusicTrack API)我不認爲MusicPlayer本身會對頻道做任何事情。您可以指定加載MIDI文件時將頻道轉換爲曲目。

音樂順序加載標誌用於配置MusicSequenceFileLoad和 MusicSequenceFileLoadData功能的行爲

標誌。

枚舉{kMusicSequenceLoadSMF_ChannelsToTracks =(1 < < 0)}; typedef UInt32 MusicSequenceLoadFlags;

常量

kMusicSequenceLoadSMF_ChannelsToTracks

If this flag is set the resultant Sequence will contain a tempo track, 1 track for each MIDI Channel that is found in the SMF, 1 track 

的專用信息或MetaEvents - 這將是LoadSMFWithFlags電話後 序列中的最後一首曲目。

Available in OS X v10.3 and later. 

Declared in MusicPlayer.h.