File Exchange

image thumbnail

Piano

version 1.0.24 (1.14 KB) by Silas Henderson
Play notes with keyboard

54 Downloads

Updated 17 Sep 2020

View Version History

View License

Keys: a,s,d,f,g,h,j,k

Cite As

Silas Henderson (2020). Piano (https://www.mathworks.com/matlabcentral/fileexchange/71836-piano), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Jan

Even more minimal:

function keyDownFcn(~, event)
freqPool = [530, 587, 659, 698, 784,880, 932, 988, 1047, 1175] ;
freq = freqPool(event.Key == 'asdfghujkl');
sound(sin(freq*2*pi*[0:1/8192:.4]));
end

Chang hsiung

MATLAB Release Compatibility
Created with R2019a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!