|
Post by kimmykix on Feb 3, 2018 20:41:12 GMT 1
So I have been working on a project to create an Asymmetrical Distortion plugin using SE 1.3, but for some reason, the plugin will not work outside of SE itself. The main issue seems to be my Asymmetry algorithm prefab, which is this: I have even exported this prefab in itself as a plugin, but it will not load in Ableton or FL. If I take this prefab out of my main plugin, the main plugin will load up just fine. The C++ Code that this prefab is based off is as follo ws:
if (sample < 0.0f) {
sample *= (1.0f - m_symmetry) * 2.0f;
} else {
sample *= m_symmetry * 2.0f;
}
Also, I had a friend attempt to code a SE module to do the same thing in itself, but even though the module loads into SE just fine, once any signal is put through the module, it crashes SynthEdit. Any Idea what might be causing this issue?
|
|
|
Post by Rob on Feb 4, 2018 17:54:34 GMT 1
Hi, Your code example doesn't send anything to the output. Where btw is a waveshaping function, like e.g. atan or sin? Now it just changes the volume at one side and lowers the other and visa versa? if (input < 0.0f) {
input *= (1.0f - m_symmetry) * 2.0f;
} else {
input *= m_symmetry * 2.0f;
}
This compiles fine and doesn't crash SE: for( int s = sampleFrames; s > 0; --s ) { // TODO: Signal processing goes here. float in = *input; float sym = *symmetry;
if (in < 0.0f) { *output = in * ((1.0f - sym) * 2.0f); } else { *output = in * (sym * 2.0f); }
// Increment buffer pointers. ++input; ++symmetry; ++output; }
Attached is the compiled module (x64) and source code. Attachments:Rhasym.zip (123.47 KB)
RH-Asym.zip (1.89 KB)
|
|
|
Post by kimmykix on Feb 5, 2018 6:23:06 GMT 1
Thanks for the module fix! To clear things up, the code I posted originally was only the code of the formula, hense why it had to output. Here is the rest of the code of the original (non working) module: void SEAsymmetry::subProcess(int bufferOffset, int sampleFrames)
{
float* in = pinAudioInput.getBuffer() + bufferOffset;
float* out = pinAudioOutput.getBuffer() + bufferOffset;
float balance = pinBalanceInput.getValue();
for (int i = sampleFrames; i > 0; i--) {
float sample = *in;
if (sample < 0.0f) {
sample *= (1.0f - balance) * 2.0f;
} else {
sample *= balance * 2.0f;
}
*out = sample;
in++;
out++;
}
}
The Asymmetry is only one feature of my distortion plugin, the actual distortion is a simple overdrive/clip currently. I plan to add a few different types of distortion to the plugin. Here is where the plugin sits currently, all working now thanks to your fixed module: Now I am having the same problem (plugin not loading or showing up in Ableton/FL) with another plugin I'm working on making (A synth), but I think I will make a different topic for that one.
|
|
Andrew
Developer
Posts: 110
Posts: 110
|
Post by Andrew on Feb 5, 2018 18:29:25 GMT 1
Just a note, you might want to move your 1st LP/HP pair in front of the distortion, tends to give cleaner sounds, especially on complex material.
|
|