sampling

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: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pos

type Pos struct {
	Pos  int
	Frac float32
}

Pos stores the integer and fractional portions of a position within a sample

func (*Pos) Add

func (p *Pos) Add(amt float32)

Add increments the internal position values by the specified amount

type SampleStream

type SampleStream interface {
	GetSample(Pos) volume.Matrix
}

SampleStream is an interface to a sample stream (aka: an instrument)

type Sampler

type Sampler interface {
	GetPosition() Pos
	Advance()
	GetSample() volume.Matrix
}

Sampler is an interface to the sampling system

func NewSampler

func NewSampler(ss SampleStream, pos Pos, period float32) Sampler

NewSampler creates a basic sampler that implements the Sampler interface

Jump to

Keyboard shortcuts

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