Documentation
¶
Overview ¶
Package module provides byte and PCM helpers for native tracker formats.
Index ¶
- Constants
- func Approach(value, target, amount int) int
- func ApproachPeriod(value, target, amount float64) float64
- func DecimalRow(value uint8) int
- func Emit(ctx *tracker.TickContext, channel tracker.ChannelID, event synth.VoiceEvent) error
- func Instrument[T audio.Sample](samples audio.Buffer[float64], rate int, loop, sustain *synth.SampleLoop, ...) (*synth.PCMInstrument[T, float64], error)
- func Loop(start, end, frames int64, pingPong bool) (*synth.SampleLoop, error)
- func Name(data []byte) string
- func Orders(orders []uint8, patterns int) ([]int, error)
- func PCM(data []byte, offset, frames int64, channels, width int, ...) (audio.Buffer[float64], error)
- func Read(r io.Reader) ([]byte, error)
- func Remember(memory *uint8, param uint8)
- func ReservePCM(remaining *int64, values int64) error
- func ResolveOrder(orders []int, native int) (int, bool)
- func SetSourceRate(ctx *tracker.TickContext, channel tracker.ChannelID, sourceHz float64) error
- func SlideVolume(volume int, param uint8) int
- func Span(data []byte, offset, size int64) ([]byte, error)
- func Trigger(ctx *tracker.TickContext, channel tracker.ChannelID, ...) error
- func TriggerAtOffset(ctx *tracker.TickContext, channel tracker.ChannelID, ...) error
- func U16(data []byte) int
- func U32(data []byte) int64
Constants ¶
const MaxFileSize = 256 << 20
const MaxPCMValues int64 = 16 << 20
MaxPCMValues bounds decoded sample memory, including aliased file offsets.
Variables ¶
This section is empty.
Functions ¶
func ApproachPeriod ¶
ApproachPeriod is Approach for profiles with fractional periods.
func DecimalRow ¶
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 Orders ¶
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 ReservePCM ¶
func ResolveOrder ¶
ResolveOrder maps an S3M or IT jump target to the next playable order.
func SetSourceRate ¶
SetSourceRate changes the sample step without moving the active cursor.
func SlideVolume ¶
SlideVolume applies the MOD/XM regular volume-slide nibbles.
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
Types ¶
This section is empty.