ref: 1ba8e601bb6be628e7fda92fda097c3fc04716e1
parent: c18981e18c1132af49c0eaf3d700dc616d248b98
author: Paul Brossier <piem@piem.org>
date: Thu Jan 29 10:09:31 EST 2015
ext/aubiomodule.c: improve documentation
--- a/python/ext/aubiomodule.c
+++ b/python/ext/aubiomodule.c
@@ -2,12 +2,82 @@
#include "aubio-types.h"
#include "aubio-generated.h"
+static char aubio_module_doc[] = "Python module for the aubio library";
+
+static char Py_alpha_norm_doc[] = ""
+"alpha_norm(fvec, integer) -> float\n"
+"\n"
+"Compute alpha normalisation factor on vector, given alpha\n"
+"\n"
+"Example\n"
+"-------\n"
+"\n"
+">>> b = alpha_norm(a, 9)";
+
+static char Py_bintomidi_doc[] = ""
+"bintomidi(float, samplerate = integer, fftsize = integer) -> float\n"
+"\n"
+"Convert bin (float) to midi (float), given the sampling rate and the FFT size\n"
+"\n"
+"Example\n"
+"-------\n"
+"\n"
+">>> midi = bintomidi(float, samplerate = 44100, fftsize = 1024)";
+
+static char Py_miditobin_doc[] = ""
+"miditobin(float, samplerate = integer, fftsize = integer) -> float\n"
+"\n"
+"Convert midi (float) to bin (float), given the sampling rate and the FFT size\n"
+"\n"
+"Example\n"
+"-------\n"
+"\n"
+">>> bin = miditobin(midi, samplerate = 44100, fftsize = 1024)";
+
+static char Py_bintofreq_doc[] = ""
+"bintofreq(float, samplerate = integer, fftsize = integer) -> float\n"
+"\n"
+"Convert bin number (float) in frequency (Hz), given the sampling rate and the FFT size\n"
+"\n"
+"Example\n"
+"-------\n"
+"\n"
+">>> freq = bintofreq(bin, samplerate = 44100, fftsize = 1024)";
+
+static char Py_freqtobin_doc[] = ""
+"freqtobin(float, samplerate = integer, fftsize = integer) -> float\n"
+"\n"
+"Convert frequency (Hz) in bin number (float), given the sampling rate and the FFT size\n"
+"\n"
+"Example\n"
+"-------\n"
+"\n"
+">>> bin = freqtobin(freq, samplerate = 44100, fftsize = 1024)";
+
+static char Py_zero_crossing_rate_doc[] = ""
+"zero_crossing_rate(fvec) -> float\n"
+"\n"
+"Compute Zero crossing rate of a vector\n"
+"\n"
+"Example\n"
+"-------\n"
+"\n"
+">>> z = zero_crossing_rate(a)";
+
+static char Py_min_removal_doc[] = ""
+"min_removal(fvec) -> float\n"
+"\n"
+"Remove the minimum value of a vector, in-place modification\n"
+"\n"
+"Example\n"
+"-------\n"
+"\n"
+">>> min_removal(a)";
+
extern void add_generated_objects ( PyObject *m );
extern void add_ufuncs ( PyObject *m );
extern int generated_types_ready(void);
-static char Py_alpha_norm_doc[] = "compute alpha normalisation factor";
-
static PyObject *
Py_alpha_norm (PyObject * self, PyObject * args)
{
@@ -39,8 +109,6 @@
return result;
}
-static char Py_bintomidi_doc[] = "convert bin to midi";
-
static PyObject *
Py_bintomidi (PyObject * self, PyObject * args)
{
@@ -56,8 +124,6 @@
return (PyObject *)PyFloat_FromDouble (output);
}
-static char Py_miditobin_doc[] = "convert midi to bin";
-
static PyObject *
Py_miditobin (PyObject * self, PyObject * args)
{
@@ -73,8 +139,6 @@
return (PyObject *)PyFloat_FromDouble (output);
}
-static char Py_bintofreq_doc[] = "convert bin to freq";
-
static PyObject *
Py_bintofreq (PyObject * self, PyObject * args)
{
@@ -90,8 +154,6 @@
return (PyObject *)PyFloat_FromDouble (output);
}
-static char Py_freqtobin_doc[] = "convert freq to bin";
-
static PyObject *
Py_freqtobin (PyObject * self, PyObject * args)
{
@@ -107,8 +169,6 @@
return (PyObject *)PyFloat_FromDouble (output);
}
-static char Py_zero_crossing_rate_doc[] = "compute zero crossing rate";
-
static PyObject *
Py_zero_crossing_rate (PyObject * self, PyObject * args)
{
@@ -139,8 +199,6 @@
return result;
}
-static char Py_min_removal_doc[] = "compute zero crossing rate";
-
static PyObject *
Py_min_removal(PyObject * self, PyObject * args)
{
@@ -183,8 +241,6 @@
{"min_removal", Py_min_removal, METH_VARARGS, Py_min_removal_doc},
{NULL, NULL} /* Sentinel */
};
-
-static char aubio_module_doc[] = "Python module for the aubio library";
PyMODINIT_FUNC
init_aubio (void)