?? digtai_piano.asv
字號:
function varargout = digtai_piano(varargin)
% DIGTAI_PIANO M-file for digtai_piano.fig
% DIGTAI_PIANO, by itself, creates a new DIGTAI_PIANO or raises the existing
% singleton*.
%
% H = DIGTAI_PIANO returns the handle to a new DIGTAI_PIANO or the handle to
% the existing singleton*.
%
% DIGTAI_PIANO('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in DIGTAI_PIANO.M with the given input arguments.
%
% DIGTAI_PIANO('Property','Value',...) creates a new DIGTAI_PIANO or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before digtai_piano_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to digtai_piano_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help digtai_piano
% Last Modified by GUIDE v2.5 28-Sep-2007 10:39:23
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @digtai_piano_OpeningFcn, ...
'gui_OutputFcn', @digtai_piano_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before digtai_piano is made visible.
function digtai_piano_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to digtai_piano (see VARARGIN)
% Choose default command line output for digtai_piano
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes digtai_piano wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = digtai_piano_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=131;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
pause(1);
cla;
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=147;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
pause(1);
cla;
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=165;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=175;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=196;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=220;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=247;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=262;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=294;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton12.
function pushbutton12_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=330;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton13.
function pushbutton13_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=349;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton14.
function pushbutton14_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=392;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton15.
function pushbutton15_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=440;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton16.
function pushbutton16_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=494;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1')
set(Phandel,'String',f,'FontSize',15.0)
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
% --- Executes on button press in pushbutton17.
function pushbutton17_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton17 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=1;
f=523;
Fs=11025;
P=60;
T=1.0/f;
dt=T/Fs;
N=T/dt;
t=linspace(0,1,N);
y=A*sin(2*pi*f*t+P);
Phandel=findobj('Tag','edit1');
set(Phandel,'String',f,'FontSize',15.0);
plot(t,y,'r');
grid ;
axis([0,0.1,-1.5,1.5]);
wavplay(y,11025);
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -