Documentation ¶
Overview ¶
Package module provides built-in modules
Index ¶
- Constants
- Variables
- func Register(name string, fn func(Config) (Patcher, error))
- func RegisteredTypes() []string
- type BeatsPerMin
- type Buffer
- type Config
- type Frame
- type Hz
- type IO
- func (io *IO) AddInput(in *In) error
- func (io *IO) AddOutput(out *Out) error
- func (io *IO) Close() error
- func (io *IO) Expose(name string, ins []*In, outs []*Out) error
- func (io *IO) ID() string
- func (io *IO) Inputs() map[string]*In
- func (io *IO) Output(name string) (*Out, error)
- func (io *IO) Outputs() map[string]*Out
- func (io *IO) OutputsActive(sinking bool) int
- func (io *IO) Patch(name string, t interface{}) error
- func (io *IO) Reset() error
- func (io *IO) ResetOnly(names []string) error
- func (io *IO) String() string
- type In
- type InitFunc
- type LuaMethod
- type MS
- type Out
- type Patcher
- type Pitch
- type Port
- type Reader
- type ReaderProvider
- type ReaderProviderFunc
- type SourceSetter
- type Value
- type Valuer
Constants ¶
const (
// SampleRate is the numebr of samples computed every second
SampleRate = 44100.0
)
Variables ¶
var FrameSize = 256
FrameSize is the number of samples computed during every callback
var Registry = map[string]InitFunc{}
Registry contains initializers for all known synthesizer modules
Functions ¶
func RegisteredTypes ¶
func RegisteredTypes() []string
RegisteredTypes returns a list of all registered module types
Types ¶
type BeatsPerMin ¶ added in v0.0.11
BeatsPerMin represents beats-per-minute
func BPM ¶ added in v0.0.11
func BPM(v float64) BeatsPerMin
BPM returns a scalar value in beats-per-minute
func (BeatsPerMin) Read ¶ added in v0.0.11
func (bpm BeatsPerMin) Read(out Frame)
Read reads the BPM real value to a Frame
func (BeatsPerMin) String ¶ added in v0.0.11
func (bpm BeatsPerMin) String() string
type Buffer ¶
Buffer is a buffered source. Every read Frame is stored
type Config ¶
type Config map[string]interface{}
Config is the conduit for providing initialization information to a module
type IO ¶
type IO struct {
// contains filtered or unexported fields
}
IO is the input/output registry of a module. It manages the lifecycles of the ports; fascilitating connects and disconnects between them. This struct lazy initializes so it is useful by default. It is intended to just be embedded inside other structs that represent a module.
func (*IO) AddInput ¶ added in v0.0.12
AddInput registers a new input with the module. This is primarily used to allow for lazy-creation of inputs when patched instead of at the module's create-time.
func (*IO) AddOutput ¶ added in v0.0.12
AddOutput registers a new output with the module. Like AddInput, it is used for lazy-creation of outputs.
func (*IO) Expose ¶
Expose registers inputs and outputs of the module so that they can be used in patching
func (*IO) OutputsActive ¶
OutputsActive returns the total count of actively patched outputs
func (*IO) Reset ¶
Reset disconnects all inputs from their sources (closing them in the process) and re-assigns the input to its original default value
type In ¶
type In struct { Source Reader Name string ForceSinking bool // contains filtered or unexported fields }
In is a module input
func (*In) IsSinking ¶ added in v0.0.11
IsSinking returns whether the input is sinking to audio output
func (*In) SourceName ¶ added in v0.0.8
SourceName returns the name of the connected output
type MS ¶
MS is a value representation of milliseconds
func DurationInt ¶ added in v0.0.3
DurationInt returns a scalar value (int) in MS
type Out ¶
type Out struct { Name string Provider ReaderProvider // contains filtered or unexported fields }
Out is a module output
func (*Out) DestinationName ¶ added in v0.0.8
DestinationName returns the name of the destination input
type Patcher ¶
type Patcher interface { ID() string Patch(string, interface{}) error Output(string) (*Out, error) Reset() error ResetOnly([]string) error Close() error }
Patcher is the patching behavior of a module
type Pitch ¶
Pitch is a pitch that has been expressed in scientific notation
func ParsePitch ¶
ParsePitch parses the scientific notation of a pitch
type Reader ¶
type Reader interface {
Read(Frame)
}
Reader is the interface that wraps reading to Frames.
type ReaderProvider ¶
type ReaderProvider interface {
Reader() Reader
}
ReaderProvider allows for delayed retrieval of Readers. This is typically used in outputs where the output should only be created when requested in a patch.
func Provide ¶
func Provide(r Reader) ReaderProvider
Provide is a helper function that creates a ReaderProvider with a directly given Reader
type ReaderProviderFunc ¶
type ReaderProviderFunc func() Reader
ReaderProviderFunc is a function that acts as as ReaderProvider
func (ReaderProviderFunc) Reader ¶
func (fn ReaderProviderFunc) Reader() Reader
Reader yields the new Reader
type SourceSetter ¶
type SourceSetter interface {
SetSource(Reader)
}
SourceSetter is something that can set its source
type Valuer ¶
type Valuer interface {
Value() Value
}
Valuer is the wrapper interface around the Value method; which is used in obtaining the constant value
func ParseValueString ¶
ParseValueString parses string representations of integers, floats and Pitches
Source Files ¶
- adsr.go
- binary.go
- chance_gate.go
- clip.go
- clock.go
- comb.go
- compress.go
- concurrent.go
- control.go
- count.go
- crossfade.go
- crossfeed.go
- dc_block.go
- debug.go
- delay.go
- direct.go
- distort.go
- edges.go
- expression.go
- file_source.go
- filter.go
- filtered_reverb.go
- fold.go
- follow.go
- gate_mix.go
- gate_sequencer.go
- glide.go
- interpolate.go
- invert.go
- io.go
- lpg.go
- mix.go
- multi_out_io.go
- multiple.go
- mux.go
- noise.go
- note_quantize.go
- oscillator.go
- pan.go
- quantize.go
- random_series.go
- reader.go
- registry.go
- reverb.go
- sample_hold.go
- shape.go
- soft_clip.go
- stage_sequencer.go
- step_sequencer.go
- switch.go
- tap.go
- tape.go
- tape_markers.go
- template.go
- tempo_detect.go
- toggle.go
- track_hold.go
- unary.go
- util.go
- values.go
- variable_random_series.go
- wavetable.go
- wrap.go