New to Matlab: How to create array of ratios inside For Loop
I'm coming to stackoverflow as a last resort, and after searching around I
still can't find an answer. I'm very new to Matlab.
I would like to create an array or vector of musical notes using a for
loop. Every musical note, A, A#, B, C...etc is a 2^(1/12) ratio of the
previous/next. E.G the note A is 440Hz, and A# is 440 * 2^(1/12) Hz =
446.16Hz.
Starting from 27.5Hz (A0), I want a loop that iterates 88 times to create
an array of each notes frequency up to 4186Hz, so that will look like
f= [27.5 29.14 30.87 ... 4186.01]
So far, I've understood this much:
f = [];
for i=1:87,
%what goes here
% f = [27.5 * 2^(i/12)]; ?
end
return;
No comments:
Post a Comment