Remove the bool enabled members from the spectral process parameters

This commit is contained in:
xenakios 2018-01-30 18:49:00 +02:00
parent 65545c96b6
commit f414f19e01
3 changed files with 4 additions and 33 deletions

View File

@ -26,35 +26,27 @@ struct ProcessParameters
{ {
ProcessParameters() ProcessParameters()
{ {
pitch_shift.enabled=false;
pitch_shift.cents=0; pitch_shift.cents=0;
octave.enabled=false;
octave.om2=octave.om1=octave.o1=octave.o15=octave.o2=0.0f; octave.om2=octave.om1=octave.o1=octave.o15=octave.o2=0.0f;
octave.o0=1.0f; octave.o0=1.0f;
freq_shift.enabled=false;
freq_shift.Hz=0; freq_shift.Hz=0;
compressor.enabled=false;
compressor.power=0.0f; compressor.power=0.0f;
filter.enabled=false;
filter.stop=false; filter.stop=false;
filter.low=0.0f; filter.low=0.0f;
filter.high=22000.0f; filter.high=22000.0f;
filter.hdamp=0.0f; filter.hdamp=0.0f;
harmonics.enabled=false;
harmonics.freq=440.0f; harmonics.freq=440.0f;
harmonics.bandwidth=25.0f; harmonics.bandwidth=25.0f;
harmonics.nharmonics=10; harmonics.nharmonics=10;
harmonics.gauss=false; harmonics.gauss=false;
spread.enabled=false;
spread.bandwidth=0.3f; spread.bandwidth=0.3f;
tonal_vs_noise.enabled=false;
tonal_vs_noise.preserve=0.5f; tonal_vs_noise.preserve=0.5f;
tonal_vs_noise.bandwidth=0.9f; tonal_vs_noise.bandwidth=0.9f;
}; };
@ -63,34 +55,28 @@ struct ProcessParameters
struct{ struct{
bool enabled;
int cents; int cents;
}pitch_shift; }pitch_shift;
struct{ struct{
bool enabled;
REALTYPE om2,om1,o0,o1,o15,o2; REALTYPE om2,om1,o0,o1,o15,o2;
}octave; }octave;
struct{ struct{
bool enabled;
int Hz; int Hz;
}freq_shift; }freq_shift;
struct{ struct{
bool enabled;
REALTYPE power; REALTYPE power;
}compressor; }compressor;
struct{ struct{
bool enabled;
REALTYPE low,high; REALTYPE low,high;
REALTYPE hdamp; REALTYPE hdamp;
bool stop; bool stop;
}filter; }filter;
struct{ struct{
bool enabled;
REALTYPE freq; REALTYPE freq;
REALTYPE bandwidth; REALTYPE bandwidth;
int nharmonics; int nharmonics;
@ -98,12 +84,10 @@ struct ProcessParameters
}harmonics; }harmonics;
struct{ struct{
bool enabled;
REALTYPE bandwidth; REALTYPE bandwidth;
}spread; }spread;
struct{ struct{
bool enabled;
REALTYPE preserve; REALTYPE preserve;
REALTYPE bandwidth; REALTYPE bandwidth;
}tonal_vs_noise; }tonal_vs_noise;
@ -149,30 +133,22 @@ struct ProcessParameters
*/ */
bool operator == (const ProcessParameters& other) const noexcept bool operator == (const ProcessParameters& other) const noexcept
{ {
return pitch_shift.enabled == other.pitch_shift.enabled && return pitch_shift.cents == other.pitch_shift.cents &&
pitch_shift.cents == other.pitch_shift.cents &&
octave.enabled == other.octave.enabled &&
octave.o0 == other.octave.o0 && octave.o0 == other.octave.o0 &&
octave.o1 == other.octave.o1 && octave.o1 == other.octave.o1 &&
octave.o15 == other.octave.o15 && octave.o15 == other.octave.o15 &&
octave.o2 == other.octave.o2 && octave.o2 == other.octave.o2 &&
octave.om1 == other.octave.om1 && octave.om1 == other.octave.om1 &&
octave.om2 == other.octave.om2 && octave.om2 == other.octave.om2 &&
spread.enabled == other.spread.enabled &&
spread.bandwidth == other.spread.bandwidth && spread.bandwidth == other.spread.bandwidth &&
tonal_vs_noise.enabled == other.tonal_vs_noise.enabled &&
tonal_vs_noise.bandwidth == other.tonal_vs_noise.bandwidth && tonal_vs_noise.bandwidth == other.tonal_vs_noise.bandwidth &&
tonal_vs_noise.preserve == other.tonal_vs_noise.preserve && tonal_vs_noise.preserve == other.tonal_vs_noise.preserve &&
freq_shift.enabled == other.freq_shift.enabled &&
freq_shift.Hz == other.freq_shift.Hz && freq_shift.Hz == other.freq_shift.Hz &&
compressor.enabled == other.compressor.enabled &&
compressor.power == other.compressor.power && compressor.power == other.compressor.power &&
harmonics.bandwidth == other.harmonics.bandwidth && harmonics.bandwidth == other.harmonics.bandwidth &&
harmonics.enabled == other.harmonics.enabled &&
harmonics.freq == other.harmonics.freq && harmonics.freq == other.harmonics.freq &&
harmonics.gauss == other.harmonics.gauss && harmonics.gauss == other.harmonics.gauss &&
harmonics.nharmonics == other.harmonics.nharmonics && harmonics.nharmonics == other.harmonics.nharmonics &&
filter.enabled == other.filter.enabled &&
filter.hdamp == other.filter.hdamp && filter.hdamp == other.filter.hdamp &&
filter.high == other.filter.high && filter.high == other.filter.high &&
filter.low == other.filter.low && filter.low == other.filter.low &&

View File

@ -662,9 +662,9 @@ void SpectralVisualizer::setState(const ProcessParameters & pars, int nfreqs, do
spectrum_do_freq_shift(pars, nfreqs, samplerate, m_freqs2.data(), m_freqs1.data()); spectrum_do_freq_shift(pars, nfreqs, samplerate, m_freqs2.data(), m_freqs1.data());
spectrum_do_compressor(pars, nfreqs, m_freqs1.data(), m_freqs2.data()); spectrum_do_compressor(pars, nfreqs, m_freqs1.data(), m_freqs2.data());
spectrum_spread(nfreqs, samplerate, m_freqs3, m_freqs2.data(), m_freqs1.data(), pars.spread.bandwidth); spectrum_spread(nfreqs, samplerate, m_freqs3, m_freqs2.data(), m_freqs1.data(), pars.spread.bandwidth);
if (pars.harmonics.enabled) //if (pars.harmonics.enabled)
spectrum_do_harmonics(pars, m_freqs3, nfreqs, samplerate, m_freqs1.data(), m_freqs2.data()); // spectrum_do_harmonics(pars, m_freqs3, nfreqs, samplerate, m_freqs1.data(), m_freqs2.data());
else spectrum_copy(nfreqs, m_freqs1.data(), m_freqs2.data()); //else spectrum_copy(nfreqs, m_freqs1.data(), m_freqs2.data());
Graphics g(m_img); Graphics g(m_img);
g.fillAll(Colours::black); g.fillAll(Colours::black);
g.setColour(Colours::white); g.setColour(Colours::white);

View File

@ -100,11 +100,6 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor()
m_thumbcache->getTimeSliceThread().setPriority(3); m_thumbcache->getTimeSliceThread().setPriority(3);
m_stretch_source = std::make_unique<StretchAudioSource>(2, m_afm); m_stretch_source = std::make_unique<StretchAudioSource>(2, m_afm);
m_ppar.pitch_shift.enabled = true;
m_ppar.freq_shift.enabled = true;
m_ppar.filter.enabled = true;
m_ppar.compressor.enabled = true;
m_stretch_source->setOnsetDetection(0.0); m_stretch_source->setOnsetDetection(0.0);
m_stretch_source->setLoopingEnabled(true); m_stretch_source->setLoopingEnabled(true);
m_stretch_source->setFFTWindowingType(1); m_stretch_source->setFFTWindowingType(1);