Menu

#205 Functions Don't Work in Copy Command

1.x
open
nobody
None
2022-03-02
2022-02-26
No

I'm trying to implement upmixing from stereo to 3.1. I thought the command I needed was going to be something like (experimentation needed!):

Copy: L=L R=R LFE=0.5*L+0.5R C=0.25*(abs(L+R)-abs(L-R))*(L+R)

But when I write this then no sound is being output on the centre speaker and strange speaker names appear in the speaker diagram like one named abs(.

What I mean is that when the left and right channels have similar values then the centre channel should be louder and when they have have highly differing values then the centre channel should take a backseat. Perhaps it might make more sense to compute an average value over a period of time rather than using instantaneous values (i.e. construct an envelope follower) or to perform calculations in the frequency domain rather than the time domain, I'm not sure, but I have no idea how to implement either of those inside this tool.

I'm not sure how else to achieve the effect that I'm looking for, since I didn't see any mention of a wave shaping distortion command in the documentation and that's the only other way I can think of generating the absolute value. Am I right too in thinking that the Eval command only works with control data and not audio rate data?

Please pardon my ignorance but I don't really know what this tool is for. I know it's called Equalizer APO but it can clearly do other things besides being an equalizer, like adding reverb. I came to this site from this page: https://www.techpowerup.com/forums/threads/equaliser-apo-stereo-surround-upmixer.276608/ and I was trying to improve on Ferather's upmixing configuration because their command reduces the width of the stereo field.

Copy: L=L R=R C=0.5*L+0.5*R LFE=0.5*L+0.5*R RL=L RR=R SL=L SR=R

I glanced at Ferather's config and I'm familiar with the Web Audio API and a little bit of Pure Data so I thought it was basically the same idea of making your own audio processing graph and this site even mentions Windows Audio Graph, but it seems a bit hit and miss as to what the end user is allowed to create and what they're not. I read some articles that mentioned mid/side processing so that's what inspired my cobbled together formula.

Thanks for listening.

Discussion

  • Elizabeth Hudnott

    I also came across this paper https://www.sfxmachine.com/docs/FrequencyDomainUpmix.pdf which I haven't fully gotten my head around yet.

     
  • Elizabeth Hudnott

    Google Chrome appears to open the audio device in 5.1 mode (which is what I have configured the device as in the Windows sound control panel) but most web sites only output stereo. How can I detect how many channels are actually outputting audio? Because inputChannelCount isn't so useful in this scenario when more channels exist but they're just outputting zeros the whole time.

     

    Last edit: Elizabeth Hudnott 2022-02-26
  • Etienne Dechamps

    Where have you read that the Copy command accepts math functions? It does not. The Copy command is quite basic. It only supports multiplicative factors.

    Perhaps it might make more sense to compute an average value over a period of time rather than using instantaneous values (i.e. construct an envelope follower) or to perform calculations in the frequency domain rather than the time domain, I'm not sure, but I have no idea how to implement either of those inside this tool.

    You might want to try to look for a VST plugin that does what you're after (or write one). Equalizer APO can load VST plugins.

    I didn't see any mention of a wave shaping distortion command in the documentation

    Equalizer APO only natively supports a fairly basic set of filters which are mostly aimed at audio system setup/EQ/calibration. It does not include niche/sophisticated filters like those you're after. Hence the VST support.

     
    • Elizabeth Hudnott

      Well, I saw a large list of complicated functions like sin() and abs() listed under the heading "Expression Commands". But it seems that these only work inside assignment and if statements, and the only variables accessible in those contexts are basic things like inputChannelCount and sampleRate (at least the handful of variables in that table are the only ones that actually vary for different audio streams)? Why would you need a transformation as complicated as sine with such simple variables? That's why I thought the functions might be more generally applicable. And also the node types like filter, IIR filter, delay and convolution seem very reminiscent of the primitives in Web Audio, and the phrase Windows Audio Graph is mentioned, so I thought the program was a similar nodes and connections based programming paradigm with a similar set of primitives because of those hints. The syntax for the Copy command also seemed somewhat vague, since "..." is not proper BNF grammar.

       

Log in to post a comment.