christopherh@1: %INDICTIONARY christopherh@1: %found = indictionary(chord, dictionary, cardinality) christopherh@1: christopherh@1: christopherh@1: christopherh@1: function found = indictionary(chord, dictionary, comparison, cardinality) christopherh@1: christopherh@1: found = 0; christopherh@1: christopherh@1: switch lower(comparison) christopherh@1: case 'ov' christopherh@1: % pnset comparison used so inclusion should be calculated with christopherh@1: % rlsets christopherh@1: comp = 'oi'; christopherh@1: christopherh@1: case 'op' christopherh@1: % pcset comparison used so inclusion should be calculated with christopherh@1: % rcsets christopherh@1: comp = 'or'; christopherh@1: christopherh@1: otherwise christopherh@1: % assume this is not a dictionary evaluation christopherh@1: found = 1; christopherh@1: end christopherh@1: christopherh@1: if ~found christopherh@1: christopherh@1: if isempty(dictionary) christopherh@1: found = 1; christopherh@1: christopherh@1: else christopherh@1: christopherh@1: chordslength = length(dictionary); christopherh@1: christopherh@1: chord = striproot(chord); christopherh@1: christopherh@1: christopherh@1: for indexc = 1:chordslength christopherh@1: christopherh@1: %do a comparison of the current chord symbol and a member of the christopherh@1: %found list christopherh@1: [found, success, error] = comparechords2(chord, dictionary{indexc}, comp, cardinality,0); christopherh@1: christopherh@1: if ~success christopherh@1: display(error) christopherh@1: end christopherh@1: christopherh@1: % if found = 1 christopherh@1: if found christopherh@1: % exit because the chord is in the dictionary christopherh@1: break; christopherh@1: end christopherh@1: christopherh@1: end christopherh@1: end christopherh@1: end