mathieu@14: function [] = simScene(inputPath,outputPath,score,varargin) mathieu@14: % [] = simScene(inputPath,outputPath,score,[opts ... ]) mathieu@14: % mathieu@14: % Generate a simulated auditory scene by mixing randomly chosen samples. mathieu@14: % The samples and their mixing properties are chosen partially randomly mathieu@14: % following user-provided guidelines. mathieu@14: % mathieu@14: % Required input variables are: mathieu@14: % mathieu@14: % - inputPath: a dataset of isolated sound events and backgrounds mathieu@14: % respectively located in inputPat/event/ and mathieu@14: % inputPat/background mathieu@14: % mathieu@14: % - outputPath: the repository where simscene will write the simulated scene mathieu@14: % as well as the annotations mathieu@14: % mathieu@14: % - score: a structure describing the scene to simulate mathieu@14: % mathieu@14: % score.sceneDuration: length of the simulated scene in second mathieu@14: % mathieu@14: % score.backgrounds: Backgrounds are continuous sounds that keep going mathieu@14: % over the whole duration of the scene. Several background samples mathieu@14: % may be mixed together. If 'sceneDuration' is more than the mathieu@14: % natural length of one of the selected bg sounds, they will be mathieu@14: % looped as necessary -- that may not sound great, depending on the mathieu@14: % sound... The format of the 'background' field controlling their mathieu@14: % selection and use is: mathieu@14: % mathieu@14: % {{'','', 1}, mathieu@14: % {'','', }...} mathieu@14: % mathieu@14: % The value of 'snr' is ignored for the first bg sound. For the mathieu@14: % following ones, it will be evaluated against the sum of the mathieu@14: % previous ones. The value of 'Label' is the label of the mathieu@14: % background track. Simscene will use the value 'sampleId' to load mathieu@14: % the background sample(s) located in inputpath/background. mathieu@14: % Simscene will only use background sample(s) having a name mathieu@14: % containing the value 'sampleId'. mathieu@14: % mathieu@14: % score.events: The 'events' is an array of cell arrays containg data use mathieu@14: % to simulated the scenes. Event contains the following data: mathieu@14: % mathieu@14: % {{'', mathieu@14: % '', mathieu@14: % , mathieu@14: % , mathieu@14: % , mathieu@14: % , mathieu@14: % , mathieu@14: % , mathieu@14: % , mathieu@14: % }, mathieu@14: % {' ...}, mathieu@14: % {' ...} mathieu@14: % ...} mathieu@14: % mathieu@14: % If is 0, then it will be set to the mathieu@14: % sample length (so if is also 0, mathieu@14: % the sample will be looped). mathieu@14: % If is -1, then the sound will be mathieu@14: % played just once. The considered EBR value is the maximum EBR mathieu@14: % of the fg sample relative to the bg on windows of 1000 samples. mathieu@14: % The considered bg for this is the mix of all specified bgs. mathieu@14: % mathieu@14: % This version of simscene allows a lot of options to be controlled, as mathieu@14: % optional 'name', value pairs from the 4th argument. Here is a brief mathieu@14: % description of the optional parameters: gregoirelafay@17: % save pictures without displaying them mathieu@14: % - timeMode: control a time spacing between events. mathieu@14: % 'generate' (default): values must be set for each track using the mathieu@14: % score control structure mathieu@14: % 'abstract': values are computed from an abstract representation of mathieu@14: % an existing acoustic scene given as parameter mathieu@14: % 'replicate': values are replicated from an existing acoustic scene mathieu@14: % given as parameter mathieu@14: % mathieu@14: % - ebrMode: control the Event to Background power level Ratio (EBR) of events. mathieu@14: % Possible options are: 'generate' (default), 'abstract', 'replicate', see above. mathieu@14: % mathieu@14: % If ebrMode is set to 'replicate' or 'abstract', and score.events exist, mathieu@14: % simScene will use the values and as offsets for mathieu@14: % the class