aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xplugins/LinuxVST/src/Coils/CoilsProc.cpp18
-rwxr-xr-xplugins/MacAU/Coils/Coils.cpp5
-rwxr-xr-xplugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.pbxuser30
-rwxr-xr-xplugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.perspectivev326
-rwxr-xr-xplugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.pbxuser43
-rwxr-xr-xplugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.perspectivev337
-rwxr-xr-xplugins/MacVST/Coils/source/CoilsProc.cpp18
-rwxr-xr-xplugins/WinVST/Coils/CoilsProc.cpp18
8 files changed, 119 insertions, 76 deletions
diff --git a/plugins/LinuxVST/src/Coils/CoilsProc.cpp b/plugins/LinuxVST/src/Coils/CoilsProc.cpp
index cc0456a..409fd66 100755
--- a/plugins/LinuxVST/src/Coils/CoilsProc.cpp
+++ b/plugins/LinuxVST/src/Coils/CoilsProc.cpp
@@ -20,7 +20,8 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
if (boost < 0.001) boost = 0.001; //there's a divide, we can't have this be zero
figureL[0] = figureR[0] = 600.0/getSampleRate(); //fixed frequency, 600hz
figureL[1] = figureR[1] = 0.023; //resonance
- double offset = B;
+ double offset = (B*2.0)-1.0;
+ double sinOffset = sin(offset); //we can cache this, it's expensive
double wet = C;
double K = tan(M_PI * figureR[0]);
double norm = 1.0 / (1.0 + K / figureR[1] + K * K);
@@ -43,7 +44,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
//figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]);
//inputSample = tempSample + sin(drySample-tempSample);
//or
- //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-offset)*boost);
+ //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost);
//
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Purest case, and since
@@ -53,7 +54,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
long double tempSample = (inputSampleL * figureL[2]) + figureL[7];
figureL[7] = -(tempSample * figureL[5]) + figureL[8];
figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]);
- inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
@@ -61,7 +62,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
tempSample = (inputSampleR * figureR[2]) + figureR[7];
figureR[7] = -(tempSample * figureR[5]) + figureR[8];
figureR[8] = (inputSampleR * figureR[4]) - (tempSample * figureR[6]);
- inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
@@ -103,7 +104,8 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
if (boost < 0.001) boost = 0.001; //there's a divide, we can't have this be zero
figureL[0] = figureR[0] = 600.0/getSampleRate(); //fixed frequency, 600hz
figureL[1] = figureR[1] = 0.023; //resonance
- double offset = B;
+ double offset = (B*2.0)-1.0;
+ double sinOffset = sin(offset); //we can cache this, it's expensive
double wet = C;
double K = tan(M_PI * figureR[0]);
double norm = 1.0 / (1.0 + K / figureR[1] + K * K);
@@ -126,7 +128,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
//figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]);
//inputSample = tempSample + sin(drySample-tempSample);
//or
- //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-offset)*boost);
+ //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost);
//
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Purest case, and since
@@ -136,7 +138,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
long double tempSample = (inputSampleL * figureL[2]) + figureL[7];
figureL[7] = -(tempSample * figureL[5]) + figureL[8];
figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]);
- inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
@@ -144,7 +146,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
tempSample = (inputSampleR * figureR[2]) + figureR[7];
figureR[7] = -(tempSample * figureR[5]) + figureR[8];
figureR[8] = (inputSampleR * figureR[4]) - (tempSample * figureR[6]);
- inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
diff --git a/plugins/MacAU/Coils/Coils.cpp b/plugins/MacAU/Coils/Coils.cpp
index e8e222b..75cb6db 100755
--- a/plugins/MacAU/Coils/Coils.cpp
+++ b/plugins/MacAU/Coils/Coils.cpp
@@ -198,6 +198,7 @@ void Coils::CoilsKernel::Process( const Float32 *inSourceP,
figure[0] = 600.0/GetSampleRate(); //fixed frequency, 600hz
figure[1] = 0.023; //resonance
Float64 offset = GetParameter( kParam_Two );
+ Float64 sinOffset = sin(offset); //we can cache this, it's expensive
Float64 wet = GetParameter( kParam_Three );
@@ -218,7 +219,7 @@ void Coils::CoilsKernel::Process( const Float32 *inSourceP,
//figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]);
//inputSample = tempSample + sin(drySample-tempSample);
//or
- //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-offset)*boost);
+ //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost);
//
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Purest case, and since
@@ -227,7 +228,7 @@ void Coils::CoilsKernel::Process( const Float32 *inSourceP,
long double tempSample = (inputSample * figure[2]) + figure[7];
figure[7] = -(tempSample * figure[5]) + figure[8];
figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]);
- inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-offset)*boost);
+ inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
diff --git a/plugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.pbxuser b/plugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.pbxuser
index ad352c5..22eaa41 100755
--- a/plugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.pbxuser
@@ -49,12 +49,12 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 598121407;
- PBXWorkspaceStateSaveDate = 598121407;
+ PBXPerProjectTemplateStateSaveDate = 598128541;
+ PBXWorkspaceStateSaveDate = 598128541;
};
perUserProjectItems = {
- 8BE4464723A6992B00A26556 /* PlistBookmark */ = 8BE4464723A6992B00A26556 /* PlistBookmark */;
- 8BE4469323A6A0D400A26556 /* PlistBookmark */ = 8BE4469323A6A0D400A26556 /* PlistBookmark */;
+ 8BE446D723A6B15500A26556 /* PlistBookmark */ = 8BE446D723A6B15500A26556 /* PlistBookmark */;
+ 8BE4471123A6B86300A26556 /* PlistBookmark */ = 8BE4471123A6B86300A26556 /* PlistBookmark */;
};
sourceControlManager = 8BD3CCB8148830B20062E48C /* Source Control */;
userBuildSettings = {
@@ -62,10 +62,10 @@
};
8BA05A660720730100365D66 /* Coils.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {770, 3367}}";
- sepNavSelRange = "{10735, 0}";
- sepNavVisRange = "{9083, 2157}";
- sepNavWindowFrame = "{{648, 60}, {817, 818}}";
+ sepNavIntBoundsRect = "{{0, 0}, {770, 3419}}";
+ sepNavSelRange = "{9161, 70}";
+ sepNavVisRange = "{9022, 2293}";
+ sepNavWindowFrame = "{{623, 60}, {817, 818}}";
};
};
8BA05A690720730100365D66 /* CoilsVersion.h */ = {
@@ -98,7 +98,7 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
- 8BE4464723A6992B00A26556 /* PlistBookmark */ = {
+ 8BE446D723A6B15500A26556 /* PlistBookmark */ = {
isa = PlistBookmark;
fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */;
fallbackIsa = PBXBookmark;
@@ -106,11 +106,11 @@
kPath = (
CFBundleName,
);
- name = /Users/christopherjohnson/Desktop/Coils/Info.plist;
- rLen = 0;
- rLoc = 9223372036854775808;
+ name = /Users/christopherjohnson/Desktop/Plugins/MacAU/Coils/Info.plist;
+ rLen = 26;
+ rLoc = 0;
};
- 8BE4469323A6A0D400A26556 /* PlistBookmark */ = {
+ 8BE4471123A6B86300A26556 /* PlistBookmark */ = {
isa = PlistBookmark;
fRef = 8D01CCD10486CAD60068D4B7 /* Info.plist */;
fallbackIsa = PBXBookmark;
@@ -119,8 +119,8 @@
CFBundleName,
);
name = /Users/christopherjohnson/Desktop/Plugins/MacAU/Coils/Info.plist;
- rLen = 0;
- rLoc = 9223372036854775807;
+ rLen = 26;
+ rLoc = 0;
};
8D01CCC60486CAD60068D4B7 /* Coils */ = {
activeExec = 0;
diff --git a/plugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.perspectivev3
index 0df6891..c6c3159 100755
--- a/plugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacAU/Coils/Coils.xcodeproj/christopherjohnson.perspectivev3
@@ -256,8 +256,6 @@
<key>Layout</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -354,10 +352,10 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>8BE4469323A6A0D400A26556</string>
+ <string>8BE4471123A6B86300A26556</string>
<key>history</key>
<array>
- <string>8BE4464723A6992B00A26556</string>
+ <string>8BE446D723A6B15500A26556</string>
</array>
</dict>
<key>SplitCount</key>
@@ -371,18 +369,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {531, 229}}</string>
+ <string>{{0, 0}, {531, 202}}</string>
<key>RubberWindowFrame</key>
<string>566 197 841 654 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>229pt</string>
+ <string>202pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>379pt</string>
+ <string>406pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -396,7 +394,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 352}}</string>
+ <string>{{10, 27}, {531, 379}}</string>
<key>RubberWindowFrame</key>
<string>566 197 841 654 0 0 1440 878 </string>
</dict>
@@ -452,7 +450,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {531, 339}}</string>
+ <string>{{10, 27}, {531, 365}}</string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -480,11 +478,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BE4469423A6A0D400A26556</string>
+ <string>8BE4471223A6B86300A26556</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BE4469523A6A0D400A26556</string>
+ <string>8BE4471323A6B86300A26556</string>
<string>8BD7274A1D46E5A5000176F0</string>
- <string>8BE4469623A6A0D400A26556</string>
+ <string>8BE4471423A6B86300A26556</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -657,7 +655,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>598122708.61674905</real>
+ <real>598128739.18132901</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -674,7 +672,7 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8BE4469723A6A0D400A26556</string>
+ <string>8BE446DB23A6B15500A26556</string>
<string>/Users/christopherjohnson/Desktop/Plugins/MacAU/Coils/Coils.xcodeproj</string>
</array>
<key>WindowString</key>
diff --git a/plugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.pbxuser b/plugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.pbxuser
index 2da593f..0bfa035 100755
--- a/plugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.pbxuser
+++ b/plugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.pbxuser
@@ -49,8 +49,13 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 598120984;
- PBXWorkspaceStateSaveDate = 598120984;
+ PBXPerProjectTemplateStateSaveDate = 598128645;
+ PBXWorkspaceStateSaveDate = 598128645;
+ };
+ perUserProjectItems = {
+ 8BE4470623A6B85C00A26556 /* PBXTextBookmark */ = 8BE4470623A6B85C00A26556 /* PBXTextBookmark */;
+ 8BE4470723A6B85C00A26556 /* PBXBookmark */ = 8BE4470723A6B85C00A26556 /* PBXBookmark */;
+ 8BE4470823A6B85C00A26556 /* PBXTextBookmark */ = 8BE4470823A6B85C00A26556 /* PBXTextBookmark */;
};
sourceControlManager = 8B02375E1D42B1C400E1E8C8 /* Source Control */;
userBuildSettings = {
@@ -58,9 +63,9 @@
};
2407DEB6089929BA00EB68BF /* Coils.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {848, 1768}}";
+ sepNavIntBoundsRect = "{{0, 0}, {740, 1742}}";
sepNavSelRange = "{4376, 0}";
- sepNavVisRange = "{0, 2018}";
+ sepNavVisRange = "{1746, 272}";
sepNavWindowFrame = "{{12, 57}, {895, 821}}";
};
};
@@ -82,9 +87,9 @@
};
24D8286F09A914000093AEF8 /* CoilsProc.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {848, 2223}}";
- sepNavSelRange = "{6893, 0}";
- sepNavVisRange = "{5037, 2417}";
+ sepNavIntBoundsRect = "{{0, 0}, {712, 2236}}";
+ sepNavSelRange = "{6662, 0}";
+ sepNavVisRange = "{6060, 445}";
sepNavWindowFrame = "{{49, 57}, {895, 821}}";
};
};
@@ -102,6 +107,30 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
+ 8BE4470623A6B85C00A26556 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 2407DEB6089929BA00EB68BF /* Coils.cpp */;
+ name = "Coils.cpp: 116";
+ rLen = 0;
+ rLoc = 4376;
+ rType = 0;
+ vrLen = 272;
+ vrLoc = 1746;
+ };
+ 8BE4470723A6B85C00A26556 /* PBXBookmark */ = {
+ isa = PBXBookmark;
+ fRef = 24D8286F09A914000093AEF8 /* CoilsProc.cpp */;
+ };
+ 8BE4470823A6B85C00A26556 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 24D8286F09A914000093AEF8 /* CoilsProc.cpp */;
+ name = "CoilsProc.cpp: 149";
+ rLen = 0;
+ rLoc = 6662;
+ rType = 0;
+ vrLen = 445;
+ vrLoc = 6060;
+ };
8D01CCC60486CAD60068D4B7 /* Coils */ = {
activeExec = 0;
};
diff --git a/plugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.perspectivev3 b/plugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.perspectivev3
index 31fb443..b9d72cc 100755
--- a/plugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.perspectivev3
+++ b/plugins/MacVST/Coils/Coils.xcodeproj/christopherjohnson.perspectivev3
@@ -339,7 +339,7 @@
<key>PBXProjectModuleGUID</key>
<string>8B0237581D42B1C400E1E8C8</string>
<key>PBXProjectModuleLabel</key>
- <string>Gain.h</string>
+ <string>CoilsProc.cpp</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -347,7 +347,16 @@
<key>PBXProjectModuleGUID</key>
<string>8B0237591D42B1C400E1E8C8</string>
<key>PBXProjectModuleLabel</key>
- <string>Gain.h</string>
+ <string>CoilsProc.cpp</string>
+ <key>_historyCapacity</key>
+ <integer>0</integer>
+ <key>bookmark</key>
+ <string>8BE4470823A6B85C00A26556</string>
+ <key>history</key>
+ <array>
+ <string>8BE4470623A6B85C00A26556</string>
+ <string>8BE4470723A6B85C00A26556</string>
+ </array>
</dict>
<key>SplitCount</key>
<string>1</string>
@@ -360,18 +369,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {603, 0}}</string>
+ <string>{{0, 0}, {603, 117}}</string>
<key>RubberWindowFrame</key>
<string>34 365 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>0pt</string>
+ <string>117pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>441pt</string>
+ <string>324pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -385,7 +394,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {603, 414}}</string>
+ <string>{{10, 27}, {603, 297}}</string>
+ <key>RubberWindowFrame</key>
+ <string>34 365 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -440,8 +451,6 @@
<dict>
<key>Frame</key>
<string>{{10, 27}, {603, 414}}</string>
- <key>RubberWindowFrame</key>
- <string>34 365 810 487 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -469,11 +478,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>8BE446A023A6A10800A26556</string>
+ <string>8BE4470923A6B85C00A26556</string>
<string>1CA23ED40692098700951B8B</string>
- <string>8BE446A123A6A10800A26556</string>
+ <string>8BE4470A23A6B85C00A26556</string>
<string>8B0237581D42B1C400E1E8C8</string>
- <string>8BE446A223A6A10800A26556</string>
+ <string>8BE4470B23A6B85C00A26556</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -626,7 +635,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>598122760.10607398</real>
+ <real>598128732.26977098</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -643,8 +652,8 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>8BE446A323A6A10800A26556</string>
- <string>/Users/christopherjohnson/Desktop/Coils/Coils.xcodeproj</string>
+ <string>8BE4470C23A6B85C00A26556</string>
+ <string>/Users/christopherjohnson/Desktop/Plugins/MacVST/Coils/Coils.xcodeproj</string>
</array>
<key>WindowString</key>
<string>34 365 810 487 0 0 1440 878 </string>
diff --git a/plugins/MacVST/Coils/source/CoilsProc.cpp b/plugins/MacVST/Coils/source/CoilsProc.cpp
index cc0456a..409fd66 100755
--- a/plugins/MacVST/Coils/source/CoilsProc.cpp
+++ b/plugins/MacVST/Coils/source/CoilsProc.cpp
@@ -20,7 +20,8 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
if (boost < 0.001) boost = 0.001; //there's a divide, we can't have this be zero
figureL[0] = figureR[0] = 600.0/getSampleRate(); //fixed frequency, 600hz
figureL[1] = figureR[1] = 0.023; //resonance
- double offset = B;
+ double offset = (B*2.0)-1.0;
+ double sinOffset = sin(offset); //we can cache this, it's expensive
double wet = C;
double K = tan(M_PI * figureR[0]);
double norm = 1.0 / (1.0 + K / figureR[1] + K * K);
@@ -43,7 +44,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
//figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]);
//inputSample = tempSample + sin(drySample-tempSample);
//or
- //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-offset)*boost);
+ //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost);
//
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Purest case, and since
@@ -53,7 +54,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
long double tempSample = (inputSampleL * figureL[2]) + figureL[7];
figureL[7] = -(tempSample * figureL[5]) + figureL[8];
figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]);
- inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
@@ -61,7 +62,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
tempSample = (inputSampleR * figureR[2]) + figureR[7];
figureR[7] = -(tempSample * figureR[5]) + figureR[8];
figureR[8] = (inputSampleR * figureR[4]) - (tempSample * figureR[6]);
- inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
@@ -103,7 +104,8 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
if (boost < 0.001) boost = 0.001; //there's a divide, we can't have this be zero
figureL[0] = figureR[0] = 600.0/getSampleRate(); //fixed frequency, 600hz
figureL[1] = figureR[1] = 0.023; //resonance
- double offset = B;
+ double offset = (B*2.0)-1.0;
+ double sinOffset = sin(offset); //we can cache this, it's expensive
double wet = C;
double K = tan(M_PI * figureR[0]);
double norm = 1.0 / (1.0 + K / figureR[1] + K * K);
@@ -126,7 +128,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
//figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]);
//inputSample = tempSample + sin(drySample-tempSample);
//or
- //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-offset)*boost);
+ //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost);
//
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Purest case, and since
@@ -136,7 +138,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
long double tempSample = (inputSampleL * figureL[2]) + figureL[7];
figureL[7] = -(tempSample * figureL[5]) + figureL[8];
figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]);
- inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
@@ -144,7 +146,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
tempSample = (inputSampleR * figureR[2]) + figureR[7];
figureR[7] = -(tempSample * figureR[5]) + figureR[8];
figureR[8] = (inputSampleR * figureR[4]) - (tempSample * figureR[6]);
- inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
diff --git a/plugins/WinVST/Coils/CoilsProc.cpp b/plugins/WinVST/Coils/CoilsProc.cpp
index cc0456a..409fd66 100755
--- a/plugins/WinVST/Coils/CoilsProc.cpp
+++ b/plugins/WinVST/Coils/CoilsProc.cpp
@@ -20,7 +20,8 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
if (boost < 0.001) boost = 0.001; //there's a divide, we can't have this be zero
figureL[0] = figureR[0] = 600.0/getSampleRate(); //fixed frequency, 600hz
figureL[1] = figureR[1] = 0.023; //resonance
- double offset = B;
+ double offset = (B*2.0)-1.0;
+ double sinOffset = sin(offset); //we can cache this, it's expensive
double wet = C;
double K = tan(M_PI * figureR[0]);
double norm = 1.0 / (1.0 + K / figureR[1] + K * K);
@@ -43,7 +44,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
//figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]);
//inputSample = tempSample + sin(drySample-tempSample);
//or
- //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-offset)*boost);
+ //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost);
//
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Purest case, and since
@@ -53,7 +54,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
long double tempSample = (inputSampleL * figureL[2]) + figureL[7];
figureL[7] = -(tempSample * figureL[5]) + figureL[8];
figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]);
- inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
@@ -61,7 +62,7 @@ void Coils::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra
tempSample = (inputSampleR * figureR[2]) + figureR[7];
figureR[7] = -(tempSample * figureR[5]) + figureR[8];
figureR[8] = (inputSampleR * figureR[4]) - (tempSample * figureR[6]);
- inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
@@ -103,7 +104,8 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
if (boost < 0.001) boost = 0.001; //there's a divide, we can't have this be zero
figureL[0] = figureR[0] = 600.0/getSampleRate(); //fixed frequency, 600hz
figureL[1] = figureR[1] = 0.023; //resonance
- double offset = B;
+ double offset = (B*2.0)-1.0;
+ double sinOffset = sin(offset); //we can cache this, it's expensive
double wet = C;
double K = tan(M_PI * figureR[0]);
double norm = 1.0 / (1.0 + K / figureR[1] + K * K);
@@ -126,7 +128,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
//figure[8] = (inputSample * figure[4]) - (tempSample * figure[6]);
//inputSample = tempSample + sin(drySample-tempSample);
//or
- //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-offset)*boost);
+ //inputSample = tempSample + ((sin(((drySample-tempSample)/boost)+offset)-sinOffset)*boost);
//
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Purest case, and since
@@ -136,7 +138,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
long double tempSample = (inputSampleL * figureL[2]) + figureL[7];
figureL[7] = -(tempSample * figureL[5]) + figureL[8];
figureL[8] = (inputSampleL * figureL[4]) - (tempSample * figureL[6]);
- inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleL = tempSample + ((sin(((drySampleL-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.
@@ -144,7 +146,7 @@ void Coils::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s
tempSample = (inputSampleR * figureR[2]) + figureR[7];
figureR[7] = -(tempSample * figureR[5]) + figureR[8];
figureR[8] = (inputSampleR * figureR[4]) - (tempSample * figureR[6]);
- inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-offset)*boost);
+ inputSampleR = tempSample + ((sin(((drySampleR-tempSample)/boost)+offset)-sinOffset)*boost);
//given a bandlimited inputSample, freq 600hz and Q of 0.023, this restores a lot of
//the full frequencies but distorts like a real transformer. Since
//we are not using a high Q we can remove the extra sin/asin on the biquad.