diff simScene.m @ 17:fc99c676c280

add channel option; add figure hide option
author gregoire lafay <gregoirelafay@sfr.fr>
date Wed, 06 Jan 2016 19:29:35 +0100
parents 92f73423eb37
children ce14979b84f8
line wrap: on
line diff
--- a/simScene.m	Wed Jan 06 18:04:24 2016 +0100
+++ b/simScene.m	Wed Jan 06 19:29:35 2016 +0100
@@ -65,7 +65,7 @@
 %  This version of simscene allows a lot of options to be controlled, as
 %  optional  'name', value pairs from the 4th argument. Here is a brief 
 %  description of the optional parameters:
-% 
+% save pictures without displaying them
 %  - timeMode: control a time spacing between events. 
 %  		'generate' (default): values must be set for each track using the 
 %                             score control structure
@@ -100,11 +100,17 @@
 %                       or 'replicate', this parameter is the path to the wav 
 %                       file of the reference scene sampled at 44100 Hz.
 %  
-%  - figuresOption: (default 1) save and show pictures (piano roll, time domain stacked visualization, overlaid spectrogram)
+%  - figure: (default 0) save and show pictures (piano roll, time domain stacked visualization, overlaid spectrogram)
 %             0: don't save or display pictures
 %             1: save pictures without displaying them
 %             2: save and display pictures
 %
+%  - channel: (default 0) number of audio channels contained in the file
+%             0: 1 channel (mono)
+%             1: As many channel as sound classes (events+textures)
+%             2: As many channel as sound classes (events+textures). Each
+%                channel is saved in a separated wav file.
+%
 %  - outputFileName: name of generated files with no extension
 %  
 %  - sampleChoice: method for choosing sample to schedule within a track
@@ -155,7 +161,7 @@
 
 addpath(genpath('nonExposed'));
 
-[timeMode,ebrMode,instanceAnnotFile,instanceAudioFile,figuresOption,sampleChoice,outputFileName,minSpace,endCut,eventInfoPath,norm]=process_options(varargin,'timeMode','generate','ebrMode','generate','instanceAnnotFile','none','instanceAudioFile','none','figuresOption',1,'sampleChoice','random','outputFileName','simulatedScene','minSpace',-1,'endCut',0,'eventInfoPath','','norm',0);
+[timeMode,ebrMode,instanceAnnotFile,instanceAudioFile,figuresOption,sampleChoice,outputFileName,minSpace,endCut,eventInfoPath,norm,channelsOption]=process_options(varargin,'timeMode','generate','ebrMode','generate','instanceAnnotFile','none','instanceAudioFile','none','figure',0,'sampleChoice','random','outputFileName','simulatedScene','minSpace',-1,'endCut',0,'eventInfoPath','','norm',0,'channel',0);
 
 sr=44100;
 
@@ -204,7 +210,7 @@
     mkdir([outputPath,'annotation'])
 end
 
-[simsSceneWav,sceneSchedule] = generateScene(sceneSchedule,sceneObjects,score,inputPath,outputPath,outputFileName,figuresOption,timeMode,endCut,norm,sr);
+[sceneSchedule] = generateScene(sceneSchedule,sceneObjects,score,inputPath,outputPath,outputFileName,figuresOption,timeMode,endCut,norm,sr,channelsOption);
 
 %% Check simulated scene
 
@@ -214,6 +220,4 @@
     checkOverlapping(sceneSchedule,score.sceneDuration)
 end
 
-%% Generate Sound
-audiowrite([outputPath,'sound/',outputFileName,'.wav'],simsSceneWav,sr);
 end