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

Hints for: convert vse strip to sound object #3

Open
tin2tin opened this issue Jul 12, 2021 · 11 comments
Open

Hints for: convert vse strip to sound object #3

tin2tin opened this issue Jul 12, 2021 · 11 comments

Comments

@tin2tin
Copy link

tin2tin commented Jul 12, 2021

Very cool project.

If you want here are some snippets:
Convert audio strips in the vse to sound objects: https://gist.github.com/tin2tin/9b24dff1ab4294e9562724614e450599
Process selected strips: https://blender.stackexchange.com/a/154436/37272

Add-on for installing python modules: https://github.com/amb/blender_pip

@tin2tin tin2tin changed the title Hints for: convert vse strip to sound object? Hints for: convert vse strip to sound object Jul 12, 2021
@iluvcapra
Copy link
Owner

These are good snippets. Maybe you know, how can you add strips to a sound object's NLE track with bpy? I can't seem to figure it out.

@tin2tin
Copy link
Author

tin2tin commented Jul 13, 2021

If you mean for the NLA, I never used it, so I don't know. Aren't Speakers added automatically?

If you mean for the VSE, then Scene strips might be a solution(but I remember some bug-reports on sound). The annoying thing about Scene strips is that you can't reference the scene you're in currently, so you'll have to reference the scene from another scene. Downside is that you can't adjust the volume or anything else sound related in the VSE: https://developer.blender.org/D10029

The surround sound of the VSE is pretty poorly implemented: https://developer.blender.org/T47140

@tin2tin
Copy link
Author

tin2tin commented Jul 13, 2021

Looking at the VSE pan settings, https://developer.blender.org/T69684#784634 I wish we had implemented the preset buttons back then. I have no idea what these values mean now, why there are 3 columns, and why the same numbers are repeated, and I have no surround setup(are there any free emulators out there?).

The coding of the preset buttons should be very quick to do - the review process, properly much longer, but at least the devs will know there is a problem there.

If you have time, could you take a look and see how they're making sense? Maybe the columns are connected to different number of channels?
image

@tin2tin
Copy link
Author

tin2tin commented Jul 13, 2021

Could you check if these values are correct in the vse?

Mono
No pan

Stereo
Left = -1
Center = 0
Right = 1

4 Channels
Left = -1
Center = 0
Right = 1

Rear Left = -2 ?
Rear Right = 2 ?

5.1 Channels https://www.youtube.com/watch?v=RHbtFnjFcp0
Left = -1
Center = 0
Right = 1

Side Left = -1.250
Side Right = 1.250

Rear Left = -2 Center?
Rear Right = 2 Center?

7.1 Channels https://developer.blender.org/T69684#784634
Left = -0.33335
Center = 0
Right = 0.33335

Side Left = -1.66667
Side Right = 1.66667

Rear Left = -1.222
Rear Right = 1.222

@tin2tin
Copy link
Author

tin2tin commented Jul 13, 2021

I ended up spending the day trying to set up the Surround presets for the VSE in the UI, however I still need the right values for the positions: https://github.com/tin2tin/surround_preset_ui

surround_preset2

@iluvcapra
Copy link
Owner

So I've never used the VSE in Blender, if I need to do video I usually just use Resolve but it's interesting.

I'm not sure how the sound settings work in the VSE, what I started doing in this project is creating arrays of sound sources (or static particle systems), converting them to speakers, and then rendering them out as 5.1s or 7.1s, which seemed to work okay. I then added the ADM object rendering features which just renders groups of non-overlapping speakers to mono, and then takes the speaker motion animation and converts it to ADM sound object panning.

What are these for? Are they coefficients for something?

#3 (comment)

@iluvcapra
Copy link
Owner

What I'd been trying to do is making it so a single speaker can play multiple sounds one after the other with the NLA track but I can't figure out how to script this, the py API in this area doesn't seem to follow the underlying data model here.

@iluvcapra
Copy link
Owner

Looking at your mono panning cheat sheet...

So the "pan" parameter in the VSE is like an azimuth? And it seems to be normalized so 2.0 is directly behind you?

It looks like column 1 on the cheat sheet is the settings if you are panning in 7.1 render, column 2 is if you are panning into a stereo render, and column 3 is if you are panning into a 5.1 render, you use these values in order to obtain a downmix without attenuation, because I guess the way Blender renders surround sound in OpenAL there might be dead zones or dips between the speakers, because it's 3D rendered and they don't use an equal-power pan law? Just speculating.

@tin2tin
Copy link
Author

tin2tin commented Jul 13, 2021

I watched your video looks like magic to me! :-)

I don't know much about sound or surround at all, I just annoys me that the UI is so incomprehensible, but I have no hardware to check the values on.

In the VSE, you import(Add Menu > Sound) an audio file, select in and in the sidebar, check Mono(only mono) can be panned, and then compare the values I found here with where you hear the sound coming from in the various pan values in teh sidebar and channel options found in the Preferences: #3 (comment)

Then I can add those values to the patch and submit it, and hopefully it'll help some users out there, if the bf devs commits it.

@tin2tin
Copy link
Author

tin2tin commented Jul 13, 2021

I got a reply from the coder of the lib Blender uses for audio, so everything should be okay now: neXyon/audaspace#34 (comment)

@iluvcapra
Copy link
Owner

I read that, sounds like I suspected. It looks like they use the ITU BS.2094 angles mostly for the surround formats.

https://www.itu.int/dms_pubrec/itu-r/rec/bs/R-REC-BS.2094-1-201706-I!!PDF-E.pdf

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