oscillator

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mixer

type Mixer struct {
	// contains filtered or unexported fields
}

func NewMixer

func NewMixer(sampleRate int) (*Mixer, error)

func (*Mixer) DeleteOscillator

func (m *Mixer) DeleteOscillator(index int)

func (*Mixer) NewOscillator

func (m *Mixer) NewOscillator() *Oscillator

func (*Mixer) Oscillators

func (m *Mixer) Oscillators() []*Oscillator

type Oscillator

type Oscillator struct {
	// contains filtered or unexported fields
}

func NewOscillator

func NewOscillator(context *oto.Context, sampleRate int) *Oscillator

func (*Oscillator) Amplitude

func (O *Oscillator) Amplitude() float64

func (*Oscillator) Duty

func (O *Oscillator) Duty() float64

func (*Oscillator) Frequency

func (O *Oscillator) Frequency() float64

func (*Oscillator) Pan

func (O *Oscillator) Pan() float64

func (*Oscillator) Phase

func (O *Oscillator) Phase() float64

func (*Oscillator) Read

func (O *Oscillator) Read(buf []byte) (int, error)

func (*Oscillator) SetAmplitude

func (O *Oscillator) SetAmplitude(amplitude float64)

Sets the amplitude of the signal. Accepts a real number from [0, 1].

func (*Oscillator) SetDuty

func (O *Oscillator) SetDuty(duty float64)

Sets the duty cycle of rectangular wave. Accepts a real number from [0, 1].

func (*Oscillator) SetFrequency

func (O *Oscillator) SetFrequency(frequency float64)

Sets the duty frequency of periodic signals. Accepts a real number from [10, 20000].

func (*Oscillator) SetPan

func (O *Oscillator) SetPan(pan float64)

Sets the pan of the signal. Accepts a real number from [-1, 1], -1 meaning total left, and 1 total right pan.

func (*Oscillator) SetPhase

func (O *Oscillator) SetPhase(phase float64)

func (*Oscillator) SetShape

func (O *Oscillator) SetShape(shape string)

func (*Oscillator) SetSkew

func (O *Oscillator) SetSkew(skew float64)

Sets the skewness of the triangular wave. Accepts a real number from [0, 1].

func (*Oscillator) Shape

func (O *Oscillator) Shape() string

func (*Oscillator) Skew

func (O *Oscillator) Skew() float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL