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

Lots of audio nodes produced where none need be #6

Open
robertbryer opened this issue Sep 28, 2018 · 2 comments
Open

Lots of audio nodes produced where none need be #6

robertbryer opened this issue Sep 28, 2018 · 2 comments

Comments

@robertbryer
Copy link

All audio-participating nodes, that is, all those in the ancestry of leaf nodes, are producing audio nodes for the graph. Nodes in the XML with no audio attributes do no change the audio, but are still producing gain nodes with a gain of 1 and pan nodes with a pan of 0. We should remove these superfluous audio nodes.

@nigelmegitt
Copy link
Collaborator

I'm pretty sure I've made a big dent in the overall scale of this in bbc/Adhere#84:

  • the end times were being calculated wrongly, which is now fixed by updates to TimingCalculator and by correctly calculating the end time only when an element's descendants have been created. The effect of this bug was that some cues were active for way too long.
  • Parser.markSpeech() had a logic error: previously when iterating through an element's children, as soon as any of them reported that they have speech, all the subsequent ones were marked as having speech too, even if they didn't. This has now been fixed. The impact was that too many nodes were created.

There's one further optimisation that we could make, which is, only create a pan node if pan is being modified, and only create a gain node if gain is being modified. Need to make sure we don't make it impossible to implement bbc/Adhere#78 in doing this though. I'm not really sure if it's worthwhile.

@robertbryer do you think the issue you originally raised has now been fixed, or are you still seeing significantly too many nodes?

@robertbryer
Copy link
Author

There's one further optimisation that we could make, which is, only create a pan node if pan is being modified, and only create a gain node if gain is being modified. Need to make sure we don't make it impossible to implement bbc/Adhere#78 in doing this though. I'm not really sure if it's worthwhile.

I think that was the original point I was getting at with issue—it's why the nodes refer to this.input/this.output because the original intention was to allow them to just passthrough as an option (i.e., when you ask for a non-audio-modifying node's output, it could just return its parent's output instead). If you wrapped every <span> in their own <p> and then a <div> there would be a lot of unneccessary gain/pans. I haven't seen any performance problems or otherwise, so maybe it's not a problem to get exercised about right now.

@nigelmegitt nigelmegitt transferred this issue from another repository Mar 1, 2021
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

No branches or pull requests

2 participants