bw_osc_sin

Sinusoidal oscillator waveshaper.

It turns a normalized phase signal, such as that geneated by bw_phase_gen, into a sinusoidal wave.

Examples

Here you can download one or more example VST3 plugins for Windows, macOS and Linux. Source code of the audio engine(s) is included in the archive(s).

DescriptionLink
Ring modulator Download
Monophonic subtractive synth Download
Polyphonic subtractive synth Download
VST® is a trademark of Steinberg Media Technologies GmbH, registered in Europe and other countries.

API

Module type: DSP

bw_osc_sin_process1()

static inline float bw_osc_sin_process1(
	float x);

Processes one input sample x, representing the normalized phase, and returns the corresponding output sample.

x must be in [0.f, 1.f).

bw_osc_sin_process()

static inline void bw_osc_sin_process(
	const float * x,
	float *       y,
	size_t        n_samples);

Processes the first n_samples of the input buffer x, containing the normalized phase signal, and fills the first n_samples of the output buffer y.

All samples in x must be in [0.f, 1.f).

bw_osc_sin_process_multi()

static inline void bw_osc_sin_process_multi(
	const float * const * x,
	float * const *       y,
	size_t                n_channels,
	size_t                n_samples);

Processes the first n_samples of the n_channels input buffers x, containing the normalized phase signals, and fills the first n_samples of the n_channels output buffers y.

All samples in x must be in [0.f, 1.f).

C++ wrapper

Brickworks::oscSinProcess
template<size_t N_CHANNELS>
void oscSinProcess(
		const float * const * x,
		float * const *       y,
		size_t                nSamples);

# ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS>
void oscSinProcess(
		std::array<const float *, N_CHANNELS> x,
		std::array<float *, N_CHANNELS>       y,
		size_t                                nSamples);
# endif

Changelog

  • Version 1.2.0:
    • Added support for BW_INCLUDE_WITH_QUOTES, BW_NO_CXX, and BW_CXX_NO_EXTERN_C.
    • Added debugging checks in bw_osc_sin_process_multi() to ensure that buffers used for both input and output appear at the same channel indices.
  • Version 1.1.0:
    • Now using BW_NULL and BW_CXX_NO_ARRAY.
  • Version 1.0.0:
    • bw_osc_sin_process() and bw_osc_sin_process_multi() now use size_t to count samples and channels.
    • Added more const specifiers to input arguments.
    • Moved C++ code to C header.
    • Added overloaded C++ oscSinProcess() function taking C-style arrays as arguments.
    • Removed usage of reserved identifiers.
    • Clearly specified validity ranges for audio-rate signals.
    • Added debugging code.
  • Version 0.6.0:
    • Removed dependency on bw_config.
  • Version 0.5.0:
    • Added bw_osc_sin_process_multi().
    • Added C++ wrapper.
  • Version 0.2.0:
    • Refactored API.
  • Version 0.1.0:
    • First release.