mathieu@34: function cmap = pleasantnessColormap (sceneObjects) mathieu@34: % returns a colormap following pleasantness indicators mathieu@34: % red: mechanical sounds mathieu@34: % blue: human sounds mathieu@34: % yellow: animal sounds mathieu@34: mathieu@34: % Background sounds will have a saturation of .3, foreground sounds of 1 mathieu@34: % Value is always let to .5, since modifying it would erroneously suggest mathieu@34: % a difference of intensity mathieu@34: mathieu@34: % This program was written by Mathias Rossignol & Grégoire Lafay mathieu@34: % is Copyright (C) 2015 IRCAM mathieu@34: % mathieu@34: % This program is free software: you can redistribute it and/or modify it mathieu@34: % under the terms of the GNU General Public License as published by the Free mathieu@34: % Software Foundation, either version 3 of the License, or (at your option) mathieu@34: % any later version. mathieu@34: % mathieu@34: % This program is distributed in the hope that it will be useful, but mathieu@34: % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY mathieu@34: % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mathieu@34: % for more details. mathieu@34: % mathieu@34: % You should have received a copy of the GNU General Public License along mathieu@34: % with this program. If not, see . mathieu@34: mathieu@34: nbTracks = length(sceneObjects); mathieu@34: mathieu@34: 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: 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: mathieu@34: % for k=1:length(classLabels) mathieu@34: % fprintf('%s ', [classLabels{k} ' ' num2str(classType(k))]) mathieu@34: % end mathieu@34: mathieu@34: hues = [0 240 66]/360; mathieu@34: % Generate a colormap: mathieu@34: for c=1:nbTracks mathieu@34: % sceneObjects(c).classLabel mathieu@34: idx = find(contains(classLabels, sceneObjects(c).classLabel)); mathieu@34: % classType(idx) mathieu@34: if isempty(idx) mathieu@34: % disp(sceneObjects(c).classLabel) mathieu@34: cmap(c,:) = zeros(1, 3); mathieu@34: else mathieu@34: % if (sceneObjects(c).isBackground) mathieu@34: % cmap(c,:) = hsl2rgb([hues(classType(idx)), .7, .5]); mathieu@34: % else mathieu@34: cmap(c,:) = hsl2rgb([hues(classType(idx)), 1, .5]); mathieu@34: end mathieu@34: % end mathieu@34: end