| 123456789101112131415161718192021222324252627282930313233343536 |
- desc: DC Offset
- version: 1.8.3
- author: chokehold
- tags: utility dc offset
- link: https://github.com/chkhld/jsfx/
- screenshot: https://github.com/chkhld/jsfx/blob/main/assets/screenshots/dc_offset.png
- about:
- # DC Offset
-
- Adds a DC Offset (0 Hz non-moving frequency) to all channels of a signal.
-
- This will usually not be a desirable thing, but it will help you when testing
- DC filters for functionality. :)
- // ----------------------------------------------------------------------------
- // The range [-1,+1] adds DC of up to 0 dBfs, so that should be sufficient...
- slider1:dcOffset=0<-1,1,0.00001>DC Offset
- // By not having in_pin and out_pin assignments, this plugin is able to adapt to
- // the number of channels on its track automatically.
- @sample // ---------------------------------------------------------------------
-
- // Start at channel 0
- channel = 0;
-
- // Cycle through all channels on this track
- while (channel < num_ch)
- (
- // Replace this channel's sample by a DC filtered version of itself
- spl(channel) += dcOffset;
-
- // Advance to the sample on the next channel
- channel += 1;
- );
-
|