I'm trying to play a midi file where the notes are created from one .wav audio sample.
I have something working, but on the device, some audio glitches are audible (They are hardly noticable in the simulator).
I'm not sure if it is a bug or if I'm doing something wrong, but it seems that this problem appeared recently (or it is just that I never noticed it in the simulator).
Here is attached a sample code (and an attached project file).
local snd = playdate.sound local music = snd.sequence.new("sounds/music.mid") local sample = snd.sample.new("sounds/note") local ntracks = music:getTrackCount() for i=1,ntracks do local track = music:getTrackAtIndex(i) local instrument = snd.instrument.new() for i=1,track:getPolyphony() do instrument:addVoice(snd.synth.new(sample)) end track:setInstrument(instrument) end music:play() function playdate.update() end
Source.zip (283.2 KB)
This is not exactly what I do in my app, but it seems to reproduce the problem.
Do you have any idea where these audio glitches come from?