Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Bit masks for reading instrument number, note and effect NoteMaskSampleBitsUpper = uint32(0xF0000000) // 04 11110000 00000000 00000000 00000000 Upper bits for sample number NoteMaskPeriod = uint32(0x0FFF0000) // 12 00001111 11111111 00000000 00000000 Period (note) NoteMaskSampleBitsLower = uint32(0x0000F000) // 04 00000000 00000000 11110000 00000000 Lower bits for sample number NoteMaskEffect = uint32(0x00000F00) // 04 00000000 00000000 00001111 00000000 Effect number 0x0 - 0xF NoteMaskEffectParameters = uint32(0x000000FF) // 08 00000000 00000000 00000000 11111111 Parameter(s) for effect // split uint8 to uint4+uint4 NoteSampleMaskUpper = uint8(0xF0) // 4 11110000 NoteSampleMaskLower = uint8(0x0F) // 4 00001111 )
Variables ¶
View Source
var Detect = map[string]Meta{ "M.K.": {Channels: 4, Type: TrackerProtracker}, "M!K!": {Channels: 4, Type: TrackerProtracker}, "M&K!": {Channels: 4, Type: TrackerNoisetracker}, "N.T.": {Channels: 4, Type: TrackerNoisetracker}, }
Detect module type
View Source
var Endianness = binary.BigEndian
View Source
var NotePeriodMap = map[NotePeriod]NoteInfo{ 856: {NoteC, 1}, 808: {NoteCSharp, 1}, 762: {NoteD, 1}, 720: {NoteDSharp, 1}, 678: {NoteE, 1}, 640: {NoteF, 1}, 604: {NoteFSharp, 1}, 570: {NoteG, 1}, 538: {NoteGSharp, 1}, 508: {NoteA, 1}, 480: {NoteASharp, 1}, 453: {NoteB, 1}, 428: {NoteC, 2}, 404: {NoteCSharp, 2}, 381: {NoteD, 2}, 360: {NoteDSharp, 2}, 339: {NoteE, 2}, 320: {NoteF, 2}, 302: {NoteFSharp, 2}, 285: {NoteG, 2}, 269: {NoteGSharp, 2}, 254: {NoteA, 2}, 240: {NoteASharp, 2}, 226: {NoteB, 2}, 214: {NoteC, 3}, 202: {NoteCSharp, 3}, 190: {NoteD, 3}, 180: {NoteDSharp, 3}, 170: {NoteE, 3}, 160: {NoteF, 3}, 151: {NoteFSharp, 3}, 143: {NoteG, 3}, 135: {NoteGSharp, 3}, 127: {NoteA, 3}, 120: {NoteASharp, 3}, 113: {NoteB, 3}, }
Map of notes and octaves for lookup
Functions ¶
This section is empty.
Types ¶
type EffectCommand ¶
type EffectCommand uint8
const ( EffectNoneArpeggio EffectCommand = iota // 0 EffectPortamentoUp // 1 EffectPortamentoDown // 2 EffectTonePortamento // 3 EffectVibrato // 4 EffectTonePVolSlide // 5 EffectVibraVolSlide // 6 EffectTremolo // 7 EffectNotUsed // 8 EffectSampleOffset // 9 EffectVolumeSlide // A 10 EffectPositionJump // B 11 EffectSetVolume // C 12 EffectPatternBreak // D 13 EffectMiscCmds // E 14 EffectSetSpeed // F 15 )
func (EffectCommand) String ¶
func (e EffectCommand) String() string
type Meta ¶
type Meta struct { Channels uint8 Type TrackerType }
type Module ¶
type Module struct { Name string `json:"name"` Tracker TrackerType `json:"tracker"` Channels uint8 `json:"channels"` HighestPattern uint8 `json:"highest_pattern"` PatternOrders []uint8 `json:"pattern_orders"` Patterns []Pattern `json:"patterns"` Samples []Sample `json:"samples"` }
func NewFromReader ¶
func NewFromReader(r io.ReadSeeker) (m Module, err error)
Convert raw binary reader stream to a module
type NoteData ¶
type NoteData struct { SampleNumber uint8 `json:"sample"` Note *NoteInfo `json:"note"` Effect EffectCommand `json:"effect"` EffectParameters uint8 `json:"effect_parameters"` Channel uint8 `json:"channel"` Row uint8 `json:"row"` }
Note data
func (*NoteData) MarshalJSON ¶
Custom JSON marshaler
type NoteDataRaw ¶
type NoteDataRaw uint32
NoteData data in raw binary format
func (NoteDataRaw) ToNote ¶
func (n NoteDataRaw) ToNote() NoteData
Convert raw binary to proper note data
type NotePeriod ¶
type NotePeriod uint16
type Sample ¶
type Sample struct { Name string `json:"name"` // Sample name WaveForm []byte `json:"wave"` // Sample's binary waveform Finetune uint8 `json:"finetune,omitempty"` // Finetune Volume uint8 `json:"volume,omitempty"` // Sample's volume level RepeatPointOffset uint16 `json:"repeat_point_offset,omitempty"` // Point where sample repeats RepeatLength uint16 `json:"repeat_length,omitempty"` // How long the repeat is }
Sample
type SampleRaw ¶
type SampleRaw struct { Name [22]byte Length uint16 // Multiply with 2 to get bytes Finetune uint8 // Finetune 0x0 - 0xF Volume uint8 // 0x0 - 0x40 (0 - 64) RepeatPointOffset uint16 // Multiply with 2 to get bytes RepeatLength uint16 // Multiply with 2 to get bytes }
Sample in raw binary format
type TrackerType ¶
type TrackerType uint8
const ( TrackerUnknown TrackerType = iota TrackerProtracker TrackerNoisetracker TrackerSoundtracker TrackerProtrackerClone )
func (TrackerType) String ¶
func (tt TrackerType) String() string
Click to show internal directories.
Click to hide internal directories.