56 lines · 1.6 KB · Text
RawDownload
#+TITLE: Scrubber* OverviewAn FFT based in-memory sample scrubber with pitch control.* Tangled Files* FFT procedures, and SoundpipeOne could spend a whole lifetime building FFT algorithms,so an existing FFT implementation is used. For FFT andinverse-FFT operations, the Soundpipe fft utilities areused. So yes, Soundpipe is a hard dependency for thisalgorithm. Or at least, bits of Soundpipe are. The FFTportions can easily be extracted from the Soundpipecodebase. The soundpipe FFT utility is a wrapper around a publicdomain FFT implementation by John Green.* InitializationDone with =sk_scrubber_init=.* CleanupDone with =sk_scrubber_cleanup=. Mainly done for the sakeof the =sp_fft=. Future iterations will try to remove anymandatory use of =malloc= and =free=.* ConstantsScrubber uses a fixed FFT size, which greatly simplifiesthings. The FFT size chosen is 2048, or =2^11=. It's a goodvalue that equal parts effeciency and fidelity. The LOG2 of this FFT size is 11, and this is what is passedinto the soundpipe FFT interface. The hopsize determines how quickly to slide along the FFTwindow. In this case it's 512, or the FFT size divided upinto 4 bits. This divisor is a significant constant that will bestored as a constant as well.* Parameters** PositionSets the current read position of the buffer, in samples.** PlaybackSets the relative playback speed. 1 is normal, 2 is 2xspeed, and 0.5 is 2x slower.* ComputationRead interpolated samples from buffer forward/backwardframes. Take FFT of frames Phase Vocode. Inverse FFT operation. Overlap-add to output frames. Write to output and scale; Update counter and frame position.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t