MCPcopy Create free account
hub / github.com/andrewreeman/SpectralSuite / process

Method process

Playground/PlaygroundFFTProcessor.cpp:29–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29void PlaygroundFFTProcessor::process(const FftDecimal* input, FftDecimal* output, int blockSize){
30 if(!phaseBuffer->isAvailable()) {
31 PhaseVocoder::process(input, output, blockSize);
32 return;
33 }
34
35#ifdef STRETCH_USING_LARGE_OUTPUT_FFT
36 if(m_stretchedOutputReadIndex < m_stretchedOutput.size()) {
37 for(int i=0; i<blockSize; i++) {
38 output[i] = m_stretchedOutput[(i + m_stretchedOutputReadIndex) % m_stretchedOutput.size()];
39 }
40
41 m_stretchedOutputReadIndex += blockSize;
42 return;
43 }
44#endif
45
46 if(m_useThreadForLargeFft && isLargeFft() && m_isWaitingForFft) {
47 // this will write the audio input to the internal buffer of the process.
48 float* pWriteToOutput = (&m_prevOutput[0]) + m_offset;
49
50 for(int i=0; i<blockSize; ++i){
51 output[i] += *pWriteToOutput;
52 ++pWriteToOutput;
53 }
54 m_offset += blockSize;
55
56 if( m_offset >= m_fftSize){
57 m_offset = 0;
58 }
59 }
60 else {
61 fill_in_passOut(input, output, blockSize);
62 m_offset += blockSize;
63 }
64
65 if( m_offset >= m_fftSize){
66 // single fft thread
67 // set busy
68 // do async if large fft size. do sync if small
69 if(m_useThreadForLargeFft && isLargeFft()) {
70 readyForFft();
71 }
72 else {
73 performFftWork();
74 }
75
76 // set offset sync?
77 m_offset = 0;
78 }
79}
80
81bool PlaygroundFFTProcessor::setFFTSize(int newSize){
82 bool status = PhaseVocoder::setFFTSize(newSize);

Callers

nothing calls this directly

Calls 1

isAvailableMethod · 0.80

Tested by

no test coverage detected