Changes in / [813f4c7:e79943b]


Ignore:
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • README.md

    r813f4c7 re79943b  
    171171---------------------------------
    172172
    173 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
     173Copyright (C) 2003-2016 Paul Brossier <piem@aubio.org>
    174174
    175175aubio is free software: you can redistribute it and/or modify it under the
  • doc/aubionotes.txt

    r813f4c7 re79943b  
    5050  0.1. Lower threshold values imply more onsets detected. Try 0.5 in case of
    5151  over-detections. Defaults to 0.3.
     52
     53  -M, --minioi value  Set the minimum inter-onset interval, in seconds, the
     54  shortest interval between two consecutive notes. Defaults to 0.030
    5255
    5356  -p, --pitch method  The pitch detection method to use. See PITCH METHODS
  • python/tests/test_notes.py

    • Property mode changed from 100644 to 100755
    r813f4c7 re79943b  
    3939        assert_equal (self.o.get_silence(), val)
    4040
     41from utils import list_all_sounds
     42list_of_sounds = list_all_sounds('sounds')
     43
     44class aubio_notes_sinewave(TestCase):
     45
     46    def analyze_file(self, filepath, samplerate=0):
     47        from aubio import source
     48        import numpy as np
     49        win_s = 512 # fft size
     50        hop_s = 256 # hop size
     51
     52        s = source(filepath, samplerate, hop_s)
     53        samplerate = s.samplerate
     54
     55        tolerance = 0.8
     56
     57        notes_o = notes("default", win_s, hop_s, samplerate)
     58        total_frames = 0
     59
     60        results = []
     61        while True:
     62            samples, read = s()
     63            new_note = notes_o(samples)
     64            if (new_note[0] != 0):
     65                note_str = ' '.join(["%.2f" % i for i in new_note])
     66                results.append( [total_frames, np.copy(new_note)] )
     67            total_frames += read
     68            if read < hop_s: break
     69        return results
     70
     71    def test_sinewave(self):
     72        for filepath in list_of_sounds:
     73            if '44100Hz_44100f_sine441.wav' in filepath:
     74                results = self.analyze_file(filepath)
     75                assert_equal (len(results), 1)
     76                assert_equal (len(results[0]), 2)
     77                assert_equal (results[0][0], 1280)
     78                assert_equal (results[0][1], [69, 123, -1])
     79
    4180if __name__ == '__main__':
    4281    main()
  • wscript

    r813f4c7 re79943b  
    4848
    4949def options(ctx):
     50    ctx.add_option('--build-type', action = 'store',
     51            default = "release",
     52            choices = ('debug', 'release'),
     53            dest = 'build_type',
     54            help = 'whether to compile with (--build_type=release) or without (--build_type=debug) '\
     55              ' compiler opimizations [default: release]')
    5056    add_option_enable_disable(ctx, 'fftw3f', default = False,
    5157            help_str = 'compile with fftw3f instead of ooura (recommended)',
     
    126132    ctx.env['DEST_OS'] = target_platform
    127133
     134    if ctx.options.build_type == "debug":
     135        ctx.define('DEBUG', 1)
     136    else:
     137        ctx.define('NDEBUG', 1)
     138   
    128139    if ctx.env.CC_NAME != 'msvc':
     140        # enable debug symbols and configure warnings
    129141        ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
    130     else:
    131         ctx.env.CFLAGS += ['/W4', '/MD']
    132         ctx.env.CFLAGS += ['/D_CRT_SECURE_NO_WARNINGS']
    133 
     142        if ctx.options.build_type == "release":
     143            # set optimization level
     144            ctx.env.CFLAGS += ['-O2']
     145    else:
     146        # enable debug symbols
     147        ctx.env.CFLAGS += ['/Z7', '/FS']
     148        ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO']
     149        # configure warnings
     150        ctx.env.CFLAGS += ['/W4', '/D_CRT_SECURE_NO_WARNINGS']
     151        # set optimization level and runtime libs
     152        if (ctx.options.build_type == "release"):
     153            ctx.env.CFLAGS += ['/Ox']
     154            ctx.env.CFLAGS += ['/MD']
     155        else:
     156            assert(ctx.options.build_type == "debug")
     157            ctx.env.CFLAGS += ['/MDd']
     158       
    134159    ctx.check_cc(lib='m', uselib_store='M', mandatory=False)
    135160
Note: See TracChangeset for help on using the changeset viewer.