Commit Graph

2286 Commits

Author SHA1 Message Date
DanielKauss
c779521730 Add slicer plugin (#6857)
* extremly basic slicer, note playback and gui works

* very simple peak detection working

* basic phase vocoder implementation, no effects yet

* phase vocoder slight rewrite

* pitch shifting works more or less

* basic timeshift working

* PV timeshift working (no pitch shift)

* basic functions work (UI, editing, playback)

* slice editor Ui working

* fundamental  functionality done

* Everything basic works fully

* cleanup and code guidelines

* more file cleanup

* Tried fixing multi slice playback (still broken)

* remove includes, add license

* code factoring issues

* more code factoring

* fixed multinote playback and bpm check

* UI performance improvments + code style

* initial UI changes + more code style

* threadsafe(maybe) + UI finished

* preparing for dinamic timeshifting

* dynamic timeshifting start

* realtime time scaling (no stereo)

* stereo added, very slow

* playback performance improvments

* Roxas new UI start

* fixed cmake

* Waveform UI finished

* Roxas UI knobs + layout

* Spectral flux onset detection

* build + PV fixes

* clang-format formatting

* slice snap + better defaults

* windows build fixes

* windows build fixes part 2

* Fixed slice bug + Waveform code cleanup

* UI button text + reorder + file cleanup

* Added knob colors

* comments + code cleanup

* var names fit convention

* PV better windowing

* waveform zoom

* Minor style fixes.

* Initial artistic rebalancing of the plugin artwork.

* PV phase ghosting fix

* Use base note as keyboard slice start

* Good draft of Artwork, renamed bg to artwork

* Removed soft glow.

* Fixed load crashes + findSlices cleanup

* Added sync button

* added pitch shifting, sometimes crashes

* pitch fixes

* MacOs build fixes

* use linear interpolation

* copyright + div by 0 fixes

* Fixed rare crash + name changes + license

* review: memcpy, no array, LMMS header, name change

* static constexpr added

* static vars to public + LMMS guards

* remove references in classes

* remove constexpr and parent pointer in waveform

* std::array for fft

* fixed wrong name in style

* remove c style casts

* use src_process

* use note vector for return

* Moved PhaseVocoder into core

* removed PV from plugin

* remove pointers in waveform

* clang-format again

* Use std:: + review suggestions

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Co-authored-by: saker <sakertooth@gmail.com>

* More review changes

* new signal slot + more review

* Fixed pitch shifting

* Fixed buffer overflow in PV

* Fixed mouse bug + better empty screen

* Small editor refactor + improvments

* Editor playback visual + small fixes

* Roxas UI improvments

* initial timeshift removing

* Remove timeshift + slice refactor

* Removed unused files

* Fix export bug

* Fix zoom bug

* Review changes SakerTooth#2

* Remove most comments

* Performance + click to load

* update PlaybackState + zerocross snapping

* Fix windows build issue

* Review + version

* Fixed fade out bug

* Use cosine interpolation

* Apply suggestions from code review

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* More review changes

* Renamed files

* Full sample only at base note

* Fix memory leak

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Style fixes

---------

Co-authored-by: Katherine Pratt <consolegrl@gmail.com>
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Co-authored-by: saker <sakertooth@gmail.com>
2023-11-11 18:09:38 -05:00
Lost Robot
89c98a77a5 LOMM (upward/downward multiband compressor) (#6925) 2023-11-10 07:10:44 -08:00
Lost Robot
8c194fc29c Improve Compressor lookahead algorithm (#6953) 2023-11-08 12:53:59 -08:00
Lost Robot
fccbe5d517 Add MP3 import (#6750) 2023-11-01 15:37:56 -07:00
Dominic Clark
7b99c58926 Expose targets and versions for more dependencies (#6842) 2023-11-01 19:34:32 +00:00
Michael Gregorius
c6ed4a274a First version of a new dynamic LADSPA control dialog (#2068)
Introduce a new version of the LADSPA control dialog which uses "bar controllers" and arranges them in a grid layout. Long parameter names are elided long if needed. The new dialog is implemented in the class `LadspaMatrixControlDialog`.

Note: it is still possible to reactivate the old dialog as it has not been removed yet. You can do so in `plugins/LadspaEffect/LadspaControls.h` by replacing the implementation of `createView()` with the following:
```
gui::EffectControlDialog* createView() override
{
	return new gui::LadspaControlDialog( this );
}
```

Introduce the new base class `FloatModelEditorBase`. It serves as the base widget for widgets that manipulate a float model and provides some base functionalities like context menus, edit dialogs, mouse handling, etc. Currently `BarModelEditor` and `Knob` inherit from `FloatModelEditorBase`. Therefore lots of code was moved from `Knob` to `FloatModelEditorBase`.

`BarModelEditor` supports style sheets. See the changes in style.css for the available options and their usage.
 
Extend `LedCheckBox` so that it adds support to render the text with the default font in the default size. The class now supports two modes:
* Legacy mode
* Non-legacy mode

Legacy mode is the default and renders the LedCheckBox as before. The font is set to 7 pixels and all the text is rendered with a shadow.

Non-legacy mode uses the current font to render the text. The text is rendered without a shadow and the pixmap is centered vertically to the left side of the text. Non-legacy mode is currently only used in the context of the matrix LADSPA dialog. Toggle options are rendered using it as well as the "Link Channels" button.

Add `TempoSyncBarModelEditor` which adds a tempo sync option to a `BarModelEditor`. Please note that the code was mostly copied and adjusted from the `TempoSyncKnob` class. It was not attempted yet to unify some of the code because with the current design it seems to be a road to "inheritance hell". A better solution might be to refactor the code so that it becomes more composable.

What follows are the individual commit messages of the 64 commits that have been squashed into a single merge commit.

* First version of a new dynamic LADSPA control dialog

The new dialog shows the LADSPA controls in a matrix layout. Each row
corresponds to a LADSPA parameter. Each parameter can have several
channels which can be linked. Each channel has its own row of controls.

The class LadspaMatrixControlView was added by copying and modifying
LadspaControlView to get rid of the link buttons which are associated
with some controls and some labels.

* Remove trailing whitespaces

* Merge fix

* Use the new connect syntax

* Remove empty destructors

* Use override keyword

* Reformat a bit

* Use nullptr

* Use range-based loops

* Add BarModelEditor and improve layouts

Add the new class `BarModelEditor` which is intended to become a new way
to adjust values of float models.

Simplify the layout in `LadspaMatrixControlDialog` by removing some
nested layouts. Remove the "Parameters" column.

Adjust `LadspaMatrixControlView` to implement the following changes:
* Show the name of the control next to toggle buttons (`LedCheckBox`).
* Use the new `BarModelEditor` for integer and float types.
* SHow the name of the control next to time based parameters that use
`TempoSyncKnob`.

The names are shown so that the "Parameters" column can be removed.

Technical details
------------------
The class `LadspaMatrixControlDialog` now creates a widget that contains
the matrix layout with the controls. This widget is then added to a
scroll area. The layout is populated in the new method
`arrangeControls`.

Add some helper methods to `LadspaMatrixControlDialog` which retrieve
the `LadspaControls` instance and the number of channels.

Add the implementation of `BarModelEditor` to `src/gui/CMakeLists.txt`.

TODOs
------
Extract common code out of the `Knob` class so that it can be reused by
`BarModelEditor`.

* Use factory to create LADSPA control widgets

Replace the class `LadspaMatrixControlView` with the factory class
`LadspaWidgetFactory`. The former was a widget that wrapped the widget
representation of a LADSPA control in yet another widget with a layout.
The factory simply returns the configured widget so that it can be
incorporated directly in layouts or other widgets.

Adjust `LadspaMatrixControlDialog` so that it uses the
`LadspaWidgetFactory` instead of the `LadspaMatrixControlView`.

* Initial version of FloatModelEditorBase

Create an initial version of `FloatModelEditorBase`. It is intended to
become the base widget for all widgets that manipulate a float model and
provides some base functionalities like context menus, edit dialogs,
mouse handling, etc.

The initial version is a copy of `Knob`. The enum and its values have
been suffixed with "Temp" as they will be removed later anyway. Same
applies for the function `convertPixmapToGrayScaleTemp`.

* Remove Knob related code from FloatModelEditorBase

First removal of Knob related code from FloatModelEditorBase.

* Remove setHtmlLabel

* Remove enum for knob types

* Remove label related code

Remove setLabel and the members m_label and m_isHtmlLabel.

* Remove several Qt properties

* Remove angle related members and methods

* Remove unused members and includes

* Clean up includes

* Make BarModelEditor inherit from FloatModelEditorBase

Make `BarModelEditor` inherit from `FloatModelEditorBase` so that it
inherits all shared functionality. Currently the class mostly implements
size related methods and overrides the paint method.

* Move LadspaWidgetFactory to LadspaEffect

Move the class `LadspaWidgetFactory` to the project LadspaEffect to make
it hopefully compile with mingw32 and mingw64.

Interestingly the code compiled and worked under Linux and MacOS.

* Code adjustments after scripted checks

Add an include guard and an additional `#pragme once`. Add comments to
closing namespace scopes.

* Export BarModelEditor

Export BarModelEditor so that for example the LadspaEffect project/
plugin can use it.

* Improve rendering of bar model editor

Increase the margin from 2 to 3 so that we have a more prominent border
around the filled area.

Fix a problem in the rendering code which led to situations where the
bar was drawn to the left of the start position for small values.

Return a more exact minimum size hint.

* Elide long parameter names

Elide long parameter names if needed.

* Enable horizontal direction of manipulation

Extend `FloatModelEditorBase` so that it also allows manipulation of the
values when the mouse is moved in horizontal directions. The default is
to use the vertical direction.

Make use of this new feature in `BarModelEditor` which now reacts to
horizontal movements when changing values.

* Represent enum parameters using the bar widget

The implementation of the current LADSPA dialog in master uses knobs to
represent enum parameters. Therefore it should also work with the new
bar widget.

This gets rid of many labels with the parameter name followed by
"(unsupported)".

* Remove TODO in LadspaWidgetFactory

* Render text of LedCheckBox with default font

Extend LedCheckBox so that it adds support to render the text with the
default font in the default size. The class now supports two modes:
* Legacy mode
* Non-legacy mode

Legacy mode is the default and renders the LedCheckBox as before. The
font is set to 7 pixels and all the text is rendered with a shadow.

Non-legacy mode uses the current font to render the text. The text is
rendered without a shadow and the pixmap is centered vertically to the
left side of the text.

The non-legacy mode is currently only used in the context of the matrix
LADSPA dialog. Toggle options are rendered using it as well as the "Link
Channels" button.

* Use "yellow" LEDs for bool parameters

Use "yellow" LEDs (which are actually blue) for dynamically added bool
parameters so that the dialog is consistent with regards to the LED
colors. The "Link Channels" button also uses a "yellow" LED.

* Fix Qt5 builds

Fix the Qt5 builds which do not know horizontalAdvance as a member of
FontMetrics.

Also refactor LedCheckBox::onTextUpdated to make it more compact.

* Style sheets for BarModelEditor

Add style sheets options for BarModelEditor. See the changes in
style.css for the available options and their usage.

The members that can be manipulated by the style sheet options are
initialized accoriding to the palette so that the BarModelEditor should
also render something useful if no style is set.

Adjust the paintEvent method to use the style sheet brushes and colors.

* Layout optimizations

Set the vertical scroll bar to always show so that the controls do not
move around if the scroll bar is hidden or shown.

Set the margin of the grid layout to 0 so that the whole dialog becomes
tighter.

* Get rid of initial scroll bars

Make sure that the widget is shown without a scrollbar whenever possible
using the following rules.

If the widget fits on the workspace we use the height of the widget as
the minimum size of the scroll area. This will ensure that the scrollbar
is not shown initially (and never will be).

If the widget is larger than the workspace then we want it to mostly
cover the workspace. In that case the minimum height is set to 90 % of
the workspace.

* Switch to a green theme

Switch to a green theme to better match the default theme.

* Adjust classic theme

Adjust the classic theme so that it renders the bars in a legible way.

* Fixes for CodeFactor

Remove virtual keyword from methods that are marked as override.

Remove whitespaces that make CodeFactor unhappy. One of these fixes
includes moving the implementation of
LadspaMatrixControlDialog::isResizable into the cpp file.

* CodeFactor is still unhappy

Remove a blank line after the constructor.

* Center align time based controls

Align time based controls, i.e. knobs, in the center.

The implementation defeats the purpose of the widget factory a bit but
it makes the design look nicer.

* Fix build

Fix the build by adjusting the enums. I added the changes while writing
the commit message for the merge commit but they did not make it.

* Attempt at CodeFactor warning

Try to make the last CodeFactor warning disappear.

* Add bar controller with tempo sync option

Add `TempoSyncBarModelEditor` which adds a tempo sync option to a `BarModelEditor`. Please note that the code was mostly copied and adjusted from the `TempoSyncKnob` class. It was not attempted yet to unify some of the code because with the current design it seems to be a road to "inheritance hell". A better solution might be to refactor the code so that it is more composable.

Another option might be to move the tempo sync functionality into a class like `FloatModelEditorBase`. Although this would not be a 100% right place either because `TempoSyncKnobModel` inherits from `FloatModel`. In that case we'd have specialized code in a generic base class.

Adjust `LadspaWidgetFactory` so that it now returns an instance of a `TempoSyncBarModelEditor` instead of a `TempoSyncKnob`.

Remove the extra layout code from `LadspaMatrixControlDialog.cpp` as most things are bar editors now.

Adjust `TempoSyncKnobModel` so we do not have to make `TempoSyncBarModelEditor` a friend of it.

* Another attempt to please CodeFactor

Have another attempt to fix CodeFactor's complaints about `LadspaMatrixControlDialog.h`.

* Coding conventions, blanks and blank lines

Remove lots of unnecessary white space. Remove blank lines. Remove leading underscores from parameters.

Remove line breaks in `TempoSyncBarModelEditor.cpp` to make the code more readable. Remove repeated method calls by introducing local variables.

* Break down complex method

Break down the complex method `TempoSyncBarModelEditor::updateDescAndIcon` by delegating to the new methods `updateTextDescription` and `updateIcon`.

* Another attempt to please CodeFactor

Another attempt to fix `LadspaMatrixControlDialog.h` to please CodeFactor.

* Work on TODOs

The TODO "Assumes that all processors are equal..." has been turned into a comment when we start iterating over the channels. If the channels are not of the same structure this would likely also have been a problem in the old implementation.

The TODO "Use a factory..." has been removed as this is already done.

The include of `FloatModelEditorBase.h` in LadspaWidgetFactory has been removed.

* Modifier keys for mouse wheel adjustments

Integrate the changes of commit 7000afb2ea into `FloatModelEditorBase`.

This commit added modifier keys for mouse wheel adjustments to the `Knob` class. The port to `FloatModelEditorBase` results in the bar control now also supporting different scales of adjustments that can be switched with the Shift, Ctrl and Alt keys.

* Show current value on mouse over

Integrate the changes of commit fcdf4c0568 into `FloatModelEditorBase`. This commit lets users show the current value of a float model when the mouse is moved over the control.

* Make Knob inherit from FloatModelEditorBase

Make `Knob` inherit from `FloatModelEditorBase`. This is mostly a continuation for the changes introduced with commit c63d86f.

The idea is that `FloatModelEditorBase` contains the underlying functionality and logic to deal with float models. `Knob` and other classes then only override the presentation aspects. This way `Knob` and `BarModelEditor` can share the same functionality but can differ in how they present the data.

Technical details
------------------
Remove all methods that are already defined in `FloatModelEditorBase` from `Knob`. These are all methods that are defined in the same way in `FloatModelEditorBase`. The method `paintEvent` is not removed because it is overridden by `Knob` as it has its own presentation.

Remove forward declaration of `QPixmap` from `FloatModelEditorBase` as it was not used. Remove unused function `convertPixmapToGrayScaleTemp` from `FloatModelEditorBase`.

* Cleanup includes in Knob class

* Code style changes in FloatModelEditorBase

`FloatModelEditorBase` is a new class/file. Therefore we can do some extensive code cleanup on the code that was initially copied from `Knob`.

Adjust whitespace for methods and some if-statements. Remove underscores from parameter names. Use only two blank lines between method definitions.

* Cleanup include for FloatModelEditorBase

* Show effect name as title of dialog

Add the effect name as the title in the content of the window. This improves the structure of the dialog as it is now clearer from the content itself to which effect the controls belong to.

This duplicates the information from the window title. However, the window title is rather small and the larger font in the content makes it easier to find an effect in a set of opened dialogs.

* Revert "Show effect name as title of dialog"

This reverts commit 8ce0d366d0.

* Fix problem with LedCheckBox in grid layout

The LedCheckBox does not play nice when being used in a grid layout as it disables the resizing behavior of every column it appears in.

The solution is to wrap it into the layout of a parent widget that knows how to behave.

* Reduce minimum width of BarModelEditor

Reduce the minimum width of `BarModelEditor` from 200 to 50.

---------

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
2023-10-29 11:16:39 +01:00
Johannes Lorenz
476a56e713 Update remote of zyn's submodule instruments
This PR makes changes in the submodule `zynaddsubfx`. It affects its
submodule `instruments`:

* updates the URL to use github (since SF is less reliable)
* changes the protocl from SSH to HTTPS (see
  https://stackoverflow.com/a/50299434)
* does not change the submodule's commit ID

You must now run
```
git submodule sync --recursive
```
once to reflect this change.
2023-10-15 16:08:26 +02:00
Rossmaxx
5c9adeb9a6 Bump SWH and TAP LADSPA plugins (#6937) 2023-10-14 19:58:29 -04:00
Dominic Clark
21dc88c37a Set SF2 voice tuning relative to initial value (#6924) 2023-10-10 21:33:50 +01:00
superpaik
382fd9f4c1 Fix EQ effect warnings (#6655)
* Fix warnings "QPainterPath::lineTo Invalid coordinates" on console when loading the effect or changing
  some paramenters, by not "drawing" the EQ curve when there is no EQ band active.
* Fix warnings on console "QPainterPath::lineTo Invalid coordinates" when EQ is processing a sound, because
  in this function log10f generates a pole error when freq is 0, returning and invalid x value pixel
* Update plugins/Eq/EqCurve.cpp

---------

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
2023-10-09 23:06:55 +02:00
Dominic Clark
d9ce7d8d4c Use remaining sample duration for AFP beat length (#6872) 2023-10-06 21:23:50 +01:00
Oskar Wallgren
42c5101803 Mallets - Some small fixes (#6913)
* Fix issue with knob range

* Randomness for BandedWG

* Implement Tubular Bells ADSR

* LFO - update values on change while playing

* coding style

* Vibrato Gain - update
2023-10-06 20:50:06 +01:00
Rossmaxx
e1cc63bb97 Switched ladspaeffect/Cmakelists.txt to use LMMS_HAVE_* instead of WANT_* (#6903)
* fixed cmakelists conditions

* Fixed the order messup.

Co-authored-by: Dominic Clark <mrdomclark@gmail.com>

---------

Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
2023-10-01 09:55:25 -04:00
Oskar Wallgren
7dc00524fa Mallets - Add random knob function (#6466)
* Mallets - Add random knob function

Implement randomness for the instrument. When Random is applied, Hardness and Position of instrument 1 - 9, or Modulator and Crossfade on instrument 10 (Tubular Bells), are nudged on every note to liven up the sound. With the modulated knobs placed at their center values, Random at max will select from the full range of possible values.

Co-authored-by: saker <sakertooth@gmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
2023-09-29 20:39:01 +02:00
Lost Robot
006c43820b Fix Compressor zero divisions (#6887)
* Fix threshold zero division

* Fix RMS zero division
2023-09-24 13:19:19 +02:00
saker
49c713df5b Use resid submodule from libsidplayfp (#6883) 2023-09-23 19:33:20 -04:00
Michael Gregorius
21fb430c76 Merge pull request #6867 from michaelgregorius/RemoveIdenticalCalls
(Re)move identical calls to `InstrumentTrack::processAudioBuffer`
2023-09-21 20:12:04 +02:00
Michael Gregorius
7e8c79a191 Enable build under NixOS (#6855)
Explicitly call the perl interpreter when building the SWH LADSPA plugins
2023-09-20 13:52:59 -04:00
saker
d25723cead Update display file name when opening `PatmanView` (#6870)
* Update display file name when loading Patman

* Conditionally update file name
2023-09-15 22:25:54 -04:00
Michael Gregorius
a6b6565687 Remove unused variable
Remove the unused variable `frames` in `VestigeInstrument::play` to fix the stricter GitHub build.
2023-09-14 23:35:16 +02:00
Michael Gregorius
d3d710e0ad Remove identical calls to InstrumentTrack::processAudioBuffer
Remove identical calls to `InstrumentTrack::processAudioBuffer` which appear in the overridden implementations of `Instrument::play` and `Instrument::playNotes`. Instead the call to `processAudioBuffer` has been moved into `InstrumentPlayHandle::play` and `InstrumentTrack::playNote`. These two methods call the aforementioned methods of `Instrument`. Especially in the case of `InstrumentTrack::playNote` the previous implementation resulted in some unncessary "ping pong" where `InstrumentTrack` called a method on an `Instrument` which then in turn called a method on `InstrumentTrack`. And this was done in almost every instrument.

In `InstrumentTrack::playNote` an additional check was added which only calls `processAudioBuffer` if the buffer is not `nullptr`. The reason is that under certain circumstances `PlayHandle::doProcessing` calls the `play` method by explicitly passing a `nullptr` as the buffer. This behavior was added with commit 7bc97f5d5b. Because it is unknown if this was done for some side effects the code was adjusted so that it behaves identical in this case.

Move the complex implementation for `InstrumentPlayHandle::play` and `InstrumentPlayHandle::isFromTrack` into the cpp file and optimize the includes.
2023-09-14 23:12:22 +02:00
Babakinha
296d5736c8 Remember to check for Linux VST Effects (#6751)
Remember to also check .so files and not only .dll
2023-09-11 16:57:36 +02:00
saker
b353cbea82 Add options to enable sanitizers (#6840)
* Add options to enable sanitizers

* Specify them as debugging options

* Apply suggestions made by Dom

* Fix linking issues
There were linking issues, most likely because we were
applying the sanitizer flags to unnecessary targets that
are part of the build. Now, we only focus on adding the
compiler flags to lmmsobjs as a PUBLIC dependency,
and selectively choose what targets we need to apply
the linker flags to as PRIVATE dependencies.

* Add UBSan

* Add status messages

* Remove GNU as supported compiler for MSan

* Revert to using add_<compile|link>_options again

* Fix sanitizer linkage within veal and cmt libraries
I suspect that our sanitizer flags were removed for these two CMake
targets. Instead of setting the properties directly, we call
target_compile_options and target_link_options
instead.

* Remove TODO comment

* Revert "Fix sanitizer linkage within veal and cmt libraries"

This reverts commit b04dce8d8c.

* Use CMAKE_<LANG>_FLAGS_<CONFIG> and apply fixes

* Remove quotes

* Add support for additional flags

* Disable vptr for UBSan

* Print "Debug using" in status for clarity

* Wrap ${supported_compilers} and ${status_flag} in quotes

* Replace semicolons with spaces in additional_flags

* Remove platform check for no-undefined flag
The platform check was added as an attempt
to make this branch compile with the veal
and cmt libraries. However, it seems to work
without it, so the problem must've been something
else occuring in these files.

* Undo change to FP exceptions status message

* Use spaces instead of tabs

* Remove -no-undefined flag for cmt and veal libraries
2023-09-08 11:49:43 -04:00
Lost Robot
b7196337a4 Fix Compressor arithmetic exception in Debug mode (#6854) 2023-09-07 11:43:23 -07:00
Dalton Messmer
0768f5ad2f Fix a few memory issues found with ASan (#6843)
* Fix LADSPA effects memory leak

* Fix buffer overflow in PianoView

* Avoid using invalid iterators in AutomationClip

* Fix memory leaks in SimpleTextFloat

* Handle potential case where QMap::lowerBound(...) returns end iterator

* Implement suggestions from review
2023-09-03 17:29:31 -04:00
Dominic Clark
4804ab6785 Support per-note detuning and panning with Sf2 Player (#6602)
* Add `ArrayVector` class template and tests

* Fix counting of failed test suites

* Support detuning and panning with Sf2 Player

* Restrict panning to supported FluidSynth versions

* Fix data array cast type

* Fix tests for Qt<5.10 and correct mistaken test

* DIsplay warning for FluidSynth < 2

* Remove unnecessary clamp

* Update include guard name
2023-08-31 07:12:00 -04:00
saker
a311eed8e8 Add Tap Tempo (#6375)
* Add Tap Tempo Feature (#6375)
Resolves #5181

* Update formatting, use namespaces, etc.

* Use Qt Designer .ui file to handle the UI
Thanks to irrenhaus for the idea
Also added a few buttons I will add functionality for

* Play metronome sound when tapped

* Improve stabilization speed by comparing differences in length between intervals
To improve the speed at which the BPM counter stabilizes at a
certain number, we now compare the differences in length between
the last two taps and the most recent two taps and reset the counter
if the threshold is passed.
I made it so that a difference of 500 ms resets the counter.

* Remove duplicate m_ui
An artifact from my battle with Git and merge conflicts..

* Format TapTempoUi header file

* Add lmms namespace in UI file

* Remove taptempo.ui XML file
Not needed

* Add LMMS_EXPORT to SamplePlayHandle

* Use std::chrono::duration<double, std::milli> for intervals
Co-authored-by: irrenhaus3 <irrenhaus3@gmail.com>

* Use alias for steady_clock
Co-authored-by: irrenhaus3 <irrenhaus3@gmail.com>

* Speed up convergence by accounting for recent intervals

This uses a combination of keeping track of a more accurate BPM,
while also using a BPM difference threshold to move towards the true BPM
more quickly.

After three taps, a "recent interval" is calculated, which is similar
to the latest interval, but less fluctuating since it accounts for
three taps instead of one. This allows for comparing between
the BPM on the display with the recent BPM more closely.

We then compare the difference in magnitude of both BPM's
with the threshold. If the threshold is passed, the counter gets reset.

* Remove semicolon from "QOBJECT;" in plugins/TapTempo/TapTempo.h

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>

* Add newline between using alias and constructor

* Cleanup header files

* Add // namespace lmms::gui comment

* Rename header guards in plugins/TapTempo/TapTempo.h

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Rename header guards in plugins/TapTempo/TapTempo.h

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Rename header guards in plugins/TapTempo/TapTempoUi.h

Will merge this file with ``TapTempoView`` soon.

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Rename header guards in plugins/TapTempo/TapTempoUi.h

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Update plugins/TapTempo/TapTempo.h

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Replace virtual with override in plugins/TapTempo/TapTempo.h

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Merge UI file into TapTempoView

* Pass TapTempo* directly into constructor in plugins/TapTempo/TapTempoView.h

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Update style in plugins/TapTempo/TapTempoView.h

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Add parameter name for keyPressEvent function in plugins/TapTempo/TapTempoView.h

Also reorder the function declarations to match the order in the source file.

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Remove dynamic_cast to TapTempo* in plugins/TapTempo/TapTempoView.cpp

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Restrict C linkage to only lmms_plugin_main and plugin descriptor
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Simplify algorithm

* Update labels when calling closeEvent

* Add reset button

* Adjust layout

* Format document

* Only allow the tap button to gain focus

* Use icon provided by LMMS

* Add sync button and adjust formatting

* Make the metronome downbeat the first beat

Also simplify code

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Round BPM values when syncing with project tempo

Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>

* Change Plugin::Tool to Plugin::Type::Tool

---------

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
2023-08-25 14:43:09 -04:00
Dominic Clark
f10277715f Classier enums (#6760) 2023-08-24 19:16:02 +01:00
saker
9a0add49fb Core Refactor: Replace `QVector with std::vector` (#6477)
* Replace QVector with std::vector in AudioEngine

* Replace QVector with std::vector in AudioEngineWorkerThread

* Replace QVector with std::vector in AudioJack

* Replace QVector with std::vector in AutomatableModel

* Replace QVector with std::vector in AutomationClip

* Replace QVector with std::vector in AutomationEditor

* Replace QVector with std::vector in ConfigManager

* Replace QVector with std::vector in Controller

* Replace QVector with std::vector in ControllerConnection

* Replace QVector with std::vector in EffectChain

* Replace QVector with std::vector in EnvelopeAndLfoParameters

* Replace QVector with std::vector in InstrumentFunctions

* Replace QVector with std::vector in MidiClient

* Replace QVector with std::vector in Mixer

* Replace QVector with std::vector in Note

* Replace QVector with std::vector in PeakController

* Replace QVector with std::vector in PianoRoll

* Replace QVector with std::vector in PluginFactory

* Replace QVector with std::vector in RenderManager

* Replace QVector with std::vector in StepRecorder

* Replace QVector with std::vector in Track

* Replace QVector with std::vector in TrackContainer

* Replace QVector with std::vector in Song

* Adapt QVector to std::vector changes in ControllerConnectionDialog

* Phase 2: Use std::abs in panning.h
Without this, the QVector changes will make the code not compile.

* Phase 2: Replace QVector with std::vector in PeakControllerEffect

* Phase 2: Replace QVector with std::vector in AutomatableModel

* Phase 2: Replace QVector with std::vector in AutomationClip

* Phase 2: Replace QVector with std::vector in ControllerConnection

* Phase 2: Replace QVector with std::vector in EffectChain

* Phase 2: Replace QVector with std::vector in Mixer

* Phase 2: Replace QVector with std::vector in PeakController

* Phase 2: Replace QVector with std::vector in RenderManager

* Phase 2: Replace QVector with std::vector in Song

* Phase 2: Replace QVector with std::vector in StepRecorder

* Phase 2: Replace QVector with std::vector in Track

* Phase 2: Replace QVector with std::vector in TrackContainer

* Phase 2: Adapt QVector changes in EffectRackView

* Phase 2: Adapt QVector changes in AutomationClipView

* Phase 2: Adapt QVector changes in ClipView

* Phase 2: Adapt QVector changes in AutomationEditor

* Phase 2: Adapt QVector changes in PianoRoll

* Phase 2: Adapt QVector changes in TrackContainerView

* Phase 2: Adapt QVector changes in TrackContentWidget

* Phase 2: Adapt QVector changes in InstrumentTrack

* Phase 2: Adapt QVector changes in MidiClip

* Phase 2: Adapt QVector changes in SampleTrack

* Fix segmentation fault in ConfigManager::value

* Fix unintended faulty std::vector insert in AutomationClip::resolveAllIDs

* Resolve trailing whitespace in src/core/StepRecorder.cpp

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>

* Use std::next and std::prev in EffectChain::moveUp/moveDown

* Introduce static "combineAllTracks" function in AutomationClip

* Adjust variable name in Song::automatedValuesAt

* Adjust removal of long step notes in StepRecorder::removeNotesReleasedForTooLong

* Iterate over m_chords by const reference in src/core/InstrumentFunctions.cpp

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>

* Fix StepRecorder::removeNotesReleasedForTooLong again

* Combine the ConfigManager::value overloads using std::optional

* Revise StepRecorder::removeNotesReleasedForTooLong

* Remove redundant std::optional in ConfigManager::value

* Remove trailing whitespace in ConfigManager::value

* Fix: Prevent incorrect use of std::distance when element not found

* Chore: Remove trailing whitespace in edited files

* Only set the id attribute if the controller was found

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>

* Remove extra indents from 84b8fe8a559855ed263b74cc582eab3655250c5f

* Fix compilation issues

* Add LMMS_ prefix for header guard in Track.h

* Undo changes made to MixerView::deleteUnusedChannels

* Simplify code to handle failure of finding tracks
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>

* Split ternary operator into separate if statement
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>

* Undo changes to indentation in MixerRoute

* Do general clean-up
Some of the changes made:
+ Use auto where benefical
+ Fix bug in AutomatableModel::globalAutomationValueAt (for loop should be looping over clips variable, not clipsInRange)
+ Undo out of focus whitespace changes

* Always assign to m_steps regardless if clip is found or not
Even when the clip is not found (i.e., currentClip is -1), m_steps still
gets assigned to.

* Insert at the end of tracks vector in src/core/Mixer.cpp

Co-authored-by: Dominic Clark <mrdomclark@gmail.com>

* Insert at the end of tracks vector in src/core/Mixer.cpp (2)

Co-authored-by: Dominic Clark <mrdomclark@gmail.com>

* Remove redundant template parameter

* Use std::array for zoomLevels

---------

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
2023-08-22 12:08:56 +09:00
Dalton Messmer
5cbf2c5287 Fix LMMS plugin issues (#6670)
* Fix Organic automated harmonic parameter loading

* Fix Kicker automated end distortion parameter loading

* Fix AudioFileProcessor automated interpolation parameter loading

* Fix Vibed automated volume parameter loading

* Improve coding style/formatting

* Fix #6671

* Fix Vibed memory leaks

* Refactor Vibed instrument

* Fix build

* Try to fix build again

* Revert previous commit

* Replace more raw pointers with smart pointers

* Remove unused files

* Minor changes

* Update plugins/Vibed/Vibed.cpp

Co-authored-by: Kevin Zander <veratil@gmail.com>

* Implement suggestions from review

* Minor changes

* Only check plugin data pointer

* Refactor NineButtonSelector

* Fix memory leaks during heavy tempo automation

* Fix build

* Use s_stringCount

* Replace some vectors with arrays

* Use array instead of switch

* Allow compiler to generate move assignment operator

* Fix loading of old automated detune values

* Fix member variable names

* Address review comments

---------

Co-authored-by: Kevin Zander <veratil@gmail.com>
2023-08-22 12:07:09 +09:00
Bimal Poudel
793f096c4f Update DummyCarla.cpp to use CARLA_PLUGIN_EXPORT (#6814) 2023-08-20 15:52:23 +09:00
Tres Finocchiaro
bc99728534 Consolidate and simplify CMAKE_POLICY entries (#6780)
Simplify CMake Policies
Per https://github.com/LMMS/lmms/pull/6758#discussion_r1271346366
2023-08-02 23:06:18 -04:00
Sergey Fedorov
a9d49d4ff7 CMakeLists: use flags for Apple correctly (#6784) 2023-07-29 00:22:32 -04:00
Tres Finocchiaro
c53f3d981b Bump cmt submodule (#6151)
* Bump cmt submodule
Closes #6006
2023-07-11 12:52:32 -04:00
Aidan Mueller
1f30ffc5e4 Fixed issue #5734 (FreeBoy Division by zero) (#6053)
* Fixed issue #5734 (FreeBoy Division by zero).

Added comments and used more descriptive variable names for noise
channel initialization block.

Also indented the nested for loop to improve code clarity.
The reasons for doing this can be found in this answer:
https://softwareengineering.stackexchange.com/a/362796

* Better initial div_ratio guess

Allows us to skip r = 0 and a conditional in the loop below.

---------

Co-authored-by: Spekular <Spekular@users.noreply.github.com>
2023-07-02 12:28:40 +09:00
Lost Robot
4ea8a70de6 Fix Equalizer LP/HP curve display (#6748) 2023-06-26 17:23:47 -07:00
Michael Gregorius
7c6ade5736 Merge pull request #6731 from michaelgregorius/6729-MissingFilterImage
Add SID filter image back (#6729)
2023-06-08 17:41:58 +02:00
Michael Gregorius
5debf982ef Add SID filter image back (#6729)
Add the image for the disabled SID filter back. According to a comment
in the issue it seems to have gone missing during commit c1e6b313.
2023-06-08 17:15:53 +02:00
Tres Finocchiaro
bceee6c427 Look for libcarla_native-plugin.dll on Windows (#6726)
Closes #5984
2023-06-05 16:22:05 -04:00
Michael Gregorius
bd5f1b9ea1 Fix uninitialized variable "pCurPreset" (#6639) (#6723)
Fix the uninitialized variable pCurPreset by setting it to nullptr.

Please note that it looks as if the nullptr is now being passed to the
function fluid_sfont_iteration_next_wrapper. However, the function does
not use the parameter anyway and then the variable is set to the result
of that function.
2023-06-04 22:44:48 -05:00
Lost Robot
f13e95932d Include cstdint (#6697) 2023-04-25 11:06:15 -07:00
Lost Robot
1f93dbc124 EQ default shelf reso (#6694) 2023-04-21 11:17:53 -07:00
Dalton Messmer
64003fb004 Fix FreeBoy CPU time bug (#6680) 2023-04-18 14:39:02 -05:00
Lost Robot
2e572caa58 Add Dispersion effect (#6683) 2023-04-05 21:08:24 -07:00
Arash Partow
2baa23ee1a Update ExprTk package 2023-02-26 15:51:24 +01:00
JGHFunRun
ac080513fd Fixed typo (#6652) 2023-02-23 23:31:07 +01:00
Johannes Lorenz
5b84b65236 Lv2: Update copyright 2023-02-21 21:03:00 +01:00
Johannes Lorenz
f48dd0fb1f Fixes #6401: Reload Lv2 plugin on SR change
This also includes banning blop's wavedata plugins, because they crash
on reloading. Reference: https://gitlab.com/drobilla/blop-lv2/-/issues/3
2023-02-21 21:03:00 +01:00
Johannes Lorenz
7649f5ed24 Lv2ControlBase: Remove unused virtuals
They were never used. Possibly they were just in the code because the
code originated from #4662 (where the virtuals would also be
omittable...).
2023-02-21 21:03:00 +01:00
Hyunjin Song
f89d52fa21 Fix more Qt deprecation warnings (#6615)
* Add <QHash> to PluginFactory.h

* Handle one more deprecated QTextStream::endl

* Replace QLayout::setMargin with setContentsMargins

* Replace Qt::MidButton with Qt::MiddleButton

* Replace QPalette::Background with QPalette::Window

* Fix deprecation warnings in LcdFloatSpinBox
2023-01-18 10:16:28 +09:00