beaTunes News

Monday, January 26, 2015

Audio Analysis Options Explained

In part 1 of this series of articles, I explained the overarching idea of beaTunes, i.e. how analysis and inspection help you to build better playlists. Part 2 explained the different kinds of libraries. Today, I am going to concentrate on analysis options.

Analysis allows you to compute or retrieve additional, mostly non-textual information about your music—great examples are tempo and key. While both can be useful for DJing, tempo can be used for all kinds of applications including workout playlists for running, spinning, and aerobics. You can trigger analysis by selecting a couple of songs and then clicking on the Analyze button in the toolbar.

Using Online Resources

For most analysis tasks, beaTunes offers to simply download the desired value instead of computing it. If the value cannot be found, beaTunes falls back on its built-in algorithm. To trigger this download-first-behavior, you must check the box Use online resources in the analysis options dialog—that's the dialog that pops up, when you click on Analyze (see screenshot below).

Now, should you check that box or not?

Let's take the BPM analysis as an example. While accuracy differs depending on genre, overall state-of-the-art BPM analysis is currently roughly 74% accurate—94%, if you are willing to tolerate x2 and x0.5 errors. This so called octave error is the biggest problem in automatic BPM detection. When downloading values from the database, you are downloading values computed or entered by other beaTunes users. Doing so, you give up any control over the BPM range (or octave) as well as the used algorithm. This is not all bad—the database uses some fancy heuristics to ignore bad values and attempts to pick the "right" ones. But the fact remains: you give up control over the largest error source. There is no way to increase the octave accuracy via tweaks. Plus, you cannot use this feature when you are offline. And when you're online, analysis speed depends on your Internet connection's bandwidth and the general load on the database server.

If you decide not to use online resources, you can force beaTunes to calculate a BPM value in a certain range, e.g. 80-160 BPM. Assuming you know what general tempo your music is in, this can help you to avoid the octave error. Additionally, you get to choose which algorithm beaTunes will use (OnsetPeak is the more modern algorithm). And if you don't use online services for any task, analysis speed only depends on your personal hardware and some settings. More about those later.

In the end, you might want to use online resources, if computing values locally is too slow and you don't care much about tweaking the algorithm. But if you have lots of local processing power, fast disks, and like to stay in control, not using the online database may be the better choice.

Computational Effort

Regarding online lookup, pretty much the same rules apply to the other computation tasks—namely segmentation, color, key, replay gain, and silence detection. It's worth noting though, that some of these require much more effort than others (see Table 1). Assuming a steady beat, beaTunes does not need to look at the whole file when analyzing just for BPM. Automatic segmentation on the other hand, requires beaTunes to read the whole file and do some hefty computations. Replay gain calculation also dictates that the whole file must be decoded and analyzed. And in the case of album replay gain, multiple files have to be read. So when you enable those analysis tasks and need results quickly for thousands of songs, think about what you really want: Each checked task adds more analysis time.

TaskFile PartComputational Effort
BPMsmalllow
Colorsmalllow
Keymedium/largelow
Silencewholelow
Track ReplayGainwholelow
Segmentationwholehigh
Album ReplayGainmultiple wholelow
Table 1: Disk IO and effort of computational analysis tasks

Keep in mind that analysis speed is bound by two factors: disk IO and processing power (Table 1). For disk IO the worst case is a music collection on a slow external device that's connected via a slow interface, e.g. a slow spinning disk connected via USB 2 or an old wireless network. So while a NAS is very convenient for your home entertainment system, for analysis it's not the greatest idea. The best case is currently a fast internal SSD. And if you must use an external drive, try to connect it via USB 3—it's substantially faster than its predecessor.

Last but not least, other, non-computational tasks—like missing metadata and Last.fm tag import—always depend on an online service, no matter what analysis options you use. This means that analysis speed is limited by your network bandwidth, server load, and possible throttling dictated by third party terms of service. Last.fm for example requires, that "You will not make more than 5 requests per originating IP address per second, averaged over a 5 minute period, without prior written consent" (Terms of Service §4.4).

Global Settings

Remember the settings I mentioned earlier? There are two of them that can make analysis slower or faster. In the beaTunes preferences, under the Analysis tab, you can set the number of parallel tasks. Typically, two or three parallel tasks are recommended. You can increase this number (restart required), but—because of Amdahl's law and bottlenecks like disk IO—this does not necessarily mean that beaTunes will process your files any faster. It will mean however, that beaTunes' memory usage will increase. And memory is the other setting you can change. Usually, modifying this parameter manually is not necessary—beaTunes should prompt you for an increase, if it needs one. Should you nevertheless decide you want to grant beaTunes more memory, please see this page. Specifically, large libraries may benefit from using a little more memory. If you are unsure about your current memory settings, just open the About dialog—it shows the configured min and max memory heap sizes.

Conclusion

I hope this article shed some light on the most important analysis options and their performance implications, and helps you make smart decisions about what box to check the next time you use beaTunes for audio analysis. If you have further questions, please comment below or start a discussion in the support forum.



This article is part of a small series under the heading "HowDoesItAllWork".

  • Part 1 explains the overarching idea behind beaTunes.
  • Part 2 explains what kind of libraries beaTunes supports.
  • Part 4 takes you step-by-step through the inspection process.
  • Part 5 concludes this little series, showing how to build great playlists.

Labels: , , , ,

0 Comments:

Post a Comment

<< Home