Jump to content



Photo
- - - - -

@Toxie VPX multi channel audio


  • Please log in to reply
9 replies to this topic

#1 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,798 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 19 September 2020 - 06:39 AM

So, i discovered that VPX will use all channels in a 5.1 AND 7.1 setup (it wont use 9.1 or more but who the hell could put that in a pin cab anyways)

 

This includes sort of discrete use of the center channel

 

But here is the kicker...

I discovered that, when doing table audio, if you wanted something to accurately pan @ object based on
 

PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)

You needed to provide the sound file in MONO form, otherwise the panning was pretty bad, to non existent, especially if the left and right channels were dissimilar.

OK, actually makes sense, and not really different than how some other game engines handle 3d positional audio.
You give them a 44.1k mono sound and they handle how much goes to what channel, and if there should be any delay between channels
which is easier that trying to figure out what the hell to do with the other channel of audio, or what you lose when you try dumping it etc.

 

But, and here is the kicker.

I found that IF you assign a sound to the backglass
AND you set the sound to play at the rear of the backglass
The sound will try to play discretely out of the center channel only.
 

BUT

 

Only if the sound is STEREO, if the sound is MONO, it will default to hard right pan
and if you nudge the balance even a wee bit to the left it pans hard left.

If the sound is stereo, then setting to backbox, and then sliding position to REAR, the sound will come out mostly from the center, but with unwanted bleed over into the right channel (right rear of cabinet, right front as identified in standard surround terms)
And again, if you nudge said sound a wee bit to the left, it pans hard left.

 

Now i went a bit further.
I encoded some different versions of same sound.
Mono, Stereo, and various forms of multi channel, shifting the mono sound to the various speaker locations, leaving the other channels present but
silent.
I thought well, since it can actually identify and use the center channel, perhaps it is looking for the sound to be designated at a specific channel location, so i tried it left right center l and r rear surround, l and r side surround, and even tried the 4 front and rear ambient positions, even though no one runs 12 channel dolby in a cabinet..

It did not do AC3 or AIFF, said no 3D support

so i tried as multi channel wav, since windows can read and play a multi track wav format file
got  Can not create static sound buffer on import error.

 

So next thing i tried was Ogg

Now when set to backglass, a 7.1 channel Ogg worked
All 7 discrete channels.

Only in backglass mind you.

 

When set to table, the only channels it played was front left and center, and both of those it played blended between the center and front right channels (or center and rear right in cabinet terms)

That part is OK as the table can shift sounds as needed as determined in the table script, and it does not need more than 4 discrete channels because physically a real pinball machine is a lot less discrete audio wise than what we can digitally create here.

 

Ok so back to the backglass, So Ogg works, fully positional via the backglass, the downside is you have to set the volume to about -0.96
or the Ogg files play back terribly over driven and distorted. 

At -0.96 they play back at normal volume, no idea why as they play back perfect outside of VPX, via media player or what not without turning them down.
Seems like VPX does a gain boost on Ogg or something?

This may seem silly to write about, maybe is for most people, but i will give an example of what i am presently going to do with it right now.
I am updating a VP9 table to VPX.
It is an old 70's era table, it has chimes in the backbox.

Now, you do not really want the chimes popping out the same speakers that your rear most bumpers and targets etc are playing out of.
Chimes are object mounted inside the backbox away from the playfield.
So, i am having the chimes play out of the center channel, where nothing else is.

If i was making a cabinet, i could tuck a skinny little row of small speakers discretely above the back glass, and presto, there is my centered audio
for what ever i wish to have on the backglass, in this case some bells.

 

There is a lot more creative things one could do of course, especially on a custom original table.
In a 7.1 set up, it would really let you do some nifty audio stuff, you could actually bring something from the backbox and have it run right up
to the player so to speak.

 

And surround Ogg is easy for anyone to do in audacity, so wav/ac3/aiff formats are not really a big deal, but the artificial gain boost on them kind of is, so maybe that could be looked at?

And this is probably asking alot, not to mention i think you are the wrong guy to ask, but do you think would it be possible to get an option in pinmame to direct where the audio is going?

 

Oh, and the backglass will send out LFE channel too (and man how)
If you trigger a table sound, and a backglass sound that only has the LFE channel, at the same time, you can make yourself believe that your cabinet just blew up.

I was tinkering with that with a bumper sound just to see, and you would have though someone fired a 50 cal MG under my desk.

 




 


[EDIT]
And since i forgot to hit submit earlier, i just wanted to add.
I just finished the bell sounds in 5.1 Ogg, with empty channels except for center channel.

set center speaker on something, behind the monitor that serves as a backglass.
damn it sounds convincing, with them coming from dead center, totally separate from any other sounds


If you feel the need to empty your wallet in my direction, i dont have any way to receive it anyways

If you really want to get rid of money you can donate to this

Athena's Wildlife Sanctuary


#2 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,660 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 25 September 2020 - 11:51 AM

phew.. could you try to contact DJRobX, too? He did the majority of the work to add multichannel support.



#3 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,798 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 25 September 2020 - 05:21 PM

phew.. could you try to contact DJRobX, too? He did the majority of the work to add multichannel support.

Ok, i have sent him a PM, but it did say he had not been here for over a month, so not sure how soon he will see it?


If you feel the need to empty your wallet in my direction, i dont have any way to receive it anyways

If you really want to get rid of money you can donate to this

Athena's Wildlife Sanctuary


#4 DJRobX

DJRobX

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 941 posts
  • Location:Valencia, CA

  • Flag: United States of America

  • Favorite Pinball: F14 Tomcat

Posted 25 September 2020 - 11:43 PM

Good read but is there a question here that needs answering?  :)

You could use a 9.1 system if you really wanted to - VPX is just playing sounds at X/Y/Z positions.    The "7.1" vs "Quad" modes in VPX just control where VPX is putting things in the virtual room. 

 

Microsoft specifies that input samples to surround should be mono.   So converting all samples to mono is a good idea anyway.     VPX can't do this on the fly, Toxie was considering implementing it though because the BASS audio library that he was trying to migrate everything to, requires it for surround output.   The behavior when input samples are stereo is undefined but seems to be downsampled to mono on most setups.   It may differ based on audio driver.

If you want to play a multichannel WAV use PinUp.    I also highly recommend EQAPO if you're trying to do fancy things with LFE channel.  It will let you route the inputs you get from VPX to your heart's content.   You can use something like DOFImpactor to create andd send certain DOF effects to LFE only.  I do this with a bass shaker.

There is a lot of fuss from a few about it bleeding to the backglass, having imperfect positioning and such.    For me what's here is good enough so I won't be trying to improve it any further, but the sources are out there if people want to take it to the next level! 



#5 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,798 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 26 September 2020 - 12:55 AM

Well, the backglass, as far as i can tell, will play 12 channel 7.1.4
(l front / center / r front /l surround / r surround / l side / r side / lf ambient /rf ambient / lr ambient / rr ambient)
If i give it an appropriately encoded file of course.

Of course make a rather interesting use of that, i dont need to make a pinball cabinet, i need to make a pinball closet that you go shut yourself into
that has some speakers external to the table.
Somebody would probably do it too


The table no, but the table itself, to me, needs no more than 4 channels as it is simple creating space between the 4 corners of the table
Which would be a thing sitting right in front of you, so i would probably need to be an oscilloscope toting audiophile to find any advantage in the table itself having more locations

for an object that is that close to you, and the audio is already positionally better than what a real table would give in a real world environment.

 

And of course no real table has a DDS sound system in the backglass or otherwise, but we can do fun things with it that Bally/Stern/Gottlieb etc can not.

 

I kind of get what you are saying about the LFE, Maybe?
It would not be my preferred use of it though.
I would not choose to add the general bass management to it (maybe i do have just a tiny oscilloscope?)
for me, it is not hard to set up a proper LFE track for something, and i would not want an over abundance of content going out that way.

 

 

Question wise?
When sound is assigned to backglass, Slider set to REAR with panning centered, and sound is stereo
Sound plays about 70% center channel and 30% right front channel

If pan is moved 1 fraction to left, the sound just pans hard left.

If sound is mono, Slider set to REAR and pan is centered, sound plays back hard right pan
and if pan is moved a fraction left, sound does a hard left pan.
 

If sound is mono or stereo, and set to backbox, and slider set to front, it simply plays out of the "back box" speakers as it would play out of a stereo

 

If sound is in proper multi track channel allocation for Ogg format, and slider is set REAR and pan centered sound plays exactly where it was told to, on any speaker attached to the entire table.

And just a curious question
Do you know why a sound assigned to backbox in Ogg format gets a super gain boost?
It's totally workable, you just reduce the gain by 96% and its good to go, same volume as if set to table and volume at 0 (centered).
 

 

So i guess question part is, could the odd hard panning thing going on when mono or stereo sound is sent to back box with slider rear be fixed easily?




 


 

There is a lot of fuss from a few about it bleeding to the backglass, having imperfect positioning and such. 

 

That depends on what i give to the backglass.
If i give it the right thing, the positioning is absolutely perfect, and any place in 3d auditory space i want it :) 


If you feel the need to empty your wallet in my direction, i dont have any way to receive it anyways

If you really want to get rid of money you can donate to this

Athena's Wildlife Sanctuary


#6 DJRobX

DJRobX

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 941 posts
  • Location:Valencia, CA

  • Flag: United States of America

  • Favorite Pinball: F14 Tomcat

Posted 26 September 2020 - 09:15 PM

Sounds set to the backglass are played as plain stereo.   As with vpinmame, we expect this to end up on F and R, and land on the BG.    Some sound drivers will send a mono sound to center, messing up both this and vpinmame.   Installing EQAPO can fix that, if it happens. 

OGG is only supported by 10.7 beta, and will use an entirely different sound library.  I'm not very familiar with this code, Toxie would have to answer questions about it. 

Panning/fading values are using logarithmic values so they are super sensitive.     The sliders really should be updated to compensate for that, but I never got around to doing it.   Positioning is largely controlled by table scripts which position them with PlaySoundAt functions that tie the sound to a physical spot on the table.  So 95% of the time the position should be left at 0,0, leaving the table to position them by script.


Edited by DJRobX, 26 September 2020 - 09:18 PM.


#7 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,798 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 26 September 2020 - 10:06 PM

Well, what i have been having a lot of fun with actually, is taking some of my old tables, especially EM ones
And taking sounds that the table technically can not position since the devices do not exist in the table itself but inside the backbox, and re-encoding those
as DDS sounds and positioning them in the backbox, in 3d space, using front left center and front right.

 

bells, score motors and palls etc.
May be a little over kill but it kind of adds to the illusion that there is "stuff" inside the backbox and that it is bolted down in slightly different places.
I like it, but you could simple do them all on the center channel, and it would still put the sounds up inside the backbox, and may be more widely useful as that works
not only for 7.1 but also for someone who had 5.1 and had the front(L/R) speakers sharing table audio duty

And the table can not position those anyways as the vertical backbox space does not exist to it, nor should it really, to me.
I mean no point in having the table calculate the values for something that it's situation is static and does not change due to ball velocities etc.

 

To me it is kind of fun, it adds to the illusion that i have a real mechanical pinball machine sitting there with separate clunking buzzing dinging mechanical pieces in 2 separate
wooden boxes.

 

I also played around with some other stuff
One was someone's original horror themed table
I separated the mechanical sounds from the theatrical sounds.
Let the table control the aspects of where and how the mechanicals played via the normal fashion

The theatricals i reworked in DDS to what kind of felt appropriate for a given sound.
One has a girl screaming and running, so she runs out of the backbox, and down the left side of the table.
Another tells you something unpleasant is going to happen to you in a creepy kind of hissy whispery voice from, in my case, the area of the lockdown bar, as that is where i have my rear(table front) speakers positioned.

 

It perhaps was not the intention you had in mind or set out for when you upgraded the sound in VPX
But you have given it, if a table author wanted to make use of it, the ability to marry a pinball machine to a THX equipped theater, and do some cool stuff that no real pinball machine could feasibly do on a production scale.

I'd say that is a good thing

 


 


If you feel the need to empty your wallet in my direction, i dont have any way to receive it anyways

If you really want to get rid of money you can donate to this

Athena's Wildlife Sanctuary


#8 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,660 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 28 September 2020 - 11:40 AM

as for the new 10.7 MP3/OGG support: still some work left to do to make it match the old behavior..  :/



#9 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,798 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 28 September 2020 - 06:07 PM

as for the new 10.7 MP3/OGG support: still some work left to do to make it match the old behavior..  :/

 

"Old Behavior" ?

 

In which aspects?

 

Aside from the odd gain boost when an Ogg is set to backglass rear, which i can work with, it seemed to be working quite well.

Though i am slightly at a loss, with the new method of not using PlayMusic as to how to let the player adjust the music track volume like they normally do
in VPX audio settings

 


If you feel the need to empty your wallet in my direction, i dont have any way to receive it anyways

If you really want to get rid of money you can donate to this

Athena's Wildlife Sanctuary


#10 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,798 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 06 October 2020 - 09:46 PM

as for the new 10.7 MP3/OGG support: still some work left to do to make it match the old behavior..  :/

 

Here is one old behavior you might look into

 

in 10.7, if a person has no center speaker hooked up
and sets a mono or stereo sound to backglass, it gets piped to the center speaker, and of course they hear nothing at all

 

If sound is a 3 channel Ogg in correct channel assignment (left, right, and center being an empty track) they would hear sound
but not in a standard 1 or 2 channel sound file

If they have a center channel hooked up, all will seem perfectly fine, but seems a lot of peoples cabs have the center and LFE channels disabled entirely
 

In 10.6 the backglass plays as nothing else but 2ch stereo

 

I am probably the minority with having all DDS channels represented, but it makes for some really fun backglass sound effects.

Maybe some kind of over ride they could click to run all backglass as 2ch stereo in 10.6 style?


Edited by wiesshund, 06 October 2020 - 09:49 PM.

If you feel the need to empty your wallet in my direction, i dont have any way to receive it anyways

If you really want to get rid of money you can donate to this

Athena's Wildlife Sanctuary