@@ -257,3 +257,5 @@ inline bool is_in_range(T val, T start, T end) | |||||
{ | { | ||||
return val >= start && val <= end; | return val >= start && val <= end; | ||||
} | } | ||||
//#define SOUNDRANGE_OFFSET_ENABLED |
@@ -214,19 +214,27 @@ void PaulstretchpluginAudioProcessorEditor::resized() | |||||
m_parcomps[cpi_tonalvsnoisepreserve]->setBounds(xoffs, yoffs, div - 1, 24); | m_parcomps[cpi_tonalvsnoisepreserve]->setBounds(xoffs, yoffs, div - 1, 24); | ||||
xoffs = 1; | xoffs = 1; | ||||
yoffs += 25; | yoffs += 25; | ||||
m_parcomps[cpi_soundstart]->setBounds(xoffs, yoffs, div - 1, 24); | |||||
xoffs += div; | |||||
m_parcomps[cpi_soundend]->setBounds(xoffs, yoffs, div - 1, 24); | |||||
xoffs = 1; | |||||
yoffs += 25; | |||||
// filter here | |||||
m_parcomps[cpi_filter_low]->setBounds(xoffs, yoffs, div - 1, 24); | m_parcomps[cpi_filter_low]->setBounds(xoffs, yoffs, div - 1, 24); | ||||
xoffs += div; | xoffs += div; | ||||
m_parcomps[cpi_filter_high]->setBounds(xoffs, yoffs, div - 1, 24); | m_parcomps[cpi_filter_high]->setBounds(xoffs, yoffs, div - 1, 24); | ||||
xoffs = 1; | xoffs = 1; | ||||
yoffs += 25; | yoffs += 25; | ||||
m_parcomps[cpi_loopxfadelen]->setBounds(xoffs, yoffs, div - 1, 24); | m_parcomps[cpi_loopxfadelen]->setBounds(xoffs, yoffs, div - 1, 24); | ||||
xoffs += div; | xoffs += div; | ||||
m_parcomps[cpi_onsetdetection]->setBounds(xoffs, yoffs, div - 1, 24); | m_parcomps[cpi_onsetdetection]->setBounds(xoffs, yoffs, div - 1, 24); | ||||
xoffs = 1; | |||||
yoffs += 25; | |||||
m_parcomps[cpi_soundstart]->setBounds(xoffs, yoffs, div - 1, 24); | |||||
xoffs += div; | |||||
m_parcomps[cpi_soundend]->setBounds(xoffs, yoffs, div - 1, 24); | |||||
#ifdef SOUNDRANGE_OFFSET_ENABLED | |||||
yoffs += 25; | |||||
xoffs = 1; | |||||
m_parcomps[cpi_playrangeoffset]->setBounds(xoffs, yoffs, getWidth() - 2, 24); | |||||
#endif | |||||
yoffs += 25; | yoffs += 25; | ||||
int remain_h = getHeight() - 1 - yoffs -15; | int remain_h = getHeight() - 1 - yoffs -15; | ||||
m_spec_order_ed.setBounds(1, yoffs, getWidth() - 2, remain_h / 5 * 1); | m_spec_order_ed.setBounds(1, yoffs, getWidth() - 2, remain_h / 5 * 1); | ||||
@@ -370,9 +378,13 @@ void PaulstretchpluginAudioProcessorEditor::showSettingsMenu() | |||||
if (r == 3) | if (r == 3) | ||||
{ | { | ||||
String fftlib = fftwf_version; | String fftlib = fftwf_version; | ||||
String juceversiontxt = String("JUCE ") + String(JUCE_MAJOR_VERSION) + "." + String(JUCE_MINOR_VERSION); | |||||
String juceversiontxt = String("JUCE ") + String(JUCE_MAJOR_VERSION) + "." + String(JUCE_MINOR_VERSION); | |||||
String title = g_plugintitle; | |||||
#ifdef JUCE_DEBUG | |||||
title += " (DEBUG)"; | |||||
#endif | |||||
AlertWindow::showMessageBoxAsync(AlertWindow::InfoIcon, | AlertWindow::showMessageBoxAsync(AlertWindow::InfoIcon, | ||||
g_plugintitle, | |||||
title, | |||||
"Plugin for extreme time stretching and other sound processing\nBuilt on " + String(__DATE__) + " " + String(__TIME__) + "\n" | "Plugin for extreme time stretching and other sound processing\nBuilt on " + String(__DATE__) + " " + String(__TIME__) + "\n" | ||||
"Copyright (C) 2006-2011 Nasca Octavian Paul, Tg. Mures, Romania\n" | "Copyright (C) 2006-2011 Nasca Octavian Paul, Tg. Mures, Romania\n" | ||||
"(C) 2017-2018 Xenakios\n\n" | "(C) 2017-2018 Xenakios\n\n" | ||||
@@ -142,6 +142,9 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() | |||||
addParameter(new AudioParameterBool("markdirty0", "Internal (don't use)", false)); // 31 | addParameter(new AudioParameterBool("markdirty0", "Internal (don't use)", false)); // 31 | ||||
m_inchansparam = new AudioParameterInt("numinchans0", "Num ins", 2, 8, 2); // 32 | m_inchansparam = new AudioParameterInt("numinchans0", "Num ins", 2, 8, 2); // 32 | ||||
addParameter(m_inchansparam); // 32 | addParameter(m_inchansparam); // 32 | ||||
#ifdef SOUNDRANGE_OFFSET_ENABLED | |||||
addParameter(new AudioParameterFloat("playrangeoffset_0", "Play offset", 0.0f, 1.0f, 0.0f)); // 33 | |||||
#endif | |||||
auto& pars = getParameters(); | auto& pars = getParameters(); | ||||
for (const auto& p : pars) | for (const auto& p : pars) | ||||
m_reset_pars.push_back(p->getValue()); | m_reset_pars.push_back(p->getValue()); | ||||
@@ -478,6 +481,14 @@ void copyAudioBufferWrappingPosition(const AudioBuffer<float>& src, AudioBuffer< | |||||
} | } | ||||
} | } | ||||
inline void sanitizeTimeRange(double& t0, double& t1) | |||||
{ | |||||
if (t0 > t1) | |||||
std::swap(t0, t1); | |||||
if (t1 - t0 < 0.001) | |||||
t1 = t0 + 0.001; | |||||
} | |||||
void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) | void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) | ||||
{ | { | ||||
ScopedLock locker(m_cs); | ScopedLock locker(m_cs); | ||||
@@ -555,10 +566,20 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M | |||||
m_stretch_source->setLoopXFadeLength(*getFloatParameter(cpi_loopxfadelen)); | m_stretch_source->setLoopXFadeLength(*getFloatParameter(cpi_loopxfadelen)); | ||||
double t0 = *getFloatParameter(cpi_soundstart); | double t0 = *getFloatParameter(cpi_soundstart); | ||||
double t1 = *getFloatParameter(cpi_soundend); | double t1 = *getFloatParameter(cpi_soundend); | ||||
if (t0 > t1) | |||||
std::swap(t0, t1); | |||||
if (t1 - t0 < 0.001) | |||||
t1 = t0 + 0.001; | |||||
sanitizeTimeRange(t0, t1); | |||||
#ifdef SOUNDRANGE_OFFSET_ENABLED | |||||
if (m_cur_playrangeoffset != (*getFloatParameter(cpi_playrangeoffset))) | |||||
{ | |||||
double prlen = t1 - t0; | |||||
m_cur_playrangeoffset = jlimit<float>(0.0f,1.0f-prlen,(float)*getFloatParameter(cpi_playrangeoffset)); | |||||
t0 = m_cur_playrangeoffset; | |||||
t1 = t0 + prlen; | |||||
sanitizeTimeRange(t0, t1); | |||||
getFloatParameter(cpi_soundstart)->setValueNotifyingHost(t0); | |||||
getFloatParameter(cpi_soundend)->setValueNotifyingHost(t1); | |||||
} | |||||
#endif | |||||
m_stretch_source->setPlayRange({ t0,t1 }, true); | m_stretch_source->setPlayRange({ t0,t1 }, true); | ||||
m_stretch_source->setFreezing(getParameter(cpi_freeze)); | m_stretch_source->setFreezing(getParameter(cpi_freeze)); | ||||
m_stretch_source->setPaused(getParameter(cpi_pause_enabled)); | m_stretch_source->setPaused(getParameter(cpi_pause_enabled)); | ||||
@@ -58,6 +58,7 @@ const int cpi_max_capture_len = 29; | |||||
const int cpi_passthrough = 30; | const int cpi_passthrough = 30; | ||||
const int cpi_markdirty = 31; | const int cpi_markdirty = 31; | ||||
const int cpi_num_inchans = 32; | const int cpi_num_inchans = 32; | ||||
const int cpi_playrangeoffset = 33; | |||||
class MyPropertiesFile | class MyPropertiesFile | ||||
{ | { | ||||
@@ -203,7 +204,7 @@ private: | |||||
std::vector<float> m_reset_pars; | std::vector<float> m_reset_pars; | ||||
int m_cur_program = 0; | int m_cur_program = 0; | ||||
void setParameters(const std::vector<double>& pars); | void setParameters(const std::vector<double>& pars); | ||||
float m_cur_playrangeoffset = 0.0; | |||||
//============================================================================== | //============================================================================== | ||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor) | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor) | ||||
}; | }; |
@@ -8,7 +8,7 @@ Released under GNU General Public License v.2 license. | |||||
History : | History : | ||||
02-14-2018 1.0.1 | |||||
02-15-2018 1.0.1 | |||||
-Increased maximum number of input channels to 8 | -Increased maximum number of input channels to 8 | ||||
-Added zoom/scroll bar for waveform | -Added zoom/scroll bar for waveform | ||||
-GUI performance improvement/bug fix during capture mode | -GUI performance improvement/bug fix during capture mode | ||||