-
-
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
#5339, #5340: Fix pasting notes from bb editor #5502
#5339, #5340: Fix pasting notes from bb editor #5502
Conversation
🤖 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://7993-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.684-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/7993?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://7992-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.684-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/7992?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://7994-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.684-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/7994?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/34wupqknvva3mx87/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34458344"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/3tc628c2hrh5yuh3/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34458344"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://7991-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.684-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/7991?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "cef300d946dc077d3ee262b4934815bfb481bcdb"} |
Instead of defining a new constant, why don't you just check if the pasted note has a length of -DefaultTicksPerBar? |
Because What i noticed while writing the above: This PR fixes the problem where notes are copied from the BB Editors Piano Roll and pasted to an Instruments Piano Roll as described in the issues. I have not thought of the implications of the PR when copying notes from a BB Editor to itself or to another BB Editor. @Veratil, please remove the approval for now. |
But, instead of setting the note length to a magic number and then resizing it when it's added, couldn't you just set the note to the correct length before adding it? |
You're totally right, thanks! I missed that the pattern is accessible from the |
46202ca
to
434012e
Compare
@@ -218,6 +219,7 @@ Note * Pattern::addNote( const Note & _new_note, const bool _quant_pos ) | |||
m_notes.insert(std::upper_bound(m_notes.begin(), m_notes.end(), new_note, Note::lessThan), new_note); | |||
instrumentTrack()->unlock(); | |||
|
|||
adjustSteps(); |
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.
Could you explain why you update m_steps
only in this case, not whenever the length changes?
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.
When a user clicks on "Add steps" and creates a pattern on the added steps, if he then deselects all of the steps in the extended range for a moment, the range is shrunk immediately. I thought this would be a bit annoying, though it looks nicer when steps are moved inside the piano roll or removed and the beat pattern adapts. This would be a one line change essentialy.
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.
I could be wrong, that's my first glance on the PR. But from what I read, on master m_steps
is only changed by methods related to the BBTrack. When you have an MelodyPattern
(adding notes through the piano roll), it seems that the length of the pattern changes but m_steps
remains the same value. So when you delete the notes and it goes back to being a BeatPattern
, the number of steps is the one you set earlier on the BBEditor. I didn't test yet but I think with this line you'd end up updating the number of steps as you add notes and once you go back to a BeatPattern
you'd have the last value you had, not the one you set on the BBEditor. Changing that behavior is not really necessary and IMHO it makes sense to keep BeatPattern
number of steps separated from the MelodyPattern
length.
Co-authored-by: Hyunjin Song <[email protected]>
Co-authored-by: Kevin Zander <[email protected]>
acadfb3
to
cef300d
Compare
At first sight, the code looks good, though I'd personally remove |
Close in favor of #5902 . |
Addresses #5339 and #5340: When pasting notes from the bb editor to the piano roll, the length of the notes copied is now set to the envelope length of the underlying instrument, dependent on the BPM and envelope settings at the moment of pasting. Previously, copying the notes led to unexpected behavior including them not being registered in the song editor or being ignored by the loop. Thanks @Veratil for the discussion on discord and the change requests.