Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For large scores exported as audio or played continuously, MuseSounds staves are out of sync with the other staves #19232

Open
metasekk opened this issue Aug 30, 2023 · 6 comments
Assignees
Labels
muse sounds P1 Priority: High

Comments

@metasekk
Copy link

metasekk commented Aug 30, 2023

Issue type

General playback bug & Muse Sounds bug

Bug description

When a score becomes large enough and is exported as audio (e.g. mp3) or played without interruption, there comes a point when the staves that use MuseSounds will sound distinctly out of sync with (specifically, ahead of) the ones that don't use MuseSounds. The delay between staves is increasing gradually. It happens in the exported audio file, and it is reflected in the playback of the score if the latter is sustained long enough.

Steps to reproduce

  1. Create a new empty score with at least one staff using a MuseSounds instrument, and one that doesn't;

  2. Add many bars (for instance 999);

  3. Go to the beginning of the score;

  4. Write the same notes on the two staves mentioned above, so that they should play at the same time. During playback, hear that they are indeed synchronized;

  5. Export the score as mp3;

  6. Notice that the notes of the two staves are synchronized in the exported mp3 file, as expected.

  7. Now repeat steps 1. to 5., but write the notes at the end of the score instead. Notice that the notes of the two staves are out of sync in the exported mp3 file.

Screenshots/Screen recordings

I provide a video here where I apply the steps that I mentioned before (the piano uses MS Basic, while the violin uses Muse Sounds).

Here is also a proof of concept on a toy score, showing that the delay is growing progressively.

MuseScore Version

Checked in 4.1.1, 4.2.0, 4.3.0 and master (4.4).

Regression

I don't know

Operating system

Win10 (22H2); RAM: 16Go; CPU: Intel Core i5-9300H (2.40GHz)

Additional context

Like #20019, it seems to be depending on the sample rate (files exported at 44100 Hz show more delay than those at 48000 Hz, in particular).

It has been reported on musescore.org in https://musescore.org/en/node/361212 and https://musescore.org/en/node/344031#comment-1203191.

@bkunda bkunda added the P1 Priority: High label Sep 1, 2023
@metasekk

This comment was marked as outdated.

@metasekk metasekk changed the title For large scores exported as mp3, MuseSounds staves are out of sync with the other staves For large scores exported as audio, MuseSounds staves are out of sync with the other staves Sep 27, 2023
@metasekk
Copy link
Author

While other synchronization problems (#20019, #20021) seem to have been solved with the latest update of MuseSampler, this issue is still reproducible in MuseSampler v0.5.1.62.

@MarcSabatella
Copy link
Contributor

MarcSabatella commented Dec 22, 2023

Please ZIP and attach a score that demonstrates this issue, and describe exactly where in the exported audio to listen in order to hear the problem.

@metasekk
Copy link
Author

metasekk commented Dec 23, 2023

Please find attach a simplified score for the issue, as well as the result when exported as mp3 in MuseScore 4.2.0 with MuseSampler 0.5.1.62. In this example, Piano 1 uses MuseSounds Grand Piano, while Piano 2 has MS Basic Grand Piano. You should listen to bars 1-4 (beginning of the score, 0-8 s in the exported audio), and then 1126-1129 (end of the score, 37:29-37:37 in the exported audio).

19232_Toy_score.zip

@metasekk
Copy link
Author

metasekk commented Dec 25, 2023

I've investigated further, and the issue seems very different from what I had described at first.

  1. When played in MuseScore, MuseSounds staves seem to play at a slightly higher speed [1] than the other soundbanks [2], so that the staves that use Muse Sounds are gradually desynchronizing with the others (more precisely, they're getting ahead of the others). Here is a proof of concept on a toy score similar to the one that I attached in my previous comment.

[1] This has probably something to do with sample rates, since scores exported at 44100 Hz are more out of sync than those with 48000 Hz (see the corresponding files).
[2] I tested MS Basic and a VST.

  1. As a consequence, the desynchronization does happen in the playback of the score, and not just in the exported audio, as the initial issue made it seem; but the playback needs to be sustained for a sufficient amount of time for the desynchronization to reveal, so that it can't be heard for playback of short scores, although the issue is likely to be present from the beginning.

  2. Summing up, two conditions are needed for the issue to be noticeable: (i) a long score, for the gradual desynchronization to be perceptible, and (ii) it requires the playback to be sustained with no break. Point 2, in particular, justifies why this issue is unlikely to be naturally heard during the playback (I suspect it is not common to play a score for a long time with no break, yet, starting the playback again resets it in a synchronized state...) but very easily perceptible in the exported audio (where I suspect that the exportation engine mimics a continuous playback?).

  3. I am still investigating to know roughly at which point the issue emerged (in the history of MuseSampler and/or MuseScore 4), so as to know in particular if it is a MuseSampler regression.

@cbjeukendrup cbjeukendrup changed the title For large scores exported as audio, MuseSounds staves are out of sync with the other staves For large scores exported as audio or played continuously, MuseSounds staves are out of sync with the other staves Dec 25, 2023
@metasekk
Copy link
Author

metasekk commented Dec 26, 2023

Completing Point 4 of my previous comment: it turns out that I fortunately have a backup for version v0.3.2.18 of MuseSampler (dating back to December 2022). I could force MuseScore to use it by putting "MuseSamplerCoreLib.dll" directly into the "\bin" folder of the app (it works well in nightly builds too).

musesampler-win-0.3.2.18.zip

In my tests, the issue proves to be present since at least MuseSampler v0.3.2, as can be heard in the exported audio here (Sampler 0.3.2.18, MuseScore 4.3.0). Note that MuseSounds falls silent at 35'47 due to #15768 affecting v0.3, but the desynchronization can be heard before.

I found the issue using MuseSampler v0.3.2.18 in Master (4.3), 4.2.0, and Beta 4.1.0, but I could not check earlier versions of either MuseScore or MuseSampler.

I hope this helps !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
muse sounds P1 Priority: High
Projects
None yet
Development

No branches or pull requests

6 participants