Atk FoaDecoderMatrix.newStereo not as expected

I’m new to Ambisonic and tried what @elifieldsteel was explaining in Ambisonic Sound - MUS 499C Fall 2018: Algorithmic Techniques for Mul and encountered that rendering to 2 channels didn’t work as I expected, when using newStereo. Why get both channels the identical signal? Probably, I don’t get the documentation right. What worked for me, was using newPanto(2) instead.

Btw, I think FoaXformDisplay provides a B-Format signal, so I guess 4 channels are enough.

Here’s a code snippet:

FoaXformDisplay.new(8);

~bus = Bus.audio(s, 4);
~bus.index;

(
{
	var sig;
	sig = In.ar(~bus, 4);
	// sig is in B-format
	sig = FoaDecode.ar(sig,	FoaDecoderMatrix.newPanto(2)); //.newStereo(0, 0));
	//sig.poll;
	Out.ar(0,sig);
}.play
)

Actually I’d like to render to a binaural image (head phones). I managed to do it as following, where I had to instantiate the ~decoder first before using later, otherwise I encountered the same problem as reported here ATK Binaural decoder. Supposedly, that’s a timing issue.

What does 1013 mean? I suppose it’s a specific model, but I couldn’t find a documentation on that.

~bus = Bus.audio(s, 4);
~bus.index;
~decoder = FoaDecoderKernel.newListen(1013);

(
{
	var sig;
	sig = In.ar(~bus, 4);
	sig = FoaDecode.ar(sig,	~decoder); 
	Out.ar(0,sig);
}.play
)

Hello @aiode, I’ll reply to this first query…

… by referring you to the documentation for FoaDecoderMatrix.newStereo, and point you to a few relevant settings to try:

// Default: Cardioids at 180 deg
~decoder = FoaDecoderMatrix.newStereo

// Cardioids at 131 deg
~angle = (131/2).degrad
~pattern = 0.5
~decoder = FoaDecoderMatrix.newStereo(~angle, ~pattern)

// Super-cardioids at 115 deg
~angle = (115/2).degrad
~pattern = (3-sqrt(3))/2
~decoder = FoaDecoderMatrix.newStereo(~angle, ~pattern)

// Hyper-cardioids at 105 deg
~angle = (105/2).degrad
~pattern = 0.75
~decoder = FoaDecoderMatrix.newStereo(~angle, ~pattern)

// Blumlein
~angle = (90/2).degrad
~pattern = 1.0
~decoder = FoaDecoderMatrix.newStereo(~angle, ~pattern)

Your example code chooses:

~angle = 0.0
~pattern = 0.0

This will return two omnis (~pattern = 0.0) with a half angle (~angle = 0.0) of 0 degrees. With these settings we would expect to just get the same signal on both the left and the right output, given we’re dealing with two coincident virtual omnis microphones.

Try some of the other settings listed to return a few classic stereo arrays.

Hello @aiode, if you’re having the same issue as ATK Binaural decoder, you’ll want to be sure to update the ATK quark.

You may want to review the installation documentation. All components should be kept up to date.

The binaural decoder needs to be loaded before it is used. This is a kernel decoder, so is a collection of FIR filters that have to be read from disk. Here’s a brief discussion on the difference between matrix & kernel operations.

For FOA there are three binaural decoders. Two are from measurement libraries, the third is a synthetic model. These three decoders are documented as you’d expect via the help page for FoaDecoderKernel. The direct links to each method are here:

  1. FoaDecoderKernel.newSpherical
  2. FoaDecoderKernel.newListen
  3. FoaDecoderKernel.newCIPIC

1013 is the subjectID, in other words, the HRIR choice from a given library. In this case, the IRCAM Listen library. You’ll notice that we’ve provided a direct link to the LISTEN HRTF DATABASE on the help page. You can follow the various links available on the IRCAM page for more info.

Will more libraries be added? We’re intending to add the facility for users to “grow ur own” at some point in the future.

Hope this helps!