changeset 1:8973548174c1 tip

adding tools to repo
author christopherh
date Mon, 06 May 2013 14:43:47 +0100
parents 0a4ad3e72e75
children
files beatles_info/beatles_A_paths.txt chordtools/addshort2list.m chordtools/checklabs.m chordtools/checklabsyntax.m chordtools/checkomissions.m chordtools/chord2fifthpositions.m chordtools/chord2midinotes.m chordtools/chord2notes.m chordtools/chord2pitchclasses.m chordtools/chord2quality.m chordtools/contents.m chordtools/degree2interval.m chordtools/degree2semitone.m chordtools/getchordinfo.m chordtools/interval2note.m chordtools/interval2rcclass.m chordtools/interval2semitone.m chordtools/intervals2notes.m chordtools/intervals2quality.m chordtools/intervals2semitones.m chordtools/labread.m chordtools/labwrite.m chordtools/mlf2lab.m chordtools/note2fifthinfo.m chordtools/note2fifthposition.m chordtools/note2interval.m chordtools/note2pitchclass.m chordtools/notes2fifthpositions.m chordtools/notes2pitchclasses.m chordtools/parsechord.m chordtools/parseinterval.m chordtools/parseintervals.m chordtools/parsenote.m chordtools/short2quality.m chordtools/shorthand2intervals.m chordtools/syntaxcheck.m chordtools/testlog.log chordtools/testlog2.log chordtools/types.m evaluationtools/cell2list.m evaluationtools/comparechords.m evaluationtools/compareorderedsets.m evaluationtools/compareunorderedsets.m evaluationtools/format_recall_results.m evaluationtools/get_all_recall_results.m evaluationtools/get_all_seg_results.m evaluationtools/getrecall.m evaluationtools/indictionary.m evaluationtools/merge_repeats.m evaluationtools/mxmap.m evaluationtools/printfile.m evaluationtools/readlist.m evaluationtools/stripinversion.m evaluationtools/striproot.m
diffstat 54 files changed, 5573 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/beatles_info/beatles_A_paths.txt	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,181 @@
+01_-_Please_Please_Me/01_-_I_Saw_Her_Standing_There.lab
+01_-_Please_Please_Me/02_-_Misery.lab
+01_-_Please_Please_Me/03_-_Anna_(Go_To_Him).lab
+01_-_Please_Please_Me/04_-_Chains.lab
+01_-_Please_Please_Me/05_-_Boys.lab
+01_-_Please_Please_Me/06_-_Ask_Me_Why.lab
+01_-_Please_Please_Me/07_-_Please_Please_Me.lab
+01_-_Please_Please_Me/08_-_Love_Me_Do.lab
+01_-_Please_Please_Me/09_-_P._S._I_Love_You.lab
+01_-_Please_Please_Me/10_-_Baby_It's_You.lab
+01_-_Please_Please_Me/11_-_Do_You_Want_To_Know_A_Secret.lab
+01_-_Please_Please_Me/12_-_A_Taste_Of_Honey.lab
+01_-_Please_Please_Me/13_-_There's_A_Place.lab
+01_-_Please_Please_Me/14_-_Twist_And_Shout.lab
+02_-_With_the_Beatles/01_-_It_Won't_Be_Long.lab
+02_-_With_the_Beatles/02_-_All_I've_Got_To_Do.lab
+02_-_With_the_Beatles/03_-_All_My_Loving.lab
+02_-_With_the_Beatles/04_-_Don't_Bother_Me.lab
+02_-_With_the_Beatles/05_-_Little_Child.lab
+02_-_With_the_Beatles/06_-_Till_There_Was_You.lab
+02_-_With_the_Beatles/07_-_Please_Mister_Postman.lab
+02_-_With_the_Beatles/08_-_Roll_Over_Beethoven.lab
+02_-_With_the_Beatles/09_-_Hold_Me_Tight.lab
+02_-_With_the_Beatles/10_-_You_Really_Got_A_Hold_On_Me.lab
+02_-_With_the_Beatles/11_-_I_Wanna_Be_Your_Man.lab
+02_-_With_the_Beatles/12_-_Devil_In_Her_Heart.lab
+02_-_With_the_Beatles/13_-_Not_A_Second_Time.lab
+02_-_With_the_Beatles/14_-_Money.lab
+03_-_A_Hard_Day's_Night/01_-_A_Hard_Day's_Night.lab
+03_-_A_Hard_Day's_Night/02_-_I_Should_Have_Known_Better.lab
+03_-_A_Hard_Day's_Night/03_-_If_I_Fell.lab
+03_-_A_Hard_Day's_Night/04_-_I'm_Happy_Just_To_Dance_With_You.lab
+03_-_A_Hard_Day's_Night/05_-_And_I_Love_Her.lab
+03_-_A_Hard_Day's_Night/06_-_Tell_Me_Why.lab
+03_-_A_Hard_Day's_Night/07_-_Can't_Buy_Me_Love.lab
+03_-_A_Hard_Day's_Night/08_-_Any_Time_At_All.lab
+03_-_A_Hard_Day's_Night/09_-_I'll_Cry_Instead.lab
+03_-_A_Hard_Day's_Night/10_-_Things_We_Said_Today.lab
+03_-_A_Hard_Day's_Night/11_-_When_I_Get_Home.lab
+03_-_A_Hard_Day's_Night/12_-_You_Can't_Do_That.lab
+03_-_A_Hard_Day's_Night/13_-_I'll_Be_Back.lab
+04_-_Beatles_for_Sale/01_-_No_Reply.lab
+04_-_Beatles_for_Sale/02_-_I'm_a_Loser.lab
+04_-_Beatles_for_Sale/03_-_Baby's_In_Black.lab
+04_-_Beatles_for_Sale/04_-_Rock_and_Roll_Music.lab
+04_-_Beatles_for_Sale/05_-_I'll_Follow_the_Sun.lab
+04_-_Beatles_for_Sale/06_-_Mr._Moonlight.lab
+04_-_Beatles_for_Sale/07_-_Kansas_City-_Hey,_Hey,_Hey,_Hey.lab
+04_-_Beatles_for_Sale/08_-_Eight_Days_a_Week.lab
+04_-_Beatles_for_Sale/09_-_Words_of_Love.lab
+04_-_Beatles_for_Sale/10_-_Honey_Don't.lab
+04_-_Beatles_for_Sale/11_-_Every_Little_Thing.lab
+04_-_Beatles_for_Sale/12_-_I_Don't_Want_to_Spoil_the_Party.lab
+04_-_Beatles_for_Sale/13_-_What_You're_Doing.lab
+04_-_Beatles_for_Sale/14_-_Everybody's_Trying_to_Be_My_Baby.lab
+05_-_Help!/01_-_Help!.lab
+05_-_Help!/02_-_The_Night_Before.lab
+05_-_Help!/03_-_You've_Got_To_Hide_Your_Love_Away.lab
+05_-_Help!/04_-_I_Need_You.lab
+05_-_Help!/05_-_Another_Girl.lab
+05_-_Help!/06_-_You're_Going_to_Lose_That_Girl.lab
+05_-_Help!/07_-_Ticket_To_Ride.lab
+05_-_Help!/08_-_Act_Naturally.lab
+05_-_Help!/09_-_It's_Only_Love.lab
+05_-_Help!/10_-_You_Like_Me_Too_Much.lab
+05_-_Help!/11_-_Tell_Me_What_You_See.lab
+05_-_Help!/12_-_I've_Just_Seen_a_Face.lab
+05_-_Help!/13_-_Yesterday.lab
+05_-_Help!/14_-_Dizzy_Miss_Lizzy.lab
+06_-_Rubber_Soul/01_-_Drive_My_Car.lab
+06_-_Rubber_Soul/02_-_Norwegian_Wood_(This_Bird_Has_Flown).lab
+06_-_Rubber_Soul/03_-_You_Won't_See_Me.lab
+06_-_Rubber_Soul/04_-_Nowhere_Man.lab
+06_-_Rubber_Soul/05_-_Think_For_Yourself.lab
+06_-_Rubber_Soul/06_-_The_Word.lab
+06_-_Rubber_Soul/07_-_Michelle.lab
+06_-_Rubber_Soul/08_-_What_Goes_On.lab
+06_-_Rubber_Soul/09_-_Girl.lab
+06_-_Rubber_Soul/10_-_I'm_Looking_Through_You.lab
+06_-_Rubber_Soul/11_-_In_My_Life.lab
+06_-_Rubber_Soul/12_-_Wait.lab
+06_-_Rubber_Soul/13_-_If_I_Needed_Someone.lab
+06_-_Rubber_Soul/14_-_Run_For_Your_Life.lab
+07_-_Revolver/01_-_Taxman.lab
+07_-_Revolver/02_-_Eleanor_Rigby.lab
+07_-_Revolver/03_-_I'm_Only_Sleeping.lab
+07_-_Revolver/04_-_Love_You_To.lab
+07_-_Revolver/05_-_Here,_There_And_Everywhere.lab
+07_-_Revolver/06_-_Yellow_Submarine.lab
+07_-_Revolver/07_-_She_Said_She_Said.lab
+07_-_Revolver/08_-_Good_Day_Sunshine.lab
+07_-_Revolver/09_-_And_Your_Bird_Can_Sing.lab
+07_-_Revolver/10_-_For_No_One.lab
+07_-_Revolver/11_-_Doctor_Robert.lab
+07_-_Revolver/12_-_I_Want_To_Tell_You.lab
+07_-_Revolver/13_-_Got_To_Get_You_Into_My_Life.lab
+07_-_Revolver/14_-_Tomorrow_Never_Knows.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/01_-_Sgt._Pepper's_Lonely_Hearts_Club_Band.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/02_-_With_A_Little_Help_From_My_Friends.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/03_-_Lucy_In_The_Sky_With_Diamonds.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/04_-_Getting_Better.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/05_-_Fixing_A_Hole.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/06_-_She's_Leaving_Home.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/07_-_Being_For_The_Benefit_Of_Mr._Kite!.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/08_-_Within_You_Without_You.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/09_-_When_I'm_Sixty-Four.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/10_-_Lovely_Rita.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/11_-_Good_Morning_Good_Morning.lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/12_-_Sgt._Pepper's_Lonely_Hearts_Club_Band_(Reprise).lab
+08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/13_-_A_Day_In_The_Life.lab
+09_-_Magical_Mystery_Tour/01_-_Magical_Mystery_Tour.lab
+09_-_Magical_Mystery_Tour/02_-_The_Fool_On_The_Hill.lab
+09_-_Magical_Mystery_Tour/03_-_Flying.lab
+09_-_Magical_Mystery_Tour/04_-_Blue_Jay_Way.lab
+09_-_Magical_Mystery_Tour/05_-_Your_Mother_Should_Know.lab
+09_-_Magical_Mystery_Tour/06_-_I_Am_The_Walrus.lab
+09_-_Magical_Mystery_Tour/07_-_Hello_Goodbye.lab
+09_-_Magical_Mystery_Tour/08_-_Strawberry_Fields_Forever.lab
+09_-_Magical_Mystery_Tour/09_-_Penny_Lane.lab
+09_-_Magical_Mystery_Tour/10_-_Baby_You're_A_Rich_Man.lab
+09_-_Magical_Mystery_Tour/11_-_All_You_Need_Is_Love.lab
+10CD1_-_The_Beatles/CD1_-_01_-_Back_in_the_USSR.lab
+10CD1_-_The_Beatles/CD1_-_02_-_Dear_Prudence.lab
+10CD1_-_The_Beatles/CD1_-_03_-_Glass_Onion.lab
+10CD1_-_The_Beatles/CD1_-_04_-_Ob-La-Di,_Ob-La-Da.lab
+10CD1_-_The_Beatles/CD1_-_05_-_Wild_Honey_Pie.lab
+10CD1_-_The_Beatles/CD1_-_06_-_The_Continuing_Story_of_Bungalow_Bill.lab
+10CD1_-_The_Beatles/CD1_-_07_-_While_My_Guitar_Gently_Weeps.lab
+10CD1_-_The_Beatles/CD1_-_08_-_Happiness_is_a_Warm_Gun.lab
+10CD1_-_The_Beatles/CD1_-_09_-_Martha_My_Dear.lab
+10CD1_-_The_Beatles/CD1_-_10_-_I'm_So_Tired.lab
+10CD1_-_The_Beatles/CD1_-_11_-_Black_Bird.lab
+10CD1_-_The_Beatles/CD1_-_12_-_Piggies.lab
+10CD1_-_The_Beatles/CD1_-_13_-_Rocky_Raccoon.lab
+10CD1_-_The_Beatles/CD1_-_14_-_Don't_Pass_Me_By.lab
+10CD1_-_The_Beatles/CD1_-_15_-_Why_Don't_We_Do_It_In_The_Road.lab
+10CD1_-_The_Beatles/CD1_-_16_-_I_Will.lab
+10CD1_-_The_Beatles/CD1_-_17_-_Julia.lab
+10CD2_-_The_Beatles/CD2_-_01_-_Birthday.lab
+10CD2_-_The_Beatles/CD2_-_02_-_Yer_Blues.lab
+10CD2_-_The_Beatles/CD2_-_03_-_Mother_Nature's_Son.lab
+10CD2_-_The_Beatles/CD2_-_04_-_Everybody's_Got_Something_To_Hide_Except_Me_and_My_Monkey.lab
+10CD2_-_The_Beatles/CD2_-_05_-_Sexy_Sadie.lab
+10CD2_-_The_Beatles/CD2_-_06_-_Helter_Skelter.lab
+10CD2_-_The_Beatles/CD2_-_07_-_Long_Long_Long.lab
+10CD2_-_The_Beatles/CD2_-_08_-_Revolution_1.lab
+10CD2_-_The_Beatles/CD2_-_09_-_Honey_Pie.lab
+10CD2_-_The_Beatles/CD2_-_10_-_Savoy_Truffle.lab
+10CD2_-_The_Beatles/CD2_-_11_-_Cry_Baby_Cry.lab
+10CD2_-_The_Beatles/CD2_-_12_-_Revolution_9.lab
+10CD2_-_The_Beatles/CD2_-_13_-_Good_Night.lab
+11_-_Abbey_Road/01_-_Come_Together.lab
+11_-_Abbey_Road/02_-_Something.lab
+11_-_Abbey_Road/03_-_Maxwell's_Silver_Hammer.lab
+11_-_Abbey_Road/04_-_Oh!_Darling.lab
+11_-_Abbey_Road/05_-_Octopus's_Garden.lab
+11_-_Abbey_Road/06_-_I_Want_You.lab
+11_-_Abbey_Road/07_-_Here_Comes_The_Sun.lab
+11_-_Abbey_Road/08_-_Because.lab
+11_-_Abbey_Road/09_-_You_Never_Give_Me_Your_Money.lab
+11_-_Abbey_Road/10_-_Sun_King.lab
+11_-_Abbey_Road/11_-_Mean_Mr_Mustard.lab
+11_-_Abbey_Road/12_-_Polythene_Pam.lab
+11_-_Abbey_Road/13_-_She_Came_In_Through_The_Bathroom_Window.lab
+11_-_Abbey_Road/14_-_Golden_Slumbers.lab
+11_-_Abbey_Road/15_-_Carry_That_Weight.lab
+11_-_Abbey_Road/16_-_The_End.lab
+11_-_Abbey_Road/17_-_Her_Majesty.lab
+12_-_Let_It_Be/01_-_Two_of_Us.lab
+12_-_Let_It_Be/02_-_Dig_a_Pony.lab
+12_-_Let_It_Be/03_-_Across_the_Universe.lab
+12_-_Let_It_Be/04_-_I_Me_Mine.lab
+12_-_Let_It_Be/05_-_Dig_It.lab
+12_-_Let_It_Be/06_-_Let_It_Be.lab
+12_-_Let_It_Be/07_-_Maggie_Mae.lab
+12_-_Let_It_Be/08_-_I've_Got_A_Feeling.lab
+12_-_Let_It_Be/09_-_One_After_909.lab
+12_-_Let_It_Be/10_-_The_Long_and_Winding_Road.lab
+12_-_Let_It_Be/11_-_For_You_Blue.lab
+12_-_Let_It_Be/12_-_Get_Back.lab
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/addshort2list.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,178 @@
+%
+%ADDSHORT2LIST Combine intervals of a shorthand with another interval list
+% 
+% [fullinterval_list, success, errormessage] = addshort2list(shorthand, interval_list, {verbose})
+% 
+% Combine shorthand and interval_list to form full interval list for a chord.  
+% Takes into account the omit interval character '*' in producing final list.
+% 
+% Success = 1 if shorthand and interval_list combined correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% returns:  fullinterval_list (string)
+%           success (boolean)
+%           errormessage (string)
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [fullinterval_list, success, errormessage] = addshort2list(shorthand, interval_list, verbose)
+
+% set verbose default to 0
+if nargin < 3
+    verbose = 0;
+end
+
+errormessage = '';
+
+% initialise variables
+fullinterval_list = '';
+shortdegrees = [];
+intervaldegrees = [];
+addlist = [];
+success = 1;
+
+% convert shorthand string to list of intervals
+[shortintervals, ok, errors]  = shorthand2intervals(shorthand);
+
+if ok
+    % if that works convert the shorthand intervals and interval_list to
+    % degrees and accidentals
+    
+    % add the implied 1 degree to the shorthand list
+ %   if isempty(shortintervals)
+ %       rootdegree = '1'; % no comma if shorthand is empty
+ %   else
+ %       rootdegree = '1,'; % comma shows that there are further intervals after this one
+ %   end
+        
+    
+    [shortdegrees, ok, errors] = parseintervals(shortintervals); 
+
+    if (ok)
+
+      
+      % this part of the algorithm finds all the present degrees and sorts
+      % them into ascending numeric order
+  
+      % First put the shorthand degrees into the full list
+      
+      [ilength,y] = size(shortdegrees);
+   
+      for index = 1:ilength
+          % convert degree to a semitone value  
+          semitone = degree2semitone(shortdegrees(index,1),shortdegrees(index,2));
+          
+          % Using the semitone value as an index will find redundant
+          % intervals and also sort them in number order. Multiplying the degree by its
+          % presence value leaves either the degree value or 0. Any element 
+          % in the array with degree of 0 will be discarded later
+          % We add 1 to the semitone value to handle the '1'  or 'unity'
+          % degree that would return a 0 semitone value
+          
+          % record the degree 
+          addlist(semitone+1,1) = shortdegrees(index,1) .* shortdegrees(index,3);
+          % record the accidentals as well
+          addlist(semitone+1,2) = shortdegrees(index,2);
+          
+      end
+    else
+        success = 0;
+    end
+
+    [intervaldegrees, ok2, errors] = parseintervals(interval_list);
+    ok = ok && ok2;
+    
+    if ok
+      % Now add the intervals from the interval_list taking redundant and 
+      % ommitted intervals into account 
+      
+      [ilength,y] = size(intervaldegrees);
+   
+      for index = 1:ilength
+          % convert degree to a semitone value  
+          [semitone, ok, errors] = degree2semitone(intervaldegrees(index,1),intervaldegrees(index,2));
+          
+          if ok && semitone >= 0
+          % record the degree 
+          addlist(semitone+1,1) = intervaldegrees(index,1) .* intervaldegrees(index,3);
+          % record the accidentals as well
+          addlist(semitone+1,2) = intervaldegrees(index,2);
+          
+          else
+             success = 0; 
+          end
+          
+      end
+    else
+        success=0;
+    end
+    
+    
+    % now create fullinterval_list
+    if ok
+
+        [ilength,y] = size(addlist);
+
+        for index = 1:ilength
+
+            % if there is a non zero degree in this element, convert 
+            % it to an interval symbol and add it to the output list
+            if(addlist(index,1) ~=0)
+
+                intervalsymbol = degree2interval(addlist(index,1),addlist(index,2));
+
+                if isempty(fullinterval_list)
+                    % if this is the first interval then start list
+                    fullinterval_list = intervalsymbol; 
+                else
+                    % add to list with a separating comma
+                    fullinterval_list = [fullinterval_list ',' intervalsymbol];
+                end
+            end
+        end
+    else
+
+        success = 0;
+        
+    end
+    
+else
+    
+    success = 0;
+    
+end
+
+
+if success == 0
+    errormessage = [errors sprintf(['Error in addshort2list: unsuccessful '...
+                    'combination  "' shorthand '" and "' interval_list '"\n'])];
+    
+    if verbose ==1
+       fprintf(1,errormessage);
+    end
+       
+       
+end   
+
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/checklabs.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,54 @@
+%
+% CHECKLABS check chord syntax in all lab files in a directory
+% 
+% success = checklabs(directory, logfile)
+% 
+% Check the syntax of chord symbols in every lab file in the target
+% directory.  A log of syntax errors is created in the text file logfile
+% 
+% Success = 1 if all symbols have correct syntax, 0 otherwise.
+%
+% returns:  success (boolean)
+%
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [success] = checklabs(directory, logfile)
+
+files = dir([directory '/*.lab']);
+
+ilength = length(files);
+
+success = 1;
+
+fid = fopen(logfile, 'a');
+
+for index = 1:ilength
+    
+    ok = checklabsyntax([directory '/' files(index).name],fid);
+
+    success = success && ok;
+
+end
+
+fclose(fid);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/checklabsyntax.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,70 @@
+%
+% CHECKLABSYNTAX Check the syntax of all chords in a lab file
+% 
+% [success] = checklabsyntax(labfile, {fid})
+% 	
+% Checks syntax of all chord symbols in a lab file. Any incorrect chords 
+% will produce syntax errors and be quoted with time of chord from the 
+% labfile given for inspection.
+% 
+% fid is the file id of the output log file.  If not given, the error log 
+% will be printed to the screen
+% 
+% Success = 1 if all symbols have correct syntax, 0 otherwise.
+%
+% Returns: success (boolean)
+% 
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [success] = checklabsyntax(labfile,fid)
+
+if nargin < 2
+       fid = 1;
+end
+
+success = 1;
+
+[times1,t2,symbols] = labread(labfile);
+
+ilength = length(symbols);
+
+% new file
+fprintf(fid, ['*** File: ' labfile ' ***\n\n']);
+
+errormessage = '';
+
+for index = 1:ilength
+    
+    [ok, errormessage] = syntaxcheck(char(symbols(index)));
+    
+    
+    if ok == 0
+        
+        success = 0;
+        
+        fprintf(fid,['Time: %f seconds\n' errormessage '\n\n'], times1(index));
+        
+    end
+end
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/checkomissions.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,110 @@
+%
+% CHECKOMISSIONS
+% 
+% [success, errormessage] = checkomissions(shortints, intervals, {verbose})
+% 
+% Checks that any omitted intervals are actually present in the interval
+% list that makes up a shorthand definition. For example C:maj(*4) is an
+% incorrect chord because the shorthand does not contain interval 4 so
+% there is no reason to omit it.
+%
+% Arguments 'shortints' and 'intervals' should either be interval lists
+% (characters) or arrays of [degree, modifier, present] triples of the type
+% produced by the function 'parseintervals'.
+% 
+% Success = 1 if the interval list does not contain an omitted interval
+% that is not present in the shorthand list.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% returns:  success (boolean)
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte, December 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
+% USA
+
+function [success, errormessage] = checkomissions(shortints,intervals,verbose)
+
+if nargin < 3
+    verbose = 0;
+end
+
+errormessage = '';
+
+success = 1;
+
+% if 'shortints' is a character string interval list, convert it to
+% [degree,modifier,present] triples
+if ischar(shortints)
+    [shortints,success,errormessage] = parseintervals(shortints);
+end
+
+% if 'intervals' is a character string interval list, convert it to
+% [degree,modifier,present] triples
+if success && ischar(intervals)
+    [intervals, success, errormessage] = parseintervals(intervals);
+end
+
+% if everything is ok so far, check any omissions
+if success 
+
+    [sizey,sizex] = size(intervals);
+    [sizey2,sizex2] = size(shortints);
+
+    success = 1;
+
+    % for each interval in the intervals list
+    for indexa = 1:sizey
+
+        % if it is an omitted interval
+        if intervals(indexa,3) == 0
+
+            % check that the shorthand list contains that interval to omit
+            success = 0;
+
+            for indexb = 1:sizey2
+
+                if shortints(indexb,1:2) == intervals(indexa,1:2)
+                    % if the omitted interval is found in the shorthand
+                    % list then the omission is valid
+                    success = 1;
+                end
+            end
+        end 
+    end
+end 
+
+    
+% if there was an error, format the error message appropriately:
+if success == 0
+        if isempty(errormessage)
+            errormessage = sprintf(['Error in checkommisions: ommitted interval not present in shorthand. \n']);
+        else
+            errormessage = [sprintf(['Error in checkommisions: badly formatted argument \n']) errormessage];
+        end
+        
+        if verbose == 1
+            fprintf(1,errormessage);
+        end
+
+end 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/chord2fifthpositions.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,82 @@
+%
+%CHORD2FIFTHPOSITIONS Convert chord symbol to pitch positions on line of fifths
+% 
+% [fifthpostions, bass, success, errormessage] = chord2fifthpostions(chordsymbol, {verbose})
+% 
+% Converts a chord symbol to an array of integer positions on the line of fifths.
+% C is the reference position 0.
+%
+% In the case of the 'no chord' symbol 'N' function returns an empty array
+%
+% Success = 1 if notes extracted from chordsymbol correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls:    chord2notes
+%           notes2fifthpositions
+% 
+% returns:  fifthpostions (array of integers)           
+%           success (boolean)
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%             
+function [fifthpostions, bass, success, errormessage] = chord2fifthpostions(chordsymbol, verbose)
+
+% set verbose default to 0
+if nargin < 2
+    verbose = 0;
+end
+
+errormessage = '';
+mainlist = '';
+success = 1;
+fifthpostions = [];
+bass = '';
+
+% get constituent notes
+[chordnotes, bassnote, success, errormessage] = chord2notes(chordsymbol);
+
+if success && ~isempty(chordnotes)
+% find fifthpostions of notes
+[fifthpostions, success, errormessage] = notes2fifthpositions(chordnotes);
+end
+
+if success && ~isempty(bassnote)
+[bass, success, errormessage] = note2fifthposition(char(bassnote));
+end
+
+
+
+if success == 0
+    errormessage = [errormessage sprintf(['Error in chord2fifthpostions: Couldn''t convert chord "' chordsymbol '"\n'])];   
+    if verbose ==1
+       fprintf(1,errormessage);
+    end
+       
+       
+end  
+    
+    
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/chord2midinotes.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,148 @@
+%
+%CHORD2MIDINOTES Generate MIDI note values for a given chord symbol
+% 
+% [midinotes, success, errormessage] = chord2midinotes(chordsymbol, {verbose})
+% 
+% Obtains a set of midi note values for notes present in chord "chordsymbol".
+% The voicing is built on the rootnote with all other intervals occuring 
+% above in number order unless a bass interval is specified.
+%
+% In the case of the 'no chord' symbol 'N' function returns midinote -1
+%
+% Success = 1 if chord is converted correctly else 0.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+%
+% Returns:  midinotes (array of integers)
+%           success (boolean)
+%           errormessage (string)
+%
+%
+% % Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [midinotes, success,errormessage] = chord2midinotes(chordsymbol, verbose)
+
+% set verbose default to 0
+if nargin < 2
+    verbose = 0;
+end
+
+errormessage = '';
+mainlist = '';
+success = 1;
+midinotes = 0;
+
+% parse the chordsymbol
+[rootnote,shorthand,interval_list,bass, success, errormessage] = getchordinfo(chordsymbol);
+
+if success
+
+
+    %if 'no chord' then return -1
+    if rootnote == 'N'
+
+        midinotes = -1;
+    else
+
+        % get root's pitchclass with respect to middle C and calculate absolute
+        % pitch of root in that octave   
+        if success
+
+        [rootpitchclass, success, errormessage] = note2pitchclass(rootnote);
+
+        % midinote C4 = 60 so add pitchclass to calculate rootpitch
+        rootpitch = 60 + rootpitchclass;
+
+        end
+
+
+        % combine shorthand and interval_list and obtain semitone values for each
+        % interval
+        if success
+
+            [mainlist, success, errormessage] = addshort2list(shorthand, interval_list);
+
+            if success
+
+                [semitones,success,errormessage] = intervals2semitones(mainlist);
+
+                % add rootpitch to obtain midinotes
+                chordpitches = semitones + rootpitch;
+
+            end
+
+        end
+
+        % Now find the bass note
+
+        if success
+
+            % if we haven't got a bass interval then play the rootnote as the
+            % bassnote
+            if isempty(bass)
+                basspitchclass = rootpitchclass;
+            else
+                % otherwise convert the bassinterval to a note
+                [bassnote,success,errormessage] = interval2note(bass, rootnote);
+
+                if success
+
+                    [basspitchclass, success, errormessage] = note2pitchclass(char(bassnote));
+
+                end
+            end
+
+            if success
+                % calculate bass note so that it is in the octave below the
+                % rest of the chord i.e. add to C3 midinote 48
+                basspitch = basspitchclass + 48;
+
+                % Put midinote list together
+                midinotes = [basspitch, rootpitch];
+                
+                for index = 1:length(chordpitches)
+                    if chordpitches(index) ~= rootpitch
+                       midinotes = [midinotes, chordpitches(index)];
+                    end
+                end
+            end
+
+        end
+    end
+
+%alter pitches for chords with high roots
+if rootpitchclass > 6
+    midinotes = midinotes-12;
+end
+
+end
+    
+if success == 0
+    errormessage = [errormessage sprintf(['Error in chord2midinotes: Couldn''t convert chord"' chordsymbol '"\n'])];   
+    if verbose ==1
+       fprintf(1,errormessage);
+    end
+end  
+    
+    
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/chord2notes.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,167 @@
+%
+%CHORD2NOTES Convert chord symbol to list of constituent notes
+% 
+% [chordnotes, bassnote, success, errormessage] = chord2notes(chordsymbol, {verbose})
+% 
+% Converts a chord symbol to a cell array of note strings and a bassnote string.
+%
+% In the case of the 'no chord' symbol 'N' function returns an empty array
+%
+% Success = 1 if notes extracted from chordsymbol correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls:    getnoteinfo
+%           parsenote
+%           addshort2list
+%           interval2note
+% 
+% returns:  chordnotes  (cell array of note strings)
+%           bassnote (string)           
+%           success (boolean)
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%             
+function [chordnotes, bassnote, success, errormessage] = chord2notes(chordsymbol, inversion, verbose)
+
+%set default inversion to 0
+if nargin < 2
+    inversion = 0;
+end
+
+% set verbose default to 0
+if nargin < 3
+    verbose = 0;
+end
+
+errormessage = '';
+mainlist = '';
+success = 1;
+chordnotes = [];
+bassnote = '';
+
+% parse the chordsymbol
+[rootnote,shorthand,interval_list,bass, success, errormessage] = getchordinfo(chordsymbol);
+
+
+
+
+%if 'no chord' then return N
+if (success == 1)
+    
+
+    
+    if rootnote == 'N'
+        
+        chordnotes = {};
+    else
+
+
+        % combine shorthand and interval_list and obtain note names for each
+        % interval
+        if success
+
+            [mainlist, success, errormessage] = addshort2list(shorthand, interval_list);
+
+            if success
+
+                % convert list of intervals to list of notes 
+                [chordnotes,success,errormessage] = intervals2notes(mainlist,rootnote);
+                 
+            end
+
+        end
+
+        % Now find the bass note
+
+        if success
+
+            if ~isempty(bass)
+
+                [bassnote,success,errormessage] = interval2note(bass, rootnote);
+    
+                if inversion
+                    % if the bass note is a member of the chord
+                    if length(intersect(bassnote,chordnotes))==1
+                        %rotate the chord until the bassnote is the first
+                        %element
+                        for i=1:length(chordnotes)
+                           if strcmp(chordnotes{1},bassnote)
+                               break
+                           else
+                               chordnotes = [chordnotes(2:end); chordnotes(1)];
+                           end                           
+                            
+                        end
+                     
+                    else
+                        % insert the bassnote at the start of the chord
+
+                        chordnotes = [bassnote; chordnotes];
+
+
+                    end
+                end
+%                 if success
+%                     
+%                     ilength = length(chordnotes);
+%                     index = 1;
+%                     
+%                     % check if the bass note is included in the other chord notes 
+%                     while index<=ilength
+%                         if char(bassnote) == char(chordnotes(index))
+%                             index = ilength +1;
+%                             contains = 1;
+%                         else
+%                             contains = 0;
+%                             index = index +1;
+%                         end
+%                     end
+%                     
+%                     if contains == 0
+%                         
+%                        % chordnotes = [bassnote; chordnotes];
+%                     end
+%                 end
+            else
+                bassnote = chordnotes(1);
+            end
+
+
+        end
+    end
+end
+
+if success == 0
+    errormessage = [errormessage sprintf(['Error in chord2notes: Couldn''t convert chord "' chordsymbol '"\n'])];   
+    if verbose ==1
+       fprintf(1,errormessage);
+    end
+       
+       
+end  
+    
+    
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/chord2pitchclasses.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,139 @@
+%
+%CHORD2PITCHCLASSES Convert chord symbol to array of pitch classes
+% 
+% [pitchclasses, bassclass, success, errormessage] = chord2pitchclasses(chordsymbol, {inversion}, {verbose})
+% 
+% Converts a chord symbol to an array of integer pitch class values and a
+% bass pitch class value. Pitch class values are referenced w.r.t. C = 0.
+%
+% In the case of the 'no chord' symbol 'N' function returns an empty array
+%
+% Success = 1 if notes extracted from chordsymbol correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls:    chord2notes
+%           notes2pitchclasses
+% 
+% returns:  pitchclasses (array of integers)
+%           bassclass (integer)           
+%           success (boolean)
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%             
+function [pitchclasses, bassclass, success, errormessage] = chord2pitchclasses(chordsymbol, inversion, verbose)
+
+% set verbose default to 0
+if nargin < 3
+    verbose = 0;
+end
+
+if nargin < 2
+    inversion = 1;
+end
+
+errormessage = '';
+mainlist = '';
+success = 1;
+pitchclasses = [];
+bassclass = '';
+contains = 0;
+ 
+% get constituent notes
+[chordnotes, bassnote, success, errormessage] = chord2notes(chordsymbol);
+
+%convert notes and bass to pitch classes
+if success && ~isempty(chordnotes)
+% find pitchclasses of notes
+[pitchclasses, success, errormessage] = notes2pitchclasses(chordnotes);
+end
+
+if success && ~isempty(bassnote)
+[bassclass, success, errormessage] = note2pitchclass(char(bassnote));
+
+    % check if the bass class is already part of the chord
+    if success
+        ilength = length(pitchclasses);
+
+        contains = 0;
+
+        for index = 1:ilength
+            if bassclass == pitchclasses(index)
+                contains = 1;
+                if inversion
+                    pitchclasses = [pitchclasses(index:end) pitchclasses(1:index-1)];
+                end
+            end
+        end
+
+    end
+
+    %if the note is not already part of the chord then insert it
+    if ~contains
+
+        % if inversion=1 then insert at start of pitchclasses
+        if inversion
+            pitchclasses = [bassclass pitchclasses];
+        else
+            relpc = mod(pitchclasses-pitchclasses(1),12);
+            relbass = mod(bassclass-pitchclasses(1),12);
+            
+            i=0;
+            while(i<ilength)
+                if relbass<relpc(i+1)
+                    break
+                else
+                    i=i+1;
+                end
+            end
+
+            if i==ilength
+                pitchclasses = [pitchclasses bassclass];
+            else
+                pitchclasses = [pitchclasses(1:i) bassclass pitchclasses(i+1:end)];
+            end
+            
+            
+            
+            
+        end
+        
+    end
+
+end    
+    
+
+
+if success == 0
+    errormessage = [errormessage sprintf(['Error in chord2pitchclasses: Couldn''t convert chord "' chordsymbol '"\n'])];   
+    if verbose ==1
+       fprintf(1,errormessage);
+    end
+       
+       
+end  
+    
+    
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/chord2quality.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,85 @@
+%
+% CHORD2QUALITY return the chord quality of a given chord symbol
+% 
+% [quality,success, errormessage] = chord2quality(chordsymbol, {verbose})
+% 
+% Returns the chord quality of a given chord symbol. Quality values are from 
+% the enumeration:
+%
+% 0   Major
+% 1   Minor
+% 2   Diminished
+% 3   Augmented
+% 4   Suspended
+%
+% Success = 1 if symbols parsed correctly, 0 otherwise. 
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls:    getchordinfo
+%           short2quality
+%           intervals2quality
+% 
+% returns:  quality (integer)
+%           success  (boolean)  
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+
+function [quality, success, errormessage] = chord2quality(chordsymbol,verbose)
+
+quality = 0;
+errormessage = '';
+
+if nargin < 2
+    verbose = 0;
+end
+
+[rootnote,shorthand,interval_list,bassinterval,success,error] = getchordinfo(chordsymbol);
+
+if success
+    
+    if ~isempty(shorthand)
+    
+        [quality, success, error] = short2quality(shorthand);
+        
+    else
+   
+        [quality, success, error] = intervals2quality(interval_list);
+        
+    end
+    
+end
+
+
+
+if(success==0) 
+
+    errormessage = sprintf([error 'Error in Chord2quality: Chord "' chordsymbol '"\n']);
+    
+    if verbose == 1
+        fprintf(1, errormessage);
+    end
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/contents.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,64 @@
+% C4DM Chord Symbols Toolkit 
+%
+% Version 2.0 March 2009
+% 
+%TYPES
+% types - help describes types, structures and enumerations used in toolkit
+% 
+%SYMBOL MANIPULATION FUNCTIONS
+% parsechord           - Parse chord symbol to its constituent string elements
+% parsenote            - Parse a note string to a natural plus accidentals
+% parseinterval        - Parse an interval to a degree plus accidentals
+% parseintervals       - Parse an interval list to degrees and accidentals 
+% interval2semitone    - Convert an interval to equivalent number of semitones
+% degree2semitone      - Convert degree + accidentals to semitone value
+% degree2interval      - Convert degree + accidentals to an interval string
+% intervals2semitones  - Convert an interval list to an array of semitone values
+% interval2note        - Convert an interval to correctly spelled note w.r.t. a root
+% intervals2quality    - Return the quality of a given interval list
+% note2pitchclass      - Convert a note to a pitchclass value w.r.t C=0
+% notes2pitchclasses   - Convert a note list to an array pitchclasses
+% note2fifthinfo       - Find line of fifths natural-position and accidentals  
+% note2fifthposition   - Find note position on the line of fifths w.r.t. C=0
+% notes2fifthpositions - Convert notes list to positions on line of fifths
+% note2interval        - Convert a note to an interval w.r.t. a given root
+% shorthand2intervals  - Convert a shorthand string to equivalent interval list
+% short2quality        - Return the quality of a given shorthand string
+% 
+% 
+%HIGHER LEVEL CHORD SYMBOL FUNCTIONS
+% getchordinfo         - Check chord symbol validity and return constituent parts
+% syntaxcheck          - Check the syntax and validity of a chord symbol 
+% addshort2list        - Combine intervals of a shorthand with another interval list
+% chord2quality        - Returns the chord quality of a given chord symbol
+% chord2notes          - Convert chord symbol to list of constituent notes
+% chord2midinotes      - Generate MIDI note values for a given chord symbol
+% chord2pitchclasses   - Convert chord symbol to array of pitch classes w.r.t C=0
+% chord2fifthpositions - Convert chord symbol to pitch positions on line of fifths 
+%
+%LAB FILE FUNCTIONS
+% labread              - Read in times and symbols from a lab file
+% labwrite             - Write times and symbols to a lab file
+% mlf2lab              - Convert an mlf transcription file to a lab file
+% checklabsyntax       - Check the syntax of all chords in a lab file
+% checklabs            - Check chord syntax in all lab files in a directory
+% 
+% Author: Christopher Harte, March 2009 
+%
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit version 2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/degree2interval.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,84 @@
+%
+% DEGREE2INTERVAL
+% 
+% [interval,success,errormessage] = degree2interval(degree,accidentals,{verbose})
+% 
+% Converts a degree and accidental pair to an interval string.
+% 
+% Success = 1 if degree converted correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% returns:  interval (string)
+%           success (boolean)
+%           errormessage (string)
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0 
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function [interval,success,errormessage] = degree2interval(degree,accidentals, verbose)
+
+% set verbose default to 0
+if nargin < 3
+    verbose = 0;
+end
+
+errormessage = '';
+
+
+success = 1;
+interval = '';
+
+
+if accidentals >=1
+   % then the degree is either a natural or has a number of sharps 
+    if accidentals ~= 0
+        for index = 1:accidentals 
+            interval = [interval '#'];
+        end
+    end
+    
+else
+    % then the degree has a number of flats
+    
+    for index = 1:abs(accidentals) 
+   
+        interval = [interval 'b'];
+    end
+    
+end
+
+if isnumeric(degree)
+    
+    degreestring = num2str(degree);
+    interval = [interval degreestring];
+    
+else
+   success = 0;
+   errormessage = 'Error in degree2interval: incorrect degree';
+end
+    
+if (success == 0) && (verbose == 1)   
+    fprintf(1,errormessage);
+end  
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/degree2semitone.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,75 @@
+%
+% DEGREE2SEMITONE
+% 
+% [semitone, success, errormessage] = degree2semitone(degree, accidental, {verbose})
+% 
+% Convert a degree and accidentals pair to a semitone value
+% 
+% Success = 1 if degree converted correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% returns:  semitone (string)
+%           success (boolean)
+%           errormessage (string)
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function [semitone, success, errormessage] = degree2semitone(degree, accidentals, verbose)
+
+if nargin < 3 
+    % verbose defaults 0
+    verbose = 0;
+end
+
+errormessage = '';
+
+% semitone equivalents for degrees
+%             degree   1,2,3,4,5,6,7         
+%semitonetranslation = [0,2,4,5,7,9,11];
+
+semitone = 0;
+
+success = 1;
+
+if (degree > 0) && (degree < 50)
+
+% semitone value is the number of semitones equivalent to the degree
+% added to the number of accidentals (sharps are positive, flats are
+% negative) and the number of octaves above the reference note to
+% account for extensions 
+
+%semitone = semitonetranslation(mod(degree,8) + fix(degree/8)) + accidentals + 12*fix(degree/8);
+
+semitone = 2*mod(degree-1,7) - floor((mod(degree-1,7)+1)/4) + 12*floor((degree-1)/7)+ accidentals; 
+
+else
+    success = 0;
+    
+    errormessage = sprintf('Error in degree2semitone: out of range degree "%d"\n', degree);
+    
+    if verbose == 1
+        fprintf(1,errormessage);
+    end
+end
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/getchordinfo.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,102 @@
+%
+% GETCHORDINFO Check chord symbol validity and return constituent parts
+% 
+% [rootnote, shorthand,intervals, bassinterval, success, errormessage] 
+%                                   = getchordinfo(chordsymbol, {verbose})
+% 
+% Checks symbol for correct syntax and returns chord information  Differs 
+% from parsechord in that notes, shorthands, intervals and bass values are all 
+% checked for validity in the process.
+% 
+% Success = 1 if all symbols have correct syntax, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% Returns:	rootnote        (string)
+%           shorthand       (string)
+%           intervals       (interval list string)
+%           bassinterval    (string)
+%           success         (boolean) true or false for correct syntax 
+%           errormessage    (string)  
+%
+% See also: syntaxcheck
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function [rootnote, shorthand, intervals, bassinterval, success, errormessage] = getchordinfo(chordsymbol, verbose)
+
+if nargin < 2
+    verbose = 0;
+end
+    
+errormessage = '';
+rootnote = '';
+shorthand =  '';
+intervals = '';
+bassintervall = '';
+
+shortints = '';
+tempints = '';
+
+success = 0;
+
+% parse the chord symbol into its constituent parts
+[rootnote,shorthand, intervals,bassinterval, success, errormessage] = parsechord(chordsymbol);
+
+if success == 1
+    
+    if rootnote ~= 'N'
+        
+        % check validity of rootnote
+        [temp, temp2, success, errormessage] = parsenote(rootnote);
+
+        %check validity of shorthand list
+        if ((success == 1) && ~(isempty(shorthand)))
+           [shortints, success, errormessage] = shorthand2intervals(shorthand);
+        end        
+        
+        % check validity of intervals
+        if (success == 1) && ~(isempty(intervals))
+            [tempints, success, errormessage] = parseintervals(intervals);
+        end
+    
+        % check for incorrectly ommitted intervals
+        if ((success == 1) && ~(isempty(intervals) && ~(isempty(shorthand))))
+            [success, errormessage] = checkomissions(shortints,tempints);
+        end
+        
+        % check validity of bass interval
+        if (success == 1) && ~(isempty(bassinterval))
+           [temp,temp2,temp3, success, errormessage] = parseinterval(bassinterval); 
+        end
+          
+    end
+
+end
+
+if (success ==0) 
+    errormessage = [sprintf(['Error in getchordinfo: syntax incorrect in chord symbol: "' chordsymbol '" \n']) errormessage];
+    if (verbose == 1)
+        fprintf(1,errormessage);
+    end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/interval2note.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,157 @@
+%
+%INTERVAL2NOTE convert an interval to correctly spelled note w.r.t. a root
+% 
+% [note,success,errormessage] = interval2note(interval, root {verbose})
+% 
+% Converts an interval to a note (string) with root as reference note 
+% for interval degree.
+% 
+% Success = 1 if interval is converted correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+%
+% returns:  note (string)
+%           success (boolean)
+%           errormessage (string)
+%
+% See also intervals2notes, parsenote.
+%
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [note,success,errormessage] = interval2note(interval, root,verbose)
+
+if nargin < 3
+    verbose = 0;
+end
+errormessage = '';
+
+error1 = '';
+error2 = '';
+
+note = [];
+
+degreetranslation = [5,0,2,4,-1,1,3,5]; % scale interval translations on line of fifths 
+
+fifthpositions = {'F','C','G','D','A','E','B'}; %order of naturals on line of fifths
+
+success = 1;
+
+% parse the root note
+[rootnatural,rootaccs, rsuccess, error1] = parsenote(root);
+
+%parse the interval
+[degree, intervalaccs, present, dsuccess, error2] = parseinterval(interval);
+
+% if parsing symbols was successful
+if(rsuccess && dsuccess);
+
+    switch(rootnatural) % find root natural position on line of fifths
+
+        case 'F'
+            fifthindex = 0;        
+        case 'C'
+            fifthindex = 1;
+        case 'G'
+            fifthindex = 2;
+        case 'D'
+            fifthindex = 3;
+        case 'A'
+            fifthindex = 4;
+        case 'E'
+            fifthindex = 5;
+        case 'B'
+            fifthindex = 6;
+
+    end
+
+    %locate enharmonic root on line of fifths (modulo 6 arithmetic)   
+    
+    fifthoffset = rootaccs*7;
+    
+    fifthindex = fifthindex + fifthoffset;
+    
+    
+    % calculate degree translation on line of fifths (add 1 to account
+    % for matlab referencing of array elements... 
+    degreeoffset = degreetranslation(mod(degree,7)+1); 
+    finalposition = fifthindex + degreeoffset;
+    
+    
+    naturalvalue = mod(finalposition,7);
+    
+    
+    % calculate number of accidentals
+    if finalposition <0 
+        %if final position is negative then calculate number of flats
+        % remembering to include the extra first flat (-1)
+        accidentals = fix((finalposition+1)/7) + intervalaccs -1;
+    
+    else
+        % note is a natural or has a number of sharps
+        accidentals = fix(finalposition/7) + intervalaccs;
+    end
+    
+    note = fifthpositions(naturalvalue+1);
+    
+    if accidentals > 0
+        
+        for i=1:accidentals
+            
+            note = strcat(note, '#');
+            
+        end
+        
+    elseif accidentals <=0
+        
+        for i=1:abs(accidentals)
+            
+            note = strcat(note, 'b');
+            
+        end
+    end
+        
+else
+ 
+    success=0;
+    
+end
+
+if(success==0) % correct interval therefore return success = 1 
+    % if not an integer then the interval string is incorrect
+    errormessage = [error1 error2 sprintf(['Error in interval2note: Unrecognised interval "' interval '" or root "' root '"\n'])]; 
+    
+    if verbose == 1
+       fprintf(1,errormessage); 
+    end
+    
+end
+    
+    
+    
+    
+
+    
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/interval2rcclass.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,79 @@
+%
+% INTERVAL2RCCLASS convert an interval to relative pitchclass displacement
+% 
+% [rcclass,success, errormessage] = interval2rcclass(interval, {verbose})
+% 
+% Converts an interval string to relative pitchclass displacement.
+%
+% Success = 1 if symbols parsed correctly, 0 otherwise. 
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls:    parseinterval
+%           degree2semitone
+% 
+% returns:  rcclass (integer)
+%           success  (boolean)  
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte,  January 2010
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function  [rcclass, success, errormessage] = interval2rcclass(interval, verbose)
+    
+if nargin <2 
+    % verbose defaults 0
+    verbose = 0;
+end
+
+errormessage = '';
+
+ilength = length(interval);
+
+success=0;
+semitone = 0;
+
+% parse the interval string
+
+[degree, accidentals, present, ok,errormessage] = parseinterval(interval);
+
+if (ok == 1)
+    
+    % convert degree and accidentals to equivalent number of semitones 
+    [semitone, ok, errors] = degree2semitone(degree,accidentals);
+    
+    rcclass = mod(semitone,12);
+    
+    
+    success = 1;
+    
+else
+    
+    errormessage = sprintf([errormessage 'Error in interval2rcclass: incorrect interval "' interval '"\n']);
+
+end
+
+if (verbose ==1) && (success ==0)
+    fprintf(1,errormessage); 
+end
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/interval2semitone.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,76 @@
+%
+% INTERVAL2SEMITONE convert an interval to equivalent number of semitones
+% 
+% [semitone,success, errormessage] = interval2semitone(interval, {verbose})
+% 
+% Converts an interval string to equivalent number of semitones.
+%
+% Success = 1 if symbols parsed correctly, 0 otherwise. 
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls:    parseinterval
+%           degree2semitone
+% 
+% returns:  semitone (integer)
+%           success  (boolean)  
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function  [semitone, success, errormessage] = interval2semitone(interval, verbose)
+    
+if nargin <2 
+    % verbose defaults 0
+    verbose = 0;
+end
+
+errormessage = '';
+
+ilength = length(interval);
+
+success=0;
+semitone = 0;
+
+% parse the interval string
+
+[degree, accidentals, present, ok,errormessage] = parseinterval(interval);
+
+if (ok == 1)
+    
+    % convert degree and accidentals to equivalent number of semitones 
+    [semitone, ok, errors] = degree2semitone(degree,accidentals);
+    
+    success = 1;
+    
+else
+    
+    errormessage = sprintf([errormessage 'Error in interval2semitone: incorrect interval "' interval '"\n']);
+
+end
+
+if (verbose ==1) && (success ==0)
+    fprintf(1,errormessage); 
+end
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/intervals2notes.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,111 @@
+%
+%INTERVALS2NOTES Convert an interval_list to an array of notes w.r.t. a root
+% 
+% [notes, success, errormessage] = intervals2notes(interval_list, root, {verbose})
+% 
+% Converts the intervals in interval_list to correctly spelled notes with 
+% respect to the root note.
+% 
+% Success = 1 if intervals converted correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+%
+% returns: notes (cell array of strings)
+%          success (boolean)
+%          errormessage (string)
+% 
+% See also interval2note
+%
+%
+%% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [notes, success, errormessage] = intervals2notes(interval_list, root, verbose)
+
+% set verbose default to 0
+if nargin < 3
+    verbose = 0;
+end
+
+errormessage = '';
+
+ilength = length(interval_list);
+
+index = 1;
+
+tempindex = 1;
+
+tempstring = '';
+
+success = 1;
+
+notes = {};
+
+
+while index <= ilength
+    
+   
+    while (interval_list(index) ~= ',')  
+        
+        tempstring(tempindex) = interval_list(index);
+        tempindex = tempindex +1;
+        index = index + 1;
+        
+        if(index > ilength)
+            break;
+        end
+        
+        if (interval_list(index) == ',') && (index == ilength)
+            success = 0;
+            errormessage = sprintf(['Error in intervals2notes: interval list finishes with a comma "' interval_list '"\n']);
+        end
+            
+            
+    end
+    
+        [newnote,ok, error] = interval2note(tempstring,root);
+        % concatenate error messages if there are any...
+        errormessage = [errormessage error];
+        
+        if(ok == 1)
+            tempstring = '';
+            tempindex = 1;
+            notes = [notes; cellstr(newnote)];
+            
+            index = index + 1;
+        else
+
+            errormessage = [errormessage sprintf(['Error in intervals2notes: incorrect interval in list "' interval_list '"\n'])];
+            success = 0;
+            index = ilength +1;            
+        end
+    
+    
+end
+
+if (success == 0) && (verbose == 1)
+
+    fprintf(1,errormessage)
+    
+end    
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/intervals2quality.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,115 @@
+%
+%INTERVALS2QUALITY Return the quality of a given interval_list
+% 
+% [quality,success, errormessage] = intervals2quality(interval_list, {verbose})
+% 
+% Converts a list of interval strings to an integer value denoting the
+% chord's quality. Quality values are from the enumeration:
+%
+% 0   Major
+% 1   Minor
+% 2   Diminished
+% 3   Augmented
+% 4   Suspended
+%
+% Success = 1 if symbols parsed correctly, 0 otherwise. 
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls:    intervals2semitones
+% 
+% returns:  quality (integer)
+%           success  (boolean)  
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [quality,success,errormessage] = intervals2quality(interval_list,verbose)
+
+
+
+
+quality = '';
+errormessage = '';
+
+if nargin < 2
+    verbose = 0;
+end
+
+% define templates for the 5 different triad chords (four quality families
+% plus suspension) - weights mean maj thirds will have more effect than min
+% 3rds which in turn have more effect than 5ths and then 2nds and 4ths
+
+templates = [[1,0,0,0,6,0,0,4,0,0,0,0]; ... % maj
+             [1,0,0,5,0,0,0,4,0,0,0,0]; ... % min
+             [1,0,0,5,0,0,4,0,0,0,0,0]; ... % dim
+             [1,0,0,0,6,0,0,0,4,0,0,0]; ... % aug
+             [1,0,2,0,0,2,0,4,0,0,0,0]];    % sus
+             
+         
+% get the semitone equivalents of the intervals in the interval list             
+[semitones,success,error] = intervals2semitones(interval_list);
+
+indexa = 1;
+
+% initialise a binary vector showing which semitones are present 
+present = zeros(1,12);
+
+while indexa <= 3 && indexa <= length(semitones) 
+    
+    % for each of the first three semitones in the list make its position a
+    % one in the vector 'present' 
+    
+    if semitones(indexa) < 12
+    
+        present(semitones(indexa)+1) = 1;
+    
+    end
+    indexa = indexa +1;
+    
+end
+
+% multiply present by the templates matrix to give a vector of scores for
+% the possible qualities
+qvector = templates * present';
+
+
+% find maximum value from the qualities vector
+% this function benfits from the max function's picking of the first
+% maximum value if there are several equal ones so is predisposed toward 
+% major if the quality is not obvious from the input. (e.g. C:(1) returns major)  
+[value,index] = max(qvector);
+
+% take 1 from index to give correct enumeration
+quality = index-1;
+
+
+if(success==0) 
+
+    errormessage = sprintf([error 'Error in intervals2quality: incorrect interval in list "' interval_list '"\n']);
+    
+    if verbose == 1
+        fprintf(1, errormessage);
+    end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/intervals2semitones.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,117 @@
+%
+%INTERVALS2SEMITONES convert an interval list to an array of semitone values
+% 
+% [semitones, success, errormessage] = intervals2semitones(interval_list, {verbose})
+% 
+% Converts a list of intervals to corresponding semitone degrees 
+% 
+% Success = 1 if symbols parsed correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls interval2semitone
+% 
+% returns:  semitones (array of integers)
+%           success (boolean)
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+%
+
+function [semitones, success, errormessage] = intervals2semitones(interval_list, verbose)
+
+% set verbose default to 0
+if nargin < 2
+    verbose = 0;
+end
+
+errormessage = '';
+
+ilength = length(interval_list);
+
+index = 1;
+
+tempindex = 1;
+
+tempstring = '';
+
+success = 1;
+
+parindex  = 1;
+
+semitones = [];
+
+
+while index <= ilength
+    
+   
+    while (interval_list(index) ~= ',')  
+        
+        tempstring(tempindex) = interval_list(index);
+        tempindex = tempindex +1;
+        index = index + 1;
+        
+        if(index > ilength)
+            break;
+        end
+        
+        if (interval_list(index) == ',') && (index == ilength)
+            success = 0;
+            errormessage = sprintf(['Error in intervals2semitones: interval list finishes with a comma "' interval_list '"\n']);
+        end
+            
+            
+    end
+    
+        [semitones(parindex),ok, error] = interval2semitone(tempstring);
+        % concatenate error messages if there are any...
+        errormessage = [errormessage error];
+        
+        if(ok == 1)
+            tempstring = '';
+            tempindex = 1;
+            parindex = parindex + 1;
+            index = index + 1;
+        else
+
+            errormessage = [errormessage sprintf(['Error in intervals2semitones: incorrect interval in list "' interval_list '"\n'])];
+            success = 0;
+            index = ilength +1;            
+        end
+    
+    
+end
+
+if (success == 0) && (verbose == 1)
+
+    fprintf(1,errormessage)
+    
+end    
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/labread.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,39 @@
+%
+%LABREAD read lab file
+%
+% [times1, times2, labels] = labread(labfile);
+% 
+% read times and labels from a wavesurfer lab file
+% 
+% 
+% returns: times1 (array of segment start-times)  
+%          times2 (array of segment end-times)
+%          labels (cell array of label strings)
+%
+% See also labwrite, mlf2lab, checklabsyntax.
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+%
+		
+function [times1, times2, labels] = labread(labfile);
+
+[times1,times2, labels] = textread(labfile, '%f %f %s');
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/labwrite.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,58 @@
+%
+%LABWRITE write a labfile to disk
+%
+% labwrite(times1, times2, labels, labfile, {protect})
+%
+% Write time indices and labels to a wavesurfer .lab transcription file
+% with file name labfile.
+%  
+% If optional argument 'protect' is 1 then if a lab file of the given name 
+% already exists it will be copied to a backup file with extension '.labx' 
+% before writing new data to the lab file   
+%
+% See also labread, mlf2lab, checklabsyntax.
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+%
+		
+function labwrite(times1, times2, labels, labfile, protect)
+
+if nargin<5
+    protect = 0;
+end
+
+if (protect == 1)
+   check = copyfile(labfile, [labfile 'x']);
+end
+
+fid = fopen(labfile, 'w');
+
+for i = 1:length(times1)
+    
+    outtext = ['%f %f ' char(labels(i)) '\n'];
+    
+    fprintf(fid, outtext, times1(i), times2(i));
+    
+end
+
+fclose(fid);
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/mlf2lab.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,54 @@
+%
+% MLF2LAB Convert mlf file to lab file
+% 
+% mlf2lab(inputfile, labfile)
+% 
+% Converts a '.mlf' transcription file "inputfile" to a wavesurfer '.lab' 
+% transcription file "labfile".
+% 
+% See also labread, labwrite, checklabsyntax.
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+		
+%
+function mlf2lab(inputfile, labfile)
+
+
+[timestamps, timestamps2, stamps] = textread(inputfile, '%f %f %s');
+
+
+newtimes = timestamps./10000000;
+newtimes2 = timestamps2./10000000;
+
+
+fid = fopen(labfile, 'w');
+
+for i = 1:length(newtimes)
+    
+    outtext = ['%f %f ' char(stamps(i)) '\n'];
+    
+    fprintf(fid, outtext, newtimes(i), newtimes2(i));
+    
+end
+
+fclose(fid);
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/note2fifthinfo.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,94 @@
+%
+%NOTE2FIFTHINFO find line of fifths natural-position and accidentals
+% 
+% [position, accidentals, success,errormessage] = note2fifthinfo(note,{verbose})
+% 
+% Converts a note string to a natural position on the line of fifths and its 
+% corresponding number of sharps or flats. 
+%
+% *** NOTE! *** 
+% Reference for natural positions on line of fifths for this function is F = 0.
+% 
+% Success = 1 if note converted correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls: parsenote
+%
+% returns:  position (integer)
+%           accidentals (integer)
+%           success (boolean)
+%           errormessage (string)
+% 
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0 
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function [position,accidentals, success, errormessage] = note2fifthinfo(note, verbose)
+
+% set verbose default to 0
+if nargin < 3
+   verbose = 0;
+end
+
+errormessage = '';
+success = 1;
+position = '';
+accidentals = '';
+
+
+[natural, accidentals, success, errormessage] = parsenote(note);
+
+if success
+    switch(natural)
+        case 'F' 
+            position = 0;
+
+        case 'C' 
+            position = 1;
+
+        case 'G' 
+            position = 2;
+
+        case 'D' 
+            position = 3;
+
+        case 'A' 
+            position = 4;
+
+        case 'E' 
+            position = 5;
+
+        case 'B' 
+            position = 6;
+
+        otherwise
+            errormessage = 'Error in note2fifthinfo: unrecognised natural';
+            success=0;
+    end
+end
+        
+            
+if (success == 0) && (verbose == 1)   
+    fprintf(1,errormessage);
+end  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/note2fifthposition.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,62 @@
+%
+%NOTE2FIFTHPOSITION find note position on the line of fifths w.r.t. C=0
+% 
+% [noteposition, success, errormessage] = note2fifthposition(note,{verbose})
+% 
+% Converts a note string to a natural position on the line of fifths and its 
+% corresponding number of sharps or flats. Reference on line of fifths is C = 0.
+% 
+% Success = 1 if note converted correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls: 	note2fifthinfo
+%
+% returns:  noteposistion (integer)
+%           success (boolean)
+%           errormessage (string)
+% 
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function [noteposition, success, errormessage] = note2fifthposition(note, verbose)
+
+% set verbose default to 0
+if nargin < 3
+   verbose = 0;
+end
+
+errormessage = '';
+success = 1;
+noteposition = '';
+
+[notenatural, noteaccidentals, success1,errormessage] = note2fifthinfo(note);
+
+if success
+    noteposition = notenatural + 7.*noteaccidentals -1;
+end        
+            
+if (success == 0) && (verbose == 1)   
+    fprintf(1,errormessage);
+end  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/note2interval.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,136 @@
+%
+%NOTE2INTERVAL convert a note to an interval w.r.t. a given root
+% 
+% [interval,success,errormessage] = note2interval(note,root,{octave},{verbose})
+% 
+% Converts a note string to an interval with respect to a given root note.
+% Optional value octave gives octave offset to account for extended
+% degrees.
+% 
+% Success = 1 if note converted correctly, 0 otherwise.
+% 
+% Optional argument octave defaults to 0.  
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls: note2fifthposition
+%
+% returns:  interval (string)
+%           success (boolean)
+%           errormessage (string)
+% 
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function [interval,success,errormessage] = note2interval(note, root,octave, verbose)
+
+% set verbose default to 0
+if nargin < 3
+   octave = 0; 
+   verbose = 0;
+
+elseif nargin < 4
+   verbose = 0;
+end
+
+errormessage = '';
+success = 1;
+interval = '';
+
+% degree translations on the line of fifths
+fifthtranslations = [1,5,2,6,3,7,4];
+
+
+% get note and root natural position and accidentals on line of fifths 
+[noteposition, success1,error1] = note2fifthposition(note);
+  
+[rootposition, success2,error2] = note2fifthposition(root);
+
+if success1 && success2
+
+    % take the difference between the two note positions for relative positions
+    % of notes with respect to one and other
+    fifthsdifference = noteposition - rootposition + 1;
+
+    % natural difference on line of fifths
+    fifthsdegree = mod((fifthsdifference-1),7);
+
+    i=0;
+
+    % find number of accidentals apart on line of fifths
+    if fifthsdifference < 0 % if above 0 then either natural or sharp
+
+      %if final position is negative then calculate number of flats
+        % remembering to include the extra first flat (-1)
+        accidentals = fix((fifthsdifference+1)/7) -1;
+    
+    else
+        % note is a natural or has a number of sharps
+        accidentals = fix(fifthsdifference/7);
+
+    end
+
+
+    % put the required number of sharps or flats into the output string
+    if accidentals > 0
+        
+        for i=1:accidentals
+            
+           interval = ['#' interval];
+            
+        end
+        
+    elseif accidentals <=0
+        
+        for i=1:abs(accidentals)
+            
+           interval = ['b' interval];
+            
+        end
+    end    
+    
+    
+    % find degree value from translation array
+    degree = fifthtranslations(fifthsdegree+1);
+
+    if octave >= 0
+        degree = degree + 7.*octave;
+    else
+        success = 0;
+        errormessage = 'Error in note2interval: Octave argument is negative';
+    end
+
+
+
+    interval = [interval num2str(degree)];
+
+else
+    success = 0;
+    errormessage = [error1 error2];
+end
+    
+if (success == 0) && (verbose == 1)   
+    fprintf(1,errormessage);
+end  
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/note2pitchclass.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,126 @@
+%
+%NOTE2PITCHCLASS convert a note to a pitchclass value w.r.t middle C
+% 
+% [pitchclass, success, errormessage] = note2pitchclass(note, {verbose})
+% 
+% Converts a note string to a pitch class (integer) with C as reference 
+% pitch class 0
+% 
+% Success = 1 if symbols parsed correctly, 0 otherwise.
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% returns:  pitchclass (integer)
+%           success (boolean)
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [pitchclass, success, errormessage] = note2pitchclass(note, verbose)
+
+if nargin < 2
+    verbose = 0;
+end
+
+errormessage = '';
+
+ilength = length(note);
+
+index = 1;
+success = 1;
+
+
+% first char should be a natural name A-G
+switch note(index)
+
+    case 'C' % natural C
+            pitchclass = 0; 
+            index = index + 1;
+
+    case 'D' % natural D
+            pitchclass = 2; 
+            index = index + 1;
+    
+    case 'E' % natural E
+            pitchclass = 4; 
+            index = index + 1;
+    
+    case 'F' % natural F
+            pitchclass = 5; 
+            index = index + 1;
+    
+    case 'G' % natural G
+            pitchclass = 7; 
+            index = index + 1;
+    
+    case 'A' % natural A
+            pitchclass = 9; 
+            index = index + 1;
+    
+    case 'B' % natural B
+            pitchclass = 11; 
+            index = index + 1;
+            
+    otherwise %Unrecognised character
+            errormessage = sprintf(['Error in Note2PitchClass: Unrecognised note "' note '"\n']);
+            index = ilength + 1;
+            pitchclass=-1;
+            success = 0;
+         
+end
+
+% any other characters should be either flats or sharps
+while index <= ilength
+           
+    switch(note(index))
+        
+        case 'b' % FLAT
+            pitchclass = pitchclass - 1; %decrement pitchclass value
+            index = index + 1;
+            
+        case '#' % SHARP
+            pitchclass = pitchclass + 1; %increment pitchclass value
+            index = index + 1;
+        
+        otherwise % Unrecognised character
+            errormessage = sprintf(['Error in Note2PitchClass: Unrecognised note "' note '"\n']);
+            index = ilength + 1;
+            pitchclass=-1;
+            success = 0;
+    end        
+            
+end
+
+% Use modulo command to make sure that we are back within range 0-12
+if(success == 1)
+    
+    pitchclass = mod(pitchclass,12);
+    
+else
+   if(verbose == 1)
+      fprintf(1,errormessage); 
+   end
+end
+
+            
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/notes2fifthpositions.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,80 @@
+%
+%NOTES2FIFTHPOSITIONS convert notes list to positions on line of fifths
+% 
+% [pitchclasses, success, errormessage] = notes2fifthpostions(notes, {verbose})
+% 
+% Converts a cell array of note strings to an array of integers denoting 
+% positions on the line of fifths with C as reference position 0.
+% 
+% Success = 1 if symbols converted correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls:    note2pitchclass
+% 
+% returns:  pitchclasses (array of integers)
+%           success (boolean)
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte,  March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+%
+
+function [fifthpositions, success, errormessage] = notes2fifthpostions(notes, verbose)
+
+% set verbose default to 0
+if nargin < 2
+    verbose = 0;
+end
+
+errormessage = '';
+
+ilength = length(notes);
+
+index = 1;
+
+success = 1;
+
+fifthpositions = [];
+
+while index <= ilength
+    
+        [fifthpositions(index), success, errormessage] = note2fifthposition(char(notes(index)));
+    
+        if success
+            index=index+1;
+        else
+            errormessage = [errormessage sprintf(['Error in notes2fifthpostions: couldn''t convert notes "' notes '"\n'])];
+            index = ilength +1;            
+        end
+    
+    
+end
+
+if (success == 0) && (verbose == 1)
+
+    fprintf(1,errormessage)
+    
+end    
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/notes2pitchclasses.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,80 @@
+%
+%NOTES2PITCHCLASSES convert a note list to an array pitchclasses
+% 
+% [pitchclasses, success, errormessage] = notes2pitchclasses(notes, {verbose})
+% 
+% Converts a cell array of note strings to an array of pitch class integer 
+% values. Pitch class values are referenced w.r.t. C = 0. 
+% 
+% Success = 1 if symbols converted correctly, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls note2pitchclass
+% 
+% returns:  pitchclasses (array of integers)
+%           success (boolean)
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+%
+
+function [pitchclasses, success, errormessage] = notes2pitchclasses(notes, verbose)
+
+% set verbose default to 0
+if nargin < 2
+    verbose = 0;
+end
+
+errormessage = '';
+
+ilength = length(notes);
+
+index = 1;
+
+success = 1;
+
+pitchclasses = [];
+
+while index <= ilength
+    
+        [pitchclasses(index), success, errormessage] = note2pitchclass(char(notes(index)));
+    
+        if success
+            index=index+1;
+        else
+            errormessage = [errormessage sprintf(['Error in notes2pitchclasses: couldn''t convert notes "' notes '"\n'])];
+            index = ilength +1;            
+        end
+    
+    
+end
+
+if (success == 0) && (verbose == 1)
+
+    fprintf(1,errormessage)
+    
+end    
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/parsechord.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,274 @@
+%
+%PARSECHORD parse chord symbol to its constituent string elements
+% 
+% [rootnote, shorthand, intervals, bass, success, errormessage]
+%                                   = parsechord(chord, {verbose})
+% 	
+% Parses the chord symbol string "chord" into its separate string elements. 
+% 
+% NOTE: This function does not check validity of the chord elements, it
+% merely separates them according to the chord syntax. 
+% To obtain chord elements with included validity check use GETCHORDINFO.
+%
+% Success = 1 if symbols parsed correctly, 0 otherwise.
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 	
+% returns:  rootnote        (note string)
+%           shorthand       (shorthand string)
+%           intervals       (interval-list string)
+%           bass            (interval string)
+%           success         (boolean)
+%           errormessage    (string)
+%
+% See also: getchordinfo                     
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function  [rootnote, shorthand, intervals, bass, success, errormessage] = parsechord(chord, verbose)
+	
+% set verbose default to 0
+if nargin <2
+    verbose = 0;
+end
+
+ilength = length(chord);
+
+% initialise variables
+errormessage = '';
+rootnote = '';
+shorthand = '';
+intervals = '';
+bass = '';
+
+success = 1;
+index = 1;
+
+
+% check for 'no chord' symbol
+if chord(index) == 'N'
+    rootnote = chord(index);
+    index = index +1;
+    % check to see there are no further characters
+    if(index<=ilength)
+        errormessage = sprintf(['Error in parsechord: \nExtra characters after "no chord" symbol "' chord '"\n']); 
+        success = 0;
+    end
+else
+% parse thechord symbol
+
+    % the first part of the symbol before a switch character should be the root note
+    while ((index <=ilength ))
+    
+        if (chord(index) ==  ':') || (chord(index) ==  '/') || ...
+           (chord(index) ==  '(') || (chord(index) ==  ')')
+            
+            break
+        end
+
+        rootnote(index) = chord(index);
+        index = index+1;
+    
+        if(index > ilength) || (chord(index) == '/')
+            % if chord is a rootnote on its own or with just a bass note 
+            % then it is a major chord therefore set shorthand to 'maj'
+            shorthand = 'maj';
+        end
+    end
+    
+    % initialise booleans to record which switch characters we have found
+    colon = 0;
+    openbracket = 0;
+    closebracket = 0;
+    slash = 0;
+    
+    % parse the rest of the chord symbol
+    while(index <= ilength)
+        
+        % reset temporary index 
+        tempindex = 1;
+        
+       switch(chord(index))
+       
+           case ':'  
+                        
+               % if we find a colon after any switch characters have 
+               % already occured then the symbol is incorrect 
+               if (colon || openbracket || closebracket || slash)
+                    errormessage = sprintf(['Error in parsechord: \nIncorrect character sequence in chord "' chord '"\n']); 
+                    success = 0;
+                    index = ilength+1;
+               else
+                
+                   % found the first instance of a colon character
+                   colon = 1;
+                   
+                   index = index +1;
+                   
+                   if(index > ilength)
+                        errormessage = sprintf(['Error in parsechord: \nFound ":" at end of chord string "' chord '"\n']); 
+                        success = 0; 
+                   end
+                   % colon should be followed by a shorthand string or
+                   % an interval list contained in brackets
+                   while (index <= ilength)
+                       
+                       if (chord(index) ==  ':') || (chord(index) ==  '/') || ...
+                          (chord(index) ==  '(') || (chord(index) ==  ')')
+
+                           break
+                       end
+
+                       % copy character into shorthand
+                       shorthand(tempindex) = chord(index);
+                       index = index +1;
+                       tempindex = tempindex +1;
+
+                   end
+               
+               end
+               
+           case '('
+               
+               % if we have had a colon but no other switch charaters then
+               % an open bracket signifies the start of the interval list
+               if (colon && ~slash && ~closebracket && ~openbracket) 
+                   
+                   openbracket = 1;
+                   
+                   index = index +1;
+                   
+                   while (index <= ilength)
+
+                       if (chord(index) ==  ':') || (chord(index) ==  '/') || ...
+                          (chord(index) ==  '(') || (chord(index) ==  ')')
+
+                           break
+                       end
+                       
+                       % copy character into intervals
+                       intervals(tempindex) = chord(index);
+                       index = index +1;
+                       tempindex = tempindex +1;
+
+                   end
+                   
+                   if(index > ilength)
+                        errormessage = sprintf(['Error in parsechord: \nInterval list brackets not closed in chord "' chord '"\n']); 
+                        success = 0; 
+                   end
+                   
+               else
+                   errormessage = sprintf(['Error in parsechord: \nIncorrect character sequence in chord "' chord '"\n']); 
+                   success = 0;
+                   index = ilength +1;
+               end
+               
+           case ')'
+               
+               
+               % if we find a closing bracket then we should either be at
+               % the end of the symbol or there should be a slash to follow
+               if (colon && openbracket && ~slash && ~closebracket) 
+                   
+                   closebracket = 1;
+                   index = index +1;
+                   
+               else
+                   errormessage = sprintf(['Error in parsechord: \nIncorrect character sequence in chord "' chord '"\n']); 
+                   success = 0;
+                   index = ilength +1;
+               end
+               
+               % check to see that the brackets contained something
+               if isempty(intervals)
+                   errormessage = sprintf(['Error in parsechord: \nBrackets contain no intervals in chord "' chord '"\n']); 
+                   success = 0;
+                   index = ilength +1;
+               end
+               
+               
+           case '/'
+               % forward slash should be followed by an interval string
+              
+                   slash = 1;
+
+                   % move on to next character to process the expected bass interval
+                   index = index +1;
+                                     
+                   % check that we haven't overun the end of the symbol string
+                   if(index > ilength)
+                        errormessage = sprintf(['Error in parsechord: \nNo bass interval "/" at end of chord "' chord '"\n']); 
+                        success = 0; 
+                   end
+                   
+                   % check that if we have had an open bracket that it also
+                   % had a closed bracket
+                   if(xor(openbracket,closebracket))
+                        errormessage = sprintf(['Error in parsechord: \nFound "/" before closing bracket in chord "' chord '"\n']); 
+                        success = 0; 
+                        index = ilength +1;
+                   end
+
+                   % check that the previous character was not a ':'
+                   if(chord(index-2) == ':')
+                        errormessage = sprintf(['Error in parsechord: \nFound "/" directly after ":" in chord "' chord '"\n']); 
+                        success = 0; 
+                        index = ilength +1;
+                   end
+
+                   
+                   while( index <= ilength )
+                       
+                       % if we find a switch character after a slash then
+                       % the symbol is incorrect
+                       if (chord(index) ==  ':') || (chord(index) ==  '/') || ...
+                          (chord(index) ==  '(') || (chord(index) ==  ')')
+         
+                           errormessage = sprintf(['Error in parsechord: \nIncorrect character sequence in chord "' chord '"\n']); 
+                           success = 0;
+                           index = ilength +1;
+                       
+                       else
+
+                           % copy remaining characters into bass
+                           bass(tempindex) = chord(index);
+                           index = index +1;
+                           tempindex = tempindex +1;
+                       end
+                   end
+                            
+           otherwise
+                errormessage = sprintf(['Error in parsechord: \nUnrecognised chord "' chord '"\n']); 
+                success = 0;
+                index = ilength + 1;
+       end
+            
+    end
+end            
+            
+if (verbose == 1) && (success == 0)
+    fprintf(1,errormessage);
+end
+        
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/parseinterval.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,125 @@
+%
+% PARSEINTERVAL
+% 
+% [degree, accidentals, success, errormessage] = parseinterval(interval, {verbose})
+% 
+% Parse an interval to a degree value and a number of accidentals
+% if accidentals is positive it denotes number of sharps,
+% if it is negative it denotes number of flats.
+% If the omit interval character '*' is found then present is returned as 0 
+% otherwise it is 1. 
+%
+% Success = 1 if symbols parsed correctly, 0 otherwise.
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% returns:  degree      (integer)
+%           accidentals (integer) 
+%           present     (boolean)
+%           success     (boolean)
+%           errormessage (string)  
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [degree,accidentals,present,success, errormessage] = parseinterval(interval, verbose)
+
+if nargin < 2
+    verbose = 0;
+end
+
+ilength = length(interval);
+
+errormessage = '';
+accidentals = 0;
+degree = 0;
+success=1;
+present = 1;
+
+index = 1;
+ 
+% if the input string is not empty   
+if (isempty(interval) == 0)
+
+    
+    % check for omit interval '*'
+    if interval(index) == '*' 
+        present = 0;
+        index = index +1;
+    end
+
+
+    tempstring = '';
+    tempindex = 1;
+    % parse the interval string
+    while index <= ilength
+
+        switch interval(index)
+
+            case 'b' % FLAT
+                accidentals = accidentals - 1; %decrement accidental count
+                index = index + 1;
+
+            case '#' % SHARP
+                accidentals = accidentals + 1; %increment accidental count
+                index = index + 1;
+             
+            case {'1','2','3','4','5','6','7','8','9'}
+                % if neither of the above then remaining string should be
+                % an integer degree value
+                %tempstring(tempindex) = interval(index);
+                
+                %tempindex = tempindex+1;
+                %index = index+1;
+                success=1;
+                break
+                
+            otherwise
+                % unrecognised symbol
+                success=0;
+                break; %index = ilength+1;
+        end
+    end
+else
+    success=0;
+end
+
+if success
+
+% convert the degree string to an integer
+    [degree, success] = str2num(interval(index:end)); 
+
+    % check it worked and that the degree is valid
+    if isempty(degree) || (degree <= 0) 
+        success = 0; 
+    end
+end            
+
+if(success==0) % correct interval therefore return success = 1 
+    % if not an integer then the interval string is incorrect
+    errormessage = sprintf(['Error in parseinterval: Unrecognised interval "' interval '"\n']);
+    degree = 0;
+    if verbose == 1
+        fprintf(1, errormessage);
+    end
+    
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/parseintervals.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,121 @@
+%
+% PARSEINTERVALS
+% 
+% [parintervals, success, errormessage] = parseintervals(interval_list, {verbose})
+% 
+% Parses a comma delimited list of intervals to an array of degrees, their 
+% associated accidentals and whether or not they are present (presence 
+% denoted by a '*' in front of an interval in the input interval_list). 
+%
+% Success = 1 if symbols parsed correctly, 0 otherwise.
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls parseinterval
+% 
+% returns:  intervals     (array of int: [degree,accidental,present])
+%           success       (boolean)
+%           errormessage  (string) 
+% 
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [parintervals, success, errormessage] = parseintervals(interval_list, verbose)
+
+% set verbose default to 0
+if nargin < 2
+    verbose = 0;
+end
+
+errormessage = '';
+
+ilength = length(interval_list);
+
+index = 1;
+
+tempindex = 1;
+
+tempstring = '';
+
+success = 1;
+
+parindex  = 1;
+
+parintervals = [];
+
+
+while index <= ilength
+    
+   
+    while (interval_list(index) ~= ',')  
+        
+        tempstring(tempindex) = interval_list(index);
+        tempindex = tempindex +1;
+        index = index + 1;
+        
+        if(index > ilength)
+            break;
+        end
+        
+        if (interval_list(index) == ',') && (index == ilength)
+            success = 0;
+            errormessage = sprintf(['Error in parseintervals: interval list finishes with a comma "' interval_list '"\n']);
+        end
+            
+            
+    end
+    
+        [parintervals(parindex,1),parintervals(parindex,2),parintervals(parindex,3),ok, error] = parseinterval(tempstring);
+        % concatenate error messages if there are any...
+        errormessage = [errormessage error];
+        
+        if(ok == 1)
+            tempstring = '';
+            tempindex = 1;
+            parindex = parindex + 1;
+            index = index + 1;
+        else
+
+            errormessage = [errormessage sprintf(['Error in parseintervals: incorrect interval in list "' interval_list '"\n'])];
+            success = 0;
+            index = ilength +1;            
+        end
+    
+    
+end
+
+if (success == 0) && (verbose == 1)
+
+    fprintf(1,errormessage)
+    
+end    
+
+
+    
+              
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/parsenote.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,102 @@
+%
+% PARSENOTE
+% 
+% [natural, accidentals, success, errormessage] = parsenote(note, {verbose})
+% 
+% Parse a note to a natural character value and a number of accidentals
+% if accidentals is positive it denotes number of sharps,
+% if it is negative it denotes number of flats.
+%
+% Success = 1 if symbols parsed correctly, 0 otherwise.
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% returns:  natural     (char)
+%           accidentals (integer) 
+%           success     (boolean)
+%           errormessage (string)
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [natural,accidentals,success, errormessage] = parsenote(note, verbose)
+
+if nargin < 2
+    verbose = 0;
+end
+
+errormessage = '';
+
+ilength = length(note);
+
+accidentals = 0;
+natural = [];
+success=1;
+
+index = 1;
+
+if (isempty(note))  % if we have been passed an empty string
+    success=0;
+
+else  % parse the note string
+  
+    switch(note(index))
+
+        case {'A','B','C','D','E','F','G'}
+
+            %first character should be a natural
+            natural = note(index);
+            index= index+1;
+
+            %remaining characters should be sharps or flats
+            while index <= ilength
+
+                switch note(index)
+
+                    case 'b' % FLAT
+                        accidentals = accidentals - 1; %decrement accidental count
+                        index = index + 1;
+
+                    case '#' % SHARP
+                        accidentals = accidentals + 1; %increment accidental count
+                        index = index + 1;
+
+                    otherwise
+                        % if neither of the above then the note is incorrect
+                        success=0;
+                        index = ilength+1;
+                end
+            end
+
+        otherwise
+            success=0;        
+    end
+end
+    
+if(success==0) % correct note therefore return success = 1 
+    % if not an integer then the note string is incorrect
+    errormessage = sprintf(['Error in parsenote: Unrecognised note "' note '"\n']); 
+    
+    if verbose ==1
+        fprintf(1,errormessage);
+    end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/short2quality.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,115 @@
+%
+%SHORT2QUALITY return the quality of a given shorthand string
+% 
+% [quality,success, errormessage] = short2quality(shorthand, {verbose})
+% 
+% Returns the quality of a given shorthand string. Quality values are from 
+% the enumeration:
+%
+% 0   Major
+% 1   Minor
+% 2   Diminished
+% 3   Augmented
+% 4   Suspended
+% 
+%
+% Success = 1 if symbols parsed correctly, 0 otherwise. 
+%
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% calls:   
+% 
+% returns:  quality (integer)
+%           success  (boolean)  
+%           errormessage (string)
+%
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [quality,success,errormessage] = short2quality(shorthand,verbose)
+
+if nargin < 2
+    verbose = 0;
+end
+
+success = 1;
+errormessage = '';
+quality = '';
+
+switch shorthand
+    
+        
+    % triads
+    case 'maj'
+        quality = 0;        
+    case 'min' 
+        quality = 1;        
+    case 'dim' 
+        quality = 2;    
+    case 'aug' 
+        quality = 3;
+        
+    % sevenths    
+    case 'maj7' 
+        quality = 0;
+    case 'min7' 
+        quality = 1;
+    case '7' 
+        quality = 0;        
+    case 'minmaj7' 
+        quality = 1;        
+    case 'dim7' 
+        quality = 2;
+    case 'hdim7'
+        quality = 2;
+ 
+    % sixths
+    case 'maj6'
+        quality = 0;        
+    case 'min6' 
+        quality = 1;
+
+    % ninths 
+ 
+    case '9'
+        quality = 0;          
+    case 'maj9'
+        quality = 0;    
+    case 'min9'
+        quality = 1;    
+
+    % suspended
+    case 'sus4'
+        quality = 4;
+    case 'sus2'
+        quality = 4;
+        
+    otherwise
+        success = 0;
+        errormessage = ['Error in short2quality: unrecognised shorthand: ' shorthand];
+end
+
+        
+if (success ==0) && (verbose == 1)
+    fprintf(1,errormessage);
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/shorthand2intervals.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,115 @@
+%
+% SHORTHAND2INTERVALS
+% 
+% [interval_list, success, errormessage] = shorthand2intervals(shorthand, {verbose})
+% 
+% Converts a shorthand string to an interval-list
+% 
+% Success = 1 if shorthand is recognised, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% returns:  interval_list (string)
+%           success (boolean)
+%           errormessage (string)
+%
+% This function replaces the old shorthand2degrees from version 1.0 of the
+% toolkit.
+%
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%
+function [interval_list, success, errormessage] = shorthand2intervals(shorthand, verbose)
+
+%set verbose to default to 0;;
+if nargin <2
+    verbose = 0;
+end
+
+interval_list = '';
+errormessage = '';
+
+success = 1;
+
+switch(shorthand)
+    
+    % Empty:
+    case ''
+        interval_list = ''; %empty interval_list
+        
+    % Triad chords:
+    case 'maj'
+        interval_list = '1,3,5'; % major
+    case 'min'
+        interval_list = '1,b3,5'; % minor
+    case 'dim'
+        interval_list = '1,b3,b5'; % diminished  
+    case 'aug'
+        interval_list = '1,3,#5'; % augmented
+    
+    % Seventh chords:
+    case 'maj7'
+        interval_list = '1,3,5,7'; %major seventh
+    case 'min7'
+        interval_list = '1,b3,5,b7'; % minor seventh
+    case '7'
+        interval_list = '1,3,5,b7'; % seventh
+    case 'dim7'
+        interval_list = '1,b3,b5,bb7'; % diminished seventh
+    case 'hdim7'
+        interval_list = '1,b3,b5,b7'; % half diminished seventh
+    case 'minmaj7'
+        interval_list = '1,b3,5,7'; % minor (major seventh)
+        
+    % Sixth Chords:    
+    case 'maj6'
+        interval_list = '1,3,5,6'; % major sixth
+    case 'min6'
+        interval_list = '1,b3,5,6'; % minor sixth
+        
+    % Ninth chords:
+    case 'maj9'
+        interval_list = '1,3,5,7,9'; % major ninth
+    case 'min9'
+        interval_list = '1,b3,5,b7,9'; % minor ninth
+    case '9'
+        interval_list = '1,3,5,b7,9'; % ninth
+
+    case 'sus2'
+        interval_list = '1,2,5'; % suspended second        
+    case 'sus4'
+        interval_list = '1,4,5'; % suspended fourth
+        
+    otherwise
+        errormessage = sprintf(['Error in shorthand2degrees: Unrecognised shorthand string "' shorthand '"\n']);
+        if verbose == 1
+            fprintf(1,errormessage);
+        end
+        success = 0;
+        
+end
+
+
+   
+    
+        
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/syntaxcheck.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,58 @@
+%
+%SYNTAXCHECK Checks symbol for correct syntax. 
+% 
+% [success, errormessage] = syntaxcheck(chordsymbol, {verbose})
+% 
+% Checks symbol for correct syntax and checks for valid note, shorthand 
+% and interval values. 
+%
+% calls getchordinfo
+% 
+% Success = 1 if symbol has correct syntax, 0 otherwise.
+% 
+% If optional argument 'verbose' is 1, function prints any errormessage to 
+% the screen.
+% 
+% Returns:  chordinfo (struct)
+%           success (boolean) true or false for correct syntax 
+%           errormessage (string)  
+%     
+% See also: getchordinfo
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+%		
+function [success, errormessage] = syntaxcheck(chordsymbol, verbose)
+
+if nargin < 2
+    verbose = 0;
+end
+    
+errormessage = '';
+chordinfo = [];
+
+success = 0;
+
+[root,short,intervals,bass, success, errormessage] = getchordinfo(chordsymbol,verbose);
+
+if (success ==0) && (verbose == 1)
+    fprintf(1,errormessage);
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/testlog.log	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,420 @@
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//01_-_Sgt._Pepper's_Lonely_Hearts_Club_Band.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//02_-_With_A_Little_Help_From_My_Friends.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//03_-_Lucy_In_The_Sky_With_Diamonds.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//04_-_Getting_Better.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//01_-_Sgt._Pepper's_Lonely_Hearts_Club_Band.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//02_-_With_A_Little_Help_From_My_Friends.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//03_-_Lucy_In_The_Sky_With_Diamonds.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//01_-_Sgt._Pepper's_Lonely_Hearts_Club_Band.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//02_-_With_A_Little_Help_From_My_Friends.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//03_-_Lucy_In_The_Sky_With_Diamonds.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//04_-_Getting_Better.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//05_-_Fixing_A_Hole.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//06_-_She's_Leaving_Home.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//07_-_Being_For_The_Benefit_Of_Mr._Kite!.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//08_-_Within_You_Without_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//09_-_When_I'm_Sixty-Four.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//10_-_Lovely_Rita.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//11_-_Good_Morning_Good_Morning.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//12_-_Sgt._Pepper's_Lonely_Hearts_Club_Band_(Reprise).lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band//13_-_A_Day_In_The_Life.lab ***
+
+Time: 105.436575 seconds
+Error in getchordinfo: syntax incorrect in chord symbol: "E:min(*3)/5" 
+Error in checkommisions: ommitted interval not present in shorthand. 
+
+
+Time: 106.969092 seconds
+Error in getchordinfo: syntax incorrect in chord symbol: "C#:maj7(*b5)" 
+Error in checkommisions: ommitted interval not present in shorthand. 
+
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/01_-_I_Saw_Her_Standing_There.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/02_-_Misery.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/03_-_Anna_(Go_To_Him).lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/04_-_Chains.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/05_-_Boys.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/06_-_Ask_Me_Why.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/07_-_Please_Please_Me.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/08_-_Love_Me_Do.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/09_-_P._S._I_Love_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/10_-_Baby_It's_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/11_-_Do_You_Want_To_Know_A_Secret.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/12_-_A_Taste_Of_Honey.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/13_-_There's_A_Place.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/14_-_Twist_And_Shout.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/01_-_It_Won't_Be_Long.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/02_-_All_I've_Got_To_Do.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/03_-_All_My_Loving.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/04_-_Don't_Bother_Me.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/05_-_Little_Child.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/06_-_Till_There_Was_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/07_-_Please_Mister_Postman.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/08_-_Roll_Over_Beethoven.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/09_-_Hold_Me_Tight.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/10_-_You_Really_Got_A_Hold_On_Me.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/11_-_I_Wanna_Be_Your_Man.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/12_-_Devil_In_Her_Heart.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/13_-_Not_A_Second_Time.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/14_-_Money.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/01_-_A_Hard_Day's_Night.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/02_-_I_Should_Have_Known_Better.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/03_-_If_I_Fell.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/04_-_I'm_Happy_Just_To_Dance_With_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/05_-_And_I_Love_Her.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/06_-_Tell_Me_Why.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/07_-_Can't_Buy_Me_Love.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/08_-_Any_Time_At_All.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/09_-_I'll_Cry_Instead.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/10_-_Things_We_Said_Today.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/11_-_When_I_Get_Home.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/12_-_You_Can't_Do_That.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/13_-_I'll_Be_Back.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/01_-_No_Reply.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/02_-_I'm_a_Loser.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/03_-_Baby's_In_Black.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/04_-_Rock_and_Roll_Music.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/05_-_I'll_Follow_the_Sun.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/06_-_Mr._Moonlight.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/07_-_Kansas_City-_Hey,_Hey,_Hey,_Hey.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/08_-_Eight_Days_a_Week.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/09_-_Words_of_Love.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/10_-_Honey_Don't.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/11_-_Every_Little_Thing.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/12_-_I_Don't_Want_to_Spoil_the_Party.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/13_-_What_You're_Doing.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/14_-_Everybody's_Trying_to_Be_My_Baby.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/01_-_Help!.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/02_-_The_Night_Before.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/03_-_You've_Got_To_Hide_Your_Love_Away.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/04_-_I_Need_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/05_-_Another_Girl.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/06_-_You're_Going_to_Lose_That_Girl.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/07_-_Ticket_To_Ride.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/08_-_Act_Naturally.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/09_-_It's_Only_Love.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/10_-_You_Like_Me_Too_Much.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/11_-_Tell_Me_What_You_See.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/12_-_I've_Just_Seen_a_Face.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/13_-_Yesterday.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/14_-_Dizzy_Miss_Lizzy.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/01_-_Drive_My_Car.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/02_-_Norwegian_Wood_(This_Bird_Has_Flown).lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/03_-_You_Won't_See_Me.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/04_-_Nowhere_Man.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/05_-_Think_For_Yourself.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/06_-_The_Word.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/07_-_Michelle.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/08_-_What_Goes_On.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/09_-_Girl.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/10_-_I'm_Looking_Through_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/11_-_In_My_Life.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/12_-_Wait.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/13_-_If_I_Needed_Someone.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/14_-_Run_For_Your_Life.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/01_-_Taxman.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/02_-_Eleanor_Rigby.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/03_-_I'm_Only_Sleeping.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/04_-_Love_You_To.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/05_-_Here,_There_And_Everywhere.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/06_-_Yellow_Submarine.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/07_-_She_Said_She_Said.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/08_-_Good_Day_Sunshine.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/09_-_And_Your_Bird_Can_Sing.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/10_-_For_No_One.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/11_-_Doctor_Robert.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/12_-_I_Want_To_Tell_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/13_-_Got_To_Get_You_Into_My_Life.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/14_-_Tomorrow_Never_Knows.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/01_-_Sgt._Pepper's_Lonely_Hearts_Club_Band.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/02_-_With_A_Little_Help_From_My_Friends.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/03_-_Lucy_In_The_Sky_With_Diamonds.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/04_-_Getting_Better.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/05_-_Fixing_A_Hole.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/06_-_She's_Leaving_Home.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/07_-_Being_For_The_Benefit_Of_Mr._Kite!.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/08_-_Within_You_Without_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/09_-_When_I'm_Sixty-Four.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/10_-_Lovely_Rita.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/11_-_Good_Morning_Good_Morning.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/12_-_Sgt._Pepper's_Lonely_Hearts_Club_Band_(Reprise).lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/13_-_A_Day_In_The_Life.lab ***
+
+Time: 105.436575 seconds
+Error in getchordinfo: syntax incorrect in chord symbol: "E:min(*3)/5" 
+Error in checkommisions: ommitted interval not present in shorthand. 
+
+
+Time: 106.969092 seconds
+Error in getchordinfo: syntax incorrect in chord symbol: "C#:maj7(*b5)" 
+Error in checkommisions: ommitted interval not present in shorthand. 
+
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/01_-_Magical_Mystery_Tour.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/02_-_The_Fool_On_The_Hill.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/03_-_Flying.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/04_-_Blue_Jay_Way.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/05_-_Your_Mother_Should_Know.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/06_-_I_Am_The_Walrus.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/07_-_Hello_Goodbye.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/08_-_Strawberry_Fields_Forever.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/09_-_Penny_Lane.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/10_-_Baby_You're_A_Rich_Man.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/11_-_All_You_Need_Is_Love.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_01_-_Back_in_the_USSR.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_02_-_Dear_Prudence.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_03_-_Glass_Onion.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_04_-_Ob-La-Di,_Ob-La-Da.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_05_-_Wild_Honey_Pie.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_06_-_The_Continuing_Story_of_Bungalow_Bill.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_07_-_While_My_Guitar_Gently_Weeps.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_08_-_Happiness_is_a_Warm_Gun.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_09_-_Martha_My_Dear.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_10_-_I'm_So_Tired.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_11_-_Black_Bird.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_12_-_Piggies.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_13_-_Rocky_Raccoon.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_14_-_Don't_Pass_Me_By.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_15_-_Why_Don't_We_Do_It_In_The_Road.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_16_-_I_Will.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_17_-_Julia.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_01_-_Birthday.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_02_-_Yer_Blues.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_03_-_Mother_Nature's_Son.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_04_-_Everybody's_Got_Something_To_Hide_Except_Me_and_My_Monkey.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_05_-_Sexy_Sadie.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_06_-_Helter_Skelter.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_07_-_Long_Long_Long.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_08_-_Revolution_1.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_09_-_Honey_Pie.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_10_-_Savoy_Truffle.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_11_-_Cry_Baby_Cry.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_12_-_Revolution_9.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_13_-_Good_Night.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/01_-_Come_Together.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/02_-_Something.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/03_-_Maxwell's_Silver_Hammer.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/04_-_Oh!_Darling.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/05_-_Octopus's_Garden.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/06_-_I_Want_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/07_-_Here_Comes_The_Sun.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/08_-_Because.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/09_-_You_Never_Give_Me_Your_Money.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/10_-_Sun_King.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/11_-_Mean_Mr_Mustard.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/12_-_Polythene_Pam.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/13_-_She_Came_In_Through_The_Bathroom_Window.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/14_-_Golden_Slumbers.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/15_-_Carry_That_Weight.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/16_-_The_End.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/17_-_Her_Majesty.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/01_-_Two_of_Us.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/02_-_Dig_a_Pony.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/03_-_Across_the_Universe.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/04_-_I_Me_Mine.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/05_-_Dig_It.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/06_-_Let_It_Be.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/07_-_Maggie_Mae.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/08_-_I've_Got_A_Feeling.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/09_-_One_After_909.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/10_-_The_Long_and_Winding_Road.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/11_-_For_You_Blue.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/12_-_Get_Back.lab ***
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/testlog2.log	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,360 @@
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/01_-_I_Saw_Her_Standing_There.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/02_-_Misery.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/03_-_Anna_(Go_To_Him).lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/04_-_Chains.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/05_-_Boys.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/06_-_Ask_Me_Why.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/07_-_Please_Please_Me.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/08_-_Love_Me_Do.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/09_-_P._S._I_Love_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/10_-_Baby_It's_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/11_-_Do_You_Want_To_Know_A_Secret.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/12_-_A_Taste_Of_Honey.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/13_-_There's_A_Place.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/01_-_Please_Please_Me/14_-_Twist_And_Shout.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/01_-_It_Won't_Be_Long.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/02_-_All_I've_Got_To_Do.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/03_-_All_My_Loving.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/04_-_Don't_Bother_Me.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/05_-_Little_Child.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/06_-_Till_There_Was_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/07_-_Please_Mister_Postman.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/08_-_Roll_Over_Beethoven.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/09_-_Hold_Me_Tight.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/10_-_You_Really_Got_A_Hold_On_Me.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/11_-_I_Wanna_Be_Your_Man.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/12_-_Devil_In_Her_Heart.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/13_-_Not_A_Second_Time.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/02_-_With_the_Beatles/14_-_Money.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/01_-_A_Hard_Day's_Night.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/02_-_I_Should_Have_Known_Better.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/03_-_If_I_Fell.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/04_-_I'm_Happy_Just_To_Dance_With_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/05_-_And_I_Love_Her.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/06_-_Tell_Me_Why.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/07_-_Can't_Buy_Me_Love.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/08_-_Any_Time_At_All.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/09_-_I'll_Cry_Instead.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/10_-_Things_We_Said_Today.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/11_-_When_I_Get_Home.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/12_-_You_Can't_Do_That.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/03_-_A_Hard_Day's_Night/13_-_I'll_Be_Back.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/01_-_No_Reply.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/02_-_I'm_a_Loser.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/03_-_Baby's_In_Black.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/04_-_Rock_and_Roll_Music.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/05_-_I'll_Follow_the_Sun.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/06_-_Mr._Moonlight.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/07_-_Kansas_City-_Hey,_Hey,_Hey,_Hey.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/08_-_Eight_Days_a_Week.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/09_-_Words_of_Love.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/10_-_Honey_Don't.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/11_-_Every_Little_Thing.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/12_-_I_Don't_Want_to_Spoil_the_Party.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/13_-_What_You're_Doing.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/04_-_Beatles_for_Sale/14_-_Everybody's_Trying_to_Be_My_Baby.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/01_-_Help!.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/02_-_The_Night_Before.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/03_-_You've_Got_To_Hide_Your_Love_Away.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/04_-_I_Need_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/05_-_Another_Girl.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/06_-_You're_Going_to_Lose_That_Girl.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/07_-_Ticket_To_Ride.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/08_-_Act_Naturally.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/09_-_It's_Only_Love.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/10_-_You_Like_Me_Too_Much.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/11_-_Tell_Me_What_You_See.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/12_-_I've_Just_Seen_a_Face.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/13_-_Yesterday.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/05_-_Help!/14_-_Dizzy_Miss_Lizzy.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/01_-_Drive_My_Car.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/02_-_Norwegian_Wood_(This_Bird_Has_Flown).lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/03_-_You_Won't_See_Me.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/04_-_Nowhere_Man.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/05_-_Think_For_Yourself.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/06_-_The_Word.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/07_-_Michelle.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/08_-_What_Goes_On.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/09_-_Girl.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/10_-_I'm_Looking_Through_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/11_-_In_My_Life.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/12_-_Wait.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/13_-_If_I_Needed_Someone.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/06_-_Rubber_Soul/14_-_Run_For_Your_Life.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/01_-_Taxman.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/02_-_Eleanor_Rigby.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/03_-_I'm_Only_Sleeping.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/04_-_Love_You_To.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/05_-_Here,_There_And_Everywhere.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/06_-_Yellow_Submarine.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/07_-_She_Said_She_Said.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/08_-_Good_Day_Sunshine.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/09_-_And_Your_Bird_Can_Sing.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/10_-_For_No_One.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/11_-_Doctor_Robert.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/12_-_I_Want_To_Tell_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/13_-_Got_To_Get_You_Into_My_Life.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/07_-_Revolver/14_-_Tomorrow_Never_Knows.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/01_-_Sgt._Pepper's_Lonely_Hearts_Club_Band.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/02_-_With_A_Little_Help_From_My_Friends.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/03_-_Lucy_In_The_Sky_With_Diamonds.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/04_-_Getting_Better.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/05_-_Fixing_A_Hole.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/06_-_She's_Leaving_Home.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/07_-_Being_For_The_Benefit_Of_Mr._Kite!.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/08_-_Within_You_Without_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/09_-_When_I'm_Sixty-Four.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/10_-_Lovely_Rita.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/11_-_Good_Morning_Good_Morning.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/12_-_Sgt._Pepper's_Lonely_Hearts_Club_Band_(Reprise).lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/08_-_Sgt._Pepper's_Lonely_Hearts_Club_Band/13_-_A_Day_In_The_Life.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/01_-_Magical_Mystery_Tour.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/02_-_The_Fool_On_The_Hill.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/03_-_Flying.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/04_-_Blue_Jay_Way.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/05_-_Your_Mother_Should_Know.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/06_-_I_Am_The_Walrus.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/07_-_Hello_Goodbye.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/08_-_Strawberry_Fields_Forever.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/09_-_Penny_Lane.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/10_-_Baby_You're_A_Rich_Man.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/09_-_Magical_Mystery_Tour/11_-_All_You_Need_Is_Love.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_01_-_Back_in_the_USSR.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_02_-_Dear_Prudence.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_03_-_Glass_Onion.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_04_-_Ob-La-Di,_Ob-La-Da.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_05_-_Wild_Honey_Pie.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_06_-_The_Continuing_Story_of_Bungalow_Bill.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_07_-_While_My_Guitar_Gently_Weeps.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_08_-_Happiness_is_a_Warm_Gun.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_09_-_Martha_My_Dear.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_10_-_I'm_So_Tired.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_11_-_Black_Bird.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_12_-_Piggies.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_13_-_Rocky_Raccoon.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_14_-_Don't_Pass_Me_By.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_15_-_Why_Don't_We_Do_It_In_The_Road.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_16_-_I_Will.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD1_-_The_Beatles/CD1_-_17_-_Julia.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_01_-_Birthday.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_02_-_Yer_Blues.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_03_-_Mother_Nature's_Son.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_04_-_Everybody's_Got_Something_To_Hide_Except_Me_and_My_Monkey.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_05_-_Sexy_Sadie.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_06_-_Helter_Skelter.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_07_-_Long_Long_Long.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_08_-_Revolution_1.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_09_-_Honey_Pie.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_10_-_Savoy_Truffle.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_11_-_Cry_Baby_Cry.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_12_-_Revolution_9.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/10CD2_-_The_Beatles/CD2_-_13_-_Good_Night.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/01_-_Come_Together.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/02_-_Something.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/03_-_Maxwell's_Silver_Hammer.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/04_-_Oh!_Darling.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/05_-_Octopus's_Garden.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/06_-_I_Want_You.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/07_-_Here_Comes_The_Sun.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/08_-_Because.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/09_-_You_Never_Give_Me_Your_Money.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/10_-_Sun_King.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/11_-_Mean_Mr_Mustard.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/12_-_Polythene_Pam.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/13_-_She_Came_In_Through_The_Bathroom_Window.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/14_-_Golden_Slumbers.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/15_-_Carry_That_Weight.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/16_-_The_End.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/11_-_Abbey_Road/17_-_Her_Majesty.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/01_-_Two_of_Us.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/02_-_Dig_a_Pony.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/03_-_Across_the_Universe.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/04_-_I_Me_Mine.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/05_-_Dig_It.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/06_-_Let_It_Be.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/07_-_Maggie_Mae.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/08_-_I've_Got_A_Feeling.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/09_-_One_After_909.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/10_-_The_Long_and_Winding_Road.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/11_-_For_You_Blue.lab ***
+
+*** File: /media/data/beatles chord transcriptions 1.3/12_-_Let_It_Be/12_-_Get_Back.lab ***
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chordtools/types.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,114 @@
+%
+%TYPES for C4DM Chord Toolkit
+% 
+% Help file on types, structures and enumerations used in chord symbol
+% toolbox
+% 
+%
+% *** STRING TYPES ***
+%
+%NATURAL
+% 
+% Character A|B|C|D|E|F|G
+% 
+% 
+%MODIFIER
+% 
+% Character b|#
+% 
+% 
+%NOTE
+% 
+% Character string containing one natural and optional modifiers. 
+% Modifiers may only occur after the natural. 
+% 
+% note = <natural> | <note> <modifier>
+% 
+% 
+%INTERVAL
+% 
+% Character string containing one degree and optional modifiers.
+% Modifiers may only occur before the degree.
+% 
+% interval =  <degree> | <modifier> <interval>
+% 
+%
+% *** OTHER TYPES ***
+%
+%DEGREE
+% 
+% Integer which can take values in the range 1 to 13
+%
+%
+%ACCIDENTALS
+% 
+% signed integer number of sharps or flats.  If positive then denotes 
+% sharps, if negative then denotes flats.
+% 
+% 
+%SEMITONE
+% 
+% Integer value signifying a relative number of semitones. 
+% 
+% 
+%PITCHCLASS
+% 
+% Integer value between 0 and 11 enumerating pitch classes with C as
+% reference pitch class 0.
+% 
+% 
+%CHORDTYPE
+% 
+% Enumerates shorthand chordtypes
+% 
+% 0   maj 
+% 1   min 
+% 2   dim 
+% 3   aug 
+% 4   maj7 
+% 5   min7 
+% 6   7 
+% 7   dim7 
+% 8   hdim7 
+% 9   minmaj7 
+% 10  maj6 
+% 11  min6 
+% 12  9 
+% 13  maj9 
+% 14  min9 
+% 15  sus4 
+% 16  sus2
+% 
+%QUALITY
+% 
+% Enumerates chord quality
+% 
+% 0   Major
+% 1   Minor
+% 2   Diminished
+% 3   Augmented
+% 4   Suspended
+% 
+% 
+%
+%
+% Author: Christopher Harte, March 2009
+% 
+% Copyright: Centre for Digital Music, Queen Mary University of London 2005 
+%
+% This file is part of the C4DM Chord Toolkit V2.0  
+%
+% The C4DM Chord Toolkit is free software; you can redistribute it and/or 
+% modify it under the terms of the GNU General Public License as published 
+% by the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% The C4DM Chord Toolkit is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with the C4DM Toolkit; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+%
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/cell2list.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,15 @@
+
+function list = cell2list(cells, separator)
+
+list = '';
+
+if ~isempty(cells)
+
+    list = cells{1};
+
+    for i = 2:length(cells)
+        
+        list = [list separator cells{i}];
+        
+    end
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/comparechords.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,165 @@
+
+%COMPARECHORDS
+%
+% [match,success,errormessage] = comparechords(chord1, chord2, comparison,
+% cardinality, inversion,verbose)
+%
+%
+% COMPARISON OPTIONS:
+%
+% CHORDS
+% s = string comparison
+% ov = ordered pnset comparison
+% op = ordered pcset comparison
+% uv = ordered pnset comparison
+% up = ordered pcset comparison
+% 
+% mx08 = compare using MIREX08 chord mapping
+% mx09 = compare using MIREX09 chord mapping
+%
+% CHORDTYPES (root-blind)
+% q = quality
+% oi = ordered relative interval comparison
+% or = ordered relative pitchclass set comparison
+% ui = unordered relative interval comparison
+% ur = unordered relative pitchclass set comparison
+
+
+function [match,success,errormessage] = comparechords2(chord1, chord2, comparison, cardinality, inversion,verbose)
+
+errormessage = '';
+success = 1;
+match = 0;
+
+% remember these just in case there is an error to report
+c1 = chord1;
+c2 = chord2;
+
+% initialise things if not specified...
+if  nargin<3
+    comparison = 's';
+end
+
+if  nargin<4
+    cardinality = 6; % maximum cardinality in beatles collection
+end
+
+if  nargin<5
+    inversion = 1;  % assume people want to keep inversion information
+end
+
+if  nargin<6
+    verbose = 0;  
+end
+
+
+
+% if inversion is 0, strip bass intervals off the chords if they have them
+if inversion==0
+   chord1 = stripinversion(chord1); 
+   chord2 = stripinversion(chord2);   
+end
+   
+mx=0;
+% strip roots from chords and replace with C if this is a chordtype comparison
+switch lower(comparison)
+
+    case  {'mx08','mx09'}
+        mx=1;
+        
+    case {'q','oi','or','ui','ur'}
+        chord1 = striproot(chord1,1);
+        chord2 = striproot(chord2,1);
+        
+    case {'s','ov','op','uv','up'}
+        % do nothing in this case...
+        
+    otherwise
+        % not a recognised option so exit with errormessage
+        errormessage = 'Error in comparechords: unrecognised comparison type';
+        success = 0;
+        
+end
+
+
+if (success)
+    if mx
+        
+        % use a mirex 08/09 comparison
+        
+        year = str2num(comparison(3:4));
+        
+        if isempty(year)
+            success = 0;
+        else
+
+           [val1,success] = mxmap(chord1, year);
+           if success
+                [val2,success] = mxmap(chord2, year);
+            
+                if success
+                   if abs(val1-val2)==0
+                       match = 1;              
+                   end
+                end
+            end
+        end
+        
+    else
+        
+       
+        if length(comparison)==2
+            % if the comparison is 2 chars then it is a set-matching option
+            switch comparison
+                case {'oi','ov','uv','ui'}
+                    [set1x,bn,success,errormessage] = chord2notes(chord1,1);
+                    if success
+                        [set2x,bn,success,errormessage] = chord2notes(chord2,1);
+                        % cludge to get the sets the right way round, fix
+                        % later...
+                        if success
+                            set1 = set1x';
+                            set2 = set2x';
+                        end
+                    end
+                case {'ur','or','op','up'}
+                    [set1, bc1, success,errormessage] = chord2pitchclasses(chord1);
+                    if success
+                        [set2, bc2,success,errormessage] = chord2pitchclasses(chord2);
+                    end
+                otherwise
+                    %by this stage there shouldn't be an otherwise...
+                    success = 0;
+            end
+
+
+            if success
+                switch comparison
+                    case {'ui','ur','uv','up'}
+                      % do an unordered match 
+                        [match,success,errormessage] = compareunorderedsets(set1,set2,cardinality);    
+
+                    case {'ov','op','oi','or'}
+                      % do an ordered match
+                        [match,success,errormessage] = compareorderedsets(set1,set2,cardinality);    
+
+                    otherwise
+                        %by this stage there shouldn't be an otherwise...
+                        success = 0;
+                end
+            end
+
+        else
+            % otherwise must be a string match
+            [match,success,errormessage] = compareorderedsets(chord1,chord2);    
+        end
+    end
+end
+
+
+if success==0
+    errormessage = [errormessage sprintf(['Error in comparechords: Couldn''t compare chords "' c1 '" and "' c2 '"\n'])];
+    if verbose ==1
+       fprintf(1,errormessage);
+    end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/compareorderedsets.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,78 @@
+
+
+function [match,success,errormessage] = compareorderedsets(set1,set2,cardinality)
+
+errormessage = '';
+success = 1;
+match = 0;
+
+if nargin<3
+    cardinality = 6;
+end
+
+
+
+
+% check to see if sets are same type
+if strcmp(class(set1),class(set2))
+    % check whether dealing with strings, cell arrays of chars or arrays of ints
+    if ischar(set1)
+
+        % compare strings
+        if strcmp(set1,set2)
+            match = 1;
+        else
+            match = 0;
+        end
+    end
+    
+    if iscell(set1)
+        % compare cell arrays of characters
+
+        % fill blank spaces so that cardinalities match
+        while length(set1)<cardinality
+            set1 = [set1, '-'];
+        end    
+
+        while length(set2)<cardinality
+            set2 = [set2, '-'];
+        end    
+
+        for i = 1:cardinality
+
+            if strcmp(set1{i},set2{i})
+                match = 1;
+            else
+                match = 0;
+                break;
+            end 
+        end
+    end
+    
+	if isnumeric(set1) && isnumeric(set2)
+        % compare integers
+
+            % fill blank spaces so that cardinalities match
+        while length(set1)<cardinality
+            set1 = [set1,-1];
+        end    
+
+        while length(set2)<cardinality
+            set2 = [set2,-1];
+        end    
+
+        for i = 1:cardinality
+
+            if set1(i)==set2(i)
+                match = 1;
+            else
+                match = 0;
+                break;
+            end 
+        end
+    end
+else
+    % trying to compare mixed data types   
+    errormessage = 'Error in compareorderedsets: trying to compare mixed data types';
+    success= 0;   
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/compareunorderedsets.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,41 @@
+
+function [match,success,errormessage] = compareunorderedsets(set1,set2,cardinality)
+
+
+if nargin<3
+    cardinality = 6;
+end
+
+
+
+errormessage = '';
+success = 1;
+match = 0;
+
+
+
+if strcmp(class(set1),class(set2))
+
+
+        % make sure that the sets don't contain duplicate objects
+        X = unique(set1);
+        Y = unique(set2);
+
+
+        u = length(intersect(X,Y));
+
+        m = min(cardinality,max(length(X),length(Y)));
+
+        if u >= m
+
+            match = 1;
+
+        else
+
+            match = 0;
+
+        end
+else
+     success = 0;
+     errormessage = 'Error in compareunorderedsets: trying to compare mixed data types';
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/format_recall_results.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,27 @@
+
+
+function  outtext = format_recall_results(results, params, algonames, songnames)
+
+[algorithms, songs] = size(results(:,:,1));
+
+outtext = ['Recall results \nComparison ' params.comparison  ...
+           '\nCardinality ' num2str(params.cardinality)   ...
+           '\nInversion ' num2str(params.inversion)  ...
+           '\nDictionary ' cell2list(params.dictionary, ', ') ...
+           '\nFrame rate ' num2str(params.framerate) ...
+           '\n\n Song name; ' cell2list(algonames, ';;')];
+
+
+       
+           
+for i = 1:songs
+    
+     outtext = [outtext '\n' songnames{i} ';' ];
+    
+    for j = 1:algorithms
+        
+       outtext = [outtext num2str(results(j,i,1)) ';' num2str(results(j,i,2)) ';'];
+          
+    end
+    
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/get_all_recall_results.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,136 @@
+
+
+E_directory = '/media/data/matlab-work/mirex_results/converted';
+
+A_directory = '/media/data/beatles chord transcriptions 1.3/';
+
+results_dir = '/media/data/matlab-work/mirex_results/recall1' 
+
+
+folders = {'de','ko1','ko2','md','ogf1','ogf2','pp','pvm1','pvm2','rrhs1','rrhs2','rrhs3'};
+
+beatles_A_names = readlist('beatles_A_paths.txt');
+
+beatles_E_names = readlist('beatles_names.txt');
+
+outtext = '';
+
+folder_number = length(folders);
+song_number = length(beatles_A_names);
+
+paramasarray = [];
+
+%tests to run:
+
+
+% TEST1
+
+% set the recall parameters
+params.framerate = 100; %fps 10ms frames
+params.comparison = 'mx08'; 
+params.cardinality = 3; 
+params.inversion = 0;
+params.dictionary = {};% {'N', 'X:maj', 'X:min', 'X:dim', 'X:aug'};
+
+paramsarray = [paramsarray params];
+
+
+% TEST2
+
+% set the recall parameters
+params.comparison = 'mx09'; 
+params.cardinality = 3; 
+params.inversion = 0;
+params.dictionary = {};% {'N', 'X:maj', 'X:min', 'X:dim', 'X:aug'};
+
+paramsarray = [paramsarray params];
+
+% TEST3
+
+% set the recall parameters
+params.comparison = 'op'; 
+params.cardinality = 3; 
+params.inversion = 0;
+params.dictionary = {};% {'N', 'X:maj', 'X:min', 'X:dim', 'X:aug'};
+
+paramsarray = [paramsarray params];
+
+% TEST4
+
+% set the recall parameters
+params.comparison = 'op'; 
+params.cardinality = 2; 
+params.inversion = 0;
+params.dictionary = {};% {'N', 'X:maj', 'X:min', 'X:dim', 'X:aug'};
+
+paramsarray = [paramsarray params];
+
+% TEST5
+
+% set the recall parameters
+params.comparison = 'op'; 
+params.cardinality = 3; 
+params.inversion = 0;
+params.dictionary = {'N', 'X:maj', 'X:min'};
+
+paramsarray = [paramsarray params];
+
+
+% TEST6
+
+% set the recall parameters
+params.comparison = 'op'; 
+params.cardinality = 2; 
+params.inversion = 0;
+params.dictionary = {'N', 'X:maj', 'X:min'};
+
+paramsarray = [paramsarray params];
+
+
+
+for index = 1:numparams
+    
+    params = paramsarray(index);
+    
+    results = zeros(folder_number,song_number,2);
+
+    time_resolution = 1/params.framerate; % recall time resolution = 1/fps
+
+    for i = 1:folder_number
+
+        % for each folder
+
+
+        for j = 1:song_number
+
+            % get current annotation file
+            annotations_labfile = [A_directory '/' beatles_A_names{j}]
+
+            % get current labfile
+            estimates_labfile = [E_directory '/' folders{i} '/' beatles_E_names{j}];
+
+            % sample at specified frame rate
+%            annotation_frames = lab2frames(annotations_labfile, time_resolution);
+%            estimate_frames = lab2frames(estimates_labfile, time_resolution);
+
+            % calculate recall
+%            [recall, non_dictionary] = getrecall2(estimate_frames, annotation_frames, params);
+
+            [recall, non_dictionary] = getrecall3(estimates_labfile, annotations_labfile, params);
+
+            %[segmeasure, m, f] = getsegmeasure(annotation_labfile, estimates_labfile)
+
+            results(i,j,1) = recall;
+            results(i,j,2) = non_dictionary;
+
+        end
+
+
+    end
+
+    outtext = format_recall_results(results, params, folders, beatles_A_names);
+
+    printfile(outtext, [results_dir '/recall-' datestr(now,'yyyy-mm-dd') '-' params.comparison '.txt']);
+
+end
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/get_all_seg_results.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,69 @@
+
+
+E_directory = '/media/data/matlab-work/mirex_results/converted';
+
+A_directory = '/media/data/beatles chord transcriptions 1.3/';
+
+results_dir = '/media/data/matlab-work/mirex_results/seg' 
+
+
+folders = {'ch_aes','ch_hcdf','ch_hcdfa','de','ko1','ko2','md','ogf1','ogf2','pp','pvm1','pvm2','rrhs1','rrhs2','rrhs3'};
+
+beatles_A_names = readlist('beatles_A_paths.txt');
+
+beatles_E_names = readlist('beatles_names.txt');
+
+outtext = '';
+
+folder_number = length(folders);
+song_number = length(beatles_A_names);
+
+paramasarray = [];
+
+%tests to run:
+
+
+% TEST1
+
+% set the recall parameters
+params.framerate = 100; %fps 10ms frames
+
+
+    
+    results = zeros(folder_number,song_number,6);
+
+    time_resolution = 1/params.framerate; % recall time resolution = 1/fps
+
+    for i = 1:folder_number
+
+        % for each folder
+
+
+        for j = 1:song_number
+
+            % get current annotation file
+            annotations_labfile = [A_directory '/' beatles_A_names{j}]
+
+            % get current labfile
+            estimates_labfile = [E_directory '/' folders{i} '/' beatles_E_names{j}];
+
+            [segmeasure, m, f,total_time, dAE, dEA] = getsegmeasure(annotation_labfile, estimates_labfile)
+
+            results(i,j,1) = segmeasure;
+            results(i,j,2) = m;
+            results(i,j,3) = f;
+            results(i,j,4) = total_time;
+            results(i,j,5) =  dAE;
+            results(i,j,6) =  dEA;
+
+        end
+
+
+    end
+
+    outtext = format_seg_results(results, folders, beatles_A_names);
+
+    printfile(outtext, [results_dir '/seg-' datestr(now,'yyyy-mm-dd') '.txt']);
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/getrecall.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,80 @@
+%GETRECALL get frame-based chord symbol recall
+%
+%[recall, nondictionary] = getrecall(estimates, annotations,cardinality)
+% 
+% params.comparison = 'ov'; 
+% params.cardinality = 3; 
+% params.inversion = 0;
+% params.dictionary = {'X:maj', 'X:min'};
+
+function [recall, nondictionary] = getrecall3(estimates_labfile, annotations_labfile,params)
+
+
+[at1, at2, as] = merge_repeats(annotations_labfile);
+
+[et1, et2, es] = merge_repeats(estimates_labfile);
+
+
+%indeces for E and A
+i = 1;
+j = 1;
+
+ilength = length(et1);
+jlength = length(at1);
+
+% find length in Nt of annotated sequence 
+%alength = length(annotations);
+
+% find length in Nt of estimated sequence 
+%elength = length(estimates);
+
+% use lesser value for evaluation
+%ilength = min(alength,elength);
+
+Nc = 0; % number of successfully matched Nt
+
+Nt = 0; % total number of evaluated Nt
+
+Ne = 0;
+
+seg_start= 0;
+seg_end = 0;
+
+Tc = 0;
+Ti = 0;
+Tt = 0;
+    
+while i <= ilength & j <= jlength
+
+    segstart = max(at1(j), et1(i));
+    segend = min(at2(j), et2(i));
+    
+    [match, success, errormessage] = comparechords2(char(es{i}),char(as{j}), params.comparison, params.cardinality, params.inversion);
+           
+    includeE = indictionary(char(es{i}), params.dictionary, params.comparison, params.cardinality);
+    includeA = indictionary(char(as{j}), params.dictionary, params.comparison, params.cardinality);
+ 
+    seglength = segend-segstart;
+    
+    Tc = Tc + (match * includeE * seglength);
+    
+    Ti = Ti + (includeA * seglength);
+    
+    Tt = Tt + seglength;
+    
+    if at2(j) > segend
+        i = i+1;
+    elseif et2(i) > segend
+        j= j+1;
+    else
+        i = i+1;
+        j = j+1;
+    end
+    
+end
+
+% recall is number of correct matches out of total evaluated Nt
+recall = Tc/Ti;
+
+% percentage of annotations that were non-dictionary chords so ignored
+nondictionary = 1-(Ti/Tt);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/indictionary.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,56 @@
+%INDICTIONARY
+%found = indictionary(chord, dictionary, cardinality)
+
+
+
+function found = indictionary(chord, dictionary, comparison, cardinality)
+
+found = 0;
+
+switch lower(comparison)
+    case 'ov'
+        % pnset comparison used so inclusion should be calculated with
+        % rlsets
+        comp = 'oi';
+   
+    case 'op'
+        % pcset comparison used so inclusion should be calculated with
+        % rcsets
+        comp = 'or';
+ 
+    otherwise
+        % assume this is not a dictionary evaluation
+        found = 1;
+end
+
+if ~found 
+    
+    if isempty(dictionary)
+        found = 1; 
+    
+    else
+        
+        chordslength = length(dictionary);
+
+        chord = striproot(chord);
+
+
+        for indexc = 1:chordslength
+
+            %do a comparison of the current chord symbol and a member of the
+            %found list
+            [found, success, error] = comparechords2(chord, dictionary{indexc}, comp, cardinality,0);
+
+            if ~success
+                display(error)
+            end
+
+            % if found = 1
+            if found
+                % exit because the chord is in the dictionary
+                break;
+            end
+
+        end
+    end
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/merge_repeats.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,46 @@
+
+% merge contiguous repeated chord labels in a labfile
+
+function [t1,t2,s] = merge_repeats(labfile, outputlabfile)
+
+writefile = 1;
+
+if nargin<2
+    % if no output labfile name is given then don't write output to a file
+    writefile=0;
+end
+
+t1 = [];
+t2 = [];
+s = {};
+
+[in_t1,in_t2,in_s] = labread(labfile);
+
+current = in_s{1};
+temp1 = in_t1(1);
+
+for i=1:length(in_s)-1
+    
+    next = in_s{i+1};
+    
+    % if current is the same as next
+    if ~strcmp(current,next)
+        t1 = [t1; temp1];
+        t2 = [t2; in_t2(i)];
+        s =  [s; {current}];
+        current = next;
+        temp1 = in_t1(i+1);
+    end
+    
+    if i==length(in_s)-1
+       t1 = [t1; temp1];
+       t2 = [t2; in_t2(i+1)];
+       s =  [s; {current}];  
+    end
+    
+end
+    
+if writefile
+    
+    labwrite(t1,t2,s,outputlabfile);
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/mxmap.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,38 @@
+
+% map chord to mirex integer representation
+
+function [val,success] = mxmap(chord, year)
+
+success = 1;
+errormessage = '';
+
+[rootnote, shorthand,intervals, bassinterval, success, errormessage] = getchordinfo(chord);
+
+if strcmp(rootnote,'N')
+
+    val = 24;
+    
+else
+    if success
+        [val, success, errormessage] = note2pitchclass(rootnote);
+    end
+
+    if success
+        switch year
+
+            case 8
+                if ~isempty(strfind(shorthand,'min'));
+                    val = val+12;
+                end
+            case 9
+                if ~(isempty(strfind(shorthand,'min')) & isempty(strfind(shorthand,'dim')) & isempty(strfind(shorthand,'sus2')));
+                    val = val+12;
+                end
+            otherwise
+                success = 0;
+                errormessage = 'Error in mxmap: invalid year\n';
+
+        end
+    end
+    
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/printfile.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,7 @@
+%printfile(text, filename)
+
+function printfile(text, filename)
+
+fid = fopen(filename, 'w');
+fprintf(fid,text);
+fclose(fid);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/readlist.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,38 @@
+
+%READLIST
+% list = readlist(filename)
+
+% read a list of string values line by line from a text file. 
+% Ignores any line starting with the '%' character
+
+function [list, success] = readlist(filename)
+
+list = {}; %list is a cell array
+
+success = 1;
+% open the text file
+fid=fopen(filename); 
+
+% if file opened successfully
+if fid ~= -1
+    
+    while 1 
+        line = fgetl(fid);
+        
+        %break on end of file
+        if ~ischar(line), break, end
+
+        %if the line starts with a % then ignore it
+        if length(line) && line(1) ~= '%' 
+            % otherwise put current line into output list
+            list = [list line];
+        end  
+
+    end
+    
+    % close the file
+    fclose(fid);
+else
+    success = 0;
+end
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/stripinversion.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,17 @@
+
+function chord = stripinversion(chordinput)
+
+chord = '';
+
+ilength = length(chordinput);
+
+for i = 1:ilength
+    
+    if chordinput(i)~='/'
+        chord = [chord chordinput(i)];
+    else
+        break;
+    end
+end
+
+     
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/evaluationtools/striproot.m	Mon May 06 14:43:47 2013 +0100
@@ -0,0 +1,33 @@
+
+function chord = striproot(chordinput,rootc)
+
+if nargin<2
+    rootc=0;
+end
+
+
+    [rootnote, shorthand, intervals, bass, success, errormessage] = parsechord(chordinput);
+
+    if strcmp(rootnote, 'N')
+            chord = 'N';   
+    else
+            if isempty(shorthand) && isempty(intervals)
+                chord = 'X';
+            elseif isempty(intervals)
+                chord = ['X:' shorthand];
+            elseif isempty(shorthand)
+                chord = ['X:(' intervals ')'];
+            else
+                chord = ['X:' shorthand '(' intervals ')'];
+            end
+
+            if ~isempty(bass)
+                chord = [chord '/' bass];
+            end
+     
+            if rootc
+                chord(1) = 'C';
+            end
+    end
+     
+    
\ No newline at end of file