%% Select Input File

[filename_input] = uigetfile('*.wav','Select the INPUT audio file (.wav)'); 

%% Select IR

[filename_IR] = uigetfile('*.wav','Select the IMPULSE RESPONSE audio file (.wav)');

%% Sets Inputs for Step 2: 

prompt = {'Distortion Type (1 = tanhdist, 2 = expdist or 3 = symclip)','Enter decayfactor:','Input/IR Mix (0 = 100% "Input", 100 = 100% "IR"):','Distortion Wet/Dry Mix % (0 = fully clean, 100 = fully distorted):','Distortion Value ("Gain"):','Reverse Impulse Response? (Yes or No)','Sampling Rate','Time Stretch? (0 = No, 1 = Yes)','System Type: A = Post Convolution (Default), B = Pre-Convolution'};
dlg_title = 'Set Inputs for distCONV';
num_lines = 1; 
defaultans = {'1','1','50','50','1000','No','44100','0','A'};
answer = inputdlg(prompt,dlg_title,num_lines,defaultans); 

    [distortion_option status] = str2num(answer{1});
    if ~status
        % Handle empty value returned 
        % for unsuccessful conversion
        % ... 
    end 

    [decayfactor status] = str2num(answer{2});
    if ~status
    end 

    [mix_wetdry status] = str2num(answer{3});
    if ~status 
    end

    [mix_distortion status] = str2num(answer{4});
    if ~status
    end

    [dist_value status] = str2num(answer{5});
    if ~status
    end

    reverse_IR = answer{6};
       if strcmp(answer{6}, 'yes') == 1;
       reverse_IR = 'Yes'; 
       end 
    
    [fs status] = str2num(answer{7});
    if ~status
    end
    
    [t_stretch_ans status] = str2num(answer{8});
    if ~status
    end
    
    systemstatus = answer{9};
    if strcmp(answer{9}, 'b') == 1;
       systemstatus = 'B' 
    end
