- Timestamp:
- Feb 11, 2013, 11:06:28 AM (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:
- 050a8f3
- Parents:
- 5314432 (diff), 88fc249 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- python
- Files:
-
- 7 added
- 2 deleted
- 1 edited
- 36 moved
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/__init__.py
r5314432 rfc117d0 1 """Copyright (C) 2004 Paul Brossier <piem@altern.org> 2 print aubio.__LICENSE__ for the terms of use 3 """ 1 import numpy 2 from _aubio import * 4 3 5 __LICENSE__ = """\ 6 Copyright (C) 2004-2009 Paul Brossier <piem@aubio.org> 4 class fvec(numpy.ndarray): 7 5 8 This file is part of aubio. 9 10 aubio is free software: you can redistribute it and/or modify 11 it under the terms of the GNU General Public License as published by 12 the Free Software Foundation, either version 3 of the License, or 13 (at your option) any later version. 14 15 aubio is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with aubio. If not, see <http://www.gnu.org/licenses/>. 22 """ 23 24 #from aubioclass import * 25 #from onsetcompare import * 26 #from median import * 27 #from noteroc import * 28 #from txtfile import * 6 def __new__(self, length = 1024, **kwargs): 7 if type(length) == type([]): 8 return numpy.array(length, dtype='float32', **kwargs) 9 return numpy.zeros(length, dtype='float32', **kwargs) -
python/demos/demo_beats_and_tempo.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 import sys -
python/demos/demo_filterbank_slaney.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from aubio import filterbank -
python/demos/demo_filterbank_triangle_bands.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from aubio import filterbank, fvec -
python/demos/demo_sink.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 import sys … … 5 5 6 6 if __name__ == '__main__': 7 if len(sys.argv) < 2:7 if len(sys.argv) < 3: 8 8 print 'usage: %s <inputfile> <outputfile>' % sys.argv[0] 9 9 sys.exit(1) -
python/demos/demo_source.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 import sys -
python/demos/demo_spectrogram.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 import sys … … 23 23 24 24 # plotting 25 imshow(log10(specgram.T ), origin = 'bottom', aspect = 'auto', cmap=cm.gray_r)25 imshow(log10(specgram.T + .001), origin = 'bottom', aspect = 'auto', cmap=cm.gray_r) 26 26 axis([0, len(specgram), 0, len(specgram[0])]) 27 ylabel('Frequency (Hz)')28 xlabel('Time (s)')29 27 # show axes in Hz and seconds 30 28 time_step = hop_s / float(samplerate) 31 29 total_time = len(specgram) * time_step 32 ticks = 10 33 xticks( arange(ticks) / float(ticks) * len(specgram), 34 [x * total_time / float(ticks) for x in range(ticks) ] ) 35 yticks( arange(ticks) / float(ticks) * len(specgram[0]), 36 [x * samplerate / 2. / float(ticks) for x in range(ticks) ] ) 30 print "total time: %0.2fs" % total_time, 31 print ", samplerate: %.2fkHz" % (samplerate / 1000.) 32 n_xticks = 10 33 n_yticks = 10 34 35 def get_rounded_ticks( top_pos, step, n_ticks ): 36 top_label = top_pos * step 37 # get the first label 38 ticks_first_label = top_pos * step / n_ticks 39 # round to the closest .1 40 ticks_first_label = round ( ticks_first_label * 10. ) / 10. 41 # compute all labels from the first rounded one 42 ticks_labels = [ ticks_first_label * n for n in range(n_ticks) ] + [ top_label ] 43 # get the corresponding positions 44 ticks_positions = [ ticks_labels[n] / step for n in range(n_ticks) ] + [ top_pos ] 45 # convert to string 46 ticks_labels = [ "%.1f" % x for x in ticks_labels ] 47 # return position, label tuple to use with x/yticks 48 return ticks_positions, ticks_labels 49 50 # apply to the axis 51 xticks( *get_rounded_ticks ( len(specgram), time_step, n_xticks ) ) 52 yticks( *get_rounded_ticks ( len(specgram[0]), (samplerate / 2. / 1000.) / len(specgram[0]), n_yticks ) ) 53 ylabel('Frequency (kHz)') 54 xlabel('Time (s)') 37 55 38 56 if __name__ == '__main__': -
python/demos/demo_tss.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 import sys -
python/gen_pyobject.py
r5314432 rfc117d0 360 360 if name in param_numbers.keys(): 361 361 n_input_param, n_output_param = param_numbers[name] 362 print name, n_output_param363 362 else: 364 363 n_input_param, n_output_param = 1, n_param - 1 -
python/generator.py
r5314432 rfc117d0 8 8 def get_cpp_objects(): 9 9 10 cpp_output = [l.strip() for l in os.popen('cpp -DAUBIO_UNSTABLE=1 -I../ ../build/src ../../src/aubio.h').readlines()]10 cpp_output = [l.strip() for l in os.popen('cpp -DAUBIO_UNSTABLE=1 -I../build/src ../src/aubio.h').readlines()] 11 11 12 12 cpp_output = filter(lambda y: len(y) > 1, cpp_output) -
python/run_all_tests
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 if __name__ == '__main__': … … 7 7 curdir = os.path.dirname(sys.argv[0]) 8 8 if curdir == '': curdir = '.' 9 files = os.listdir( curdir)9 files = os.listdir(os.path.join(curdir, 'tests')) 10 10 modfiles = filter (lambda y: y.endswith('.py'), files) 11 11 modfiles = filter (lambda f: f.startswith('test_'), modfiles) -
python/setup.py
r5314432 rfc117d0 2 2 3 3 from distutils.core import setup, Extension 4 from generator import generate_object_files 5 import os.path 6 import numpy 4 7 5 from generator import generate_object_files 6 7 import os.path 8 9 library_dirs = ['../../build/src', '../../src/.libs'] 10 include_dirs = ['../../build/src', '../../src', '.' ] 8 library_dirs = ['../build/src', '../src/.libs'] 9 include_dirs = ['../build/src', '../src', '.' ] 11 10 library_dirs = filter (lambda x: os.path.isdir(x), library_dirs) 12 11 include_dirs = filter (lambda x: os.path.isdir(x), include_dirs) … … 24 23 # generated files 25 24 ] + generate_object_files(), 26 include_dirs = include_dirs ,25 include_dirs = include_dirs + [ numpy.get_include() ], 27 26 library_dirs = library_dirs, 28 27 libraries=['aubio']) -
python/tests/test_aubio.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, run_module_suite -
python/tests/test_fft.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, run_module_suite -
python/tests/test_filter.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, assert_equal, assert_almost_equal -
python/tests/test_filterbank.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, run_module_suite -
python/tests/test_filterbank_mel.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, run_module_suite -
python/tests/test_fvec.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, run_module_suite -
python/tests/test_onset.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, run_module_suite -
python/tests/test_peakpicker.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, assert_equal, assert_almost_equal -
python/tests/test_phasevoc.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, run_module_suite -
python/tests/test_pitch.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase -
python/tests/test_source.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, assert_equal, assert_almost_equal -
python/tests/test_specdesc.py
r5314432 rfc117d0 1 #! /usr/bin/ python1 #! /usr/bin/env python 2 2 3 3 from numpy.testing import TestCase, assert_equal, assert_almost_equal
Note: See TracChangeset
for help on using the changeset viewer.