Skip to content

Commit

Permalink
Fix Matrix display bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRobotMusic committed Jul 19, 2019
1 parent 92b7269 commit 2bb614c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions plugins/Microwave/Microwave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Microwave::Microwave(InstrumentTrack * instrument_track) :
Instrument(instrument_track, &microwave_plugin_descriptor),
m_visvol(100, 0, 1000, 0.01f, this, tr("Visualizer Volume")),
m_loadChnl(0, 0, 1, 1, this, tr("Wavetable Loading Channel")),
m_mainNum(1, 1, 8, this, tr("Main Oscillator Number")),
m_mainNum(1, 1, 8, this, tr("Wavetable Oscillator Number")),
m_subNum(1, 1, 64, this, tr("Sub Oscillator Number")),
m_sampNum(1, 1, 8, this, tr("Sample Number")),
m_oversample(this, tr("Oversampling")),
Expand Down Expand Up @@ -1038,7 +1038,7 @@ void Microwave::subSampLenChanged(int num)
}


//Stores the highest enabled main oscillator. Helps with CPU benefit, refer to its use in mSynth::nextStringSample
//Stores the highest enabled wavetable oscillator. Helps with CPU benefit, refer to its use in mSynth::nextStringSample
void Microwave::mainEnabledChanged(int num)
{
for (int i = 0; i < 8; ++i)
Expand Down Expand Up @@ -2165,11 +2165,6 @@ void MicrowaveView::updateScroll()
m_modInCurveKnob2[i]->setMatrixLocation(4, 4, i);
}

// Bug evasion. Without this, some display glitches happen in certain conditions.
modOutSecChanged(i+matrixDivide);
modInChanged(i+matrixDivide);
modIn2Changed(i+matrixDivide);

visimove(m_modInBox[i], 45, i*115+57 - matrixRemainder, inMatrixTab);
visimove(m_modInNumBox[i], 90, i*115+57 - matrixRemainder, inMatrixTab);
visimove(m_modInAmntKnob[i], 136, i*115+53 - matrixRemainder, inMatrixTab);
Expand All @@ -2190,6 +2185,11 @@ void MicrowaveView::updateScroll()
visimove(m_i1Button[i], 25, i*115+50 - matrixRemainder, inMatrixTab);
visimove(m_i2Button[i], 25, i*115+112 - matrixRemainder, inMatrixTab);
visimove(m_modNumText[i], 192, i*115+89 - matrixRemainder, inMatrixTab);

// Bug evasion. Without this, some display glitches happen in certain conditions.
modOutSecChanged(i+matrixDivide);
modInChanged(i+matrixDivide);
modIn2Changed(i+matrixDivide);
}

for (int i = 0; i < 8; ++i)
Expand Down Expand Up @@ -2526,7 +2526,7 @@ void MicrowaveView::modOutSecChanged(int i)
m_modOutSecNumBox[i-matrixDivide]->hide();
break;
}
case 1:// Main OSC
case 1:// Wavetable OSC
{
m_modOutSigBox[i-matrixDivide]->show();
m_modOutSecNumBox[i-matrixDivide]->show();
Expand Down Expand Up @@ -2605,7 +2605,7 @@ void MicrowaveView::modInChanged(int i)
m_modInNumBox[i-matrixDivide]->hide();
break;
}
case 1:// Main OSC
case 1:// Wavetable OSC
{
m_modInNumBox[i-matrixDivide]->show();
m_b->m_modInNum[i]->setRange(1, 8, 1);
Expand Down Expand Up @@ -2671,7 +2671,7 @@ void MicrowaveView::modIn2Changed(int i)
m_modInNumBox2[i-matrixDivide]->hide();
break;
}
case 1:// Main OSC
case 1:// Wavetable OSC
{
m_modInNumBox2[i-matrixDivide]->show();
m_b->m_modInNum2[i]->setRange(1, 8, 1);
Expand Down Expand Up @@ -4136,7 +4136,7 @@ void mSynth::nextStringSample(sampleFrame &outputSample, float (&m_waveforms)[8]
{
break;
}
case 1:// Main Oscillator
case 1:// Wavetable Oscillator
{
switch (m_modOutSig[l])
{
Expand Down Expand Up @@ -4936,9 +4936,9 @@ void mSynth::nextStringSample(sampleFrame &outputSample, float (&m_waveforms)[8]
}
}

//=====================//
//== MAIN OSCILLATOR ==//
//=====================//
//==========================//
//== WAVETABLE OSCILLATOR ==//
//==========================//

for (int i = 0; i < m_maxMainEnabled; ++i)// m_maxMainEnabled keeps this from looping 8 times every m_sample, saving some CPU
{
Expand Down Expand Up @@ -5521,7 +5521,7 @@ void mSynth::nextStringSample(sampleFrame &outputSample, float (&m_waveforms)[8]
outputSample[0] = 0;
outputSample[1] = 0;

// Main Oscillator outputs
// Wavetable Oscillator outputs
for (int i = 0; i < m_maxMainEnabled; ++i)
{
if (m_enabled[i])
Expand Down
6 changes: 3 additions & 3 deletions plugins/Microwave/Microwave.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
#define modinmodel(name)\
name->clear();\
name->addItem(tr("None"), make_unique<PluginPixmapLoader>("none"));\
name->addItem(tr("Main OSC"), make_unique<PluginPixmapLoader>("sqr"));\
name->addItem(tr("Wavetable OSC"), make_unique<PluginPixmapLoader>("sqr"));\
name->addItem(tr("Sub OSC"), make_unique<PluginPixmapLoader>("sin"));\
name->addItem(tr("Sample OSC"), make_unique<PluginPixmapLoader>("noise"));\
name->addItem(tr("Filter Output"), make_unique<PluginPixmapLoader>("moog"));\
Expand All @@ -91,7 +91,7 @@
#define modsectionsmodel(name)\
name->clear();\
name->addItem(tr("None"), make_unique<PluginPixmapLoader>("none"));\
name->addItem(tr("Main OSC"), make_unique<PluginPixmapLoader>("sqr"));\
name->addItem(tr("Wavetable OSC"), make_unique<PluginPixmapLoader>("sqr"));\
name->addItem(tr("Sub OSC"), make_unique<PluginPixmapLoader>("sin"));\
name->addItem(tr("Sample OSC"), make_unique<PluginPixmapLoader>("noise"));\
name->addItem(tr("Matrix"), make_unique<PluginPixmapLoader>("ramp"));\
Expand Down Expand Up @@ -590,7 +590,7 @@ protected slots:
float m_macroArr[18] = {0};
//Above is for passing to mSynth initialization

int m_maxMainEnabled = 0;// The highest number of main oscillator sections that must be looped through
int m_maxMainEnabled = 0;// The highest number of wavetable oscillator sections that must be looped through
int m_maxModEnabled = 0;// The highest number of matrix sections that must be looped through
int m_maxSubEnabled = 0;// The highest number of sub oscillator sections that must be looped through
int m_maxSampleEnabled = 0;// The highest number of sample sections that must be looped through
Expand Down

0 comments on commit 2bb614c

Please sign in to comment.