Better Copy Paste?

• Jul 22, 2023 - 06:58

It would be helpful if there could be an improved Copy/Paste feature within MuseScore. As far as I know, this doesn't exist yet.

For regular text there are clipping managers which work with text - though these may be OS specific, and limited in what they will do with some applications. There may be other issues with some of those tools - uncertain behaviour, charges, subscription models, though some are free and work quite well with text.

There may not be anything which works quite so well with clipboard fragments from programs like MuseScore.

A good clipping tool which works within MuseScore could be very helpful.

Here is a use case.

Suppose you have a score with bars and a chord sequence. Some of the measures are already orchestrated, with specific instrumentation, and specific rhythmic patterns for each instrument. This might be particularly relevant for string accompaniments. There are only a limite number of patterns - each corresponding to a fairly standard chord representation. Thus one might have patterns for C, for Gm, for F7 say. If there are long sections which use these patterns, then first create a temporary score with those patterns already worked out. Then copy the patterns in turn into a tool which remembers which pattern is which - ideally allowing the user to give each pattern an identifiable name - which might just as well be something like the name of a chord symbol.

Then to quickly generate the required accompaniment, simply go to an appropriate bar, and activate this clipping tool. Select the require pattern and paste it into the score. Repeat this for each new measure which has to be filled in.

This kind of procedure can currently be done using an auxiliary file, or a part of a score which is used as a temporary work space, but it requires a lot of operations.

Note also the patterns to be pasted into a score could be assigned keyboard shortcuts, so this approach could be very powerful.

Essentially what is suggested is a clipping manager which actually works with MuseScore. Currently it is not known whether there any which work, and the ability to define and use keyboard shortcuts would be pretty much essential.

If such a clipping manager could be built in to MuseScore that would be very helpful, and note - although the use case here refers to copying bars of music, it could be very general and not only restricted in that way. However my own current interest is in applications of that kind.


Comments

I have found many situations where this type of processing would make scoring more efficient – and not just for copy paste. Some sort of simple macro language aimed at regular users rather than plugin developers would fit the bill nicely. I'm thinking along the lines of Microsoft Excel which has a macro recorder for simple situations and a full blown programming language for developers.

Then shortcuts could be assigned to macros for quick usage and macros could be saved for loading into other scores. These macros could be called snippets.

It may be possible to provide such a framework via a plugin but I'm not sure.

My current use would be for applying a transposition to selected notes, because the transpose settings in MS3 are not remembered between uses, even within the same editing session on a single score. 😩

In reply to by yonah_ag

Glad to see a positive response to this. Actually things can be taken a lot further than this - with dissassembly/reassembly tools - though that may be several steps too far for some round here.

The basic steps would be

(a) dissassembly - a process to reduce the score into an easily manageable form for some procedure.
(b) one or more procedures to apply to the "now" form of the score - which incidently would be highly fragmented and otherwise probably useless.
(c) reassembly - a process to reverse step (a), but which would now have the effects of step (b) applied to all the relevant parts of the score.

The (a) process could be a sort, as indeed could the (c) process.

So - how would this work?

Example: orchestrating all sections of a score with a particular chord sequence. OK - here I'll just deal with the situation where the orchestration is "simply" applied to bars with a particular chord, rather than a sequence, but I believe with a little bit more ingenuity this really could be modified for use with chord sequences - though would require the use of secondary keys [by which I mean database keys, of course!]

This may seem like overkill but for a lot of string writing there may be many stretches of similar configurations.

So - the method would be:

Step (a): sort all the bars according to their assigned chord symbols - assuming one chord symbol per bar.
Step (b): orchestrate one of the bars which is incomplete. Replicate this step for all the other bars which are similar.
Step (c): sort all the bars according to their original bar number - which would have been kept as a sort key.
This should restore the overall score, but the parts would have been filled in.

Processes like this could greatly speed up some kinds of operations.

Note that the original concept of disassembly could be any other process, such as a filter, or even a sequence of processes. The only really important thing is that it should reduce the data to a much smaller data set, which could then be processed and expanded easily, and that the disassembly process should be reversible, which would generally be the case if unique keys for all the bars are retained, and used to reconstruct the score from the reduced intermediate.

The middle step could be anything relevant to a musician - rearticulating parts, transposing, whatever.

In reply to by dave2020X

Sounds good but maybe would need to be either a companion tool which understands MS database design or integrated into MS5 (!)

I have used a similar approach to this with plugouts hosted in Excel and written in VBA. The .mscx file (from MS3) is loaded into a worksheet and the XML then parsed into a set of tables for ease of processing. The tables are linked by measure to the XML for post-processing update and then the mscx is overwritten, ready for re-opening in MS.

It's slower than a plugin but every element and property of the score is available. Maybe the plugin API in MS4 will be able to facilitate this type of processing.

In reply to by yonah_ag

Great that you've tried that kind of approach. I think if you look "under the hood" that a lot of MuseScore is based on XML data, which may be either a tree or graph structure. If so it should be possible to use XML processing tools - possibly in conjunction with other tools, to get a workable result. I don't do much programming now and how I'd tackle anything like this would depend on what I felt about the scale of the problem. It would also depend on whther there was any other working code, which could be reused and modified easily. Otherwise I'd probably want to use a functional language which would in theory be quite easy to use for prototyping, and might even turn out to be fast enough.

Having said that, it's unlikely that I'll ever do that now, but it'd be really good if someone, or some group, with good design and programming skills could do this kind of thing.

In reply to by yonah_ag

I'm not sure that I like Python. I would probably try Haskell - though fairly few people use that.

For me I'd have to be able to use higher order functions easily. I'm not sure that Haskell really works well with interactive programming - which is what editing, reviewing and changing MuseScore files would be.

Tools like XSLT might help - but I found many of the XML tools somewhat clunky. The same comment re interactive editing - as above - would apply.

Chances are that the interactivity might prove problematic in tools I'd maybe try to use - so Python could be one of the best options.

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