Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
997a9abd
Commit
997a9abd
authored
Aug 03, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce range of volume effect (limit to -50 - +50 dB), and use logarithmic scale in timeline.
Related to
#770
parent
68914726
Pipeline
#29549
passed with stage
in 29 minutes and 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
data/effects/volume.xml
data/effects/volume.xml
+1
-1
src/assets/keyframes/model/keyframemodel.cpp
src/assets/keyframes/model/keyframemodel.cpp
+8
-7
No files found.
data/effects/volume.xml
View file @
997a9abd
...
...
@@ -3,7 +3,7 @@
<name>
Volume (keyframable)
</name>
<description>
Adjust audio volume with keyframes
</description>
<author>
Dan Dennedy
</author>
<parameter
type=
"animated"
name=
"level"
default=
"0"
max=
"
60"
min=
"-10
0"
suffix=
"dB"
scale=
"-1"
>
<parameter
type=
"animated"
name=
"level"
default=
"0"
max=
"
50"
min=
"-5
0"
suffix=
"dB"
scale=
"-1"
>
<name>
Gain
</name>
</parameter>
</effect>
src/assets/keyframes/model/keyframemodel.cpp
View file @
997a9abd
...
...
@@ -305,9 +305,9 @@ bool KeyframeModel::updateKeyframe(int pos, double newVal)
int
logRole
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
ScaleRole
).
toInt
();
double
realValue
;
if
(
logRole
==
-
1
)
{
// Logarythmic scale
for lower than norm values
// Logarythmic scale
if
(
newVal
>=
0.5
)
{
realValue
=
norm
+
(
2
*
(
newVal
-
0.5
)
*
(
max
/
factor
-
norm
)
);
realValue
=
norm
+
pow
(
2
*
(
newVal
-
0.5
),
10.0
/
6
)
*
(
max
/
factor
-
norm
);
}
else
{
realValue
=
norm
-
pow
(
2
*
(
0.5
-
newVal
),
10.0
/
6
)
*
(
norm
-
min
/
factor
);
}
...
...
@@ -461,11 +461,12 @@ QVariant KeyframeModel::data(const QModelIndex &index, int role) const
int
logRole
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
ScaleRole
).
toInt
();
double
linear
=
val
*
factor
;
if
(
logRole
==
-
1
)
{
// Logarythmic scale for lower than norm values
// Logarythmic scale
// transform current value to 0..1 scale
if
(
linear
>=
norm
)
{
return
0.5
+
(
linear
-
norm
)
/
(
max
*
factor
-
norm
)
*
0.5
;
double
scaled
=
(
linear
-
norm
)
/
(
max
*
factor
-
norm
);
return
0.5
+
pow
(
scaled
,
0.6
)
*
0.5
;
}
// transform current value to 0..1 scale
double
scaled
=
(
linear
-
norm
)
/
(
min
*
factor
-
norm
);
// Log scale
return
0.5
-
pow
(
scaled
,
0.6
)
*
0.5
;
...
...
@@ -896,9 +897,9 @@ QVariant KeyframeModel::getNormalizedValue(double newVal) const
int
logRole
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
ScaleRole
).
toInt
();
double
realValue
;
if
(
logRole
==
-
1
)
{
// Logarythmic scale
for lower than norm values
// Logarythmic scale
if
(
newVal
>=
0.5
)
{
realValue
=
norm
+
(
2
*
(
newVal
-
0.5
)
*
(
max
/
factor
-
norm
)
);
realValue
=
norm
+
pow
(
2
*
(
newVal
-
0.5
),
10.0
/
6
)
*
(
max
/
factor
-
norm
);
}
else
{
realValue
=
norm
-
pow
(
2
*
(
0.5
-
newVal
),
10.0
/
6
)
*
(
norm
-
min
/
factor
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment