LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
7.98k stars 995 forks source link

metronome lag #6932

Open SalutanisOrkonus opened 11 months ago

SalutanisOrkonus commented 11 months ago

Bug Summary

Relatively recently it feels like, the metronome seems to frequently cause the program to lag even in an almost empty project, which makes it very hard to use and work with for, say for example, getting the bpm right for drum loops

Steps to reproduce

Turn on metronome

Expected behavior

it's fine

Actual behavior

it weirdly lags sometimes (not as in the metronome is sometimes off beat, it makes the program itself stutter and/or lag for a split moment)

Affected LMMS versions

1.3.0-alpha.1.430+g999c10e4b

mirk0dex commented 9 months ago

I don't know if it's related, but the metronome also has an extreme sidechain effect on the tracks. The whole song silences when it plays. Maybe this is intentional though.

michaelgregorius commented 9 months ago

The file 6932-MetronomeProblem.zip demonstrates the problem as described by @mirk0dex. It's a project with one 3OSC instance that plays a low sine note. You can clearly hear clicks when the metronome is active. The clicks disappear when the metronome is inactive.

Is this what you wanted to describe @SalutanisOrkonus?

The clicks are also present if the content of the files metronome01.ogg and metronome02.ogg are replaced with pure silence. This indicates that the master stream is indeed replaced with the metronome sound. IMO the metronome should not duck anything but it should just be mixed with the stream of the master channel.

I haven't found the code which introduces the silencing whenever the metronome is playing. The journey seems to start in AudioEngine::handleMetronome though where SamplePlayHandles for the metronome clicks are added.

IMHO the AudioEngine is not a fitting place for the metronome functionality. The AudioEngine should be used by something which provides the metronome functionality, either directly or even with some more layers in between.

SalutanisOrkonus commented 8 months ago

No, I was referring to the program in general lagging on a bunch of metronome clicks always, but it seems that doesn't actually happen all the time anymore? still definitely happens in this project I'm trying my hand at making DnB in though

michaelgregorius commented 8 months ago

What tempo does your song have @SalutanisOrkonus? I wonder if you problem is releated to #4038 (although I cannot reproduce the problem reported there on my machine).

SalutanisOrkonus commented 8 months ago

Just 155

michaelgregorius commented 4 months ago

I cannot reproduce the sidechain effect that was referenced in https://github.com/LMMS/lmms/issues/6932#issuecomment-1858919293 and https://github.com/LMMS/lmms/issues/6932#issuecomment-1864526644 anymore.

Can you still reproduce the original problem @SalutanisOrkonus? Perhaps it has been fixed in the meantime as well.