Versions in this module Expand all Collapse all v0 v0.0.1 Nov 7, 2026 Changes in this version + const BlockFrames + const DefaultVoices + const MaxLayers + const MaxSampleRate + const MaxUnison + const MinEnvelopeTime + const MinSampleRate + const StealFade + var DefaultReverb = Reverb + var FilterTypes = [...]string + type Envelope struct + Attack time.Duration + Decay time.Duration + Release time.Duration + Sustain float32 + type Filter struct + Cutoff float32 + Resonance float32 + Type FilterType + type FilterType uint8 + const BandPass + const HighPass + const LowPass + func (t FilterType) String() string + type Format uint8 + const FormatFloat32 + const FormatInt16 + type Glide struct + From float32 + Time time.Duration + type Patch struct + Detune float32 + Env Envelope + Filter Filter + Gain float32 + Glide Glide + Layers []float32 + PulseWidth float32 + Reverb float32 + Sample *Sample + Spread float32 + Unison int + Vibrato Vibrato + Wave Waveform + func PatchFromSpec(spec voice.InstrumentSpec, load SampleLoader) (Patch, error) + func (p *Patch) Validate() error + type Reverb struct + Damping float32 + Size float32 + Width float32 + type Sample struct + Data []float32 + Loop bool + LoopEnd int + LoopStart int + Rate int + Root float32 + type SampleLoader func(name string) (*Sample, error) + type Stream struct + func NewStream(cfg StreamConfig) (*Stream, error) + func (s *Stream) Format() Format + func (s *Stream) NoteOff(owner voice.Owner, inst voice.Instrument, note float32) + func (s *Stream) NoteOn(owner voice.Owner, inst voice.Instrument, note, velocity, pan float32) + func (s *Stream) Read(p []byte) (int, error) + func (s *Stream) Release(owner voice.Owner) + func (s *Stream) Render(left, right []float32) + func (s *Stream) SampleRate() int + func (s *Stream) SetGain(gain float32) + func (s *Stream) SetPatch(owner voice.Owner, inst voice.Instrument, p Patch) error + func (s *Stream) SetReverb(r Reverb) error + func (s *Stream) SetVoice(owner voice.Owner, v *voice.Voice, load SampleLoader) error + type StreamConfig struct + Format Format + SampleRate int + Voices int + type Vibrato struct + Delay time.Duration + Depth float32 + Rate float32 + type Waveform uint8 + const Noise + const Saw + const Sine + const Square + const Triangle + func (w Waveform) String() string