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

Scaling issues on high DPI displays #2510

Open
2 of 3 tasks
samkcarlile opened this issue Jan 17, 2016 · 100 comments
Open
2 of 3 tasks

Scaling issues on high DPI displays #2510

samkcarlile opened this issue Jan 17, 2016 · 100 comments

Comments

@samkcarlile
Copy link

samkcarlile commented Jan 17, 2016

Edit: tresf, added checklist and workaround:

  • Windows: - Partially working via d2e50df.
  • Linux: - Implemented via 8a39302 reverted. reimplemented bbedfa9. (Qt5.6+)
  • MacOS: - Implemented via 8a39302

Unfortunately some HiDPI displays don't scale properly. There's more discussion around this here: #4800 (comment)

# HiDPI workaround for problematic screens
export QT_SCALE_FACTOR=1
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_SCREEN_SCALE_FACTORS=2

Or permanently (use with caution!)

# HiDPI workaround for problematic screens
echo -e "QT_SCALE_FACTOR=1\nQT_AUTO_SCREEN_SCALE_FACTOR=0\nQT_SCREEN_SCALE_FACTORS=2" | sudo tee -a /etc/environment

This is my first time submitting an issue here, so If I'm doing it incorrectly, please let me know.

I'm on Windows 10 and would like to use LMMS, however, being on a Surface Book with a high DPI display, I can't comfortably use this software without squinting to see the various menu items and text. This application doesn't seem to scale when I scale Windows up. Is this a known issue or is it just me?

@tresf
Copy link
Member

tresf commented Jan 18, 2016

Known issue, unfortunately. Closing, marking as duplicate of #455, #2209, #1913, #82.

Edit: Reopened. :)

Quote from @BaraMGB

In the arch Linux wiki is an article which explains how to setup several desktop environments on hidpi resolution screens. This can help in the future for testing.
https://wiki.archlinux.org/index.php/HiDPI

Quote from @michaelgregorius:

@Wallacoloo Yes, there are still several places where the fixed font sizes are used. For example in the song editor's tracks, also in lots of plugins and other places where custom widgets are used. I'd say there is still tons of work to do.

Here is a list of places where pointSize and pointSizeF are still called:

$ grep -l -r pointSize | sort | uniq
include/gui_templates.h
plugins/audio_file_processor/audio_file_processor.cpp
plugins/carlabase/carla.cpp
plugins/DualFilter/DualFilterControlDialog.cpp
plugins/ladspa_browser/ladspa_browser.cpp
plugins/monstro/Monstro.cpp
plugins/patman/patman.cpp
plugins/stk/mallets/mallets.cpp
plugins/vestige/vestige.cpp
plugins/VstEffect/VstEffectControlDialog.cpp
plugins/zynaddsubfx/ZynAddSubFx.cpp
src/core/audio/AudioAlsa.cpp
src/core/audio/AudioJack.cpp
src/core/audio/AudioOss.cpp
src/core/audio/AudioPortAudio.cpp
src/core/audio/AudioPulseAudio.cpp
src/core/audio/AudioSdl.cpp
src/core/midi/MidiAlsaRaw.cpp
src/core/midi/MidiAlsaSeq.cpp
src/core/midi/MidiOss.cpp
src/core/Track.cpp
src/gui/AutomationPatternView.cpp
src/gui/editors/AutomationEditor.cpp
src/gui/editors/PianoRoll.cpp
src/gui/PianoView.cpp
src/gui/SetupDialog.cpp
src/gui/widgets/ComboBox.cpp
src/gui/widgets/EffectView.cpp
src/gui/widgets/EnvelopeAndLfoView.cpp
src/gui/widgets/FxLine.cpp
src/gui/widgets/GroupBox.cpp
src/gui/widgets/InstrumentFunctionViews.cpp
src/gui/widgets/InstrumentMidiIOView.cpp
src/gui/widgets/InstrumentSoundShapingView.cpp
src/gui/widgets/Knob.cpp
src/gui/widgets/LcdWidget.cpp
src/gui/widgets/LedCheckbox.cpp
src/gui/widgets/MeterDialog.cpp
src/gui/widgets/MidiPortMenu.cpp
src/gui/widgets/ProjectNotes.cpp
src/gui/widgets/SideBarWidget.cpp
src/gui/widgets/TabBar.cpp
src/gui/widgets/TabWidget.cpp
src/gui/widgets/TextFloat.cpp
src/gui/widgets/VisualizationWidget.cpp
src/tracks/BBTrack.cpp
src/tracks/InstrumentTrack.cpp
src/tracks/Pattern.cpp
src/tracks/SampleTrack.cpp

Do you want to open a new issue for some of the remaining changes or reuse this one?

@tresf tresf closed this as completed Jan 18, 2016
@musikBear

This comment has been minimized.

@tresf

This comment has been minimized.

@tresf
Copy link
Member

tresf commented Feb 24, 2016

@musikBear here's what LMMS looks like on Windows 10 running scaled desktop...

image

  • ✅ File/Menu bar does scale
  • ✅ MDI window titles do scale
  • ⛔ Images do not scale
  • ⛔ Fonts do not scale

@tresf
Copy link
Member

tresf commented Feb 24, 2016

@tresf
Copy link
Member

tresf commented Feb 25, 2016

Edit, Qt5 alone does not fix this problem...

LMMS built with Qt5 running on Windows 10 hi-res display:
image

@musikBear
Copy link

Very good explanation. Thanks! 🎁

@tresf
Copy link
Member

tresf commented Mar 7, 2016

I created a graphical representation of what works and what doesn't based on overlaying 100% with 125%. This should help understand where the problems stem from and how to start identifying them and eventually fixing them.

It appears ALL pixmaps are drawn at their natural size, so that may be a fix-it-everywhere type patch.

Some Qt items, such as minimize and close buttons are out of our control and we'll have to live with what the framework gives until it is patched upstream.

Obvious but

  • Green = Scales properly.
  • Red = Does not scale properly.

image

Font/Zoom Factor: 100%
image

The raw data...

Font/Zoom Factor: 125%
image

@IvanMaldonado
Copy link
Contributor

Yo, where can I find the fork to test lmms with qt5?

@tresf
Copy link
Member

tresf commented Mar 7, 2016

No fork needed.

Just export QT5=True should do the trick .

All of our wiki tutorials have been updated to reflect this.

@IvanMaldonado
Copy link
Contributor

When or where do I have to do that?

I followed the instructions on https://github.com/LMMS/lmms/wiki/Compiling-lmms (Using Qt5) and it didn't work for me, since the only time I use cmake is in "cmake ../" that's where I put the flag.

@tresf
Copy link
Member

tresf commented Mar 8, 2016

export FOO=bar is quite common on Linux, it really needs no explanation.

Your system has to have Qt5 available of course, but I'd rather not use a bug report about HiRes support as a Q/A for a tried and true build process. Can you move your questions to the Qt5 thread please?

@tresf
Copy link
Member

tresf commented Mar 8, 2016

Some more interesting information... (I tried this without much success, but I'd like to hear feedback from others... )

Scale factor of 200%, Qt 5.4 or higher required

#include <QtGlobal>
qputenv("QT_DEVICE_PIXEL_RATIO",QByteArray("2"));

The article also claims that export QT_DEVICE_PIXEL_RATIO=2 works too, but I couldn't get it to work on Windows or Mac.

Allow high-dpi pixmaps, Qt5.1 or higher required

QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);

And to prevent crashes on older Qt versions...

#include <QtGlobal>

#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
    QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
#endif

References:
http://blog.davidedmundson.co.uk/blog/kde_apps_high_dpi
http://blog.qt.io/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/

@tresf
Copy link
Member

tresf commented Jun 19, 2016

Some additional information on this topic:

http://doc.qt.io/qt-5/highdpi.html

Microsoft Windows

Scaling

The user can choose a scaling factor from the control panel or via context menu. This works by making the functions for querying the system metrics return different values for standard font sizes, sizes of window borders, and so on. It does not perform any actual scaling.

DPI Awareness

An application on Windows can assume one of the following levels of "DPI Awareness":

DPI Awareness Level Meaning
DPI Unaware This level has been introduced in Windows-Vista. Windows will pretend to the application that it is running on a standard display of 96 DPI of 1920x1080 and scale the application accordingly. It is intended to accommodate older applications designed for low DPI displays. Some artifacts may result from this type of scaling.
System‑DPI Aware This level has been introduced in Windows-Vista. It differs from Per-Monitor DPI Aware only when multiple monitors are connected. Windows will calculate a scaling suitable for all connected monitors.
Per‑Monitor DPI Aware This level has been introduced in Windows 8.1. Windows does not perform any scaling at all.

Qt applications by default are Per-Monitor DPI Aware on Windows 8.1 or System-DPI Aware on older versions of Windows. As of Qt 5.4, the level can be specified by passing a parameter to the platform plugin (see Using qt.conf):

<application> -platform windows:dpiawareness=0,1,2

@tresf
Copy link
Member

tresf commented Jun 19, 2016

An interesting photoshop write-up which allows a Windows application to notify the OS of dpi-awareness through an exe manifest file:

http://neoshamon.blogspot.com/2015/06/adobe-app-scaling-on-high-dpi-displays.html?view=sidebar

@zapashcanon
Copy link
Contributor

I would like to add two things.

First, I'm not sure, but as I didn't saw it mentioned, it's the case on linux too:

capture du 2016-07-02 16-57-23

And, in the @tresf's graphical representation, the menu is already in red, but there's also another problem with icons:

capture du 2016-07-02 17-02-50

@michaelgregorius
Copy link
Contributor

@zapashcanon From the attached screenshot I take that you are running a resolution of 2880 × 1800? I assume that Qt checks the resolution and DPI value and then decides to scale all icons to twice their size. It seems that our menus can't cope with that due to some hard coded values either in the CSS or in the code itself.

@zapashcanon
Copy link
Contributor

Yes, it's 2880 * 1800. And yes, I think it's probably something like that.

@michaelgregorius
Copy link
Contributor

The fix for the HiDPI issue of the sample track window (see here) has also been merged (via #6788).

@michaelgregorius
Copy link
Contributor

The fixes for the elements mentioned in this comment are now also merged via #6789.

So the setup dialog changes shown here are the last of the batch. But it looks like they need some more adjustments.

@he29-net
Copy link
Contributor

Did something change in the way we build AppImage between versions 1.2.2 and the current nightly builds? I wanted to check out the latest fixes, since the fix in Sample Track seems to introduce two very different font sizes into the same window, which doesn't look that great. So I wanted to test it on my system, and I found that the nightly AppImage does not scale at all for me:

lmms-1.2.2-linux-x86_64.AppImage:
scale_122

lmms-1.3.0-alpha.1.386+g910cdf22c-linux-x86_64.AppImage:
scale_13x

Using banana for scale, you can see that the 1.2.2 fonts are uniform in size and properly scaled for a 4K screen (maybe a bit larger than needed if anything). Not only that, but if I drag LMMS to a lower resolution laptop screen, it detects the difference in density and scales down. So 1.2.2 works perfectly (at least for a scaling method limited to integer multiples).

With the 1.3 nightly, no scaling is applied except for the OK / Cancel button labels and the main menu, and nothing changes when I drag the window to a different screen. The buttons in Song-Editor are aware that the devicePixelRatio() isn't one, because they adjust their size to accommodate the upscaled icons. So Qt clearly "knows" it is running on a high DPI screen. But the icons (and everything else for that matter) stay 1:1 anyway -- the "scale all non-natively-scalable elements by 2x" behavior found in 1.2.2 is not present. So it seems like a regression caused by a different Qt version (different default settings or method of detecting system configuration?), or some change in environment variables set up by us in the AppImage?

Playing around some more, I realized this probably matches the appearance common in screens from @michaelgregorius (most of GUI not scaled, and non-fixed-size fonts being notably larger than everything else) that I never managed to replicate on my system until now. I can finally experience the issue you have been dealing with the whole time. :)

When I build locally from the source, LMMS always behaves like the 1.2.2 version (apart from the automatic scaling when dragging to a low-res screen, that does not work). And I have no idea how to build or debug an AppImage, so I'm not sure where and how exactly should I look for the root cause of this difference. Environment variables exported before running the AppImage do seem to have some effect, but so far I had no luck replicating the 1.2.2 behavior (which seems much more "release-ready" compared to current nightlies).

@michaelgregorius
Copy link
Contributor

Playing around some more, I realized this probably matches the appearance common in screens from @michaelgregorius (most of GUI not scaled, and non-fixed-size fonts being notably larger than everything else) that I never managed to replicate on my system until now. I can finally experience the issue you have been dealing with the whole time. :)

If anyone is interested why my desktop looked as described here's a coarse description of the setup at the time:

  • I use SDDM as my login manager and it was configured to start the Plasma session with some extra argument that specified the DPI:
ServerArguments=-nolisten tcp -dpi 120
  • Plasma was configured to have a scaling of 100% (I don't even know if it supported fractional scaling at the time).

It seems that with this configuration images were not scaled at all (due to the 100% setting) but text was still scaled according to the DPI value. Therefore all images/pixmaps looked small compared to text.

Only recently I had to reinstall my system and now I am not using the DPI arguments anymore. Instead I use the fractional scaling that's provided by Plasma. It is set to 125% and now I can also enjoy images/pixmaps that are scaled in ugly ways as well as flickering sub window borders when they are being moved. See here for an example:

UglyFractionalScaling

Note for example the missing light gray border on the left side of the window. It appears and vanishes when the window is being moved, hence the flickering. Almost all elements look ugly now: knobs, LED numbers, gear icons, button images. The button on the top right flickers when I move the right window border.

In general it seems that HiDPI is still a mess under Xorg/Wayland/Qt. I mean, why did I even have to specify the DPI explicitly in the first place? Shouldn't Xorg know best how to find out the DPI and provide that information to Qt?

When I build locally from the source, LMMS always behaves like the 1.2.2 version (apart from the automatic scaling when dragging to a low-res screen, that does not work). And I have no idea how to build or debug an AppImage, so I'm not sure where and how exactly should I look for the root cause of this difference. Environment variables exported before running the AppImage do seem to have some effect, but so far I had no luck replicating the 1.2.2 behavior (which seems much more "release-ready" compared to current nightlies).

I wonder if AppImage builds can include environment variables and if both build are configured with different ones which then steer Qt in different directions. Perhaps the new builds have been configured to work around fractional scaling due to the issues shown above.

However, I don't know much about AppImages and unfortunately I wasn't able to find out where their builds live.

@michaelgregorius
Copy link
Contributor

@he29-net, can you please show how the elements that have been fixed so far look in the 1.3 AppImage on your 4K screen? This would for example be:

  • The file browser, e.g. the "My presets" tab
  • Menus of combo boxes, e.g. the combo box that shows "1 bar" in the Song Editor
  • The track settings menu
  • The sample track window

@he29-net
Copy link
Contributor

he29-net commented Sep 23, 2023

@michaelgregorius Sure. I had to do the screenshots on the smaller screen (because imagemagick cannot grab the screen when a menu is open, and Kazam refuses to store anything on the main screen for some reason), but the proportions are the same (i.e. the big text is properly sized, everything else too small). System is Debian 12.1 + Xfce 4.18 with DPI set to 155.
Screenshot 2023-09-23 13:54:45
Screenshot 2023-09-23 13:57:33

The mixed scaling also happens in the Spectrum analyzer, as you reported in #5088, just with even larger difference in font sizes. The Add effect dialog is also a bit wonky: all the fonts are scaled up, but the window itself has a default size that does not scale with DPI, so it looks really tiny. I think that is a common problem with many similar windows as well (same goes for the side panel, which is too narrow by default and cuts off the check box labels).
Screenshot 2023-09-23 14:07:12

As for the fractional scaling, yeah, that looks pretty terrible. Maybe if we only allowed 1x / 1.5x / 2x, it would be more acceptable, but the only good solution is probably to draw everything from vectors, and that's going to take quite a bit of effort. Meanwhile, there are other small bugs even with the "2x fallback scaling" done by the 1.2.2 version, like the borders of combo boxes (2x scale vs. 1x scale for comparison):
screen
screen

Taking care of all things like that seems like a major GUI rework, so I think for 1.3.0 it would be better to just focus on making the scaling at least "acceptable" and "consistent". And either aim the "proper scaling" for 1.4.x, or 2.0 (along with single-window mode, since that's also a complete GUI rework, so might as well do everything at once).

@michaelgregorius
Copy link
Contributor

Thanks @he29-net!

This looks as expected then. All the remaining small elements are likely caused by:

  • Code that sets the font size in pixels, e.g. via the pointSize template. Example:
p.setFont( pointSize<8>( p.font() ) );
  • Style sheet entries that use pixel sizes
  • Code that hard codes widget sizes

The way forward

I think the way forward is:

  • Remove all calls to the pointSize template.
  • Switch all widgets that use fixed layouts, e.g. that move their children to fixed positions, and that assume fixed sizes. Make them use layouts so that they can flexibly adjust to different text sizes.
  • If widgets do not want to use the default system font size they should define their size in points and ideally via a style sheet (I think this might also apply to the Spectrum Analyzer that was mentioned).

Places where pointSize is used

Currently the pointSize template can be found in the following files. I guess it is best to start with everything that's not under plugins:

  • /plugins/AudioFileProcessor/AudioFileProcessor.cpp
  • /plugins/CarlaBase/Carla.cpp
  • /plugins/DualFilter/DualFilterControlDialog.cpp
  • /plugins/LadspaBrowser/LadspaBrowser.cpp
  • /plugins/Monstro/Monstro.cpp
  • /plugins/Patman/Patman.cpp
  • /plugins/Stk/Mallets/Mallets.cpp
  • /plugins/Vestige/Vestige.cpp
  • /plugins/VstEffect/VstEffectControlDialog.cpp
  • /plugins/ZynAddSubFx/ZynAddSubFx.cpp
  • /src/core/audio/AudioJack.cpp
  • /src/core/audio/AudioOss.cpp
  • /src/core/audio/AudioPortAudio.cpp
  • /src/core/audio/AudioPulseAudio.cpp
  • /src/core/audio/AudioSdl.cpp
  • /src/core/audio/AudioSndio.cpp
  • /src/core/audio/AudioSoundIo.cpp
  • /src/gui/clips/SampleClipView.cpp
  • /src/gui/editors/AutomationEditor.cpp
  • /src/gui/editors/PianoRoll.cpp
  • /src/gui/instrument/EnvelopeAndLfoView.cpp
  • /src/gui/instrument/InstrumentFunctionViews.cpp
  • /src/gui/instrument/InstrumentMidiIOView.cpp
  • /src/gui/instrument/InstrumentMiscView.cpp
  • /src/gui/instrument/InstrumentSoundShapingView.cpp
  • /src/gui/instrument/InstrumentTrackWindow.cpp
  • /src/gui/instrument/PianoView.cpp
  • /src/gui/menus/MidiPortMenu.cpp
  • /src/gui/modals/SetupDialog.cpp (Solve the HiDPI issues of the setup dialog (#2510) #6779)
  • /src/gui/tracks/TrackOperationsWidget.cpp
  • /src/gui/widgets/ComboBox.cpp
  • /src/gui/widgets/GroupBox.cpp
  • /src/gui/widgets/LedCheckBox.cpp
  • /src/gui/widgets/MeterDialog.cpp
  • /src/gui/widgets/Oscilloscope.cpp
  • /src/gui/widgets/TabBar.cpp
  • /src/gui/widgets/TabWidget.cpp
  • /src/gui/AudioAlsaSetupWidget.cpp
  • /src/gui/Lv2ViewBase.cpp
  • /src/gui/MidiSetupWidget.cpp
  • /src/gui/SampleTrackWindow.cpp

Effort

As you have already noted this will be a ton of work. This first set of fixes were mostly low hanging fruits, except for the setup dialog. The goal was to make the application at least a bit more usable on HiDPI screens.

Example for the introduction of layouts

Some while ago I have started hacking on the effects boxes so that they also work with layouts. Their name labels use a larger font now and they elide the name if it is too long. Ideally they should be horizontally resizable. They currently look as follows in my branch:

EffectsWithLabels

"Add effect" dialog and side panel

One option might be to resize the "Add effect" dialog according to the screen size when it is opened. The dialog is resizable, so it might also be a good idea to store its last size when it's closed so that it later opens at that size again.

The same applies to the side panel. It it likely initialized with a pixel size instead of for example a percentage of the available width. On my screen I can fully read the check boxes but because you have a higher DPI screen (155 DPI vs. 117 DPI) the fonts are made bigger relative to the fixed pixel width and hence they are cut off on your screen.

@tresf
Copy link
Member

tresf commented Sep 23, 2023

Did something change in the way we build AppImage between versions 1.2.2 and the current nightly builds?

Not a whole lot, although in my experience, the Qt version we bundle can drastically influence the behavior, so it may be worthwhile to baseline compare the Qt versions.

And I have no idea how to build or debug an AppImage, so I'm not sure where and how exactly should I look for the root cause of this difference.

@PhysSong offered some debugging steps here: #4286 (comment), the relevant parts are:

  1. Go to the directory which contains the AppImage
  2. Run ./lmms-1.2.0-rc5.43-linux-x86_64.AppImage --appimage-extract
  3. Run squashfs-root/usr/bin/lmms

Since lmms is a wrapper to call lmms.real, there may be other environmental factors to consider and they should be present in the script. If you'd like to instead call lmms.real directly, PhysSong has the steps for providing this environment in his original steps although I'd recommend removing the calls to gdb unless that's desired.

There's also a small chance that the linuxdeployqt tool has changed the behavior since 1.2.2 release. That would be a deeper dive, since it's responsible for finding and bundling all of the dependant libraries.

michaelgregorius added a commit that referenced this issue Oct 1, 2023
…youts

Solve the HiDPI issues of the setup dialog (#2510)
@michaelgregorius
Copy link
Contributor

The fix for the scaling issues of the setup dialog (see here) has been merged via pull request #6779.

This might be of interest for @Glitchy-Tozier who has mentioned the problem.

@Rossmaxx
Copy link
Contributor

I have opened #7159 which might fix the text scaling issues but i don't really have time to confirm it. Would appreciate if someone gives a heads up.

@michaelgregorius
Copy link
Contributor

Does anybody know if all of the targeted system (Linux, Windows and MacOS) have a notion of global (fractional) scaling? If they do, does the scaling apply to all of the following elements in a Qt application?

  • Raster images
  • Text that's defined in pixels
  • Text that's defined in points

Windows has support for fractional scaling and Linux also seems to be gaining support for it, e.g. via Wayland. Does MacOS also support this?

If all system supported global fractional scaling (for all of the elements listed above) then the solution might be to follow these rules:

  • Widgets that use font sizes in points must be able to accommodate for text with different pixel heights. They must not use hard coded widths, heights and widget placements. They should use layouts instead of hard coded placements.
  • Widgets that set their font sizes in pixels can use hard coded widths, heights and widget placements because they will scale with global scaling and will be discernible.

With global scaling the way forward to fix the problems with HiDPI would be to either use flexible, scalable widgets that can take different font sizes as preferred by the user or use hard coded widgets with text sizes set in pixels.

More details can be found in #7178. There's also a screenshot which shows problematic elements in the GUI that need work. The quickest fix for some of these elements might be to use QFont::setPixelSize. But this would only be a solution if global scaling scales text in pixel sizes on all targeted systems.

@michaelgregorius
Copy link
Contributor

michaelgregorius commented Mar 31, 2024

Pull request #7185 should fix most scaling issues for users that use global fractional scaling. It for example fixes #7178 and does so in a consistent way.

There is still room for improvement though as it might still be desirable to have a flexible GUI that can scale, e.g. for users that cannot use global fractional scaling. If wanted the items that are described below can also be turned into potential tasks of a new project.

Areas for potential improvements

I have identified the following areas that could be worked on. The gist of it is that the individual plugin GUIs likely cannot be changed if they are not reimplemented completely. Several other areas outside of the plugins could be adjusted though.

Mixer channel view

The name of the mixer channels is still presented using a pixel sized font. It should be attempted to switch it to a fully dynamic layout, so that it can also be defined using a point sized font.

ScalableGUI-MixerChannelView

Automation editor

The automation editor uses a pixel sized font to display the min and max values on the left size of the editor. Might be switched to a point based size.

ScalableGUI-AutomationEditor

Piano roll

The piano roll uses a pixel sized font to display "Note Velocity" and "Note Panning" on the lower left side of the dialog. Might be switched to a point based size if everything around this area can scale accordingly.

ScalableGUI-PianoRollNoteVel

ScalableGUI-PianoRollNotePan

Instrument dialog:

This is the dialog that displays the different instruments. It shows the following information:

  • Characteristic GUI of the instrument
  • Volume/cutoff/resonance envelopes
  • LFOs
  • Note stacking
  • Arpeggios
  • The effects chain of the instrument
  • MIDI input/output
  • Tuning options.

It should be attempted to reimplement the instrument dialog using layouts so that only the actual instrument GUI is displayed at it's fixed size. Everything else around it should be resizable and implemented using layouts. This is a rather big undertaking though but could also make the instrument window much more attractive as it could use more real estate to display the different aspects, e.g. envelopes and LFOs.

ScalableGUI-InstrumentDialog-01-PluginScalableGUI-InstrumentDialog-02-EnvFilterLFO
ScalableGUI-InstrumentDialog-03-ChordStackArpeggioScalableGUI-InstrumentDialog-04-Effects
ScalableGUI-InstrumentDialog-05-MIDIScalableGUI-InstrumentDialog-06-Tuning

Effect view

It should be attempted to switch the effect view to a dynamically layouted implementation so that the view that shows the effects can be resized as well. Some time ago I have attempted to do so (see screenshots at the bottom here) but have not continued yet. This will also involve the effect chain list though. Therefore it has a dependency to the changes made to the instrument dialog because this dialog also shows an effect chain and ideally it should also be resizable.

ScalableGUI-EffectsChain

Widgets

There are several custom widgets that use hard coded sizes and rendering. Due to this they cannot be used sensibly in layouts, i.e. they do not scale. For each of these widget there should be an alternative version that can use points size fonts and that can scale accordingly. In some cases it might be enough to inherit from an existing Qt widget, extend it with the additional functionality and to style it via a style sheet. The widgets are (each under src/gui/widgets/):

  • ComboBox
  • GroupBox
  • Knob
  • LcdFloatSpinBox
  • LcdWidget
  • LedCheckBox
  • Oscilloscope
  • TabBar
  • TabWidget

If possible the old non-scalable widgets should be removed so that they do not get used in the future. Widgets that are used in the context of the plugins with fixed sizes cannot be removed though. It should be attempted to isolate the classes to only the plugins and make sure that they are not used outside of this context.

Plugins

The plugins can be found under plugins in the source tree. In this area nothing should be changed to use point sizes because the actual GUIs of most plugins use pixmap backgrounds and therefore assume absolute positioning, sizes, etc.

@tresf
Copy link
Member

tresf commented Apr 1, 2024

Does MacOS also support [fractional scaling]?

Not officially, no. AFAIK, all displays that they ship use integer scaling, so this would be more common with Hackintosh laptops or perhaps some oddball external displays.

@michaelgregorius
Copy link
Contributor

Does MacOS also support [fractional scaling]?

Not officially, no. AFAIK, all displays that they ship use integer scaling, so this would be more common with Hackintosh laptops or perhaps some oddball external displays.

Thanks for the info @tresf!

So the idea is that Apple sells displays that are close to multiples of 96 DPI so that users can scale with an integer factor? And people who use other hardware must live with the consequence of everything being either a tad too small or too large?

@michaelgregorius
Copy link
Contributor

I have a branch where the instrument window currently has the following layout:
PluginNextToTabs

The idea is that the individual instrument design is always visible and that the other options which shared by all instruments are shown right next to it. This design makes more use of screen real estate and less clicks are needed to sculpt a desired sound.

The next step would be to make the tabs appear less crammed by using layouts where they are not already used so that the dialog all in all becomes more scalable. The other layouts would likely be redesigned to give more breathing space.

Is it feasible to continue in this direction?

@tresf
Copy link
Member

tresf commented Apr 2, 2024

So the idea is that Apple sells displays that are close to multiples of 96 DPI so that users can scale with an integer factor? And people who use other hardware must live with the consequence of everything being either a tad too small or too large?

Correct. They do offer accessibility setting to increase font sizes, but as is the norm with Apple, anything outside of the hardware that they ship requires unofficial 3rd-party software.

Oddly, I've never had scaling issues with Qt apps on Mac (LMMS included), so this strategy has been effective in my opinion.

@Rossmaxx
Copy link
Contributor

Rossmaxx commented Apr 2, 2024

I remember @LostRobotMusic ranting about how every instrument has the same envelope setting. Michael's unification approach (two messages above this one) looks helpful. Perhaps it would even make sense to remove the seperate envelope tab and Integrate it per instrument but that's a rather huge change.

@musikBear
Copy link

seperate envelope tab

Envelopes should not be like this
image
I made simpleton changes to the values so the envelopes was sc Negated, witch only means that the output is piano-like, and afair it was Oscar who added these changes to Master. He did it as a favour because i could not for the sake of sanity make commits from virtual-box.
In Master, Its should be like this:
image

@LostRobotMusic
Copy link
Contributor

I remember @LostRobotMusic ranting about how every instrument has the same envelope setting. Michael's unification approach (two messages above this one) looks helpful. Perhaps it would even make sense to remove the seperate envelope tab and Integrate it per instrument but that's a rather huge change.

No, I said absolutely nothing of the sort. What I have been ranting about is that LMMS's envelopes are strictly linear which sounds extremely awful, the time it takes to drop from 0 to -6 dBFS is the same amount of time as it takes to drop from -6 to -infinity dBFS. This is one of the main contributing factors behind people making the claim that LMMS simply "sounds worse" than other programs. I never once expressed any opinions against LMMS's instruments coming with an envelope supplied by the DAW itself.

@tresf
Copy link
Member

tresf commented Apr 10, 2024

Perhaps it would even make sense to remove the seperate envelope tab and Integrate it per instrument but that's a rather huge change.

Slightly off-topic.... I've mixed feelings about the overall layout, but "front-and-center envelope" I think is a win-win (both for newcomers and seasoned users).

@michaelgregorius
Copy link
Contributor

Perhaps it would even make sense to remove the seperate envelope tab and Integrate it per instrument but that's a rather huge change.

Slightly off-topic.... I've mixed feelings about the overall layout, but "front-and-center envelope" I think is a win-win (both for newcomers and seasoned users).

@tresf, are you referring to the current "old" layout or the new one? If it's the latter what gives you the mixed feelings?

In my opinion the current instrument screen is much too small and hides too much information. Compared to some VSTs that strive to have everything quickly accessible on one screen it takes much more clicking to get the same things done in LMMS' instrument dialog.

The design above also isn't meant as the ultimate implementation anyway. The idea would rather be to start moving into a better direction and get a more and more improved solution via incremental steps. In the end this might even result in a complete redesign which shows all envelopes at once and that redistributes the other elements.

Technical motivations for a redesigned instrument dialog

There's also a technical motivation to change things. The current implementation of the instrument dialog uses LMMS' own TabWidget and that widget does not play nice with widgets that use layouts to organize their children. However, using layouts can help with getting a scalable GUI that works with different screen sizes and pixel densities. So the usage of that widget somewhat stands in the way of that.

IMO one goal should be to get rid of LMMS' own non-scalable widget implementations and to replace them with styled Qt widget wherever possible. This was for example done in the screenshot above with regards to the tabs. They are using a styled QTabWidget and as you can see with that tab widget the widgets are using the space they need which is not the case with TabWidget.

@tresf
Copy link
Member

tresf commented Apr 11, 2024

what gives you the mixed feelings [on the new layout]?

It's just aesthetically worse. Much more dead space in the interface, controls stretched to places they don't belong, LMMS-themed controls next to plugin-themed controls. I understand that it's no small task to rearrange the plugin controls for the future, but this side-by-side looks more like a deconstructed sandwich because it's obvious that it's an explosion of its parts.

A bit extreme (and in my opinion, over simplified) is @budislav's mockup. See "instruments and effects" section here: https://www.behance.net/gallery/194917259/LMMS-Redesign-Concept. (I don't believe he shows the envelope in any
of his mockups
Edit: He does show it in the first mockup, but I believe it's missing from the mockups that follow -- which is why I believe "front-and-center envelope" would be a mutual improvement to both designs).

Many will argue that this will take the branding out of our plugins (this statement would be true). There may be a way to marry the ideas, but I find the existing "background plugin artwork" as a base for the panel-size to be a regression. I can't argue its utility, but I do not think the tradeoff is worthwhile. I hope that is clear and that this is not intended -- in any way -- as a way to minimize the effort involved. The community is always indebted to those that care enough to fix and improve things. ❤️

@tresf
Copy link
Member

tresf commented Apr 11, 2024

IMO one goal should be to get rid of LMMS' own non-scalable widget

Yes, I believe this summarizes it best on a technical level.

@michaelgregorius
Copy link
Contributor

Thanks for you input, @tresf! I appreciate it!

Let me first emphasize that the design above is not meant to be final. It is meant as a proposal for a direction to solve the problems of the users (and also of some of the code). With that in mind I'd like to address some of your remarks:

Much more dead space in the interface, controls stretched to places they don't belong

At least technically the dead space could be removed by moving the controls at the top (Vol, Pan, ..., Save) to above the plugin window. Although that might not make sense logically.

LMMS-themed controls next to plugin-themed controls.

That's the current nature of the thing, also with regards to how it is implemented. The only thing the plugin provides with regards to the GUI is the individual plugin window. Everything on the right is implemented in the underlying instrument base classes and therefore it also looks the same for every plugin (but also different from most plugins).

I understand that it's no small task to rearrange the plugin controls for the future, but this side-by-side looks more like a deconstructed sandwich because it's obvious that it's an explosion of its parts.

No, it is definitively not a small task and that's the exact reason why I am advocating for small steps into the right direction even if none of the steps may be "perfect" and might have its "warts". The important thing would be that each of the step improves upon the previous steps.

A bit extreme (and in my opinion, over simplified) is @budislav's mockup. [...]

Many will argue that this will take the branding out of our plugins (this statement would be true). There may be a way to marry the ideas, but I find the existing "background plugin artwork" as a base for the panel-size to be a regression. I can't argue its utility, but I do not think the tradeoff is worthwhile.

I agree that the fixed plugin artwork/GUI size is a hindrance. It pains me to see that new plugins like SlicerT have to be crammed into that small space, limiting the functionality they can provide.

Some proposals to marry both ideas would be:

  • enable the plugins to have arbitrary sizes, i.e. to redesign the instrument dialog in such a way that it can accommodate arbitrary sizes plugin windows
  • allow plugins to have their own design elements so that they do not lose all individuality
  • require plugins to be designed in such a way that they can potentially scale
  • provide a consistent widget set of controls that are shared by the plugins

Finally, I think what's most important is that some sort of direction is given, e.g. in the form of a project that describes the goal, the strategy and its intended steps. Because no one wants to go through all these steps without being sure that all the work will not be done in vain.

I hope that is clear and that this is not intended -- in any way -- as a way to minimize the effort involved. The community is always indebted to those that care enough to fix and improve things. ❤️

Yes, it is. 🙂

@michaelgregorius
Copy link
Contributor

The envelope and LFO graph are now both scalable. So the design proposed here #3067 (comment) would be possible now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests