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

Basic ghost notes feature. #4575

Merged
merged 9 commits into from Jan 17, 2019
Merged

Basic ghost notes feature. #4575

merged 9 commits into from Jan 17, 2019

Conversation

ghost
Copy link

@ghost ghost commented Sep 2, 2018

This adds a option to the pattern context-menu to add the pattern as ghost notes to the Piano-Roll. Also added a button in the Piano-Roll to clear the ghost notes.

Edited by @tresf: Closes #4449, #4303, #520, Related: #1438, #696

Basic ghost notes

* Changed `int m_noteOpacity` to `unsigned char m_noteOpacity` (aslo converted the relative functions (`noteOpacity` and `setNoteOpacity`) to `unsigned char`) since the maximum value will be 255 and minimum 0.
@LmmsBot
Copy link

LmmsBot commented Sep 2, 2018

Downloads for this pull request

Generated by the LMMS pull requests bot.

…n` in the PianoRoll header since we defined it as `pattern` in the cpp file as well.
src/tracks/Pattern.cpp Outdated Show resolved Hide resolved
@PhysSong
Copy link
Member

PhysSong commented Sep 3, 2018

You should handle the case where the ghost pattern is deleted. If not, you may get a crash after deleting the pattern.
You can use destroyedPattern signal for this purpose. Here's an example:

// make sure to always get informed about the pattern being destroyed
connect( m_pattern, SIGNAL( destroyedPattern( Pattern* ) ), this, SLOT( hidePattern( Pattern* ) ) );

include/PianoRoll.h Outdated Show resolved Hide resolved
…n` signal.

* changed `and` to `&&` for MSVC support.

- Thanks to PhysSong for the review.
@ghost
Copy link
Author

ghost commented Sep 3, 2018

@PhysSong yes it crashed indeed on deletion of the ghost pattern, so I connected to the destroyedPattern signal as you suggested. It doesn't crash anymore on ghost pattern deletion.

Also changed the and to && for MSVC support.

Thanks.

@enp2s0
Copy link
Contributor

enp2s0 commented Sep 18, 2018

This is definitely a much-needed feature!

@dev-sr0
Copy link

dev-sr0 commented Sep 19, 2018

This is so good. I can't overstate how much this would help me.

@tresf tresf added this to the 1.3.0 milestone Sep 24, 2018
@tresf
Copy link
Member

tresf commented Sep 24, 2018

@Umcaruje please chime in on artwork or open a task for yourself and/or @RebeccaDeField to review it after merge.

@ghost
Copy link
Author

ghost commented Sep 24, 2018

I’m also working on a feature to set ghost notes in the Automation Editor with the option to scale the ghost notes. I have something working but I need to clean it first before putting anything online, but should I open a new PR or just merge the code with this?

The slider normally scaled the ghost notes vertically, on double click of the slider handle it controls the position offset. Styling is just there for example.

automation_ghost_notes

@tresf
Copy link
Member

tresf commented Sep 24, 2018

should I open a new PR or just merge the code with this?

I recommend a new PR. This one's near-ready for merge, so you can just rebase/fast forward the other PR off of master once this is merged.

@ghost
Copy link
Author

ghost commented Sep 24, 2018

Ok great I'll do that, thanks.

@FeralBytes
Copy link

@cyberdevilnl I can't wait for this to get merged, Thank you for your work on this much needed feature!

@zonkmachine
Copy link
Member

@Umcaruje please chime in on artwork or open a task for yourself and/or @RebeccaDeField to review it after merge.

The artwork folks isn't that active right now so I don't think we can wait for them. What else is left to do here?

@PhysSong
Copy link
Member

PhysSong commented Jan 6, 2019

Testing? If this one works well, why not merge this? The artwork stuff can be handled later.

@zonkmachine
Copy link
Member

OK. I'll take it for a spin. :)

@FeralBytes
Copy link

FeralBytes commented Jan 6, 2019

Why even delay for the artwork folks, the art work is included in the commit? If it is not good enough then the artist can come back and fix it when they comeback from hiatus, there commit activity is practically nill last year. (Correction/Addition: I do see that they have been actively communicating though in other PRs so that is good.) I will be downloading this to use for sure and I will report back if I encounted any issues.

@zonkmachine
Copy link
Member

Tested works. Basically it works like this. When you have an open Piano Roll you can right click a pattern in the Song Editor and set it as ghost pattern in the open Piano Roll. If you have no Piano Roll open it's the last opened Pattern that is effected (and the pattern is opened in a Piano Roll window when the ghost pattern is set). You can clear the ghost pattern with a button but the ghost pattern is also not persistent so when you close the Piano Roll it will be forgotten. The artwork is adorable.

It's good enough for master in my opinion but I want a second opinion.
I've never used a function like this in any other software so I don't know what people expect from this.
Should a ghost pattern be persistent?
Are there better ways to set a ghost Pattern? Right click/copy, right click/"paste as ghost pattern"?

@cyberdevilnl Is the artwork your original?

@musikBear
Copy link

Should a ghost pattern be persistent?

imo yes, until the user decides to remove the ghosts. Not only does persistence open more options, toggle-able features are always more user-friendly, than a rule based behaviour
Besides that ; HUGE firework for this feature ! @cyberdevilnl +1

@ghost
Copy link
Author

ghost commented Jan 6, 2019

@zonkmachine : Yes I created the icons with Inkscape from scratch, feel free to use/replace them.

@FeralBytes @musikBear : glad it’s been helpful :-)

If there are behaviour changes needed please let me know. One thing I could think of is disabling/hiding the clear ghost icon in PianoRoll when there is no ghost set.

@zonkmachine
Copy link
Member

One thing I could think of is disabling/hiding the clear ghost icon in PianoRoll when there is no ghost set.

Yes. This is a good idea. Also, if you right click an empty pattern, maybe the context menu ghost icon should be disabled?

@RebeccaDeField
Copy link
Contributor

@FeralBytes Actually hoping to have some more activity this year, but I agree that it would be best to commit now, update art later. I have some ideas on how the icons could be finished up, but I'm not available to work on it yet.

@tresf
Copy link
Member

tresf commented Jan 6, 2019

Why even delay for the artwork folks

Agreed. This shouldn't be a factor unless it's actively be worked on. Most features come with default artwork and is re-themed as time goes on. This should be the standard as to encourage the coding of features and discourage lengthy merge times. If we can get some more volunteer project maintainers we can shorten the merge time as well. <3

* Small change to comply more with the rest of the coding style.
@ghost
Copy link
Author

ghost commented Jan 6, 2019

@zonkmachine Good, I’ve made some changes. The context menu entry won’t be added if the pattern is empty and the clear ghost notes button in the piano-roll is only enabled when a ghost pattern is set.

@FeralBytes
Copy link

@cyberdevilnl It definitely would be better with some persistence. But even so this is a huge productivity boost. Also several checks have failed but looks like they just took too long. How do we get the LMMS Bot to build a new PR app Image once all checks are passing?
@RebeccaDeField Sorry that the message may have come off as a personal attack, it was not meant like that. I understand we all get busy and these are open source volunteer based programs. I just more so wanted to make sure that the PR does not get held up if the current artwork is satisfactory.

@tresf
Copy link
Member

tresf commented Jan 7, 2019

How do we get the LMMS Bot to build a new PR app Image once all checks are passing?

Don't believe there's a way yet and I'm not sure if the bot's still running for new PRs. @Reflexe?

@PhysSong
Copy link
Member

PhysSong commented Jan 7, 2019

I'm not sure if the bot's still running for new PRs.

It seems like there was a problem with the bot and @Reflexe have fixed it. For some reason, however, there are no transfer.sh links in build logs. The upload works fine locally though. I suspect they may have blocked uploads from Travis-CI, but not really sure...

@zonkmachine
Copy link
Member

@zonkmachine Good, I’ve made some changes. The context menu entry won’t be added if the pattern is empty and the clear ghost notes button in the piano-roll is only enabled when a ghost pattern is set.

Better. 👍

src/tracks/Pattern.cpp Outdated Show resolved Hide resolved
@zonkmachine
Copy link
Member

I haven't looked deep into the code of this but @PhysSong had a go at it earlier in the thread.

@cyberdevilnl Did you look into the ghost notes being remembered? It is a bit volatile at the moment as it's lost as soon as you exit the Piano Roll.

@ghost
Copy link
Author

ghost commented Jan 10, 2019

@zonkmachine Ah I get what you mean, should be fixed now.

CYBERDEViLNL added 2 commits January 10, 2019 10:37
* Don’t paint ghost if it’s the same pattern.
@zonkmachine
Copy link
Member

@zonkmachine Ah I get what you mean, should be fixed now.

Great! Now the pattern is remembered for the complete session. The PR is well defined and works.

You set a ghost pattern and it's set globally and is there until you either clear it, set another pattern or close the project.

@zonkmachine
Copy link
Member

Merge?

@zonkmachine zonkmachine merged commit 5126070 into LMMS:master Jan 17, 2019
@zonkmachine zonkmachine mentioned this pull request Feb 2, 2019
4 tasks
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
Lets you set a melody pattern as visible in the background of the Piano Roll
as support when building a new pattern. The pattern is visible throughout
the session or until cleared via the provided button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants