Skip to content
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

Create articulation_expression_swap #744

Merged
merged 2 commits into from
Jul 21, 2024

Conversation

MuseCraft-Studio
Copy link
Contributor

Replaces the selected articulation with the selected expression (or vice versa) for the full document if a region is not selected.

Replaces the selected articulation with the selected expression (or vice versa) for the full document if a region is not selected.
@rpatters1
Copy link
Collaborator

rpatters1 commented Jun 3, 2024

  • This repo uses snake-case for function names as well as variable names.
  • You should check for 0 on return from DisplayArticulationDialog and DisplayExpressionDialog. 0 means the user canceled out of the dialog.
  • I'm guessing you only want to allow text expressions. That means you need to check the 2nd return value of DisplayExpressionDialog and reject the result if it is true. Otherwise, you need to track the 2nd return value through your code so that you actually retrieve the appropriate shape expression. (Remember that text and shape expressions are numbered separately starting from 1.)
  • Be aware that both DisplayArticulationDialog and DisplayExpressionDialog allow the user to modify the articulation and expressions lists, respectively. Consider placing those calls in their own Undo block separate from the run function.
  • Since you are using some of the new RGP Lua APIs, there should be an appropriate MinJWLuaVersion.

@MuseCraft-Studio MuseCraft-Studio changed the title Add articulation_expression_swap Create articulation_expression_swap Jun 30, 2024
@cv-on-hub
Copy link
Contributor

Hi @MuseCraft-Studio. Hope you don't mind but I needed some coding recreation and have implemented some of @rpatters1 's suggestions to your script. (But not isolated Display[X]Dialog in a separate Undo block). And done a bit of streamlining. Feel free, of course, to ignore this completely!

articulation_expression_swap.lua.txt

@rpatters1
Copy link
Collaborator

What is the status of this PR? Will there be updates?

@MuseCraft-Studio
Copy link
Contributor Author

I got the script updated with all of the feedback, but after I couldn't find comparable examples of the undo block for the articulation/expression dialog, I got a bit distracted with other things. I'm happy to just push Carl's version (which also doesn't have the undo blocks)

@rpatters1
Copy link
Collaborator

I'd say push the changes. The separate undo block is optional.

@rpatters1 rpatters1 merged commit 921079a into finale-lua:master Jul 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants