tracker

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: GPL-3.0, GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Packate tracker implements the audio.Tracker interface and can be used to record changes in the state of the TIA audio.

Also contains functions that can convert register values into meaningful descriptions.

Index

Constants

View Source
const (
	Noise   = MusicalNote("*")
	Silence = "-"
	Low     = "L"
)

Preset values that the MusicalNote can be. Other values should be musical notation. eg. "C4, D#4", etc.

View Source
const NoPianoKey = 0

NoPianoKey is pressed.

Variables

This section is empty.

Functions

func LookupDistortion

func LookupDistortion(reg audio.Registers) string

LookupDistortion converts the control register value into a text description.

Descriptions taken from Random Terrain's "The Atari 2600 Music and Sound Page"

https://www.randomterrain.com/atari-2600-memories-music-and-sound.html

Types

type Emulation added in v0.19.3

type Emulation interface {
	State() govern.State
	TV() *television.Television
}

Emulation defines as much of the emulation we require access to.

type Entry

type Entry struct {
	Coords    coords.TelevisionCoords
	Channel   int
	Registers audio.Registers

	Distortion  string
	MusicalNote MusicalNote
	PianoKey    PianoKey
}

type MusicalNote

type MusicalNote string

MusicalNote defines the musical note (C#, D, D#, etc.) of an TIA audio channel register group.

func LookupMusicalNote

func LookupMusicalNote(tv *television.Television, reg audio.Registers) MusicalNote

LookupMusicalNote converts the current register values for a channel into a musical note.

Descriptions taken from Random Terrain's "The Atari 2600 Music and Sound Page"

https://www.randomterrain.com/atari-2600-memories-music-and-sound.html

type PianoKey

type PianoKey int

PianoKey is the key number on a piano keyboard.

func NoteToPianoKey

func NoteToPianoKey(note MusicalNote) PianoKey

NoteToPianoKey converts the musical note to the corresponding piano key.

Handle sharps but not flats.

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

Tracker implements the audio.Tracker interface and keeps a history of the audio registers over time.

func NewTracker

func NewTracker(emulation Emulation) *Tracker

NewTracker is the preferred method of initialisation for the Tracker type.

func (*Tracker) Copy

func (tr *Tracker) Copy() []Entry

Copy makes a copy of the Tracker entries.

func (*Tracker) GetLast

func (tr *Tracker) GetLast(channel int) Entry

GetLast entry for channel.

func (*Tracker) Reset

func (tr *Tracker) Reset()

Reset removes all entries from tracker list.

func (*Tracker) Tick

func (tr *Tracker) Tick(channel int, reg audio.Registers)

Tick implements the audio.Tracker interface

Jump to

Keyboard shortcuts

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