need specific plugin:copy and paste notes according a percentage of duration
Hi,
if i copy/paste in double duration, the duration percentage is 200%
if i copy/paste in half duration, the duration percentage is 50%
i need a qml script that :
-selects and copies a group of notes
-asks me for the new duration percentage between 0 and 200%.
-pastes this group of notes according to the new duration percentage
thnks
Comments
There may not be a note value at percentages other than 50% and 200%. For example, I think it's almost definite that there's no note available to paste that is 73% of ANY note. At a guess, I would say that only 25%, 50%, 75%, 100% (no change), 125%, 150%, 175%, and 200% are even possible and most of them (indeed, all of them except 25%, 50%, 100%, and 200%) are problematic to some degree.
In reply to There may not be a note… by TheHutch
Yes,you are right !
i need a qml script that :
-selects and copies a group of notes
-asks me for the new duration percentage is a multiple of 25 between 0 and 200
-pastes this group of notes according to the new duration percentage
In reply to Yes,you are right ! i need a… by fionacar
Instead, you need a DAW. For example Cubase has the 'Logical Editor' which allows any type of transformation. But Cubase is also (secondarily) a 'notation software': if you go and see the result of unusual transformations after removing the 'quantization' you will realize the absurdity of your request.
In reply to Yes,you are right ! i need a… by fionacar
If you're on MS3 you can definitely write a plugin to do that. Not sure about MS4. For a good example see the Duration Editor plugin:
https://musescore.org/en/project/duration-editor
In reply to If you're on MS3 you can… by yonah_ag
Of course it can be done. But in my opinion we must also think about the practical side of the issue. A simple dotted quaver (360 ticks) at 75% becomes a value of 270 ticks: this value cannot be represented by a single note. The developer will have to think about how to represent it in relation to its position in the measure; if it is at the beginning of the bar we will have a quaver tied to a hemi-demi-semiquaver. And this for a simple dotted quaver, and to obtain an illegible score. Best wishes to the developer!
In reply to Of course it can be done… by ILPEPITO
With the plugin API nothing is ever as simple as "of course it can be done" so I am just confirming to the OP that it would be possible. It may be obvious to you but may not be obvious to the OP.
In reply to Yes,you are right ! i need a… by fionacar
ChatGPT m'a donné ce script qml qui contient des erreurs que je n'arrive pas à corriger:
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Dialogs 1.2
import MuseScore 3.0
MuseScore {
menuPath: "Plugins.ScaleAndPasteNotes_3"
description: "Copies selected notes, scales durations, and pastes"
function showPercentageDialog() {
var dialog = Qt.createQmlObject(
`import QtQuick.Dialogs 1.2;
import QtQuick.Controls 1.4;
}
}
Quelqu'un peut-il le corriger?
In reply to ChatGPT m'a donné ce script… by fionacar
This plugin is nonsense, no wonder ChatGPT wrote it. Unfortunately it is not so simple to conceive a plugin that can realize your requests. For one thing, 'duration' does not belong to the 'note' object, and it is a complex object, it cannot be calculated directly, and if I remember correctly it is also 'read-only' (and this would only be the least of the problems...)
In reply to This plugin is nonsense, no… by ILPEPITO
I have recently been wrestling with note duration modification in a plugin. As you rightly say, duration does not belong to the note object but to the chord object, (via the properties inherited from the DurationElement). I could not find a way to modify duration directly and had to resort to cmd('pad-note-n'), which is very slow.
In reply to I have recently been… by yonah_ag
No, you cannot directly change note durations. Personally I prefer to memorize them (the notes), and then rewrite them with 'setDuration' and 'addNote', but each has its own methods. The two methods I mentioned also have limits: the main one is that if I change the duration of a note and end up having a fraction that does not correspond to a single note, I will have to manage the creation of more notes. Finally, the creation of ChatGTP is rather abstract: the management of the new positions of the notes is totally missing (essential above 100%, if I have not misunderstood the meaning of the request, not very clear), even if this is perhaps not due to ChatGTP.
In reply to No, you cannot directly… by ILPEPITO
I'll have a play with setDuration and addNote - it might well be quicker. My scenario will not generate unpleasant fractions.
Yes, ChatGPT's solution is rather abstract. I guess it was worth a try.
In reply to I'll have a play with… by yonah_ag
I wrote chatGTP instead of chatGPT...I must be allergic to AI. I have no idea if it can be faster, certainly 'addRest' and 'addNote' allow you to insert dotted values directly; also, it works with Musescore4 ('cmd' instead I think not). If your scenario only involves transformations with division and multiplication with the number 2, there will certainly be no problems.
In reply to ChatGPT m'a donné ce script… by fionacar
Well maybe it's a starting framework but ChatGPT clearly lacks sufficient knowledge of the MS plugin API.
This plugin already has double and half options:
https://musescore.org/en/project/note-duration-actions
In reply to This plugin already has… by yonah_ag
at yonah_ag . I apologize, but I don't think you understood that the requester (the OP?) has no intention of writing the plugin, but would like someone else to write it for him...
In reply to at yonah_ag . I apologize,… by ILPEPITO
🙃
Yes, I think that you are correct.
(OP = Original Poster)
In reply to 🙃 by yonah_ag
(OP = Original Poster).
Thank you. You learn something new every day...
In reply to 🙃 by yonah_ag
Or Opening Post
In reply to Or Opening Post by Jojo-Schmitz
Now I've learnt something new too.