Mercurial > hg > c4dm-chord-transcriptions
comparison evaluationtools/striproot.m @ 1:8973548174c1 tip
adding tools to repo
author | christopherh |
---|---|
date | Mon, 06 May 2013 14:43:47 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:0a4ad3e72e75 | 1:8973548174c1 |
---|---|
1 | |
2 function chord = striproot(chordinput,rootc) | |
3 | |
4 if nargin<2 | |
5 rootc=0; | |
6 end | |
7 | |
8 | |
9 [rootnote, shorthand, intervals, bass, success, errormessage] = parsechord(chordinput); | |
10 | |
11 if strcmp(rootnote, 'N') | |
12 chord = 'N'; | |
13 else | |
14 if isempty(shorthand) && isempty(intervals) | |
15 chord = 'X'; | |
16 elseif isempty(intervals) | |
17 chord = ['X:' shorthand]; | |
18 elseif isempty(shorthand) | |
19 chord = ['X:(' intervals ')']; | |
20 else | |
21 chord = ['X:' shorthand '(' intervals ')']; | |
22 end | |
23 | |
24 if ~isempty(bass) | |
25 chord = [chord '/' bass]; | |
26 end | |
27 | |
28 if rootc | |
29 chord(1) = 'C'; | |
30 end | |
31 end | |
32 | |
33 |