mathieu@34
|
1 function cmap = pleasantnessColormap (sceneObjects)
|
mathieu@34
|
2 % returns a colormap following pleasantness indicators
|
mathieu@34
|
3 % red: mechanical sounds
|
mathieu@34
|
4 % blue: human sounds
|
mathieu@34
|
5 % yellow: animal sounds
|
mathieu@34
|
6
|
mathieu@34
|
7 % Background sounds will have a saturation of .3, foreground sounds of 1
|
mathieu@34
|
8 % Value is always let to .5, since modifying it would erroneously suggest
|
mathieu@34
|
9 % a difference of intensity
|
mathieu@34
|
10
|
mathieu@34
|
11 % This program was written by Mathias Rossignol & Grégoire Lafay
|
mathieu@34
|
12 % is Copyright (C) 2015 IRCAM <http://www.ircam.fr>
|
mathieu@34
|
13 %
|
mathieu@34
|
14 % This program is free software: you can redistribute it and/or modify it
|
mathieu@34
|
15 % under the terms of the GNU General Public License as published by the Free
|
mathieu@34
|
16 % Software Foundation, either version 3 of the License, or (at your option)
|
mathieu@34
|
17 % any later version.
|
mathieu@34
|
18 %
|
mathieu@34
|
19 % This program is distributed in the hope that it will be useful, but
|
mathieu@34
|
20 % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
mathieu@34
|
21 % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
mathieu@34
|
22 % for more details.
|
mathieu@34
|
23 %
|
mathieu@34
|
24 % You should have received a copy of the GNU General Public License along
|
mathieu@34
|
25 % with this program. If not, see <http://www.gnu.org/licenses/>.
|
mathieu@34
|
26
|
mathieu@34
|
27 nbTracks = length(sceneObjects);
|
mathieu@34
|
28
|
mathieu@34
|
29 classLabels = {'train' 'crowd' 'schoolyard', 'traffic', 'park', 'stepPark', 'scooter', 'moto', 'bike', 'subway', 'bus', 'streetNoise', 'hammer', 'barrier', 'glassNoise', 'waterNoise', 'cutleryNoise', 'keys', 'music', 'brake', 'pneumaticBlast', 'bip', 'whistle', 'zip', 'voice', 'baby', 'cityCar', 'truck', 'carHorn', 'constructionSite', 'coughing', 'stopCar', 'doorCar', 'siren', 'doorHouse', 'bird', 'dog', 'cityStep', 'bell', 'broom', 'suitcase', 'plane'};
|
mathieu@34
|
30 classType = [0 1 1 0 2 1 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 2 2 1 1 0 1 0]+1;
|
mathieu@34
|
31
|
mathieu@34
|
32 % for k=1:length(classLabels)
|
mathieu@34
|
33 % fprintf('%s ', [classLabels{k} ' ' num2str(classType(k))])
|
mathieu@34
|
34 % end
|
mathieu@34
|
35
|
mathieu@34
|
36 hues = [0 240 66]/360;
|
mathieu@34
|
37 % Generate a colormap:
|
mathieu@34
|
38 for c=1:nbTracks
|
mathieu@34
|
39 % sceneObjects(c).classLabel
|
mathieu@34
|
40 idx = find(contains(classLabels, sceneObjects(c).classLabel));
|
mathieu@34
|
41 % classType(idx)
|
mathieu@34
|
42 if isempty(idx)
|
mathieu@34
|
43 % disp(sceneObjects(c).classLabel)
|
mathieu@34
|
44 cmap(c,:) = zeros(1, 3);
|
mathieu@34
|
45 else
|
mathieu@34
|
46 % if (sceneObjects(c).isBackground)
|
mathieu@34
|
47 % cmap(c,:) = hsl2rgb([hues(classType(idx)), .7, .5]);
|
mathieu@34
|
48 % else
|
mathieu@34
|
49 cmap(c,:) = hsl2rgb([hues(classType(idx)), 1, .5]);
|
mathieu@34
|
50 end
|
mathieu@34
|
51 % end
|
mathieu@34
|
52 end |