Commit Graph

4386 Commits

Author SHA1 Message Date
regulus79
6bde3fb492 Fix Crash when Reversing Empty MIDI Clip (#7893) 2025-05-15 22:45:17 -04:00
regulus79
61736a97b6 Ensure clips have auto-resizing enabled by default (#7874)
A follow up to #7477, which ensures clips have auto-resizing enabled by default. This is needed because auto-resizing was the default behavior, but the code tried to use this newly added attribute with a default of 0 (i.e., auto resizing is not enabled).
2025-05-04 16:42:43 -04:00
regulus79
06d897bc4d Fix crash when playing Pattern Editor without Pattern Track (#7862)
Fixes a crash that occurs when attempting to play within the Pattern Editor with no Pattern Track created.

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-05-04 15:59:16 -04:00
regulus79
1c62638696 Fix issue with Mixer key events and Track Label Button focus (#7870)
A follow up to #7762 to fix various issues involving key events and focus grabbing problems.
2025-05-04 15:50:33 -04:00
cyberrumor
41093efcbe Revert "Fix PeakController attack/decay (#7566)" (#7871)
Prior to commit b5de1d50e, audible zipper artifacts were present when
using the PeakController on a bus to control the volume of another bus
for sidechain compression. The bus that had its volume reduced was the
one which produced audible artifacts.

Commit b5de1d50e introduced LERP to PeakController to smooth out its
signal, which eliminated the zipper artifacts. However, this had the
side effect of increased latency even when both attack and decay
settings were set to zero.

Until a more robust solution is implemented, reverting this change
eliminates the latency by eliminating the lerp, but reintroduces audible
zipper artifacts.
2025-05-02 11:04:47 -04:00
regulus79
679f9b848e Add splitting (and resizing) to all types of clips (#7477)
Allow for splitting and resizing all types of clips (automation, MIDI, sample, pattern, etc) using the knife tool in the Song Editor.

---------

Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-04-29 17:56:13 -04:00
Michael Gregorius
c91c81eee7 Update src/3rdparty/qt5-x11embed to latest version (#7825)
Update the submodule https://github.com/Lukas-W/qt5-x11embed.git to commit 499d737c8e8.

This is done to enable LMMS to build with CMake 4 and newer.
2025-04-28 19:21:20 +02:00
Andrew Wiltshire
d403a54140 Add option to favorite items in the file browser (#7753)
Added the ability to favorite items. This gets added to its own tab named "My Favorites".

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-04-27 21:34:37 -04:00
regulus79
510fbf6ffc Global Spacebar Play (#7762)
This PR refactors how the spacebar is handled by the editors and the MainWindow to allow it to play/stop (Shift+Space for play/pause) the last played editor, no matter if it is in focus or not.

---------

Co-authored-by: Fawn <rubiefawn@gmail.com>
Co-authored-by: Sotonye Atemie <satemiej@gmail.com>
2025-04-26 18:26:26 -04:00
regulus79
32c427eab4 Add Midi Reversing (#7606)
Adds the ability to reverse the selected midi notes in the PianoRoll.

The tool is located under the wrench icon in the PianoRoll and can also be triggered with Shift-R.

---------

Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
2025-04-19 15:40:21 -04:00
regulus79
cb8badc0bb Fix Clip Creation Quantization in Song Editor (#7763)
Previously, clicking on a track or dragging in a sample would always create a clip on the closest/previous bar, no matter what the Song Editor's snap size was. This fixes that issue by using the Song Editor's quantization when placing new clips, so for example if the snap size is 1/4 bar, the clip will be added at the closest/previous 1/4 bar mark.
2025-04-19 15:08:15 -04:00
Cas Pascal
64053342d8 [Follow up] Improve performance when rendering sample waveforms (#7695)
A follow up to 786088baec to fix rendering issues and crashes.

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-04-15 23:40:16 -04:00
Andrew Wiltshire
c2912b89ee Auto assign MIDI device when track is created (#7835)
Newly created MIDI tracks were not automatically assigned to the desired MIDI device when the option to do so was specified in settings. This commit fixes that.
2025-04-12 23:42:15 -04:00
Tres Finocchiaro
3f0044dc7f Handle SIGINT (#7698)
Handle SIGINT
Allows Ctrl + C to close LMMS for unix-like environments that 
---------

Co-authored-by: Fawn Sannar <rubiefawn@gmail.com>
2025-04-11 10:25:27 -04:00
SpomJ
9cb3ae7de1 Add build flags to output of lmms --version (#7780) 2025-03-31 10:36:29 -04:00
Dalton Messmer
16296c1dfb Fix Vestige file browser filter (#7816)
- Remove pointless *.exe option
- Add an "All VST files" option on Linux when there is both LinuxVST and Wine VST support
- Remove *.dll option from Linux builds without Wine VST support (i.e. LinuxVST-only builds)
2025-03-26 21:31:38 -04:00
Fawn
8afe95aeaf Fix track operations button alignment, size, and style (#7779)
Make the track ops button consistently sized and style it and the solo & mute buttons using CSS instead of SVG assets
2025-03-25 19:02:08 -06:00
Sotonye Atemie
1d5f2c0050 Add ability to change sample rate in the settings menu (#7719)
Add a slider in the audio settings menu to allow users to select a few standard sample rates, those being 44100, 48000, 88200, 96000, and 192000.
2025-03-25 16:27:00 -04:00
Tres Finocchiaro
498315ef48 Make buttons automatable on macOS (#7813) 2025-03-24 13:34:28 -04:00
Rossmaxx
7367750823 [Code Cleanup] Cleaned up some header files and move a bit of debugging logic to cmake (#7677)
* Renamed lmms_basics.h to LmmsTypes.h and scoped it down for that purpose.

* Shifted the LMMS_STRINGIFY macro to it's own header.

* Removed the debug.h header file and use cmake to handle the macro logic.

* Remove some unused headers and include directives
2025-03-24 19:07:46 +05:30
regulus79
db9ccbeb56 Add Strum Tool to Piano Roll (#7725)
Adds a complex strum tool to the Piano Roll, allowing the user to take a selection of chords, and drag around the notes to shape the strum exactly how they want it.

---------

Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
Co-authored-by: Sotonye Atemie <satemiej@gmail.com>
2025-03-22 05:54:40 -04:00
Fawn
6af3ab5875 Fix missing update to mixer channel name when created (#7795)
Fixes a regression from 07baf9e27a, in
which a channel that was created through a tracks "Assign track to new
mixer channel" context menu would display an incorrect name until it was
renamed by a user.
2025-03-21 06:07:15 -04:00
Fawn
953f6b7351 Rework Crossover EQ plugin GUI (#7781)
* Switches to SVG assets
* Fixes layout issues
* Refactors redundant code

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
2025-03-20 01:30:29 -04:00
regulus79
b9cb343d8b Revert "Change tooltip window flags (#7613)" (#7761)
This reverts commit b21a2696a9.
2025-03-19 21:29:44 -04:00
cyberrumor
fd32158861 Fix crash when switching opened projects (#7797)
* Fix crash when switching opened projects #7793

When the DAW is already running with an open project and you attempt to
open another project via File > Open, a segfault used to occur.

The crash seems to have been caused by model()->value(), which was
called in Fader::getModelValueAsDbString(). The model() function
looked like it should return a pointer to an AutomatableModel.

I suspect that when a model was dropped in favor of loading models for
a new project, the AutomatableModel pointer became a null pointer.

Add a check to the AutomatableModel pointer so getModelValueAsDbString
returns early (before accessing member functions) if the pointer is
null. This fixes the crash.
2025-03-19 13:23:53 -04:00
szeli1
f72ae32fd3 Ensure hidden full-screen windows are restored in the correct position (#7752)
Fix bug introduced with #7595 where drag-moving the MDI canvas background would break the show/hide behavior of a fullscreen window.

Closes #7751
2025-03-17 15:35:28 -04:00
Andrew Wiltshire
b0f9480d3c Fix SVG Scaling; Allow SVGs to be rendered at sizes other than their natural size. (#7769)
Allow embed.cpp to load SVG assets at screen DPI by leveraging QPixmap::setDevicePixelRatio

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
Co-authored-by: Fawn <rubiefawn@gmail.com>
2025-03-14 15:05:45 -04:00
Fawn
91f750d2c2 Fix track operations widget vertical alignment (#7765)
In #7708, the track operations widget was given a centered vertical alignment in order to fix an aesthetic layout issue. This is being reverted, since it is possible to resize tracks, and all the other track interface elements are top-aligned.
2025-03-13 11:12:33 -06:00
Fawn
7f2761df9b Fix incorrect graph step size behavior (#7703)
The y-axis quantization for graph values was being calculated
incorrectly. This would have gone unnoticed since the only step sizes
currently used are 0 (continuous) or 1. Any other values produce
"sloped" quantization. This fix prevents this error from affecting
any future uses of graphModel.
2025-03-11 16:53:29 -06:00
Fawn
6233c5b9e4 Update mute and solo buttons, add them to instrument windows (#7708)
* Add mute and solo buttons to instrument windows
* Change mute and solo buttons to optimized CC0 SVG assets
* Icons provided by @StakeoutPunch, button backgrounds provided by
@RebeccaDeField

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
Co-authored-by: Rebecca Noel Ati <contactme@rebeccadefield.com>
Co-authored-by: Stakeout Punch <StakeoutPunch@users.noreply.github.com>
2025-03-11 14:30:04 -04:00
Michael Gregorius
8821d88c09 InstrumentSoundShaping refactoring (#7229)
* Accessors for volume, cutoff, resonance

Add private accessors for the volume, cutoff and resonance parameters (envelope and LFO).

This makes the code less technical and more readable as it for example removes lots of static casts. The casts are now done in a special helper method that returns the parameters for a given target.

* Remove EnvelopeAndLfoParameters array

Remove the `EnvelopeAndLfoParameters` array and use explicit instances for volume, cutoff, resonance. This simplifies construction and initialization of the instances.

Besides the array this also removes the `Target` enum and the `NumTargets` value.

To simplify storage and retrieval of the parameters three private methods have been added which provide the node names of the volume, cutoff and resonance parameters.

Adjust `InstrumentSoundShapingView` to the removed `NumTargets` property.

* Use references instead of pointers

Use references to the volume, cutoff and resonance parameters instead of pointers.

* Remove friend relationship

Remove the friend relationship between `InstrumentSoundShaping` and its related view by providing the models via getters.

* Get rid of targetNames

Get rid of `InstrumentSoundShaping::targetNames` by using translations and strings directly. Move the remaining stuff into `InstrumentSoundShapingView` until it is removed there as well.

* Explicit EnvelopeAndLfoViews

Remove the array of EnvelopeAndLfoViews and use dedicated instances instead.

This also enables the final removal of the remaining `targetNames`.

* Move the code of some getters

Move the code of some getters into the header file.

* Several code review changes

Apply some code review proposals.

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-03-09 11:25:00 +01:00
Sotonye Atemie
f44aa3edc3 Refactor OGG export and always use VBR (#7697)
Refactors `AudioFileOgg`, a class used to export to OGG files. There were problems reported of the exported OGG file failing to be played back on some systems. To fix this issue as well as to improve code quality, the class was refactored. In addition, VBR (variable bit rate) is always used, with the quality of the export being determined by a ratio of the selected bit rate and the maximum bit rate allowed. This change naturally occurred when refactoring, though the libvorbisenc documentation recommend VBR for improved audio quality.
2025-03-07 10:23:30 -05:00
regulus79
c12fd571f5 Allow cutting multiple notes at once in Piano Roll (#7715)
Adds the ability to cut multiple notes at once in the Piano Roll. Users can select the Knife tool and create a cut line by holding the mouse and dragging it across the notes that should be cut. This also allows cutting the notes at an angle. When releasing the mouse, the Shift key can be pressed to remove the shorter end of the notes that were cut. If any notes are selected, only they will be considered for the cut, even if the cut line covers more notes.
2025-03-02 18:29:29 -05:00
szeli1
5fa01e7dbc Navigate workspace in the main window by dragging the mouse (#7595)
The scroll bars shown in the main window were removed in favor of a new navigation feature that utilizes dragging the mouse instead. Users can now hold the mouse down on an empty part of the workspace and drag the mouse around to navigate where necessary.
2025-03-02 18:03:37 -05:00
Oskar Wallgren
ef1d86fa41 ExportProjectDialog: Remove arbitrary loop count limit (#7724)
Increases the number of max loops when exporting above 99
2025-03-02 20:37:26 +01:00
Andrew Wiltshire
9159533814 FileBrowser: "Open containing folder" automatically selects file in the OS's file manager (#7700)
Introduces a new class FileRevealer to manage file selection across different platforms (Windows, macOS, Linux, and other *nix operating systems with xdg). Includes methods to open and select files or directories using the default file manager on the respective platform.

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-03-01 19:38:51 -05:00
Michael Gregorius
3c3441bb0c Faders with a dB scale (instead of linear/percentage) (#7636)
* Use dbFS scale for the faders

Make the faders use a linear dbFS scale. They now also change position on first click and can then be dragged.

The `Fader` class now has a new property called `m_faderMinDb`. It's the minimum value before the amplification drops down fully to 0. It is needed because we cannot represent a scale from -inf to maxDB.

Rename `knobPosY` to `calculateKnobPosYFromModel` and move the implementation into the cpp file. The method now first converts the model's current amplification value to dbFS and then computes a ratio based on that values and the minimum and maximum dbFS values.

Add the method `setVolumeByLocalPixelValue` which takes a local y coordinate of the widget and sets the amplification of the model based on a dbFS scale.

Adjust `mousePressEvent` and `mouseMoveEvent` so that they mostly take the local y coordinate of the event and use that to adjust the model via `setVolumeByLocalPixelValue`.

Remove `m_moveStartPoint` and `m_startValue` and they are not needed anymore.

* Apply curve to faders

Apply a curve, i.e. the cube function and its inverse, to the fader
positions to that we have more space to work with in the "interesting"
areas around 0 dB and less space in the area where we tend to "-inf dB".

Set the minimum dB value of the fader to -120 dB to increase the potential
headroom.

* Support for dB models

Add support for models that are in dB.

There's a new member `m_modelIsLinear` which can be set via the
constructor. The default value in the constructor is `true`.

Add the method `modelIsLinear` which can be used to query the parameter.
It is used in `calculateKnobPosYFromModel` and
`setVolumeByLocalPixelValue`. Both methods got extended to deal with
models in dB. They were also refactored to extract code that is common
for both cases.

Ensure that the constructor of `Fader` is called with `false` for
`CrossoverEQControlDialog` and `EqFader` because these use models that
are in dB.

* Show current dB value of fader in tool tip

Show the current value of the fader in its tool tip. Please note that
this value is always shown in dB because the goal should be to get rid
of the linear values for the faders.

Some of the code is extracted into the new method
`Fader::getModelValueAsDbString` which is shared by
`Fader::modelValueChanged` (also new) and `Fader::updateTextFloat`.

Please note that `getModelValueAsDbString` will use "dB" instead of
"dBFS" as the unit and that it will format "-inf dB" instead of "-∞ dB".
These changes will also be visible in the text float that is used to
show the new values as the fader is being dragged.

* Let users enter values in dB

Let users enter values in dB in the dialog that opens with a double
click.

The minimum value that can be entered is the minimum value that the
fader allows to set, i.e. -120 dB. The maximum value is the maximum
value of the model converted to dB. As of now this is ~6 dB. The
current value is converted to dB. If it corresponds to "-inf dB", i.e.
if the amplification is 0 then the minimum value is used.

* Remove option "Display volume as dBFS"

Remove the option "Display volume as dBFS" from the settings dialog and
the check box option "Volume as dBFS" from the "View" menu. Volumes are
now always treated as dB, i.e. all evaluations of the property
"displaydbfs" have been removed which results in assuming that this
option is always true.

The upgrade code in `ConfigManager::upgrade_1_1_91` was left as is.
However, a note was added which informs the reader that the value of
"displaydbfs" is not evaluated anymore.

* Extend Fader::wheelEvent

Extend `Fader::wheelEvent` for the case where the model is not a dB
model (`modelIsLinear() == true`), e.g. for the mixer faders. In that
case it works as follows. Each step increments or decrements by 1 dB if
no modifier is pressed. With "Shift" pressed the increment value is 3 dB.
With "STRG" ("CTRL") pressed the increment value is reduced to 0.1 dB. If
the value goes below the minimum positive dB value that is allowed by the
fader then the fader is set to "-inf dB", i.e. zero amplification. If the
fader is set to "-inf dB" and the users want to increase the value then
it is first set to the minimum positive value that is allowed by the
fader.

If the model is a dB model then the same behavior as before is used.
Although it should be considered to adjust this case as well. These
models are used by the faders of the Crossover Equalizer, Equalizer,
Compressor and Delay and they are not very usable with the mouse wheel.

* Adjust the wheel behavior for faders with dB models

Make the faders of the Crossover Equalizer, Equalizer, Compressor and
Delay behave like the mixer faders, i.e. step in sizes of 3 dB, 1dB and
0.1 dB depending on whether a modifier key is pressed or not.

Extract some common code to do so and add some `const` keywords.

* Less "jumpy" knobs

Implement a more stable knob behavior.

Remove the jumping behavior if the users directly click on a volume
knob. By storing the offset from the knob center and taking it into
account during the changes it now also feels like the users are
dragging the knob.

Changes to the amplification are now only applied when the mouse is
moved. This makes the double click behavior much more stable, i.e. if
users click on the knob when it is at 0 dB the dialog will also show
0 dB and not something like 0.3 dB because the first click is already
registered as a change of volume.

If the users click next to the knob the amplification will still be
changed immediately to that value.

## Technical details

To make the knobs more stable a variable called `m_knobCenterOffset` was
introduced. It stores the offset of the click from the knob center so
that this value can be taken into account for in the method
`setVolumeByLocalPixelValue`.

* Make MSVC happy

Add an indication that a float value is assigned to a float variable.

* Introduce constexpr for scaling exponent

Introduce the `constexpr c_dBScalingExponent` which describes the
scaling exponent that's used to scale the dB scale in both directions.
This will simplify potential adjustments by keeping the values
consistent everywhere.

* Draw fader ticks

Draw fader ticks in case the model is a linear one. This means that for
now they should only be painted for the mixer faders but not for the
faders of the Compressor, Delay, etc.

Extract the computation of the scaled ratio between the maximum model dB
value and the minimum supported fader dB value into the new private
method `computeScaledRatio`. This is necessary because it is needed to
paint the fader knob at the correct position (using the knob bottom as
the reference) and to paint the fader ticks at the correct position
(using the knob center).

Introduce the private method `paintFaderTicks` which paints the fader
ticks.

Note: to paint some non-evenly spaced fader ticks replace the `for`
expression in `paintFaderTicks` with something like the following:
```
for (auto & i : {6.f, 0.f, -6.f, -12.f, -24.f, -36.f, -48.f, -60.f, -72.f, -84.f, -96.f, -108.f, -120.f})
```

* Fader adjustments via keyboard

Allow the adjustment of the faders via the keyboard. Using the up or
plus key will increment the fader value whereas the down or minus key
will decrement it. The same key modifiers as for the wheel event apply:
* No modifier: adjust by 1 dB
* Shift: adjust by 3 dB
* Control: adjust by 0.1 dB

Due to the very similar behavior of the mouse wheel and key press
handling some common functionality was factored out:
* Determinination of the (absolute) adjustment delta value by
  insprecting the modifier keys of an event. Factored into
  `determineAdjustmentDelta`.
* Adjustment of the model by a given dB delta value. Factored into
  `adjustModelByDBDelta`.

* Move the fader of the selected channel

Move the fader of the selected channel instead of the fader that has
focus when the up/plus or down/minus keys are pressed. Doing so also
feels more natural because users can already change the selected
channel via the left and right keys and now they can immediately adjust
the volume of the currently selected channel while doing so.

Key events are now handled in `MixerView::keyPressEvent` instead of
`Fader::keyPressEvent` and the latter is removed. `MixerChannelView`
now has a method called `fader` which provides the associated fader.
This is needed so that the event handler of `MixerView` can act upon
the currently selected fader.

## Changes in Fader
The `Fader` class provides two new public methods.

The `adjust` method takes the modifier key(s) and the adjustment
direction and then decides internally how the modifier keys are mapped
to increment values. This is done to keep the mapping between modifier
keys and increment values consistent across different clients, e.g. the
key event of the `MixerView` and the wheel event of the `Fader` itself.
The direction is provided by the client because the means to determine
the direction can differ between clients and cases, e.g. a wheel event
determines the direction differently than a key event does.

The method `adjustByDecibelDelta` simply adjusts the fader by the given
delta amount. It currently is not really used in a public way but it
still makes sense to provide this functionality in case a parent class
or client wants to manipulate the faders by its very own logic.

Because the `Fader` class does not react itself to key press events
anymore the call to `setFocusPolicy` is removed again.

* Enter fader value when space key pressed

Let the users enter the fader value via dialog when the space key is
pressed.

Extract the dialog logic into the new method `adjustByDialog` and call
it from `MixerView::keyPressEvent`.

Make `Fader::mouseDoubleClickEvent` delegate to `adjustByDialog` and
also fix the behavior by accepting the event.

* More prominent fader ticks around 0 dB

Make the fader ticks around 0 dB more prominent but drawing them
slightly wider and with a more opaque color.

* Work around a Qt bug

Work around a Qt bug in conjunction with the scroll wheel and the Alt
key. Simply return 0 for the fader delta as soon as Alt is pressed.

* Fix wheel events without any modifier

Fix the handling of wheel events without any modifier key being pressed.

Commit ff435d551b accidentally tested against Alt using a logical OR
instead of an AND.

* Code review changes

First set of code review changes:
* Use Doxygen style documentation comments
* Remove comment about `displaydbfs` from upgrade routine
* White-space changes for touched lines.

* Make minimum dB value a constexpr

Make the minimum dB value a constexpr in the implementation file because
currently it's an implementation detail that should not be of any
interest to any other client.

So `m_faderMinDb` becomes `c_faderMinDb`.

* More flexible painting of fader ticks

Paint the fader ticks in a more systematic and flexible way. This also
removes some "magic numbers", e.g. by using `c_faderMinDb` instead of
`-120.f` as the lower limit.

The upper limit, i.e. the "starting point" is now also computed using
the maximum value of the model so that the fader will still paint
correctly if it ever changes.

* Make the zero indicator bolder

Make the zero indicator tick of the fader bolder.

* Make rendering of fader ticks a preference

Make rendering of fader ticks a preference which is off by default.

Introduce the new option "Show fader ticks" to the setup dialog and save
it to the UI attribute `showfaderticks`.

The configuration value is currently evaluated in `Fader::paintEvent`.
If this leads to performance problems it might be better to introduce a
boolean member to the `Fader` class which caches that value.

* Move constexprs to anonymous namespace
2025-03-01 20:08:04 +01:00
regulus79
3417dfe86d Fix Envelope and LFO Graph Size on Resizeable Instruments (#7738) 2025-02-28 22:13:00 -05:00
Johannes Lorenz
3aa1a5dafa Rename AudioPort -> AudioBusHandle (#7712)
No functional changes.
2025-02-28 23:44:58 +01:00
regulus79
cf4b492292 Fix logarithmic behavior when dragging knobs and sliders (#7647)
* Initial fix

* Remove stray m_leftOver reference

* Fix shift-dragging

* Revert to relative mouse control. I realize now that the maths don't actually change.

* Change qRound to std::round

* Fix scrolling behavior

* Fix mouse relative position buildup at values < minValue

* Use approximatelyEqual
2025-02-28 17:02:52 -05:00
superpaik
a4c91f8ba0 Recursively unmute channels when soloing in the mixer (#6746)
* unmute related FX channels

When soled one FX channel, unmute send and receive channels, to allow complex FX channel routing (BUS, SENDs, etc.)

* Comment change

* SEND channels

Activate also SEND channels recursively

* Remove unnecessary whitespace

* Encapsulate mixer channel index

Make the mixer channel index `m_channelIndex` private and add getters and
setters. Also add a method to determine if the channel is the master
channel.

Move `m_channelIndex` to the end of the initialization list of the
`MixerChannel` constructor because it is now the last member in the
header.

Adjust all clients to make use of the new methods.

* Replace const int& getIndex() with int index() const

* Format changes

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-02-28 09:52:41 -05:00
Kevin Zander
9b04e29c4e Remove song import global automation (#5229)
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
2025-02-22 14:24:29 +05:30
Tres Finocchiaro
055e0ba576 Fix additional warnings when Carla is missing (#7722)
Fix additional warnings when Carla is missing
Adds new env var LMMS_EXCLUDE_LADSPA

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-02-21 00:56:04 -05:00
Sotonye Atemie
ea02b3aba0 Do not set Qt::WA_OpaquePaintEvent (#7643)
Attempts to fix child widgets -- such as clips from the song editor -- drawing on top on other
2025-02-19 19:24:27 -05:00
Tres Finocchiaro
7725d0024e Allow plugins to be skipped at runtime (#7691)
Allows plugins (such as carla) to be skipped when not installed
2025-02-18 01:37:54 -05:00
Fawn
e328a136fc Use C++20 std::numbers, std::lerp() (#7696)
* use c++20 concepts and numbers for lmms_constants.h

* replace lmms::numbers::sqrt2 with std::numbers::sqrt2

* replace lmms::numbers::e with std::numbers::e
Also replace the only use of lmms::numbers::inv_e with a local constexpr instead

* remove lmms::numbers::pi_half and lmms::numbers::pi_sqr
They were only used in one or two places each

* replace lmms::numbers::pi with std::numbers::pi

* add #include <numbers> to every file touched so far
This is probably not needed for some of these files. I'll remove those later

* Remove lmms::numbers

Rest in peace lmms::numbers::tau, my beloved

* Add missing #include <numbers>

* replace stray use of F_EPSILON with approximatelyEqual()

* make many constants inline constexpr
A lot of the remaining constants in lmms_constants.h are specific to
SaProcessor. If they are only used there, shouldn't they be in SaProcessor.h?

* ok then, it's allowed to be signed

* remove #include "lmms_constants.h" for files that don't need it
- And also move F_EPSILON into lmms_math.h
- And also add an overload for fast_rand() to specify a higher and lower bound
- And a bunch of other nonsense

* ok then, it's allowed to be inferred

* ok then, it can accept an integral

* fix typo

* appease msvc

* appease msvc again

* Replace linearInterpolate with std::lerp()

As well as time travel to undo several foolish decisions and squash tiny
commits together

* Fix msvc constexpr warnings

* Fix msvc float to double truncation warning

* Apply two suggestions from code review

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Apply suggestions from code review

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* fix silly mistake

* Remove SlicerT's dependence on lmms_math.h

* Allow more type inference on fastRand() and fastPow10f()

* Apply suggestions from code review

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Clean up fastRand() a little bit more

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-02-13 13:15:08 -05:00
Dalton Messmer
7d271e4f39 Fix vcpkg builds (#7702)
* Try to fix MSVC linker error related to lilv

* Remove temporary workaround

* Temporary debugging messages

* oops

* Temporary debugging

* Try to find FluidSynth using Config mode first

* Try again to fix lilv

* Fix FluidSynth installed with vcpkg on Windows

* Fix lilv from vcpkg

* Remove debug flag

* Fix for when lilv is not found (*-NOTFOUND evaluates to false)

* Use lowercase package name for lv2

* Try using only pkg_check_modules for lv2

* Use Lilv::lilv

* Add pkg-config guard back in

* Fix package name

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>

* Fix Lilv_INCLUDE_DIRS

* Rename vcpkg cache key

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
2025-02-12 20:19:13 -05:00
Tres Finocchiaro
30216aac51 macOS: Change drag copy shortcut from Command to Option (#7325)
macOS: Replace Command + Drag shortcut key with Option + Drag
Add new header `KeyboardShortcuts.h` for platform-specific keyboard mappings

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
2025-02-09 02:50:38 -05:00
Fawn
4a089a19dc Update math functions to C++ standard library (#7685)
* use c++ std::* math functions
This updates usages of sin, cos, tan, pow, exp, log, log10, sqrt, fmod, fabs, and fabsf,
excluding any usages that look like they might be part of a submodule or 3rd-party code.
There's probably some std math functions not listed here that haven't been updated yet.

* fix std::sqrt typo

lmao one always sneaks by

* Apply code review suggestions
- std::pow(2, x) -> std::exp2(x)
- std::pow(10, x) -> lmms::fastPow10f(x)
- std::pow(x, 2) -> x * x, std::pow(x, 3) -> x * x * x, etc.
- Resolve TODOs, fix typos, and so forth

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>

* Fix double -> float truncation, DrumSynth fix

I mistakenly introduced a bug in my recent PR regarding template
constants, in which a -1 that was supposed to appear outside of an abs()
instead was moved inside it, screwing up the generated waveform. I fixed
that and also simplified the function by factoring out the phase domain
wrapping using the new `ediv()` function from this PR. It should behave
how it's supposed to now... assuming all my parentheses are in the right
place lol

* Annotate magic numbers with TODOs for C++20

* On second thought, why wait?

What else is lmms::numbers for?

* begone inline

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>

* begone other inline

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>

* Re-inline function in lmms_math.h

For functions, constexpr implies inline so this just re-adds inline to
the one that isn't constexpr yet

* Formatting fixes, readability improvements

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Fix previously missed pow() calls, cleanup

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Just delete ediv() entirely lmao

No ediv(), no std::fmod(), no std::remainder(), just std::floor().
It should all work for negative phase inputs as well. If I end up
needing ediv() in the future, I can add it then.

* Simplify DrumSynth triangle waveform

This reuses more work and is also a lot more easy to visualize.

It's probably a meaningless micro-optimization, but it might be worth changing it back to a switch-case and just calculating ph_tau and saw01 at the beginning of the function in all code paths, even if it goes unused for the first two cases. Guess I'll see if anybody has strong opinions about it.

* Move multiplication inside abs()

* Clean up a few more pow(x, 2) -> x * x

* Remove numbers::inv_pi, numbers::inv_tau

* delete spooky leading 0

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

---------

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-02-08 23:50:02 -05:00
Dominic Clark
cb7c6d16cb Reload stylesheet when CSS file changes (#6331)
* Reload stylesheet when CSS file changes

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
2025-02-08 23:33:44 -05:00