function [labels_simplified] = simplify_chord_annotations(labels);
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Simplifies Chord Annotation by Harte
%
% Verena Konz 10.08.2009
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%labels = [char(labels)];
labels_simplified = cell(size(labels,1),1);
for labelindex = 1: size(labels,1)
     if length(labels{labelindex}) == 1
         labels_simplified(labelindex)=labels(labelindex);
         continue;
     end
    minortest = findstr(labels{labelindex}, 'min');
    if isempty(minortest) == 0
        if strcmp(labels{labelindex}(2), 'b')== 1;
            labels_simplified{labelindex}(1:6) = labels{labelindex}(1:6);
        elseif  strcmp(labels{labelindex}(2), '#')== 1;
            labels_simplified{labelindex}(1:6) = labels{labelindex}(1:6);
        else
            labels_simplified{labelindex}(1:5) = labels{labelindex}(1:5);
        end
    else
        if strcmp(labels{labelindex}(2), 'b')== 1;
            labels_simplified{labelindex}(1:2) = labels{labelindex}(1:2);
        elseif strcmp(labels{labelindex}(2), '#')== 1;
            labels_simplified{labelindex}(1:2) = labels{labelindex}(1:2);
        else labels_simplified{labelindex}(1) = labels{labelindex}(1);
        end
    end
end


   



