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 @ 5:422c0871839f

History | View | Annotate | Download (3.35 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
(Added Feb 2011: matlab/octave wrapper, an offline function onsetsds() which can
20
be applied to a matrix of fft data)
21

    
22
<h2>Download</h2>
23

    
24
<ul>
25
	<li><a href="https://sourceforge.net/project/showfiles.php?group_id=210998">Download the sourcecode bundle</a></li>
26
	<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 />
27
	  <tt>svn co %https://onsetsds.svn.sourceforge.net/svnroot/onsetsds onsetsds</tt></li>
28
</ul>
29

    
30
<h2>Typical usage</h2>
31

    
32
\code
33

    
34
// This example uses the recommended settings of an FFT size of 512 (@44.1kHz),
35
// and a median span of 11. It also uses the "rectified complex deviation"
36
// onset detection function - your choice of function may be down to taste,
37
// or to performance on the particular type of sound you're using.
38

    
39
#include "onsetsds.h"
40

    
41
// An instance of the OnsetsDS struct, declared/allocated somewhere in your code,
42
// however you want to do it.
43
OnsetsDS ods;
44

    
45

    
46
///////// (1) INITIALISATION: /////////
47

    
48
// There are various types of onset detector available, we must choose one
49
odftype = ODS_ODF_RCOMPLEX;
50

    
51
// Allocate contiguous memory using malloc or whatever is reasonable.
52
float* odsdata = (float*) malloc( onsetsds_memneeded(odftype, 512, 11) );
53

    
54
// Now initialise the OnsetsDS struct and its associated memory
55
onsetsds_init(&ods, odsdata, ODS_FFT_FFTW3_HC, odftype, 512, 11, 44100.f);
56

    
57

    
58
///////// (2) EXECUTION:      /////////
59

    
60
bool onset;
61
while(running){
62
   // Grab your 512- or 1024-point, 50%-overlap, nicely-windowed FFT data, into "fftdata"
63
   
64
   // Then detect. "onset" will be true when there's an onset, false otherwise
65
   onset = onsetsds_process(&ods, fftdata);
66
}
67

    
68

    
69
///////// (3) TIDYING UP:     /////////
70

    
71
free(ods->data); // Or free(odsdata), they point to the same thing in this case
72

    
73
\endcode
74

    
75
<h2>Research background</h2>
76

    
77
%OnsetsDS is based on research into musical onset detection
78
carried out by Dan Stowell, with Dr Mark Plumbley, at 
79
Queen Mary University of London's 
80
<a href="http://www.elec.qmul.ac.uk/digitalmusic/">Centre for Digital Music</a>.
81

    
82
Relevant publications:
83

    
84
\li D. Stowell and M. D. Plumbley. 
85
<a href="http://www.elec.qmul.ac.uk/digitalmusic/papers/2007/StowellPlumbley07-icmc.pdf">
86
Adaptive whitening for improved real-time audio onset detection.</a> 
87
Proceedings of the International Computer Music Conference (ICMC'07), 
88
Copenhagen, Denmark, August 2007.
89

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

    
94

    
95
*/