LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
7.83k stars 988 forks source link

Ergonomics #6967

Open bboboedov opened 8 months ago

bboboedov commented 8 months ago

Enhancement Summary

In TripleOscillator, it would be more convenient to experiment with different waveforms if the selection of waves was carried out not through the file opening dialog box, but using a list that leaves when you click "+" to the right of the window and remains there. Clicking on the list item should have the same effect as when opening the file, and the focus should go to the window in such a way that you can hear the sound by pressing the keys on the keyboard. The list should contain: 1) the selection of the folder whose files will be the items of the list and 2) the search field by name (possibly by other criteria). Thus, it will take less clicks to try different waveforms.

Justification

Mockup

musikBear commented 8 months ago

if the selection of waves was carried out not through the file opening dialog box

it is not In 3OC there is a click-able representation of waveforms: image It is intuitive and easy -or? are you thinking on Filters..?

michaelgregorius commented 8 months ago

If I understand correctly this issue is about improving the loading of custom waveforms into the oscillators so that it becomes easier to experiment with them. The current workflow is as follows:

  1. Double click on the "+" sign.
  2. A dialog opens which by default shows the "samples/waveforms" folder.
  3. Select a file to load into the oscillator.

So if you want to try out different waveforms you must repeat the steps above which is rather cumbersome.

While checking this I also noticed that having to double click the "+" sign is not very discoverable. All other waves can be selected with a single click and if you single click the "+" there is no sound because no wave is loaded into the oscillator yet. You must first double click and select a wave. It's not very obvious that the "+" can be double clicked in the first place.

This proposal seems to be the following:

  1. The users can select a directory of their choice with potential waveforms.
  2. Upon selection the directory is scanned and a list with available waveforms is populated.
  3. The users can now open the list and directly select a waveform without having to go through the file dialog.

I think ideally it should also be possible to go from one waveform to the next, e.g. with some arrow keys.

Even if this was implemented there are some technical questions:

  1. Should the directory be scanned recursively? If yes, how should the results be represented in the list? Flattened? Mirroring the sub directories.
  2. How to ensure that the users does not specify their root directories which would lead to scans that take a very long time if scanned recursively?
teknopaul commented 8 months ago

I am interested in developing something similar for Audio File Processor.

What I had intended was to save the directory where the audio file is inside the instrument if it is (not already), then with up down buttons or key presses load all the files of the correct type in the same diredctory (not recursive) into an array and then iterate that, updating the instrument with the file each time.

Would that help?

For example I have a bunch of different samples from professional sample packs that are already organized by directory. I want up diown burttons to flip throught the current directory. To change directory just use the + symbol as before.

I think same approach would work for other instruments?

michaelgregorius commented 8 months ago

Hi @teknopaul, I think this could be a valuable feature.

What do you mean by "load the files" though? Do you mean to load the meta data of the files so that you can load the actual data once it is requested or would you intend to load the actual content of all files? I would advise against doing the latter as it might take a very long time and would be wasteful with regards to resources, especially if you have thousands of samples in the directory.

teknopaul commented 8 months ago

For AFP GUI would be like this...

/somedire/current.wav [dir icon] [<] [>]

flick the file icon and it loads a file as normal

click < n.b. first time we need to find m_index then cache just that int for each subsequent click

QString DirectoryScroller::findNext(bool upDown)
{
    QStringList files = m_dir.entryList(QStringList(m_suffix), QDir::NoFilter, QDir::Name);
    if (upDown)
    {
        if (m_index < files.length())
        {
            m_index++;
        }
    }
    else if (m_index > 0)
    {
        m_index--;
    }
    return files.at(m_index);
}
teknopaul commented 8 months ago

It could be faster but I don't think that can be slower than opening up the file chooser each time.

teknopaul commented 8 months ago

I've written this as a util class so we can iterate on better implementations, supporting nested directories etc

teknopaul commented 8 months ago

Screenshot from 2023-11-07 17-10-50

teknopaul commented 8 months ago

There is a QWidget called LeftRightNav

teknopaul commented 8 months ago

Created this on a feature branch if you want to try it out

/home/teknopaul/github_workspace/lmms feature/directory-scroller

teknopaul commented 8 months ago

Screenshot from 2023-11-07 19-37-03

teknopaul commented 8 months ago

Same widget would look like this in the triple oscillator

teknopaul commented 8 months ago

Screenshot from 2023-11-07 19-37-03

teknopaul commented 8 months ago

So thats a screen shot of it working in feature/directory-scroller branch, works on my machine.

@bboboedov can you try that out, I have only Linux to try things out on and this code has weird paths. LMMS internally users.

double click [+] to select a file, only after having done that once prev and next will work: you need to select a directory of files.

musikBear commented 8 months ago

loading of custom waveforms @michaelgregorius vrote

: p Now i get it. Thanks mic. And already implemented ! Impressive work @teknopaul 👍

bboboedov commented 8 months ago

Итак, вот снимок экрана, на котором он работает в ветке feature / directory-scroller, работает на моем компьютере.

@bboboedov не могли бы вы попробовать это, у меня есть только Linux для тестирования, и в этом коде есть странные пути. LMMS поддерживает внутренних пользователей.

дважды щелкните [+], чтобы выбрать файл, только после того, как вы сделали это один раз, предыдущие и следующие будут работать: вам нужно выбрать каталог файлов.

Hello! Thank you for your responsiveness! I would try, but I need instructions on how to do it.

teknopaul commented 8 months ago

on Linux you clone the source from gitub git switch to the branch mkdir build cd build cmake make ./lmms

teknopaul commented 8 months ago

But Linux always has build tool available in other Platforms I have not done QT dev

teknopaul commented 8 months ago

https://github.com/LMMS/lmms/wiki

teknopaul commented 8 months ago

@musikBear

Any idea how to go about getting pull requests tested and merged?

michaelgregorius commented 8 months ago

Hi @teknopaul,

I think it should work as follows:

  1. Go to the "Code" section of your LMMS repository.
  2. Select the "feature/directory-scroller" branch.
  3. In the "The branch is X commits ahead" box there should be a "Contribute" drop down from which you can select to create a pull request.