Browse Source

cmDspPgmKr.c : Re-enabled input compressor.

master
Kevin Larke 10 years ago
parent
commit
31dcea8f55
1 changed files with 49 additions and 19 deletions
  1. 49
    19
      dsp/cmDspPgmKr.c

+ 49
- 19
dsp/cmDspPgmKr.c View File

@@ -383,6 +383,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
383 383
   bool     useWtFl      = false;
384 384
   bool     useChain1Fl  = true;
385 385
   bool     useInputEqFl = false;
386
+  bool     useInCompFl  = true;
387
+
386 388
   unsigned wtLoopCnt    = 1;    // 1=play once (-1=loop forever)
387 389
   unsigned wtInitMode   = 0;    // initial wt mode is 'silence'
388 390
   unsigned wtSmpCnt     = floor(cmDspSysSampleRate(h)); // wt length == srate
@@ -420,7 +422,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
420 422
   double          apfQ          = 1.0;
421 423
   double          apfGain       = 1.0;
422 424
 
423
-  /*
425
+
426
+  // input compressor default parameters
424 427
   bool            cmpBypassFl  = false;
425 428
   double          cmpInGain    = 3.0;
426 429
   double          cmpThreshDb  = -40.0;
@@ -430,8 +433,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
430 433
   double          cmpMakeup    = 1.0;
431 434
   double          cmpWndMaxMs  = 1000.0;
432 435
   double          cmpWndMs     = 200.0;
433
-  */
434
-
436
+ 
435 437
   memset(&r,0,sizeof(r));
436 438
   cmErrSetup(&err,&cmCtx->rpt,"Kr Timeline");
437 439
 
@@ -465,13 +467,17 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
465 467
   cmDspInst_t* eqMx_3 = useInputEqFl ? cmDspSysAllocInst( h, "AMix",      NULL, 4, 3, eqMixGain, eqMixGain, eqMixGain) : NULL;
466 468
 
467 469
 
468
-  cmDspInst_t* mx0p = cmDspSysAllocInst( h, "AMix",      NULL, 3, 2, 1.0, 1.0);
469
-  cmDspInst_t* mx1p = cmDspSysAllocInst( h, "AMix",      NULL, 3, 2, 1.0, 1.0);
470
+  cmDspInst_t* mx0p = cmDspSysAllocInst( h, "AMix",      NULL, 3, 2, 0.5, 0.5);
471
+  cmDspInst_t* mx1p = cmDspSysAllocInst( h, "AMix",      NULL, 3, 2, 0.5, 0.5);
470 472
 
473
+  cmDspInst_t* ci0p = NULL;
474
+  cmDspInst_t* ci1p = NULL;
471 475
 
472
-  //cmDspInst_t* ci0p = cmDspSysAllocInst(h,"Compressor",  NULL,  8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
473
-  //cmDspInst_t* ci1p = cmDspSysAllocInst(h,"Compressor",  NULL,  8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
474
-
476
+  if( useInCompFl )
477
+  {
478
+    ci0p = cmDspSysAllocInst(h,"Compressor",  NULL,  8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
479
+    ci1p = cmDspSysAllocInst(h,"Compressor",  NULL,  8, cmpBypassFl, cmpThreshDb, cmpRatio_num, cmpAtkMs, cmpRlsMs, cmpMakeup, cmpWndMs, cmpWndMaxMs ); 
480
+  }
475 481
 
476 482
   cmDspInst_t* tlp  = cmDspSysAllocInst(h,"TimeLine",    "tl",  2, r.tlFn, r.tlPrefixPath );
477 483
   cmDspInst_t* scp  = cmDspSysAllocInst(h,"Score",       "sc",  1, r.scFn );
@@ -519,8 +525,7 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
519 525
     mix1 = cmDspSysAllocInst(h,"AMix",        NULL,   3, 2, 1.0, 1.0 );
520 526
   }
521 527
 
522
-  /*
523
-  if( useCmpFl )
528
+  if( useInCompFl )
524 529
   {
525 530
     cmDspSysNewPage(h,"InComp");
526 531
 
@@ -566,7 +571,6 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
566 571
     cmDspSysInstallCb(h, ci1p,      "env", cmp1_mtr, "in", NULL );
567 572
 
568 573
   }
569
-  */
570 574
 
571 575
   cmDspInst_t* apf0 =  cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, apfBypassFl, apfModeSymId, apfF0hz+0, apfQ, apfGain  ); 
572 576
   cmDspInst_t* apf1 =  cmDspSysAllocInst(h,"BiQuadEq",NULL, 5, apfBypassFl, apfModeSymId, apfF0hz+100.0, apfQ, apfGain  ); 
@@ -636,6 +640,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
636 640
   cmDspInst_t* afop    = cmDspSysAllocInst(h,"AudioFileOut",NULL,    2, r.recordDir,2);
637 641
   cmDspInst_t* mi0p    = cmDspSysAllocInst(h,"AMeter","In 0",  0);
638 642
   cmDspInst_t* mi1p    = cmDspSysAllocInst(h,"AMeter","In 1",  0);
643
+  cmDspInst_t* mi2p    = cmDspSysAllocInst(h,"AMeter","In 2",  0);
644
+  cmDspInst_t* mi3p    = cmDspSysAllocInst(h,"AMeter","In 3",  0);
639 645
 
640 646
 
641 647
   //--------------- Preset controls
@@ -752,6 +758,11 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
752 758
   // Audio connections
753 759
   cmDspSysConnectAudio(h, php,  "out",   wtp,  "phs" );     // phs -> wt
754 760
 
761
+  cmDspSysConnectAudio( h, ai0p, "out", mi0p, "in");
762
+  cmDspSysConnectAudio( h, ai1p, "out", mi1p, "in");
763
+  cmDspSysConnectAudio( h, ai2p, "out", mi2p, "in");
764
+  cmDspSysConnectAudio( h, ai3p, "out", mi3p, "in");
765
+
755 766
   if( useInputEqFl )
756 767
   {
757 768
     cmDspSysConnectAudio(h, ai0p,    "out", eqLpf_0, "in" );     // ain->eq
@@ -796,14 +807,24 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
796 807
     cmDspSysConnectAudio(h, au0Sw,  "a-out", rpp,   "in-0");    // sw  -> rcdply
797 808
     cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr0,"in"  );    // sw  -> kr
798 809
     //cmDspSysConnectAudio(h, au0Sw,  "a-out", c0.kr1,"in"  );    // sw  -> kr
799
-    cmDspSysConnectAudio(h, au0Sw,  "a-out",  mi0p,  "in" );    // sw  -> meter  
810
+    //cmDspSysConnectAudio(h, au0Sw,  "a-out",  mi0p,  "in" );    // sw  -> meter  
800 811
   }
801 812
   else
802 813
   {
803 814
     cmDspSysConnectAudio(h, mx0p,  "out", rpp,   "in-0");    // sw  -> rcdply
804
-    cmDspSysConnectAudio(h, mx0p,   "out",   c0.kr0, "in" ); // ain -> sw
805
-    //cmDspSysConnectAudio(h, mx0p,   "out",   c0.kr1, "in" ); // ain -> sw
806
-    cmDspSysConnectAudio(h, mx0p,   "out",   mi0p,  "in" );     
815
+
816
+
817
+    if( useInCompFl )
818
+    {
819
+      cmDspSysConnectAudio(h, mx0p,   "out",   ci0p,   "in" ); // ain -> in compress
820
+      cmDspSysConnectAudio(h, ci0p,   "out",   c0.kr0, "in" );
821
+    }
822
+    else
823
+    {
824
+      cmDspSysConnectAudio(h, mx0p,   "out",   c0.kr0, "in" ); // ain -> sw
825
+    }
826
+
827
+    //cmDspSysConnectAudio(h, mx0p,   "out",   mi0p,  "in" );     
807 828
   }
808 829
 
809 830
   if( fragFl )
@@ -837,14 +858,23 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
837 858
       cmDspSysConnectAudio(h, au1Sw,  "a-out", rpp,   "in-1");    // sw  -> rcdply
838 859
       cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr0,"in"  );    // sw  -> kr
839 860
       //cmDspSysConnectAudio(h, au1Sw,  "a-out", c1.kr1,"in"  );    // sw  -> kr
840
-      cmDspSysConnectAudio(h, au1Sw,  "a-out",  mi1p,  "in" );    // sw  -> meter 
861
+      //cmDspSysConnectAudio(h, au1Sw,  "a-out",  mi1p,  "in" );    // sw  -> meter 
841 862
     }
842 863
     else
843 864
     {
844 865
       cmDspSysConnectAudio(h, mx1p,  "out", rpp,   "in-1");    // sw  -> rcdply
845
-      cmDspSysConnectAudio(h, mx1p,   "out",   c1.kr0, "in" ); // ain -> sw
846
-      //cmDspSysConnectAudio(h, mx1p,   "out",   c1.kr1, "in" ); // ain -> sw
847
-      cmDspSysConnectAudio(h, mx1p,   "out",   mi1p,  "in" );
866
+
867
+      if( useInCompFl )
868
+      {
869
+        cmDspSysConnectAudio(h, mx1p,   "out",   ci1p,   "in" ); // ain -> in compress
870
+        cmDspSysConnectAudio(h, ci1p,   "out",   c1.kr0, "in" );
871
+      }
872
+      else
873
+      {
874
+        cmDspSysConnectAudio(h, mx1p,   "out",   c1.kr0, "in" ); // ain -> sw
875
+      }
876
+
877
+      //cmDspSysConnectAudio(h, mx1p,   "out",   mi1p,  "in" );
848 878
     }
849 879
 
850 880
     if( fragFl )

Loading…
Cancel
Save