-
-
Notifications
You must be signed in to change notification settings - Fork 975
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
New vector graph implementation #7158
base: master
Are you sure you want to change the base?
Conversation
Added new class and moved the input dialog and the context menu there. |
Added new |
Most of the heap allocations were removed. This is after removing 9 heap allocations. Added new button in WaveShaper for simplifying the graph. This can improve performance. |
This pull request adds a new widget to LMMS called VectorGraph.
This widget has been implemented in the WaveShaper effect.
A new effect called "FFTFilter" was planned but removed from the final pull request.
I consider this pull request finished.
There was one vector graph implementation before this in pr #4367.
This new widget does not have a fixed size (unlike
Graph.h
) and uses points for the base graph instead of samples. This allows better workflow and smoother output. The lines (and samples) between points are automatically generated inpaintEvent
. The graph supports outputs with custom sample count. The graph supports different types of lines such as "sine", "peak", "steps", "random". The graph also supports automatable point attributes and interaction between two graphs inside the same widget (called "effector graphs").The changes are compatible with older versions.
How to use:
Press somewhere in the widget with left click to add a new point.
Delete points by pressing right click and dragging over them.
Click a point with left click to select it. This will show an editing menu. Whit the menu almost all of the point attributes are editable.
VectorGraphDataArray
can block access to some attribute settings if setup correctly.In editing mode double click with the left mouse button on a float attribute to show an input dialog.
In editing mode drag the widget to an automationTrack with ctrl + left mouse to connect it. Automated points will show up with a different color.
The user can remove the automation by clicking on an attribute with the right mouse button. This will show a context menu with the full name of the attribute at the top.
By clicking the top left square, the user can change the currently edited
VectorGraphDataArray
. The number in the top left corner shows the currently editedVectorGraphDataArray
's location inVectorGraphModel
m_dataArrays.By double left clicking on a point, an input dialog shows up which can edit the x and y position of the point.
The point's line type can be selected by pressing the "switch graph line type" setting in editing mode. The "1. attribute value" and the "2. attribute value" setting is used different ways in different line types.
The point's automated and effected float attribute can be selected by pressing the "switch graph automated value" and "switch graph effected value" setting in editing mode. Only one attribute can be effected or automated from the 4 automatable attributes (y coordinate, curve, valueA ("1. attribute value"), valueB ("2. attribute value")).
How one graph effects the other can be changed in editing mode with the effect settings. In WaveShaper these settings allow the green graph to be effected with the white graph. These settings allow more easy automation and different interactions between the 2 graph such as "add" and "clamp". Use these effects by selecting a point on the green graph (in this case) and clicking on different effects to enable them. An example which these effects can be useful is when a
VectorGraphDataArray
is used for displaying a sound frequency spectrum, and an otherVectorGraphDataArray
can interact with these constantly changing graph points.Different implementations can give different restrictions to different
VectorGraphDataArray
s.these images are currently outdated
TODO list:
rewrite comments
rename functions and values
test all the features / settings
do TODO-s
automation:
-- add automation support:
-- save
FloatModels
-- safe deletion (currently not safe??) needs testing
event when a dataArray's size gets to 0
scaled graph option in
VectorGraphView
which scales the last used output to be displayed in the widget (does not callgetValues
(renamed togetSamples
)). need testingcall
dataChanged()
insetDataArray
journalling in
PointGraphModel
setDataArray
keep attributes option,formatArray
option which runsformatArray
context menu in gui (clear automation, connect to controller)
display hints (full text) while editing
ability to edit multiple graphs using
m_isLastSelectedArray
handle effector arrays when deleting
VectorGraphDataArray
update
formatArray
licensing email
new button in gui which switches between the currently selected graphs
add new effects: clamp
dragging
redo clamps
filter implementation
remove qDebug
Final WaveShaper VectorGraph implementation:
Different
VectorGraphDataArrays
effecting each other, one is automated:Keep in mind that this widget can have harmful bugs/errors.
Feel free to make suggestions and criticize my coding style / decisions.