- Timestamp:
- Mar 3, 2013, 10:27:17 PM (12 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 7a6521d
- Parents:
- 6a50b9e
- Location:
- python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubiomodule.c
r6a50b9e r6514bb6 38 38 39 39 return result; 40 } 41 42 static char Py_unwrap2pi_doc[] = "unwrap phase value to [-pi, pi]"; 43 44 static PyObject * 45 Py_unwrap2pi (PyObject * self, PyObject * args) 46 { 47 smpl_t input; 48 smpl_t output; 49 50 if (!PyArg_ParseTuple (args, "|f", &input)) { 51 return NULL; 52 } 53 54 output = aubio_unwrap2pi (input); 55 56 return (PyObject *)PyFloat_FromDouble (output); 40 57 } 41 58 … … 209 226 210 227 static PyMethodDef aubio_methods[] = { 228 {"unwrap2pi", Py_unwrap2pi, METH_VARARGS, Py_unwrap2pi_doc}, 211 229 {"bintomidi", Py_bintomidi, METH_VARARGS, Py_bintomidi_doc}, 212 230 {"miditobin", Py_miditobin, METH_VARARGS, Py_miditobin_doc}, -
python/tests/test_mathutils.py
r6a50b9e r6514bb6 4 4 from numpy.testing import assert_equal, assert_almost_equal 5 5 from aubio import bintomidi, miditobin, freqtobin, bintofreq, freqtomidi, miditofreq 6 from aubio import unwrap2pi 6 7 7 8 class aubio_mathutils(TestCase): 9 10 def test_unwrap2pi(self): 11 a = [ x/100. for x in range(-600,600,100) ] 12 b = [ unwrap2pi(x) for x in a ] 13 #print b 8 14 9 15 def test_miditobin(self): … … 25 31 freqs = [ miditofreq(a) for a in range(128) ] 26 32 midis = [ freqtomidi(a) for a in freqs ] 27 print midis28 33 29 34 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.