Appendix B %Melody Matrix m=zeros(36,2); m(1,:)=[-2 1]; %[note rhythmicvalue] m(2,:)=[1 1]; %note expressed in 1/2steps away from A4. m(3,:)=[5 1]; m(4,:)=[1 1]; m(5,:)=[3 11]; m(6,:)=[-100 1]; m(7,:)=[-2 1]; m(8,:)=[1 1]; m(9,:)=[5 1]; m(10,:)=[1 1]; m(11,:)=[3 11]; m(12,:)=[-100 1]; m(13,:)=[3 1]; m(14,:)=[6 1]; m(15,:)=[10 1]; m(16,:)=[6 1]; m(17,:)=[8 11]; m(18,:)=[-100 1]; m(19,:)=[-2 1]; m(20,:)=[1 1]; m(21,:)=[5 1]; m(22,:)=[1 1]; m(23,:)=[3 11]; m(24,:)=[-100 1]; m(25,:)=[-2 1]; m(26,:)=[3 1]; m(27,:)=[5 1]; m(28,:)=[3 1]; m(29,:)=[1 11]; m(30,:)=[-100 1]; m(31,:)=[-2 1]; m(32,:)=[1 1]; m(33,:)=[5 1]; m(34,:)=[1 1]; m(35,:)=[3 11]; m(36,:)=[-100 1]; %Walking bass Matrix n(1,:)=[-100 5]; %rest n(2,:)=[3 2]; %c- n(3,:)=[5 2]; n(4,:)=[6 2]; n(5,:)=[8 2]; n(6,:)=[10 2]; n(7,:)=[13 2]; n(8,:)=[15 2]; n(9,:)=[6 2]; n(10,:)=[3 2]; %C- n(11,:)=[-2 2]; n(12,:)=[1 2]; n(13,:)=[2 2]; n(14,:)=[3 2]; n(15,:)=[5 2]; n(16,:)=[6 2]; n(17,:)=[7 2]; n(18,:)=[8 2];%f- n(19,:)=[9 2]; n(20,:)=[10 2]; n(21,:)=[11 2]; n(22,:)=[12 2]; n(23,:)=[13 2]; n(24,:)=[14 2]; n(25,:)=[16 2]; n(26,:)=[15 2];%c- n(27,:)=[3 2]; n(28,:)=[-2 2]; n(29,:)=[1 2]; n(30,:)=[3 2]; n(31,:)=[5 2]; n(32,:)=[6 2]; n(33,:)=[8 2]; n(34,:)=[10 2];%g- n(35,:)=[5 2]; n(36,:)=[-2 2]; n(37,:)=[-3 2]; n(38,:)=[-4 2]; n(39,:)=[-2 2]; n(40,:)=[-1 2]; n(41,:)=[1 2]; n(42,:)=[3 2];%c- n(43,:)=[2 2]; n(44,:)=[3 2]; n(45,:)=[4 2]; n(46,:)=[5 2]; n(47,:)=[-1 2]; n(48,:)=[-2 2]; n(49,:)=[1 2]; LC=48*2; NC=4; LT=NC*LC+5; %Reference and Solo orbits sig=10; %Chaotic Lorenz Attractor r=28; b=8/3; F = @(t, y) [sig*(y(2)-y(1)); r*y(1)-y(2)-y(1)*y(3); y(1)*y(2)-b*y(3)]; %1,2 yo = [2;1;5]; %Create IC for reference orbit %1,2 y1 = [2.001;1.001;5]; %previous initial coniditions used %3yo = [9;-3;0]; %y1 = [9;-2.99999999;5]; %4yo=[-1;2;-3]; %y1=[-1;2;-3.0000001]; %5yo=[4;5;6]; %y1=[3.9999999;5;6]; yo=[-2;2;2]; y1=[-1.9999999;2.0000001;2]; step=.05; %.1 for 1-4 tspan=0:step:step*200; [ts, ys]=ode45(F, tspan, yo); %solve for reference orbit [tt, yy]=ode45(F, tspan, y1); %solve for variation orbit %Solo Matrix s=zeros(200,2); %create a solo matrix for cc=1:200 %compare var to ref orbit compm=400; %assign s(i,x) to smallest m(j,x)>s(j,x compr=400; %assign s(i,y) to smallest m(j,y)>s(j,y for dd=1:36 if ys(dd,1)-yy(cc,1)>0 && ys(dd,1)-yy(cc,1)0 && ys(dd,2)-yy(cc,2)