Versions in this module Expand all Collapse all v0 v0.0.1 Nov 7, 2026 Changes in this version + const DefaultBPM + const DefaultBaseNote + const DefaultBeatVolume + const DefaultBreath + const DefaultDivision + const DefaultEndRest + const DefaultLength + const DefaultMotifVolume + const DefaultPauseRest + const DefaultSpeed + const DefaultVariation + const DefaultVelocity + const InstPercussion + const InstrumentCount + const MaxPercussion + var Filters = []string + var Waves = []string + func PercussionNames() []string + func PresetNames() []string + type BeatTrack struct + Pattern string + Sound string + type Category uint8 + const Fricative + const Plosive + const Sonorant + const Vowel + func (c Category) Instrument() Instrument + func (c Category) String() string + type Clock struct + BPM float32 + Phase time.Duration + type ComposeOptions struct + Clock *Clock + MuteBeat bool + type Contour uint8 + const ContourAccent + const ContourFall + const ContourNone + const ContourRise + func (c Contour) String() string + type Event struct + Kind EventKind + Line uint64 + type EventKind uint8 + const Completed + const Skipped + const Started + const Stopped + func (k EventKind) String() string + type FieldError struct + File string + Message string + Path string + func (e *FieldError) Error() string + type Instrument uint8 + const InstFricative + const InstMotif + const InstPlosive + const InstSonorant + const InstVowel + func (i Instrument) String() string + type InstrumentSpec struct + AttackMs float32 + Cutoff float32 + DecayMs float32 + Detune float32 + Filter string + Gain float32 + GlideFrom float32 + GlideMs float32 + Layers []float32 + Loop bool + LoopEnd int + LoopStart int + PulseWidth float32 + ReleaseMs float32 + Resonance float32 + Reverb float32 + Root float32 + Sample string + Spread float32 + Sustain float32 + Unison int + VibratoDelayMs float32 + VibratoDepth float32 + VibratoRate float32 + Wave string + type Language struct + func DefaultLanguage() *Language + func LoadLanguage(r io.Reader) (*Language, error) + func LoadLanguageFS(fsys fs.FS, name string) (*Language, error) + func (l *Language) Name() string + func (l *Language) Phonemes() []PhonemeDef + func (l *Language) Punctuation() []PunctuationDef + type Note struct + Instrument Instrument + Note float32 + Off time.Duration + On time.Duration + Pan float32 + Velocity float32 + type Owner uint16 + type Percussion struct + Name string + Note float32 + Spec InstrumentSpec + func BuiltinPercussion(name string) (Percussion, bool) + type Phoneme struct + Category Category + Clause bool + Contour Contour + End int + Kind TokenKind + Length float32 + Pitch float32 + Start int + Symbol string + Velocity float32 + func AppendParse(dst []Phoneme, lang *Language, text string) []Phoneme + func Parse(lang *Language, text string) []Phoneme + type PhonemeDef struct + Category Category + Length float32 + Pitch float32 + Symbol string + Velocity float32 + type PunctuationDef struct + Contour Contour + Pause float32 + Symbol string + type Rest uint8 + const RestBar + const RestBeat + const RestNone + const RestStep + func (r Rest) String() string + type Reveal struct + At time.Duration + Offset int + type Rhythm struct + Accents []float32 + BPM float32 + Beat []BeatTrack + BeatVolume float32 + CountIn int + Division int + EndRest Rest + PauseRest Rest + Swing float32 + type SayOptions struct + Clock *Clock + Instant bool + Language *Language + MuteBeat bool + Speed float32 + type Sink interface + NoteOff func(owner Owner, inst Instrument, note float32) + NoteOn func(owner Owner, inst Instrument, note float32, velocity float32, pan float32) + Release func(owner Owner) + type Speaker struct + func NewSpeaker(sink Sink, owner Owner) *Speaker + func (s *Speaker) Close() + func (s *Speaker) Done() bool + func (s *Speaker) Events() []Event + func (s *Speaker) Pause() + func (s *Speaker) Paused() bool + func (s *Speaker) Resume() + func (s *Speaker) Revealed() int + func (s *Speaker) Say(v *Voice, text string, opts SayOptions) + func (s *Speaker) Skip() + func (s *Speaker) Stop() + func (s *Speaker) Timeline() Timeline + func (s *Speaker) Update(dt time.Duration) + type Timeline struct + Duration time.Duration + Notes []Note + Reveals []Reveal + TextLen int + func Compose(v *Voice, text string, tokens []Phoneme) Timeline + func ComposeText(v *Voice, lang *Language, text string) Timeline + func ComposeWith(v *Voice, text string, tokens []Phoneme, opts ComposeOptions) Timeline + type TokenKind uint8 + const TokenPause + const TokenPhoneme + const TokenSkip + type UnknownPolicy uint8 + const UnknownFallback + const UnknownPause + const UnknownSkip + func (p UnknownPolicy) String() string + type Voice struct + BaseNote float32 + Breath float32 + Instruments [InstPercussion]InstrumentSpec + Language string + Length float32 + MotifVolume float32 + Name string + Pan float32 + Percussion []Percussion + Pitch float32 + Rhythm *Rhythm + Seed uint64 + Speed float32 + Variation float32 + Velocity float32 + func LoadVoice(r io.Reader) (*Voice, error) + func LoadVoiceFS(fsys fs.FS, name string) (*Voice, error) + func Preset(name string) (*Voice, error) + func (v *Voice) Validate() error