it

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: Unlicense Imports: 6 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// IMPMFlagStereo :: On = Stereo, Off = Mono (panning enablement flag)
	IMPMFlagStereo = IMPMFlags(1 << 0)
	// IMPMFlagVol0Optimizations :: If on, no mixing occurs if the volume at mixing time is 0 (redundant v1.04+)
	IMPMFlagVol0Optimizations = IMPMFlags(1 << 1)
	// IMPMFlagUseInstruments :: On = Use instruments, Off = Use samples
	IMPMFlagUseInstruments = IMPMFlags(1 << 2)
	// IMPMFlagLinearSlides :: On = Linear slides, Off = Amiga slides
	IMPMFlagLinearSlides = IMPMFlags(1 << 3)
	// IMPMFlagOldEffects :: On = Old Effects, Off = IT Effects
	IMPMFlagOldEffects = IMPMFlags(1 << 4)
	// IMPMFlagEFGLinking :: On = Link Effect G's memory with Effect E/F
	IMPMFlagEFGLinking = IMPMFlags(1 << 5)
	// IMPMFlagMidiPitchController :: Use MIDI pitch controller, Pitch depth given by PitchWheelDepth
	IMPMFlagMidiPitchController = IMPMFlags(1 << 6)
	// IMPMFlagReqEmbedMidi :: Request embedded MIDI configuration
	IMPMFlagReqEmbedMidi = IMPMFlags(1 << 7)
)
View Source
const (
	// IMPMSpecialFlagMessageAttached :: On = song message attached
	IMPMSpecialFlagMessageAttached = IMPMSpecialFlags(1 << 0)
	// IMPMSpecialFlagHistoryIncluded :: On = history data included (maybe)
	IMPMSpecialFlagHistoryIncluded = IMPMSpecialFlags(1 << 1)
	// IMPMSpecialFlagHighlightDataIncluded :: On = highlight data included
	IMPMSpecialFlagHighlightDataIncluded = IMPMSpecialFlags(1 << 2)
	// IMPMSpecialFlagEmbedMidi :: MIDI configuration embedded
	IMPMSpecialFlagEmbedMidi = IMPMSpecialFlags(1 << 3)
	// IMPMSpecialFlagReservedBit4 :: Reserved
	IMPMSpecialFlagReservedBit4 = IMPMSpecialFlags(1 << 4)
	// IMPMSpecialFlagReservedBit5 :: Reserved
	IMPMSpecialFlagReservedBit5 = IMPMSpecialFlags(1 << 5)
	// IMPMSpecialFlagReservedBit6 :: Reserved
	IMPMSpecialFlagReservedBit6 = IMPMSpecialFlags(1 << 6)
	// IMPMSpecialFlagReservedBit7 :: Reserved
	IMPMSpecialFlagReservedBit7 = IMPMSpecialFlags(1 << 7)
	// IMPMSpecialFlagReservedBit8 :: Reserved
	IMPMSpecialFlagReservedBit8 = IMPMSpecialFlags(1 << 8)
	// IMPMSpecialFlagReservedBit9 :: Reserved
	IMPMSpecialFlagReservedBit9 = IMPMSpecialFlags(1 << 9)
	// IMPMSpecialFlagReservedBit10 :: Reserved
	IMPMSpecialFlagReservedBit10 = IMPMSpecialFlags(1 << 10)
	// IMPMSpecialFlagReservedBit11 :: Reserved
	IMPMSpecialFlagReservedBit11 = IMPMSpecialFlags(1 << 11)
	// IMPMSpecialFlagReservedBit12 :: Reserved
	IMPMSpecialFlagReservedBit12 = IMPMSpecialFlags(1 << 12)
	// IMPMSpecialFlagReservedBit13 :: Reserved
	IMPMSpecialFlagReservedBit13 = IMPMSpecialFlags(1 << 13)
	// IMPMSpecialFlagReservedBit14 :: Reserved
	IMPMSpecialFlagReservedBit14 = IMPMSpecialFlags(1 << 14)
	// IMPMSpecialFlagReservedBit15 :: Reserved
	IMPMSpecialFlagReservedBit15 = IMPMSpecialFlags(1 << 15)
)
View Source
const (
	// SampleFlagSampleExists :: On = sample associated with header
	SampleFlagSampleExists = SampleFlags(1 << 0)
	// SampleFlag16Bit :: On = 16 bit, Off = 8 bit
	SampleFlag16Bit = SampleFlags(1 << 1)
	// SampleFlagStereo :: On = stereo, Off = mono
	SampleFlagStereo = SampleFlags(1 << 2)
	// SampleFlagCompressed :: On = compressed samples
	SampleFlagCompressed = SampleFlags(1 << 3)
	// SampleFlagUseLoop :: On = Use loop
	SampleFlagUseLoop = SampleFlags(1 << 4)
	// SampleFlagUseSustainLoop :: On = Use sustain loop
	SampleFlagUseSustainLoop = SampleFlags(1 << 5)
	// SampleFlagPingPongLoop :: On = Ping Pong loop, Off = Forwards loop
	SampleFlagPingPongLoop = SampleFlags(1 << 6)
	// SampleFlagPingPongSustainLoop :: On = Ping Pong Sustain loop, Off = Forwards Sustain loop
	SampleFlagPingPongSustainLoop = SampleFlags(1 << 7)
)
View Source
const (
	// ConvertFlagSignedSamples :: On = Samples are signed. Off = Samples are unsigned
	ConvertFlagSignedSamples = ConvertFlags(1 << 0)
	// ConvertFlagBigEndian :: On = 16 bit big endian, Off = 16 bit little endian
	ConvertFlagBigEndian = ConvertFlags(1 << 1)
	// ConvertFlagSampleDelta :: On = stored as delta values, Off = stored as PCM values
	ConvertFlagSampleDelta = ConvertFlags(1 << 2)
	// ConvertFlagByteDelta :: On = stored as byte delta values
	ConvertFlagByteDelta = ConvertFlags(1 << 3)
	// ConvertFlagTXWave12Bit :: On = stored as TX-Wave 12-bit values
	ConvertFlagTXWave12Bit = ConvertFlags(1 << 4)
	// ConvertFlagChannelSelectionPrompt :: On = Left/Right/All Stereo prompt
	ConvertFlagChannelSelectionPrompt = ConvertFlags(1 << 5)
	// ConvertFlagReserved6 :: Reserved
	ConvertFlagReserved6 = ConvertFlags(1 << 6)
	// ConvertFlagReserved7 :: Reserved
	ConvertFlagReserved7 = ConvertFlags(1 << 7)
)
View Source
const (
	// IMPIOldFlagUseVolumeEnvelope :: On = Use volume envelope
	IMPIOldFlagUseVolumeEnvelope = IMPIOldFlags(1 << 0)
	// IMPIOldFlagUseVolumeLoop :: On = Use volume loop
	IMPIOldFlagUseVolumeLoop = IMPIOldFlags(1 << 1)
	// IMPIOldFlagUseSustainVolumeLoop :: On = Use sustain volume loop
	IMPIOldFlagUseSustainVolumeLoop = IMPIOldFlags(1 << 2)
)
View Source
const (
	// EnvelopeFlagEnvelopeOn :: On = Use envelope
	EnvelopeFlagEnvelopeOn = EnvelopeFlags(1 << 0)
	// EnvelopeFlagLoopOn :: On = Use loop
	EnvelopeFlagLoopOn = EnvelopeFlags(1 << 1)
	// EnvelopeFlagSustainLoopOn :: On = Use sustain loop
	EnvelopeFlagSustainLoopOn = EnvelopeFlags(1 << 2)
)
View Source
const (
	// ChannelDataFlagNote :: On = Note is available
	ChannelDataFlagNote = ChannelDataFlags(1 << 0)
	// ChannelDataFlagInstrument :: On = Instrument is available
	ChannelDataFlagInstrument = ChannelDataFlags(1 << 1)
	// ChannelDataFlagVolPan :: On = VolPan is available
	ChannelDataFlagVolPan = ChannelDataFlags(1 << 2)
	// ChannelDataFlagCommand :: On = Command/CommandData is available
	ChannelDataFlagCommand = ChannelDataFlags(1 << 3)
	// ChannelDataFlagUseLastNote :: On = Use the previous Note value in the channel
	ChannelDataFlagUseLastNote = ChannelDataFlags(1 << 4)
	// ChannelDataFlagUseLastInstrument :: On = Use the previous Instrument value in the channel
	ChannelDataFlagUseLastInstrument = ChannelDataFlags(1 << 5)
	// ChannelDataFlagUseLastVolPan :: On = Use the previous VolPan value in the channel
	ChannelDataFlagUseLastVolPan = ChannelDataFlags(1 << 6)
	// ChannelDataFlagUseLastCommand :: On = Use the previous Command/CommandData value in the channel
	ChannelDataFlagUseLastCommand = ChannelDataFlags(1 << 7)
)
View Source
const (
	// DefaultVolume is the default volume for many things in IT files
	DefaultVolume = Volume(64)

	// DefaultFineVolume is the default volume for fine volumes in IT files
	DefaultFineVolume = Volume(128)
)
View Source
const (
	// NewNoteActionCut means to cut the previous playback when a new note occurs
	NewNoteActionCut = NewNoteAction(0)
	// NewNoteActionContinue means to continue the previous playback when a new note occurs
	NewNoteActionContinue = NewNoteAction(1)
	// NewNoteActionOff means to note-off the previous playback when a new note occurs
	NewNoteActionOff = NewNoteAction(2)
	// NewNoteActionFade means to fade the previous playback when a new note occurs
	NewNoteActionFade = NewNoteAction(3)
)
View Source
const (
	// DuplicateCheckTypeOff is for when the duplicate check type is disabled
	DuplicateCheckTypeOff = DuplicateCheckType(0)
	// DuplicateCheckTypeNote is for when the duplicate check type is set to note mode
	DuplicateCheckTypeNote = DuplicateCheckType(1)
	// DuplicateCheckTypeSample is for when the duplicate check type is set to sample mode
	DuplicateCheckTypeSample = DuplicateCheckType(2)
	// DuplicateCheckTypeInstrument is for when the duplicate check type is set to instrument mode
	DuplicateCheckTypeInstrument = DuplicateCheckType(3)
)
View Source
const (
	// DuplicateCheckActionCut cuts the playback when a duplicate is detected
	DuplicateCheckActionCut = DuplicateCheckAction(0)
	// DuplicateCheckActionOff performs a note-off on the playback when a duplicate is detected
	DuplicateCheckActionOff = DuplicateCheckAction(1)
	// DuplicateCheckActionFade performs a fade-out on the playback when a duplicate is detected
	DuplicateCheckActionFade = DuplicateCheckAction(2)
)
View Source
const (
	// DuplicateNoteCheckOff disables the duplicate note checking
	DuplicateNoteCheckOff = DuplicateNoteCheck(0)
	// DuplicateNoteCheckOn activates the duplicate note checking
	DuplicateNoteCheckOn = DuplicateNoteCheck(1)
)

Variables

View Source
var (
	// ErrInvalidFileFormat is for when an invalid file format is encountered
	ErrInvalidFileFormat = errors.New("invalid file format")
)
View Source
var (
	// ErrInvalidInstrumentFormat is an error for when an invalid instrument format is encountered
	ErrInvalidInstrumentFormat = errors.New("invalid instrument format")
)

Functions

This section is empty.

Types

type ChannelData

type ChannelData struct {
	ChannelNumber int8
	Flags         ChannelDataFlags
	Note          Note
	Instrument    uint8
	VolPan        uint8
	Command       uint8
	CommandData   uint8
}

ChannelData is the partially decoded channel data from the packed pattern

type ChannelDataFlags

type ChannelDataFlags uint8

ChannelDataFlags is a set of flags specifying what data is available in the packed pattern and/or in this channel data

func (ChannelDataFlags) HasCommand

func (cdf ChannelDataFlags) HasCommand() bool

HasCommand returns true if there is a Command value present

func (ChannelDataFlags) HasInstrument

func (cdf ChannelDataFlags) HasInstrument() bool

HasInstrument returns true if there is a Instrument value present

func (ChannelDataFlags) HasNote

func (cdf ChannelDataFlags) HasNote() bool

HasNote returns true if there is a Note value present

func (ChannelDataFlags) HasVolPan

func (cdf ChannelDataFlags) HasVolPan() bool

HasVolPan returns true if there is a VolPan value present

func (ChannelDataFlags) IsUseLastCommand

func (cdf ChannelDataFlags) IsUseLastCommand() bool

IsUseLastCommand returns true if the previous Command/CommandData value should be used

func (ChannelDataFlags) IsUseLastInstrument

func (cdf ChannelDataFlags) IsUseLastInstrument() bool

IsUseLastInstrument returns true if the previous Instrument value should be used

func (ChannelDataFlags) IsUseLastNote

func (cdf ChannelDataFlags) IsUseLastNote() bool

IsUseLastNote returns true if the previous Note value should be used

func (ChannelDataFlags) IsUseLastVolPan

func (cdf ChannelDataFlags) IsUseLastVolPan() bool

IsUseLastVolPan returns true if the previous VolPan value should be used

type ConvertFlags

type ConvertFlags uint8

ConvertFlags defines the flags associated to the IT format sample data conversion settings

func (ConvertFlags) IsBigEndian

func (sf ConvertFlags) IsBigEndian() bool

IsBigEndian returns true if the sample is 16-bit big endian

func (ConvertFlags) IsByteDelta

func (sf ConvertFlags) IsByteDelta() bool

IsByteDelta returns true if the sample data is stored in byte delta format

func (ConvertFlags) IsChannelSelectPrompt

func (sf ConvertFlags) IsChannelSelectPrompt() bool

IsChannelSelectPrompt returns true if the channel selection prompt is enabled

func (ConvertFlags) IsSampleDelta

func (sf ConvertFlags) IsSampleDelta() bool

IsSampleDelta returns true if the sample is stored in sample delta format

func (ConvertFlags) IsSignedSamples

func (sf ConvertFlags) IsSignedSamples() bool

IsSignedSamples returns true if the sample data is in signed values

func (ConvertFlags) IsTXWave12Bit

func (sf ConvertFlags) IsTXWave12Bit() bool

IsTXWave12Bit returns true if the sample loop is stored in TX-Wave 12-bit format

type DuplicateCheckAction

type DuplicateCheckAction uint8

DuplicateCheckAction is the action to perform when a duplicate is detected

type DuplicateCheckType

type DuplicateCheckType uint8

DuplicateCheckType is the duplicate check type

type DuplicateNoteCheck

type DuplicateNoteCheck uint8

DuplicateNoteCheck activates or deactivates the duplicate note checking

type Envelope

type Envelope struct {
	Flags            EnvelopeFlags
	Count            uint8
	LoopBegin        uint8
	LoopEnd          uint8
	SustainLoopBegin uint8
	SustainLoopEnd   uint8
	NodePoints       [25]NodePoint24
	Reserved51       uint8
}

Envelope is an envelope structure

type EnvelopeFlags

type EnvelopeFlags uint8

EnvelopeFlags is the flagset for new instrument envelopes

type File

type File struct {
	Head               ModuleHeader
	OrderList          []uint8
	InstrumentPointers []ParaPointer32
	SamplePointers     []ParaPointer32
	PatternPointers    []ParaPointer32
	Instruments        []IMPIIntf
	Samples            []FullSample
	Patterns           []PackedPattern
	Blocks             []block.Block
}

File is an IT internal file representation

func Read

func Read(r io.Reader) (*File, error)

Read reads an IT file from the reader `r` and creates an internal File representation

type FineVolume

type FineVolume uint8

FineVolume defines a volume value with double precision

func (FineVolume) Value

func (p FineVolume) Value() float32

Value returns the value of the fine volume as a floating point value between 0 and 1, inclusively

type FullSample

type FullSample struct {
	Header Sample
	Data   []byte
}

FullSample is a full sample, header + data

type IMPIInstrument

type IMPIInstrument struct {
	IMPI                   [4]byte
	Filename               [12]byte
	Nul10                  uint8
	NewNoteAction          NewNoteAction
	DuplicateCheckType     DuplicateCheckType
	DuplicateCheckAction   DuplicateCheckAction
	Fadeout                uint16
	PitchPanSeparation     int8
	PitchPanCenter         uint8
	GlobalVolume           FineVolume
	DefaultPan             PanValue
	RandomVolumeVariation  Percentage8
	RandomPanVariation     Percentage8
	TrackerVersion         uint16
	SampleCount            uint8
	Reserved1F             uint8
	Name                   [26]byte
	InitialFilterCutoff    uint8
	InitialFilterResonance uint8
	MidiChannel            uint8
	MidiProgram            uint8
	MidiBank               uint16
	NoteSampleKeyboard     [120]NoteSample
	VolumeEnvelope         Envelope
	PanningEnvelope        Envelope
	PitchEnvelope          Envelope
}

IMPIInstrument is the format of the IMPI Instrument for tracker compatibility versions >= 0x0200

func (*IMPIInstrument) GetFilename

func (i *IMPIInstrument) GetFilename() string

GetFilename returns a string representation of the data stored in the Filename field

func (*IMPIInstrument) GetName

func (i *IMPIInstrument) GetName() string

GetName returns a string representation of the data stored in the Name field

type IMPIInstrumentOld

type IMPIInstrumentOld struct {
	IMPI               [4]byte
	Filename           [12]byte
	Nul10              uint8
	Flags              IMPIOldFlags
	VolumeLoopStart    uint8
	VolumeLoopEnd      uint8
	SustainLoopStart   uint8
	SustainLoopEnd     uint8
	Fadeout            uint16
	NewNoteAction      NewNoteAction
	DuplicateNoteCheck DuplicateNoteCheck
	TrackerVersion     uint16
	SampleCount        uint8
	Reserved1F         uint8
	Name               [26]byte
	Reserved3A         [6]uint8
	NoteSampleKeyboard [120]NoteSample
	VolumeEnvelope     [200]uint8
	NodePoints         [25]NodePoint16
}

IMPIInstrumentOld is the format of the IMPI Instrument for tracker compatibility versions < 0x0200

func (*IMPIInstrumentOld) GetFilename

func (i *IMPIInstrumentOld) GetFilename() string

GetFilename returns a string representation of the data stored in the Filename field

func (*IMPIInstrumentOld) GetName

func (i *IMPIInstrumentOld) GetName() string

GetName returns a string representation of the data stored in the Name field

type IMPIIntf

type IMPIIntf interface{}

IMPIIntf is an interface to the IT instruments

type IMPIOldFlags

type IMPIOldFlags uint8

IMPIOldFlags is the flagset for IMPIInstrumentOld instruments

type IMPMFlags

type IMPMFlags uint16

IMPMFlags is a set of flags describing various features in the IT file

func (IMPMFlags) IsEFGLinking

func (f IMPMFlags) IsEFGLinking() bool

IsEFGLinking returns true if effect E/F/G linking is enabled

func (IMPMFlags) IsLinearSlides

func (f IMPMFlags) IsLinearSlides() bool

IsLinearSlides returns true if linear slides is enabled

func (IMPMFlags) IsMidiPitchController

func (f IMPMFlags) IsMidiPitchController() bool

IsMidiPitchController returns true if midi pitch controller is enabled

func (IMPMFlags) IsOldEffects

func (f IMPMFlags) IsOldEffects() bool

IsOldEffects returns true if old-style effects are enabled

func (IMPMFlags) IsReqEmbedMidi

func (f IMPMFlags) IsReqEmbedMidi() bool

IsReqEmbedMidi returns true if request embedded midi configuration is enabled

func (IMPMFlags) IsStereo

func (f IMPMFlags) IsStereo() bool

IsStereo returns true if stereo (panning) is enabled

func (IMPMFlags) IsUseInstruments

func (f IMPMFlags) IsUseInstruments() bool

IsUseInstruments returns true if use-instruments (instead of samples) is enabled

func (IMPMFlags) IsVol0Optimizations

func (f IMPMFlags) IsVol0Optimizations() bool

IsVol0Optimizations returns true if vol-0 optimization is enabled

type IMPMSpecialFlags

type IMPMSpecialFlags uint16

IMPMSpecialFlags is a set of flags describing various special features in the IT file

func (IMPMSpecialFlags) IsEmbedMidi

func (sf IMPMSpecialFlags) IsEmbedMidi() bool

IsEmbedMidi returns true if embedded midi configuration is enabled

func (IMPMSpecialFlags) IsHighlightDataIncluded

func (sf IMPMSpecialFlags) IsHighlightDataIncluded() bool

IsHighlightDataIncluded returns true if there is a highlight data attached to the file

func (IMPMSpecialFlags) IsHistoryIncluded

func (sf IMPMSpecialFlags) IsHistoryIncluded() bool

IsHistoryIncluded returns true if there is a history block following the pattern parapointres in the file

func (IMPMSpecialFlags) IsMessageAttached

func (sf IMPMSpecialFlags) IsMessageAttached() bool

IsMessageAttached returns true if there is a special message attached to the file

type ModuleHeader

type ModuleHeader struct {
	IMPM                 [4]byte
	Name                 [26]byte
	PHighlight           uint16
	OrderCount           uint16
	InstrumentCount      uint16
	SampleCount          uint16
	PatternCount         uint16
	TrackerVersion       uint16
	TrackerCompatVersion uint16
	Flags                IMPMFlags
	SpecialFlags         IMPMSpecialFlags
	GlobalVolume         FineVolume
	MixingVolume         FineVolume
	InitialSpeed         uint8
	InitialTempo         uint8
	PanningSeparation    PanSeparation
	PitchWheelDepth      uint8
	MessageLength        uint16
	MessageOffset        ParaPointer32
	Reserved3C           [4]uint8
	ChannelPan           [64]PanValue
	ChannelVol           [64]Volume
}

ModuleHeader is the initial header definition of an IT file

func ReadModuleHeader

func ReadModuleHeader(r io.Reader) (*ModuleHeader, error)

ReadModuleHeader reads a ModuleHeader from the input stream

func (*ModuleHeader) GetName

func (mh *ModuleHeader) GetName() string

GetName returns a string representation of the data stored in the Name field

type NewNoteAction

type NewNoteAction uint8

NewNoteAction is what to do when a new note occurs

type NodePoint16

type NodePoint16 struct {
	Tick      uint8
	Magnitude uint8
}

NodePoint16 is a node point in the old instrument format

type NodePoint24

type NodePoint24 struct {
	Y    int8
	Tick uint16
}

NodePoint24 is a node point in the new instrument format

type Note

type Note uint8

Note is a note field value

func (Note) IsNoteCut

func (n Note) IsNoteCut() bool

IsNoteCut returns true if the note is a note-cut command

func (Note) IsNoteFade

func (n Note) IsNoteFade() bool

IsNoteFade returns true if the note is a note-fade command

func (Note) IsNoteOff

func (n Note) IsNoteOff() bool

IsNoteOff returns true if the note is a note-off command

func (Note) IsSpecial

func (n Note) IsSpecial() bool

IsSpecial returns true if the note is actually a special value (see above)

type NoteSample

type NoteSample struct {
	Note   Note
	Sample uint8
}

NoteSample is a note-sample keyboard mapping entry

type PackedPattern

type PackedPattern struct {
	Length     uint16
	Rows       uint16
	Reserved04 [4]byte
	Data       []uint8
}

PackedPattern is a packed pattern from the IT format

func (*PackedPattern) ReadChannelData

func (p *PackedPattern) ReadChannelData(pos int, rowMem []ChannelData) (int, *ChannelData, error)

ReadChannelData decodes a packed pattern from the position indicated (`pos`) and returns an integer equal to the number of bytes used to decode the channel data, a ChannelData structure, and a possible error value. If there is no error and the row is completed, the ChannelData structure returned will be nil.

type PanSeparation

type PanSeparation uint8

PanSeparation is the panning separation value

func (PanSeparation) Value

func (p PanSeparation) Value() float32

Value returns the value of the panning separation as a floating point value between 0 and 1, inclusively

type PanValue

type PanValue uint8

PanValue describes a panning value in the IT format

func (PanValue) IsDisabled

func (p PanValue) IsDisabled() bool

IsDisabled returns true if the channel this panning value is attached to is muted Effects in muted channels are still processed

func (PanValue) IsSurround

func (p PanValue) IsSurround() bool

IsSurround returns true if the panning is in surround-sound mode

func (PanValue) Value

func (p PanValue) Value() float32

Value returns the value of the panning as a floating point value between 0 and 1, inclusively 0 = absolute left, 0.5 = center, 1 = absolute right

type ParaPointer

type ParaPointer interface {
	Offset() int
}

ParaPointer is a pointer offset within the IT file format

type ParaPointer16

type ParaPointer16 uint16

ParaPointer16 is a 16-bit pointer offset within the IT file format

func (ParaPointer16) Offset

func (p ParaPointer16) Offset() int

Offset returns the actual offset

type ParaPointer24

type ParaPointer24 struct {
	Hi uint8
	Lo ParaPointer16
}

ParaPointer24 is a 24-bit pointer offset within the IT file format

func (ParaPointer24) Offset

func (p ParaPointer24) Offset() int

Offset returns the actual offset

type ParaPointer32

type ParaPointer32 uint32

ParaPointer32 is a 32-bit pointer offset within the IT file format

func (ParaPointer32) Offset

func (p ParaPointer32) Offset() int

Offset returns the actual offset

type Percentage8

type Percentage8 uint8

Percentage8 is a percentage stored as a uint8

func (Percentage8) Value

func (p Percentage8) Value() float32

Value returns the value of the percentage

type Sample

type Sample struct {
	IMPS             [4]byte
	Filename         [12]byte
	Reserved10       [1]byte
	GlobalVolume     Volume
	Flags            SampleFlags
	Volume           Volume
	Name             [26]byte
	ConvertFlags     ConvertFlags
	DefaultPan       SamplePanValue
	Length           uint32
	LoopBegin        uint32
	LoopEnd          uint32
	C5Speed          uint32
	SustainLoopBegin uint32
	SustainLoopEnd   uint32
	SamplePointer    ParaPointer32
	VibratoSpeed     uint8
	VibratoDepth     uint8
	VibratoSweep     uint8
	VibratoType      uint8
}

Sample is a sample from the IT format

func (*Sample) GetFilename

func (s *Sample) GetFilename() string

GetFilename returns a string representation of the data stored in the Filename field

func (*Sample) GetName

func (s *Sample) GetName() string

GetName returns a string representation of the data stored in the Name field

type SampleFlags

type SampleFlags uint8

SampleFlags defines the flags associated to the IT format sample header

func (SampleFlags) DoesSampleExist

func (sf SampleFlags) DoesSampleExist() bool

DoesSampleExist returns true if the sample header has a sample associated with it.

func (SampleFlags) Is16Bit

func (sf SampleFlags) Is16Bit() bool

Is16Bit returns true if the sample is 16-bit

func (SampleFlags) IsCompressed

func (sf SampleFlags) IsCompressed() bool

IsCompressed returns true if the sample data is compressed

func (SampleFlags) IsLoopEnabled

func (sf SampleFlags) IsLoopEnabled() bool

IsLoopEnabled returns true if the sample loop is enabled

func (SampleFlags) IsLoopPingPong

func (sf SampleFlags) IsLoopPingPong() bool

IsLoopPingPong returns true if the sample loop mode is ping-pong

func (SampleFlags) IsStereo

func (sf SampleFlags) IsStereo() bool

IsStereo returns true if the sample is stereo

func (SampleFlags) IsSustainLoopEnabled

func (sf SampleFlags) IsSustainLoopEnabled() bool

IsSustainLoopEnabled returns true if the sample sustain loop is enabled

func (SampleFlags) IsSustainLoopPingPong

func (sf SampleFlags) IsSustainLoopPingPong() bool

IsSustainLoopPingPong returns true if the sample sustain loop mode is ping-pong

type SamplePanValue

type SamplePanValue uint8

SamplePanValue describes a panning value in the IT format's sample header

func (SamplePanValue) IsDisabled

func (p SamplePanValue) IsDisabled() bool

IsDisabled returns true if the channel this panning value is attached to is muted Effects in muted channels are still processed

func (SamplePanValue) IsSurround

func (p SamplePanValue) IsSurround() bool

IsSurround returns true if the panning is in surround-sound mode

func (SamplePanValue) Value

func (p SamplePanValue) Value() float32

Value returns the value of the panning as a floating point value between 0 and 1, inclusively 0 = absolute left, 0.5 = center, 1 = absolute right

type Volume

type Volume uint8

Volume defines a volume value

func (Volume) Value

func (p Volume) Value() float32

Value returns the value of the volume as a floating point value between 0 and 1, inclusively

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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