Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
764440a6
Commit
764440a6
authored
12 years ago
by
aacuevas
Browse files
Options
Downloads
Patches
Plain Diff
AudioNode updated to use channel gain
parent
1c2cbea3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/Processors/AudioNode.cpp
+5
-4
5 additions, 4 deletions
Source/Processors/AudioNode.cpp
with
5 additions
and
4 deletions
Source/Processors/AudioNode.cpp
+
5
−
4
View file @
764440a6
...
...
@@ -129,7 +129,7 @@ void AudioNode::setParameter (int parameterIndex, float newValue)
if
(
parameterIndex
==
1
)
{
// volume level
volume
=
newValue
*
0.
0000
1
f
;
volume
=
newValue
*
0.1
f
;
}
else
if
(
parameterIndex
==
100
)
{
...
...
@@ -160,7 +160,7 @@ void AudioNode::process(AudioSampleBuffer &buffer,
MidiBuffer
&
midiMessages
,
int
&
nSamples
)
{
float
gain
;
//std::cout << "Audio node sample count: " << nSamples << std::endl; ///buffer.getNumSamples() << std::endl;
// clear the left and right channels
...
...
@@ -174,13 +174,14 @@ void AudioNode::process(AudioSampleBuffer &buffer,
if
(
channelPointers
[
i
-
2
]
->
isMonitored
)
{
gain
=
volume
/
(
float
(
0x7fff
)
*
channelPointers
[
i
-
2
]
->
bitVolts
);
buffer
.
addFrom
(
0
,
// destination channel
0
,
// destination start sample
buffer
,
// source
i
,
// source channel
0
,
// source start sample
buffer
.
getNumSamples
(),
// number of samples
volume
// gain to apply
gain
// gain to apply
);
buffer
.
addFrom
(
1
,
// destination channel
...
...
@@ -189,7 +190,7 @@ void AudioNode::process(AudioSampleBuffer &buffer,
i
,
// source channel
0
,
// source start sample
buffer
.
getNumSamples
(),
// number of samples
volume
// gain to apply
gain
// gain to apply
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment