From 57ce9b2f6228bca21c1274137d100dc11bc199d3 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 26 Oct 2018 18:10:43 +0200 Subject: [PATCH] [python] add docstrings to bintomidi and miditobin --- python/ext/aubiomodule.c | 50 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/python/ext/aubiomodule.c b/python/ext/aubiomodule.c index e97c3d35..01d2e9c8 100644 --- a/python/ext/aubiomodule.c +++ b/python/ext/aubiomodule.c @@ -20,24 +20,60 @@ static char Py_alpha_norm_doc[] = "" ">>> b = alpha_norm(a, 9)"; static char Py_bintomidi_doc[] = "" -"bintomidi(float, samplerate = integer, fftsize = integer) -> float\n" +"bintomidi(fftbin, samplerate, fftsize)\n" "\n" -"Convert bin (float) to midi (float), given the sampling rate and the FFT size\n" +"Convert FFT bin to frequency in midi note, given the sampling rate\n" +"and the size of the FFT.\n" +"\n" +"Parameters\n" +"----------\n" +"fftbin : float\n" +" input frequency bin\n" +"samplerate : float\n" +" sampling rate of the signal\n" +"fftsize : float\n" +" size of the FFT\n" +"\n" +"Returns\n" +"-------\n" +"float\n" +" Frequency converted to midi note.\n" "\n" "Example\n" "-------\n" "\n" -">>> midi = bintomidi(float, samplerate = 44100, fftsize = 1024)"; +">>> aubio.bintomidi(10, 44100, 1024)\n" +"68.62871551513672\n" +""; static char Py_miditobin_doc[] = "" -"miditobin(float, samplerate = integer, fftsize = integer) -> float\n" +"miditobin(midi, samplerate, fftsize)\n" "\n" -"Convert midi (float) to bin (float), given the sampling rate and the FFT size\n" +"Convert frequency in midi note to FFT bin, given the sampling rate\n" +"and the size of the FFT.\n" "\n" -"Example\n" +"Parameters\n" +"----------\n" +"midi : float\n" +" input frequency, in midi note\n" +"samplerate : float\n" +" sampling rate of the signal\n" +"fftsize : float\n" +" size of the FFT\n" +"\n" +"Returns\n" "-------\n" +"float\n" +" Frequency converted to FFT bin.\n" +"\n" +"Examples\n" +"--------\n" "\n" -">>> bin = miditobin(midi, samplerate = 44100, fftsize = 1024)"; +">>> aubio.miditobin(69, 44100, 1024)\n" +"10.216779708862305\n" +">>> aubio.miditobin(75.08, 32000, 512)\n" +"10.002175331115723\n" +""; static char Py_bintofreq_doc[] = "" "bintofreq(float, samplerate = integer, fftsize = integer) -> float\n" -- 2.11.0