5.4 breaking change: why was MPESynthesiserVoice::wasStartedBefore() removed?


#1

MPESynthesiserVoice::wasStartedBefore() was a public function in 5.3.x but is no longer present in 5.4. It provides access to the private variable noteStartTime. This deletion breaks our subclass of MPESynthesiser::findVoiceToSteal(), which has a very slightly modified copy of the JUCE code. The 5.3.x JUCE code uses wasStartedBefore() while the 5.4 code accesses noteStartTime directly, which it can do because MPESynthesiser is declared a friend of MPESynthesiserVoice. Our code can’t access noteStartTime directly because subclasses of friends don’t inherit friend access.

Could I humbly ask for the restoration of MPESynthesiserVoice::wasStartedBefore(), since without it creating custom voice-stealing code is going to be much more difficult?

As far as I can tell, this breaking change wasn’t documented, but feel free to point me in the right direction if I missed something.

Thanks.


#2

We removed that method as the note on time was never actually being set. This commit sets it correctly, but if you need access to the note start time for your own note sorting algorithm we can just make the noteOnTime variable public. Would that work for you?


#3

Thanks–making the variable public would be just fine.


#4

OK, I’ve pushed this and it should be on develop shortly. We’ll be doing a 5.4.1 release sometime next week so it’ll make its way onto the master branch then.

Just a heads up - you might get different behaviour in your note sorting algorithm in JUCE 5.4 as the noteOnTime is actually being set correctly whereas before it was always 0.


#5

Hey, I see that it’s already been pushed as an update. Thanks a bunch! And thanks for the heads-up; it won’t be a problem, we’re just short-circuiting the voice-stealing code a little bit so that the user can limit the number of voices.