Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
// 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. :)
//
// author: chokehold
// url: https://github.com/chkhld/jsfx/
// tags: utility dc offset
//
desc:DC Offset
// 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;
);