# HG changeset patch # User Mathieu Lagrange # Date 1426581253 -3600 # Node ID b1901e8d8f5fcca494c0ada9711ada7ec68c8623 initial commit diff -r 000000000000 -r b1901e8d8f5f demo.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demo.m Tue Mar 17 09:34:13 2015 +0100 @@ -0,0 +1,72 @@ +% SimScene is a set of Matlab functions dedicated to the simulation of acoustic scenes. +% This tool is specifically tailored to the evaluation of machine listening systems. +% Thus, extensive and precise annotation of the scene content is provided together with the simulated scene. +% +% This tool is a research tool, provided as-is with the hope that it will be +% useful and easy to adapt to the needs of others. Do not hesitate to provide +% us with feedback at the following mail address: mathieu.lagrange@cnrs.fr +% +% SimScene have been tested on Matlab R2013b. The input audio files must be sampled at 44100 Hz. + +% clear all; +% close all; + +inputPath='./sound/'; +outputPath='./results/'; + +%% timeMode: 'generate' -- ebrMode: 'generate' + +timeMode='generate'; +ebrMode='generate'; +sceneDuration=15; + +score.sceneDuration=sceneDuration; +score.backgrounds={{'forest','forest', 1}}; +score.events={{'alouette','alouette', 12, 0, 2, 0.1, 1, 10, 0, 0},... + {'bulbul' ,'bulbul' , 6 , 0, 2, 0, 3, 13, 0, 0},... + {'geai' ,'geai' , 6 , 0, 1, 0.25, 5, 10, 0, 0}}; + +sceneId = ['demo_forest_timeMode_' timeMode '_ebrMode_' ebrMode]; +disp(sceneId); + +simScene(inputPath,outputPath,score,... + 'timeMode',timeMode,'ebrMode',ebrMode,'outputFileName',sceneId); + +%% timeMode: 'replicate' -- ebrMode: 'replicate' + +instanceAnnotFile='./scene2Replicate/forest.txt'; +instanceAudioFile='./scene2Replicate/forest.wav'; + +timeMode='replicate'; +ebrMode='replicate'; +sceneId = ['demo_forest_timeMode_' timeMode '_ebrMode_' ebrMode]; +disp(sceneId); + +score.backgrounds={{'forest','forest', 1}}; + +score.events={{'alouette','', -3, 0, 0, 0, 0, 0, 0, 0},... % Only change + {'bulbul','', 3, 0, 0, 0, 6, 0, 0, 0}}; % Change and + +% If score.event is of length 1 and