volume

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: Unlicense Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// VolumeUseInstVol tells the system to use the volume stored on the instrument
	// This is useful for trackers and other musical applications
	VolumeUseInstVol = Volume(math.Inf(-1))
)

Functions

This section is empty.

Types

type Int24

type Int24 struct {
	Hi int8
	Lo uint16
}

Int24 is an approximation of a 24-bit integer

type Matrix

type Matrix struct {
	StaticMatrix
	Channels int
}

Matrix is an array of Volumes

func (*Matrix) Accumulate added in v1.1.0

func (m *Matrix) Accumulate(in Matrix)

func (Matrix) Apply

func (m Matrix) Apply(vol Volume) Matrix

func (Matrix) ApplyToMatrix added in v1.1.0

func (m Matrix) ApplyToMatrix(mtx Matrix) Matrix

Apply takes a volume matrix and multiplies it by incoming volumes

func (Matrix) AsMono added in v1.1.0

func (m Matrix) AsMono() Matrix

func (Matrix) AsQuad added in v1.1.0

func (m Matrix) AsQuad() Matrix

func (Matrix) AsStereo added in v1.1.0

func (m Matrix) AsStereo() Matrix

func (*Matrix) Assign added in v1.1.0

func (m *Matrix) Assign(channels int, data []Volume)

func (Matrix) Get added in v1.1.0

func (m Matrix) Get(ch int) Volume

func (Matrix) Lerp added in v1.1.1

func (m Matrix) Lerp(other Matrix, t float32) Matrix

func (*Matrix) Set added in v1.1.0

func (m *Matrix) Set(ch int, vol Volume)

func (Matrix) Sum

func (m Matrix) Sum() Volume

Sum sums all the elements of the Matrix and returns the resulting Volume

func (Matrix) ToChannels added in v1.1.0

func (m Matrix) ToChannels(channels int) Matrix

type StaticMatrix added in v1.1.0

type StaticMatrix [4]Volume

StaticMatrix is an array of Volumes

type Volume

type Volume float32

Volume is a mixable volume

func (Volume) ApplyMultiple added in v1.1.0

func (v Volume) ApplyMultiple(samp []Volume) []Volume

Apply multiplies the volume to 1 sample, then returns the results

func (Volume) ApplySingle added in v1.1.0

func (v Volume) ApplySingle(samp Volume) Volume

Apply multiplies the volume to 1 sample, then returns the results

func (Volume) String added in v1.3.1

func (v Volume) String() string

func (Volume) ToIntSample

func (v Volume) ToIntSample(bitsPerSample int) int32

ToIntSample returns a volume as an int32 value ranged to the bits per sample provided

func (Volume) ToSample

func (v Volume) ToSample(bitsPerSample int) interface{}

ToSample returns a volume as a typed value supporting the bits per sample provided

func (Volume) ToUintSample added in v1.2.0

func (v Volume) ToUintSample(bitsPerSample int) uint32

ToUintSample returns a volume as a uint32 value ranged to the bits per sample provided

func (Volume) WithOverflowProtection added in v1.2.0

func (v Volume) WithOverflowProtection() float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL