Changes in / [b712146:54a2ca2]
- Files:
-
- 17 added
- 11 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/web.cfg
rb712146 r54a2ca2 715 715 ../src/pitch/pitchfcomb.h \ 716 716 ../src/tempo/beattracking.h \ 717 ../src/utils/hist.h \ 717 718 ../src/utils/scale.h \ 718 719 ../src/utils.h -
python/demos/demo_specdesc.py
rb712146 r54a2ca2 22 22 pv = pvoc(win_s, hop_s) 23 23 24 methods = ['default', 'energy', 'hfc', 'complex', 'phase', 'specdiff', 'kl', 'mkl',25 'specflux', 'centroid', 'spread', 'skewness', 'kurtosis', 'slope', 'decrease',26 'rolloff',]24 methods = ['default', 'energy', 'hfc', 'complex', 'phase', 'specdiff', 'kl', 25 'mkl', 'specflux', 'centroid', 'slope', 'rolloff', 'spread', 'skewness', 26 'kurtosis', 'decrease',] 27 27 28 28 all_descs = {} … … 40 40 samples, read = s() 41 41 fftgrain = pv(samples) 42 print "%f" % ( total_frames / float(samplerate) ),42 #print "%f" % ( total_frames / float(samplerate) ), 43 43 for method in methods: 44 44 specdesc_val = o[method](fftgrain)[0] 45 45 all_descs[method] = hstack ( [all_descs[method], specdesc_val] ) 46 print "%f" % specdesc_val,47 print46 #print "%f" % specdesc_val, 47 #print 48 48 total_frames += read 49 49 if read < hop_s: break … … 53 53 import matplotlib.pyplot as plt 54 54 from demo_waveform_plot import get_waveform_plot 55 from demo_waveform_plot import set_xlabels_sample2time 55 56 fig = plt.figure() 56 57 plt.rc('lines',linewidth='.8') 57 58 wave = plt.axes([0.1, 0.75, 0.8, 0.19]) 58 get_waveform_plot(filename, samplerate, ax = wave )59 get_waveform_plot(filename, samplerate, block_size = hop_s, ax = wave ) 59 60 wave.yaxis.set_visible(False) 60 61 wave.xaxis.set_visible(False) … … 74 75 horizontalalignment='right', verticalalignment='bottom', 75 76 ) 76 if all_desc_times[-1] / float(samplerate) > 60: 77 plt.xlabel('time (mm:ss)') 78 ax.set_xticklabels([ "%02d:%02d" % (t/float(samplerate)/60, (t/float(samplerate))%60) for t in ax.get_xticks()[:-1]], rotation = 50) 79 else: 80 plt.xlabel('time (ss.mm)') 81 ax.set_xticklabels([ "%02d.%02d" % (t/float(samplerate), 100*((t/float(samplerate))%1) ) for t in ax.get_xticks()[:-1]], rotation = 50) 77 set_xlabels_sample2time(ax, all_desc_times[-1], samplerate) 82 78 #plt.ylabel('spectral descriptor value') 83 79 ax.xaxis.set_visible(True) -
python/demos/demo_waveform_plot.py
rb712146 r54a2ca2 5 5 from numpy import zeros, hstack 6 6 7 def get_waveform_plot(filename, samplerate = 0, ax = None):7 def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None): 8 8 import matplotlib.pyplot as plt 9 9 if not ax: 10 10 fig = plt.figure() 11 11 ax = fig.add_subplot(111) 12 hop_s = 4096 # blocksize12 hop_s = block_size 13 13 14 14 allsamples_max = zeros(0,) 15 downsample = 2** 3# to plot n samples / hop_s15 downsample = 2**4 # to plot n samples / hop_s 16 16 17 17 a = source(filename, samplerate, hop_s) # source file … … 26 26 total_frames += read 27 27 if read < hop_s: break 28 print samples.reshape(hop_s/downsample, downsample).shape29 30 28 allsamples_max = (allsamples_max > 0) * allsamples_max 31 29 allsamples_max_times = [ ( float (t) / downsample ) * hop_s for t in range(len(allsamples_max)) ] … … 35 33 ax.axis(xmin = allsamples_max_times[0], xmax = allsamples_max_times[-1]) 36 34 37 if allsamples_max_times[-1] / float(samplerate) > 60: 35 set_xlabels_sample2time(ax, allsamples_max_times[-1], samplerate) 36 return ax 37 38 def set_xlabels_sample2time(ax, latest_sample, samplerate): 39 ax.axis(xmin = 0, xmax = latest_sample) 40 if latest_sample / float(samplerate) > 60: 38 41 ax.set_xlabel('time (mm:ss)') 39 42 ax.set_xticklabels([ "%02d:%02d" % (t/float(samplerate)/60, (t/float(samplerate))%60) for t in ax.get_xticks()[:-1]], rotation = 50) … … 41 44 ax.set_xlabel('time (ss.mm)') 42 45 ax.set_xticklabels([ "%02d.%02d" % (t/float(samplerate), 100*((t/float(samplerate))%1) ) for t in ax.get_xticks()[:-1]], rotation = 50) 46 47 43 48 if __name__ == '__main__': 44 49 import matplotlib.pyplot as plt -
python/ext/aubio-types.h
rb712146 r54a2ca2 1 #include "Python.h"1 #include <Python.h> 2 2 #include <structmember.h> 3 3 -
python/lib/aubio/__init__.py
rb712146 r54a2ca2 1 #! /usr/bin/env python 2 1 3 import numpy 2 4 from _aubio import * … … 4 6 5 7 class fvec(numpy.ndarray): 6 8 " a simple numpy array holding a vector of float32 " 7 9 def __new__(self, length = 1024, **kwargs): 10 self.length = length 8 11 if type(length) == type([]): 9 12 return numpy.array(length, dtype='float32', **kwargs) -
python/lib/gen_pyobject.py
rb712146 r54a2ca2 22 22 'source': [0, 2], 23 23 'sink': [2, 0], 24 'sampler': [1, 1], 24 25 } 25 26 … … 101 102 'peakpicker': ['1'], 102 103 'source': ['self->hop_size', '1'], 104 'sampler': ['self->hop_size'], 103 105 } 104 106 -
python/tests/test_phasevoc.py
rb712146 r54a2ca2 8 8 class aubio_pvoc_test_case(TestCase): 9 9 10 def test_members (self):10 def test_members_automatic_sizes_default(self): 11 11 f = pvoc() 12 12 assert_equal ([f.win_s, f.hop_s], [1024, 512]) 13 14 def test_members_automatic_sizes_not_null(self): 13 15 f = pvoc(2048, 128) 14 16 assert_equal ([f.win_s, f.hop_s], [2048, 128]) -
python/tests/test_source.py
rb712146 r54a2ca2 55 55 def test_wrong_hop_size(self): 56 56 for p in list_of_sounds: 57 f = source(p, 0, -1) 58 print f.hop_size 57 try: 58 f = source(p, 0, -1) 59 except Exception, e: 60 print e 61 else: 62 self.fail('does not fail with wrong hop_size %d' % f.hop_size) 59 63 60 64 def test_zero_hop_size(self): -
src/aubio.h
rb712146 r54a2ca2 186 186 #include "io/sink.h" 187 187 #include "io/audio_unit.h" 188 #include "synth/sampler.h" 188 189 189 190 #if AUBIO_UNSTABLE -
src/pitch/pitchyinfft.h
rb712146 r54a2ca2 28 28 function is tapered, the selection of the period is simplified. 29 29 30 Paul Brossier, ``Automatic annotation of musical audio for interactive31 systems '', Chapter 3, Pitch Analysis, PhD thesis, Centre for Digital music,32 Queen Mary University of London, London, UK, 2006.30 Paul Brossier, [Automatic annotation of musical audio for interactive 31 systems](http://aubio.org/phd/), Chapter 3, Pitch Analysis, PhD thesis, 32 Centre for Digital music, Queen Mary University of London, London, UK, 2006. 33 33 34 34 \example pitch/test-pitchyinfft.c -
src/tempo/tempo.h
rb712146 r54a2ca2 19 19 */ 20 20 21 /** \file 22 21 /** \file 22 23 23 Tempo detection object 24 24 … … 40 40 typedef struct _aubio_tempo_t aubio_tempo_t; 41 41 42 /** create tempo detection object */ 43 aubio_tempo_t * new_aubio_tempo (char_t * method, 42 /** create tempo detection object 43 44 \param buf_size length of FFT 45 \param hop_size number of frames between two consecutive runs 46 \param samplerate sampling rate of the signal to analyze 47 48 \return newly created ::aubio_tempo_t if successful, `NULL` otherwise 49 50 */ 51 aubio_tempo_t * new_aubio_tempo (char_t * method, 44 52 uint_t buf_size, uint_t hop_size, uint_t samplerate); 45 53 46 /** execute tempo detection */ 54 /** execute tempo detection 55 56 \param o beat tracking object 57 \param input new samples 58 \param tempo output beats 59 60 */ 47 61 void aubio_tempo_do (aubio_tempo_t *o, fvec_t * input, fvec_t * tempo); 48 62 49 /** set tempo detection silence threshold */ 63 /** set tempo detection silence threshold 64 65 \param o beat tracking object 66 \param threshold new silence threshold, in dB 67 68 \return `0` if successful, non-zero otherwise 69 70 */ 50 71 uint_t aubio_tempo_set_silence(aubio_tempo_t * o, smpl_t silence); 51 72 52 /** set tempo detection peak picking threshold */ 73 /** set tempo detection peak picking threshold 74 75 \param o beat tracking object 76 \param threshold new threshold 77 78 \return `0` if successful, non-zero otherwise 79 80 */ 53 81 uint_t aubio_tempo_set_threshold(aubio_tempo_t * o, smpl_t threshold); 54 82 55 83 /** get current tempo 56 84 57 \param btbeat tracking object85 \param o beat tracking object 58 86 59 Returns the currently observed tempo, or 0if no consistent value is found87 \return the currently observed tempo, or `0` if no consistent value is found 60 88 61 89 */ 62 smpl_t aubio_tempo_get_bpm(aubio_tempo_t * bt);90 smpl_t aubio_tempo_get_bpm(aubio_tempo_t * o); 63 91 64 92 /** get current tempo confidence 65 93 66 \param btbeat tracking object94 \param o beat tracking object 67 95 68 Returns the confidence with which the tempo has been observed, 0if no96 \return confidence with which the tempo has been observed, `0` if no 69 97 consistent value is found. 70 98 71 99 */ 72 smpl_t aubio_tempo_get_confidence(aubio_tempo_t * bt);100 smpl_t aubio_tempo_get_confidence(aubio_tempo_t * o); 73 101 74 /** delete tempo detection object */ 102 /** delete tempo detection object 103 104 \param o beat tracking object 105 106 */ 75 107 void del_aubio_tempo(aubio_tempo_t * o); 76 108 -
tests/src/io/test-sink.c
rb712146 r54a2ca2 34 34 } while ( read == hop_size ); 35 35 36 PRINT_MSG(" %d frames read from %s\n written to %s at %dHz\n",37 n_frames, s ource_path, sink_path, samplerate);36 PRINT_MSG("wrote %d frames at %dHz from %s written to %s\n", 37 n_frames, samplerate, source_path, sink_path); 38 38 39 39 beach: -
tests/src/io/test-source_multi.c
rb712146 r54a2ca2 44 44 n_frames / hop_size, source_path); 45 45 46 del_fmat (mat); 46 47 del_aubio_source (s); 47 48 beach: 48 del_fmat (mat);49 49 50 50 return err;
Note: See TracChangeset
for help on using the changeset viewer.