Buzzing in Audio playback

I’m building a little tracker sequencer thing and when I playback audio I get this weird buzzing sound that happens that looks almost like RM through zero. When you zoom in on the recording, the period of the buzz is roughly 4 samples which is my buffer size. I am fairly certain that my code is not the issue as it is just an oscillator and an envelope being triggered on and off.

This was recorded through a Scarlett Solo via TRS cable which was plugged directly into audioOut1 and ground. AGND and DGND are connected.

Has anyone else had this problem and is there anyway to fix it?

Welcome!

I’m sorry to hear that you’re running into an issue with the sound.
You should be able to share an audio file. I would like to hear what it sounds like.
And feel free to post the code and more info on how your hardware is wired up. Thanks!

What is RM through zero?
Since you mention some apparent correlation between the noise and the buffer size - have you tried other buffer sizes to (possibly) find out if that is a coincidence?