My Music (Listen with quality headphones)

Saturday 9 February 2013

How to remove the click at the end of loops exported from LMMS

UPDATE 20130210: Apparently the problem is with VST plugins because you can't use their envelope settings to set release to 0 (which would fix the problem):
"Note: the first thing that must be emphasized is that no VeSTige instrument will respond to anything on this tab! You can't use envelopes or filters, because VST generates sounds using an internal method that excludes LMMS's envelopes completely."


In LMMS 0.4.14-rc1 you can export tracks as loops:
Project > Export > choose filename > Save > click "Export as loop" > Start

If you open the loop in e.g. Audacity and loop it, you might hear a little click sound at the end of the file. This can be because the wav doesn't end in the middle, i.e.:





To fix this for a specific file, you can do it manually in Audacity by selecting the last part of the wav where it's in the middle, then hold in the Shift key and press the End key > Effect > Fade Out.



To fix this in a batch process, for many files, automatically, do this:
0) If you don't have sox installed:
sudo apt-get install sox

1) Open a terminal. Change directory to the folder containing the loop files to post-process:
cd /path/to/loops/to/fix/


2) Loop through the files and add a fade out effect using sox:
for w in *.wav;do sox "$w" "${w%.wav}_.wav" fade 0 $(soxi -D $w) 0.00045;done

Note: soxi -D $w outputs the length of the audio input file.

1 comment:

  1. Excellent fix Nick! This can fix any sample that need the fade effect added, not just LMMS!

    -Tres

    ReplyDelete

My content is under the Creative Commons Attribution 3.0 license. I work hard to publish relevant and useful information in order to help people learn difficult things and find solutions to their problems, so please attribute me if you reuse my content elsewhere.