christopherh@1: christopherh@1: function chord = striproot(chordinput,rootc) christopherh@1: christopherh@1: if nargin<2 christopherh@1: rootc=0; christopherh@1: end christopherh@1: christopherh@1: christopherh@1: [rootnote, shorthand, intervals, bass, success, errormessage] = parsechord(chordinput); christopherh@1: christopherh@1: if strcmp(rootnote, 'N') christopherh@1: chord = 'N'; christopherh@1: else christopherh@1: if isempty(shorthand) && isempty(intervals) christopherh@1: chord = 'X'; christopherh@1: elseif isempty(intervals) christopherh@1: chord = ['X:' shorthand]; christopherh@1: elseif isempty(shorthand) christopherh@1: chord = ['X:(' intervals ')']; christopherh@1: else christopherh@1: chord = ['X:' shorthand '(' intervals ')']; christopherh@1: end christopherh@1: christopherh@1: if ~isempty(bass) christopherh@1: chord = [chord '/' bass]; christopherh@1: end christopherh@1: christopherh@1: if rootc christopherh@1: chord(1) = 'C'; christopherh@1: end christopherh@1: end christopherh@1: christopherh@1: