volume

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Unlicense Imports: 1 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 []Volume

Matrix is an array of Volumes

func (Matrix) Apply

func (m Matrix) Apply(samp ...Volume) Matrix

Apply takes a volume matrix and multiplies it by incoming volumes

func (Matrix) ApplyInSitu

func (m Matrix) ApplyInSitu(samp ...Volume) Matrix

ApplyInSitu takes a volume matrix and multiplies it by incoming volumes

func (Matrix) Sum

func (m Matrix) Sum() Volume

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

type Volume

type Volume float32

Volume is a mixable volume

func (Volume) Apply

func (v Volume) Apply(samp ...Volume) Matrix

Apply multiplies the volume to 0..n samples, then returns an array of the results

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

Jump to

Keyboard shortcuts

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