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

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

% Last Modified by GUIDE v2.5 28-Feb-2005 11:30:36

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @ksstringexpo_OpeningFcn, ...
                   'gui_OutputFcn',  @ksstringexpo_OutputFcn, ...
                   'gui_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 ksstringexpo is made visible.
function ksstringexpo_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 ksstringexpo (see VARARGIN)

% Choose default command line output for ksstringexpo
	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 = ksstringexpo_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 ksstringexpo_fig window is resized.
function ksstringexpo_fig_ResizeFcn(hObject, eventdata, handles)
% hObject    handle to ksstringexpo_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