Remove Noise class from flanger (#7473)

This commit is contained in:
Rossmaxx
2024-08-29 01:16:48 +05:30
committed by GitHub
parent a992019626
commit 35f350eeff
5 changed files with 4 additions and 102 deletions

View File

@@ -1,7 +1,7 @@
INCLUDE(BuildPlugin)
BUILD_PLUGIN(
flanger FlangerEffect.cpp FlangerControls.cpp FlangerControlsDialog.cpp Noise.cpp MonoDelay.cpp
flanger FlangerEffect.cpp FlangerControls.cpp FlangerControlsDialog.cpp MonoDelay.cpp
MOCFILES FlangerControls.h FlangerControlsDialog.h
EMBEDDED_RESOURCES artwork.png logo.png
)

View File

@@ -25,10 +25,10 @@
#include "FlangerEffect.h"
#include "Engine.h"
#include "MonoDelay.h"
#include "Noise.h"
#include "QuadratureLfo.h"
#include "embed.h"
#include "lmms_math.h"
#include "plugin_export.h"
namespace lmms
@@ -61,7 +61,6 @@ FlangerEffect::FlangerEffect( Model *parent, const Plugin::Descriptor::SubPlugin
m_lfo = new QuadratureLfo( Engine::audioEngine()->outputSampleRate() );
m_lDelay = new MonoDelay( 1, Engine::audioEngine()->outputSampleRate() );
m_rDelay = new MonoDelay( 1, Engine::audioEngine()->outputSampleRate() );
m_noise = new Noise;
}
@@ -81,10 +80,6 @@ FlangerEffect::~FlangerEffect()
{
delete m_lfo;
}
if(m_noise)
{
delete m_noise;
}
}
@@ -113,8 +108,8 @@ bool FlangerEffect::processAudioBuffer( SampleFrame* buf, const fpp_t frames )
float leftLfo;
float rightLfo;
buf[f][0] += m_noise->tick() * noise;
buf[f][1] += m_noise->tick() * noise;
buf[f][0] += (fastRandf(2.0f) - 1.0f) * noise;
buf[f][1] += (fastRandf(2.0f) - 1.0f) * noise;
dryS[0] = buf[f][0];
dryS[1] = buf[f][1];
m_lfo->tick(&leftLfo, &rightLfo);

View File

@@ -33,7 +33,6 @@ namespace lmms
{
class MonoDelay;
class Noise;
class QuadratureLfo;
@@ -55,8 +54,6 @@ private:
MonoDelay* m_lDelay;
MonoDelay* m_rDelay;
QuadratureLfo* m_lfo;
Noise* m_noise;
};

View File

@@ -1,46 +0,0 @@
/*
* noise.cpp - defination of Noise class.
*
* Copyright (c) 2014 David French <dave/dot/french3/at/googlemail/dot/com>
*
* This file is part of LMMS - https://lmms.io
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include "Noise.h"
#include "lmms_math.h"
namespace lmms
{
Noise::Noise()
{
inv_randmax = FAST_RAND_RATIO; /* for range of 0 - 1.0 */
}
float Noise::tick()
{
return fastRandf(2.0f) - 1.0f;
}
} // namespace lmms

View File

@@ -1,44 +0,0 @@
/*
* noise.h - defination of Noise class.
*
* Copyright (c) 2014 David French <dave/dot/french3/at/googlemail/dot/com>
*
* This file is part of LMMS - https://lmms.io
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#ifndef NOISE_H
#define NOISE_H
namespace lmms
{
class Noise
{
public:
Noise();
float tick();
private:
double inv_randmax;
};
} // namespace lmms
#endif // NOISE_H