History

ext/aubiomodule.c: improve documentation

Paul Brossier committed 11 years ago

Commit 1ba8e601 parent c18981e1 file · +72 −16Browse files

Showing the changes to python/ext (1 of 1 file). Show all

Unified · Split

python/ext/aubiomodule.c+72−16
@@ -2,12 +2,82 @@ · 1 unmodified line
22 #include "aubio-types.h"
33 #include "aubio-generated.h"
44
5+static char aubio_module_doc[] = "Python module for the aubio library";
6+
7+static char Py_alpha_norm_doc[] = ""
8+"alpha_norm(fvec, integer) -> float\n"
9+"\n"
10+"Compute alpha normalisation factor on vector, given alpha\n"
11+"\n"
12+"Example\n"
13+"-------\n"
14+"\n"
15+">>> b = alpha_norm(a, 9)";
16+
17+static char Py_bintomidi_doc[] = ""
18+"bintomidi(float, samplerate = integer, fftsize = integer) -> float\n"
19+"\n"
20+"Convert bin (float) to midi (float), given the sampling rate and the FFT size\n"
21+"\n"
22+"Example\n"
23+"-------\n"
24+"\n"
25+">>> midi = bintomidi(float, samplerate = 44100, fftsize = 1024)";
26+
27+static char Py_miditobin_doc[] = ""
28+"miditobin(float, samplerate = integer, fftsize = integer) -> float\n"
29+"\n"
30+"Convert midi (float) to bin (float), given the sampling rate and the FFT size\n"
31+"\n"
32+"Example\n"
33+"-------\n"
34+"\n"
35+">>> bin = miditobin(midi, samplerate = 44100, fftsize = 1024)";
36+
37+static char Py_bintofreq_doc[] = ""
38+"bintofreq(float, samplerate = integer, fftsize = integer) -> float\n"
39+"\n"
40+"Convert bin number (float) in frequency (Hz), given the sampling rate and the FFT size\n"
41+"\n"
42+"Example\n"
43+"-------\n"
44+"\n"
45+">>> freq = bintofreq(bin, samplerate = 44100, fftsize = 1024)";
46+
47+static char Py_freqtobin_doc[] = ""
48+"freqtobin(float, samplerate = integer, fftsize = integer) -> float\n"
49+"\n"
50+"Convert frequency (Hz) in bin number (float), given the sampling rate and the FFT size\n"
51+"\n"
52+"Example\n"
53+"-------\n"
54+"\n"
55+">>> bin = freqtobin(freq, samplerate = 44100, fftsize = 1024)";
56+
57+static char Py_zero_crossing_rate_doc[] = ""
58+"zero_crossing_rate(fvec) -> float\n"
59+"\n"
60+"Compute Zero crossing rate of a vector\n"
61+"\n"
62+"Example\n"
63+"-------\n"
64+"\n"
65+">>> z = zero_crossing_rate(a)";
66+
67+static char Py_min_removal_doc[] = ""
68+"min_removal(fvec) -> float\n"
69+"\n"
70+"Remove the minimum value of a vector, in-place modification\n"
71+"\n"
72+"Example\n"
73+"-------\n"
74+"\n"
75+">>> min_removal(a)";
76+
577 extern void add_generated_objects ( PyObject *m );
678 extern void add_ufuncs ( PyObject *m );
779 extern int generated_types_ready(void);
880
9−static char Py_alpha_norm_doc[] = "compute alpha normalisation factor";
10−
1181 static PyObject *
1282 Py_alpha_norm (PyObject * self, PyObject * args)
1383 {
@@ -39,8 +109,6 @@ Py_alpha_norm (PyObject * self, PyObject * args) · 25 unmodified lines
39109 return result;
40110 }
41111
42−static char Py_bintomidi_doc[] = "convert bin to midi";
43−
44112 static PyObject *
45113 Py_bintomidi (PyObject * self, PyObject * args)
46114 {
@@ -56,8 +124,6 @@ Py_bintomidi (PyObject * self, PyObject * args) · 9 unmodified lines
56124 return (PyObject *)PyFloat_FromDouble (output);
57125 }
58126
59−static char Py_miditobin_doc[] = "convert midi to bin";
60−
61127 static PyObject *
62128 Py_miditobin (PyObject * self, PyObject * args)
63129 {
@@ -73,8 +139,6 @@ Py_miditobin (PyObject * self, PyObject * args) · 9 unmodified lines
73139 return (PyObject *)PyFloat_FromDouble (output);
74140 }
75141
76−static char Py_bintofreq_doc[] = "convert bin to freq";
77−
78142 static PyObject *
79143 Py_bintofreq (PyObject * self, PyObject * args)
80144 {
@@ -90,8 +154,6 @@ Py_bintofreq (PyObject * self, PyObject * args) · 9 unmodified lines
90154 return (PyObject *)PyFloat_FromDouble (output);
91155 }
92156
93−static char Py_freqtobin_doc[] = "convert freq to bin";
94−
95157 static PyObject *
96158 Py_freqtobin (PyObject * self, PyObject * args)
97159 {
@@ -107,8 +169,6 @@ Py_freqtobin (PyObject * self, PyObject * args) · 9 unmodified lines
107169 return (PyObject *)PyFloat_FromDouble (output);
108170 }
109171
110−static char Py_zero_crossing_rate_doc[] = "compute zero crossing rate";
111−
112172 static PyObject *
113173 Py_zero_crossing_rate (PyObject * self, PyObject * args)
114174 {
@@ -139,8 +199,6 @@ Py_zero_crossing_rate (PyObject * self, PyObject * args) · 24 unmodified lines
139199 return result;
140200 }
141201
142−static char Py_min_removal_doc[] = "compute zero crossing rate";
143−
144202 static PyObject *
145203 Py_min_removal(PyObject * self, PyObject * args)
146204 {
@@ -184,8 +242,6 @@ static PyMethodDef aubio_methods[] = { · 37 unmodified lines
184242 {NULL, NULL} /* Sentinel */
185243 };
186244
187−static char aubio_module_doc[] = "Python module for the aubio library";
188−
189245 PyMODINIT_FUNC
190246 init_aubio (void)
191247 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t