Skip to content

Commit

Permalink
Updated controllers tags, tested that it is played back by drums
Browse files Browse the repository at this point in the history
  • Loading branch information
arinaLozhkina committed Aug 29, 2023
1 parent 886470d commit fb10b74
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ms3/bs4_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3531,17 +3531,18 @@ def set_instrument(self, staff_id: Union[str, int], trackname):
cur_value = value[idx_channel]
found = found_channel.find_all("controller")
for idx, elem in enumerate(cur_value):
elem["ctrl"] = cur_value[idx]["ctrl"]
elem["value"] = cur_value[idx]["value"]
if idx >= len(found) - 1:
new_tag = self.soup.new_tag("controller")
new_tag["ctrl"] = cur_value[idx]["ctrl"]
new_tag["value"] = cur_value[idx]["value"]
found_channel.append(
new_tag
)
if len(found) > len(value):
for i in range(len(value) - len(found)):
else:
found[idx]["ctrl"] = elem["ctrl"]
found[idx]["value"] = elem["value"]
if len(found) > len(cur_value):
for i in range(len(cur_value) - len(found)):
found[i + len(found) - 1].extract()
elif field_to_change == "ChannelValue":
channel_data, value = self.modify_list_tags(changed_part, channel_data, value)
Expand Down

0 comments on commit fb10b74

Please sign in to comment.