Documentation
¶
Index ¶
- Constants
- func PlayWav(filePath string) error
- func PlayWaveform(wave []int, sampleRate int) error
- type Settings
- func CopySettings(cfg *Settings) *Settings
- func New606(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
- func New707(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
- func New808(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
- func New909(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
- func NewDeepHouse(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
- func NewExperimental(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
- func NewLinnDrum(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
- func NewRandom() *Settings
- func NewSettings(startFreq, endFreq float64, sampleRate int, duration float64, bitDepth int, ...) (*Settings, error)
Constants ¶
View Source
const ( WaveSine = iota WaveTriangle WaveSawtooth WaveSquare WaveNoiseWhite WaveNoisePink WaveNoiseBrown )
View Source
const ( NoiseNone = iota NoiseWhite NoisePink NoiseBrown )
Variables ¶
This section is empty.
Functions ¶
func PlayWaveform ¶
PlayWaveform writes the waveform to a temporary .wav file and plays it using mpv or ffmpeg
Types ¶
type Settings ¶
type Settings struct {
StartFreq float64
EndFreq float64
SampleRate int
Duration float64
WaveformType int
Attack float64
Decay float64
Sustain float64
Release float64
Drive float64
FilterCutoff float64
FilterResonance float64
Sweep float64
PitchDecay float64
NoiseType int
NoiseAmount float64
Output io.WriteSeeker
NumOscillators int
OscillatorLevels []float64
SaturatorAmount float64
FilterBands []float64
BitDepth int
FadeDuration float64
SmoothFrequencyTransitions bool
}
func CopySettings ¶
CopySettings creates a deep copy of a Settings struct
func NewDeepHouse ¶
func NewDeepHouse(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
NewDeepHouse creates a kick drum perfect for Deep House music
func NewExperimental ¶
func NewExperimental(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
NewExperimental with more extreme parameters for a truly experimental sound
func NewLinnDrum ¶
func NewLinnDrum(sampleRate int, duration float64, bitDepth int, output io.WriteSeeker) (*Settings, error)
NewLinnDrum emulates the LinnDrum bass drum, known for its punchy and iconic sound
func NewSettings ¶
func (*Settings) Color ¶
Color returns a color that very approximately represents the current kick config
func (*Settings) GenerateKick ¶
func (*Settings) GenerateKickInMemory ¶
GenerateKickInMemory generates the kick waveform and returns it as a slice of integers.
Click to show internal directories.
Click to hide internal directories.