Overview » History » Version 10
Version 9 (Emmanouil Theofanis Chourdakis, 2017-10-04 08:09 PM) → Version 10/15 (Emmanouil Theofanis Chourdakis, 2017-10-05 10:23 AM)
h1. SimScene.py -
h2. An acoustic pattern generation tool
Copyright (c) Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk>
SimScene.py is a collection of tools to synthesize an audio scene from independent sound events.
It is inspired by Lagrange et al. simScene (https://bitbucket.org/mlagrange/simscene) but takes
a different direction. The goal of SimScene.py simScene.py is to (1) have a python implementation of such a
system since python is the platform of choice for developers accustomed with deep learning packages
or other python package candy and (2) to allow generating audio scenes from graph-based patterns.
*Currently it can only batch-generate The original simscene.m is used in the following paper:
Lafay, G., Lagrange, M., Rossignol, M., Benetos, E. and Roebel, A., 2016.
A morphological model for simulating acoustic scenes with target EBRs*
and its application to sound event detection.
IEEE/ACM Transactions on Audio, Speech, and Language Processing, 24(10), pp.1854-1864.
Please direct any comments, suggestions, etc. to Emmanouil Chourdakis <e.t.chourdakis@qmul.ac.uk>
This code is licensed under GPLv3. Please see LICENSE for more info.
h2. Usage *Screenshot:*
The best way to show usage of the tool is through an example of generating 10 scenes of bird sounds in the forest. First, clone this repository in a directory (requires mercurial): !logo.png!
@hg clone https://code.soundsoftware.ac.uk/hg/simscene-py@
Then install the necessary libraries
@pip install -r requirements.txt@
Then open the files _forest_backgrounds.xls_ and _forest_events.xls_ in the _examples_ folder which contain information about the event and background tracks (for now do not change them, just see that you can open them). Note that you can view the same files as _.txt_ files in the same directory. SimScene.py allows both formats.
Here is a preview of the _forest_backgrounds.xls_ in Calc: *Audio:*
!forest_backgrounds.png! full-scene.wav (link below)
An explanation of the fields follows:
Usage examples:
* *label* - The name of the track
* *sampleid* - Prefix of the filename the track uses. If there are many files with _sampleid_ as their prefix, one as random is picked ./simscene.py -h
Displays command line syntax and used for generation.
option descriptions.
* *snr* - For the first row, it is just the amplitude of that track. For the second row ./simscene.py ../simscene-input/sound ../simscene-output 15 -e ../simscene-input/forest_events.txt -vv
Reads sounds from `../simscene-input/sound', and below, it is the SNR (not dB) of the track of that row, relative to the sum of the other tracks.
Backgrounds sounds are _looped_ throughout the scene.
The events file (_forest_events.xls_) is creates a bit more complicated:
!forest_events.png!
* *label* and *sampleid* - same as above.
* *ebr* - The desired Energy-to-background ratio relative to the sum 15 second scene of the background tracks.
* *ebr_stddev* - How much the desired EBR can deviate (standard deviation).
* *mean_time_between_events* - The mean time successive events of that type can occur. Note that it is the mean time between successive start_times unless that value is zero. In that case, the next events starts right after the previous events finishes.
* *time_between_events_stddev* - The standard deviation of the starting times of successive events.
* *start_time* - The starting time of the track. Note that this is different than the starting time of individual event sounds (in seconds).
* *end_time* - The ending time of the track (in seconds).
* *fade_in_time/fade_out_time* - Fade Event options are given in ../simscene-input/forest_events.txt. Finally, generates and out times of individual sound events in seconds.
After viewing those files, we can generate an acoustic scene and generate some displays plots on the screen. First of all, create a directory to save the resulting files:
@mkdir output@
Then run simscene.py
@./simscene.py example/sound/ output/ 10 -e example/forest_events.xls -b example/forest_backgrounds.xls -vvv@
And it will show on screen some plots, (waveforms, spectrograms and also generate some files in the _output_ directory. Go on and listen piano rolls). Saves everything to it! Some explanations:
* _example/sound/_ is a directory containing event sounds in _example/sound/event_ and background sounds in _example/sound/background_. ../simscene-output.
* _output/_ is the files where generated plots and audio files reside.
* 10 is the duration of the scene in seconds. In our case, 10 seconds.
* *-e* is a switch pointing at the event file (see above).
* *-b* is a switch pointing at the background file (see above).
* *-vvv* Is the maximum verbosity level which will show piano roll, will shade over individual events and also plot them on screen.
It will generate plots like this one:
!scene.png!
It can also generate 5 instances of the same scene at once with:
@./simscene.py example/sound/ output/ 10 -e example/forest_events.xls -b example/forest_backgrounds.xls -vv -N 5@
Note that you cannot use *-vvv* when using the *-N* switch (it will be ignored).
h2. An acoustic pattern generation tool
Copyright (c) Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk>
SimScene.py is a collection of tools to synthesize an audio scene from independent sound events.
It is inspired by Lagrange et al. simScene (https://bitbucket.org/mlagrange/simscene) but takes
a different direction. The goal of SimScene.py simScene.py is to (1) have a python implementation of such a
system since python is the platform of choice for developers accustomed with deep learning packages
or other python package candy and (2) to allow generating audio scenes from graph-based patterns.
*Currently it can only batch-generate The original simscene.m is used in the following paper:
Lafay, G., Lagrange, M., Rossignol, M., Benetos, E. and Roebel, A., 2016.
A morphological model for simulating acoustic scenes with target EBRs*
and its application to sound event detection.
IEEE/ACM Transactions on Audio, Speech, and Language Processing, 24(10), pp.1854-1864.
Please direct any comments, suggestions, etc. to Emmanouil Chourdakis <e.t.chourdakis@qmul.ac.uk>
This code is licensed under GPLv3. Please see LICENSE for more info.
h2. Usage *Screenshot:*
The best way to show usage of the tool is through an example of generating 10 scenes of bird sounds in the forest. First, clone this repository in a directory (requires mercurial): !logo.png!
@hg clone https://code.soundsoftware.ac.uk/hg/simscene-py@
Then install the necessary libraries
@pip install -r requirements.txt@
Then open the files _forest_backgrounds.xls_ and _forest_events.xls_ in the _examples_ folder which contain information about the event and background tracks (for now do not change them, just see that you can open them). Note that you can view the same files as _.txt_ files in the same directory. SimScene.py allows both formats.
Here is a preview of the _forest_backgrounds.xls_ in Calc: *Audio:*
!forest_backgrounds.png! full-scene.wav (link below)
An explanation of the fields follows:
Usage examples:
* *label* - The name of the track
* *sampleid* - Prefix of the filename the track uses. If there are many files with _sampleid_ as their prefix, one as random is picked ./simscene.py -h
Displays command line syntax and used for generation.
option descriptions.
* *snr* - For the first row, it is just the amplitude of that track. For the second row ./simscene.py ../simscene-input/sound ../simscene-output 15 -e ../simscene-input/forest_events.txt -vv
Reads sounds from `../simscene-input/sound', and below, it is the SNR (not dB) of the track of that row, relative to the sum of the other tracks.
Backgrounds sounds are _looped_ throughout the scene.
The events file (_forest_events.xls_) is creates a bit more complicated:
!forest_events.png!
* *label* and *sampleid* - same as above.
* *ebr* - The desired Energy-to-background ratio relative to the sum 15 second scene of the background tracks.
* *ebr_stddev* - How much the desired EBR can deviate (standard deviation).
* *mean_time_between_events* - The mean time successive events of that type can occur. Note that it is the mean time between successive start_times unless that value is zero. In that case, the next events starts right after the previous events finishes.
* *time_between_events_stddev* - The standard deviation of the starting times of successive events.
* *start_time* - The starting time of the track. Note that this is different than the starting time of individual event sounds (in seconds).
* *end_time* - The ending time of the track (in seconds).
* *fade_in_time/fade_out_time* - Fade Event options are given in ../simscene-input/forest_events.txt. Finally, generates and out times of individual sound events in seconds.
After viewing those files, we can generate an acoustic scene and generate some displays plots on the screen. First of all, create a directory to save the resulting files:
@mkdir output@
Then run simscene.py
@./simscene.py example/sound/ output/ 10 -e example/forest_events.xls -b example/forest_backgrounds.xls -vvv@
And it will show on screen some plots, (waveforms, spectrograms and also generate some files in the _output_ directory. Go on and listen piano rolls). Saves everything to it! Some explanations:
* _example/sound/_ is a directory containing event sounds in _example/sound/event_ and background sounds in _example/sound/background_. ../simscene-output.
* _output/_ is the files where generated plots and audio files reside.
* 10 is the duration of the scene in seconds. In our case, 10 seconds.
* *-e* is a switch pointing at the event file (see above).
* *-b* is a switch pointing at the background file (see above).
* *-vvv* Is the maximum verbosity level which will show piano roll, will shade over individual events and also plot them on screen.
It will generate plots like this one:
!scene.png!
It can also generate 5 instances of the same scene at once with:
@./simscene.py example/sound/ output/ 10 -e example/forest_events.xls -b example/forest_backgrounds.xls -vv -N 5@
Note that you cannot use *-vvv* when using the *-N* switch (it will be ignored).