File Exchange

image thumbnail

Piano

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

3 Downloads

Updated 23 Dec 2020

View Version History

View License

Make empty figure window that responds to keyboard.

Press keys a,s,d,f,g,h,j,k to play notes for C major scale.

Cite As

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

Comments and Ratings (3)

Pink_panther

There is nothing showing inside the Figure windows, sound is ok.

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!