WAD::Music
Inherits WritingAdditions::Music < Reference < Object
A music track.
Constructors
parse(filename : String | Path) : Music
Parses a music file given the filename
Opens a music file and parses it:
my_music = WAD::Music.parse("Path/To/Music")
parse(io : IO) : Music
Parses a music file given the io
Opens a music io and parses it:
File.open("Path/To/Music") do |file|
my_music = WAD::Music.parse(file)
end
Class methods
is_music?(name : String)
Checks to see if name is music with name format 'D_x..x'.
Returns true if the name is a music:
music_name = "D_E1M1"
if WAD::Music.is_music?(music_name)
puts "Is a Music"
else
puts "Is not a Music"
end
Instance methods
channels
Count of primary channels.
channels=(channels : UInt16)
Count of primary channels.
clone
Returns a copy of self with all instance variables cloned.
dummy
dummy=(dummy : UInt16)
identifier
identifier=(identifier : String)
instr_cnt
instr_cnt=(instr_cnt : UInt16)
instruments
instruments=(instruments : Array(UInt16))
score_len
score_len=(score_len : UInt16)
score_start
score_start=(score_start : UInt16)
sec_channels
Count of secondary channels.
sec_channels=(sec_channels : UInt16)
Count of secondary channels.
song
song=(song : Array(UInt8))