From 32e2e4d41d8926b684329b508c576b640c547959 Mon Sep 17 00:00:00 2001 From: Chris Johnson Date: Sun, 19 Apr 2020 20:15:15 -0400 Subject: Tape Redux Modifications to allow for a Bump control that enables level setting on the head bump --- .../Tape/Tape.xcodeproj/christopherjohnson.pbxuser | 44 ++++++++++++---------- .../christopherjohnson.perspectivev3 | 21 +++++------ plugins/MacVST/Tape/source/Tape.cpp | 8 ++++ plugins/MacVST/Tape/source/Tape.h | 4 +- plugins/MacVST/Tape/source/TapeProc.cpp | 10 +++-- 5 files changed, 52 insertions(+), 35 deletions(-) (limited to 'plugins/MacVST') diff --git a/plugins/MacVST/Tape/Tape.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/Tape/Tape.xcodeproj/christopherjohnson.pbxuser index e624c93..635e3be 100755 --- a/plugins/MacVST/Tape/Tape.xcodeproj/christopherjohnson.pbxuser +++ b/plugins/MacVST/Tape/Tape.xcodeproj/christopherjohnson.pbxuser @@ -49,14 +49,14 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 602110889; - PBXWorkspaceStateSaveDate = 602110889; + PBXPerProjectTemplateStateSaveDate = 608502034; + PBXWorkspaceStateSaveDate = 608502034; }; perUserProjectItems = { 8B043CDA23DCE7AD00DF857C /* PBXTextBookmark */ = 8B043CDA23DCE7AD00DF857C /* PBXTextBookmark */; 8B043D1923DCFF6200DF857C /* PBXTextBookmark */ = 8B043D1923DCFF6200DF857C /* PBXTextBookmark */; + 8B7A75F32445042300014B55 /* PBXTextBookmark */ = 8B7A75F32445042300014B55 /* PBXTextBookmark */; 8BA0D9C023E37DB300721922 /* PBXTextBookmark */ = 8BA0D9C023E37DB300721922 /* PBXTextBookmark */; - 8BA0D9C123E37DB300721922 /* PBXBookmark */ = 8BA0D9C123E37DB300721922 /* PBXBookmark */; 8BA0D9C223E37DB300721922 /* PBXTextBookmark */ = 8BA0D9C223E37DB300721922 /* PBXTextBookmark */; }; sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */; @@ -65,17 +65,17 @@ }; 2407DEB6089929BA00EB68BF /* Tape.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {848, 1742}}"; - sepNavSelRange = "{515, 0}"; - sepNavVisRange = "{2798, 1803}"; + sepNavIntBoundsRect = "{{0, 0}, {848, 1833}}"; + sepNavSelRange = "{4328, 0}"; + sepNavVisRange = "{2979, 1986}"; sepNavWindowFrame = "{{12, 57}, {895, 821}}"; }; }; 245463B80991757100464AD3 /* Tape.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {866, 1261}}"; - sepNavSelRange = "{517, 0}"; - sepNavVisRange = "{427, 180}"; + sepNavIntBoundsRect = "{{0, 0}, {866, 1144}}"; + sepNavSelRange = "{2663, 0}"; + sepNavVisRange = "{672, 2237}"; sepNavWindowFrame = "{{20, 57}, {895, 821}}"; }; }; @@ -89,9 +89,9 @@ }; 24D8286F09A914000093AEF8 /* TapeProc.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {740, 7371}}"; - sepNavSelRange = "{23627, 0}"; - sepNavVisRange = "{23438, 235}"; + sepNavIntBoundsRect = "{{0, 0}, {740, 7579}}"; + sepNavSelRange = "{23699, 0}"; + sepNavVisRange = "{23459, 168}"; sepNavWindowFrame = "{{545, 57}, {895, 821}}"; }; }; @@ -114,7 +114,7 @@ fRef = 2407DEB6089929BA00EB68BF /* Tape.cpp */; name = "Tape.cpp: 21"; rLen = 0; - rLoc = 857; + rLoc = 867; rType = 0; vrLen = 331; vrLoc = 436; @@ -124,11 +124,21 @@ fRef = 245463B80991757100464AD3 /* Tape.h */; name = "Tape.h: 26"; rLen = 0; - rLoc = 517; + rLoc = 531; rType = 0; vrLen = 180; vrLoc = 427; }; + 8B7A75F32445042300014B55 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24D8286F09A914000093AEF8 /* TapeProc.cpp */; + name = "TapeProc.cpp: 555"; + rLen = 0; + rLoc = 23699; + rType = 0; + vrLen = 168; + vrLoc = 23459; + }; 8BA0D9C023E37DB300721922 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 24A2FFDB0F90D1DD003BB5A7 /* audioeffectx.cpp */; @@ -139,16 +149,12 @@ vrLen = 280; vrLoc = 10459; }; - 8BA0D9C123E37DB300721922 /* PBXBookmark */ = { - isa = PBXBookmark; - fRef = 24D8286F09A914000093AEF8 /* TapeProc.cpp */; - }; 8BA0D9C223E37DB300721922 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 24D8286F09A914000093AEF8 /* TapeProc.cpp */; name = "TapeProc.cpp: 553"; rLen = 0; - rLoc = 23627; + rLoc = 23699; rType = 0; vrLen = 235; vrLoc = 23438; diff --git a/plugins/MacVST/Tape/Tape.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/Tape/Tape.xcodeproj/christopherjohnson.perspectivev3 index ad3683d..1278b55 100755 --- a/plugins/MacVST/Tape/Tape.xcodeproj/christopherjohnson.perspectivev3 +++ b/plugins/MacVST/Tape/Tape.xcodeproj/christopherjohnson.perspectivev3 @@ -351,13 +351,13 @@ _historyCapacity 0 bookmark - 8BA0D9C223E37DB300721922 + 8B7A75F32445042300014B55 history 8B043CDA23DCE7AD00DF857C 8B043D1923DCFF6200DF857C 8BA0D9C023E37DB300721922 - 8BA0D9C123E37DB300721922 + 8BA0D9C223E37DB300721922 SplitCount @@ -371,18 +371,18 @@ GeometryConfiguration Frame - {{0, 0}, {603, 102}} + {{0, 0}, {603, 86}} RubberWindowFrame 530 344 810 487 0 0 1440 878 Module PBXNavigatorGroup Proportion - 102pt + 86pt Proportion - 339pt + 355pt Tabs @@ -396,7 +396,7 @@ GeometryConfiguration Frame - {{10, 27}, {603, 312}} + {{10, 27}, {603, 328}} RubberWindowFrame 530 344 810 487 0 0 1440 878 @@ -480,11 +480,11 @@ TableOfContents - 8BA0D9C323E37DB300721922 + 8B7A75F42445042300014B55 1CA23ED40692098700951B8B - 8BA0D9C423E37DB300721922 + 8B7A75F52445042300014B55 8B0237581D42B1C400E1E8C8 - 8BA0D9C523E37DB300721922 + 8B7A75F62445042300014B55 1CA23EDF0692099D00951B8B 1CA23EE00692099D00951B8B 1CA23EE10692099D00951B8B @@ -637,7 +637,7 @@ StatusbarIsVisible TimeStamp - 602111411.395051 + 608502819.69231403 ToolbarConfigUserDefaultsMinorVersion 2 ToolbarDisplayMode @@ -654,7 +654,6 @@ 5 WindowOrderList - 8BA0D9C623E37DB300721922 /Users/christopherjohnson/Desktop/Plugins/MacVST/Tape/Tape.xcodeproj WindowString diff --git a/plugins/MacVST/Tape/source/Tape.cpp b/plugins/MacVST/Tape/source/Tape.cpp index eb3712c..a34d8b7 100755 --- a/plugins/MacVST/Tape/source/Tape.cpp +++ b/plugins/MacVST/Tape/source/Tape.cpp @@ -13,6 +13,7 @@ Tape::Tape(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; + B = 0.5; iirMidRollerAL = 0.0; iirMidRollerBL = 0.0; iirHeadBumpAL = 0.0; @@ -61,6 +62,7 @@ VstInt32 Tape::getChunk (void** data, bool isPreset) { float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); chunkData[0] = A; + chunkData[1] = B; /* Note: The way this is set up, it will break if you manage to save settings on an Intel machine and load them on a PPC Mac. However, it's fine if you stick to the machine you started with. */ @@ -73,6 +75,7 @@ VstInt32 Tape::setChunk (void* data, VstInt32 byteSize, bool isPreset) { float *chunkData = (float *)data; A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); /* We're ignoring byteSize as we found it to be a filthy liar */ /* calculate any other fields you need here - you could copy in @@ -83,6 +86,7 @@ VstInt32 Tape::setChunk (void* data, VstInt32 byteSize, bool isPreset) void Tape::setParameter(VstInt32 index, float value) { switch (index) { case kParamA: A = value; break; + case kParamB: B = value; break; default: throw; // unknown parameter, shouldn't happen! } } @@ -90,6 +94,7 @@ void Tape::setParameter(VstInt32 index, float value) { float Tape::getParameter(VstInt32 index) { switch (index) { case kParamA: return A; break; + case kParamB: return B; break; default: break; // unknown parameter, shouldn't happen! } return 0.0; //we only need to update the relevant name, this is simple to manage } @@ -97,6 +102,7 @@ float Tape::getParameter(VstInt32 index) { void Tape::getParameterName(VstInt32 index, char *text) { switch (index) { case kParamA: vst_strncpy (text, "Slam", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Bump", kVstMaxParamStrLen); break; default: break; // unknown parameter, shouldn't happen! } //this is our labels for displaying in the VST host } @@ -104,6 +110,7 @@ void Tape::getParameterName(VstInt32 index, char *text) { void Tape::getParameterDisplay(VstInt32 index, char *text) { switch (index) { case kParamA: float2string ((A-0.5)*24.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; default: break; // unknown parameter, shouldn't happen! } //this displays the values and handles 'popups' where it's discrete choices } @@ -111,6 +118,7 @@ void Tape::getParameterDisplay(VstInt32 index, char *text) { void Tape::getParameterLabel(VstInt32 index, char *text) { switch (index) { case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; default: break; // unknown parameter, shouldn't happen! } } diff --git a/plugins/MacVST/Tape/source/Tape.h b/plugins/MacVST/Tape/source/Tape.h index 6c1dc00..932247b 100755 --- a/plugins/MacVST/Tape/source/Tape.h +++ b/plugins/MacVST/Tape/source/Tape.h @@ -17,7 +17,8 @@ enum { kParamA = 0, - kNumParameters = 1 + kParamB = 1, + kNumParameters = 2 }; // const int kNumPrograms = 0; @@ -80,6 +81,7 @@ private: //default stuff float A; + float B; }; #endif diff --git a/plugins/MacVST/Tape/source/TapeProc.cpp b/plugins/MacVST/Tape/source/TapeProc.cpp index e29f71a..d1ecb27 100755 --- a/plugins/MacVST/Tape/source/TapeProc.cpp +++ b/plugins/MacVST/Tape/source/TapeProc.cpp @@ -19,6 +19,7 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram overallscale *= getSampleRate(); double inputgain = pow(10.0,((A-0.5)*24.0)/20.0); + double bumpgain = B*0.1; double HeadBumpFreq = 0.12/overallscale; double softness = 0.618033988749894848204586; double RollAmount = (1.0 - softness) / overallscale; @@ -205,8 +206,8 @@ void Tape::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram inputSampleL += groundSampleL; //apply UnBox processing inputSampleR += groundSampleR; //apply UnBox processing - inputSampleL += ((iirHeadBumpAL + iirHeadBumpBL) * 0.1);//and head bump - inputSampleR += ((iirHeadBumpAR + iirHeadBumpBR) * 0.1);//and head bump + inputSampleL += ((iirHeadBumpAL + iirHeadBumpBL) * bumpgain);//and head bump + inputSampleR += ((iirHeadBumpAR + iirHeadBumpBR) * bumpgain);//and head bump if (lastSampleL >= 0.99) { @@ -297,6 +298,7 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa overallscale *= getSampleRate(); double inputgain = pow(10.0,((A-0.5)*24.0)/20.0); + double bumpgain = B*0.1; double HeadBumpFreq = 0.12/overallscale; double softness = 0.618033988749894848204586; double RollAmount = (1.0 - softness) / overallscale; @@ -489,8 +491,8 @@ void Tape::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa inputSampleL += groundSampleL; //apply UnBox processing inputSampleR += groundSampleR; //apply UnBox processing - inputSampleL += ((iirHeadBumpAL + iirHeadBumpBL) * 0.1);//and head bump - inputSampleR += ((iirHeadBumpAR + iirHeadBumpBR) * 0.1);//and head bump + inputSampleL += ((iirHeadBumpAL + iirHeadBumpBL) * bumpgain);//and head bump + inputSampleR += ((iirHeadBumpAR + iirHeadBumpBR) * bumpgain);//and head bump if (lastSampleL >= 0.99) { -- cgit v1.2.3