0001 function gui_auditory_cbk(src,eventdata,options)
0002 switch(get(src,'tag'))
0003 case 'go',
0004 target = DIVA('GUI','FmtValues')';
0005 moveArtics(target);
0006 case 'fmt',
0007 set(src,'value',str2num(get(src,'string')));
0008 case 'fmt_space',
0009 F=[662 1251 2278;
0010 660 1720 2410;
0011 677 1419 2241;
0012 519 1619 2411;
0013 490 1350 1690;
0014 390 1990 2550;
0015 270 2290 3010;
0016 392 964 2233;
0017 526 910.5 2108;
0018 541 1097 2239];
0019
0020
0021
0022
0023
0024
0025
0026
0027 if(strcmp(get(src,'Type'),'axes'))
0028 x=get(src,'CurrentPoint');
0029 else
0030 x=get(get(src,'parent'),'CurrentPoint');
0031 end
0032
0033 f=[x(1,1), x(1,2)];
0034 [err,idx]=min(sqrt(sum((F(:,[1,2])-repmat(f,size(F,1),1)).^2,2)));
0035 f = [f,F(idx,3)]';
0036 moveArtics(f);
0037 end
0038
0039 function moveArtics(target),
0040 SE = 10;
0041 iter = 1;
0042 DIVA('GUI','VTAction','disable');
0043 while(SE > 0.010 & iter < 30)
0044 iter = iter+1;
0045 artic = DIVA('GUI','artic_slider',[]);
0046 temp = DIVA('VocalTract','motor',artic);
0047 current = temp{1};
0048 dCurrent = target - current;
0049 dArtic = calculateInverse(artic,current,dCurrent,size(current,1));
0050 SE = sum(dArtic.^2);
0051 dArtic = 0.8*dArtic;
0052 newArtic = artic+dArtic;
0053
0054
0055
0056
0057
0058 newArtic=max(min(newArtic,DIVA('VocalTract','MaedaSpread')),...
0059 -DIVA('VocalTract','MaedaSpread'));
0060
0061 DIVA('GUI','artic_slider',newArtic);
0062 DIVA('GUI','artic_edit',newArtic);
0063 DIVA('GUI','VT_Configuration','update');
0064 temp = DIVA('VocalTract','motor',newArtic);
0065 newFmt = temp{1};
0066
0067 DIVA('GUI','FmtSpace_crosshairs',(newFmt));
0068 DIVA('GUI','FmtValues',newFmt);
0069 end
0070 DIVA('GUI','VTAction','enable');