I noticed that playing more than one sound at a time caused massive distortion in sound. The problem was that in PokittoLib’s mixer the sample values were handled as unsigned values when multiplying and adding samples together, which messes the zero level of the sample.
I modified the mixer and synth functions so that sample values are first converted to signed values and centered around zero before any operations. Improvement in sound quality is huge.
The fix is included in this pull request by @Hanski: