For my part I would like to see it documented to indicate why you used certain values or number types to constrain number ranges.
unsigned char buf[1024]; // play buffer (Matches output blah blah)
That type of information is vital - like -
"chose u-chars for my buffer so the output value of 0 - 255 would exactly match my sample types u8 maximum range." at least in a note somewhere.
"Type equivalences for the 16 bit sample range would be
BLAH"
It's these type of implementation details that give a newbie developer insight into making what is "already there" work for better for them. Plus it documents them for everyone. including you.
I am all for the condensed style for demo code - with notes available. or the longer more documented style for walkthroughs. There is a middle ground of course and that is where most of us live.
I am fiddling with swapping in a known length of 0's at a known rate to give perceptual tempo.
Good fun!