-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Activate volume envelope by default (#6121) #6864
Activate volume envelope by default (#6121) #6864
Conversation
The deactivated volume envelope leads to clicky sounds. This is fixed by activating it by default for instruments that are added to the project as well as in the default project. The following changes are made to the envelopes: * The amount of the volume envelope is set to 1, i.e. it is activated by default. * The amounts of the cutoff and resonance envelopes are kept at 0 so that users have to opt-in to them. This might also potentially save resources. * The amount for sustain is changed from 0.5 to 1. This way users start with a full sustained sound. * The amount for hold is set to 0. The reasoning for the changes is to enable users to quickly dial in some well known envelopes, especially if they only know ADSR envelopes and don't known how an AHDSR envelope works. A user that wants to dial in some pluck envelope might try to turn the sustain down to 0. However, if the "hold" parameter was set to 0.5 by default it would get in the way and users had to learn that they have to turn the "hold" down to 0. With the new set of default values they can discover the "hold" feature without it getting into the way with simpler approaches. ## Technical details The constructor of `EnvelopeAndLfoParameters` was extended with the new parameter `defaultAmount` so that we are able to quickly set amounts of 1 or 0 for the volume, cutoff and resonance envelopes. See the changes in `InstrumentSoundShaping`. Adjust `default.mpt` according to the code changes so that not only newly added instruments have the better defaults.
We have an old issue for this that I can't seem to find and there was a PR for it that was closed that I also can not find. In that PR the problem with tweaking the envelope was that it makes the samples cut out when played in the Pattern Editor. That's also the issue here. Drop in crash01.ogg or crash02.ogg in a beat in the Pattern Editor. Very staccato. |
Thanks for the links @zonkmachine! And what a mess! It seems that there is no way to fix this for both cases due to deficiencies of the builtin instruments and their "architecture". All instruments (with some exceptions) share the exact same tabs: "Plugin", "Envelope, filter & LFO", "Chord stacking & arpeggio", "Effects", "MIDI" and "Tuning and transposition". The only place where they differ is the "Plugin" tab. So in a way they are all the same instrument and the only thing that's exchanged is the sound source or the way that a sound is generated. I guess the logical order of the tabs is the following:
So the first three tabs or modules are concerned with MIDI manipulation/generation while the last three tabs are concerned with audio generation and post processing. Because they are all baked into the instrument this is rather rigid and inflexible. Due to that architecture an instrument/plugin cannot decide how to react to the incoming MIDI notes. For example a sampler might want to react differently to them than a synthesizer:
The problem is that LMMS' instruments cannot do this because the module "Envelope, filter & LFO" is outside of the plugins. So a sampler will also have to go through step 5 and might have its sample cut short. I have also noticed that in the current master a long sample might be cut short as well. So it looks like the only way to fix this without resorting to hacks is by giving the actual plugins more power and to remove the rigid instrument architecture. I think this is also the reason why the implementation of VSTs, etc. feels so kludgy compared to other DAWs. |
Yes, The first three tabs, the MIDI stuff, I would actually expect to find on the track. To the right of the pan button. If I remember correctly this is how it worked in Logic. |
Yes. The formula for the length of a sample in the Pattern Editor is described here: #2074 (comment) Edit: Better explanation by DomClark #2074 (comment) |
I agree! This is also how it's implemented in REAPER which has some very flexible and intelligent routing of MIDI and audio. In REAPER the first three modules would also be put onto the track before any instruments. A synth plugin would contain things like oscillators/sound generators, filters, modulation, etc. and might also come with some built-in effects. The synth would just interpret and work on the incoming MIDI stream. After the plugin some external audio effect plugins might follow. Ideally the core of LMMS would just consist of MIDI and audio routing, support for plugin interfaces and audio rendering. However, I am not even sure if LMMS' own plugins are really plugins, in the sense that they are just implementations of a plugin interface that do not know anything about LMMS internals. |
Use the old default envelopes for the Kicker instrument that's used in the pattern editor of the default template. This is done so that its notes can ring out again.
Commit 19750c8 implements the second proposal of the list in this comment. The whole PR therefore implements the first two points as of now. |
Implement the following behavior: * If an instrument is dropped into the song editor it is initialized with the new default values of the volume envelope that ensure that notes do not click. * If an instrument is added from the instrument list using the context menu then it is added to the song editor and the same behavior applies. * If an instrument is dropped into the pattern editor it is initialized with the "legacy" volume envelope. This envelope will lead to clicks but enables samples, kicks, etc. to ring out like they did before. Technical details ------------------ Add the method `TrackContainerView::handleDropEvent` which takes a `QDropEvent` and a `bool` that indicates whether the added instrument must be reset to the legacy volume envelope. `PatternEditor::dropEvent` delegates to this new method with the boolean set to `true` because we want the legacy behavior if an instrument is dropped onto the pattern editor. `TrackContainerView::dropEvent` delegates with the boolean set to `false` because we want the new and improved volume envelopes when used in the song editor context. `TrackContainerView::handleDropEvent` contains the previous code of `TrackContainerView::dropEvent` plus the extension that implements the potential resetting to the legacy volume envelopes. Add the method `resetToLegacyVolumeEnvelope` to the following classes: * `Instrument`: delegates to `InstrumentTrack` * `InstrumentTrack`: delegates to `InstrumentSoundShaping` * `InstrumentSoundShaping`: contains the actual implementation using the extended interface of `EnvelopeAndLfoParameters`. Add two methods to `EnvelopeAndLfoParameters`: * Setter for predelay, attack, hold, decay, sustain and release * Setter for the envelope amount Extend `PluginDescWidget::openInNewInstrumentTrack` so that it adds the instrument using the new default envelopes. Extend `InstrumentLoaderThread` so that it knows if the instrument must be reset to the legacy volume envelope.
@zonkmachine, starting with commit e9b5efc this pull request implements the first three proposals from this comment. |
This is already a clear improvement. The issue remains in the Pattern Editor and this will confuse some but I think as a trade-off it's acceptable as a first step to mitigating the issue. |
I have already posted this to #3086 (see here) but I will also put it here for some potential additional discussion. I have a commit that adds a new option in the setup dialog so that users could turn off the "legacy volume envelopes" in the pattern editor as well. It's not pushed to this PR though. It looks as follows: By disabling this option "power users" could make sure that there are no clicks by default when adding instruments anywhere. Currently the default is that the "legacy volume envelope" is applied in the pattern editor but this could also be changed so that users would have to opt-in into the legacy behavior. |
The deactivated volume envelope leads to clicky sounds. This is fixed by activating it by default for instruments that are added to the project as well as in the default project.
The following changes are made to the envelopes:
The reasoning for the changes is to enable users to quickly dial in some well known envelopes, especially if they only know ADSR envelopes and don't known how an AHDSR envelope works. A user that wants to dial in some pluck envelope might try to turn the sustain down to 0. However, if the "hold" parameter was set to 0.5 by default it would get in the way and users had to learn that they have to turn the "hold" down to 0. With the new set of default values they can discover the "hold" feature without it getting into the way with simpler approaches.
Technical details
The constructor of
EnvelopeAndLfoParameters
was extended with the new parameterdefaultAmount
so that we are able to quickly set amounts of 1 or 0 for the volume, cutoff and resonance envelopes. See the changes inInstrumentSoundShaping
.Adjust
default.mpt
according to the code changes so that not only newly added instruments have the better defaults.