finale-lua / lua-scripts

A central repository for all Lua scripts for Finale.
https://finalelua.com
Creative Commons Zero v1.0 Universal
14 stars 14 forks source link

Create rest_minimiser.lua #712

Closed cv-on-hub closed 3 months ago

cv-on-hub commented 4 months ago

New script to delete any rests in the selection that serve no musical function.

rpatters1 commented 4 months ago

Have you looked at FCNoteEntryCell.ReduceEntries? There is a lot of overlap with this script. FWIW: ReduceEntries is implemented by Finale, with the PDK Framework function being just a passthru. That means you get Finale's quantization rules, which may or may not be what you want. But it at least provides a consistent experience for the user. I've found it to work pretty well.

cv-on-hub commented 4 months ago

Have you looked at FCNoteEntryCell.ReduceEntries?

I didn't know such a thing existed, and see that you just created it in RGP 0.68. Could reduce this script to a couple of lines! Thanks Robert ... will examine and simplify. (I had also never really noticed FCNoteEntryCell before - looks incredibly useful).

rpatters1 commented 4 months ago

The version history is usually worth perusing after each release. :-)

rpatters1 commented 4 months ago

FWIW: FCNoteEntryCell is what eachentry and eachentrysaved use under the covers. You might find it interesting to look at the how those functions work.

We also added a FCXNoteEntryCell to the mixin library that allows you to cherry pick entries from an eachentry loop for later processing without risk of crashing Finale. (The built-in version has that risk.)

cv-on-hub commented 4 months ago

There is a lot of overlap with this script

This is an understatement of delightfully mammoth proportions. That script is gone and replaced with 30 terse line under a new name: rhythm_reducer.lua.

EDIT: or maybe 'rhythm_refiner`?