function [y_labele, tonovi, akordi]=radi_labele(fre)

%--------------------------------------------------------------------------
%izrada labela za Y os: oktava, ton, frekvencija
N=4; %broj oktava

%oktave
y_oktave=[];
for i=2+4-N:2+3
    lim=12;
    oktava_txt={[num2str(i)]};
    if i==0
        lim=8;
    elseif i==3
        lim=12;
    end
    for j=1:lim
        y_oktave=[y_oktave oktava_txt];
    end
end

%tonovi
y_tonovi1={'G', 'G#/Ab','A','A#/Bb','B','C','C#/Db','D','D#/Eb','E','F','F#/Gb'};
y_tonovi=[y_tonovi1(10:12) y_tonovi1 y_tonovi1 y_tonovi1];


%frekvencija
k=1;
for i=1:length(fre)
    y_frekv{k}=sprintf('%4.2f',fre(i));
    k=k+1;
end

%y labele
for i=1:length(y_tonovi)
    y_labele{i}=sprintf('%15s %10s %2s %3d',y_frekv{i},y_tonovi{i}, y_oktave{i},i );
    tonovi{i}.ime=sprintf('%s%s',y_tonovi{i},y_oktave{i});  %radjenje strukture TONOVI
    tonovi{i}.oktava=y_oktave{i};
end
%--------------------------------------------------------------------------

%oktava=0
tonovi{1}.zica=6;   %E0
tonovi{1}.polje=0;
tonovi{2}.zica=6;   %F0
tonovi{2}.polje=1;
tonovi{3}.zica=6;   %F#0
tonovi{3}.polje=2;
tonovi{4}.zica=6;   %G0
tonovi{4}.polje=3;
tonovi{5}.zica=6;   %G#0
tonovi{5}.polje=4;
tonovi{6}.zica=[6 5];   %A0
tonovi{6}.polje=[5 0];
tonovi{7}.zica=[6 5];%A#0
tonovi{7}.polje=[6 1];
tonovi{8}.zica=[6 5];%B0
tonovi{8}.polje=[7 2];
%oktava=1
tonovi{9}.zica=[6 5];   %C1
tonovi{9}.polje=[8 3];
tonovi{10}.zica=[6 5];  %C#1
tonovi{10}.polje=[9 4];
tonovi{11}.zica=[6 5 4];  %D1
tonovi{11}.polje=[10 5 0];
tonovi{12}.zica=[6 5 4];  %D#1
tonovi{12}.polje=[11 6 1];
tonovi{13}.zica=[6 5 4];  %E1
tonovi{13}.polje=[12 7 2];
tonovi{14}.zica=[5 4];  %F1
tonovi{14}.polje=[8 3];
tonovi{15}.zica=[5 4];  %F#1
tonovi{15}.polje=[9 4];
tonovi{16}.zica=[5 4 3];   %G1
tonovi{16}.polje=[10 5 0];
tonovi{17}.zica=[5 4 3];   %G#1
tonovi{17}.polje=[11 6 1];
tonovi{18}.zica=[5 4 3];   %A1
tonovi{18}.polje=[12 7 2];
tonovi{19}.zica=[4 3];%A#1
tonovi{19}.polje=[8 3];
tonovi{20}.zica=[4 3 2];%B1
tonovi{20}.polje=[9 4 0];
%oktava=2
tonovi{21}.zica=[4 3 2];   %C2
tonovi{21}.polje=[10 5 1];
tonovi{22}.zica=[4 3 2];  %C#2
tonovi{22}.polje=[11 6 2];
tonovi{23}.zica=[4 3 2];  %D2
tonovi{23}.polje=[12 7 3];
tonovi{24}.zica=[3 2];  %D#2
tonovi{24}.polje=[8 4];
tonovi{25}.zica=[3 2 1];  %E2
tonovi{25}.polje=[9 5 0];
tonovi{26}.zica=[3 2 1];  %F2
tonovi{26}.polje=[10 6 1];
tonovi{27}.zica=[3 2 1];  %F#2
tonovi{27}.polje=[11 7 2];
tonovi{28}.zica=[3 2 1];   %G2
tonovi{28}.polje=[12 8 3];
tonovi{29}.zica=[2 1];   %G#2
tonovi{29}.polje=[9 4];
tonovi{30}.zica=[2 1];   %A2
tonovi{30}.polje=[10 5];
tonovi{31}.zica=[2 1];%A#2
tonovi{31}.polje=[11 6];
tonovi{32}.zica=[2 1];%B2
tonovi{32}.polje=[12 7];
%oktava=3
tonovi{33}.zica=[1];   %C3
tonovi{33}.polje=[8];
tonovi{34}.zica=[1];  %C#3
tonovi{34}.polje=[9];
tonovi{35}.zica=[1];  %D3
tonovi{35}.polje=[10];
tonovi{36}.zica=[1];  %D#3
tonovi{36}.polje=[11];
tonovi{37}.zica=[1];  %E3
tonovi{37}.polje=[12];
tonovi{38}.zica=[1];  %D#3
tonovi{38}.polje=[13];
tonovi{39}.zica=[1];  %E3
tonovi{39}.polje=[14];


%akordi
akordi{1}.ime='A-dur';
akordi{1}.tonovi=[13,18,22];
akordi{2}.ime='E-dur';
akordi{2}.tonovi=[8,13,17];