-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fix monitoring for objects sharing input audio #258
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
firthm01
force-pushed
the
fix257-monitoring-shared-inputs-main
branch
from
November 3, 2023 15:15
572a892
to
fc1905f
Compare
Force push was rebase on main (128 ch support) |
Var names were incorrect. The outer vector of the vec arg lists output channels, and the inner vector lists input channels. Output channels become rows in the eigen matrix, and input channels become columns. Just incorrect naming of vars - the logic is fine.
also fixes tests
flagOverlaps was used to ensure all overlapping (or previously overlapping) objects had their gains recalculated. This is not necessary anymore as each object has it's gain matrix calculated separately and so is unaffected by routing changes of other objects. They are only summed when the entire matrix is requested in order to perform the audio processing.
firthm01
force-pushed
the
fix257-monitoring-shared-inputs-main
branch
from
December 12, 2023 17:43
fc1905f
to
b38444b
Compare
Force push was rebase on main (CI fix) |
rsjbailey
reviewed
Dec 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a big improvement on flagging the overlaps.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original issue;
The
SceneGainsCalculator
class just kept a single pair of gains tables (vector of vectors, one for diffuse and one for direct feeds) for all items (i.e, AudioObjects).The
SceneGainsCalculator::update
method would iterate through all items in the store and run theaddOrUpdateItem
method to set the gains for the item in the gains tables (direct_
anddiffuse_
members). Likewise theremoveItem
method would zero affected entries in the tables. Due to this "overwrite" behaviour, it meant that input sharing between objects was not possible. The last item to be processed in the store would overwrite gains set by any previous item which is also using those input channels.Solution:
Each item keeps it's own pair of gains tables in the existing
ItemRouting
struct. These tables are only big enough for the item channel count for efficiency, rather than being sized to fit the total input and output channel count. When the backend requests the gain matrices, these are built at the point of request by summing all of the gain tables for all of the items in to an Eigen::MatrixXf which is initialised to zero, using theaddToEigenMat
free func. Note that the input channels when summing in to the matrix are offset by the starting channel number of the item.This isolation of gains tables means we don't need to concern ourselves with what other items might be affected when the routing of one item changes, because their tables are calculated independently. This means we can get rid of the
flagOverlaps
which would previously set all items to "changed" to ensure the entire gains table was rebuilt.Note that the first commit of this PR corrects some terminology (var names) in existing code before work commenced as it led to some confusion when implementing the new system.
Closes #257