Documentation ¶
Index ¶
Constants ¶
View Source
const ( SineB = 4.0 / math.Pi SineC = -4.0 / (math.Pi * math.Pi) Q = 0.775 SineP = 0.225 )
View Source
const SawtoothA = 1.0 / math.Pi
View Source
const TringleA = 2.0 / math.Pi
View Source
const (
TwoPi = float64(2 * math.Pi)
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Osc ¶
type Osc struct { Shape WaveType Amplitude float64 DcOffset float64 Freq float64 // SampleRate Fs int PhaseOffset float64 CurrentPhaseAngle float64 // contains filtered or unexported fields }
Osc is an oscillator
func NewOsc ¶
NewOsc returns a new oscillator, note that if you change the phase offset of the returned osc, you also need to set the CurrentPhaseAngle
func (*Osc) SetAttackInMs ¶
SetAttackInMs sets the duration for the oscillator to be at full amplitude after it starts.
Click to show internal directories.
Click to hide internal directories.