From 03d026999a7e96d27f5abbd32554973fa81a7cf2 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 23 May 2013 11:06:31 -0700 Subject: [PATCH 1/2] cmDspClass.c: Fixed #ifdef typo's --- dsp/cmDspClass.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dsp/cmDspClass.c b/dsp/cmDspClass.c index b9c84d3..0b35782 100644 --- a/dsp/cmDspClass.c +++ b/dsp/cmDspClass.c @@ -250,7 +250,7 @@ void* cmDspInstAllocate( return p; } -#ifdef OS_X +#ifdef OS_OSX va_list _cmDspParseArgV( cmDspVarArg_t* a, va_list vl ) #else void _cmDspParseArgV( cmDspVarArg_t* a, va_list vl ) @@ -262,7 +262,7 @@ void _cmDspParseArgV( cmDspVarArg_t* a, va_list vl ) a->cn = va_arg(vl,unsigned); a->flags = va_arg(vl,unsigned); a->doc = va_arg(vl,const char*); -#ifdef OS_X +#ifdef OS_OSX return vl; #endif } @@ -285,7 +285,7 @@ void* cmDspInstAllocateV(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned instB argCnt += repeatCnt; -#ifdef OS_X +#ifdef OS_OSX vl1 = #endif _cmDspParseArgV(&a,vl1); @@ -297,7 +297,7 @@ void* cmDspInstAllocateV(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned instB { cmDspVarArg_t a; -#ifdef OS_X +#ifdef OS_OSX vl2 = #endif _cmDspParseArgV(&a,vl2); From d4db5427c5e0af11c97c10421654373399dd3679 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 23 May 2013 11:07:34 -0700 Subject: [PATCH 2/2] cmDspPgmKr.c:Added compressor preset. --- dsp/cmDspPgmKr.c | 50 +++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/dsp/cmDspPgmKr.c b/dsp/cmDspPgmKr.c index 28c0fd7..f9ccd28 100644 --- a/dsp/cmDspPgmKr.c +++ b/dsp/cmDspPgmKr.c @@ -93,8 +93,8 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr ) if( krLoadRsrc(h,&err,&r) != kOkDspRC ) return rc; - unsigned preGrpSymId = cmDspSysPresetRegisterGroup(h,"TimeLine"); - + unsigned preGrpSymId = cmDspSysPresetRegisterGroup(h,"TimeLine"); + unsigned compPreGrpSymId = cmDspSysPresetRegisterGroup(h,"Compressor"); cmDspInst_t* tlp = cmDspSysAllocInst(h,"TimeLine", "tl", 2, r.tlFn, r.audPath ); cmDspInst_t* scp = cmDspSysAllocInst(h,"Score", "sc", 1, r.scFn ); @@ -421,14 +421,15 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr ) cmDspSysNewPage(h,"Compressor"); - cmDspInst_t* cmp0_byp = cmDspSysAllocCheck( h, "Bypass0", 1.0 ); - cmDspInst_t* cmp0_igain = cmDspSysAllocScalar( h, "In Gain0", 0.0, 10.0, 0.1, cmpInGain); - cmDspInst_t* cmp0_thr = cmDspSysAllocScalar( h, "ThreshDb0", -100.0, 0.0, 0.1, cmpThreshDb); - cmDspInst_t* cmp0_rat = cmDspSysAllocScalar( h, "Ratio0", 0.1, 100, 0.1, cmpRatio_num); - cmDspInst_t* cmp0_atk = cmDspSysAllocScalar( h, "Atk Ms0", 0.0, 1000.0, 0.1, cmpAtkMs); - cmDspInst_t* cmp0_rls = cmDspSysAllocScalar( h, "Rls Ms0", 0.0, 1000.0, 0.1, cmpRlsMs); - cmDspInst_t* cmp0_mkup = cmDspSysAllocScalar( h, "Makeup0", 0.0, 10.0, 0.01, cmpMakeup); - cmDspInst_t* cmp0_wnd = cmDspSysAllocScalar( h, "Wnd Ms0", 1.0, cmpWndMaxMs, 1.0, cmpWndMs ); + + cmDspInst_t* cmp0_byp = cmDspSysAllocCheckP( h, compPreGrpSymId, NULL, "Bypass0", 1.0 ); + cmDspInst_t* cmp0_igain = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "In Gain0", 0.0, 10.0, 0.1, cmpInGain ); + cmDspInst_t* cmp0_thr = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "ThreshDb0", -100.0, 0.0, 0.1, cmpThreshDb); + cmDspInst_t* cmp0_rat = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Ratio0", 0.1, 100, 0.1, cmpRatio_num); + cmDspInst_t* cmp0_atk = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Atk Ms0", 0.0, 1000.0, 0.1, cmpAtkMs); + cmDspInst_t* cmp0_rls = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Rls Ms0", 0.0, 1000.0, 0.1, cmpRlsMs); + cmDspInst_t* cmp0_mkup = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Makeup0", 0.0, 10.0, 0.01, cmpMakeup); + cmDspInst_t* cmp0_wnd = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Wnd Ms0", 1.0, cmpWndMaxMs, 1.0, cmpWndMs ); cmDspInst_t* cmp0_mtr = cmDspSysAllocInst(h,"Meter","Env0", 3, 0.0, 0.0, 1.0); cmDspSysInstallCb(h, cmp0_byp, "out", cmp0, "bypass", NULL ); @@ -442,14 +443,14 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr ) cmDspSysInstallCb(h, cmp0, "env", cmp0_mtr, "in", NULL ); cmDspSysNewColumn(h,0); - cmDspInst_t* cmp1_byp = cmDspSysAllocCheck( h, "Bypass1", 1.0 ); - cmDspInst_t* cmp1_igain = cmDspSysAllocScalar( h, "In Gain1", 0.0, 10.0, 0.1, cmpInGain); - cmDspInst_t* cmp1_thr = cmDspSysAllocScalar( h, "ThreshDb1", -100.0, 0.0, 0.1, cmpThreshDb); - cmDspInst_t* cmp1_rat = cmDspSysAllocScalar( h, "Ratio1", 0.1, 100, 0.1, cmpRatio_num); - cmDspInst_t* cmp1_atk = cmDspSysAllocScalar( h, "Atk Ms1", 0.0, 1000.0, 0.1, cmpAtkMs); - cmDspInst_t* cmp1_rls = cmDspSysAllocScalar( h, "Rls Ms1", 0.0, 1000.0, 0.1, cmpRlsMs); - cmDspInst_t* cmp1_mkup = cmDspSysAllocScalar( h, "Makeup1", 0.0, 10.0, 0.01, cmpMakeup); - cmDspInst_t* cmp1_wnd = cmDspSysAllocScalar( h, "Wnd Ms1", 1.0, cmpWndMaxMs, 1.0, cmpWndMs ); + cmDspInst_t* cmp1_byp = cmDspSysAllocCheckP( h, compPreGrpSymId, NULL, "Bypass1", 1.0 ); + cmDspInst_t* cmp1_igain = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "In Gain1", 0.0, 10.0, 0.1, cmpInGain); + cmDspInst_t* cmp1_thr = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "ThreshDb1", -100.0, 0.0, 0.1, cmpThreshDb); + cmDspInst_t* cmp1_rat = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Ratio1", 0.1, 100, 0.1, cmpRatio_num); + cmDspInst_t* cmp1_atk = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Atk Ms1", 0.0, 1000.0, 0.1, cmpAtkMs); + cmDspInst_t* cmp1_rls = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Rls Ms1", 0.0, 1000.0, 0.1, cmpRlsMs); + cmDspInst_t* cmp1_mkup = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Makeup1", 0.0, 10.0, 0.01, cmpMakeup); + cmDspInst_t* cmp1_wnd = cmDspSysAllocScalarP( h, compPreGrpSymId, NULL, "Wnd Ms1", 1.0, cmpWndMaxMs, 1.0, cmpWndMs ); cmDspInst_t* cmp1_mtr = cmDspSysAllocInst(h,"Meter","Env1", 3, 0.0, 0.0, 1.0); cmDspSysInstallCb(h, cmp1_byp, "out", cmp1, "bypass", NULL ); @@ -462,6 +463,19 @@ cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr ) cmDspSysInstallCb(h, cmp1_wnd, "val", cmp1, "wnd", NULL ); cmDspSysInstallCb(h, cmp1, "env", cmp1_mtr, "in", NULL ); + //--------------- Compressor Preset controls + cmDspSysNewColumn(h,0); + cmDspInst_t* comp_preset = cmDspSysAllocInst( h, "Preset", NULL, 1, compPreGrpSymId ); + cmDspInst_t* comp_presetLbl = cmDspSysAllocInst( h, "Text", "Comp_Preset", 1, "" ); + cmDspInst_t* comp_storeBtn = cmDspSysAllocButton( h, "comp_store", 0); + cmDspInst_t* comp_recallBtn = cmDspSysAllocButton( h, "comp_recall", 0); + cmDspInst_t* comp_pts = cmDspSysAllocInst( h, "PortToSym", NULL, 2, "store", "recall"); + + cmDspSysInstallCb( h, comp_presetLbl, "val", comp_preset, "label",NULL); + cmDspSysInstallCb( h, comp_storeBtn, "out", comp_pts, "store", NULL ); + cmDspSysInstallCb( h, comp_recallBtn, "out", comp_pts, "recall", NULL ); + cmDspSysInstallCb( h, comp_pts, "store", comp_preset, "cmd", NULL ); + cmDspSysInstallCb( h, comp_pts, "recall", comp_preset, "cmd", NULL ); return rc; }