Revision 3:15345ae708d6 doc/mainpage.dox

View differences:

doc/mainpage.dox
42 42

  
43 43
///////// (1) INITIALISATION: /////////
44 44

  
45
// There are various types of onset detector available, we must choose one
46
odftype = ODS_ODF_RCOMPLEX;
47

  
45 48
// Allocate contiguous memory using malloc or whatever is reasonable.
46 49
float* odsdata = (float*) malloc( onsetsds_memneeded(odftype, 512, 11) );
47 50

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

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

  
54 54

  
55 55
///////// (2) EXECUTION:      /////////
56 56

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

  
65 65

  

Also available in: Unified diff