To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / onsetsds / doc / mainpage.dox @ 0:635e8745ccc9
History | View | Annotate | Download (3.19 KB)
| 1 |
/** \mainpage OnsetsDS - real time musical onset detection C/C++ library |
|---|---|
| 2 |
|
| 3 |
<small>Copyright (c) 2007 Dan Stowell (Published under the GNU Public License v2). |
| 4 |
http://onsetsds.sourceforge.net/</small> |
| 5 |
|
| 6 |
<h2>Introduction</h2> |
| 7 |
|
| 8 |
The purpose of %OnsetsDS is to provide capabilities for FFT-based onset |
| 9 |
detection that works very efficiently in real-time, and can detect onsets |
| 10 |
pretty well in a broad variety of musical signals, with a fast reaction |
| 11 |
time. |
| 12 |
|
| 13 |
It is not specialised for any particular type of signal. Nor is it |
| 14 |
particularly tailored towards non-real-time use (if we were working in |
| 15 |
non-real-time there are extra things we could do to improve the precision). |
| 16 |
Its efficiency and fast reaction are designed with general real-time musical |
| 17 |
applications in mind. |
| 18 |
|
| 19 |
<h2>Download</h2> |
| 20 |
|
| 21 |
<ul> |
| 22 |
<li><a href="http://sourceforge.net/">Download the sourcecode bundle</a></li> |
| 23 |
<li>Or access the current development version using subversion [<small><a href="http://sourceforge.net/svn/?group_id=54622" title="What is subversion, and how to use it">info</a></small>]: <br /> |
| 24 |
<tt>svn co %https://onsetsds.svn.sourceforge.net/svnroot/onsetsds onsetsds</tt></li> |
| 25 |
</ul> |
| 26 |
|
| 27 |
<h2>Typical usage</h2> |
| 28 |
|
| 29 |
\code |
| 30 |
|
| 31 |
// This example uses the recommended settings of an FFT size of 512 (@44.1kHz), |
| 32 |
// and a median span of 11. It also uses the "rectified complex deviation" |
| 33 |
// onset detection function - your choice of function may be down to taste, |
| 34 |
// or to performance on the particular type of sound you're using. |
| 35 |
|
| 36 |
#include "onsetsds.h" |
| 37 |
|
| 38 |
// An instance of the OnsetsDS struct, declared/allocated somewhere in your code, |
| 39 |
// however you want to do it. |
| 40 |
OnsetsDS ods; |
| 41 |
|
| 42 |
|
| 43 |
///////// (1) INITIALISATION: ///////// |
| 44 |
|
| 45 |
// Allocate contiguous memory using malloc or whatever is reasonable. |
| 46 |
float* odsdata = (float*) malloc( onsetsds_memneeded(odftype, 512, 11) ); |
| 47 |
|
| 48 |
// There are various types of onset detector available, we must choose one |
| 49 |
odftype = ODS_ODF_RCOMPLEX; |
| 50 |
|
| 51 |
// Now initialise the OnsetsDS struct and its associated memory |
| 52 |
onsetsds_init(ods, odsdata, ODS_FFT_FFTW3_HC, odftype, 512, 11); |
| 53 |
|
| 54 |
|
| 55 |
///////// (2) EXECUTION: ///////// |
| 56 |
|
| 57 |
bool onset; |
| 58 |
while(running){
|
| 59 |
// Grab your 512-point, 50%-overlap, nicely-windowed FFT data, into "fftdata" |
| 60 |
|
| 61 |
// Then detect. "onset" will be true when there's an onset, false otherwise |
| 62 |
onset = onsetsds_process(ods, fftdata); |
| 63 |
} |
| 64 |
|
| 65 |
|
| 66 |
///////// (3) TIDYING UP: ///////// |
| 67 |
|
| 68 |
free(ods->data); // Or free(odsdata), they point to the same thing in this case |
| 69 |
|
| 70 |
\endcode |
| 71 |
|
| 72 |
<h2>Research background</h2> |
| 73 |
|
| 74 |
%OnsetsDS is based on research into musical onset detection |
| 75 |
carried out by Dan Stowell, with Dr Mark Plumbley, at |
| 76 |
Queen Mary University of London's |
| 77 |
<a href="http://www.elec.qmul.ac.uk/digitalmusic/">Centre for Digital Music</a>. |
| 78 |
|
| 79 |
Relevant publications: |
| 80 |
|
| 81 |
\li D. Stowell and M. D. Plumbley. |
| 82 |
<a href="http://www.elec.qmul.ac.uk/digitalmusic/papers/2007/StowellPlumbley07-icmc.pdf"> |
| 83 |
Adaptive whitening for improved real-time audio onset detection.</a> |
| 84 |
To appear in: |
| 85 |
Proceedings of the International Computer Music Conference (ICMC'07), |
| 86 |
Copenhagen, Denmark, August 2007. |
| 87 |
|
| 88 |
The research stands on the shoulders of other onset detection research, and uses |
| 89 |
some concepts from that research - see the ICMC'07 paper and its bibliography |
| 90 |
for more details. |
| 91 |
|
| 92 |
|
| 93 |
*/ |