Title says all – what library(ies) or code or whatever does a digital audio workstation written in C++ (like Ableton) use to render its graphics and play audio?
After finding out that C# + XNA is a horrible choice for computer-based daws — the metronome hardly ‘hit’ correctly after I developed it, and when I fixed that, it would go off beat — I decided that now I would switch to C++, due to the fact that C++ is an intermediate-level language, while C# is high-level; and also because of cross-platform compatibility.
After several (with extremely varied terms) Google searches, I was not able to find data on this subject. Could anyone give me the information that’ll help me begin writing a DAW?
If you’re wondering, I’m writing a DAW mainly because I need one and I like the idea of having one that I can customize, change what does what and etc; and also for fun. I tend to write really advanced and high-level projects like these for fun, although I hardly finish any… 😉
First off, it is perfectly possible to write a stable metronome and handle timing correctly any language. Plenty of basic web-based DAWs are written in Java and Flash, for example. Today’s Google (moog) doodle runs in HTML5/Javascript (if you have chrome). Higher-level languages tend to give you less control over things like garbage collection, which usually means you cannot achieve as low latency, but timing should never be an issue unless you are doing something wrong.
Now, to answer the question:
Most professional, commercial DAWs use their own libraries to interface directly with the APIs that the system provides. For audio, on linux, this means OSS or Alsa; Mac OS X: Core Audio; Windows has many audio APIs because they hate you. Some companies, such as Avid, have their APIs because they also hate you, but their hardware is compatible with standard APIs because they don’t really hate you.
For graphics: Use whatever graphics library your system supports. For portability, Qt and OpenGL are good options. I’m sure there are others. There aren’t really any standard libraries for displaying waveforms or anything — you do that yourself. It’s not super easy to do it right and efficiently, but it’s not rocket science either. As far as display goes, you can also opt to use a high-level language without trouble.
You can also think about using http://www.openframeworks.cc/ and http://libcinder.org/
For audio, you could use the very popular PortAudio library: http://www.portaudio.com/
PortAudio runs on may platforms, written in C, good community support and easier to use than any one of the existing APIs.