From: Guillaume Pellerin Date: Sun, 25 Jan 2015 23:12:49 +0000 (+0100) Subject: Merge branch 'dev' X-Git-Tag: 0.7 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=timeside.git Merge branch 'dev' Conflicts: README.rst doc/source/news.rst setup.py timeside/__init__.py timeside/grapher/render_analyzers.py --- 2a654fa376fd88875a0043556e3bb612b1fe6626 diff --cc README.rst index bdce96d,3650e7d..95c9a34 --- a/README.rst +++ b/README.rst @@@ -91,10 -112,19 +112,23 @@@ For more extensive examples, please se News ===== + 0.7 + + * Code refactoring: + + - Create a new module `timeside.plugins` and move processors therein: timeside.plugins.decoder,analyzer, timeside.plugins.encoder, timeside.plugins.fx + - WARNING: to properly manage the namespace packages structure, the TimeSide main module is now `timeside.core` and code should now be initialized with `import timeside.core`. + - `timeside.plugins` is now a `namespace package `_ enabling external plugins to be **automatically** plugged into TimeSide (see for example `timeside-diadems `_). This now makes TimeSide a **real** plugin host, yeah! + - A dummy timeside plugin will soon be provided for easy development start. + + * Move all analyzers developped by the partners of the Diadems project to a new repository: `timeside-diadems `_ + * Many fixes for a better processing by `Travis-CI `_ + * Add a dox file to test the docker building continously on `various distributions `_ + +0.6.2 + + * Bugfix release for #63 #64 #68 + 0.6.1 * Fix various minor bugs diff --cc doc/source/news.rst index 9ed659a,430d0f3..899628e --- a/doc/source/news.rst +++ b/doc/source/news.rst @@@ -1,10 -1,19 +1,23 @@@ News ===== + 0.7 + + * Code refactoring: + + - Create a new module `timeside.plugins` and move processors therein: timeside.plugins.decoder,analyzer, timeside.plugins.encoder, timeside.plugins.fx + - WARNING: to properly manage the namespace packages structure, the TimeSide main module is now `timeside.core` and code should now be initialized with `import timeside.core`. + - `timeside.plugins` is now a `namespace package `_ enabling external plugins to be **automatically** plugged into TimeSide (see for example `timeside-diadems `_). This now makes TimeSide a **real** plugin host, yeah! + - A dummy timeside plugin will soon be provided for easy development start. + + * Move all analyzers developped by the partners of the Diadems project to a new repository: `timeside-diadems `_ + * Many fixes for a better processing by `Travis-CI `_ + * Add a dox file to test the docker building continously on `various distributions `_ + +0.6.2 + + * Bugfix release for #63 #64 #68 + 0.6.1 * Fix various minor bugs diff --cc timeside/__init__.py index c8a813c,8b13789..e69de29 --- a/timeside/__init__.py +++ b/timeside/__init__.py @@@ -1,50 -1,1 +1,0 @@@ - # -*- coding: utf-8 -*- - # - # Copyright (c) 2014 Thomas Fillon - - # This file is part of TimeSide. - - # TimeSide is free software: you can redistribute it and/or modify - # it under the terms of the GNU General Public License as published by - # the Free Software Foundation, either version 2 of the License, or - # (at your option) any later version. - - # TimeSide is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - - # You should have received a copy of the GNU General Public License - # along with TimeSide. If not, see . - # - # Authors: - # Thomas Fillon - - from __future__ import absolute_import - - from . import api - from . import core - - __version__ = '0.6.2' - - - # Check Availability of external Audio feature extraction librairies - from .tools import package as ts_package - _WITH_AUBIO = ts_package.check_aubio() - _WITH_YAAFE = ts_package.check_yaafe() - _WITH_VAMP = ts_package.check_vamp() - - - _packages_with_processors = ['decoder', 'analyzer', 'encoder', 'grapher', 'fx'] - - __all__ = ['api', 'core'] - __all__.extend(_packages_with_processors) - - for _sub_pkg in _packages_with_processors: - ts_package.discover_modules(_sub_pkg, __name__) -- - # Clean-up - del ts_package - del _packages_with_processors - del _sub_pkg - del absolute_import diff --cc timeside/plugins/analyzer/externals/aubio_pitch.py index 0000000,8f56b63..8d5ca61 mode 000000,100644..100644 --- a/timeside/plugins/analyzer/externals/aubio_pitch.py +++ b/timeside/plugins/analyzer/externals/aubio_pitch.py @@@ -1,0 -1,136 +1,137 @@@ + # -*- coding: utf-8 -*- + # + # Copyright (c) 2013 Paul Brossier + + # This file is part of TimeSide. + + # TimeSide is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation, either version 2 of the License, or + # (at your option) any later version. + + # TimeSide is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with TimeSide. If not, see . + + # Author: Paul Brossier + from __future__ import absolute_import + + from timeside.core import implements, interfacedoc + from timeside.core.analyzer import Analyzer + from timeside.core.api import IAnalyzer + from timeside.core.preprocessors import downmix_to_mono, frames_adapter + from aubio import pitch + import numpy as np + from timeside.plugins.analyzer.utils import nextpow2 + + from timeside.core.tools.parameters import Float, HasTraits + + + class AubioPitch(Analyzer): + + """Aubio Pitch estimation analyzer""" + implements(IAnalyzer) # TODO check if needed with inheritance + + # Define Parameters + class _Param(HasTraits): + blocksize_s = Float + stepsize_s = Float + + def __init__(self, blocksize_s=None, stepsize_s=None): + + super(AubioPitch, self).__init__() + + self._blocksize_s = blocksize_s + self._stepsize_s = stepsize_s + + @interfacedoc + def setup(self, channels=None, samplerate=None, + blocksize=None, totalframes=None): - super(AubioPitch, self).setup(channels, - samplerate, - blocksize, - totalframes) - - + # Frame parameters setup + if self._blocksize_s: + self.input_blocksize = nextpow2(self._blocksize_s * samplerate) + else: + self.input_blocksize = 2048 + + if self._stepsize_s: + self.input_stepsize = nextpow2(self._stepsize_s * samplerate) + else: + self.input_stepsize = self.input_blocksize / 2 + ++ # Now that frames size metadata are properly set, we can do the set-up ++ super(AubioPitch, self).setup(channels, ++ samplerate, ++ blocksize, ++ totalframes) ++ ++ + # Aubio Pitch set-up + self.aubio_pitch = pitch( + "default", self.input_blocksize, self.input_stepsize, + samplerate) + self.aubio_pitch.set_unit("freq") + self.block_read = 0 + self.pitches = [] + self.pitch_confidences = [] + + @staticmethod + @interfacedoc + def id(): + return "aubio_pitch" + + @staticmethod + @interfacedoc + def name(): + return "f0 (aubio)" + + @staticmethod + @interfacedoc + def unit(): + return "Hz" + + def __str__(self): + return "pitch values" + + @downmix_to_mono + @frames_adapter + def process(self, frames, eod=False): + #time = self.block_read * self.input_stepsize * 1. / self.samplerate() + self.pitches += [self.aubio_pitch(frames)[0]] + self.pitch_confidences += [ + np.nan_to_num(self.aubio_pitch.get_confidence())] + self.block_read += 1 + return frames, eod + + def post_process(self): + pitch = self.new_result(data_mode='value', time_mode='framewise') + + # parameters : None # TODO check with Piem "default" and "freq" in + # setup + + pitch.id_metadata.id += '.' + "pitch" + pitch.id_metadata.name += ' ' + "pitch" + pitch.id_metadata.unit = "Hz" + pitch.data_object.value = self.pitches + self.add_result(pitch) + + pitch_confidence = self.new_result( + data_mode='value', time_mode='framewise') + pitch_confidence.id_metadata.id += '.' + "pitch_confidence" + pitch_confidence.id_metadata.name += ' ' + "pitch confidence" + pitch_confidence.id_metadata.unit = None + pitch_confidence.data_object.value = self.pitch_confidences + self.add_result(pitch_confidence) + + + # Generate Grapher for Aubio Pitch analyzer + from timeside.core.grapher import DisplayAnalyzer + DisplayAubioPitch = DisplayAnalyzer.create( + analyzer=AubioPitch, + result_id='aubio_pitch.pitch', + grapher_id='grapher_aubio_pitch', + grapher_name='Pitch', + background='spectrogram')