module

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package module provides byte and PCM helpers for native tracker formats.

Index

Constants

View Source
const MaxFileSize = 256 << 20
View Source
const MaxPCMValues int64 = 16 << 20

MaxPCMValues bounds decoded sample memory, including aliased file offsets.

Variables

This section is empty.

Functions

func Approach

func Approach(value, target, amount int) int

Approach moves toward target without overshooting.

func ApproachPeriod

func ApproachPeriod(value, target, amount float64) float64

ApproachPeriod is Approach for profiles with fractional periods.

func DecimalRow

func DecimalRow(value uint8) int

DecimalRow decodes a row number stored as two decimal nibbles.

func Emit

func Emit(ctx *tracker.TickContext, channel tracker.ChannelID, event synth.VoiceEvent) error

func Instrument

func Instrument[T audio.Sample](samples audio.Buffer[float64], rate int, loop, sustain *synth.SampleLoop, envelope synth.Envelope) (*synth.PCMInstrument[T, float64], error)

func Loop

func Loop(start, end, frames int64, pingPong bool) (*synth.SampleLoop, error)

func Name

func Name(data []byte) string

func Orders

func Orders(orders []uint8, patterns int) ([]int, error)

Orders resolves the S3M and IT skip and end markers. Each value is the index of a playable entry in the native order table.

func PCM

func PCM(data []byte, offset, frames int64, channels, width int, signed, delta, bigEndian bool) (audio.Buffer[float64], error)

PCM decodes planar integer samples into normalized PCM. Delta accumulators wrap at the source width and restart at each plane.

func Read

func Read(r io.Reader) ([]byte, error)

func Remember

func Remember(memory *uint8, param uint8)

Remember updates effect memory for a nonzero parameter.

func ReservePCM

func ReservePCM(remaining *int64, values int64) error

func ResolveOrder

func ResolveOrder(orders []int, native int) (int, bool)

ResolveOrder maps an S3M or IT jump target to the next playable order.

func SetSourceRate

func SetSourceRate(ctx *tracker.TickContext, channel tracker.ChannelID, sourceHz float64) error

SetSourceRate changes the sample step without moving the active cursor.

func SlideVolume

func SlideVolume(volume int, param uint8) int

SlideVolume applies the MOD/XM regular volume-slide nibbles.

func Span

func Span(data []byte, offset, size int64) ([]byte, error)

func Trigger

func Trigger(ctx *tracker.TickContext, channel tracker.ChannelID, instrument tracker.InstrumentID, sourceHz, gain, pan float64) error

func TriggerAtOffset

func TriggerAtOffset(ctx *tracker.TickContext, channel tracker.ChannelID, instrument tracker.InstrumentID, sourceHz, gain, pan float64, offset int64) error

func U16

func U16(data []byte) int

func U32

func U32(data []byte) int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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