function param = add_keys(param)
names = {'A','Bb','B','C','C#','D','Eb','E','F','F#','G','G#','Am','Bbm','Bm','Cm','C#m','Dm','Ebm','Em','Fm','F#m','Gm','G#m'};
switch param.key.set
    case 'major'
        param.key.names = names(1:12);
        profile = [1 0 1 0 1 1 0 1 0 1 0 1];
    case 'majorminor'
        param.key.names = names;
        profile = [1 0 1 0 1 1 0 1 0 1 0 1;
                   1 0 1 1 0 1 0 1 1 0 0 1];
end

nMode = size(profile,1);

param.key.profiles = zeros(12 * nMode, 12);
param.key.n = nMode * 12;

for iMode = 1:nMode
    for iSemitone = 1:12
        param.key.profiles(12 * (iMode-1) + iSemitone,:) = ...
            circshift(profile(iMode,:),[0,iSemitone-1]);
    end
end


param.chord.givenkey = zeros([param.key.n,param.chord.n]);

for iKey = 1:param.key.n
    for iChord = 1:param.chord.n
        chord_prefit = ...
            (1-param.key.profiles(iKey,:)) * param.chord.mu(:,iChord);
        param.chord.givenkey(iKey,iChord) = 1 / (chord_prefit + param.key.c);
    end
end
param.chord.givenkey = qnormalise(param.chord.givenkey,1,2);

