diff options
author | Joerg Mueller <nexyon@gmail.com> | 2010-01-01 08:09:30 +0300 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2010-01-01 08:09:30 +0300 |
commit | 174eccf07851c4e7f669b194cd8951ca98bc5c81 (patch) | |
tree | 42d11467df2d006fcbaa562023ffe09796879716 /intern/audaspace/fftw | |
parent | 3fa927a42e893709ac78f7d9419c22979b05bf3f (diff) |
Huge new year audio commit!
* Refactored the whole audaspace library to use float as sample format over all readers.
* Added new Readers like the linear resampler, envelope, lowpass, highpass and butterworth.
* Note: The butterworth filter isn't working correctly, some bug in there... Maybe also true for the envelope.
* Added a sound to f-curve operator that behaves mostly like the soundtracker script of technoestupido.
Diffstat (limited to 'intern/audaspace/fftw')
-rw-r--r-- | intern/audaspace/fftw/AUD_BandPassFactory.cpp | 12 | ||||
-rw-r--r-- | intern/audaspace/fftw/AUD_BandPassReader.cpp | 6 |
2 files changed, 4 insertions, 14 deletions
diff --git a/intern/audaspace/fftw/AUD_BandPassFactory.cpp b/intern/audaspace/fftw/AUD_BandPassFactory.cpp index 5a957081208..2950cdf8bad 100644 --- a/intern/audaspace/fftw/AUD_BandPassFactory.cpp +++ b/intern/audaspace/fftw/AUD_BandPassFactory.cpp @@ -63,16 +63,8 @@ AUD_IReader* AUD_BandPassFactory::createReader() if(reader != 0) { - if(reader->getSpecs().format == AUD_FORMAT_FLOAT32) - { - reader = new AUD_BandPassReader(reader, m_low, m_high); - AUD_NEW("reader") - } - else - { - delete reader; AUD_DELETE("reader") - return 0; - } + reader = new AUD_BandPassReader(reader, m_low, m_high); + AUD_NEW("reader") } return reader; diff --git a/intern/audaspace/fftw/AUD_BandPassReader.cpp b/intern/audaspace/fftw/AUD_BandPassReader.cpp index 34d7193866f..e77b69863f1 100644 --- a/intern/audaspace/fftw/AUD_BandPassReader.cpp +++ b/intern/audaspace/fftw/AUD_BandPassReader.cpp @@ -77,7 +77,6 @@ void AUD_BandPassReader::read(int & length, sample_t* & buffer) } m_length = length; - printf("WINDOW: %d\n", m_length); if(m_length * sizeof(double) > m_in->getSize()) { @@ -95,16 +94,15 @@ void AUD_BandPassReader::read(int & length, sample_t* & buffer) FFTW_ESTIMATE); } - float* source = (float*) buffer; double* target = (double*) m_in->getBuffer(); - float* target2 = (float*) m_buffer->getBuffer(); + sample_t* target2 = m_buffer->getBuffer(); fftw_complex* complex = (fftw_complex*) m_out->getBuffer(); float frequency; for(int channel = 0; channel < specs.channels; channel++) { for(int i = 0; i < m_length; i++) - target[i] = source[i * specs.channels + channel]; + target[i] = buffer[i * specs.channels + channel]; fftw_execute(m_forward); |