History

[python] add docstrings to bintomidi and miditobin

Paul Brossier committed 8 years ago

Commit 57ce9b21 parent e3c4d001 file · +43 −7Browse files

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

Unified · Split

python/ext/aubiomodule.c+43−7
@@ -20,24 +20,60 @@ static char Py_alpha_norm_doc[] = "" · 19 unmodified lines
20">>> b = alpha_norm(a, 9)";20">>> b = alpha_norm(a, 9)";
21 21
22static char Py_bintomidi_doc[] = ""22static char Py_bintomidi_doc[] = ""
23"bintomidi(float, samplerate = integer, fftsize = integer) -> float\n"23"bintomidi(fftbin, samplerate, fftsize)\n"
24"\n"24"\n"
25"Convert bin (float) to midi (float), given the sampling rate and the FFT size\n"25"Convert FFT bin to frequency in midi note, given the sampling rate\n"
26"and the size of the FFT.\n"
27"\n"
28"Parameters\n"
29"----------\n"
30"fftbin : float\n"
31" input frequency bin\n"
32"samplerate : float\n"
33" sampling rate of the signal\n"
34"fftsize : float\n"
35" size of the FFT\n"
36"\n"
37"Returns\n"
38"-------\n"
39"float\n"
40" Frequency converted to midi note.\n"
26"\n"41"\n"
27"Example\n"42"Example\n"
28"-------\n"43"-------\n"
29"\n"44"\n"
30">>> midi = bintomidi(float, samplerate = 44100, fftsize = 1024)";45">>> aubio.bintomidi(10, 44100, 1024)\n"
46"68.62871551513672\n"
47"";
31 48
32static char Py_miditobin_doc[] = ""49static char Py_miditobin_doc[] = ""
33"miditobin(float, samplerate = integer, fftsize = integer) -> float\n"50"miditobin(midi, samplerate, fftsize)\n"
34"\n"51"\n"
35"Convert midi (float) to bin (float), given the sampling rate and the FFT size\n"52"Convert frequency in midi note to FFT bin, given the sampling rate\n"
53"and the size of the FFT.\n"
36"\n"54"\n"
37"Example\n"55"Parameters\n"
56"----------\n"
57"midi : float\n"
58" input frequency, in midi note\n"
59"samplerate : float\n"
60" sampling rate of the signal\n"
61"fftsize : float\n"
62" size of the FFT\n"
63"\n"
64"Returns\n"
38"-------\n"65"-------\n"
66"float\n"
67" Frequency converted to FFT bin.\n"
68"\n"
69"Examples\n"
70"--------\n"
39"\n"71"\n"
40">>> bin = miditobin(midi, samplerate = 44100, fftsize = 1024)";72">>> aubio.miditobin(69, 44100, 1024)\n"
73"10.216779708862305\n"
74">>> aubio.miditobin(75.08, 32000, 512)\n"
75"10.002175331115723\n"
76"";
41 77
42static char Py_bintofreq_doc[] = ""78static char Py_bintofreq_doc[] = ""
43"bintofreq(float, samplerate = integer, fftsize = integer) -> float\n"79"bintofreq(float, samplerate = integer, fftsize = integer) -> float\n"

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