Revision 6:55d7698f79f8

View differences:

doc/mainpage.dox
22 22
<h2>Download</h2>
23 23

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

  
45 45

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

  
48 48
// There are various types of onset detector available, we must choose one
49 49
odftype = ODS_ODF_RCOMPLEX;
......
55 55
onsetsds_init(&ods, odsdata, ODS_FFT_FFTW3_HC, odftype, 512, 11, 44100.f);
56 56

  
57 57

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

  
60 60
bool onset;
61 61
while(running){
......
66 66
}
67 67

  
68 68

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

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

  
mat_oct/onsetsds.c
79 79
			packeddata[j+j+1] = (float) imag[frameoffset + j];
80 80
		}
81 81
		bool onset = onsetsds_process(&ods, packeddata);
82
//		printf("%i ", onset);
83
//		printf("[%i] %i", i, onset);
84 82
		results[i] = (onset ? 1.0 : 0.0);
85
//		printf("[%i] %g", i, results[i]);
86 83
	}	
87 84
	
88 85
	// Copy the results from double-array into matlab format
89
//	mwSize *dims = (mwSize*) mxCalloc(2, sizeof(mwSize));
90
//	dims[0] = 1;
91
//	dims[1] = numframes;
92
//	mxArray *resultsM = mxCreateNumericArray(2, dims, mxINT8_CLASS, mxREAL);
93 86
	mxArray *resultsM = mxCreateDoubleMatrix(1,numframes,mxREAL);
94
//	mxSetPr(resultsM, results);
95 87
	memcpy(mxGetPr(resultsM), results, numframes * sizeof(double));
96 88
	plhs[0] = resultsM;
97 89
	
98 90
	// destroy the ods correctly, and any matlabby things that need to go too.
99 91
	free(ods.data);
100 92
	free(packeddata);
101
//	mxFree(dims);
102 93
	mxFree(results);
103
	// *resultsM ? no I think that lives on in matlabworld
104 94
}

Also available in: Unified diff