DSP::SineOscillator
Inherits Reference < Object
Constructors
new(freq : Float64, sample_rate : Float64, ampl : Float64 = 1.0, phase : Float64 = 0.0, dc : Float64 = 0.0)
A new instance of Oscillator. The controllable wave parameters are frequency, amplitude, phase offset, and DC offset. The current phase angle is initialized to the given phase offset.
@param [Hash] args Hashed arguments. Required key is :sample_rate. Optional keys are :wave_type, :frequency, :amplitude, :phase_offset, and :dc_offset. See ARG_SPECS for more details.
Instance methods
ampl
Sourcedc
Sourcefreq
Sourcefreq=(freq : Float64)
Set the frequency (also updates the rate at which phase angle increments).
phase
Sourcephase=(phase : Float64)
Set the phase angle offset. Update the current phase angle according to the difference between the current phase offset and the new phase offset.
sample_rate
Source