DAW timing grid
-
AnnihilationRob AnnihilationRob https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=307959
- KVRist
- Topic Starter
- 34 posts since 2 Jul, 2013 from Colorado
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?
-
- KVRAF
- 7400 posts since 17 Feb, 2005
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.
-
AnnihilationRob AnnihilationRob https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=307959
- KVRist
- Topic Starter
- 34 posts since 2 Jul, 2013 from Colorado
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
-
AnnihilationRob AnnihilationRob https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=307959
- KVRist
- Topic Starter
- 34 posts since 2 Jul, 2013 from Colorado
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.
-
- KVRAF
- 6323 posts since 30 Dec, 2004 from London uk
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.
-
AnnihilationRob AnnihilationRob https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=307959
- KVRist
- Topic Starter
- 34 posts since 2 Jul, 2013 from Colorado
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.
-
- KVRAF
- 1671 posts since 11 Nov, 2009 from Northern CA
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.
http://www.digifreq.com/digifreq/tip.asp?ID=13
I have no idea if this is applicable to other DAWs.