www.gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/analsynth/sound/sndanalsynthgui.m
function varargout = sndanalsynthgui(varargin) % SNDANALSYNTHGUI M-file for sndanalsynthgui.fig % SNDANALSYNTHGUI, by itself, creates a new SNDANALSYNTHGUI or raises the existing % singleton*. % % H = SNDANALSYNTHGUI returns the handle to a new SNDANALSYNTHGUI or the handle to % the existing singleton*. % % SNDANALSYNTHGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in SNDANALSYNTHGUI.M with the given input arguments. % % SNDANALSYNTHGUI('Property','Value',...) creates a new SNDANALSYNTHGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before sndanalsynthgui_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to sndanalsynthgui_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 % Edit the above text to modify the response to help sndanalsynthgui % Last Modified by GUIDE v2.5 08-Apr-2004 14:13:29 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @sndanalsynthgui_OpeningFcn, ... 'gui_OutputFcn', @sndanalsynthgui_OutputFcn, ... 'gui_LayoutFcn', @sndanalsynthgui_LayoutFcn, ... 'gui_Callback', []); if nargin & isstr(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 sndanalsynthgui is made visible. function sndanalsynthgui_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 sndanalsynthgui (see VARARGIN) % Choose default command line output for sndanalsynthgui handles.output = hObject; guidata(hObject, handles); set(gcf,'UserData',handles); sndanalsynthfn; % This sets up the initial plot - only do when we are invisible % so window can get raised using sndanalsynthgui. if (nargin > 3) datastruct = varargin{1}; sndanalsynthfn('readinput',datastruct); end % --- Outputs from this function are returned to the command line. function varargout = sndanalsynthgui_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output; % -------------------------------------------------------------------- function FileMenu_Callback(hObject, eventdata, handles) % -------------------------------------------------------------------- function OpenMenuItem_Callback(hObject, eventdata, handles) sndanalsynthfn 'loadsound'; % -------------------------------------------------------------------- function PrintMenuItem_Callback(hObject, eventdata, handles) sndanalsynthfn 'print'; % -------------------------------------------------------------------- function CloseMenuItem_Callback(hObject, eventdata, handles) sndanalsynthfn 'close'; % --- Executes on button press in play2. function play2_Callback(hObject, eventdata, handles) sndanalsynthfn 'playsound2'; % --- Executes on button press in print. function print_Callback(hObject, eventdata, handles) sndanalsynthfn 'print'; % --- Executes during object creation, after setting all properties. function synwindowsize_CreateFcn(hObject, eventdata, handles) % hObject handle to synwindowsize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu 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 % --- Executes on selection change in synwindowsize. function synwindowsize_Callback(hObject, eventdata, handles) % hObject handle to synwindowsize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns synwindowsize contents as cell array % contents{get(hObject,'Value')} returns selected item from synwindowsize % --- Executes during object creation, after setting all properties. function synwindowshape_CreateFcn(hObject, eventdata, handles) % hObject handle to synwindowshape (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu 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 % --- Executes on selection change in synwindowshape. function synwindowshape_Callback(hObject, eventdata, handles) % hObject handle to synwindowshape (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns synwindowshape contents as cell array % contents{get(hObject,'Value')} returns selected item from synwindowshape % --- Executes on button press in play1. function play1_Callback(hObject, eventdata, handles) sndanalsynthfn 'playsound1'; % --- Executes on button press in synthesize. function synthesize_Callback(hObject, eventdata, handles) sndanalsynthfn 'synthesize'; % -------------------------------------------------------------------- function Untitled_1_Callback(hObject, eventdata, handles) % hObject handle to Untitled_1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------- function Untitled_2_Callback(hObject, eventdata, handles) % hObject handle to Untitled_2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------- function sendorigfourier_Callback(hObject, eventdata, handles) % hObject handle to sendorigfourier (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) sndanalsynthfn 'orig_fourier'; % -------------------------------------------------------------------- function sendorigsonogram_Callback(hObject, eventdata, handles) % hObject handle to sendorigsonogram (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) sndanalsynthfn 'orig_sonogram'; % -------------------------------------------------------------------- function Untitled_5_Callback(hObject, eventdata, handles) % hObject handle to Untitled_5 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------- function Untitled_6_Callback(hObject, eventdata, handles) % hObject handle to Untitled_6 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------- function sendsynthfourier_Callback(hObject, eventdata, handles) % hObject handle to sendsynthfourier (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) sndanalsynthfn 'synth_fourier'; % -------------------------------------------------------------------- function sendsynthsonogram_Callback(hObject, eventdata, handles) % hObject handle to sendsynthsonogram (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) sndanalsynthfn 'synth_sonogram'; % --- Executes during object creation, after setting all properties. function phasemenu_CreateFcn(hObject, eventdata, handles) % hObject handle to phasemenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu 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 % --- Executes on selection change in phasemenu. function phasemenu_Callback(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties. function analwindowsize_CreateFcn(hObject, eventdata, handles) % hObject handle to analwindowsize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu 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 % --- Executes on selection change in analwindowsize. function analwindowsize_Callback(hObject, eventdata, handles) % hObject handle to analwindowsize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns analwindowsize contents as cell array % contents{get(hObject,'Value')} returns selected item from analwindowsize sndanalsynthfn 'colacheck'; % --- Executes during object creation, after setting all properties. function analwindowshape_CreateFcn(hObject, eventdata, handles) % hObject handle to analwindowshape (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu 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 % --- Executes on selection change in analwindowshape. function analwindowshape_Callback(hObject, eventdata, handles) % hObject handle to analwindowshape (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns analwindowshape contents as cell array % contents{get(hObject,'Value')} returns selected item from analwindowshape % --- Executes on button press in analyze. function analyze_Callback(hObject, eventdata, handles) sndanalsynthfn 'analyze'; % --- Executes during object creation, after setting all properties. function magmenu_CreateFcn(hObject, eventdata, handles) % hObject handle to magmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu 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 % --- Executes on selection change in magmenu. function magmenu_Callback(hObject, eventdata, handles) % hObject handle to magmenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns magmenu contents as cell array % contents{get(hObject,'Value')} returns selected item from magmenu % -------------------------------------------------------------------- function saveresynth_Callback(hObject, eventdata, handles) % hObject handle to saveresynth (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) sndanalsynthfn 'saveresynth'; % --- Executes during object creation, after setting all properties. function synthwindowsize_CreateFcn(hObject, eventdata, handles) % hObject handle to synthwindowsize (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 function synthwindowsize_Callback(hObject, eventdata, handles) % hObject handle to synthwindowsize (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 synthwindowsize as text % str2double(get(hObject,'String')) returns contents of synthwindowsize as a double sndanalsynthfn 'colacheck'; % --- Executes during object creation, after setting all properties. function synthwindowskip_CreateFcn(hObject, eventdata, handles) % hObject handle to synthwindowskip (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 function synthwindowskip_Callback(hObject, eventdata, handles) % hObject handle to synthwindowskip (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 synthwindowskip as text % str2double(get(hObject,'String')) returns contents of synthwindowskip as a double function cola_CreateFcn(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties. function analcola_CreateFcn(hObject, eventdata, handles) % hObject handle to synthcola (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % --- Executes during object creation, after setting all properties. function synthcola_CreateFcn(hObject, eventdata, handles) % hObject handle to synthcola (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % --- Executes on button press in synthcola. function synthcola_Callback(hObject, eventdata, handles) % hObject handle to synthcola (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of synthcola sndanalsynthfn 'colacheck'; % --- Executes during object creation, after setting all properties. function analwindowskip_CreateFcn(hObject, eventdata, handles) % hObject handle to analwindowskip (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 function analwindowskip_Callback(hObject, eventdata, handles) % hObject handle to analwindowskip (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 analwindowskip as text % str2double(get(hObject,'String')) returns contents of analwindowskip as a double % --- Executes on button press in analcola. function analcola_Callback(hObject, eventdata, handles) % hObject handle to analcola (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of analcola sndanalsynthfn 'colacheck'; % -------------------------------------------------------------------- function help_Callback(hObject, eventdata, handles) % hObject handle to help (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) sndanalsynthfn 'help'; % --- Executes on button press in normalize. function normalize_Callback(hObject, eventdata, handles) % hObject handle to normalize (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) sndanalsynthfn 'normalize'; % --- Creates and returns a handle to the GUI figure. function h1 = sndanalsynthgui_LayoutFcn(policy) % policy - create a new figure or use a singleton. 'new' or 'reuse'. persistent hsingleton; if strcmpi(policy, 'reuse') & ishandle(hsingleton) h1 = hsingleton; return; end h1 = figure(... 'Units','characters',... 'Color',[0.701960784313725 0.701960784313725 0.701960784313725],... 'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],... 'IntegerHandle','off',... 'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),... 'MenuBar','none',... 'Name','Sound Analysis/Synthesis',... 'NumberTitle','off',... 'PaperOrientation','landscape',... 'PaperPosition',get(0,'defaultfigurePaperPosition'),... 'PaperSize',[11 8.5],... 'Pointer','crosshair',... 'Position',[128.6 13 183.4 41.3076923076923],... 'Renderer',get(0,'defaultfigureRenderer'),... 'RendererMode','manual',... 'HandleVisibility','callback',... 'Tag','sndanalsynth_fig',... 'UserData',[]); setappdata(h1, 'GUIDEOptions',struct(... 'active_h', [], ... 'taginfo', struct(... 'figure', 2, ... 'axes', 7, ... 'pushbutton', 14, ... 'popupmenu', 16, ... 'listbox', 2, ... 'text', 28, ... 'slider', 2, ... 'checkbox', 7, ... 'radiobutton', 5, ... 'frame', 5, ... 'edit', 5), ... 'override', 1, ... 'release', 13, ... 'resize', 'simple', ... 'accessibility', 'callback', ... 'mfile', 1, ... 'callbacks', 1, ... 'singleton', 1, ... 'syscolorfig', 1, ... 'lastSavedFile', '/Users/bobsturm/gibson/SSUM/analsynth/sound/sndanalsynth.m', ... 'blocking', 0)); h2 = uimenu(... 'Parent',h1,... 'Callback','sndanalsynthgui(''FileMenu_Callback'',gcbo,[],guidata(gcbo))',... 'Label','File',... 'Tag','FileMenu'); h3 = uimenu(... 'Parent',h2,... 'Callback','sndanalsynthgui(''OpenMenuItem_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Open ...',... 'Tag','OpenMenuItem'); h4 = uimenu(... 'Parent',h2,... 'Callback','sndanalsynthgui(''saveresynth_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Save Resynthesis',... 'Tag','saveresynth'); h5 = uimenu(... 'Parent',h2,... 'Callback','sndanalsynthgui(''PrintMenuItem_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Print ...',... 'Tag','PrintMenuItem'); h6 = uimenu(... 'Parent',h2,... 'Callback','sndanalsynthgui(''CloseMenuItem_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Close',... 'Separator','on',... 'Tag','CloseMenuItem'); h7 = axes(... 'Parent',h1,... 'Units','characters',... 'ALim',get(0,'defaultaxesALim'),... 'ALimMode','manual',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode','manual',... 'CameraTarget',[0.5 0.5 0.5],... 'CameraTargetMode','manual',... 'CameraUpVector',[0 1 0],... 'CameraUpVectorMode','manual',... 'CameraViewAngle',6.60861036031192,... 'CameraViewAngleMode','manual',... 'CLim',get(0,'defaultaxesCLim'),... 'CLimMode','manual',... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'DataAspectRatio',get(0,'defaultaxesDataAspectRatio'),... 'DataAspectRatioMode','manual',... 'DrawMode','fast',... 'PlotBoxAspectRatio',get(0,'defaultaxesPlotBoxAspectRatio'),... 'PlotBoxAspectRatioMode','manual',... 'Position',[8 3.46153846153846 140 15.3846153846154],... 'TickDir',get(0,'defaultaxesTickDir'),... 'TickDirMode','manual',... 'XColor',get(0,'defaultaxesXColor'),... 'XLim',get(0,'defaultaxesXLim'),... 'XLimMode','manual',... 'XTick',[0 0.2 0.4 0.6 0.8 1],... 'XTickLabel',{ '0 '; '0.2'; '0.4'; '0.6'; '0.8'; '1 ' },... 'XTickLabelMode','manual',... 'XTickMode','manual',... 'YColor',get(0,'defaultaxesYColor'),... 'YLim',get(0,'defaultaxesYLim'),... 'YLimMode','manual',... 'YTick',[0 0.2 0.4 0.6 0.8 1],... 'YTickLabel',{ '0 '; '0.2'; '0.4'; '0.6'; '0.8'; '1 ' },... 'YTickLabelMode','manual',... 'YTickMode','manual',... 'ZColor',get(0,'defaultaxesZColor'),... 'ZLim',get(0,'defaultaxesZLim'),... 'ZLimMode','manual',... 'ZTick',[0 0.5 1],... 'ZTickLabel','',... 'ZTickLabelMode','manual',... 'ZTickMode','manual',... 'Tag','timeplot2',... 'UserData',[]); h8 = get(h7,'title'); set(h8,... 'Parent',h7,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.496575342465753 1.04452054794521 1.00005459937205],... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h9 = get(h7,'xlabel'); set(h9,... 'Parent',h7,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.496575342465753 -0.160958904109589 1.00005459937205],... 'VerticalAlignment','cap',... 'HandleVisibility','off'); h10 = get(h7,'ylabel'); set(h10,... 'Parent',h7,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[-0.195205479452055 0.48972602739726 1.00005459937205],... 'Rotation',90,... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h11 = get(h7,'zlabel'); set(h11,... 'Parent',h7,... 'Color',[0 0 0],... 'HorizontalAlignment','right',... 'Position',[-0.565068493150685 1.45547945205479 1.00005459937205],... 'HandleVisibility','off',... 'Visible','off'); h12 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'ListboxTop',0,... 'Position',[155 24.3076923076923 25 15],... 'String',{ '' },... 'Style','frame',... 'Tag','frame4'); h13 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',14,... 'ListboxTop',0,... 'Position',[164.2 38.4615384615385 14 1.76923076923077],... 'String','Analysis',... 'Style','text',... 'Tag','text19'); h14 = axes(... 'Parent',h1,... 'Units','characters',... 'ALim',get(0,'defaultaxesALim'),... 'ALimMode','manual',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode','manual',... 'CameraTarget',[0.5 0.5 0.5],... 'CameraTargetMode','manual',... 'CameraUpVector',[0 1 0],... 'CameraUpVectorMode','manual',... 'CameraViewAngle',6.60861036031192,... 'CameraViewAngleMode','manual',... 'CLim',get(0,'defaultaxesCLim'),... 'CLimMode','manual',... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'DataAspectRatio',get(0,'defaultaxesDataAspectRatio'),... 'DataAspectRatioMode','manual',... 'DrawMode','fast',... 'PlotBoxAspectRatio',get(0,'defaultaxesPlotBoxAspectRatio'),... 'PlotBoxAspectRatioMode','manual',... 'Position',[8 23.0769230769231 140 15.3846153846154],... 'TickDir',get(0,'defaultaxesTickDir'),... 'TickDirMode','manual',... 'XColor',get(0,'defaultaxesXColor'),... 'XLim',get(0,'defaultaxesXLim'),... 'XLimMode','manual',... 'XTick',[0 0.2 0.4 0.6 0.8 1],... 'XTickLabel',{ '0 '; '0.2'; '0.4'; '0.6'; '0.8'; '1 ' },... 'XTickLabelMode','manual',... 'XTickMode','manual',... 'YColor',get(0,'defaultaxesYColor'),... 'YLim',get(0,'defaultaxesYLim'),... 'YLimMode','manual',... 'YTick',[0 0.2 0.4 0.6 0.8 1],... 'YTickLabel',{ '0 '; '0.2'; '0.4'; '0.6'; '0.8'; '1 ' },... 'YTickLabelMode','manual',... 'YTickMode','manual',... 'ZColor',get(0,'defaultaxesZColor'),... 'ZLim',get(0,'defaultaxesZLim'),... 'ZLimMode','manual',... 'ZTick',[0 0.5 1],... 'ZTickLabel','',... 'ZTickLabelMode','manual',... 'ZTickMode','manual',... 'Tag','timeplot1',... 'UserData',[]); h15 = get(h14,'title'); set(h15,... 'Parent',h14,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.497297297297297 1.02972972972973 1.00005459937205],... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h16 = get(h14,'xlabel'); set(h16,... 'Parent',h14,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.497297297297297 -0.105405405405405 1.00005459937205],... 'VerticalAlignment','cap',... 'HandleVisibility','off'); h17 = get(h14,'ylabel'); set(h17,... 'Parent',h14,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[-0.12972972972973 0.494594594594595 1.00005459937205],... 'Rotation',90,... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h18 = get(h14,'zlabel'); set(h18,... 'Parent',h14,... 'Color',[0 0 0],... 'HorizontalAlignment','right',... 'Position',[-1.65405405405405 1.14864864864865 1.00005459937205],... 'HandleVisibility','off',... 'Visible','off'); h19 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',14,... 'FontWeight','bold',... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[125.4 0.307692307692308 56.2 1.76923076923077],... 'String','Sound Analysis/Synthesis',... 'Style','text',... 'Tag','text3'); h20 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'ListboxTop',0,... 'Position',[155 5.92307692307692 25 17.4615384615385],... 'String',{ '' },... 'Style','frame',... 'Tag','frame3'); h21 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',14,... 'ListboxTop',0,... 'Position',[161.6 22.3846153846154 17.4 1.76923076923077],... 'String','Synthesis',... 'Style','text',... 'Tag','text14'); h22 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''play1_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[169.2 25 8 1.46153846153846],... 'String','Play',... 'Tag','play1'); h23 = uimenu(... 'Parent',h1,... 'Callback','sndanalsynthgui(''Untitled_1_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Original',... 'Tag','Untitled_1'); h24 = uimenu(... 'Parent',h23,... 'Callback','sndanalsynthgui(''Untitled_2_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Send To...',... 'Tag','Untitled_2'); h25 = uimenu(... 'Parent',h24,... 'Callback','sndanalsynthgui(''sendorigfourier_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Fourier Explorer',... 'Tag','sendorigfourier'); h26 = uimenu(... 'Parent',h24,... 'Callback','sndanalsynthgui(''sendorigsonogram_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Sonogram Explorer',... 'Tag','sendorigsonogram'); h27 = uimenu(... 'Parent',h1,... 'Callback','sndanalsynthgui(''Untitled_5_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Synthesis',... 'Tag','Untitled_5'); h28 = uimenu(... 'Parent',h27,... 'Callback','sndanalsynthgui(''Untitled_6_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Send To...',... 'Tag','Untitled_6'); h29 = uimenu(... 'Parent',h28,... 'Callback','sndanalsynthgui(''sendsynthfourier_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Fourier Explorer',... 'Tag','sendsynthfourier'); h30 = uimenu(... 'Parent',h28,... 'Callback','sndanalsynthgui(''sendsynthsonogram_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Sonogram Explorer',... 'Tag','sendsynthsonogram'); h31 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''play2_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[170.4 6.46153846153846 8 1.46153846153846],... 'String','Play',... 'Tag','play2'); h32 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''synthesize_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[156.8 6.46153846153846 12 1.46153846153846],... 'String','Synthesize',... 'Tag','synthesize'); h33 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''phasemenu_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[156.8 8.61538461538462 18.2 1.46153846153846],... 'String',{ 'Actual'; 'Zero'; 'Random'; 'Other' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn','sndanalsynthgui(''phasemenu_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','phasemenu'); h34 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[156.8 10.3846153846154 15 1.46153846153846],... 'String','Phase',... 'Style','text',... 'Tag','text18'); h35 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''analwindowsize_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[156.8 35.3076923076923 12 1.46153846153846],... 'String','512',... 'Style','edit',... 'Value',4,... 'CreateFcn','sndanalsynthgui(''analwindowsize_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','analwindowsize'); h36 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''analwindowshape_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[156.8 27.8461538461538 18.2 1.46153846153846],... 'String',{ 'Hann'; 'Rectangle'; 'Triangle' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn','sndanalsynthgui(''analwindowshape_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','analwindowshape'); h37 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[156.8 29.4615384615385 21.2 1.53846153846154],... 'String','Window Shape',... 'Style','text',... 'Tag','text20'); h38 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[156.8 36.7692307692308 18.8 1.53846153846154],... 'String','Window Size',... 'Style','text',... 'Tag','text21'); h39 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',14,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[8 38.5384615384615 15 1.76923076923077],... 'String','Original',... 'Style','text',... 'Tag','text22'); h40 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',14,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[8 19 19 1.76923076923077],... 'String','Synthesis',... 'Style','text',... 'Tag','text23'); h41 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''analyze_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[156.8 25 11 1.46153846153846],... 'String','Analyze',... 'Tag','analyze'); h42 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''magmenu_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[156.8 12.3076923076923 18.2 1.46153846153846],... 'String',{ 'Actual'; 'Random'; 'Other' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn','sndanalsynthgui(''magmenu_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','magmenu'); h43 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[156.8 14 15 1.46153846153846],... 'String','Magnitude',... 'Style','text',... 'Tag','text24'); h44 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''synthwindowsize_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[156.8 19.2307692307692 12 1.46153846153846],... 'String','512',... 'Style','edit',... 'Value',4,... 'CreateFcn','sndanalsynthgui(''synthwindowsize_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','synthwindowsize'); h45 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[156.8 20.7692307692308 18.8 1.53846153846154],... 'String','Window Size',... 'Style','text',... 'Tag','text25'); h46 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''synthwindowskip_Callback'',gcbo,[],guidata(gcbo))',... 'Enable','inactive',... 'ListboxTop',0,... 'Position',[156.8 16 12 1.46153846153846],... 'String','256',... 'Style','edit',... 'Value',4,... 'CreateFcn','sndanalsynthgui(''synthwindowskip_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','synthwindowskip'); h47 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[156.8 17.4615384615385 19 1.53846153846154],... 'String','Window Skip',... 'Style','text',... 'Tag','text26'); h48 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''synthcola_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[170.4 18.7692307692308 9 1.46153846153846],... 'String','COLA',... 'Style','checkbox',... 'Value',1,... 'CreateFcn','sndanalsynthgui(''synthcola_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','synthcola'); h49 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''analwindowskip_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[156.8 31.6153846153846 12 1.46153846153846],... 'String','512',... 'Style','edit',... 'Value',4,... 'CreateFcn','sndanalsynthgui(''analwindowskip_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','analwindowskip'); h50 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[156.8 33.0769230769231 18.8 1.53846153846154],... 'String','Window Skip',... 'Style','text',... 'Tag','text27'); h51 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''analcola_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[169.8 34.6923076923077 9 1.46153846153846],... 'String','COLA',... 'Style','checkbox',... 'Value',1,... 'CreateFcn','sndanalsynthgui(''cola_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','analcola'); h52 = uimenu(... 'Parent',h1,... 'Callback','sndanalsynthgui(''help_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Help',... 'Tag','help'); h53 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','sndanalsynthgui(''normalize_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[156.666666666667 3.83333333333333 12 1.41666666666667],... 'String','Normalize',... 'Tag','normalize'); hsingleton = h1; % --- Handles default GUIDE GUI creation and callback dispatch function varargout = gui_mainfcn(gui_State, varargin) gui_StateFields = {'gui_Name' 'gui_Singleton' 'gui_OpeningFcn' 'gui_OutputFcn' 'gui_LayoutFcn' 'gui_Callback'}; gui_Mfile = ''; for i=1:length(gui_StateFields) if ~isfield(gui_State, gui_StateFields{i}) error('Could not find field %s in the gui_State struct in GUI M-file %s', gui_StateFields{i}, gui_Mfile); elseif isequal(gui_StateFields{i}, 'gui_Name') gui_Mfile = [getfield(gui_State, gui_StateFields{i}), '.m']; end end numargin = length(varargin); if numargin == 0 % SNDANALSYNTHGUI % create the GUI gui_Create = 1; elseif numargin > 3 & ischar(varargin{1}) & ishandle(varargin{2}) % SNDANALSYNTHGUI('CALLBACK',hObject,eventData,handles,...) gui_Create = 0; else % SNDANALSYNTHGUI(...) % create the GUI and hand varargin to the openingfcn gui_Create = 1; end if gui_Create == 0 varargin{1} = gui_State.gui_Callback; if nargout [varargout{1:nargout}] = feval(varargin{:}); else feval(varargin{:}); end else if gui_State.gui_Singleton gui_SingletonOpt = 'reuse'; else gui_SingletonOpt = 'new'; end % Open fig file with stored settings. Note: This executes all component % specific CreateFunctions with an empty HANDLES structure. % Do feval on layout code in m-file if it exists if ~isempty(gui_State.gui_LayoutFcn) gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt); else gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); % If the figure has InGUIInitialization it was not completely created % on the last pass. Delete this handle and try again. if isappdata(gui_hFigure, 'InGUIInitialization') delete(gui_hFigure); gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); end end % Set flag to indicate starting GUI initialization setappdata(gui_hFigure,'InGUIInitialization',1); % Fetch GUIDE Application options gui_Options = getappdata(gui_hFigure,'GUIDEOptions'); if ~isappdata(gui_hFigure,'GUIOnScreen') % Adjust background color if gui_Options.syscolorfig set(gui_hFigure,'Color', get(0,'DefaultUicontrolBackgroundColor')); end % Generate HANDLES structure and store with GUIDATA guidata(gui_hFigure, guihandles(gui_hFigure)); end % If user specified 'Visible','off' in p/v pairs, don't make the figure % visible. gui_MakeVisible = 1; for ind=1:2:length(varargin) if length(varargin) == ind break; end len1 = min(length('visible'),length(varargin{ind})); len2 = min(length('off'),length(varargin{ind+1})); if ischar(varargin{ind}) & ischar(varargin{ind+1}) & ... strncmpi(varargin{ind},'visible',len1) & len2 > 1 if strncmpi(varargin{ind+1},'off',len2) gui_MakeVisible = 0; elseif strncmpi(varargin{ind+1},'on',len2) gui_MakeVisible = 1; end end end % Check for figure param value pairs for index=1:2:length(varargin) if length(varargin) == index break; end try, set(gui_hFigure, varargin{index}, varargin{index+1}), catch, break, end end % If handle visibility is set to 'callback', turn it on until finished % with OpeningFcn gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:}); if ishandle(gui_hFigure) % Update handle visibility set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); % Make figure visible if gui_MakeVisible set(gui_hFigure, 'Visible', 'on') if gui_Options.singleton setappdata(gui_hFigure,'GUIOnScreen', 1); end end % Done with GUI initialization rmappdata(gui_hFigure,'InGUIInitialization'); end % If handle visibility is set to 'callback', turn it on until finished with % OutputFcn if ishandle(gui_hFigure) gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end gui_Handles = guidata(gui_hFigure); else gui_Handles = []; end if nargout [varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); else feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); end if ishandle(gui_hFigure) set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); end end function gui_hFigure = local_openfig(name, singleton) try gui_hFigure = openfig(name, singleton, 'auto'); catch % OPENFIG did not accept 3rd input argument until R13, % toggle default figure visible to prevent the figure % from showing up too soon. gui_OldDefaultVisible = get(0,'defaultFigureVisible'); set(0,'defaultFigureVisible','off'); gui_hFigure = openfig(name, singleton); set(0,'defaultFigureVisible',gui_OldDefaultVisible); end