Skip to content

Instantly share code, notes, and snippets.

@belkarx
Created December 22, 2022 19:45
Show Gist options
  • Select an option

  • Save belkarx/744dcd8f00587a09dbe02c4dedf246cd to your computer and use it in GitHub Desktop.

Select an option

Save belkarx/744dcd8f00587a09dbe02c4dedf246cd to your computer and use it in GitHub Desktop.
MVP relative pitch testing.mat
t = linspace(0, 1, 14400);
scale = [261.63 293.66 329.63 349.23 392.00 440 493.88 523.25];
strs = ["C", "D", "E", "F", "G", "A", "B", "C2"];
r = rand(1, 20)
for i = 1:length(scale)
f = scale(i);
strs(i)
sound(sin((2*pi*f)*t), 14400);
pause(.5)
if r(i) > 0.4
strs(i)
sound(sin((2*pi*f*2)*t), 14400);
else
strs(i+1)
sound(sin((2*pi*scale(i+1)*2)*t), 14400);
end
pause(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment