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

What pan values would be good for presets? #34

Closed
tin2tin opened this issue Jul 13, 2021 · 8 comments
Closed

What pan values would be good for presets? #34

tin2tin opened this issue Jul 13, 2021 · 8 comments
Labels

Comments

@tin2tin
Copy link

tin2tin commented Jul 13, 2021

In the Blender VSE, the setPanning value is exposed, but most users can't figure what the values mean, so I'm working on a patch to add options to preset values for the various channel options in Blender, however I do not have the hardware to test what values will result in what directions. Is there anything in the manual on that topic? (I couldn't find anything).

These the files and my sketchy values are listed in the readme: https://github.com/tin2tin/surround_preset_ui
And a diff: https://gist.github.com/tin2tin/e68b50298918b5dca9f034222ee8a80c

How can I ensure the pan preset values will be correct without having the equipment to check it?

The relation of the channel setting and the preset options:
surround_preset2

@neXyon
Copy link
Owner

neXyon commented Jul 13, 2021

You can find the angles that are used depending on the channel configuration here: https://github.com/neXyon/audaspace/blob/master/src/respec/ChannelMapperReader.cpp#L308

The panning value is basically a scaled angle by a factor of 1/90, so to the left (stereo) is -1, i.e. -90 degrees and -2 and 2 is to the back.

Even if you don't have the hardware, you can render the audio in blender with the channel configuration of your choice and then open the resulting audio file in audacity to check if it's correct.

@tin2tin
Copy link
Author

tin2tin commented Jul 13, 2021

Thank you for your quick and very helpful reply. Can I ask you one more question? Are there any preset positions you think users would like as presets outside the speaker positions?

These are the current:

        if audio_channels == 'STEREO':
            if self.stereo == 'LEFT': sequence.pan = -1.0
            if self.stereo == 'CENTER': sequence.pan = 0.0
            if self.stereo == 'RIGHT': sequence.pan = 1.0

        if audio_channels == 'SURROUND4':
            if self.surround4 == 'FRONTLEFT': sequence.pan = -0.5
            if self.surround4 == 'FRONTCENTER': sequence.pan = 0
            if self.surround4 == 'FRONTRIGHT': sequence.pan = 0.5
						
            if self.surround4 == 'SIDELEFT': sequence.pan = -1.5
            if self.surround4 == 'SIDERIGHT': sequence.pan = 1.5

        if audio_channels == 'SURROUND51':
            if self.surround51 == 'FRONTLEFT': sequence.pan = -0.33335
            if self.surround51 == 'FRONTCENTER': sequence.pan = 0
            if self.surround51 == 'FRONTRIGHT': sequence.pan = 0.33335

            if self.surround51 == 'SIDELEFT': sequence.pan = -1.2225
            if self.surround51 == 'SIDERIGHT': sequence.pan = 1.2225

        if audio_channels == 'SURROUND71':
            if self.surround71 == 'FRONTLEFT': sequence.pan = -0.33335
            if self.surround71 == 'FRONTCENTER': sequence.pan = 0
            if self.surround71 == 'FRONTRIGHT': sequence.pan = 0.33335
			
            if self.surround71 == 'SIDELEFT': sequence.pan = -1.2225
            if self.surround71 == 'SIDERIGHT': sequence.pan = 1.2225
			
            if self.surround71 == 'REARLEFT': sequence.pan = -1.66667
            if self.surround71 == 'REARRIGHT': sequence.pan = 1.66667

@tin2tin
Copy link
Author

tin2tin commented Jul 14, 2021

I have a file here which places audio in all of the 7.1 speakers, but when I export to ac3, I only get a stereo file(5.1 seems to be working):
https://pasteall.org/media/1/7/17d03387d11a8e4f8c96bbfb860242eb.blend

Is there something else I need to do, or is it a bug?

@neXyon
Copy link
Owner

neXyon commented Jul 14, 2021

No idea, you better ask the users, if they want more presets ;)

You have to set the output channel layout. Since this was moved from Scene/Audio it's a bit cumbersome now, when you do it for Audio Rendering: in scene output, you have to choose FFmpeg Video, select some audio codec (can be different from your audio rendering codec, doesn't matter) and then choose the channel layout.

image

Also: the ac3 encoder of ffmpeg only supports up to 6 channels, so 5.1 is fine, 7.1 doesn't work, so you need to choose a different codec to test 7.1, e.g. flac or wav.

@tin2tin
Copy link
Author

tin2tin commented Jul 15, 2021

Thank you. That cleared up the export. Btw. Render Audio... doesn't seem to include channel set up eg. surround? Only Render Sequence Animation seems to export correct files.

On the values, it it correct that you can't pan over the center of the room in 7.1?
But you can do panning from left rear to right rear in 7.1 going from -1.66 to -2, then jump to 2 and then continue to 1.66?
And in 5.1 you can do the same over -2 and then jump to 2?
(I'm thinking that maybe -2 and 2 should be presets too?)

Current patch: https://developer.blender.org/D11933

@tin2tin
Copy link
Author

tin2tin commented Jul 16, 2021

Is it correct that LFE/Sub is not supported/doesn't have a pan position?
It does seem to be included in the export:
image

@tin2tin
Copy link
Author

tin2tin commented Jul 16, 2021

You can find the angles that are used depending on the channel configuration here: https://github.com/neXyon/audaspace/blob/master/src/respec/ChannelMapperReader.cpp#L308

Is the channel mapping file actually being used when importing audio files with surround channels into Blender?
(The VSE doesn't seem to support multi-channels?)

@neXyon
Copy link
Owner

neXyon commented Jul 17, 2021

Thank you. That cleared up the export. Btw. Render Audio... doesn't seem to include channel set up eg. surround? Only Render Sequence Animation seems to export correct files.

Render Audio works fine for me. As I said, you have to configure the channels in the scene export settings.

On the values, it it correct that you can't pan over the center of the room in 7.1?

As I explained in the blender patch review, you would do this with a combination of animating pan and volume.

But you can do panning from left rear to right rear in 7.1 going from -1.66 to -2, then jump to 2 and then continue to 1.66?
And in 5.1 you can do the same over -2 and then jump to 2?
(I'm thinking that maybe -2 and 2 should be presets too?)

You probably should not jump, because this will cause artifacts, just go from -1.66 to -2.34.

Is it correct that LFE/Sub is not supported/doesn't have a pan position?
It does seem to be included in the export:

LFE (Low Frequency Effects) for the Subwoofer are considered positionless since the low frequencies can usually not be localized by humans and thus don't have a pan value. LFE is only there if it's there in one of the (multi-channel) input files.

Is the channel mapping file actually being used when importing audio files with surround channels into Blender?
(The VSE doesn't seem to support multi-channels?)

Yes, works fine for me, I just exported your 7.1 file, then imported it in a new blender scene and exported it as 5.1:

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants