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

Enable Lv2 Atom ports #5691

Merged
merged 1 commit into from Oct 20, 2020
Merged

Enable Lv2 Atom ports #5691

merged 1 commit into from Oct 20, 2020

Conversation

JohannesLorenz
Copy link
Contributor

@JohannesLorenz JohannesLorenz commented Sep 29, 2020

This commit enables atom ports and feeds them with MIDI events, if the atom ports accepts them. This enables Lv2 instruments with piano roll, e.g. the MDA Piano.

Reviewer hints:

  • Please review

Tester hints:

  • Wait with final testing until review is done
  • Set up a wide range of packages (my current list of packages at Arch Linux is: "calf lsp-plugins mda.lv2 noise-repellent surge x42-plugins", and from the AUR: "lv2-plugins-aur-meta")
  • Any Lv2 instrument is worth testing
  • New effects are also available: the x42-eq and x42-dpl
  • This PR is actually just about passing piano roll key presses to Lv2 instruments (which it does via MIDI internally: when you press a key in piano roll or play it in the editor, LMMS passes MIDI to the plugin, and Lv2 now recognizes these MIDI events).
  • Things to check can include
    • play notes using
      • piano roll
      • keyboard keys
      • the Instrument view's keyboard
    • playing tons of notes at the same or nearly the same time

@LmmsBot
Copy link

LmmsBot commented Sep 29, 2020

🤖 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

Windows

macOS

🤖
{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://9685-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-735%2Bg5e873da-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9685?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://9687-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-735%2Bg5e873da14-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9687?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://9688-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-735%2Bg5e873da14-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9688?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/rfowgksa52r9n2ch/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35839173"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/5nin0we8f7608fi3/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35839173"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://9689-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-735%2Bg5e873da14-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9689?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "bec5e25132bf9d83156257ebca12751671c5e51e"}

@JohannesLorenz JohannesLorenz added needs code review A functional code review is currently required for this PR needs style review A style review is currently required for this PR labels Sep 30, 2020
@JohannesLorenz
Copy link
Contributor Author

CI finally passed 😃 Ready for review.

Copy link
Member

@DomClark DomClark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me.

src/core/lv2/Lv2ControlBase.cpp Outdated Show resolved Hide resolved
src/core/lv2/Lv2Proc.cpp Outdated Show resolved Hide resolved
include/Lv2UridCache.h Outdated Show resolved Hide resolved
src/core/lv2/Lv2Proc.cpp Outdated Show resolved Hide resolved
src/core/lv2/Lv2Ports.cpp Outdated Show resolved Hide resolved
@JohannesLorenz
Copy link
Contributor Author

All comments re-worked. Let's see what CI says...

@JohannesLorenz
Copy link
Contributor Author

CI passed 🎉 @DomClark can you please check my rework?

Copy link
Member

@DomClark DomClark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although m_midiIn is set to the required MIDI in port if one is present, this doesn't seem to be taken into account when actually sending events to the plugin - they all go to the first visited MIDI in port instead.

src/core/lv2/Lv2Proc.cpp Outdated Show resolved Hide resolved
@JohannesLorenz
Copy link
Contributor Author

JohannesLorenz commented Oct 6, 2020

@DomClark I fixed it, to use m_midiIn now. Can you please re-check? The commit has a large diff, but I only refactored, nothing else.

I wonder if the MIDI to buffer code (midiInputEventToData) should be moved into a common function, so that plugins/carlabase/carla.cpp (CarlaInstrument::handleMidiEvent) can re-use the code. What do you think?

@JohannesLorenz
Copy link
Contributor Author

@DomClark I only added 2 more commits:

  1. I fixed your comment about MIDI input events that might have not been sent to m_midiIn (7ada8c0).
  2. Refactoring: Carla and Lv2 share the code now which writes a MIDI event into a raw buffer (3a79181).

Can you please check those two, so we can finish the review?

Copy link
Member

@DomClark DomClark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks correct now, as far as I can tell. I've suggested a couple of small improvements.

src/core/lv2/Lv2Proc.cpp Outdated Show resolved Hide resolved
src/core/lv2/Lv2Proc.cpp Outdated Show resolved Hide resolved
@JohannesLorenz JohannesLorenz added needs testing This pull request needs more testing and removed needs code review A functional code review is currently required for this PR needs style review A style review is currently required for this PR labels Oct 17, 2020
All Atom ports are now being created and connected. Currently only MIDI
input ports are supplied with data.

Major contribution to LMMS#562 ("lv2 support").
Copy link
Contributor

@IanCaio IanCaio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a code review (not very familiar with the Lv2 core right now), but a tester review.

Everything seems to be working fine. I tried testing other plugins besides Surge (drumkv1, ZynAddSubFX, samplv1, Black Pearl Drumkit and Red Zeppelin Drumkit) but those couldn't be loaded due to missing features. If requested I could test with another plugin known to not require those.

Surge has worked perfectly though, the Instrument Widget's, Piano Roll's and QWERTY MIDI keyboards played the notes smoothly. Tried adding lots of notes simultaneously (above 20 I guess) and it worked fine. Also tested using a hardware MIDI keyboard and it behaved properly.

No misbehavior or instabilities noticed. Very excited to see how Lv2 is growing!

@JohannesLorenz JohannesLorenz removed the needs testing This pull request needs more testing label Oct 20, 2020
@JohannesLorenz JohannesLorenz merged commit 8b2902c into LMMS:master Oct 20, 2020
Add LV2 support automation moved this from In progress to Done Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants