Skip to content

Editing capabilities after import #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sortedcord
Copy link
Collaborator

Adds ability to edit vocal elements after importing them from a text file. This allows for the following

  • Deleting elements
  • Editing element text
  • Splitting elements
  • Changing order of elements
  • Line reset if manually edited

Closes #9

@sortedcord sortedcord added the enhancement New feature or request label Jan 12, 2025
@sortedcord
Copy link
Collaborator Author

@gigareggie Made a few changes to how lyrics are handled I'm afraid the code is getting a bit too convoluted.. Need some feedback on that

@sortedcord sortedcord requested a review from gigareggie January 12, 2025 13:00
@gigareggie
Copy link
Collaborator

gigareggie commented Jan 13, 2025

I think it would be better to remove the line_index and word_index property from the VocalElements altogether and setup methods directly inside Lyrics to get adjacent elements. Also store elements directly inside lyrics using a matrix. The Line objects will not store the elements, instead would only contain other metadata and properties. This would probably cut down on the "rebuilding" that you are doing for now. That being said, I think it would be better to incorporate changes from the other branches before making breaking changes.

@sortedcord
Copy link
Collaborator Author

Well actually, word_index doesn't really contain the index of the element. I had been using it for splitting and joining syllables of a word.

@gigareggie
Copy link
Collaborator

Why not just use a flag like part_of_word for that? If an element has been tagged with that then it and the next element would be part of a single word. Is probably more simple than what's done here

index = 0
for i in range(len(self.elements)):
if self.elements[i].word_index > index:
_str += " "
index = self.elements[i].word_index
_str += str(self.elements[i])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling editing of lyrics after syncing
2 participants