Changes in / [b712146:54a2ca2]


Ignore:
Files:
17 added
11 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • doc/web.cfg

    rb712146 r54a2ca2  
    715715                         ../src/pitch/pitchfcomb.h \
    716716                         ../src/tempo/beattracking.h \
     717                         ../src/utils/hist.h \
    717718                         ../src/utils/scale.h \
    718719                         ../src/utils.h
  • python/demos/demo_specdesc.py

    rb712146 r54a2ca2  
    2222pv = pvoc(win_s, hop_s)
    2323
    24 methods = ['default', 'energy', 'hfc', 'complex', 'phase', 'specdiff', 'kl', 'mkl',
    25     'specflux', 'centroid', 'spread', 'skewness', 'kurtosis', 'slope', 'decrease',
    26     'rolloff', ]
     24methods = ['default', 'energy', 'hfc', 'complex', 'phase', 'specdiff', 'kl',
     25        'mkl', 'specflux', 'centroid', 'slope', 'rolloff', 'spread', 'skewness',
     26        'kurtosis', 'decrease',]
    2727
    2828all_descs = {}
     
    4040    samples, read = s()
    4141    fftgrain = pv(samples)
    42     print "%f" % ( total_frames / float(samplerate) ),
     42    #print "%f" % ( total_frames / float(samplerate) ),
    4343    for method in methods:
    4444        specdesc_val = o[method](fftgrain)[0]
    4545        all_descs[method] = hstack ( [all_descs[method], specdesc_val] )
    46         print "%f" % specdesc_val,
    47     print
     46        #print "%f" % specdesc_val,
     47    #print
    4848    total_frames += read
    4949    if read < hop_s: break
     
    5353    import matplotlib.pyplot as plt
    5454    from demo_waveform_plot import get_waveform_plot
     55    from demo_waveform_plot import set_xlabels_sample2time
    5556    fig = plt.figure()
    5657    plt.rc('lines',linewidth='.8')
    5758    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 )
    5960    wave.yaxis.set_visible(False)
    6061    wave.xaxis.set_visible(False)
     
    7475                horizontalalignment='right', verticalalignment='bottom',
    7576                )
    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)
    8278    #plt.ylabel('spectral descriptor value')
    8379    ax.xaxis.set_visible(True)
  • python/demos/demo_waveform_plot.py

    rb712146 r54a2ca2  
    55from numpy import zeros, hstack
    66
    7 def get_waveform_plot(filename, samplerate = 0, ax = None):
     7def get_waveform_plot(filename, samplerate = 0, block_size = 4096, ax = None):
    88    import matplotlib.pyplot as plt
    99    if not ax:
    1010        fig = plt.figure()
    1111        ax = fig.add_subplot(111)
    12     hop_s = 4096 # block size
     12    hop_s = block_size
    1313
    1414    allsamples_max = zeros(0,)
    15     downsample = 2**3  # to plot n samples / hop_s
     15    downsample = 2**4  # to plot n samples / hop_s
    1616
    1717    a = source(filename, samplerate, hop_s)            # source file
     
    2626        total_frames += read
    2727        if read < hop_s: break
    28     print samples.reshape(hop_s/downsample, downsample).shape
    29 
    3028    allsamples_max = (allsamples_max > 0) * allsamples_max
    3129    allsamples_max_times = [ ( float (t) / downsample ) * hop_s for t in range(len(allsamples_max)) ]
     
    3533    ax.axis(xmin = allsamples_max_times[0], xmax = allsamples_max_times[-1])
    3634
    37     if allsamples_max_times[-1] / float(samplerate) > 60:
     35    set_xlabels_sample2time(ax, allsamples_max_times[-1], samplerate)
     36    return ax
     37
     38def set_xlabels_sample2time(ax, latest_sample, samplerate):
     39    ax.axis(xmin = 0, xmax = latest_sample)
     40    if latest_sample / float(samplerate) > 60:
    3841        ax.set_xlabel('time (mm:ss)')
    3942        ax.set_xticklabels([ "%02d:%02d" % (t/float(samplerate)/60, (t/float(samplerate))%60) for t in ax.get_xticks()[:-1]], rotation = 50)
     
    4144        ax.set_xlabel('time (ss.mm)')
    4245        ax.set_xticklabels([ "%02d.%02d" % (t/float(samplerate), 100*((t/float(samplerate))%1) ) for t in ax.get_xticks()[:-1]], rotation = 50)
     46
     47
    4348if __name__ == '__main__':
    4449    import matplotlib.pyplot as plt
  • python/ext/aubio-types.h

    rb712146 r54a2ca2  
    1 #include "Python.h"
     1#include <Python.h>
    22#include <structmember.h>
    33
  • python/lib/aubio/__init__.py

    rb712146 r54a2ca2  
     1#! /usr/bin/env python
     2
    13import numpy
    24from _aubio import *
     
    46
    57class fvec(numpy.ndarray):
    6 
     8    " a simple numpy array holding a vector of float32 "
    79    def __new__(self, length = 1024, **kwargs):
     10        self.length = length
    811        if type(length) == type([]):
    912            return numpy.array(length, dtype='float32', **kwargs)
  • python/lib/gen_pyobject.py

    rb712146 r54a2ca2  
    2222  'source': [0, 2],
    2323  'sink':   [2, 0],
     24  'sampler': [1, 1],
    2425}
    2526
     
    101102    'peakpicker':   ['1'],
    102103    'source':       ['self->hop_size', '1'],
     104    'sampler':      ['self->hop_size'],
    103105}
    104106
  • python/tests/test_phasevoc.py

    rb712146 r54a2ca2  
    88class aubio_pvoc_test_case(TestCase):
    99
    10   def test_members(self):
     10  def test_members_automatic_sizes_default(self):
    1111    f = pvoc()
    1212    assert_equal ([f.win_s, f.hop_s], [1024, 512])
     13
     14  def test_members_automatic_sizes_not_null(self):
    1315    f = pvoc(2048, 128)
    1416    assert_equal ([f.win_s, f.hop_s], [2048, 128])
  • python/tests/test_source.py

    rb712146 r54a2ca2  
    5555    def test_wrong_hop_size(self):
    5656        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)
    5963
    6064    def test_zero_hop_size(self):
  • src/aubio.h

    rb712146 r54a2ca2  
    186186#include "io/sink.h"
    187187#include "io/audio_unit.h"
     188#include "synth/sampler.h"
    188189
    189190#if AUBIO_UNSTABLE
  • src/pitch/pitchyinfft.h

    rb712146 r54a2ca2  
    2828  function is tapered, the selection of the period is simplified.
    2929 
    30   Paul Brossier, ``Automatic annotation of musical audio for interactive
    31   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.
    3333
    3434  \example pitch/test-pitchyinfft.c
  • src/tempo/tempo.h

    rb712146 r54a2ca2  
    1919*/
    2020
    21 /** \file 
    22  
     21/** \file
     22
    2323  Tempo detection object
    2424
     
    4040typedef struct _aubio_tempo_t aubio_tempo_t;
    4141
    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*/
     51aubio_tempo_t * new_aubio_tempo (char_t * method,
    4452    uint_t buf_size, uint_t hop_size, uint_t samplerate);
    4553
    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*/
    4761void aubio_tempo_do (aubio_tempo_t *o, fvec_t * input, fvec_t * tempo);
    4862
    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*/
    5071uint_t aubio_tempo_set_silence(aubio_tempo_t * o, smpl_t silence);
    5172
    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*/
    5381uint_t aubio_tempo_set_threshold(aubio_tempo_t * o, smpl_t threshold);
    5482
    5583/** get current tempo
    5684
    57   \param bt beat tracking object
     85  \param o beat tracking object
    5886
    59   Returns the currently observed tempo, or 0 if no consistent value is found
     87  \return the currently observed tempo, or `0` if no consistent value is found
    6088
    6189*/
    62 smpl_t aubio_tempo_get_bpm(aubio_tempo_t * bt);
     90smpl_t aubio_tempo_get_bpm(aubio_tempo_t * o);
    6391
    6492/** get current tempo confidence
    6593
    66   \param bt beat tracking object
     94  \param o beat tracking object
    6795
    68   Returns the confidence with which the tempo has been observed, 0 if no
     96  \return confidence with which the tempo has been observed, `0` if no
    6997  consistent value is found.
    7098
    7199*/
    72 smpl_t aubio_tempo_get_confidence(aubio_tempo_t * bt);
     100smpl_t aubio_tempo_get_confidence(aubio_tempo_t * o);
    73101
    74 /** delete tempo detection object */
     102/** delete tempo detection object
     103
     104  \param o beat tracking object
     105
     106*/
    75107void del_aubio_tempo(aubio_tempo_t * o);
    76108
  • tests/src/io/test-sink.c

    rb712146 r54a2ca2  
    3434  } while ( read == hop_size );
    3535
    36   PRINT_MSG("%d frames read from %s\n written to %s at %dHz\n",
    37       n_frames, source_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);
    3838
    3939beach:
  • tests/src/io/test-source_multi.c

    rb712146 r54a2ca2  
    4444    n_frames / hop_size, source_path);
    4545
     46  del_fmat (mat);
    4647  del_aubio_source (s);
    4748beach:
    48   del_fmat (mat);
    4949
    5050  return err;
Note: See TracChangeset for help on using the changeset viewer.