瀏覽代碼

cmDspPgmKr.c : Added EchoCancel to TKSB.

Changed default input and output gain to 0.0.
master
kevin 9 年之前
父節點
當前提交
7c6a0f5da5
共有 1 個檔案被更改,包括 31 行新增23 行删除
  1. 31
    23
      dsp/cmDspPgmKr.c

+ 31
- 23
dsp/cmDspPgmKr.c 查看文件

@@ -382,7 +382,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
382 382
   cmErr_t         err;
383 383
   krRsrc_t        r;
384 384
   bool     fragFl       = false;
385
-  bool     useWtFl      = true;
385
+  bool     useWtFl      = false;
386 386
   bool     useChain1Fl  = true;
387 387
   bool     useInputEqFl = false;
388 388
   bool     useInCompFl  = true;
@@ -442,10 +442,10 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
442 442
   if( krLoadRsrc(h,&err,&r) != kOkDspRC )
443 443
     return rc;
444 444
 
445
-  cmDspInst_t* ai0p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 2);
446
-  cmDspInst_t* ai1p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 3);
447
-  cmDspInst_t* ai2p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 4);
448
-  cmDspInst_t* ai3p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 5);
445
+  cmDspInst_t* ai0p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 0);
446
+  cmDspInst_t* ai1p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 1);
447
+  cmDspInst_t* ai2p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 2);
448
+  cmDspInst_t* ai3p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 3);
449 449
 
450 450
   cmDspInst_t* eqLpf_0 =  useInputEqFl ? cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, eqBypassFl, eqLpSymId,eqLpF0hz, eqLpQ, eqLpGain  ) : NULL; 
451 451
   cmDspInst_t* eqLpf_1 =  useInputEqFl ? cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, eqBypassFl, eqLpSymId,eqLpF0hz, eqLpQ, eqLpGain  ) : NULL; 
@@ -579,10 +579,10 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
579 579
   cmDspInst_t* apf2 =  cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, apfBypassFl, apfModeSymId, apfF0hz+200.0, apfQ, apfGain  ); 
580 580
   cmDspInst_t* apf3 =  cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, apfBypassFl, apfModeSymId, apfF0hz+300.0, apfQ, apfGain  ); 
581 581
 
582
-  cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 );
583
-  cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 1 );
584
-  cmDspInst_t* ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
585
-  cmDspInst_t* ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
582
+  cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
583
+  cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
584
+  cmDspInst_t* ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 4 );
585
+  cmDspInst_t* ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 5 );
586 586
 
587 587
   cmDspSysNewPage(h,"Main");
588 588
   cmDspInst_t* liveb= cmDspSysAllocInst(h,"Button", "live",    2, kCheckDuiId,  0.0 );
@@ -1270,6 +1270,9 @@ cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr )
1270 1270
   cmDspInst_t* ai2p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 2);
1271 1271
   cmDspInst_t* ai3p = cmDspSysAllocInst(h,"AudioIn",     NULL,  1, 3);
1272 1272
 
1273
+  cmDspInst_t* ec0  = cmDspSysAllocInst(h,"EchoCancel", NULL, 1, 0,1 );
1274
+  cmDspInst_t* ec1  = cmDspSysAllocInst(h,"EchoCancel", NULL, 1, 0,1 );
1275
+
1273 1276
   cmDspInst_t* eqLpf_0 =  useInputEqFl ? cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, eqBypassFl, eqLpSymId,eqLpF0hz, eqLpQ, eqLpGain  ) : NULL; 
1274 1277
   cmDspInst_t* eqLpf_1 =  useInputEqFl ? cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, eqBypassFl, eqLpSymId,eqLpF0hz, eqLpQ, eqLpGain  ) : NULL; 
1275 1278
   cmDspInst_t* eqLpf_2 =  useInputEqFl ? cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, eqBypassFl, eqLpSymId,eqLpF0hz, eqLpQ, eqLpGain  ) : NULL; 
@@ -1406,10 +1409,10 @@ cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr )
1406 1409
   cmDspInst_t* apf2 =  cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, apfBypassFl, apfModeSymId, apfF0hz+200.0, apfQ, apfGain  ); 
1407 1410
   cmDspInst_t* apf3 =  cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, apfBypassFl, apfModeSymId, apfF0hz+300.0, apfQ, apfGain  ); 
1408 1411
 
1409
-  cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 0 );
1410
-  cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 1 );
1411
-  cmDspInst_t* ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
1412
-  cmDspInst_t* ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
1412
+  cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 2 );
1413
+  cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 3 );
1414
+  cmDspInst_t* ao2p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 4 );
1415
+  cmDspInst_t* ao3p = cmDspSysAllocInst(h,"AudioOut",    NULL,   1, 5 );
1413 1416
 
1414 1417
   cmDspSysNewPage(h,"Main");
1415 1418
   cmDspInst_t* liveb= cmDspSysAllocInst(h,"Button", "live",    2, kCheckDuiId,  0.0 );
@@ -1444,10 +1447,10 @@ cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr )
1444 1447
   cmDspInst_t* stRt  = cmDspSysAllocInst(h,"Router", NULL, 2, 2, 0);
1445 1448
 
1446 1449
   cmDspSysNewColumn(h,0);
1447
-  cmDspInst_t* igain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0",    5, kNumberDuiId, 0.0,   100.0,0.01,   1.0 );  
1448
-  cmDspInst_t* igain1 = cmDspSysAllocInst(h,"Scalar", "In Gain-1",    5, kNumberDuiId, 0.0,   100.0,0.01,   1.0 );  
1449
-  cmDspInst_t* igain2 = cmDspSysAllocInst(h,"Scalar", "In Gain-2",    5, kNumberDuiId, 0.0,   100.0,0.01,   1.0 );  
1450
-  cmDspInst_t* igain3 = cmDspSysAllocInst(h,"Scalar", "In Gain-3",    5, kNumberDuiId, 0.0,   100.0,0.01,   1.0 );  
1450
+  cmDspInst_t* igain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0",    5, kNumberDuiId, 0.0,   100.0,0.01,   0.0 );  
1451
+  cmDspInst_t* igain1 = cmDspSysAllocInst(h,"Scalar", "In Gain-1",    5, kNumberDuiId, 0.0,   100.0,0.01,   0.0 );  
1452
+  cmDspInst_t* igain2 = cmDspSysAllocInst(h,"Scalar", "In Gain-2",    5, kNumberDuiId, 0.0,   100.0,0.01,   0.0 );  
1453
+  cmDspInst_t* igain3 = cmDspSysAllocInst(h,"Scalar", "In Gain-3",    5, kNumberDuiId, 0.0,   100.0,0.01,   0.0 );  
1451 1454
 
1452 1455
   cmDspInst_t* lasecs = cmDspSysAllocInst(h,"Scalar", "LA Secs",      5, kNumberDuiId, 0.0,   recdPlayMaxLaSecs,0.01,   recdPlayCurLaSecs );  
1453 1456
   cmDspInst_t* dbpsec = cmDspSysAllocInst(h,"Scalar", "Fade dBpSec",  5, kNumberDuiId, 0.0,   24.0, 0.01, recdPlayFadeRateDbPerSec);
@@ -1456,10 +1459,10 @@ cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr )
1456 1459
 
1457 1460
 
1458 1461
   cmDspSysNewColumn(h,0);
1459
-  cmDspInst_t* ogain0 = cmDspSysAllocInst(h,"Scalar", "Out Gain-0",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
1460
-  cmDspInst_t* ogain1 = cmDspSysAllocInst(h,"Scalar", "Out Gain-1",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
1461
-  cmDspInst_t* ogain2 = cmDspSysAllocInst(h,"Scalar", "Out Gain-2",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
1462
-  cmDspInst_t* ogain3 = cmDspSysAllocInst(h,"Scalar", "Out Gain-3",   5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
1462
+  cmDspInst_t* ogain0 = cmDspSysAllocInst(h,"Scalar", "Out Gain-0",   5, kNumberDuiId, 0.0,   10.0,0.01,   0.0 );  
1463
+  cmDspInst_t* ogain1 = cmDspSysAllocInst(h,"Scalar", "Out Gain-1",   5, kNumberDuiId, 0.0,   10.0,0.01,   0.0 );  
1464
+  cmDspInst_t* ogain2 = cmDspSysAllocInst(h,"Scalar", "Out Gain-2",   5, kNumberDuiId, 0.0,   10.0,0.01,   0.0 );  
1465
+  cmDspInst_t* ogain3 = cmDspSysAllocInst(h,"Scalar", "Out Gain-3",   5, kNumberDuiId, 0.0,   10.0,0.01,   0.0 );  
1463 1466
 
1464 1467
   //cmDspInst_t* scLoc = cmDspSysAllocInst(h,"Scalar", "Sc Loc",   5, kNumberDuiId, 0.0,   3000.0, 1.0,   0.0 );  
1465 1468
 
@@ -1624,8 +1627,11 @@ cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr )
1624 1627
     cmDspSysConnectAudio(h, eqHpf_3, "out", eqMx_3,  "in-2");
1625 1628
   }
1626 1629
 
1627
-  cmDspSysConnectAudio(h, useInputEqFl ? eqMx_0 : ai0p, "out", mx0p, "in-0" );  // eqmix -> input mix
1628
-  cmDspSysConnectAudio(h, useInputEqFl ? eqMx_1 : ai1p, "out", mx1p, "in-0" );
1630
+  cmDspSysConnectAudio(h, ai0p, "out", ec0, "f_in" );
1631
+  cmDspSysConnectAudio(h, ai1p, "out", ec1, "f_in" );
1632
+
1633
+  cmDspSysConnectAudio(h, useInputEqFl ? eqMx_0 : ec0,  "out", mx0p, "in-0" );  // eqmix -> input mix
1634
+  cmDspSysConnectAudio(h, useInputEqFl ? eqMx_1 : ec1,  "out", mx1p, "in-0" );
1629 1635
   cmDspSysConnectAudio(h, useInputEqFl ? eqMx_2 : ai2p, "out", mx0p, "in-1" );
1630 1636
   cmDspSysConnectAudio(h, useInputEqFl ? eqMx_3 : ai3p, "out", mx1p, "in-1" );
1631 1637
 
@@ -1672,6 +1678,7 @@ cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr )
1672 1678
     cmDspSysConnectAudio(h, c0.cmp, "out", apf0, "in" );
1673 1679
     cmDspSysConnectAudio(h, c0.cmp, "out", apf2, "in" );
1674 1680
     cmDspSysConnectAudio(h, apf0,  "out", ao0p,  "in" );
1681
+    cmDspSysConnectAudio(h, apf0,  "out", ec0,   "uf_in" );
1675 1682
     cmDspSysConnectAudio(h, apf2,  "out", ao2p,  "in" );
1676 1683
 
1677 1684
     //cmDspSysConnectAudio(h, wtp, "out", apf0, "in" );
@@ -1722,6 +1729,7 @@ cmDspRC_t _cmDspSysPgm_Tksb(cmDspSysH_t h, void** userPtrPtr )
1722 1729
       cmDspSysConnectAudio(h, c1.cmp, "out",   apf1,  "in" );   // cmp -> mix 0
1723 1730
       cmDspSysConnectAudio(h, c1.cmp, "out",   apf3,  "in" );   // cmp -> mix 0
1724 1731
       cmDspSysConnectAudio(h, apf1,  "out",   ao1p,   "in" );
1732
+      cmDspSysConnectAudio(h, apf1,  "out",   ec1,    "uf_in" );
1725 1733
       cmDspSysConnectAudio(h, apf3,  "out",   ao3p,   "in" );
1726 1734
       
1727 1735
       //cmDspSysConnectAudio(h, wtp, "out", apf1, "in" );

Loading…
取消
儲存