Is note offtime limited?

• Jul 13, 2020 - 13:22

I have a guitar "let ring" plugin which extends the length of notes by adjusting the MIDI offtime. However, there seems to be an internal MS limit on the value of this offtime set at 2000. I found this by narrowing my "RingTime" value down and any values above 2000 are simply ignored. I have not put in any code to limit this value so could you confirm that this is indeed some sort of internal limit?

LetRing.png


Comments

In reply to by BSG

Fair enough. It would be more flexible if it was set as an initialisation constant rather than hard-coded, with the default set to 2000. This would enable debugged plugins a bit more scope. I can use a workaround to get higher values but it's a bit clunky.

In reply to by yonah_ag

Then again (from the POV of notation software) if you have to double the note duration without affection notation, there's likely something wrong with the notation...
Why not change that instead?

After all, all you'll end up with is MuseScore playback not matching what a real player will play when it read the sheet music; isn't it?

In reply to by jeetee

I originally went down this route, (a couple of years back), but it led to a lot of tied notes or guitar tabs in 4 voices – which causes issues with stems. After taking onboard advice from the forums I now tab in just 2 voices which makes scoring easier at the expense of playback.

I would use the "Let Ring" option from the "Lines" palette but that option has faults, is slow to apply and intrusive on the display – hence my own plugin, which actually gets the playback closer to a real player.

For example a quaver played by a real player will naturally sustain beyond its written length unless stopped by another fret or a change in chord etc. A quaver in MS will decay pretty quickly after its written length.

Some of the background to this:
https://musescore.org/en/node/286670

In reply to by Spire42

How about putting the limits in the MS ini file, (with the default at 2000), rather than it being hard-coded? This default could be changed by editing the ini file manually or via preferences.

In a 4/4 score a value of 4000 makes sense, i.e. a notated crotchet can playback for the whole measure.
For a quaver a value of 8000 would achieve the same. I haven't seen the need to extend semi-quavers this much so maybe there's no need to go to 16,000.

So I would suggest 8,000.

In reply to by BSG

Point taken, but hopefully there would not be much requirement for a 1/16 note to ring for the whole bar. This effect only makes sense for instruments which can sustain beyond their notated value, like guitars.

Is there perhaps a limit which is defined by the MIDI specification?

In reply to by BSG

Yes, that's another possible solution but feels a bit overkill for a simple guitar ring. I'm using my plugin for speedy and clean application of rings @ 2000.

3000, 4000 and 8000 can be applied via a regex, (of 1003, 1004, 1008), on the music XML file.

My scores are really simple, especially compared to some of yours.

In reply to by BSG

How is offTime defined? Is it specified relative to the nominal start of the note, or is it relative to the effective start of the note (i.e., the nominal start of the note plus the specified onTime offset)?

I was assuming it was the former, in which case it would make sense to have, say, an onTime of -1000 and an offTime of -800. (This would result in a note that starts playing 1000 units before the nominal start of the note and plays for a duration of 200 units.)

But if it's the latter, it would indeed be meaningless to have a negative offTime value.

In reply to by Spire42

The plugin code has:

var events = the_note.playEvents;
var pe0 = events[0];
onTime.text = pe0.ontime + "";
offTime.text = (pe0.ontime + pe0.len) + "";

These are displayed in read-only fields, (blue), and the RingTime field has the user input for the new value of Offtime. From my own scores the Ontime is always zero and Offtime > 0 but this is not enough info to answer your question so maybe someone with more MS knowledge can clarify.

In reply to by jeetee

The Piano Roll editor speaks in terms of onTime and Length. This is wrong, IMHO. OnTime and OffTime are intuitive, and the Articulation Plugin negotiates in terms of them. The internal representation doesn't matter in the UI decision.

In reply to by BSG

@BSG – Totally agree! After all, my plugin is simply a tweaked version of your Articulation plugin. Thanks for said plugin as it was most useful and I learnt a lot. I hadn't come across passing a function name as an argument before so that bit of code had me scratching my head for a bit.

The plugin does ultimately set LEN but it "thinks" in terms of OnTime and OffTime. LEN definitely should be positive only.

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