Mercurial > hg > svapp
changeset 326:8e44c7302cf3 tonioni
Indentation only
author | Chris Cannam |
---|---|
date | Fri, 17 Jan 2014 08:40:01 +0000 |
parents | 7bdfbaa8d93f |
children | d2c13ec0f148 |
files | audioio/ContinuousSynth.cpp |
diffstat | 1 files changed, 36 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/audioio/ContinuousSynth.cpp Thu Jan 16 18:02:16 2014 -0500 +++ b/audioio/ContinuousSynth.cpp Fri Jan 17 08:40:01 2014 +0000 @@ -25,7 +25,7 @@ m_blockSize(blockSize), m_prevF0(-1.f), m_phase(0.0), - m_wavetype(waveType) // 0: 3 sinusoids, 1: 1 sinusoid, 2: sawtooth, 3: square + m_wavetype(waveType) // 0: 3 sinusoids, 1: 1 sinusoid, 2: sawtooth, 3: square { } @@ -83,49 +83,49 @@ if (harmonics < 1) harmonics = 1; switch (m_wavetype) { - case 1: - harmonics = 1; - break; - case 2: - break; - case 3: - break; - default: - harmonics = 3; - break; + case 1: + harmonics = 1; + break; + case 2: + break; + case 3: + break; + default: + harmonics = 3; + break; } for (int h = 0; h < harmonics; ++h) { - double v = 0; - double hn = 0; - double hp = 0; + double v = 0; + double hn = 0; + double hp = 0; - switch (m_wavetype) { - case 1: // single sinusoid - v = sin(m_phase); - break; - case 2: // sawtooth - if (h != 0) { - hn = h + 1; - hp = m_phase * hn; - v = -(1.0 / M_PI) * sin(hp) / hn; - } else { - v = 0.5; - } - break; - case 3: // square - hn = h*2 + 1; - hp = m_phase * hn; - v = sin(hp) / hn; - break; - default: // 3 sinusoids + switch (m_wavetype) { + case 1: // single sinusoid + v = sin(m_phase); + break; + case 2: // sawtooth + if (h != 0) { hn = h + 1; hp = m_phase * hn; - v = sin(hp) / hn; - break; - } + v = -(1.0 / M_PI) * sin(hp) / hn; + } else { + v = 0.5; + } + break; + case 3: // square + hn = h*2 + 1; + hp = m_phase * hn; + v = sin(hp) / hn; + break; + default: // 3 sinusoids + hn = h + 1; + hp = m_phase * hn; + v = sin(hp) / hn; + break; + } if (!wasOn && i < fadeLength) { // fade in