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

Some automation pattern fixes #3352

Merged
merged 9 commits into from
Mar 4, 2017

Conversation

zonkmachine
Copy link
Member

@zonkmachine zonkmachine commented Feb 13, 2017

Fixes #391

  • In response to one part of issue Automation "Locked Out" Bug, Affects Exporting #391, comment here, in which you can't delete Automation Points that were made under a finer quantization. Don't consider quantization when deleting and just delete the value at the position.
    We should maybe iterate through the neighbouring positions if there are no values at the current positon as it's a bit hard currently to hit the right spot for deletion. You have a similar problem when dragging an Automation Point which I haven't touched in this PR. When you select an Automation Point made under finer quantization you will instead create a new point at the quantized position.
  • Let an automation point clear the area it covers.
  • Triplets and no quantization option. This gives the Automation Editor the same quantization options as the other editors.
  • Improved erase action when moving mouse across Automation Points.
  • Eighth note, new default quantization value.

@zonkmachine
Copy link
Member Author

Found a better solution that keeps the quantization but defaults for minimal value.

@Umcaruje
Copy link
Member

On an offtopic note, I think the automation editor should support all quantization values, it can't do triplets atm.

@zonkmachine
Copy link
Member Author

it can't do triplets atm.

#3358

Note::quantized( _time, quantization() ) :
_time;
Note::quantized( _time,
DefaultTicksPerTact / 64 ) : // finest quantization
Copy link
Member

Choose a reason for hiding this comment

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

Should this be adjusted to DefaultTicksPerTact / 192 per #3358?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, or maybe reverted back to the first commit.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm yes, the first commit does look better, cause we never want to limit the deletion of automation points really, at any quantization.

@zonkmachine
Copy link
Member Author

OK. Reverted back to the first commit.

@zonkmachine
Copy link
Member Author

Tested something. Right now the quantized position only covers the starting point. Let it instead also cover the length of the Automation Point by just wiping clean the time positions it covers.

@zonkmachine
Copy link
Member Author

zonkmachine commented Feb 15, 2017

The point to be deleted is determined on a pixel basis, so you may need to zoom in to get to all time values. With no quantization on AutomationPattern::removeValue() it gets overall slightly harder to delete an Automation Point but it depends on how you use the mouse. With the last fix it gets pretty easy. You just 'turn the quantization up' and write over the old values. Needs more testing.

@zonkmachine zonkmachine changed the title Fix deleting automation points out of quantization Some automation pattern fixes Feb 20, 2017
@zonkmachine
Copy link
Member Author

I bunched the three automation pattern/editor fixes together. Ready for testing

@zonkmachine zonkmachine force-pushed the automationpatterndelete branch 3 times, most recently from cfd6e93 to 70e8c2d Compare February 24, 2017 14:16
@zonkmachine
Copy link
Member Author

@Umcaruje I fixed the algorithm for erase so it's smoother and catches Automation Points around it proportional to the zooming factor, but I don't know how it works on different resolutions. Can you test this and especially erasing Automation Points when right click + moving across them at various zoom levels?

@zonkmachine zonkmachine force-pushed the automationpatterndelete branch 2 times, most recently from a031123 to d5cfc65 Compare February 24, 2017 20:17
@zonkmachine
Copy link
Member Author

Merge?

@@ -139,6 +139,9 @@ AutomationEditor::AutomationEditor() :
}
m_quantizeModel.addItem( "1/192" );

connect(&m_quantizeModel, SIGNAL(dataChanged()), this, SLOT(setQuantization()));
m_quantizeModel.setValue( m_quantizeModel.findText( "1/4" ) );
Copy link
Member

Choose a reason for hiding this comment

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

I've been using the automation editor lately, and find the 1/8 quantization to work best for my needs, tbqh. 1/4 feels too limiting and 1/16 is too much.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK. Changing to 1/8.

@zonkmachine zonkmachine force-pushed the automationpatterndelete branch 2 times, most recently from d7b8a98 to d7d0fdb Compare February 25, 2017 18:17
@zonkmachine
Copy link
Member Author

  • Let an automation point clear the area it covers.

@Umcaruje Did you test this change? It gives the Automation Point the same length as it's quantization. I think it's a really smooth solution. You could make something like a shift key override for this but I don't think it would be used a whole lot.

@Umcaruje
Copy link
Member

Hmm, I'm not sure how much I like the deleting solution, now that I've tested it. It would be nice if it catches the 20-40px around the point, but not the whole length. It just surprises me from a UX perspective. I record automation sometimes and I delete unnecessary points, and while doing that I hold my right mouse key. With the new behaviour this just wipes clean along the Y axis, which feels weird.

Did you test this change? It gives the Automation Point the same length as it's quantization. I think it's a really smooth solution. You could make something like a shift key override for this but I don't think it would be used a whole lot.

Yes, it actually is something I would use rather than my previous method of erasing. I'd implement a shift override, because LMMS doesn't allow to have two automation points at the same position. This makes ramping automation hard to do, so I usually use the lowest quantisation to put the previous point as close to the next one. The new behaviour would make changing those points hard.

@zonkmachine
Copy link
Member Author

Hmm, I'm not sure how much I like the deleting solution, now that I've tested it. It would be nice if it catches the 20-40px around the point, but not the whole length.

Is this about erasing when sweeping with the mouse? For me the automation point is deleted when the mouse is at about 'one automation point diameter' distance. What is your screen resolution?

Yes, it actually is something I would use rather than my previous method of erasing. I'd implement a shift override, because LMMS doesn't allow to have two automation points at the same position.

OK. Will try the shift fix..

@zonkmachine
Copy link
Member Author

It would be nice if it catches the 20-40px around the point,

Right, I think I got you. Some space to counter this #3301 ?
I've tried to deal with it but I pretty much failed there unfortunately. I'll maybe look at it again but not right now. I'm taking the 'automation point length' hack out for now and send it back to the drawing board.

@zonkmachine
Copy link
Member Author

You could make something like a shift key override for this but I don't think it would be used a whole lot.

Yes, it actually is something I would use rather than my previous method of erasing. I'd implement a shift override, because LMMS doesn't allow to have two automation points at the same position. This makes ramping automation hard to do, so I usually use the lowest quantisation to put the previous point as close to the next one. The new behaviour would make changing those points hard.

OK. Shift key was busy so I used the Ctrl key.

@zonkmachine
Copy link
Member Author

I think this works well.
@Umcaruje Can you test this and see if the <Ctrl> button works to override the quantization length function?

@tresf I think this closes #391 though there is more than one issue in that ticket but it looks like the export bug part is a bit dated.

@tresf
Copy link
Member

tresf commented Mar 2, 2017

@zonkmachine I don't have time to build and test this, so if someone else can confirm that automation points smaller than default Quantization can be edited/deleted with this PR, the bug should be closed.

the export bug part is a bit dated.

I had originally assumed they were related, but on second glance it should be reopened as a separate item if still valid after this is closed.

@zonkmachine
Copy link
Member Author

zonkmachine commented Mar 2, 2017

I had originally assumed they were related, but on second glance it should be reopened as a separate item if still valid after this is closed.

I had a second look at this and it is of course the same issue. Multiples of 3 is the positions for 1/64 quantization so if you erase with 1/16 quantization you'll get those values. Just duplicated the bug.

dots

@zonkmachine
Copy link
Member Author

But then again you have the issue of the volume automation and that's not really related...

@zonkmachine
Copy link
Member Author

If there are no further comments I'll merge this later this evening.

@Umcaruje
Copy link
Member

Umcaruje commented Mar 4, 2017

So I did further testing, the Ctrl override works neatly, but I think we should display a Hint so users actually know that it exists.

The deleting behaviour is not something that I really like, cause it will make accidental deletes much more common imo. Example:
gifrecord_2017-03-04_110711

@soweliniko
Copy link

all seems working to me, I agree with @Umcaruje there should be a hint for the ctrl override.

@zonkmachine
Copy link
Member Author

whatsup

Qt cuts off the last words sometimes?

	m_quantizeComboBox->setWhatsThis( tr( "Quantization. Sets the smallest "
				"step size for the Automation Point. By default "
				"this also sets the length of the Automation "
				"Point, clearing out other points in the range. "
				"Press <Ctrl> to override this behaviour." ) );

@zonkmachine
Copy link
Member Author

The deleting behaviour is not something that I really like, cause it will make accidental deletes much more common imo. Example:

Dropping the quantization on delete makes it more or less a necessity. It's painful enough in 1.1.3 .
Should I make the action a bit closer to the point to delete?

@zonkmachine
Copy link
Member Author

zonkmachine commented Mar 4, 2017

@lukeoftheaura @Umcaruje Thanks for testing. I made the erase/delete a bit less aggressive and the whatsthis now reads:

setWhatsThis( tr( "Quantization. Sets the smallest "
				"step size for the Automation Point. By default "
				"this also sets the length, clearing out other "
				"points in the range. Press <Ctrl> to override "
				"this behaviour." ) );

@zonkmachine
Copy link
Member Author

I'm not sure what's wrong in the animation though. It looks pretty good and I see no accidental deletions in it.

ps. I'm still on schedule to merge this later on... 😃

@zonkmachine zonkmachine merged commit f7d09c3 into LMMS:master Mar 4, 2017
@zonkmachine zonkmachine deleted the automationpatterndelete branch March 4, 2017 18:04
PaulBatchelor pushed a commit to PaulBatchelor/lmms that referenced this pull request Mar 5, 2017
* Fix deleting automation points out of quantization

* Triplets in Automation Editor + better remove action

* Let a quantized Automation point wipe clean the space it covers

* Improve sensitivity on erase with zoom < 100%

* Eigth note default quantization

* Tooltip and whatsthis text
MidiTime putValue( const MidiTime & time,
const float value,
const bool quantPos = true,
const bool controlKey = false );
Copy link
Member

Choose a reason for hiding this comment

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

Core objects should not have references to the control key, which is a UI concept.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ouch! I'm looking into this now but I'm not sure how to fix that. The objective is to be able to turn off the feature to give the control point a 'minimum length' according to it's quantization value.

Copy link
Member

Choose a reason for hiding this comment

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

You have two choices:

  1. The clean way: Move the feature to the view object, which reacts to the control key.
  2. The easy way: Keep the feature in the model and rename controlKey to something like ignoreSurroundingPoints.

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. The easy way: Keep the feature in the model and rename controlKey to something like ignoreSurroundingPoints.

Do you mean like:

diff --git a/include/AutomationPattern.h b/include/AutomationPattern.h
index 480b69f..1bb5c03 100644
--- a/include/AutomationPattern.h
+++ b/include/AutomationPattern.h
@@ -79,7 +79,7 @@ public:
        MidiTime putValue( const MidiTime & time,
                                const float value,
                                const bool quantPos = true,
-                               const bool controlKey = false );
+                               const bool ignoreSurroundingPoints = false );
 
        void removeValue( const MidiTime & time );
 
diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp
index ffe13ff..7996af3 100644
--- a/src/core/AutomationPattern.cpp
+++ b/src/core/AutomationPattern.cpp
@@ -208,7 +208,7 @@ void AutomationPattern::updateLength()
 MidiTime AutomationPattern::putValue( const MidiTime & time,
                                        const float value,
                                        const bool quantPos,
-                                       const bool controlKey )
+                                       const bool ignoreSurroundingPoints )
 {
        cleanObjects();
 
@@ -221,7 +221,7 @@ MidiTime AutomationPattern::putValue( const MidiTime & time,
 
        // Remove control points that are covered by the new points
        // quantization value. Control Key to override
-       if( ! controlKey )
+       if( ! ignoreSurroundingPoints )
        {
                for( int i = newTime + 1; i < newTime + quantization(); ++i )
                {

Copy link
Member

Choose a reason for hiding this comment

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

Yes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Fixed here: #3459

PhysSong added a commit that referenced this pull request Nov 19, 2017
Change the default value of ignoreSurroundingPoints in AutomationPattern::putValue to true, which was false in #3352.
Fixes automation filpping bug and some potential issues.
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
* Fix deleting automation points out of quantization

* Triplets in Automation Editor + better remove action

* Let a quantized Automation point wipe clean the space it covers

* Improve sensitivity on erase with zoom < 100%

* Eigth note default quantization

* Tooltip and whatsthis text
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
Change the default value of ignoreSurroundingPoints in AutomationPattern::putValue to true, which was false in LMMS#3352.
Fixes automation filpping bug and some potential issues.
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.

5 participants