-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
MIDI Program Change message support in VeSTige, SF2 Player and GIG Player #5158
MIDI Program Change message support in VeSTige, SF2 Player and GIG Player #5158
Conversation
I don't see why these changes should affect the "Show/Hide GUI" and "Stop all notes" buttons. As these are MIDI related settings, wouldn't they go in the MIDI settings tab? |
MIDI settings tab is part of LMMS. Only the plugin tab displays the controls specific to plugins (in this case VeSTige). |
I thought a bit more about @Spekular's suggestion, it seems that "Use Bank Select LSB" switch could actually be moved to the MIDI tab. I started working on implementation of similar functionality in GIG Player and Sf2 Player, it turned out that I need to repeat there a substantial amount of code. The same problem would appear in other plugins when they get the same functionality as a further step. Moreover, GIG Player has a plenty of room in its GUI, but fitting the switch into GUI of Sf2 Player will be a hard task. I think that a new message should be added in the abstraction layer between MIDI clients and consumers. Maybe Instrument or Plugin class could be enhanced with a new virtual function, say, changePresets? The common code would combine Bank Selects and Program Change into a proper call with ready-made preset number. The MIDI tab will give the user a choice if the messages should be intercepted, possibly in a form of a drop-down list: [Preset selection] => {Off | Program Change only | Program Change and Bank Select MSB only | Program Change and Bank Select MSB/LSB} This way we will not interfere with CCs 0 and 32 should they have a different context on some MIDI controllers, unless explicitly told to do so. I will work on some prototype later. Still, something has to be done with "Capture Program Change" switch. It is specific to VeSTige, I believe that the user should have a choice on how the messages should be handled. If we could move the "plugin information" box a few pixels up, then I could restore the original appearance of aforementioned buttons, adding the new switch below "Stop all notes". |
I have finally found a reasonable way to move "Capture Program Change" switch to MIDI tab as well. For this reason I restored the original appearance of VeSTige (but still leaving the preset number in the upper row). Since the change is now in the common part of the code, I decided to take an opportunity and adapt Sf2 Player and GIG Player to the new functionality. Originally I intended to create a separate pull request for them, but since they allow to choose bank independently from preset I decided to re-design a bit the interface. The instruments do not receive the ready-made preset number anymore, but instead they get a separate "nullable" bank number and program number. There are 3 policies of handling Bank Select CCs:
Open points:
|
Some comments:
|
|
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
macOS
Windows
🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://6549-15778896-gh.circle-artifacts.com/0/lmms-1.2.1.705-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/6549?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://6546-15778896-gh.circle-artifacts.com/0/lmms-1.2.1.704-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/6546?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/0y4j6d3nr7c0bq0s/artifacts/build/lmms-1.2.1-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/32967989"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/ginakdbhd7b71l40/artifacts/build/lmms-1.2.1-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/32967989"}]}, "commit_sha": "4094657e6cb22d7a2e58fbcb028c03e9e6d490ad"} |
9d99530
to
be7817d
Compare
The code looks good in general. I think we need some testers for this. Testing PR before merging is not mandatory but strongly recommended. |
* Extract RecentProjectsMenu class from MainWindow * Clean up updateRecentlyOpenedProjectsMenu * Remove m_recentlyOpenedProjectsMenu from MainWindow
* Replaced large buttons for "Show/hide GUI" and "Stop all notes" with icons to fit the new control. * Added "Capture Program Change" toggle button. * Moved ID of plugin's patch to the "Preset" label to make more room for the actual preset name.
* Added proper Qt signal connection. * Removed debugs which are no longer useful. * Added protection against changing programs while a VST plugin is not loaded (crashed app). * Added model-view connection to the group view.
* Added handling of Program Change messages in Sf2 Player and Gig Player * Modified API to pass bank number and preset number separately
Prevented from emission of patchChanged signal in SF2 Player and Gig Player when neither preset and bank numbers have actually changed.
348ce79
to
0a52ea4
Compare
Any testers still needed? In Linux as a daily driver so could test SF2, might be able to boot into a Windows environment and test Vestige too. |
Yes please! |
@zonkmachine If there are any instructions on how to build feature branches on Linux (on Ubuntu 20.04) or somewhere to get Linux and/or Windows assets that would be great, otherwise any pointers would be of help as I've used LMMS for a couple of years but not really familiar with it's build system or dependencies. Thanks. |
Hi @botwhytho, there are links to pre-built .AppImage files for this PR. See the comment above by @LmmsBot, which is regularly edited with the latest build links. |
/* Base velocity help label hidden to preserve the window size. | ||
* Maybe there is a better solution */ | ||
#if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed before merging.
Code ported to the new code base. A new pull request was created (#6676), closing this one. |
Adds the native support for the following MIDI events in VeSTige:
The patch adds two toggle switches to VeSTIge GUI:
which are loadable and saveable. To make the room for new switches it was neccessary to reorganize slightly the existing user interface - "Show/Hide GUI" and "Stop all notes" buttons were reduced to the form of icons. Additionally, the MIDI preset number was moved from preset name line to the "Preset:" caption above it, so that there is more space for the actual preset name.
Description of new features
When "Capture Program Change events" switch is on, the events above are captured directly by VeSTige and used to determine the ID of preset to switch to; the VST plugin will not receive these events. When the switch is off the MIDI events will be passed through to the plugin.
When "Use Bank Select LSB" switch is on, both controllers 0 and 32 are used. The values are combined to obtain the bank number between 0 and 16383 (2^14 - 1). When the switch is off, only controller 0 is used and is treated as LSB. This allows to choose banks between 0 and 127 (2^7 - 1). This allows to work with MIDI devices that use either of the approaches.
The target preset ID is determined from the bank number and the program number. Presets 0 to 127 belong to bank 0, presets 128..255 fall into bank 1, presets 256..383 belong to bank 2, and so on.
Reception of the Program Change and/or Bank Select messages will trigger the update of the VeSTige GUI, so the preset name is visible immediately.
Validation of changes
Preparation
Validating Program Change
Validating Bank Select
Note: here I recommend using a VST plugin with more than 128 presets.
Enable "Use Bank Select LSB" switch
Send Program Change with the value of 0
Send Bank Select MSB with the value of 0 and Bank Select LSB with the value of 1
Send Bank Select LSB with the value of 2
Send Bank Select MSB with the value of 1 and Bank Select LSB with the value of 0
Disable "Use Bank Select LSB" switch
Send Bank Select MSB with the value of 0 and Bank Select LSB with the value of 1
Send Bank Select LSB with any value
Send Bank Select MSB with the value of 1
Validating save & load
Notes
Change in scope of #5138 (already closed) which is actually a part of #1472.
The pull request includes a fix for #5139 which has not yet been merged to the master branch, but is required by the new feature.