Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function skala
- A={'Ionisk','Dorisk','Frygisk','Lydisk','Mixolydisk','Aeolisk','Lokrisk'}; %%Vector with every mode
- B={'W-W-H-W-W-W-H','W-H-W-W-W-H-W','H-W-W-W-H-W-W','W-W-W-H-W-W-H','W-W-H-W-W-H-W'...
- ,'W-H-W-W-H-W-W','H-W-W-H-W-W-W'}; %%Steps in scale, W - whole steps, H - half steps
- C={'PI','PM','PA','IM','IA','MA','PIM','IMA','AMIM'}; %%Fingering
- D={'C ' 'C♯' 'D ' 'D♯' 'E ' 'F ' 'F♯' 'G ' 'G♯' 'A ' 'A♯' 'H ' ... %%Two chromatic octaves, used to
- 'C ' 'C♯' 'D ' 'D♯' 'E ' 'F ' 'F♯' 'G ' 'G♯' 'A ' 'A♯' 'H '}; %%supply keynotes
- a=length(A);
- b=length(B);
- c=length(C);
- d=12; %%Problem 1
- x=randi([1,a]); %%Gives random keynote, fingering, and scale with exact
- y=randi([1,b]); %%notes
- z=randi([1,d]);
- n=z;
- %%algorithm(?) for modes
- S1 = D([n n+2 n+4 n+5 n+7 n+9 n+11]); %%Ionisk
- S2 = D([n n+2 n+3 n+5 n+7 n+9 n+10]); %%Dorisk
- S3 = D([n n+1 n+3 n+5 n+7 n+8 n+10]); %%Frygisk
- S4 = D([n n+2 n+4 n+6 n+7 n+9 n+11]); %%Lydisk
- S5 = D([n n+2 n+4 n+5 n+7 n+9 n+10]); %%Mixolydisk
- S6 = D([n n+2 n+3 n+5 n+7 n+8 n+10]); %%Aeolisk
- S7 = D([n n+1 n+3 n+5 n+6 n+8 n+10]); %%Lokrisk
- S={S1,S2,S3,S4,S5,S6,S7}; %%cell array of every mode
- str = [S{x}];
- X = [D(z) C(y) A(x) B(x)];
- H=string(str);
- G=string(X);
- fprintf('%s \n', G{:});
- fprintf('%s ', H);
- fprintf('\n');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement