Lyrics added by Plugin won't show up until I press Ctrl+L

• Nov 29, 2021 - 02:44

I'm currently writing a lyrics input helper for East Asian languages, which reads a .txt or .lrc file and let user input lyrics thru a pannel (whether single character, prolong the syllables like input "_", or fill multiple char in a single notes). I have some problems relate to adding the lyrics to the note. When I add lyrics thru my plugin using this code (learned from notenames-as-lyrics plugin):

var fill = newElement(Element.LYRICS);
fill.text = character; //character is the lyrics text to be added
fill.voice = cursor.voice;
cursor.element.add(fill);

The lyrics does not appear automatically at the curosr. However, when I press Ctrl+L or slightly drag the note's position, the lyrics will suddenly appear at the wished spot, seems there are some refreshing issues. I compared my code to the lyrics adding part of other people's work, I couldn't find anything different methodically. Anybody knows the reason of why this happened and what did I do wrong? Thank you so much!


Comments

Do you still have an unanswered question? Please log in first to post your question.