Trying to debug mystery sinewave using AKMIDISampler in Audiokit

前端 未结 4 1722
余生分开走
余生分开走 2021-01-13 16:03

Following on from a previous issue, I stopped using AKSampler to move to the functionality used in AKMIDISampler. Got my loops working again (with

4条回答
  •  醉话见心
    2021-01-13 16:13

    I found out the cause of this issue. I learnt that the MIDI sequencer was creating an extra track when I gave it a specific number of MIDI tracks; for four tracks in my midi file, the sequencer was giving me five. This extra track is for tempo (as discovered here).

    I also learnt that my first track was being ignored from my .plist (where I set up the stems for different songs).

    My assumption that the first track is being used for the tempo track was tested, and when I created five tracks in my .plist to match the sequencer, the sinewave tone disappeared.

    This lead to a workaround hack. I did this by duplicating the first sample in my .plist, which was being ignored anyway, and then hiding the sprite that represented this sound off screen. This works for now, but if anyone has an idea of how to control this tempo track and its use in AKSequencer I’d love to know more.

    So in short: Make sure that the MIDI file has exact number of tracks that you want to use. Create the same number of AKMIDISampler to use in AKSequencer adding one for tempo track. Then beware that the first track in the sequencer is the tempo track and will not work playing samples.

提交回复
热议问题