function [ templateChords ] = chordTemplates( parameter )
%UNTITLED6 Summary of this function goes here
% Output
%  - matrix of  chord templates


if nargin<1
   parameter=[]; 
end

if isfield(parameter,'numChords')==0
   parameter.numChords = 24;
end

if isfield(parameter,'templateMajor')==0
   parameter.templateMajor = [1 0 0 0 1 0 0 1 0 0 0 0];
end

if isfield(parameter,'templateMinor')==0
   parameter.templateMinor = [1 0 0 1 0 0 0 1 0 0 0 0];
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

numChords = parameter.numChords;
%numChords = 24;

templateChords = zeros(12,numChords);
templateChords(:,1) = parameter.templateMajor';


% Major Chords
for n=1:11
    templateChords(:,n+1) = circshift(templateChords(:,1),[n 0]);
end
templateChords(:,13) = parameter.templateMinor';

% Minor Chords
for n=1:11
    templateChords(:,13+n) = circshift(templateChords(:,13),[n 0]);
end

% Normalisation
for n=1:numChords
        normChord = norm(templateChords(:,n),2);
        templateChords(:,n) = templateChords(:,n)/normChord;
end
