|
|
@ -101,33 +101,27 @@ T *LowFrequencyOscillatorVector<T>::getNextVector() |
|
|
|
break; |
|
|
|
break; |
|
|
|
case Waveform::SQUARE : |
|
|
|
case Waveform::SQUARE : |
|
|
|
for (auto i=0; i<AUDIO_BLOCK_SAMPLES; i++) { |
|
|
|
for (auto i=0; i<AUDIO_BLOCK_SAMPLES; i++) { |
|
|
|
if (m_phaseVec[i] > 3*PI_F) { |
|
|
|
|
|
|
|
m_outputVec[i] = 0.0f; |
|
|
|
if (m_phaseVec[i] < PI_F) { |
|
|
|
} |
|
|
|
m_outputVec[i] = -1.0f; |
|
|
|
else if (m_phaseVec[i] > 2*PI_F) { |
|
|
|
} else { |
|
|
|
m_outputVec[i] = 1.0f; |
|
|
|
m_outputVec[i] = 1.0f; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (m_phaseVec[i] > PI_F) { |
|
|
|
|
|
|
|
m_outputVec[i] = 0.0f; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
m_outputVec[i] = 1.0f; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case Waveform::TRIANGLE : |
|
|
|
case Waveform::TRIANGLE : |
|
|
|
// for (auto i=0; i<AUDIO_BLOCK_SAMPLES; i++) {
|
|
|
|
// A triangle is made up from two different line equations of form y=mx+b
|
|
|
|
// if (m_phaseVec[i] > 3*PI_F) {
|
|
|
|
// where m = +2/pi or -2/pi. A "Triangle Cos" starts at +1.0 and moves to
|
|
|
|
// m_outputVec[i] = ;
|
|
|
|
// -1.0 from angles 0 to PI radians.
|
|
|
|
// }
|
|
|
|
for (auto i=0; i<AUDIO_BLOCK_SAMPLES; i++) { |
|
|
|
// else if (m_phaseVec[i] > 2*PI_F) {
|
|
|
|
if (m_phaseVec[i] < PI_F) { |
|
|
|
// m_outputVec[i] = 1.0f;
|
|
|
|
// y = (-2/pi)*x + 1.0
|
|
|
|
// }
|
|
|
|
m_outputVec[i] = TRIANGE_NEG_SLOPE * m_phaseVec[i] + 1.0f; |
|
|
|
// else if (m_phaseVec[i] > PI_F) {
|
|
|
|
} else { |
|
|
|
// m_outputVec[i] = 0.0f;
|
|
|
|
// y = (2/pi)*x -1.0
|
|
|
|
// } else {
|
|
|
|
m_outputVec[i] = TRIANGE_POS_SLOPE * (m_phaseVec[i]-PI_F) - 1.0f; |
|
|
|
// m_outputVec[i] = 1.0f;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case Waveform::RANDOM : |
|
|
|
case Waveform::RANDOM : |
|
|
|
break; |
|
|
|
break; |
|
|
|