Add free filter envelope transforms as plugin parameters etc!

This commit is contained in:
xenakios 2018-02-28 14:20:26 +02:00
parent 9774af6e62
commit f5995807f4
5 changed files with 21 additions and 9 deletions

View File

@ -252,11 +252,11 @@ void PaulstretchpluginAudioProcessorEditor::resized()
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;
m_parcomps[cpi_freefilter_shiftx]->setBounds(xoffs, yoffs, div - 1, 24);
xoffs += div;
m_parcomps[cpi_freefilter_shifty]->setBounds(xoffs, yoffs, div - 1, 24);
yoffs += 25;
int remain_h = getHeight() - 1 - yoffs;
m_spec_order_ed.setBounds(1, yoffs, getWidth() - 2, remain_h / 5 * 1);
@ -316,8 +316,7 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id)
}
if (id == 3)
{
//m_specvis.setState(processor.getStretchSource()->getProcessParameters(), processor.getStretchSource()->getFFTSize() / 2,
// processor.getSampleRate());
m_free_filter_component.repaint();
}
}

View File

@ -150,7 +150,8 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor()
m_inchansparam = new AudioParameterInt("numinchans0", "Num ins", 2, 8, 2); // 32
addParameter(m_inchansparam); // 32
addParameter(new AudioParameterBool("bypass_stretch0", "Bypass stretch", false)); // 33
addParameter(new AudioParameterFloat("freefilter_shiftx_0", "Free filter shift X", -1.0f, 1.0f, 0.0f)); // 34
addParameter(new AudioParameterFloat("freefilter_shifty_0", "Free filter shift Y", -1.0f, 1.0f, 0.0f)); // 35
auto& pars = getParameters();
for (const auto& p : pars)
m_reset_pars.push_back(p->getValue());
@ -627,6 +628,8 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M
}
if (m_play_when_host_plays == true && m_playposinfo.isPlaying == false)
return;
m_free_filter_envelope->m_transform_x_shift = *getFloatParameter(cpi_freefilter_shiftx);
m_free_filter_envelope->m_transform_y_shift = *getFloatParameter(cpi_freefilter_shifty);
m_stretch_source->setMainVolume(*getFloatParameter(cpi_main_volume));
m_stretch_source->setRate(*getFloatParameter(cpi_stretchamount));
m_stretch_source->setPreviewDry(*getBoolParameter(cpi_bypass_stretch));

View File

@ -60,6 +60,8 @@ const int cpi_passthrough = 30;
const int cpi_markdirty = 31;
const int cpi_num_inchans = 32;
const int cpi_bypass_stretch = 33;
const int cpi_freefilter_shiftx = 34;
const int cpi_freefilter_shifty = 35;
class MyPropertiesFile
{

View File

@ -346,7 +346,15 @@ bool EnvelopeComponent::keyPressed(const KeyPress & ev)
repaint();
return true;
}
if (ev == 'A')
{
m_envelope->m_transform_x_shift = 0.0;
m_envelope->m_transform_y_scale = 1.0;
m_envelope->m_transform_y_shift = 0.0;
m_envelope->m_transform_y_sinus = 0.0;
repaint();
return true;
}
if (ev == KeyPress::deleteKey)
{

View File

@ -226,7 +226,7 @@ public:
{
if (state.isValid()==false)
return;
int numnodes = state.getNumChildren();
int numnodes = state.getNumChildren();
if (numnodes > 0)
{
m_nodes.clear();