module

package
v0.0.0-...-c7366c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2025 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	Attack       Input   `yaml:"attack"`
	Decay        Input   `yaml:"decay"`
	Sustain      Input   `yaml:"sustain"`
	Release      Input   `yaml:"release"`
	Peak         Input   `yaml:"peak"`
	SustainLevel Input   `yaml:"sustain-level"`
	Delay        float64 `yaml:"delay"`
	BPM          Input   `yaml:"bpm"`
	// contains filtered or unexported fields
}

func (*Envelope) Initialize

func (e *Envelope) Initialize()

func (*Envelope) Next

func (e *Envelope) Next(t float64, modMap ModulesMap)

type Filter

type Filter struct {
	Name       string `yaml:"name"`
	LowCutoff  Input  `yaml:"low-cutoff"`
	HighCutoff Input  `yaml:"high-cutoff"`
	// contains filtered or unexported fields
}

func (*Filter) Initialize

func (f *Filter) Initialize(sampleRate float64)

func (*Filter) NextCoeffs

func (f *Filter) NextCoeffs(modMap ModulesMap)

func (*Filter) Tap

func (f *Filter) Tap(x2, x1, x0, y1, y0 float64) (y2 float64)

type FilterType

type FilterType string

type FiltersMap

type FiltersMap map[string]*Filter

type IModule

type IModule interface {
	Integral() float64
	Current() output
}

type Input

type Input struct {
	Val    float64  `yaml:"val"`
	Mod    []string `yaml:"mod"`
	ModAmp float64  `yaml:"mod-amp"`
}

type Module

type Module struct {
	// contains filtered or unexported fields
}

func (*Module) Current

func (m *Module) Current() output

func (*Module) Integral

func (m *Module) Integral() float64

type ModulesMap

type ModulesMap map[string]IModule

type Noise

type Noise struct {
	Module
	Name     string    `yaml:"name"`
	Amp      Input     `yaml:"amp"`
	Pan      Input     `yaml:"pan"`
	Filters  []string  `yaml:"filters"`
	Envelope *Envelope `yaml:"envelope"`
	// contains filtered or unexported fields
}

func (*Noise) Initialize

func (n *Noise) Initialize(sampleRate float64)

func (*Noise) Next

func (n *Noise) Next(t float64, modMap ModulesMap, filtersMap FiltersMap)

type Oscillator

type Oscillator struct {
	Module
	Name     string         `yaml:"name"`
	Type     OscillatorType `yaml:"type"`
	Freq     Input          `yaml:"freq"`
	Amp      Input          `yaml:"amp"`
	Phase    float64        `yaml:"phase"`
	Pan      Input          `yaml:"pan"`
	Filters  []string       `yaml:"filters"`
	Envelope *Envelope      `yaml:"envelope"`
	// contains filtered or unexported fields
}

func (*Oscillator) Initialize

func (o *Oscillator) Initialize(sampleRate float64) error

func (*Oscillator) Next

func (o *Oscillator) Next(t float64, modMap ModulesMap, filtersMap FiltersMap)

type OscillatorType

type OscillatorType string
const (
	Sawtooth        OscillatorType = "Sawtooth"
	ReverseSawtooth OscillatorType = "ReverseSawtooth"
	Sine            OscillatorType = "Sine"
	Square          OscillatorType = "Square"
	Triangle        OscillatorType = "Triangle"
)

func (OscillatorType) String

func (t OscillatorType) String() string

type Sampler

type Sampler struct {
	Module
	Name     string    `yaml:"name"`
	Amp      Input     `yaml:"amp"`
	Pan      Input     `yaml:"pan"`
	Freq     Input     `yaml:"freq"`
	Filters  []string  `yaml:"filters"`
	Inputs   []string  `yaml:"inputs"`
	Envelope *Envelope `yaml:"envelope"`
	// contains filtered or unexported fields
}

func (*Sampler) Initialize

func (s *Sampler) Initialize(sampleRate float64)

func (*Sampler) Next

func (s *Sampler) Next(t float64, modMap ModulesMap, filtersMap FiltersMap)

type Sequence

type Sequence struct {
	Module
	Amp       Input          `yaml:"amp"`
	Envelope  *Envelope      `yaml:"envelope"`
	Filters   []string       `yaml:"filters"`
	Name      string         `yaml:"name"`
	Pan       Input          `yaml:"pan"`
	Sequence  []string       `yaml:"sequence"`
	Transpose Input          `yaml:"transpose"`
	Pitch     float64        `yaml:"pitch"`
	Randomize bool           `yaml:"randomize"`
	Type      OscillatorType `yaml:"type"`
	// contains filtered or unexported fields
}

func (*Sequence) Initialize

func (s *Sequence) Initialize(sampleRate float64) error

func (*Sequence) Next

func (s *Sequence) Next(t float64, modMap ModulesMap, filtersMap FiltersMap)

type SignalFunc

type SignalFunc func(x float64) float64

func NoSignalFunc

func NoSignalFunc() SignalFunc

func ReverseSawtoothSignalFunc

func ReverseSawtoothSignalFunc() SignalFunc

func SawtoothSignalFunc

func SawtoothSignalFunc() SignalFunc

func SineSignalFunc

func SineSignalFunc() SignalFunc

func SquareSignalFunc

func SquareSignalFunc() SignalFunc

func TriangleSignalFunc

func TriangleSignalFunc() SignalFunc

type Wavetable

type Wavetable struct {
	Module
	Name     string    `yaml:"name"`
	Table    []float64 `yaml:"table"`
	Freq     Input     `yaml:"freq"`
	Amp      Input     `yaml:"amp"`
	Pan      Input     `yaml:"pan"`
	Filters  []string  `yaml:"filters"`
	Envelope *Envelope `yaml:"envelope"`
	// contains filtered or unexported fields
}

func (*Wavetable) Initialize

func (w *Wavetable) Initialize(sampleRate float64)

func (*Wavetable) Next

func (w *Wavetable) Next(t float64, modMap ModulesMap, filtersMap FiltersMap)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳