+ Organ, Framework: use std::vector::front() instead of std::vector::data() (may possibly fix the MacOS X compilation problem reported by Daniel Klaffenbach and Tobias Doerffel)

(cherry picked from commit 628eb1543591f5137e6001abad439d01942ffd4a)
(cherry picked from commit 1294ff62ee)
This commit is contained in:
Krzysztof Foltman
2009-10-05 22:31:19 +01:00
committed by Tobias Doerffel
parent a1c720d728
commit dd055b210b
2 changed files with 5 additions and 4 deletions

View File

@@ -146,7 +146,7 @@ struct bandlimiter
new_spec[SIZE - i] = 0.f;
}
// convert back to time domain (IFFT) and extract only real part
fft.calculate(new_spec.data(), iffted.data(), true);
fft.calculate(&new_spec.front(), &iffted.front(), true);
for (int i = 0; i < SIZE; i++)
output[i] = iffted[i].real();
}

View File

@@ -173,9 +173,10 @@ static void padsynth(bandlimiter<ORGAN_WAVE_BITS> blSrc, bandlimiter<ORGAN_BIG_W
// same as above - put large array on heap to avoid stack overflow in ingen
vector<float> tmp;
tmp.resize(ORGAN_BIG_WAVE_SIZE);
blDest.compute_waveform(tmp.data());
normalize_waveform(tmp.data(), ORGAN_BIG_WAVE_SIZE);
blDest.compute_spectrum(tmp.data());
float *ptmp = &tmp.front();
blDest.compute_waveform(ptmp);
normalize_waveform(ptmp, ORGAN_BIG_WAVE_SIZE);
blDest.compute_spectrum(ptmp);
// limit is 1/2 of the number of harmonics of the original wave
result.make_from_spectrum(blDest, foldover, ORGAN_WAVE_SIZE >> (1 + ORGAN_BIG_WAVE_SHIFT));