gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/physmodel/ksstring/ksstringexpogui.m

    function varargout = ksstringexpogui(varargin)
% KSSTRINGEXPOGUI M-file for ksstringexpogui.fig
%      KSSTRINGEXPOGUI, by itself, creates a new KSSTRINGEXPOGUI or raises the existing
%      singleton*.
%
%      H = KSSTRINGEXPOGUI returns the handle to a new KSSTRINGEXPOGUI or the handle to
%      the existing singleton*.
%
%      KSSTRINGEXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in KSSTRINGEXPOGUI.M with the given input arguments.
%
%      KSSTRINGEXPOGUI('Property','Value',...) creates a new KSSTRINGEXPOGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before ksstringexpogui_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to ksstringexpogui_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 ksstringexpogui

% Last Modified by GUIDE v2.5 31-Mar-2005 09:44:05

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @ksstringexpogui_OpeningFcn, ...
                   'gui_OutputFcn',  @ksstringexpogui_OutputFcn, ...
                   'gui_LayoutFcn',  @ksstringexpogui_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 ksstringexpogui is made visible.
function ksstringexpogui_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 ksstringexpogui (see VARARGIN)

% Choose default command line output for ksstringexpogui
	handles.output = hObject;
	guidata(hObject, handles);
	set(gcf,'UserData',handles);
	ksstringexpofn;

    
	if (nargin > 3)
		datastruct = varargin{1};
		ksstringexpofn('readinput',datastruct);
	end

% --- Outputs from this function are returned to the command line.
function varargout = ksstringexpogui_OutputFcn(hObject, eventdata, handles)
	varargout{1} = handles.output;

% --------------------------------------------------------------------
function FileMenu_Callback(hObject, eventdata, handles)

% --------------------------------------------------------------------
function PrintMenuItem_Callback(hObject, eventdata, handles)
	ksstringexpofn 'print';

% --------------------------------------------------------------------
function CloseMenuItem_Callback(hObject, eventdata, handles)
	ksstringexpofn 'close';

% --- Executes on button press in print.
function print_Callback(hObject, eventdata, handles)
	ksstringexpofn 'print';


% --------------------------------------------------------------------
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


% ----------9----------------------------------------------------------
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)
    ksstringexpofn 'help';


% --- Executes when ksstringexpogui_fig window is resized.
function ksstringexpogui_fig_ResizeFcn(hObject, eventdata, handles)
% hObject    handle to ksstringexpogui_fig (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    ksstringexpofn 'resize';


% --- Executes on button press in play.
function play_Callback(hObject, eventdata, handles)
% hObject    handle to play (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	ksstringexpofn 'play';


% --- Executes on selection change in excite_menu.
function excite_menu_Callback(hObject, eventdata, handles)
% hObject    handle to excite_menu (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 excite_menu contents as cell array
%        contents{get(hObject,'Value')} returns selected item from excite_menu
    contents = get(hObject,'String');
    switch contents{get(hObject,'Value')}
        case 'Noise'
            set(handles.excitepos_text,'Enable','off');
        otherwise
            set(handles.excitepos_text,'Enable','on');
    end
    ksstringexpofn 'excitetype';

% --- Executes during object creation, after setting all properties.
function excite_menu_CreateFcn(hObject, eventdata, handles)
% hObject    handle to excite_menu (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (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 edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double


% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in model_menu.
function model_menu_Callback(hObject, eventdata, handles)
% hObject    handle to model_menu (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 model_menu contents as cell array
%        contents{get(hObject,'Value')} returns selected item from model_menu
    contents = get(hObject,'String');
    switch contents{get(hObject,'Value')}
        case {'Ideal'}
            set(handles.loss_text,'Enable','inactive');
        otherwise
            set(handles.loss_text,'Enable','on');
    end

% --- Executes during object creation, after setting all properties.
function model_menu_CreateFcn(hObject, eventdata, handles)
% hObject    handle to model_menu (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function loss_Callback(hObject, eventdata, handles)
% hObject    handle to loss (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 loss as text
%        str2double(get(hObject,'String')) returns contents of loss as a double
    val = str2num(get(hObject,'String'));
	if (val > 1)
		val = 1;
    elseif (val < 0)
        val = 0;
    end
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function loss_CreateFcn(hObject, eventdata, handles)
% hObject    handle to loss (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function frequency_text_Callback(hObject, eventdata, handles)
% hObject    handle to frequency_text (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 frequency_text as text
%        str2double(get(hObject,'String')) returns contents of frequency_text as a double
    val = str2num(get(hObject,'String'));
    if (val < 1)
        val = 1;
    end
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function frequency_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to frequency_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function amplitude_text_Callback(hObject, eventdata, handles)
% hObject    handle to amplitude_text (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 amplitude_text as text
%        str2double(get(hObject,'String')) returns contents of amplitude_text as a double
    val = str2num(get(hObject,'String'));
	if (val > 1)
		val = 1;
    elseif (val < 0)
        val = abs(val);
    end
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function amplitude_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to amplitude_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function excitepos_text_Callback(hObject, eventdata, handles)
% hObject    handle to excitepos_text (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 excitepos_text as text
%        str2double(get(hObject,'String')) returns contents of excitepos_text as a double
    val = str2num(get(hObject,'String'));
	if (val > 0.99)
		val = 0.99;
    elseif (val < 0.01)
        val = 0.01;
    end
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function excitepos_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to excitepos_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function pickups_text_Callback(hObject, eventdata, handles)
% hObject    handle to pickups_text (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 pickups_text as text
%        str2double(get(hObject,'String')) returns contents of pickups_text as a double
    % Check to see if valid positions for pickups_text [0.01, 0.99]
    val = get(hObject,'String');
    val = str2num(val);
    for i=1:size(val,2)
        if val(i) < 0.01
            val(i) = 0.01;
        elseif val(i) > 0.99
            val(i) = 0.99;
        end
    end
    % Remove duplicates
    newval = [];
    for i=1:size(val,2)
        a = find(val==val(i));
        newval = [newval val(i)];
%         if length(a) ~= 1
%             val(a(end) = val();
%         end
    end
    newval = sort(newval);
    set(hObject,'String',num2str(newval));

% --- Executes during object creation, after setting all properties.
function pickups_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to pickups_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in synthesize.
function synthesize_Callback(hObject, eventdata, handles)
% hObject    handle to synthesize (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    ksstringexpofn 'synthesize';

% --------------------------------------------------------------------
function fourierexpo_Callback(hObject, eventdata, handles)
% hObject    handle to fourierexpo (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    ksstringexpofn 'fourierexpo';

% --------------------------------------------------------------------
function sonoexpo_Callback(hObject, eventdata, handles)
% hObject    handle to sonoexpo (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    ksstringexpofn 'sonoexpo';

% --------------------------------------------------------------------
function Untitled_4_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on selection change in instmenu.
function instmenu_Callback(hObject, eventdata, handles)
% hObject    handle to instmenu (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 instmenu contents as cell array
%        contents{get(hObject,'Value')} returns selected item from instmenu
    ksstringexpofn 'instmenu';

% --- Executes during object creation, after setting all properties.
function instmenu_CreateFcn(hObject, eventdata, handles)
% hObject    handle to instmenu (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in roommenu.
function roommenu_Callback(hObject, eventdata, handles)
% hObject    handle to roommenu (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 roommenu contents as cell array
%        contents{get(hObject,'Value')} returns selected item from roommenu
    ksstringexpofn 'roommenu';

% --- Executes during object creation, after setting all properties.
function roommenu_CreateFcn(hObject, eventdata, handles)
% hObject    handle to roommenu (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --------------------------------------------------------------------
function save_Callback(hObject, eventdata, handles)
% hObject    handle to save (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    ksstringexpofn 'save';


function Fs_text_Callback(hObject, eventdata, handles)
% hObject    handle to Fs_text (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 Fs_text as text
%        str2double(get(hObject,'String')) returns contents of Fs_text as a double
    val = str2num(get(hObject,'String'));
    if (val < 0)
        val = 1;
    end
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function Fs_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Fs_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function duration_text_Callback(hObject, eventdata, handles)
% hObject    handle to duration_text (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 duration_text as text
%        str2double(get(hObject,'String')) returns contents of duration_text as a double
    val = str2num(get(hObject,'String'));
    if (val < 0)
        val = 0;
    end
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function duration_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to duration_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function infobox_inst_Callback(hObject, eventdata, handles)
% hObject    handle to infobox_inst (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 infobox_inst as text
%        str2double(get(hObject,'String')) returns contents of infobox_inst as a double


% --- Executes during object creation, after setting all properties.
function infobox_inst_CreateFcn(hObject, eventdata, handles)
% hObject    handle to infobox_inst (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function infobox_room_Callback(hObject, eventdata, handles)
% hObject    handle to infobox_room (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 infobox_room as text
%        str2double(get(hObject,'String')) returns contents of infobox_room as a double


% --- Executes during object creation, after setting all properties.
function infobox_room_CreateFcn(hObject, eventdata, handles)
% hObject    handle to infobox_room (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in fourier_inst.
function fourier_inst_Callback(hObject, eventdata, handles)
% hObject    handle to fourier_inst (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    ksstringexpofn 'fourier_inst';

% --- Executes on button press in fourier_room.
function fourier_room_Callback(hObject, eventdata, handles)
% hObject    handle to fourier_room (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    ksstringexpofn 'fourier_room';


% --------------------------------------------------------------------
function reverbexpo_Callback(hObject, eventdata, handles)
% hObject    handle to reverbexpo (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    ksstringexpofn 'reverbexpo';


% --- Executes on selection change in popupmenu10.
function popupmenu10_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu10 (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 popupmenu10 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu10


% --- Executes during object creation, after setting all properties.
function popupmenu10_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu10 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in synthmenu.
function synthmenu_Callback(hObject, eventdata, handles)
% hObject    handle to synthmenu (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 synthmenu contents as cell array
%        contents{get(hObject,'Value')} returns selected item from synthmenu
    ksstringexpofn 'synthmenu';

% --- Executes during object creation, after setting all properties.
function synthmenu_CreateFcn(hObject, eventdata, handles)
% hObject    handle to synthmenu (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function infobox_synth_Callback(hObject, eventdata, handles)
% hObject    handle to infobox_synth (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 infobox_synth as text
%        str2double(get(hObject,'String')) returns contents of infobox_synth as a double


% --- Executes during object creation, after setting all properties.
function infobox_synth_CreateFcn(hObject, eventdata, handles)
% hObject    handle to infobox_synth (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function notestart_text_Callback(hObject, eventdata, handles)
% hObject    handle to notestart_text (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 notestart_text as text
%        str2double(get(hObject,'String')) returns contents of notestart_text as a double
    val = floor(str2num(get(hObject,'String')));
    if (val < 0)
        val = 1;
    end
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function notestart_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to notestart_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function noteend_text_Callback(hObject, eventdata, handles)
% hObject    handle to noteend_text (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 noteend_text as text
%        str2double(get(hObject,'String')) returns contents of noteend_text as a double
    val = floor(str2num(get(hObject,'String')));
    if (val < 0)
        val = 1;
    end
	set(hObject,'String',num2str(val));


% --- Executes during object creation, after setting all properties.
function noteend_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to noteend_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function tempo_text_Callback(hObject, eventdata, handles)
% hObject    handle to tempo_text (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 tempo_text as text
%        str2double(get(hObject,'String')) returns contents of tempo_text as a double
    val = str2num(get(hObject,'String'));
    if (val < 0)
        val = 1;
    end
	set(hObject,'String',num2str(val));


% --- Executes during object creation, after setting all properties.
function tempo_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to tempo_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in pianoroll.
function pianoroll_Callback(hObject, eventdata, handles)
% hObject    handle to pianoroll (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    ksstringexpofn 'pianoroll';



function wetness_inst_Callback(hObject, eventdata, handles)
% hObject    handle to wetness_inst (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 wetness_inst as text
%        str2double(get(hObject,'String')) returns contents of wetness_inst as a double
    val = abs(str2num(get(hObject,'String')));
    if (val > 100)
        val = 100;
    end
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function wetness_inst_CreateFcn(hObject, eventdata, handles)
% hObject    handle to wetness_inst (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function wetness_room_Callback(hObject, eventdata, handles)
% hObject    handle to wetness_room (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 wetness_room as text
%        str2double(get(hObject,'String')) returns contents of wetness_room as a double
    val = abs(str2num(get(hObject,'String')));
    if (val > 100)
        val = 100;
    end
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function wetness_room_CreateFcn(hObject, eventdata, handles)
% hObject    handle to wetness_room (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function transpose_text_Callback(hObject, eventdata, handles)
% hObject    handle to transpose_text (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 transpose_text as text
%        str2double(get(hObject,'String')) returns contents of transpose_text as a double
    val = abs(str2num(get(hObject,'String')));
	set(hObject,'String',num2str(val));

% --- Executes during object creation, after setting all properties.
function transpose_text_CreateFcn(hObject, eventdata, handles)
% hObject    handle to transpose_text (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end




% --- Creates and returns a handle to the GUI figure. 
function h1 = ksstringexpogui_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

appdata = [];
appdata.GUIDEOptions = struct(...
    'active_h', [], ...
    'taginfo', struct(...
    'figure', 2, ...
    'axes', 8, ...
    'pushbutton', 16, ...
    'popupmenu', 12, ...
    'listbox', 2, ...
    'text', 33, ...
    'slider', 5, ...
    'checkbox', 6, ...
    'radiobutton', 5, ...
    'edit', 19, ...
    'uipanel', 5), ...
    'override', 1, ...
    'release', 13, ...
    'resize', 'simple', ...
    'accessibility', 'callback', ...
    'mfile', 1, ...
    'callbacks', 1, ...
    'singleton', 1, ...
    'syscolorfig', 1, ...
    'lastSavedFile', '/Users/bobsturm/SSUM/physmodel/ksstring/ksstringexpogui.m', ...
    'blocking', 0);
appdata.lastValidTag = 'ksstringexpo_fig';
appdata.GUIDELayoutEditor = [];

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],...
'DockControls','off',...
'IntegerHandle','off',...
'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),...
'MenuBar','none',...
'Name','String Model Explorer',...
'NumberTitle','off',...
'PaperOrientation','landscape',...
'PaperPosition',get(0,'defaultfigurePaperPosition'),...
'PaperSize',[11 8.5],...
'Pointer','crosshair',...
'Position',[1 44.2692307692307 115.666666666667 26.5],...
'Renderer',get(0,'defaultfigureRenderer'),...
'RendererMode','manual',...
'Resize','off',...
'HandleVisibility','callback',...
'Tag','ksstringexpo_fig',...
'UserData',[],...
'Behavior',get(0,'defaultfigureBehavior'),...
'Visible','on',...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'FileMenu';

h2 = uimenu(...
'Parent',h1,...
'Callback','ksstringexpogui(''FileMenu_Callback'',gcbo,[],guidata(gcbo))',...
'Label','File',...
'Tag','FileMenu',...
'Behavior',get(0,'defaultuimenuBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'save';

h3 = uimenu(...
'Parent',h2,...
'Callback','ksstringexpogui(''save_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Save',...
'Tag','save',...
'Behavior',get(0,'defaultuimenuBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'CloseMenuItem';

h4 = uimenu(...
'Parent',h2,...
'Callback','ksstringexpogui(''CloseMenuItem_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Close',...
'Separator','on',...
'Tag','CloseMenuItem',...
'Behavior',get(0,'defaultuimenuBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'Untitled_1';

h5 = uimenu(...
'Parent',h1,...
'Callback','ksstringexpogui(''Untitled_1_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Send to...',...
'Tag','Untitled_1',...
'Behavior',get(0,'defaultuimenuBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'fourierexpo';

h6 = uimenu(...
'Parent',h5,...
'Callback','ksstringexpogui(''fourierexpo_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Fourier Explorer',...
'Tag','fourierexpo',...
'Behavior',get(0,'defaultuimenuBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'sonoexpo';

h7 = uimenu(...
'Parent',h5,...
'Callback','ksstringexpogui(''sonoexpo_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Sonogram Explorer',...
'Tag','sonoexpo',...
'Behavior',get(0,'defaultuimenuBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'reverbexpo';

h8 = uimenu(...
'Parent',h5,...
'Callback','ksstringexpogui(''reverbexpo_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Reverb Explorer',...
'Tag','reverbexpo',...
'Behavior',get(0,'defaultuimenuBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'text10';

h9 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'FontSize',14,...
'HorizontalAlignment','right',...
'Position',[77.6666666666667 24.1666666666667 35 1.83333333333333],...
'String','The Karplus_Strong String',...
'Style','text',...
'Tag','text10',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'play';

h10 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','ksstringexpogui(''play_Callback'',gcbo,[],guidata(gcbo))',...
'CData',[],...
'ListboxTop',0,...
'Position',[100.666666666667 2.08333333333333 10 1.5],...
'String','Play',...
'Tag','play',...
'UserData',[],...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'excite_menu';

h11 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','ksstringexpogui(''excite_menu_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[4.66666666666667 18.3333333333333 11 1.5],...
'String',{  'Pluck'; 'Strike'; 'Noise'; 'Bow' },...
'Style','popupmenu',...
'Value',1,...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''excite_menu_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','excite_menu',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'model_menu';

h12 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','ksstringexpogui(''model_menu_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[4.66666666666667 7.83333333333334 11 1.5],...
'String',{  'Ideal'; 'Lossy'; 'Loss(f)' },...
'Style','popupmenu',...
'Value',1,...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''model_menu_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','model_menu',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text13';

h13 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[18.1666666666667 9.41666666666667 10 1.5],...
'String','Loss Factor',...
'Style','text',...
'Tag','text13',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'loss_text';

h14 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''loss_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[18.1666666666667 7.83333333333334 10 1.5],...
'String','0.0',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''loss_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','loss_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text15';

h15 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[4.66666666666667 16.25 12 1.5],...
'String','Frequency (Hz)',...
'Style','text',...
'Tag','text15',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'frequency_text';

h16 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''frequency_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[4.66666666666667 14.8333333333333 10 1.5],...
'String','440.0',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''frequency_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','frequency_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text17';

h17 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[19.3333333333333 19.8333333333333 12 1.5],...
'String','Excite Position',...
'Style','text',...
'Tag','text17',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'excitepos_text';

h18 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''excitepos_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[19.3333333333333 18.3333333333333 10 1.5],...
'String','0.5',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''excitepos_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','excitepos_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text14';

h19 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',[],...
'HorizontalAlignment','left',...
'Position',[4.66666666666667 19.8333333333333 10 1.5],...
'String','Excitation',...
'Style','text',...
'Tag','text14',...
'UserData',[],...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'text19';

h20 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',[],...
'HorizontalAlignment','left',...
'Position',[4.66666666666667 9.25 10 1.5],...
'String','Model',...
'Style','text',...
'Tag','text19',...
'UserData',[],...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'uipanel1';

h21 = uipanel(...
'Parent',h1,...
'Units','characters',...
'Title','String Model',...
'Position',[2.5 1.25 35.1666666666667 21.75],...
'Tag','uipanel1',...
'Behavior',get(0,'defaultuipanelBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'pickups_text';

h22 = uicontrol(...
'Parent',h21,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''pickups_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[2.16666666666667 2.25 30 1.5],...
'String','0.25',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''pickups_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','pickups_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text16';

h23 = uicontrol(...
'Parent',h21,...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[16.3333333333333 14.8333333333333 12 1.5],...
'String','Amplitude',...
'Style','text',...
'Tag','text16',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'amplitude_text';

h24 = uicontrol(...
'Parent',h21,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''amplitude_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[16.3333333333333 13.5833333333333 10 1.5],...
'String','0.5',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''amplitude_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','amplitude_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'uipanel2';

h25 = uipanel(...
'Parent',h1,...
'Units','characters',...
'Title','Instrument Model',...
'Position',[39.6666666666667 12.0833333333333 35.1666666666667 11],...
'Tag','uipanel2',...
'Behavior',get(0,'defaultuipanelBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'instmenu';

h26 = uicontrol(...
'Parent',h25,...
'Units','characters',...
'Callback','ksstringexpogui(''instmenu_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[1.5 7.66666666666667 11 1.5],...
'String',{  'None'; 'Load' },...
'Style','popupmenu',...
'Value',1,...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''instmenu_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','instmenu',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'infobox_inst';

h27 = uicontrol(...
'Parent',h25,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''infobox_inst_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Max',10,...
'Position',[1.5 2.08333333333333 31.5 5],...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''infobox_inst_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','infobox_inst',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text23';

h28 = uicontrol(...
'Parent',h25,...
'Units','characters',...
'Position',[13 7.25 10 1.5],...
'String','File Info',...
'Style','text',...
'Tag','text23',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'wetness_inst';

h29 = uicontrol(...
'Parent',h25,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''wetness_inst_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[13.5 0.416666666666667 8 1.5],...
'String','100',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''wetness_inst_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','wetness_inst',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text30';

h30 = uicontrol(...
'Parent',h25,...
'Units','characters',...
'HorizontalAlignment','right',...
'Position',[1.66666666666667 0.25 11 1.5],...
'String','Wetness (%)',...
'Style','text',...
'Tag','text30',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'uipanel3';

h31 = uipanel(...
'Parent',h1,...
'Units','characters',...
'Title','Room Model',...
'Position',[39.6666666666667 1.25 35.1666666666667 11],...
'Tag','uipanel3',...
'Behavior',get(0,'defaultuipanelBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'roommenu';

h32 = uicontrol(...
'Parent',h31,...
'Units','characters',...
'Callback','ksstringexpogui(''roommenu_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[2.16666666666667 7.75 11 1.5],...
'String',{  'None'; 'Load' },...
'Style','popupmenu',...
'Value',1,...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''roommenu_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','roommenu',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'infobox_room';

h33 = uicontrol(...
'Parent',h31,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''infobox_room_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Max',10,...
'Position',[1.66666666666667 2.16666666666667 31.5 5],...
'String','',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''infobox_room_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','infobox_room',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text24';

h34 = uicontrol(...
'Parent',h31,...
'Units','characters',...
'Position',[13.3333333333333 7.5 10 1.5],...
'String','File Info',...
'Style','text',...
'Tag','text24',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'wetness_room';

h35 = uicontrol(...
'Parent',h31,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''wetness_room_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[13.5 0.5 8 1.5],...
'String','100',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''wetness_room_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','wetness_room',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text31';

h36 = uicontrol(...
'Parent',h31,...
'Units','characters',...
'HorizontalAlignment','right',...
'Position',[1.66666666666667 0.333333333333333 11 1.5],...
'String','Wetness (%)',...
'Style','text',...
'Tag','text31',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'text20';

h37 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'HorizontalAlignment','left',...
'Position',[5.16666666666667 5.16666666666667 14 1.5],...
'String','Pickup Positions',...
'Style','text',...
'Tag','text20',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'help';

h38 = uimenu(...
'Parent',h1,...
'Callback','ksstringexpogui(''help_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Help',...
'Tag','help',...
'Behavior',get(0,'defaultuimenuBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'fourier_room';

h39 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','ksstringexpogui(''fourier_room_Callback'',gcbo,[],guidata(gcbo))',...
'CData',[],...
'ListboxTop',0,...
'Position',[63.1666666666667 9 10 1.5],...
'String','Fourier',...
'Tag','fourier_room',...
'UserData',[],...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'fourier_inst';

h40 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','ksstringexpogui(''fourier_inst_Callback'',gcbo,[],guidata(gcbo))',...
'CData',[],...
'ListboxTop',0,...
'Position',[63.3333333333333 19.75 10 1.5],...
'String','Fourier',...
'Tag','fourier_inst',...
'UserData',[],...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'uipanel4';

h41 = uipanel(...
'Parent',h1,...
'Units','characters',...
'Title','Synthesis',...
'Position',[77.3333333333333 1.25 35.1666666666667 22],...
'Tag','uipanel4',...
'Behavior',get(0,'defaultuipanelBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'synthmenu';

h42 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'Callback','ksstringexpogui(''synthmenu_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[1.5 18.5833333333333 11 1.5],...
'String',{  'Note'; 'Load' },...
'Style','popupmenu',...
'Value',1,...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''synthmenu_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','synthmenu',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'infobox_synth';

h43 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''infobox_synth_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Max',10,...
'Position',[1.5 13.0833333333333 31.5 5],...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''infobox_synth_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','infobox_synth',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text26';

h44 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'Position',[13 18.25 10 1.5],...
'String','File Info',...
'Style','text',...
'Tag','text26',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'duration_text';

h45 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''duration_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[16.3333333333333 10.6666666666667 8 1.5],...
'String','3.0',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''duration_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','duration_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'durtext';

h46 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'HorizontalAlignment','right',...
'Position',[1.5 10.5 13 1.5],...
'String','Duration (s)',...
'Style','text',...
'Tag','durtext',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'Fs_text';

h47 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''Fs_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[16.3333333333333 8.66666666666667 8 1.5],...
'String','22050',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''Fs_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','Fs_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text21';

h48 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'HorizontalAlignment','right',...
'Position',[1.33333333333333 8.5 13 1.5],...
'String','Sound Fs (Hz)',...
'Style','text',...
'Tag','text21',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'synthesize';

h49 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'Callback','ksstringexpogui(''synthesize_Callback'',gcbo,[],guidata(gcbo))',...
'CData',[],...
'ListboxTop',0,...
'Position',[12.3333333333333 0.75 10 1.5],...
'String','Synthesize',...
'Tag','synthesize',...
'UserData',[],...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'notestart_text';

h50 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''notestart_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[9.16666666666667 6.66666666666667 6 1.5],...
'String','1',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''notestart_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','notestart_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text27';

h51 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'HorizontalAlignment','right',...
'Position',[1.5 6.5 6 1.5],...
'String','Start',...
'Style','text',...
'Tag','text27',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'noteend_text';

h52 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''noteend_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[24.6666666666667 6.66666666666667 6 1.5],...
'String','1',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''noteend_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','noteend_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'Tempo';

h53 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'HorizontalAlignment','right',...
'Position',[6.5 4.41666666666667 8 1.5],...
'String','Tempo',...
'Style','text',...
'Tag','Tempo',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'text29';

h54 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'HorizontalAlignment','right',...
'Position',[18.1666666666667 6.5 5 1.5],...
'String','End',...
'Style','text',...
'Tag','text29',...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'tempo_text';

h55 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''tempo_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[16.5 4.75 6 1.5],...
'String','120',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''tempo_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','tempo_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'transpose_text';

h56 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','ksstringexpogui(''transpose_text_Callback'',gcbo,[],guidata(gcbo))',...
'HorizontalAlignment','left',...
'Position',[16.5 2.91666666666667 6 1.5],...
'String','1',...
'Style','edit',...
'CreateFcn', {@local_CreateFcn, 'ksstringexpogui(''transpose_text_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...
'Tag','transpose_text',...
'Behavior',get(0,'defaultuicontrolBehavior'));

appdata = [];
appdata.lastValidTag = 'text32';

h57 = uicontrol(...
'Parent',h41,...
'Units','characters',...
'CData',[],...
'HorizontalAlignment','right',...
'Position',[4.66666666666667 2.83333333333333 10 1.5],...
'String','Transpose',...
'Style','text',...
'Tag','text32',...
'UserData',[],...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );

appdata = [];
appdata.lastValidTag = 'pianoroll';

h58 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','ksstringexpogui(''pianoroll_Callback'',gcbo,[],guidata(gcbo))',...
'CData',[],...
'ListboxTop',0,...
'Position',[100.666666666667 19.8333333333333 10 1.5],...
'String','Piano Roll',...
'Tag','pianoroll',...
'UserData',[],...
'Behavior',get(0,'defaultuicontrolBehavior'),...
'CreateFcn', {@local_CreateFcn, '', appdata} );


hsingleton = h1;


% --- Set application data first then calling the CreateFcn. 
function local_CreateFcn(hObject, eventdata, createfcn, appdata)

if ~isempty(appdata)
   names = fieldnames(appdata);
   for i=1:length(names)
       name = char(names(i));
       setappdata(hObject, name, getfield(appdata,name));
   end
end

if ~isempty(createfcn)
   eval(createfcn);
end


% --- 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 = [gui_State.(gui_StateFields{i}), '.m'];
    end
end

numargin = length(varargin);

if numargin == 0
    % KSSTRINGEXPOGUI
    % create the GUI
    gui_Create = 1;
elseif isequal(ishandle(varargin{1}), 1) && ispc && iscom(varargin{1}) && isequal(varargin{1},gcbo)
    % KSSTRINGEXPOGUI(ACTIVEX,...)    
    vin{1} = gui_State.gui_Name;
    vin{2} = [get(varargin{1}.Peer, 'Tag'), '_', varargin{end}];
    vin{3} = varargin{1};
    vin{4} = varargin{end-1};
    vin{5} = guidata(varargin{1}.Peer);
    feval(vin{:});
    return;
elseif ischar(varargin{1}) && numargin>1 && isequal(ishandle(varargin{2}), 1)
    % KSSTRINGEXPOGUI('CALLBACK',hObject,eventData,handles,...)
    gui_Create = 0;
else
    % KSSTRINGEXPOGUI(...)
    % 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);
        % openfig (called by local_openfig below) does this for guis without
        % the LayoutFcn. Be sure to do it here so guis show up on screen.
        movegui(gui_hFigure,'onscreen')
    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 || ~ischar(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)

% openfig with three arguments was new from R13. Try to call that first, if
% failed, try the old openfig.
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