changeset 3:15345ae708d6

Fix/improve documentation
author danstowell
date Thu, 10 Feb 2011 16:06:46 +0000
parents 30380dddaf20
children 747075e72e54
files doc/mainpage.dox src/onsetsds.h
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/doc/mainpage.dox	Fri Jun 20 11:09:50 2008 +0000
+++ b/doc/mainpage.dox	Thu Feb 10 16:06:46 2011 +0000
@@ -42,24 +42,24 @@
 
 ///////// (1) INITIALISATION: /////////
 
+// There are various types of onset detector available, we must choose one
+odftype = ODS_ODF_RCOMPLEX;
+
 // Allocate contiguous memory using malloc or whatever is reasonable.
 float* odsdata = (float*) malloc( onsetsds_memneeded(odftype, 512, 11) );
 
-// There are various types of onset detector available, we must choose one
-odftype = ODS_ODF_RCOMPLEX;
-
 // Now initialise the OnsetsDS struct and its associated memory
-onsetsds_init(ods, odsdata, ODS_FFT_FFTW3_HC, odftype, 512, 11);
+onsetsds_init(&ods, odsdata, ODS_FFT_FFTW3_HC, odftype, 512, 11, 44100.f);
 
 
 ///////// (2) EXECUTION:      /////////
 
 bool onset;
 while(running){
-   // Grab your 512-point, 50%-overlap, nicely-windowed FFT data, into "fftdata"
+   // Grab your 512- or 1024-point, 50%-overlap, nicely-windowed FFT data, into "fftdata"
    
    // Then detect. "onset" will be true when there's an onset, false otherwise
-   onset = onsetsds_process(ods, fftdata);
+   onset = onsetsds_process(&ods, fftdata);
 }
 
 
--- a/src/onsetsds.h	Fri Jun 20 11:09:50 2008 +0000
+++ b/src/onsetsds.h	Thu Feb 10 16:06:46 2011 +0000
@@ -59,9 +59,9 @@
 * data comes from in order to interpret it correctly.
 */
 enum onsetsds_fft_types {
-	ODS_FFT_SC3_COMPLEX,	  ///< SuperCollider, cartesian co-ords ("SCComplexBuf") - NB it's more efficient to provide polar data from SC
-	ODS_FFT_SC3_POLAR,	  ///< SuperCollider, polar co-ords ("SCPolarBuf")
-	ODS_FFT_FFTW3_HC, ///< FFTW <a href="http://www.fftw.org/fftw3_doc/The-Halfcomplex_002dformat-DFT.html">"halfcomplex"</a> format 
+	ODS_FFT_SC3_COMPLEX,	  ///< SuperCollider, cartesian co-ords ("SCComplexBuf") [dc, nyq, real[1], imag[1], real[2], imag[2]...] - NB it's more efficient to provide polar data from SC
+	ODS_FFT_SC3_POLAR,	  ///< SuperCollider, polar co-ords ("SCPolarBuf") [dc, nyq, mag[1], phase[1], mag[2], phase[2]...]
+	ODS_FFT_FFTW3_HC, ///< FFTW <a href="http://www.fftw.org/fftw3_doc/The-Halfcomplex_002dformat-DFT.html">"halfcomplex"</a> format - [dc, real[1], real[2] ... nyq, imag[nyq-1] ... imag[1]]
 	ODS_FFT_FFTW3_R2C   ///< FFTW regular format, typically produced using <a href="http://www.fftw.org/fftw3_doc/One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data">real-to-complex</a> transform
 };