image thumbnail
from Piano notes recognition research by Maxim Vedenyov
try to define notes from its sound

play_sep_gui.m
global ca e1 b1 e2 a4n Fs e12 e13 e14 ch1 ch2 ch3 ch4

Fs=44100;
dr=dir('*.wav');
if length(dr)>0
    nm=[];
    for fc=1:length(dr)
        fln=dr(fc).name;
        lfln=length(fln);
        ns=fln(1:lfln-4);
        nm=[nm str2num(ns)];
    end
    [nms ind]=sort(nm);

    L=length(dr);
    ca=cell(1,L);
    for fc=1:length(dr)
        [s1 Fs1]=wavread(dr(ind(fc)).name);
        s=resample(s1,2,1);
        ca{fc}=s;
     
    end
    %soundsc(ca,44100);
    
end

% hp=semilogx(0,0,'b-');
% xlim([10 10000]);
% ym=3e6;
% ylim([0 ym]);
a4n=49;
% hold on;
% hp1=semilogx([10 10],[0.3*ym ym],'r--');
% ht=title(' ');
%for Lc=1:L
% Lc=25;
%for Lc=20:L
Lc=49;
hf=figure('units','normalized','position',[0.1 0.5 0.3 0.3]);
e1 = uicontrol('Style', 'edit', 'String', '0',...
    'units','normalized',...
    'Position', [0.1 0.8 0.15 0.1], 'Callback', '');

ch1 = uicontrol('Style', 'checkbox', 'String', ' ',...
    'units','normalized',...
    'value',1,...
    'Position', [0.1 0.8-0.1 0.15 0.1], 'Callback', '');

e12 = uicontrol('Style', 'edit', 'String', '1',...
    'units','normalized',...
    'Position', [0.1+0.2 0.8 0.15 0.1], 'Callback', '');

ch2 = uicontrol('Style', 'checkbox', 'String', ' ',...
    'units','normalized',...
    'Position', [0.1+0.2 0.8-0.1 0.15 0.1], 'Callback', '');

e13 = uicontrol('Style', 'edit', 'String', '2',...
    'units','normalized',...
    'Position', [0.1+2*0.2 0.8 0.15 0.1], 'Callback', '');

ch3 = uicontrol('Style', 'checkbox', 'String', ' ',...
    'units','normalized',...
    'Position', [0.1+2*0.2 0.8-0.1 0.15 0.1], 'Callback', '');

e14 = uicontrol('Style', 'edit', 'String', '3',...
    'units','normalized',...
    'Position', [0.1+3*0.2 0.8 0.15 0.1], 'Callback', '');

ch4 = uicontrol('Style', 'checkbox', 'String', ' ',...
    'units','normalized',...
    'Position', [0.1+3*0.2 0.8-0.1 0.15 0.1], 'Callback', '');




b1 = uicontrol('Style', 'pushbutton', 'String', 'play',...
    'units','normalized',...
    'Position', [0.2 0.5 0.4 0.1], 'Callback', 'pl');

e2 = uicontrol('Style', 'edit', 'String', '',...
    'units','normalized',...
    'Position', [0.4 0.2 0.4 0.1], 'Callback', '');


%     set(hp1,'XData',[ftc ftc]);
%     
%     set(ht,'string',number2note(nc))
    
%     xlim([10 10000]);
%     ylim([0 ym]);
%     drawnow;
%     pause(1);
%end

Contact us at files@mathworks.com