Skip to content

pitch wheel recording in the detune pattern - #6297

Merged
zonkmachine merged 7 commits into
LMMS:masterfrom
serdnab:recordmidiw
Aug 31, 2023
Merged

zonkmachine merged 7 commits into
LMMS:masterfrom
serdnab:recordmidiw

Conversation

@serdnab

@serdnab serdnab commented Feb 2, 2022 •

Copy link
Copy Markdown
Contributor

Closes #3724

When creating a note from midi origin, it now sets the position as the current playing position.
If piano roll is recording, it records the value of the instrument pitch wheel in the detune pattern of the current recording midi note.
When finishing recording of a note, it sets the detune pattern of the new note with the detune pattern of the midi note.
I extended the detune pattern range to 60 semitones, since that is the pitch wheel max range.

@LmmsBot

LmmsBot commented Feb 2, 2022 •

Copy link
Copy Markdown
ðŸĪ– Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! ðŸŽĐ

Windows

Linux

macOS

ðŸĪ–
{"platform_name_to_artifacts": {"Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://15651-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.169%2Bg022b6f46f-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/15651?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://15648-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.169%2Bg022b6f46f-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/15648?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/syqq3r1k8us3il71/artifacts/build/lmms-1.3.0-alpha-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/42472657"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/e02f5li9odwkd4l9/artifacts/build/lmms-1.3.0-alpha-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/42472657"}], "Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://15650-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.169%2Bg022b6f46f-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/15650?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://15652-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.169%2Bg022b6f46f-mac10.14.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/15652?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "2813ee29f49a909c31a0d415e060a06c197bc72b"}

@RiedleroD

RiedleroD commented Feb 3, 2022 •

Copy link
Copy Markdown
Contributor

Could this be expanded to take pitch automation from midi import as well? Would drastically decrease the amount of automation tracks I'd have to carry over, so that'd be very helpful to me.

@allejok96

Copy link
Copy Markdown
Contributor

@serdnab this is awesome! Works like a charm. Just a few things: a detune pattern with a single point is now created for every note even if the pitch wheel is untouched. This will eat memory. And the detune "sample rate" is far too low if you want to do vibrato. (One point per beat?) No reason to hold back on that one, since it will only be used occasionally in a song.

@allejok96

Copy link
Copy Markdown
Contributor

(I think this is another problem, but I'm curious) @RiedleroD can you explain the process you are currently going through when you are carrying over automation for an imported midi file?

@RiedleroD

Copy link
Copy Markdown
Contributor

@allejok96 well if there's lots of pitch automation I leave it as it is (too much work), but sometimes there's just one or two pitchbends which I just approximately recreate using note bending to declutter the project. Most of the time though, there's lots of pitch automation tracks with a single pitchbend to 0 - which are really annoying, but also really easy to remove in a separate PR I guess.

If you'd integrate pitch automation from midi import into note bending, all of that work would just disappear. Plus I'd have even cleaner files than before. Though yeah, it's probably better in a separate PR. Should I create a feature request for this?

@serdnab

serdnab commented Feb 4, 2022

Copy link
Copy Markdown
Contributor Author

a detune pattern with a single point is now created for every note even if the pitch wheel is untouched

This is a separate bug, as it happens always you create a note, even if you don't record.

the detune "sample rate" is far too low

If you open the detune editor and you change the quantization before recording any notes, you can increase the "sample rate".

Should I create a feature request for this?

Yes, please, as that would require some work.

@allejok96

Copy link
Copy Markdown
Contributor

open the detune editor and you change the quantization

A bit obscure but it makes sense when you know it.

it happens always you create a note, even if you don't record

It's not what you think, but you are right - it is an existing bug. Here you see the problem in action. It starts as soon as I touch the pitch wheel, and then it never stops until LMMS is restarted. But it only affects midi input.

bild

The bug is because the controller recording stores a "raw" float without any rounding or quantization. Look here, this shouldn't even be possible to create:

bild

This lack of rounding causes the bug in the first image, because my pitch wheel settles on 0.0000610352 which is just a ridiculous precision. The bug doesn't cause any problems atm, but this PR brought it to light. I'll file a new issue.

@allejok96

Copy link
Copy Markdown
Contributor

Adding this in InstrumentTrack::InstrumentTrack() will solve my problem. It will restrict the pitch knob to whole cents.

m_pitchModel.setStrictStepSize(true);

Since the problem arises with this PR I think it makes sense to fix it here.

Comment thread src/core/NotePlayHandle.cpp Resolved
Comment thread src/core/NotePlayHandle.cpp Resolved
Comment thread src/core/NotePlayHandle.cpp Resolved
Comment thread src/core/NotePlayHandle.cpp Resolved
@serdnab

serdnab commented Feb 5, 2022

Copy link
Copy Markdown
Contributor Author

Since the problem arises with this PR I think it makes sense to fix it here.

I will commit it.

@serdnab

serdnab commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

Requested changes addressed.
I looked for another way to check if the piano roll is recording, but I didn't find it.
If you have any ideas?

@Veratil

Veratil commented Feb 7, 2022

Copy link
Copy Markdown
Contributor

Requested changes addressed. I looked for another way to check if the piano roll is recording, but I didn't find it. If you have any ideas?

It'll require some re-architecting later, but for now this is fine. It's a good enhancement. 👍

@Veratil

Veratil commented Feb 18, 2023

Copy link
Copy Markdown
Contributor

@serdnab can you rebase and fix the conflicts? We can merge after that.

@zonkmachine

Copy link
Copy Markdown
Contributor

@serdnab @Veratil I'm having a go at updating this to latest master. Stand by... 🕚

@zonkmachine

Copy link
Copy Markdown
Contributor

@serdnab @Veratil I think I've managed to update the PR and you can always revert to 2813ee2
The build no longer works and fails on a GuiApplication related issue. It looks to me like that is due to changes on master since the last commit before I touched it.

[  0%] Building CXX object src/CMakeFiles/lmmsobjs.dir/tracks/InstrumentTrack.cpp.o
/builds/lmms/src/tracks/InstrumentTrack.cpp: In member function ‘virtual bool lmms::InstrumentTrack::play(const lmms::TimePos&, lmms::fpp_t, lmms::f_cnt_t, int)’:
/builds/lmms/src/tracks/InstrumentTrack.cpp:717:77: error: ‘GuiApplication’ has not been declared
  717 |                 processHandle->processTimePos(_start, m_pitchModel.value(), GuiApplication::instance()->pianoRoll()->isRecording());
      |                                                                             ^~~~~~~~~~~~~~
make[2]: *** [src/CMakeFiles/lmmsobjs.dir/build.make:3361: src/CMakeFiles/lmmsobjs.dir/tracks/InstrumentTrack.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2136: src/CMakeFiles/lmmsobjs.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

@zonkmachine

Copy link
Copy Markdown
Contributor

Above issue fixed. We all bow deeply to @sakertooth

Tested: We got pitch bend on record. Damn!
All hail @serdnab!

@zonkmachine
zonkmachine merged commit 005ee47 into LMMS:master Aug 31, 2023
@DomClark DomClark mentioned this pull request Oct 19, 2023
@lukas-w lukas-w mentioned this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record pitch automation directly into piano roll

7 participants