Documentation
¶
Index ¶
- func ParseDuration(d interface{}, bpm float64) (float64, error)
- type Channel
- type ChannelDef
- type ChannelFX
- type ChannelGrain
- type ChannelsDef
- type FX
- type GrainOption
- type MonophonicChannel
- func (c *MonophonicChannel) GetSamples(cfg *audio.AudioConfig, n int) []float64
- func (c *MonophonicChannel) NoteOff(note int)
- func (c *MonophonicChannel) NoteOn(note int, velocity float64)
- func (c *MonophonicChannel) SetFX(fx FX, value float64)
- func (c *MonophonicChannel) SetGrainOption(opt GrainOption, value interface{})
- func (c *MonophonicChannel) SetInstrument(g func() generators.Generator)
- func (c *MonophonicChannel) SetPitchbend(pitchbendFactor float64)
- type PercussionChannel
- func (c *PercussionChannel) GetSamples(cfg *audio.AudioConfig, n int) []float64
- func (c *PercussionChannel) LoadInstrumentsFromBank(cfg *audio.AudioConfig)
- func (c *PercussionChannel) NoteOff(note int)
- func (c *PercussionChannel) NoteOn(note int, velocity float64)
- func (c *PercussionChannel) SetFX(fx FX, value float64)
- func (c *PercussionChannel) SetGrainOption(opt GrainOption, value interface{})
- func (c *PercussionChannel) SetInstrument(g func() generators.Generator)
- func (c *PercussionChannel) SetPitchbend(f float64)
- type PolyphonicChannel
- func (c *PolyphonicChannel) GetSamples(cfg *audio.AudioConfig, n int) []float64
- func (c *PolyphonicChannel) NoteOff(note int)
- func (c *PolyphonicChannel) NoteOn(note int, velocity float64)
- func (c *PolyphonicChannel) SetFX(fx FX, value float64)
- func (c *PolyphonicChannel) SetGrainOption(opt GrainOption, value interface{})
- func (c *PolyphonicChannel) SetInstrument(g func() generators.Generator)
- func (c *PolyphonicChannel) SetPitchbend(pitchbendFactor float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseDuration ¶
Types ¶
type Channel ¶
type Channel interface { NoteOn(note int, velocity float64) NoteOff(note int) SetPitchbend(pitchbendFactor float64) SetFX(fx FX, value float64) SetGrainOption(opt GrainOption, value interface{}) SetInstrument(func() generators.Generator) GetSamples(cfg *audio.AudioConfig, n int) []float64 }
type ChannelDef ¶
type ChannelDef struct { Channel int `json:"channel,omitempty" yaml:"channel,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Instrument int `json:"instrument,omitempty" yaml:"instrument,omitempty"` Bank int `json:"bank,omitempty" yaml:"bank,omitempty"` Reverb int `json:"reverb,omitempty" yaml:"reverb,omitempty"` ReverbTime interface{} `json:"reverb_time,omitempty" yaml:"reverb_time,omitempty"` ReverbFeedback float64 `json:"reverb_feedback,omitempty" yaml:"reverb_feedback,omitempty"` Tremelo int `json:"tremelo,omitempty" yaml:"tremelo,omitempty"` Volume int `json:"volume,omitempty" yaml:"volume,omitempty"` Panning int `json:"panning,omitempty" yaml:"panning,omitempty"` LPF_Cutoff int `json:"lpf_cutoff,omitempty" yaml:"lpf_cutoff,omitempty"` HPF_Cutoff int `json:"hpf_cutoff,omitempty" yaml:"hpf_cutoff,omitempty"` Grain *instruments.GrainsOptionsDef `json:"grain,omitempty" yaml:"grain,omitempty"` Generator *instruments.GeneratorDef `json:"generator,omitempty" yaml:"generator,omitempty"` }
type ChannelFX ¶
type ChannelFX struct { Tremelo float64 // supported Reverb float64 // fake supported (through delayfilter) ReverbTime float64 ReverbFeedback float64 LPF_Cutoff float64 HPF_Cutoff float64 Chorus float64 // not supported Phaser float64 // not supported CachedFilter filters.Filter // contains filtered or unexported fields }
func NewChannelFX ¶
func NewChannelFX() *ChannelFX
type ChannelGrain ¶
type ChannelGrain struct { File string GrainSize float64 BirthRate float64 Density int Spread float64 Speed float64 RandomPosition float64 Gain float64 Repeat bool On bool CachedGenerator generators.Generator }
func NewChannelGrain ¶
func NewChannelGrain() *ChannelGrain
func (*ChannelGrain) Generator ¶
func (f *ChannelGrain) Generator(cfg *audio.AudioConfig) (generators.Generator, error)
func (*ChannelGrain) Set ¶
func (f *ChannelGrain) Set(opt GrainOption, value interface{})
type ChannelsDef ¶
type ChannelsDef struct {
Channels []*ChannelDef `json:"channels" yaml:"channels"`
}
type GrainOption ¶
type GrainOption int
const ( GrainFile GrainOption = iota GrainGain GrainOption = iota GrainSize GrainOption = iota GrainBirthRate GrainOption = iota GrainDensity GrainOption = iota GrainSpread GrainOption = iota GrainSpeed GrainOption = iota GrainRepeat GrainOption = iota )
type MonophonicChannel ¶
type MonophonicChannel struct {
Instrument generators.Generator
}
func NewMonophonicChannel ¶
func NewMonophonicChannel(g generators.Generator) *MonophonicChannel
func (*MonophonicChannel) GetSamples ¶
func (c *MonophonicChannel) GetSamples(cfg *audio.AudioConfig, n int) []float64
func (*MonophonicChannel) NoteOff ¶
func (c *MonophonicChannel) NoteOff(note int)
func (*MonophonicChannel) NoteOn ¶
func (c *MonophonicChannel) NoteOn(note int, velocity float64)
func (*MonophonicChannel) SetFX ¶
func (c *MonophonicChannel) SetFX(fx FX, value float64)
func (*MonophonicChannel) SetGrainOption ¶
func (c *MonophonicChannel) SetGrainOption(opt GrainOption, value interface{})
func (*MonophonicChannel) SetInstrument ¶
func (c *MonophonicChannel) SetInstrument(g func() generators.Generator)
func (*MonophonicChannel) SetPitchbend ¶
func (c *MonophonicChannel) SetPitchbend(pitchbendFactor float64)
type PercussionChannel ¶
type PercussionChannel struct { On *sync.Map Instruments []generators.Generator FX ChannelFX }
func NewPercussionChannel ¶
func NewPercussionChannel() *PercussionChannel
func (*PercussionChannel) GetSamples ¶
func (c *PercussionChannel) GetSamples(cfg *audio.AudioConfig, n int) []float64
func (*PercussionChannel) LoadInstrumentsFromBank ¶
func (c *PercussionChannel) LoadInstrumentsFromBank(cfg *audio.AudioConfig)
func (*PercussionChannel) NoteOff ¶
func (c *PercussionChannel) NoteOff(note int)
func (*PercussionChannel) NoteOn ¶
func (c *PercussionChannel) NoteOn(note int, velocity float64)
func (*PercussionChannel) SetFX ¶
func (c *PercussionChannel) SetFX(fx FX, value float64)
func (*PercussionChannel) SetGrainOption ¶
func (c *PercussionChannel) SetGrainOption(opt GrainOption, value interface{})
func (*PercussionChannel) SetInstrument ¶
func (c *PercussionChannel) SetInstrument(g func() generators.Generator)
func (*PercussionChannel) SetPitchbend ¶
func (c *PercussionChannel) SetPitchbend(f float64)
type PolyphonicChannel ¶
type PolyphonicChannel struct { Instruments []generators.Generator On *sync.Map FX ChannelFX Grain *ChannelGrain }
func NewPolyphonicChannel ¶
func NewPolyphonicChannel() *PolyphonicChannel
func (*PolyphonicChannel) GetSamples ¶
func (c *PolyphonicChannel) GetSamples(cfg *audio.AudioConfig, n int) []float64
func (*PolyphonicChannel) NoteOff ¶
func (c *PolyphonicChannel) NoteOff(note int)
func (*PolyphonicChannel) NoteOn ¶
func (c *PolyphonicChannel) NoteOn(note int, velocity float64)
func (*PolyphonicChannel) SetFX ¶
func (c *PolyphonicChannel) SetFX(fx FX, value float64)
func (*PolyphonicChannel) SetGrainOption ¶
func (c *PolyphonicChannel) SetGrainOption(opt GrainOption, value interface{})
func (*PolyphonicChannel) SetInstrument ¶
func (c *PolyphonicChannel) SetInstrument(g func() generators.Generator)
func (*PolyphonicChannel) SetPitchbend ¶
func (c *PolyphonicChannel) SetPitchbend(pitchbendFactor float64)
Click to show internal directories.
Click to hide internal directories.