DAW timing grid

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I've been trying to write various apps that deal with musical timing, and I'm struggling to wrap my mind around how the timing grid is implemented in modern daws. I'm actually now trying to write a basic audio editor in javascript, and I'm having trouble drawing waveforms on a timing grid with multiple tempo changes. If there is a tempo change in the middle of the waveform, the way its drawn has to be changed slightly, and doing this without a large hit to rendering performance is something I can't figure out how to do. Anyone have any experience with this?

Post

If you are talking about automation "Waveforms", they are usually done as piecewise functions. Calculating data on the fly is cheap, while looking it up is expensive in this case.

Post

I'm not sure. I don't think I mean automation waveforms. I'm just talking about rendering a plain ol' audio clip so the waveform syncs up with the grid properly like this: https://dl.dropboxusercontent.com/u/75652364/grid.png

Post

I've been able to draw all of this successfully and accurately -the gridlines and waveforms - but I am still having performance issues. I have tried two methods. The first is calculating everything on the fly, which results in slow, jerky scrolling and zooming, and the second is precalculating the corresponding sample and H:M:S location for every tick in the project each time the tempo/meter is changed. This results in a big slow down every time the tempo/meter changes though. What am I missing here? There must be some magic all the modern daws are using to be so effortless in their grid calculations.

Post

Id say its down to JavaScript. Its not used in DAW work. Youll need to move to something much faster like C++ that seems to be the language of choice.

Post

Sonar, pro tools, and the like are utterly instantaneous with every grid operation and effortlessly smooth and quick with scrolling and zooming. I know javascript's performance isn't equal to c++, but I actually wrote a bunch of other dsp code first in c++ and switched over to javascript and I haven't seen a performance loss that accounts for what I'm experiencing with the grid. I am doing a lot of my calculations with pretty long accumulation loops that I feel the real daws must not be doing in order to be so quick. I suspect there is maybe some more advanced math or something that I am just not aware of for making these kinds of calculations quickly and accurately.

Post

Stuff is usually drawn using vector graphics, so you should be doing that in case you aren't.

Post

Here's some insight into how SONAR works with waveform images:

http://www.digifreq.com/digifreq/tip.asp?ID=13

I have no idea if this is applicable to other DAWs.

Post Reply

Return to “DSP and Plugin Development”