py_sonicvisualiser is a framework for manipulating environment files to be used with sonic visualiser, and application for viewing and analysing the contents of music audio files http://www.sonicvisualiser.org/
This module is currently restricted to the generation of sonic visualiser environment files (export). Parsing (import) of such files will be hopefully supported in the next releases. Feel free to contribute if you like this project!
Latest source files: https://github.com/DavidDoukhan/py_sonicvisualiser
Package: https://pypi.python.org/pypi/py_sonicvisualiser
Documentation: http://pythonhosted.org/py_sonicvisualiser
This class allows to generate sonic visualiser environment files
Init a sonic visualiser environment structure
add a continous annotation layer
add a labelled interval annotation layer
add a spectrogram layer to the environment
Save the environment of a sv file to be used with soniv visualiser
import sys
import numpy as np
from py_sonicvisualiser import SVEnv
wavfname = sys.argv[1]
outsvenvfname = sys.argv[2]
# init a sonic visualiser environment file corresponding
# to the analysis of media wavfname
sve = SVEnv(wavfname)
# append a spectrogram view
specview = sve.add_spectrogram()
# append a continuous annotation layer corresponding to a sinusoidal signal
# on the spectrogram view previously defined
x = np.array(range(10000, 20000, 5)) / 1000.
sve.add_continuous_annotations(x, 1 + 3 * np.sin(2 * x), view=specview)
# append a labelled interval annotation layer on a new view
intvtime = [1., 5., 21.5]
intvdur = [3., 11., 5.]
intvlabel = ['myintv1', 'mywonderfull intv2', 'intv3']
intvval = [0, 1, 5]
sve.add_interval_annotations(intvtime,intvdur,intvlabel,intvval)
# save the environment to a sonic visualiser environment file
sve.save(outsvenvfname)
David Doukhan - LIMSI-CNRS - doukhan@limsi.fr - david.doukhan@gmail.com
This module has been initiated the framework of the ANR Project DIADEMS http://www.irit.fr/recherches/SAMOVA/DIADEMS