Piano Roll Editor inconsistency/confusion.
(I'm afraid I might get elected Prince (or dogcatcher) of Piano Roll Editors....)
Create a quarter-note tied to another, over the barline or not.
Go into PRE, and click on the FIRST PART of the note. Set a "len" of 500‰. The upper part of the note will be 500'ded, visibly (in PRE) and audibly (play it back from PRE). While there is a great deal of utility to this interpretation, you "have to know about it". As a matter of fact, even 0 will only blow away the upper portion of the .... what do you call it, "note-complex"?
It shouldn't even really be accepting, or (falsely) reporting len's of non-final-portions of notes.
What I still don't understand is why, when I cut the upper portion from the QML API, it plays correctly, and tells me back (via QML) what I put there, but the PRE still shows 1000 len (and yellow-bar length), although playing what I want it to. I wonder if it cached things thinking that it is the only author of on/off times....
Comments
Just out of curiosity:
After you've done this, have you tried to turn off the piano roll, play once, then turn it back on?
Is everything still the same?
Just a prediction from my previous experience (perhaps from the 2.x version).
Edit: And there was always a problem with the combined notes. (The problem that makes it look like a single note). Although you could edit both on the score separately, it wasn't on the piano roll.
In reply to Just out of curiosity: After… by Ziya Mete Demircan
Yes, and dyed-in-the-wool programmer would try that. It did not help. I did not try closing the score, though... will report that next...
In reply to Yes, and dyed-in-the-wool… by [DELETED] 1831606
It even survives restarting the app. It must be embedded in the state of the first component....
In reply to It even survives restarting… by [DELETED] 1831606
If I use the PRE to cut back the second part to 500, then inspect the off-times from QML, the FIRST part shows as 500, and the second as 1000, the exact opposite of what we hear. In the PRE, both parts report "500". The yellow bars show the second part cut 50%, and that is how it plays. The PRE is putting up the illusion of one note (doesn't matter where you click on it), but what it means is to modify the last component. At very least, QML has to learn about tied note. It is fortuitous and surprising that adjusting the last component via QML works at all.
In reply to If I use the PRE to cut back… by [DELETED] 1831606
Now I'm afraid that i'm creating internally inconsistent scores, although they look, play, and edit without a problem, but the inconsistency might be a problem 3 versions o MuseScore down the road.
In reply to If I use the PRE to cut back… by [DELETED] 1831606
Eh, if you have two tied quarter notes, then set the combined length to 500‰, then I’d expect to hear one quarter (i.e. first note 1000‰ second note 0‰). No idea how I’d expect that to be recorded in the MSCX, but that can stay/be implementation detail, but the PRE ought to show a tied note as one only.
In reply to Eh, if you have two tied… by mirabilos
It does not work that way today. You can try it. The params of the last note are recorded in the mscx as those of the first note, and neither is the "combined note". Don't believe me, try it and see.
The bigger problem right now is that the new plugins, which have already produced terrific results, do this "wrong", (try to adjust the last note, and that's what you get) but MS somehow "likes it", but may not always.
In reply to It does not work that way… by [DELETED] 1831606
Don’t worry, I trust you, I was just setting my expectations clear… from what you wrote, it sounded like setting it to 500‰ would play the length of a dotted quarter, i.e. 75%?
In reply to Don’t worry, I trust you, I… by mirabilos
Mirabilos dictu, that is actually exactly what it does. Don't believe me, ask the PRE.
In reply to Mirabilos dictu, that is… by [DELETED] 1831606
:D
I once had to register on a site which only allows eight-character usernames, and so I was called mirabile there. Perhaps this little anecdote pleases you, fellow curmudgeon ☻
This is chaos. Look at the enclosed tiny nMSCX and open it ; it was written by MuseScore, not hacked by QML, but I used the PRE directed at the FIRST note component to "cut it to 500". Stunningly, it cut the third (of three), as we've been observing, and the PRE showed that, 3rd cut, played that, but the MSCX has an explicit cut note event for the FIRST event!....
In reply to This is chaos. Look at the… by [DELETED] 1831606
I tried (and succeeded) to reproduce that from QML. I created three notes, just like above, and directed QML to cut the first one to 500. And, sure enough, the same inconsistency: the third is audibly cut; QML sees 500, 1000, 1000. Piano Roll editor shows 1000, 1000, 500 (i.e., a 2500 long bar), which is what we hear. XML sees 500, none, none.
So the rule must be, "You can only adjust the last component of a multi-note, but you must do so by adjusting the first with data about the last; the number you supply applies to the last component, not the whole, or the first, or any other". The piano roll editor won't let you do anything else. It should be that QML doesn't let you, either, or maybe the API; the inconsistent stuff we create via QML is a time-bomb, but it plays, edits, writes out, and reads back 100% "correctly". All it doesn't do correctly is piano-roll edit. And this odd dance has to be part of the PRE documentation; you can't use accurately it without knowing this.
In reply to I tried (and succeeded) to… by [DELETED] 1831606
I have looked at the data structure with the debugger window in the Debug build, and, unsurprisingly it reflects the MSCX/XML state of affairs: The notes that play 1000,1000,X bear NoteEvents with offtimes X, 1000, 1000.
I imagine that it is not an accident that adjusting the last note's note events works. Maybe something else depends upon this, in which case, the PRE's non-recognition of it is a bug. Anyone else have any expertise in these woods? At the worst, I'd have to retract my whole technology, and take down all the scores posted with it, from public view until it does this consistently! That would be .... well ... not so great.
In reply to This is chaos. Look at the… by [DELETED] 1831606
Perhaps this was mentioned already but I noticed that in the score only the first note has any
Event
associated with it. The follow-ons have no event info. It's as if the file format assumes the first note speaks for all the tied notes.I think what's happening on file load is that, when an Ms::Note is created, the constructor always preloads it with a single NoteEvent having start=0, len=1000 so you get a backwards looking construction when dumping PlayEvents using QML note by note. From the C++ code:
So is this tied arrangement supposed to be at least two 1/4 notes long PLUS 500 for the 3rd note? Or is it supposed to be just 500 long starting at the first note so that a len range of 3000 may be needed to extend the whole set of ties? I'm asking dumb questions as I'm not a music/synth subject matter expert.
-Dale
In reply to Perhaps this was mentioned… by DLLarson
The intent is exactly what you hear in all cases, effectively 2500 long. I don't want to change the representation, I'm completely happy with only being able to adjust the last component, which is all the PRE allows you now.
Let us put the PRE/UI issue aside for one more urgent. The XML, and the code say that "the first note speaks for the last note, at some level, the whole, but only the last can be adjusted." The problem is that the QML is unaware of this protocol; QML has no access to tie information, and is modifying tie-chain-non-first notes if that's what you ask for; that'd be the first thing we could do stop this bleeding (creating nonstandard files). It's pretty straightforward from the Debugger, but QML has to be aware of it. (QML can create bad files now -- try putting ampersand-foobar in a staffText and the MSCX will not be able to be read). But the "nonstandard files" we create now are "not so bad" as to not "work". QML has to know about ties, so it can at least try to do this right.
A more complex but more robust solution might be to redirect requests/sets for "playEvents" array of a non-first tied note to that of the first at the C++ interface level.
At any rate, I'm now concerned about spreading brokenness in an already ailing world ....
In reply to The intent is exactly what… by [DELETED] 1831606
>QML has no access to tie information, and is modifying tie-chain-non-first notes if that's what you ask for; that'd be the first thing we could do stop this bleeding (creating nonstandard files).<
Actually you do have access to that info. From the
tin-whistle-tab.qml
:That part is not my code but I assume it works.
-Dale
In reply to >QML has no access to tie… by DLLarson
Are the note-components of the tie-back accessible? That would solve everything. Is there any way to get to the first note if you see that? It would be bad to say you can't adjust the last component from the score until you get to the first (i.e., spread this behavior into UX). Or if not, can we make it be?
In reply to Are the note-components of… by [DELETED] 1831606
I'm checking deeper as I don't find that member in the api. Perhaps it was lost in the v3 upgrade like some other stuff I put back for that plugin.
-Dale
In reply to I'm checking deeper as I don… by DLLarson
The easiest solution for now is to refuse to deal with any note which is tied back, but we need better; this mess does not belong in the UX.
In reply to I'm checking deeper as I don… by DLLarson
DELETED_CONFUSING_POST
In reply to Here's what looks to be… by DLLarson
I don't understand your last comment "the exposed items I'm not clear on.". Where in the source is this citation?
In reply to I don't understand your last… by [DELETED] 1831606
What I meant is I have no idea what all that Tie* stuff is why the api gives you first and last. It's too raw.
Looking deeper I find that the Plugin api docs created by Doxygen was showing me the api's for the INTERNAL Ms::Note object. My bad.
-Dale
In reply to What I meant is I have no… by DLLarson
I understand what the API's are and why they're called that, but for now, other than note.tieBack, you say the're not there. Oughtta be there? Better than this?
MessageDialog {
id: tieBackError
visible: false
title: qsTr("Tie-back note error")
text: qsTr("Adjusting a tied-back note is difficult. Press 'Detail'");
detailedText: qsTr("In order to set the articulation parameters for a note " +
"which is other than the first note of a tie chain, you must " +
"set them for the first note (current MuseScore internal restriction.")
onAccepted: {
Qt.quit()
}
}
In reply to I understand what the API's… by [DELETED] 1831606
I'm saying that
tieBack
isn't there either and may have been lost in the v3.0 upgrade.I'm investigating.
-Dale
In reply to I'm saying that tieBack isn… by DLLarson
The
tieBack
property didn't make the v3.0 cut:https://github.com/musescore/MuseScore/blob/f7ae2b63a3dbb112c4b194e119e…
As you can see it has been commented out.
-Dale
In reply to The tieBack property didn't… by DLLarson
Yup. Just discovered it the hard way. We have to fix this; we're creating arguably bad files. Level 1: put back tieBack so I can at least issue the message I just posted. Level 2: Expose the others so we can get it right.
In reply to Yup. Just discovered it the… by [DELETED] 1831606
I'm looking at the other Note based methods which would be easier to do since we already have a wrapper for Note.
Note.firstTiedNote
Note.lastTiedNote
I haven't had time to cut the code though to see how it works. The "Tie*" stuff would be much more complicated. It's not a simple object.
-Dale
In reply to I'm looking at the other… by DLLarson
Those two would be fine, but I must know what they would return if the note isn't tied, and if I can do an address== check (or what) to know when I've gotten to the first of the chain. I suppose it might just give null first and non=null last. I can try it as soon as you can compile it (substitute a module).
In reply to Yup. Just discovered it the… by [DELETED] 1831606
I tested it manually.
In the present case, only the values of the first note are valid, and values aren't correct.
for example: start and length values of two tied quarter notes aren't to same as of a half note.
The start and length values of other tied notes do not matter, they only serve to extend the note.
If you play with the values of the second (and third, fourth if any) notes, you may get unwanted results.
for example: the middle note may disappear from the piano-roll-editor. the length of the note (when play it, although it does not appear that way) may be shortened, etc.
In reply to I tested it manually. In the… by Ziya Mete Demircan
As I said, the start and length of the first note apply specifically to the last note. The start and length of the non-first note should not matter, but the last one can be used to affect playback as though it "worked properly". Do you see the same? There is no way to change the parameters of the non-first notes other than QML code (or .mscx editing).
In reply to As I said, the start and… by [DELETED] 1831606
No, of course there is a way :)
Remove the ties.
Make the settings (adjustments) in the piano-roll-editor.
Put the ties back.
That's my manual test.
In reply to No, of course there is a way… by Ziya Mete Demircan
!!!! So you can create nonsense with the PRE and ties! Let me try that!
In reply to !!!! So you can create… by [DELETED] 1831606
Create Two successive, adjacent quarter notes. In the PRE, cut the second one back to, say 500. Now Just tie the @#$#$ notes. BLAM! The exact same situation created by QML, including proper playback, QML visibility, and PRE ignorance. That's why the situation is supported, and can't be desupported. I am in good company (I and +) in leveraging it.
The bugs are 1) multiple, ill-defined param models for extended notes, 2) PRE ignorance of (1) 3) Ziya's case of removing a tie leaves chaos. My plugins are not buggy. MS and the PRE are,
Thank you Ziya!
In reply to !@#!@$!$!@!@$!@$ (or, Thank… by [DELETED] 1831606
OK, the Ziya test catches the insanity by the neck: Enter two quarter notes; tie them. PRE cut "them" back 500, which actually mutilates the data structure of the first to cut back the second, Discard the tie, play, and laugh: the first will be cut back by its bogus data, and the second will play full.
"What we clearly mean here is not perfectly clear" as a program I once ran famously said. My plugins are the least insane thing here, and there is no need for more QML API until some redesign is attempted,
In reply to OK, the Ziya test catches… by [DELETED] 1831606
I've been dealing with these since 2.x.
And when I want to do something in PRE, I can hardly get the result I want.
it works just on one (untied) note correctly.
Another problem is that when the start time increases, the length remains the same.
You need to subtract the start time from the length value and then apply the desired percentage value to the remaining length value.
Example: Let's say the start time is 150, 1000-150 = 850 (This value is the end of the full value note), Now let's give the gate time: 850 * .80 = 680. Very strenuous processes.
Instead, it is less tiring to define an articulation that we do not use at the time, such as marcato, staccatissimo, according to the approximate value we want in mscx. //Then make it all invisible.
Unfortunately, there aren't enough articulations to use this way.
And I give up constantly :)
In reply to I've been dealing with these… by Ziya Mete Demircan
I have said a hundred times that the PRE should offer "off time", not length, and hide the conversion, "len" is useless. V3 PRE is new enough. And that articulations should be editable. But if you use my plugin, it becomes so. All that becomes so. It is accomplished. Did you read my phrasing tutorial of this morning that exploits it? https://musescore.com/bsg/phrasing .
In reply to I have said a hundred times… by [DELETED] 1831606
State of the art: see https://github.com/BernardSGreenberg/MuseScorePlugins/blob/master/Adjus… .
In reply to State of the art: see https:… by [DELETED] 1831606
Another question is, "how would you 'fix' the PRE UX?" If there is a very odd chaining of notes, say, a whole to a quarter (over a barline) to a sixteenth, do you really want to apply articulation to the whole irregular thing? I think not. You may want to apply on-time to the beginning note, and off-time to the final note, based on those two far-separated contexts. So "two quarter notes, same as half!" is not close enough for my comfort.
In reply to Another question is, "how… by [DELETED] 1831606
answer to "another question":
This is very complicated to solve with Musescore software.
According to my gate-time theory: Gate time is set by denominator, not by total length: //example: for 4/4;
gate-time based on quarter-note.
Or by metronome beat value (If it's different from denominator). //example: 80bpm for half-note = gate-time based on half note
examples (for 4/4):
For values equal or smaller than quarter note, a selected (fixed) gate-time is applied. // note * gate-time.
For larger values than quarter-note, the remained last note of the length is taken into account (after modulus).
https://www.hedsound.com/p/gate-time-theory.html
Of course, while a human-player can do this automatically, even applying it to a simple piece of music with software takes a lot of time.
In reply to I have said a hundred times… by [DELETED] 1831606
Yeah, I just read it. congratulations.
Very detailed, long, beautiful;
Just before the Bach part, you lost me.
and after many more examples, I want to escape to an unknown planet in space //sorry for this :D
I think may be our approach is a bit primitive.
Perhaps a participant with a fresh eye and brain can find a better way.
Workaround: If four or five "user defined gate-time" values are defined (for per score), this may be a workaround for the problem, and PRE can be used for other minor adjustments temporarily. (Until PRE's problems are solved) .
For Legato, the MIDI concept uses a Mono-mode for this.
The software (synthesizer) simply does that: the first note is played normally; next notes (if not contain a gap) are played starting from the sustain section. // The attack and decay portion of the sample is automatically skipped by the synthesizer (the same goes for the glissando).
And all synthesizers (including fluid) can do this when apply two valid CC commands (mono-on, legato-on) and/or (mono-on, portamento-on).
Of course, the main task of a engraving software is to input and display notes.
But the playing part is just as important.
In reply to Yeah, I just read it… by Ziya Mete Demircan
Here's a wild idea; express on-time/off-time in fractions of a whole note, e.g., 1/32, 3/64, etc. (possibly using the slash as a trigger for that mode).
In reply to Here's a wild idea; express… by [DELETED] 1831606
Good idea.
and based of a denominator. // To make a simple thing even more complicated :)
d1.0 = quarter
d0.5 = eighth
d2.0 =half
etc.
using the "d" as a trigger
or an options menu (Whichever is convenient for the user.):
Though, none of this will happen, but it's good to dream.
In reply to Good idea. and based of a… by Ziya Mete Demircan
I can build the application now. Things can now happen (but my skill in Qt UI isn't there yet).
In reply to I can build the application… by [DELETED] 1831606
Dale --
I still think at least some of those API's are needed for accurate QML traversal of music. Knowing that a note is tied and to what is essential for music analysis.
In reply to Dale -- I still think at… by [DELETED] 1831606
For happy people who don't want to deal with piano roll editors, simply create tied pairs and put the staccato dot (shift S) on first one in the first pair, then the other in the other pair, which will have the exact same effect as the PRE manipulations recommended. MuseScore will behave identically as described above. Staccato the first note, and the second will be cut 50%. Untie, and the first will sound cut, and the second restored. Staccato the second (of new pair), and it will behave correctly whether tied to the first or untied and retied. In fact, I have been using portato (same articulation abuse idea as Ziya has just discussed) for a long time on "end notes", producing the same varieties of internal confusion and files differing from PRE action; I didn't understand why I was getting what I was then (in every case exactly what I wanted), but now I do.
I would go so far as to say that the PRE displacement of the articulation parameters to the first note is the bug. When a tied note is PRE modified, it should find and put the parameters in the last note, and respect seeing them there. If you staccato-dot (etc) the first note of a chain, it should either reject the attempt, or do the same (modify the last note), but doing so (staccato etc) articulating the first note of a tie chain is a meaningless thing to do (although one can imagine it being called for, inactive, in the visuals of outré scores).
In reply to For happy people who don't… by [DELETED] 1831606
As usual, Ziya is a few steps ahead of me. The entire per-mille of note system is bankrupt. Pun intended, that's the long and short of it. The idea that a given "articulation" tool can assigned a fixed per-mille is bankrupt (well, maybe it has a few euro in its account ...) A sixteenth note cut in half to make staccato, an eighth note, a quarter in cut time ... that often works passably. But if articulations be abused for, well, ... articulation (phrasing), 85% or 90% might work for the faster notes, but fails completely for longer notes (e.g., canti fermi in chorale-preludes), when "articulation abuse" phrasing must cede to the Piano Roll Editor (or both to the plugin). The whole per-mille system, per mille of note value, is intellectually bankrupt, and the currency should be, as Ziya says, "denominators". I should be able to cut back the start of simultaneous notes of different lengths the same amount with the same number!
Needless to say, "we have a problem" with extant scores were we to contemplate change, but a new per-score option, "What do you want articulation to be measured in? (a) 1/1000 of note (compatibility) (b) 1/1000 of quarter notes (c) ticks (d) 1/1000 of denominator unit etc. (new default)", compatibility could be had.
Bankrupt.
In reply to As usual, Ziya is a few… by [DELETED] 1831606
Maybe we should have something like that:
*1 (remainder) : Remaining after modulus operation. (mod <= note length value of denominator)
In reply to Although the coding of the … by Ziya Mete Demircan
Thousandths of what? By "gate time = 10" do you mean what we now call "off time 990"?
In reply to Thousandths of what? By … by [DELETED] 1831606
PS: I was looking at what could be done without changing the current system ...
1st input box (start-time): no-change; same as current.
example for dotted half note (Assuming quarter note as denominator):
in thousandths:
say: start-time=15; gate time = 45%
1000/3 = 333 (denominator)
The user doesn't see this calculation.
So I added the (% remaining) portion of the gate time, as a simple input.
Edit: I just tried to see if changing the calculation system in the code might work. It may not be ideal.
Or ignore it at all :)
Suppose I speak to myself.
In reply to I have said a hundred times… by [DELETED] 1831606
I fully support that notion. Ideally, there should be a reset to defaults button, too, since you lose the easy 0/1000 as defaults then.
In reply to I fully support that notion… by mirabilos
I don't understand your proposal?
In reply to I don't understand your… by [DELETED] 1831606
Sorry, what I meant was: when we go to on-time and off-time instead of permille, maybe there should be a “reset to defaults” button for a note, to undo every PRE change. With permille, it’s easy (0 and 1000 are the defaults), but off-time depends on the length.
In reply to Sorry, what I meant was:… by mirabilos
The PRE currently has "on-time" and "length". Even with no (proposed) change to the meaning of the numbers, I think "on time"/"off time" far beats "on-time"/"length", as it should be possible to only adjust the on-time, and today it is not. It should be possible to change the off time from 1000 to 900 whether the on-time is zero or not. I have proposed that PRE UI change in an Issue months ago.
My issues are about "what the per-mille are per-mille OF". Indeed "reset to defaults" would become difficult.
In reply to The PRE currently has "on… by [DELETED] 1831606
Add to this the utter hair of tied notes, where the per-mille don't represent the "whole yellow-bar note" at all, but only its last tie-chain-member. Read https://github.com/BernardSGreenberg/MuseScorePlugins/blob/master/adjus… if this is news to you.
In reply to Add to this the utter hair… by [DELETED] 1831606
That’s crazy… what if I tie two quarters and then want to use the PRE to reduce playback time to that of an eighth? Seems impossible with the current buggy system…
In reply to That’s crazy… what if I tie… by mirabilos
Other than the len=>off time fix, what is needed here is clear definition, and, vexingly, compatibility with extant scores. "Crazy", as a technical term, seems basically correct. I would have said that the situation is a mess of confusion, difficult to understand, explain, or work with, and near-impossible to justify. The PRE is trying to hide some of it, which is an approach. Again, verify my revelations with your own experiment.
I do not think it is easy to propose what it should be. It is inextricably wedded to the issue "per mille of what", because clipping equal things off the coincident starts or ends of notes ought be straightforward, whether they're quarter notes, half notes, or a tie-chain equal to the same.
In reply to Other than the len=>off time… by [DELETED] 1831606
We could implement the new model with new XML tags, so existing scores with their old XML tags in the
.mscx
file will still get loaded and handled as before, but anything new could use a sane model.In reply to We could implement the new… by mirabilos
Yes. A sane model is the required foundation for any improvement.
In reply to Yes. A sane model is the… by [DELETED] 1831606
I wish I could find the C++ code in the PRE and synthesis substrate which implements these policies, so I could write of them with more authority. Could you help me find it?
In reply to I wish I could find the C++… by [DELETED] 1831606
Sorry, not at the moment, I’m not very familiar with the source code either, and busy with both $dayjob and preparing for a conference… just trying to get stuff done today that shouldn’t wait for next week.
But I’ll forward the request to dev chat.
In reply to I wish I could find the C++… by [DELETED] 1831606
I did some code spelunking and here's what I found...
When you select an item in the PRE the following function
PianoView::addChord()
is called to add the chord's notes to an internalPianoItem
list.https://github.com/musescore/MuseScore/blob/5979345eae6a768640b707584d2…
You can see that this code walks note.tie's back to the first note and uses that note in its
PianoItem
in later processing:i.e., it always points to the first note in a set of tied notes. Later methods like
PianorollEditor::tickLenChanged(int val)
andPianorollEditor::onTimeChanged(int val)
use this data to access the note to affect the PlayEvent timing.https://github.com/musescore/MuseScore/blob/5979345eae6a768640b707584d2…
https://github.com/musescore/MuseScore/blob/5979345eae6a768640b707584d2…
This might be enough to get you started.
In reply to I did some code spelunking… by DLLarson
Verrry inter-esting, as the late Arte Johnson used to say.... thanks....