Graphers
========
-Spectrogram
+
+Waveform
-----------
-.. automodule:: timeside.grapher.spectrogram
+.. automodule:: timeside.grapher.waveform_simple
:members:
-Waveform
------------
+WaveformCentroid
+------------------
-.. automodule:: timeside.grapher.waveform
+.. automodule:: timeside.grapher.waveform_centroid
:members:
-Simple Waveform
----------------
+WaveformTransparent
+--------------------
-.. automodule:: timeside.grapher.waveform_simple
+.. automodule:: timeside.grapher.waveform_centroid
:members:
-Contour Waveform (white)
+WaveformContour
------------------------
-.. automodule:: timeside.grapher.waveform_contour_wh
+
+.. automodule:: timeside.grapher.waveform_contour
:members:
-Contour Waveform (black)
-------------------------
-.. automodule:: timeside.grapher.waveform_contour_bk
+
+SpectrogramLog
+---------------
+
+.. automodule:: timeside.grapher.spectrogram_log
+ :members:
+
+
+SpectrogramLin
+---------------
+
+.. automodule:: timeside.grapher.spectrogram_lin
:members:
# WAVEFORMS CONTOUR BLACK
def testWav2WaveformContourBlack(self):
"Test WAV to WaveformContourBlack"
- from timeside.grapher.waveform_contour_black import WaveformContourBlack
+ from timeside.grapher.waveform_contour import WaveformContourBlack
self.source = os.path.join (os.path.dirname(__file__), "samples/sweep.wav")
self.image = "/tmp/test_waveform_contour_bk_sweep_wav.png"
self.grapher = WaveformContourBlack(width=1024, height=256, bg_color=(0,0,0), color_scheme='default')
def testFlac2WaveformContourBlack(self):
"Test FLAC to WaveformContourBlack"
- from timeside.grapher.waveform_contour_black import WaveformContourBlack
+ from timeside.grapher.waveform_contour import WaveformContourBlack
self.source = os.path.join (os.path.dirname(__file__), "samples/sweep.flac")
self.image = "/tmp/test_waveform_contour_bk_sweep_flac.png"
self.grapher = WaveformContourBlack(width=1024, height=256, bg_color=(0,0,0), color_scheme='default')
def testMp32WaveformContourBlack(self):
"Test MP3 to WaveformContourBlack"
- from timeside.grapher.waveform_contour_black import WaveformContourBlack
+ from timeside.grapher.waveform_contour import WaveformContourBlack
self.source = os.path.join (os.path.dirname(__file__), "samples/sweep.mp3")
self.image = "/tmp/test_waveform_contour_bk_sweep_mp3.png"
self.grapher = WaveformContourBlack(width=1024, height=256, bg_color=(0,0,0), color_scheme='default')
def testOgg2WaveformContourBlack(self):
"Test OGG to WaveformContourBlack"
- from timeside.grapher.waveform_contour_black import WaveformContourBlack
+ from timeside.grapher.waveform_contour import WaveformContourBlack
self.source = os.path.join (os.path.dirname(__file__), "samples/sweep.ogg")
self.image = "/tmp/test_waveform_contour_bk_sweep_ogg.png"
self.grapher = WaveformContourBlack(width=1024, height=256, bg_color=(0,0,0), color_scheme='default')
# WAVEFORMS CONTOUR WHITE
def testWav2WaveformContourWhite(self):
"Test WAV to WaveformContourWhite"
- from timeside.grapher.waveform_contour_white import WaveformContourWhite
+ from timeside.grapher.waveform_contour import WaveformContourWhite
self.source = os.path.join (os.path.dirname(__file__), "samples/sweep.wav")
self.image = "/tmp/test_waveform_contour_wh_sweep_wav.png"
self.grapher = WaveformContourWhite(width=1024, height=256, bg_color=(255,255,255), color_scheme='default')
def testFlac2WaveformContourWhite(self):
"Test FLAC to WaveformContourWhite"
- from timeside.grapher.waveform_contour_white import WaveformContourWhite
+ from timeside.grapher.waveform_contour import WaveformContourWhite
self.source = os.path.join (os.path.dirname(__file__), "samples/sweep.flac")
self.image = "/tmp/test_waveform_contour_wh_sweep_flac.png"
self.grapher = WaveformContourWhite(width=1024, height=256, bg_color=(255,255,255), color_scheme='default')
def testMp32WaveformContourWhite(self):
"Test MP3 to WaveformContourWhite"
- from timeside.grapher.waveform_contour_white import WaveformContourWhite
+ from timeside.grapher.waveform_contour import WaveformContourWhite
self.source = os.path.join (os.path.dirname(__file__), "samples/sweep.mp3")
self.image = "/tmp/test_waveform_contour_wh_sweep_mp3.png"
self.grapher = WaveformContourWhite(width=1024, height=256, bg_color=(255,255,255), color_scheme='default')
def testOggWaveformContourWhite(self):
"Test OGG to WaveformContourWhite"
- from timeside.grapher.waveform_contour_white import WaveformContourWhite
+ from timeside.grapher.waveform_contour import WaveformContourWhite
self.source = os.path.join (os.path.dirname(__file__), "samples/sweep.ogg")
self.image = "/tmp/test_waveform_contour_wh_sweep_ogg.png"
self.grapher = WaveformContourWhite(width=1024, height=256, bg_color=(255,255,255), color_scheme='default')
from waveform_simple import *
from waveform_centroid import *
from waveform_transparent import *
-from waveform_contour_black import *
-from waveform_contour_white import *
+from waveform_contour import *
from spectrogram_log import *
from spectrogram_lin import *
--- /dev/null
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2007-2010 Guillaume Pellerin <yomguy@parisson.com>
+# Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.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/>.
+
+
+from timeside.core import Processor, implements, interfacedoc, FixedSizeInputAdapter
+from timeside.api import IGrapher
+from timeside.grapher.core import *
+from timeside.grapher.waveform_simple import Waveform
+
+
+class WaveformContourBlack(Waveform):
+ """ Builds a PIL image representing an amplitude coutour (envelop) of the audio stream.
+ """
+
+ implements(IGrapher)
+
+ @interfacedoc
+ def __init__(self, width=1024, height=256, bg_color=(0,0,0), color_scheme='default'):
+ super(WaveformContourBlack, self).__init__(width, height, bg_color, color_scheme)
+ self.contour = numpy.zeros(self.image_width)
+ self.ndiv = 4
+ self.x = numpy.r_[0:self.image_width-1:1]
+ self.symetry = True
+ self.color_offset = 160
+
+ @staticmethod
+ @interfacedoc
+ def id():
+ return "waveform_contour_black"
+
+ @staticmethod
+ @interfacedoc
+ def name():
+ return "Contour black"
+
+ @interfacedoc
+ def setup(self, channels=None, samplerate=None, blocksize=None, totalframes=None):
+ super(WaveformContourBlack, self).setup(channels, samplerate, blocksize, totalframes)
+
+ @interfacedoc
+ def process(self, frames, eod=False):
+ if len(frames) != 1:
+ buffer = frames[:,0].copy()
+ buffer.shape = (len(buffer),1)
+ for samples, end in self.pixels_adapter.process(buffer, eod):
+ if self.pixel_cursor < self.image_width:
+ self.contour[self.pixel_cursor] = numpy.max(peaks(samples))
+ self.pixel_cursor += 1
+ if eod:
+ self.draw_peaks_contour()
+ return frames, eod
+
+
+
+class WaveformContourWhite(WaveformContourBlack):
+
+ """ Builds a PIL image representing an amplitude coutour (envelop) of the audio stream.
+ """
+
+ implements(IGrapher)
+
+ @interfacedoc
+ def __init__(self, width=1024, height=256, bg_color=(255,255,255), color_scheme='default'):
+ super(WaveformContourWhite, self).__init__(width, height, bg_color, color_scheme)
+ self.color_offset = 60
+
+ @staticmethod
+ @interfacedoc
+ def id():
+ return "waveform_contour_white"
+
+ @staticmethod
+ @interfacedoc
+ def name():
+ return "Contour white"
+++ /dev/null
-# -*- coding: utf-8 -*-
-#
-# Copyright (c) 2007-2010 Guillaume Pellerin <yomguy@parisson.com>
-# Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.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/>.
-
-
-from timeside.core import Processor, implements, interfacedoc, FixedSizeInputAdapter
-from timeside.api import IGrapher
-from timeside.grapher.core import *
-from timeside.grapher.waveform_simple import Waveform
-
-
-class WaveformContourBlack(Waveform):
-
- implements(IGrapher)
-
- @interfacedoc
- def __init__(self, width=1024, height=256, bg_color=(0,0,0), color_scheme='default'):
- super(WaveformContourBlack, self).__init__(width, height, bg_color, color_scheme)
- self.contour = numpy.zeros(self.image_width)
- self.ndiv = 4
- self.x = numpy.r_[0:self.image_width-1:1]
- self.symetry = True
- self.color_offset = 160
-
- @staticmethod
- @interfacedoc
- def id():
- return "waveform_contour_black"
-
- @staticmethod
- @interfacedoc
- def name():
- return "Contour black"
-
- @interfacedoc
- def setup(self, channels=None, samplerate=None, blocksize=None, totalframes=None):
- super(WaveformContourBlack, self).setup(channels, samplerate, blocksize, totalframes)
-
- @interfacedoc
- def process(self, frames, eod=False):
- if len(frames) != 1:
- buffer = frames[:,0].copy()
- buffer.shape = (len(buffer),1)
- for samples, end in self.pixels_adapter.process(buffer, eod):
- if self.pixel_cursor < self.image_width:
- self.contour[self.pixel_cursor] = numpy.max(peaks(samples))
- self.pixel_cursor += 1
- if eod:
- self.draw_peaks_contour()
- return frames, eod
+++ /dev/null
-# -*- coding: utf-8 -*-
-#
-# Copyright (c) 2007-2010 Guillaume Pellerin <yomguy@parisson.com>
-# Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.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/>.
-
-
-from timeside.core import Processor, implements, interfacedoc, FixedSizeInputAdapter
-from timeside.api import IGrapher
-from timeside.grapher.core import *
-from timeside.grapher.waveform_contour_black import WaveformContourBlack
-
-
-class WaveformContourWhite(WaveformContourBlack):
-
- implements(IGrapher)
-
- @interfacedoc
- def __init__(self, width=1024, height=256, bg_color=(255,255,255), color_scheme='default'):
- super(WaveformContourWhite, self).__init__(width, height, bg_color, color_scheme)
- self.color_offset = 60
-
- @staticmethod
- @interfacedoc
- def id():
- return "waveform_contour_white"
-
- @staticmethod
- @interfacedoc
- def name():
- return "Contour white"
-
- @interfacedoc
- def setup(self, channels=None, samplerate=None, blocksize=None, totalframes=None):
- super(WaveformContourWhite, self).setup(channels, samplerate, blocksize, totalframes)
class Waveform(Grapher):
- """ Builds a PIL image representing a waveform of the audio stream.
- Adds pixels iteratively thanks to the adapter providing fixed size frame buffers.
+ """ Builds a PIL image representing a simple waveform of the audio stream.
"""
implements(IGrapher)
class WaveformTransparent(Waveform):
- """ Builds a PIL image representing a waveform of the audio stream.
- Adds pixels iteratively thanks to the adapter providing fixed size frame buffers.
+ """ Builds a PIL image representing a transparent waveform of the audio stream.
"""
implements(IGrapher)