MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

Recall last Transpose settings when reopening the Transpose window

Open snpp07 opened this issue 8 months ago • 6 comments

Your idea

MS v4.5.1: I often need to transpose some bars 1 octave up or down (for example, when copying a soprano part to a bass part), but each time I'm going back to the transpose window, I have to reselect all : this is very annoying !... => Having the last settings already selected is a very easy feature to implement and will save lots of time.

Problem to be solved

This feature will save lots of time for repetitive actions.

Prior art

No response

Additional context

No response

Checklist

  • [x] This request follows the guidelines for reporting issues
  • [x] I have verified that this feature request has not been logged before, by searching the issue tracker for similar requests

snpp07 avatar Apr 28 '25 01:04 snpp07

This is fine suggestion, but this is not needed for octave transposition. You can transpose any selection an octave instantly via Ctrl+Up/Down - no need to even open any dialog. Also semitone is Up/Down. It's only the other transposition that require the dialog and thus could possible benefit from remembering settings, if you happen to transpose by the same interval often.

MarcSabatella avatar Apr 28 '25 02:04 MarcSabatella

Thanks for your tip Marc, you're right, nevertheless, yes, I already had to transpose several times with the same interval other than an octave and remembering last settings used would be a simple but greatly practical behavior. :-)

snpp07 avatar Apr 28 '25 13:04 snpp07

I think this makes sense. Only possible restriction might be that the dialog resets on closing and reopening the score.

bkunda avatar Apr 29 '25 14:04 bkunda

A design consideration would be, how to handle the case - the most common ones, really - where a person is choosing to transpose by key rather than by interval. It's extremely unlikely that after choosing to transpose a song to the key of Eb, one would want to then choose that same key again the next time since it's obviously in that key already. It's really only interval transposition where there is much chance of wanting to do the same transposition multiple times in a row. To be honest, I can't say I've ever encountered a use for that myself, but I gather people sometimes do this instead of using instrument transposition in order to produce transposed charts for trumpet and saxophone, etc.

MarcSabatella avatar Apr 29 '25 14:04 MarcSabatella

@MarcSabatella : Currently in MS4.5, each time you open the Transpose panel, the 'Transpose by key' is selected by default... So if you decide to Transpose by key once, when opening the Transpose panel again, you'll see "Transpose by Key" already selected, as if last used parameters had been saved and recalled... but no, it's just a default state... And as you wrote in your post, this is probably unuseful as people rarely want to transpose twice to the same key... :-))

So there's no case to handle but just one thing to implement: PLEASE, AUTOMATICALLY RECALL LAST USED PARAMETERS WHEN OPENING THE TRANSPOSE WINDOW.

And being an old C++ developer, I'm sure this is a very simple trick to implement (during the current session of course, no need to recall after a close/reopen score to answer to @bkunda). THAAAAAAANKS :-)

snpp07 avatar May 02 '25 00:05 snpp07

@snpp07 I've implemented the recalling logic, see demo: https://youtube.com/shorts/ULHYwuD8-6E?feature=share

I've had to ignore some of options, as there is indeed already some custom logic for them:

    // TRANSPOSE_TO_KEY and "transpose keys" is only possible if selection state is SelState::RANGE
    bool rangeSelection = selection()->isRange();
    
    // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    setEnableTransposeKeys(rangeSelection);
    setEnableTransposeToKey(rangeSelection);
    // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    const std::vector<EngravingItem*>& elements = selection()->elements();
    bool hasChordNames = std::any_of(elements.cbegin(), elements.cend(), [](const EngravingItem* item) {
        return item->isHarmony();
    });
    // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    setEnableTransposeChordNames(hasChordNames);
    // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    setKey(firstPitchedStaffKey());
    // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

prodoelmit avatar Sep 19 '25 22:09 prodoelmit