genmidi: Strip instrument name trailing whitespace.

Some of the DMXGUS instrument names seem to have long sections of
whitespace like this, and we can clean it up while dumping.
This commit is contained in:
Simon Howard 2023-06-24 00:49:26 -04:00
parent 276118107b
commit ffb7348b8e
2 changed files with 2 additions and 2 deletions

View file

@ -123,7 +123,7 @@ def decode_voice(data, name):
result["m_ksl_volume"] = result["m_ksl"] | result["m_volume"]
result["c_ksl_volume"] = result["c_ksl"] | result["c_volume"]
result["name"] = name.decode("ascii").rstrip("\0")
result["name"] = name.decode("ascii").rstrip("\0").rstrip()
return result

View file

@ -35,7 +35,7 @@ def read(filename):
raise Exception("Invalid header for SBI file!")
instr_data = data[36:]
result = {"name": name.decode("ascii").rstrip("\0")}
result = {"name": name.decode("ascii").rstrip("\0").rstrip()}
for i in range(len(FIELDS)):
result[FIELDS[i]], = struct.unpack("B", instr_data[i : i + 1])