gf1

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: 0 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 gf1 provides the fixed-point sample and mixer operations shared by tracker drivers that target the Gravis Ultrasound GF1.

Index

Constants

View Source
const (
	AddressFractionBits = 9
	AddressUnit         = 1 << AddressFractionBits
	AddressMask         = AddressUnit - 1

	// VoiceClock is the GF1 sample clock multiplied by its active voice count.
	VoiceClock = 44100 * 14
)

Variables

This section is empty.

Functions

func Attenuate

func Attenuate(sample, level, pan int) int

Attenuate applies the GF1's logarithmic volume and panning.

func Interpolate

func Interpolate(a, b int, address uint32) int

Interpolate combines adjacent signed samples at the address fraction.

func Normalize

func Normalize(value int) float32

Normalize clamps the integer accumulator before it is resampled.

Types

type StereoPan

type StereoPan struct {
	Left, Right int
}

StereoPan contains the attenuation for the left and right output.

func Pan

func Pan(register uint8) StereoPan

Pan returns the attenuation for a four-bit GF1 balance register.

Jump to

Keyboard shortcuts

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