Skip to content
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

effect chain preset saving/loading, custom effect defaults, and parameter hiding/rearrangement #2618

Closed
wants to merge 552 commits into from

Conversation

Be-ing
Copy link
Contributor

@Be-ing Be-ing commented Apr 1, 2020

NOTE FOR TESTERS: The new GUI widgets have only been added to Tango so far.
image

This PR is a continuation of @kshitij98's GSOC project from 2018 (#1705) to implement effect chain preset saving/loading. Since Mixxx 2.1, Mixxx has saved and loaded the state of the effects units to/from an XML file on shutdown/startup. However, due to the overcomplicated architecture, this was tightly coupled to the initialization of the effects system. To repurpose this functionality for saving/loading XML presets while using Mixxx, the entire effects system in the main thread (src/effects) had to be rewritten first. There are minimal changes to the DSP code in the audio thread; the only change to that is removing the useless EffectRack layer.

This branch adds several new features:

  • The state of an effect unit can be saved as a preset with a user-specified name. This is done with a new widget in the effects units that shows a popup menu. The presets are saved in the settings folder, in a new effects/chains subfolder.
  • Chain presets can be imported and exported as XML files from the preferences.
    preferences
  • Effect parameters can be hidden and rearranged. This allows the user to control which parameters are available for manipulation by controllers. Parameters can be hidden/shown from the same menu as is used for chain presets. Parameters can be rearranged by dragging and dropping the parameter names.
  • The state of an effect can be saved as a default snapshot that is used whenever that effect is loaded. This is done through the same menu as effect chain presets. Together with parameter hiding and rearrangement, this replaces the legacy LV2 effects preferences added in Mixxx 2.2. The snapshots are saved as XML files in a new effects/defaults subfolder of the user settings folder.
  • Chain presets can be loaded to the QuickEffect units with a new combobox widget. This is similar to Traktor's Mixer FX but more powerful because the user can create arbitrary chains of effects with custom meta/superknob linking.
  • A handful of default chain presets are included in res/effects. I have designed these so they are useful when loaded into the QuickEffects units which are only controlled by the superknob. If you come up with cool presets, please share! :)
  • The lists of effects and chain presets visible in the comboboxes in the skin can be customized from the preferences. There are separate lists of chain presets for the regular effects units and the QuickEffects.
  • New load_effect ControlObject for effects that loads an index in the list defined by the user in the preferences.
  • On first startup, a chain preset with a single effect is autogenerated for every effect with a default metaknob linking and this is added to the list of QuickEffect chain presets in addition to the chain presets from res/effects. It is not added to the list of chain presets for the regular effects units. The chain preset autogenerated from the Filter effect is the default.
  • The old next_chain/prev_chain and chain_selector ControlObjects for effect units cycle through the list of chain presets.
  • New load_preset and loaded_preset ControlObjects for effect units. These use an index in the list of chain presets defined by the user in the preferences. This allows controllers to be mapped to loading chain presets without coupling the chain preset with that particular controller; the user can choose which presets to use with the controller by arranging the list in the preferences. This is designed to be used with the Mixer FX buttons on third generation Traktor controllers (Kontrol S2 Mk3, Kontrol S4 Mk3, Kontrol S3). It could also be used with the Color FX buttons on the Pioneer DDJ-SX3, DDJ-1000, and DDJ-800.

Traktor Mixer FX on controller

To do:

  • Reimplement effects saving on shutdown/reloading on restart
  • Reimplement hiding of parameters for LV2 effects
  • Saving/loading and importing/exporting effect chain presets
  • Custom default snapshots for each effect
  • Reimplement EffectChainSlot next/prev_chain ControlObjects
  • Add ControlObject to load a specific chain preset to an EffectChainSlot
  • Allow loading chain presets for QuickEffects
  • Load default chain presets from res folder
  • ControlObject to indicate which preset is loaded in a chain
  • Let users arrange custom order of effects lists
  • Reimplement EffectSlot next/prev_effect ControlObjects and add ControlObject to load effect at specific list index
  • Separate QuickEffect chain preset list from chain preset list for regular effect chains
  • Autogenerate QuickEffect chain preset for each effect with a default metaknob linking
  • Drag and drop parameter names for rearrangement
  • Write new tests

@Be-ing Be-ing mentioned this pull request Apr 1, 2020
14 tasks
@Holzhaus
Copy link
Member

Holzhaus commented Apr 2, 2020

Can you mark this [WIP] until it's ready to review?

@Be-ing Be-ing changed the title Effects refactoring [WIP] Effects refactoring Apr 2, 2020
@Be-ing Be-ing force-pushed the effects_refactoring branch 2 times, most recently from 06af565 to 690c3c5 Compare April 3, 2020 23:16
@Be-ing Be-ing changed the title [WIP] Effects refactoring effect chain preset saving/loading and custom effect defaults Apr 4, 2020
@Be-ing
Copy link
Contributor Author

Be-ing commented Apr 4, 2020

Woohoo! This branch is now beyond feature parity with master. 🎉 🎉 It is ready for review and testing. I want to get this merged for 2.4.

You can save and load custom effect chain presets. You can also save the state of an effect as a default snapshot so that any time you load that effect in the future, it will load with that state. This replaces the hacky toggling of effect parameters in the preferences for LV2 effects and it works for built-in effects too. DlgPrefLV2 has been removed. The chain presets as well as effects presets are stored as XML files in a new "effects" folder in the user settings folder. The old effects.xml file is still used and this branch reads old effects.xml files from master, 2.2, or 2.1. All these new features were implemented while a net of 2184 lines of code were removed.

The GUI to access these new features is only a crude proof of concept right now. There is a new button which pops up a menu to save/load chain presets, hide/show parameters, and save default effect presets. I have only added it to Tango for now (when the effect units are expanded).
image

The main thread parts of the effects system has been completely rewritten, so reviewing by looking at the diff on GitHub would be overwhelming. I suggest checking out this branch locally and exploring the code. I will add documentation soon.

Further features I want to implement are letting the user rearrange the list of chain presets via the preferences. I want to add new ControlObjects to load stored chain presets so controllers can map scrolling through the list. Users could also set up loading an effect chain with a specific button by mapping a button to a position in the chain preset list and arranging the list in the preferences. I want to make chain presets able to be loaded as QuickEffects. When combined, these features will allow fully supporting the Mixer FX section on the NI Kontrol S4 Mk3:
image
I also want to add importing and exporting of chain presets. It would be fun to ship some default chain presets with Mixxx too. This branch can be merged before any of these features are implemented.

@Be-ing Be-ing changed the title effect chain preset saving/loading and custom effect defaults effect chain preset saving/loading, custom effect defaults, and parameter hiding Apr 4, 2020
@Be-ing Be-ing force-pushed the effects_refactoring branch 2 times, most recently from 1784fc0 to 1407f53 Compare April 4, 2020 20:21
src/effects/effectsmanager.h Outdated Show resolved Hide resolved
@Be-ing
Copy link
Contributor Author

Be-ing commented Apr 4, 2020

I did some file reorganization. I think the new structure is well organized:

be@localhost ~/s/m/s/effects (effects_refactoring) [141]> lsd --tree
  .
├──   backends
│  ├──   builtin
│  │  ├──   autopaneffect.cpp
│  │  ├──   autopaneffect.h
│  │  ├──   balanceeffect.cpp
│  │  ├──   balanceeffect.h
│  │  ├──   bessel4lvmixeqeffect.cpp
│  │  ├──   bessel4lvmixeqeffect.h
│  │  ├──   bessel8lvmixeqeffect.cpp
│  │  ├──   bessel8lvmixeqeffect.h
│  │  ├──   biquadfullkilleqeffect.cpp
│  │  ├──   biquadfullkilleqeffect.h
│  │  ├──   bitcrushereffect.cpp
│  │  ├──   bitcrushereffect.h
│  │  ├──   builtinbackend.cpp
│  │  ├──   builtinbackend.h
│  │  ├──   echoeffect.cpp
│  │  ├──   echoeffect.h
│  │  ├──   equalizer_util.h
│  │  ├──   filtereffect.cpp
│  │  ├──   filtereffect.h
│  │  ├──   flangereffect.cpp
│  │  ├──   flangereffect.h
│  │  ├──   graphiceqeffect.cpp
│  │  ├──   graphiceqeffect.h
│  │  ├──   linkwitzriley8eqeffect.cpp
│  │  ├──   linkwitzriley8eqeffect.h
│  │  ├──   loudnesscontoureffect.cpp
│  │  ├──   loudnesscontoureffect.h
│  │  ├──   lvmixeqbase.h
│  │  ├──   metronomeclick.h
│  │  ├──   metronomeeffect.cpp
│  │  ├──   metronomeeffect.h
│  │  ├──   moogladder4filtereffect.cpp
│  │  ├──   moogladder4filtereffect.h
│  │  ├──   parametriceqeffect.cpp
│  │  ├──   parametriceqeffect.h
│  │  ├──   phasereffect.cpp
│  │  ├──   phasereffect.h
│  │  ├──   reverbeffect.cpp
│  │  ├──   reverbeffect.h
│  │  ├──   threebandbiquadeqeffect.cpp
│  │  ├──   threebandbiquadeqeffect.h
│  │  ├──   tremoloeffect.cpp
│  │  └──   tremoloeffect.h
│  ├──   effectmanifest.cpp
│  ├──   effectmanifest.h
│  ├──   effectmanifestparameter.cpp
│  ├──   effectmanifestparameter.h
│  ├──   effectprocessor.h
│  ├──   effectsbackend.h
│  └──   lv2
│     ├──   lv2backend.cpp
│     ├──   lv2backend.h
│     ├──   lv2effectprocessor.cpp
│     ├──   lv2effectprocessor.h
│     ├──   lv2manifest.cpp
│     └──   lv2manifest.h
├──   defs.h
├──   effectbuttonparameterslot.cpp
├──   effectbuttonparameterslot.h
├──   effectchainslot.cpp
├──   effectchainslot.h
├──   effectknobparameterslot.cpp
├──   effectknobparameterslot.h
├──   effectparameter.cpp
├──   effectparameter.h
├──   effectparameterslotbase.cpp
├──   effectparameterslotbase.h
├──   effectslot.cpp
├──   effectslot.h
├──   effectsmanager.cpp
├──   effectsmanager.h
├──   presets
│  ├──   effectchainpreset.cpp
│  ├──   effectchainpreset.h
│  ├──   effectparameterpreset.cpp
│  ├──   effectparameterpreset.h
│  ├──   effectpreset.cpp
│  ├──   effectpreset.h
│  └──   effectxmlelements.h
├──   specialeffectchainslots.cpp
└──   specialeffectchainslots.h

@Be-ing Be-ing force-pushed the effects_refactoring branch 4 times, most recently from ed2d523 to 665320e Compare April 6, 2020 04:57
@Be-ing
Copy link
Contributor Author

Be-ing commented Apr 6, 2020

I added a new section to DlgPrefEffects to import, export, rename, and delete effect chain presets:
Screenshot from 2020-04-05 23-45-21

src/effects/effectsmanager.h Outdated Show resolved Hide resolved
@Be-ing Be-ing mentioned this pull request Apr 15, 2020
@ronso0 ronso0 mentioned this pull request Apr 19, 2020
1 task
@Be-ing
Copy link
Contributor Author

Be-ing commented Oct 18, 2021

Still no explanation has been made justifying why this hasn't been merged.

@Be-ing Be-ing closed this Oct 26, 2021
@ronso0 ronso0 added the changelog This PR should be included in the changelog label Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build changelog This PR should be included in the changelog code quality effects skins ui
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.