Documentation ¶
Index ¶
- Constants
- func AbsInt(n int) int
- func ApplyCommand(cmd Command, data interface{}) error
- func MaxAbsInts(ns []int) int
- func RoundInt(f float64) int
- type Activator
- type Adder
- type AllPassFilter
- type Amplituder
- type ChangeFloat
- type ChangeInt
- type ChangeMode
- type Chorus
- type CombFilter
- type Command
- type Distortion
- type Envelope
- type EnvelopeParams
- type EnveloppedOscillator
- type Filter
- func (f *Filter) ChangeCutoff(cutoff float64)
- func (f *Filter) ChangeMode(mode FilterMode)
- func (f *Filter) ChangeParameters(params FilterParams)
- func (f *Filter) ChangeResonance(res float64)
- func (f *Filter) ConnectInput(input string, op Outputter)
- func (a *Filter) Execute(cmd Command)
- func (f *Filter) Inputs() []string
- func (f *Filter) Output(secs float64) float64
- func (f *Filter) Parameters() FilterParams
- type FilterMode
- type FilterParams
- type FixedSustainEnvelope
- type InputOutputter
- type LFO
- type LinearBuffer
- type OscillatorPool
- type Outputter
- type Reverb
- type StdOscillator
- func (o *StdOscillator) Activate()
- func (o *StdOscillator) ChangeAmpl(ampl float64)
- func (o *StdOscillator) ChangeFreq(freq float64)
- func (o *StdOscillator) ChangeOvertones(n int)
- func (o *StdOscillator) ChangeParameters(params StdOscillatorParams)
- func (o *StdOscillator) ChangeType(typ StdOscillatorType)
- func (o *StdOscillator) ConnectInput(input string, op Outputter)
- func (o *StdOscillator) Deactivate()
- func (o *StdOscillator) Execute(cmd Command)
- func (o *StdOscillator) Inputs() []string
- func (o *StdOscillator) IsMuted() bool
- func (o *StdOscillator) Mute()
- func (o *StdOscillator) Output(secs float64) float64
- func (o *StdOscillator) Parameters() StdOscillatorParams
- func (o *StdOscillator) Unmute()
- type StdOscillatorParams
- type StdOscillatorType
- type Synthesizer
- type WavOutputter
Constants ¶
View Source
const ( AmplitudeInputSignal = "signal" AmplitudeInputModulation = "modulation" )
View Source
const ( DistortionInputSignal = "signal" DistortionInputTresholdModulation = "threshold-modulation" )
View Source
const ( FilterInputSignal = "signal" FilterInputCutoffModulation = "cutoff-modulation" FilterInputResonanceModulation = "resonance-modulation" )
View Source
const (
AdderInput = "signal"
)
View Source
const SampelRate44100 = 44100
View Source
const (
StdOscillatorInputFreqMod = "frequency-modulation"
)
Variables ¶
This section is empty.
Functions ¶
func ApplyCommand ¶
func MaxAbsInts ¶
Types ¶
type Activator ¶
func (*Activator) Deactivate ¶
func (a *Activator) Deactivate()
type Adder ¶
type Adder struct { Activator // contains filtered or unexported fields }
func (*Adder) ConnectInput ¶
type AllPassFilter ¶
type AllPassFilter struct { Gain float64 DelayMsec float64 SamplingRate float64 // contains filtered or unexported fields }
func NewAllPassFilter ¶
func NewAllPassFilter(gain, delayMsec, samplingRate float64) *AllPassFilter
func (*AllPassFilter) Next ¶
func (f *AllPassFilter) Next(x float64) float64
type Amplituder ¶
type Amplituder struct {
// contains filtered or unexported fields
}
func NewAmplituder ¶
func NewAmplituder(baseAmpl float64) *Amplituder
func (*Amplituder) ConnectInput ¶
func (a *Amplituder) ConnectInput(input string, op Outputter)
func (*Amplituder) Inputs ¶
func (a *Amplituder) Inputs() []string
func (*Amplituder) Output ¶
func (a *Amplituder) Output(secs float64) float64
type ChangeFloat ¶
type ChangeFloat struct { Mode ChangeMode Value float64 }
func ParseChangeFloat ¶
func ParseChangeFloat(s string) (ChangeFloat, error)
func (ChangeFloat) Applied ¶
func (cf ChangeFloat) Applied(v float64) float64
type Chorus ¶
type Chorus struct {
// contains filtered or unexported fields
}
func (*Chorus) ConnectInput ¶
func (*Chorus) ConnectInputLFO ¶
type CombFilter ¶
type CombFilter struct { Gain float64 DelayMsec float64 SamplingRate float64 // contains filtered or unexported fields }
func NewCombFilter ¶
func NewCombFilter(gain, delayMsec, samplingRate float64) *CombFilter
func (*CombFilter) Change ¶
func (f *CombFilter) Change(delayMsec, samplingRate float64)
func (*CombFilter) Next ¶
func (f *CombFilter) Next(x float64) float64
type Distortion ¶
type Distortion struct {
// contains filtered or unexported fields
}
func NewDistortion ¶
func NewDistortion(baseThreshold float64) *Distortion
func (*Distortion) ConnectInput ¶
func (d *Distortion) ConnectInput(input string, op Outputter)
func (*Distortion) Inputs ¶
func (d *Distortion) Inputs() []string
func (*Distortion) Output ¶
func (d *Distortion) Output(secs float64) float64
type Envelope ¶
type Envelope struct {
// contains filtered or unexported fields
}
func NewEnvelope ¶
func NewEnvelope(ps EnvelopeParams) *Envelope
type EnvelopeParams ¶
EnvelopeParams holds all envelope params; attack, decay and release are in seconds
type EnveloppedOscillator ¶
type EnveloppedOscillator struct {
// contains filtered or unexported fields
}
type Filter ¶
type Filter struct { Params FilterParams Activator // contains filtered or unexported fields }
func (*Filter) ChangeCutoff ¶
func (*Filter) ChangeMode ¶
func (f *Filter) ChangeMode(mode FilterMode)
func (*Filter) ChangeParameters ¶
func (f *Filter) ChangeParameters(params FilterParams)
func (*Filter) ChangeResonance ¶
func (*Filter) ConnectInput ¶
func (*Filter) Parameters ¶
func (f *Filter) Parameters() FilterParams
type FilterMode ¶
type FilterMode string
const ( FilterModeLowPass FilterMode = "lowpass" FilterModeHighPass FilterMode = "highpass" FilterModeBandPass FilterMode = "bandpass" )
type FilterParams ¶
type FilterParams struct { Mode FilterMode Cutoff float64 Resonance float64 }
type FixedSustainEnvelope ¶
type FixedSustainEnvelope struct { *Envelope // contains filtered or unexported fields }
func NewFixedSustainEnvelope ¶
func NewFixedSustainEnvelope(ps EnvelopeParams, sustainDuration float64) *FixedSustainEnvelope
func (*FixedSustainEnvelope) Value ¶
func (e *FixedSustainEnvelope) Value(secs float64) float64
type InputOutputter ¶
type LFO ¶
type LFO struct {
// contains filtered or unexported fields
}
func NewLFO ¶
func NewLFO(typ StdOscillatorType, offset, amplitude, freq float64) *LFO
type LinearBuffer ¶
type LinearBuffer struct {
// contains filtered or unexported fields
}
func NewLinearBuffer ¶
func NewLinearBuffer(maxSize int) *LinearBuffer
func (*LinearBuffer) ChangeMaxSize ¶
func (b *LinearBuffer) ChangeMaxSize(n int)
func (*LinearBuffer) FirstValue ¶
func (b *LinearBuffer) FirstValue() float64
func (*LinearBuffer) IsEmpty ¶
func (b *LinearBuffer) IsEmpty() bool
func (*LinearBuffer) Push ¶
func (b *LinearBuffer) Push(v float64)
type OscillatorPool ¶
func NewOscillatorPool ¶
func NewOscillatorPool() *OscillatorPool
func (*OscillatorPool) ConnectInput ¶
func (a *OscillatorPool) ConnectInput(input string, op Outputter)
func (*OscillatorPool) Execute ¶
func (p *OscillatorPool) Execute(cmd Command)
func (*OscillatorPool) Inputs ¶
func (p *OscillatorPool) Inputs() []string
func (*OscillatorPool) Output ¶
func (a *OscillatorPool) Output(secs float64) float64
type Reverb ¶
type Reverb struct {
// contains filtered or unexported fields
}
func (*Reverb) ConnectInput ¶
type StdOscillator ¶
type StdOscillator struct { Params StdOscillatorParams FreqModInput Outputter Muted bool // contains filtered or unexported fields }
func NewStdOscillator ¶
func NewStdOscillator(typ StdOscillatorType, baseFreq float64, baseAmpl float64, overtones int) *StdOscillator
func (*StdOscillator) Activate ¶
func (o *StdOscillator) Activate()
func (*StdOscillator) ChangeAmpl ¶
func (o *StdOscillator) ChangeAmpl(ampl float64)
func (*StdOscillator) ChangeFreq ¶
func (o *StdOscillator) ChangeFreq(freq float64)
func (*StdOscillator) ChangeOvertones ¶
func (o *StdOscillator) ChangeOvertones(n int)
func (*StdOscillator) ChangeParameters ¶
func (o *StdOscillator) ChangeParameters(params StdOscillatorParams)
func (*StdOscillator) ChangeType ¶
func (o *StdOscillator) ChangeType(typ StdOscillatorType)
func (*StdOscillator) ConnectInput ¶
func (o *StdOscillator) ConnectInput(input string, op Outputter)
func (*StdOscillator) Deactivate ¶
func (o *StdOscillator) Deactivate()
func (*StdOscillator) Execute ¶
func (o *StdOscillator) Execute(cmd Command)
func (*StdOscillator) Inputs ¶
func (o *StdOscillator) Inputs() []string
func (*StdOscillator) IsMuted ¶
func (o *StdOscillator) IsMuted() bool
func (*StdOscillator) Mute ¶
func (o *StdOscillator) Mute()
func (*StdOscillator) Output ¶
func (o *StdOscillator) Output(secs float64) float64
func (*StdOscillator) Parameters ¶
func (o *StdOscillator) Parameters() StdOscillatorParams
func (*StdOscillator) Unmute ¶
func (o *StdOscillator) Unmute()
type StdOscillatorParams ¶
type StdOscillatorParams struct { Type StdOscillatorType Freq float64 Ampl float64 Overtones int }
type StdOscillatorType ¶
type StdOscillatorType string
const ( StdOscillatorSine StdOscillatorType = "sine" StdOscillatorSquare StdOscillatorType = "square" StdOscillatorSaw StdOscillatorType = "saw" StdOscillatorTriangle StdOscillatorType = "triangle" )
type Synthesizer ¶
type Synthesizer struct {
// contains filtered or unexported fields
}
func NewSynthesizer ¶
func NewSynthesizer(sampleRate int, outputter Outputter) *Synthesizer
func (*Synthesizer) Close ¶
func (s *Synthesizer) Close() error
func (*Synthesizer) Next ¶
func (s *Synthesizer) Next() float32
func (*Synthesizer) Open ¶
func (s *Synthesizer) Open() error
func (*Synthesizer) Start ¶
func (s *Synthesizer) Start() error
func (*Synthesizer) Stop ¶
func (s *Synthesizer) Stop() error
type WavOutputter ¶
type WavOutputter struct {
// contains filtered or unexported fields
}
func NewWavOutputter ¶
func NewWavOutputter(filePath string) (*WavOutputter, error)
func (*WavOutputter) Output ¶
func (o *WavOutputter) Output(secs float64) float64
sample-rate = 44100
Source Files ¶
Click to show internal directories.
Click to hide internal directories.