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 ¶
const ( Noise = MusicalNote("*") Silence = "-" Low = "L" )
Preset values that the MusicalNote can be. Other values should be musical notation. eg. "C4, D#4", etc.
const NoPianoKey = 0
NoPianoKey is pressed.
Variables ¶
This section is empty.
Functions ¶
func LookupDistortion ¶
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 Entry ¶
type Entry struct { // the (TV) time the change occurred Coords coords.TelevisionCoords // which channel the Registers field refers to Channel int Registers audio.Registers // description of the change. the Registers field by comparison contains the // numeric information of the audio change Distortion string MusicalNote MusicalNote PianoKey PianoKey Volume VolumeChange }
Entry represents a single change of audio for a channel
type History ¶ added in v0.22.0
type History struct { // list of tracker Entries. length is capped to maxTrackerEntries Entries []Entry // the most recent information for each channel. the entries do no need to // have happened at the same time. ie. Recent[0] might refer to an audio // change on frame 10 and Recent[1] on frame 20 Recent [2]Entry // contains filtered or unexported fields }
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, 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.
Black notes are negative values of the white note it is associated with.
type Television ¶ added in v0.32.0
type Television interface { GetCoords() coords.TelevisionCoords GetSpecID() string }
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, tv Television, rewind Rewind) *Tracker
NewTracker is the preferred method of initialisation for the Tracker type
func (*Tracker) BorrowTracker ¶ added in v0.22.0
BorrowTracker will lock the Tracker history for the duration of the supplied function, which will be exectued with the History structure as an argument.
Should not be called from the emulation goroutine.
func (*Tracker) Replay ¶ added in v0.22.0
func (tr *Tracker) Replay(start int, end int, mixer television.AudioMixer, onEnd func())
Replay audio from start to end indexes
The onEnd argument is a function to run when the replay has concluded
type VolumeChange ¶ added in v0.22.0
type VolumeChange int
VolumeChange indicates whether the volume of the channel is rising or falling or staying steady
const ( VolumeSteady VolumeChange = iota VolumeRising VolumeFalling )
List of values for the Volume type
func (VolumeChange) String ¶ added in v0.22.0
func (v VolumeChange) String() string