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
2#include "aubio-types.h"2#include "aubio-types.h"
3#include "aubio-generated.h"3#include "aubio-generated.h"
4 4
5static char aubio_module_doc[] = "Python module for the aubio library";
6
7static 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
17static 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
27static 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
37static 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
47static 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
57static 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
67static 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
5extern void add_generated_objects ( PyObject *m );77extern void add_generated_objects ( PyObject *m );
6extern void add_ufuncs ( PyObject *m );78extern void add_ufuncs ( PyObject *m );
7extern int generated_types_ready(void);79extern int generated_types_ready(void);
8 80
9static char Py_alpha_norm_doc[] = "compute alpha normalisation factor";
10
11static PyObject *81static PyObject *
12Py_alpha_norm (PyObject * self, PyObject * args)82Py_alpha_norm (PyObject * self, PyObject * args)
13{83{
@@ -39,8 +109,6 @@ Py_alpha_norm (PyObject * self, PyObject * args) · 25 unmodified lines
39 return result;109 return result;
40}110}
41 111
42static char Py_bintomidi_doc[] = "convert bin to midi";
43
44static PyObject *112static PyObject *
45Py_bintomidi (PyObject * self, PyObject * args)113Py_bintomidi (PyObject * self, PyObject * args)
46{114{
@@ -56,8 +124,6 @@ Py_bintomidi (PyObject * self, PyObject * args) · 9 unmodified lines
56 return (PyObject *)PyFloat_FromDouble (output);124 return (PyObject *)PyFloat_FromDouble (output);
57}125}
58 126
59static char Py_miditobin_doc[] = "convert midi to bin";
60
61static PyObject *127static PyObject *
62Py_miditobin (PyObject * self, PyObject * args)128Py_miditobin (PyObject * self, PyObject * args)
63{129{
@@ -73,8 +139,6 @@ Py_miditobin (PyObject * self, PyObject * args) · 9 unmodified lines
73 return (PyObject *)PyFloat_FromDouble (output);139 return (PyObject *)PyFloat_FromDouble (output);
74}140}
75 141
76static char Py_bintofreq_doc[] = "convert bin to freq";
77
78static PyObject *142static PyObject *
79Py_bintofreq (PyObject * self, PyObject * args)143Py_bintofreq (PyObject * self, PyObject * args)
80{144{
@@ -90,8 +154,6 @@ Py_bintofreq (PyObject * self, PyObject * args) · 9 unmodified lines
90 return (PyObject *)PyFloat_FromDouble (output);154 return (PyObject *)PyFloat_FromDouble (output);
91}155}
92 156
93static char Py_freqtobin_doc[] = "convert freq to bin";
94
95static PyObject *157static PyObject *
96Py_freqtobin (PyObject * self, PyObject * args)158Py_freqtobin (PyObject * self, PyObject * args)
97{159{
@@ -107,8 +169,6 @@ Py_freqtobin (PyObject * self, PyObject * args) · 9 unmodified lines
107 return (PyObject *)PyFloat_FromDouble (output);169 return (PyObject *)PyFloat_FromDouble (output);
108}170}
109 171
110static char Py_zero_crossing_rate_doc[] = "compute zero crossing rate";
111
112static PyObject *172static PyObject *
113Py_zero_crossing_rate (PyObject * self, PyObject * args)173Py_zero_crossing_rate (PyObject * self, PyObject * args)
114{174{
@@ -139,8 +199,6 @@ Py_zero_crossing_rate (PyObject * self, PyObject * args) · 24 unmodified lines
139 return result;199 return result;
140}200}
141 201
142static char Py_min_removal_doc[] = "compute zero crossing rate";
143
144static PyObject *202static PyObject *
145Py_min_removal(PyObject * self, PyObject * args)203Py_min_removal(PyObject * self, PyObject * args)
146{204{
@@ -184,8 +242,6 @@ static PyMethodDef aubio_methods[] = { · 37 unmodified lines
184 {NULL, NULL} /* Sentinel */242 {NULL, NULL} /* Sentinel */
185};243};
186 244
187static char aubio_module_doc[] = "Python module for the aubio library";
188
189PyMODINIT_FUNC245PyMODINIT_FUNC
190init_aubio (void)246init_aubio (void)
191{247{

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