I recently migrated from AKAppleSequencer to AKSequencer. My app is using some AKSampler for playing recorded instruments provided as wav.
Everything works fine and the timing is much better now compared to AKAppleSequencer. But there is a strange behavior when setting the tempo to a certain value. It seems that some notes are muted (or partially cancellated) now. Setting the tempo higher or lower than that value works fine - all notes in the pattern are audible. Changing the tempo is not doing any magic except sequencer.tempo=value. There is no postprocessing except some mixers.
Here is some pseudocode:
let sequencer = AKSequencer()
let akfile = try AKAudioFile(readFileName: "sample-1.wav")
let descriptor = AKSampleDescriptor(
noteNumber: 60,
noteFrequency:
Float(AKPolyphonicNode.tuningTable.frequency(forNoteNumber: 60)),
minimumNoteNumber: -1,
maximumNoteNumber: 127,
minimumVelocity: 0,
maximumVelocity: 127,
isLooping: false,
loopStartPoint: 0.0,
loopEndPoint: 1.0,
startPoint: 0.0,
endPoint: 0.0)
let sampler = AKSampler()
sampler.loadAKAudioFile(from: descriptor, file: akfile)
sampler.buildSimpleKeyMap()
// load some more samples
// create tracks and notes
let track = sequencer.addTrack(for: sampler)
// wire everything together
// play
It seems that the issue is related to which samples are used so just dropping some lines of code might not be sufficient to reproduce the behavior.
Using AKAppleSampler instead of AKSampler solved the problem for me but any hints might be interesting for others who are facing that problem and need to use AKSampler.
I'm using AudioKit v 4.9.3 and the issue occures on hardware and simulators.