Searching for pattern

• Apr 27, 2024 - 05:35

Sometimes I write a tune or piece of a tune, and then I remember that I had previously written another tune with that same sequence in it. For instance, I recently wrote a piece containing the short sequence pictured in the attached file, and I knew that I had written another piece that had that same sequence (although perhaps in a different key), and I wanted to compare the two files/tunes. I have so many tunes, though, that to try to search through manually and find it is getting to just not be feasible. It would be nice if there were a function in MuseScore (as I don't believe there is) that would go though all the Musescore files in a folder/subfolder on my computer and find any matching sequence (in this case, a dotted eighth note dropping one step to sixteenth note, then one step to an eighth note, then another step to an eighth note, and then one more step to a half note).

Attachment Size
temp.docx 25.08 KB

Comments

This would be a radical departure from what MuseScore is and does. But it might be possible to compare the musicxml files to find such similarities??? Not sure.

In reply to by TheHutch

I suppose it is a "radical departure", but I still think it would be a good feature if it isn't too difficult to design into it. And are you saying that MuseScore could add the feature by comparing musicxml files, or that I myself might be able to compare using musicxml files? I am not sure what a musicxml file is, so I would need further clarification.

What you propose can be considered the equivalent of text search. But optimizing even the far simpler text search is still being worked on:
https://www-igm.univ-mlv.fr/~lecroq/string/index.html

In music you have chords, melody, rhythm, voices, inversions, transpositions and ??? and you would have to specify more precisely what you want.
For a plugin to “go though all the Musescore files in a folder” is not realistic in MU4. I think readScore and next-score don’t work (but I may be wrong). In MU3.6 you can load 35+ files in tabs and have the code go through all the files in one run.
My MU3.6 plugin
https://musescore.org/en/project/music-search
is a step in this direction

In reply to by elsewhere

In response to elsewhere:
I am not sure how to more precisely describe what I am referring to. I think the example in my original post is pretty clear-- to be able to identify a melodic sequence by the timing of the notes and the steps upward or downward.

As to your links, the first one is way too technical for me to ever understand. I guess the other link is saying that there is an MU 3.6 plugin available that might do what I want. If so, I don't know how to acquire or use the plug in, so you could direct me, if you wish. Sorry. As you can see, I am not particularly tech savvy.

In reply to by wardricker

Your idea is really interesting.

It would be possible to write a plugin which 'indexed' the pitches and rhythms (note durations) in a score and saved this to a file. These index files would provide an easier means of doing a search/match than processing musicxml or MS's file format. If you restricted the index to a single voice, (the melody), then this approach may not be too difficult to program. You could have options for comparing pitch or rhythm or interval or any combination of these.

In reply to by elsewhere

I posted new versions of the plugin. The original plugin now also handles a ‘mixed’ selection (single notes, chords, rests) but only searches the file of the selection. A new variant MusicSearch+ searches a bunch of files, but is MU3.6 and probably Windows specific (output goes to Notepad).
For details see the plugin page.

If any or most of this sounds Chinese to you, I recommend googling
site:musescore.org (your question/chinese term x)
It’s the best way to get to know MuseScore

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