Documentation
¶
Index ¶
Constants ¶
View Source
const ( Attack = iota Decay Sustain Release Playmode Portamendo )
ADSR parameters
Variables ¶
View Source
var ( AllowedADSR = [][]int{ Range(64, 16320, 512), Range(64, 16320, 512), Range(0, 32767, 512), Range(64, 16320, 512), []int{2048, 5120, 11264, 14336}, []int{64, 192, 6140}, } AllowedOctave = []int{-2, 1, 0, 1, 2} // Octave ranges from -2 to +2 AllowedEngine = []Setting{ Setting{ Name: "cluster", Parameters: [][]int{ Range(3072, 17408, 128), Range(0, 32767, 128), Range(512, 24064, 128), Range(3, 1638, 128), }, }, Setting{ Name: "digital", Parameters: [][]int{ Range(0, 32767, 128), Range(2048, 26624, 128), Range(-32768, 32767, 128), Range(0, 32767, 128), }, }, Setting{ Name: "dna", Parameters: [][]int{ Range(-29491, 32767, 128), Range(4608, 12800, 128), Range(0, 32767, 128), Range(0, 32767, 128), }, }, Setting{ Name: "drwave", Parameters: [][]int{ Range(0, 32767, 128), Range(0, 32767, 128), Range(0, 32767, 128), Range(0, 32767, 128), Range(32000, 32000, 128), }, }, } AllowedEffects = []Setting{ Setting{ Name: "nitro", Parameters: [][]int{ Range(64, 16448, 128), Range(-32768, 32768, 512), Range(0, 20643, 128), Range(64, 16448, 128), }, }, Setting{ Name: "cwo", Parameters: [][]int{ Range(0, 32767, 128), Range(0, 32767, 128), Range(0, 32767, 128), Range(0, 32767, 128), }, }, Setting{ Name: "delay", Parameters: [][]int{ Range(1024, 11264, 128), Range(3276, 32767, 128), Range(0, 16384, 128), Range(0, 32767, 128), }, }, Setting{ Name: "grid", Parameters: [][]int{ Range(1344, 16704, 128), Range(1344, 16704, 128), Range(0, 32767, 128), Range(0, 32767, 128), Range(8000, 8000, 128), Range(8000, 8000, 128), Range(8000, 8000, 128), Range(8000, 8000, 128), }, }, } AllowedLFO = []Setting{ Setting{ Name: "element", Parameters: [][]int{ []int{7168, 5056, 5280, 2000, 2144}, Range(-32767, 32767, 512), []int{1024, 2000, 2448, 5056, 7168}, []int{1024, 2000, 5056, 5824, 10526, 15360}, }, }, Setting{ Name: "tremelo", Parameters: [][]int{ Range(16400, 32440, 512), Range(-32767, 32767, 512), Range(-32767, 32767, 512), }, }, } )
specified allowed values for parameters
View Source
var MAXENDPOINT = int64(2147483646)
2147483646 = max value found in the sample end points
View Source
var SAMPLECONVERSION = int64(4058)
2147483646/(44100*12) ~ 4058
View Source
var SAMPLERATE = int64(44100)
Functions ¶
Types ¶
type DrumPatch ¶
type DrumPatch struct { DrumVersion int `json:"drum_version"` DynaEnv []int64 `json:"dyna_env"` End []int64 `json:"end"` FxActive bool `json:"fx_active"` FxParams []int64 `json:"fx_params"` FxType string `json:"fx_type"` LfoActive bool `json:"lfo_active"` LfoParams []int64 `json:"lfo_params"` LfoType string `json:"lfo_type"` Name string `json:"name"` Octave int64 `json:"octave"` Pitch []int64 `json:"pitch"` Playmode []int64 `json:"playmode"` Reverse []int64 `json:"reverse"` Start []int64 `json:"start"` Type string `json:"type"` Volume []int64 `json:"volume"` }
DrumPatch is a list of custom fields sometimes set by OP-1
func NewDrumPatch ¶ added in v1.0.0
func NewDrumPatch() DrumPatch
NewDrumPatch returns a new DrumPatch with correct defaults
type SynthPatch ¶ added in v1.0.0
type SynthPatch struct { Adsr [8]int `json:"adsr"` FxActive bool `json:"fx_active"` FxParams [8]int `json:"fx_params"` FxType string `json:"fx_type"` Knobs [8]int `json:"knobs"` LfoActive bool `json:"lfo_active"` LfoParams [8]int `json:"lfo_params"` LfoType string `json:"lfo_type"` Name string `json:"name"` Octave int `json:"octave"` SynthVersion int `json:"synth_version"` Type string `json:"type"` BaseFreq float64 `json:"base_freq,omitempty"` }
func NewSynthPatch ¶ added in v1.0.0
func NewSynthPatch() (sd SynthPatch)
func NewSynthSamplePatch ¶ added in v1.0.0
func NewSynthSamplePatch(freq ...float64) (sd SynthPatch)
func RandomSynthPatch ¶ added in v1.0.0
func RandomSynthPatch(seed ...int64) (sd SynthPatch)
func ReadSynthPatch ¶ added in v1.0.0
func ReadSynthPatch(fname string) (sp SynthPatch, err error)
func (SynthPatch) Check ¶ added in v1.0.0
func (s SynthPatch) Check() (err error)
Check will return an error if any of the values are out of range
func (SynthPatch) Encode ¶ added in v1.0.0
func (s SynthPatch) Encode() (encoded string)
func (SynthPatch) SaveSample ¶ added in v1.0.0
func (s SynthPatch) SaveSample(fname string, fnameout string, trimSilence bool) (err error)
Build a synth patch from a file
Click to show internal directories.
Click to hide internal directories.