Request to control amount of padding added to audio export

• Jan 12, 2018 - 20:40
S5 - Suggestion

Win 10
MuseScore 2.1.0
revision# 871c8ce

For some reason when i export my files MuseScore is adding 2 seconds to the end. I was attempting to create a looping track and so I thought that Unity was the issue until I checked the audio file in VLC and found that there was an extra 2 seconds (ish).

I then googled RE MuseScore and found this:
Where the user states they were not using MIDI but all follow up was regarding MIDI's behaviour and teh fact that the user was using an outdated version. They seemed to have had the problem with all formats, I can confirm for WAV and OGG (I don't want licensing issues so I don't have the MP3 library).

I also found this:
Where apparently MuseScore stretched the actual music to fill an arbitrary file length that was 2 measure longer than the sheet music. The user added the 2 measures but for a looping sound this doesn't work for me. There does not appear to be any follow up.

So, what have I done? Here is my workflow:
- write music
- delete extra bars at end
- export to OGG
Along with all sorts of copying and pasting, sometimes I would also paste to extend the music but this has happened on 3 files of varying length one of which was a copy-paste from one file to another, followed by deletion of the remaining, unused, measures.

I did try to extend the number of measures and thus extend the loop but to no avail, there is still an extra 2 to 3 seconds added so long as there are notes in the final 2 measures. All files are 4/4 time with defaults left in tact.

Is there a place to specify a cutoff time? I checked the notes in the piano roll editor and they appear to stop by the end of the measure. Just to be sure I reduced the length from 1000 to 500 and I could here the quick die off. 2 measures are still added. Just to be sure I tried a final measure with a quarter rest at the end so nothing should be playing (ringing?) anymore. Still extra time added.

Repeated experimentation verifies that 2 measure seem to always be added unless the last 2 measures are completely empty.

Have I missed something? The length of my piece is 18 measures. Does it need to be divisible by a number like 8 perhaps? I tried 24 measures and still the same extra time is added. Can I disable padding?

Thanks in advance to whoever reads this!


Status (old) duplicate active
Status fixed active
Type Functional Wording/Translation

Ah sorry, I misinterpreted the paragraph by lasconic to be refferring only to MIDI, not to a problem with the APIs used by MuseScore other than the MIDI one.

So, assuming available, is there no plan in the future to allow the trail to be cut off through the WAV/OGG APIs after the data has been loaded but before file export? MuseScore will just keep padding as new bugs are found? No option to disable the padding? I found this:

I'm certainly no sound expert, despite 6 years of band starting almost 20 years ago, but as a design philosophy, isn't this in violation of the user contract? If the user can control it, that's one thing, but at minimum a warning should be issued either before or during the "export" function in one of the popups. That should at minimum help keep zombie issues from resurrection.

As a workaround, end your 'loop' score by inserting a normal repeat. That way the export contains a double sample of which the continuation from the first to the 2nd playthrough is seamless. You can then copy-paste midloop-to-midloop sections and cleanly match them.

Title Extra 2 measures added to end of OGG and WAV files Request to control amount of padding added to audio export

I think you might be misunderstanding the referenced issue. The issue isn't some bug in an API or in MuseScore, it's just plain necessary to avoid cutting off the release of the last note (consider things like cymbals that ring far longer than their notated value) and also reverb that adds additional time. If we cut the sound off right on the final barline, the result would sound bad - that's just not how sound works.

That said, sure, I can imagine there might occasionally be some special unusual situation where you want this effect and it might be nice to be able to achieve it directly in MuseScore rather than require editing in Audacity or whatever. So I'm leaving this open as a feature request.

Alright that sounds reasonable. As mentioned I did play with the piano roll editor to no effect but I did observe the ring in audacity so I think you're correct.

The repeat workaround had occurred to me but unless I know the length of a session (like in a time trial) I still have the loop problem.

Anywho, the new feature would be great if you all get a chance to implement. Thanks guys!

Reported version 2.1  
Regression No
Workaround No

I know this is an old thread and it has come up numerous times. I was hoping for a solution to this as well because I am exporting small loops (12 bar blues progression for example) to wave files to use with a looper pedal for practice purposes. Thanks and any help would be appreciated!

Would it work for your purposes to loop it within MuseScore, and export it already looped? If not, for now editing the WAV file is your best bet. Doing it in Audacity is simple enough and wouldn't take but a minute, but I wonder if anyone has tried putting together an automation script for this? I seem to recall Audacity having some options in that area.

I have the same problem when creating wav files for my looper.
This is how I do it:
1. in musescore: export to .wav and to .mid
2. open the midi file in audacity and read the ending time.
3. open the wav file in audacity and cut at the ending time found in the midi file
4. save and copy to looper
It would be nice when there is an option to do this in musescore