Ok guys, I had some of the same question last years and I have dig the Internet for you
For me the best way to start was reading some simple code and try to understand them.
One that was really helpfull was taken here : http://olofson.net/mixed.html
DT42 is a drum tracker which work with 3000 line of C using sdl.
It is not easy and well written but it contain :
- a nice sdl GUI ;
- a load save function ;
- a structure to store the song ;
- sample instrument : just trig ;
- a really basic synth but well written and great to understand ;
There is also a minimal version without the GUI which take 1000 line of C, it's a strip down version of DT42. This guy has done a really good tutorial for anyone IMHO.
If you plan to write a tracker I think you should learn how to write :
- a waveform generator ;
- a minimal sound mixer ;
- a pattern player with an audio engine ;
I'm not an expert in this area, I just begin to code a minimal player.
It play wave but the audio engine is not really perfect.
it's well written I think but I am a noob in waveform generation so i get broken c++ code.
It works I can generate sawtooth wave and I enjoy it.
I can't get a decent sine wave, i don't understand the full stuff...
Good to see there are people out there which write code, i enjoy this
And hope this will help you to begin.
Johann