To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

The primary repository for this project is hosted at svn://svn.code.sf.net/p/onsetsds/code/ .
This repository is a read-only copy which is updated automatically every hour.

Statistics Download as Zip
| Branch: | Revision:

root / doc / mainpage.dox @ 2:30380dddaf20

History | View | Annotate | Download (3.22 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 or later). 
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="https://sourceforge.net/project/showfiles.php?group_id=210998">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
Proceedings of the International Computer Music Conference (ICMC'07), 
85
Copenhagen, Denmark, August 2007.
86

    
87
The research stands on the shoulders of other onset detection research, and uses
88
some concepts from that research - see the ICMC'07 paper and its bibliography
89
for more details.
90

    
91

    
92
*/