3

Is there a way to set loop in the AKSequencer with arbitrary start and end timestamps. As I see, the method setLoopInfo only allows you set the loop which end is exactly at the end of the track. But I want to set a loop in the middle of a track.

I understand that this limitation of the AudioKit Sequencer grows from the limitation in the underlying apple'a MusicalPlayer, but maybe there are some workarounds...

Dmitry Klochkov
  • 2,484
  • 24
  • 31
  • 1
    You can easily set the right-side end point of your loop to any arbitrary point in your sequence. The left-side is the problem. The workaround that I use (for an app currently in production) is to shift the looping section left so that the start of the loop is at timestamp 0. It is described here: https://stackoverflow.com/a/50775161/2717159 – c_booth Mar 14 '19 at 13:04
  • 1
    Reading the doc comments at the kSequenceTrackProperty_LoopInfo property it looks like it is the other way around. "Looping is set by specifying the length of the loop. It loops from (TrackLength - loop length) to Track Length". So it is the left side of the loop that can be easily set not the right. And to make a loop in the middle we should cut the part of the track after the end of the required loop. – Dmitry Klochkov Mar 14 '19 at 14:10
  • 1
    Cutting the tracks should work but I wonder would it cause any performance issues.. – Dmitry Klochkov Mar 14 '19 at 14:13
  • 1
    I managed to set a loop in the middle of a sequence by firstly trimming the sequence at the loop's end timestamp and this works. But when I disable looping and add the trimmed part of the sequence back all is screwed up. Depending on how much time the loop was played, the position of the playhead jumps differently after disabling the loop. – Dmitry Klochkov Mar 16 '19 at 20:07

0 Answers0