]> git.parisson.com Git - timeside.git/commitdiff
Merge branch 'dev' master 0.7
authorGuillaume Pellerin <yomguy@parisson.com>
Sun, 25 Jan 2015 23:12:49 +0000 (00:12 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Sun, 25 Jan 2015 23:12:49 +0000 (00:12 +0100)
Conflicts:
README.rst
doc/source/news.rst
setup.py
timeside/__init__.py
timeside/grapher/render_analyzers.py

1  2 
README.rst
doc/source/news.rst
timeside/__init__.py
timeside/plugins/analyzer/externals/aubio_pitch.py

diff --cc README.rst
index bdce96d188aa467e31d52b010d16b57e2d7f4b5e,3650e7d9f77ababfe72d26a412e1bc6326e9ff9f..95c9a3448cdb42b5bb1dc65335b41c49477795b9
@@@ -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 <https://pythonhosted.org/setuptools/setuptools.html#namespace-packages>`_ enabling external plugins to be **automatically** plugged into TimeSide (see for example `timeside-diadems <https://github.com/ANR-DIADEMS/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 <https://github.com/ANR-DIADEMS/timeside-diadems>`_
+  * Many fixes for a better processing by `Travis-CI <https://travis-ci.org/Parisson/TimeSide>`_
+  * Add a dox file to test the docker building continously on `various distributions <https://github.com/Parisson/Docker>`_
 +0.6.2
 +
 +  * Bugfix release for #63 #64 #68
 +
  0.6.1
  
    * Fix various minor bugs
index 9ed659a3f45a74c3c03b5d92ce02e8015885b075,430d0f327a0e0cf6b977b77a5ab2f8703ec0bb45..899628e6334ad947891e93f6f895ec16bcd6d1c6
@@@ -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 <https://pythonhosted.org/setuptools/setuptools.html#namespace-packages>`_ enabling external plugins to be **automatically** plugged into TimeSide (see for example `timeside-diadems <https://github.com/ANR-DIADEMS/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 <https://github.com/ANR-DIADEMS/timeside-diadems>`_
+  * Many fixes for a better processing by `Travis-CI <https://travis-ci.org/Parisson/TimeSide>`_
+  * Add a dox file to test the docker building continously on `various distributions <https://github.com/Parisson/Docker>`_
 +0.6.2
 +
 +  * Bugfix release for #63 #64 #68
 +
  0.6.1
  
    * Fix various minor bugs
index c8a813c1e64846cc9f29816facc677df906121c7,8b137891791fe96927ad78e64b0aad7bded08bdc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
@@@ -1,50 -1,1 +1,0 @@@
- # -*- coding: utf-8 -*-
- #
- # Copyright (c) 2014 Thomas Fillon <thomas@parisson.com>
- # 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 <http://www.gnu.org/licenses/>.
- #
- # Authors:
- # Thomas Fillon <thomas@parisson.com>
- 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
index 0000000000000000000000000000000000000000,8f56b63b3a75baf7d1259ce438c3d9da2d53a216..8d5ca61504b81026056c6f1d1231162601d3cf7d
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,136 +1,137 @@@
 -        super(AubioPitch, self).setup(channels,
 -                                      samplerate,
 -                                      blocksize,
 -                                      totalframes)
 -
 -
+ # -*- coding: utf-8 -*-
+ #
+ # Copyright (c) 2013 Paul Brossier <piem@piem.org>
+ # 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 <http://www.gnu.org/licenses/>.
+ # Author: Paul Brossier <piem@piem.org>
+ 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):
+         # 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')