Thanks (as usual
) for the excessive testing!
As for the 3D position stuff: njk to the rescue, please. I have no clue about that (plus no setup to test this).
Stereo Panning: Unfortunately we're stuck in legacy hell here, as this is on a log scale since it was implemented back then. :/
And so we cannot change it, unless we want to break existing tables. :/
If you look at the example table, there is for example a ^10 scaling involved when panning, due to this, to make the setting more sane.
I assume you are talking about
Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
Dim tmp
tmp = tableobj.y * 2 / table1.height-1
If tmp > 0 Then
AudioFade = Csng(tmp ^10)
Else
AudioFade = Csng(-((- tmp) ^10) )
End If
End Function
Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
Dim tmp
tmp = tableobj.x * 2 / table1.width-1
If tmp > 0 Then
AudioPan = Csng(tmp ^10)
Else
AudioPan = Csng(-((- tmp) ^10) )
End If
End Function
?
The thing is, fade has some semblance of functioning
you can at least get something to play at the front of table, middle of table or rear of table
I did not test exactly how fine it will move incrementally
But Pan seems to be a wee bit broken
basically 0 Pan is center and right speaker
Using the example table
' PlaySound soundname, loopcount, volume, AudioPan, randompitch, pitch, useexisting, restart, AudioFade
If keycode = LeftFlipperKey Then
LeftFlipper.TimerEnabled = True 'This line is only for ninuzzu's flipper shadows!
LeftFlipper.RotateToEnd
PlaySound "fx_flipperup",0,1,0.00,0,0,0,1,-1.00
End If
If keycode = RightFlipperKey Then
RightFlipper.TimerEnabled = True 'This line is only for ninuzzu's flipper shadows!
RightFlipper.RotateToEnd
PlaySound "bumper mono",0,1,0.00,0,0,0,1,1.00
End If
The expected outcome is that one flipper plays in the middle of the table, but at the back, and the other plays in the middle, at the bottom
The received outcome is
one flipper plays in the middle at the table front
the other flipper plays out the right and center at the table rear
Now changing this to
PlaySound "bumper mono",0,1,0.00,0,0,0,1,0.00
Results in sound in middle of table, between the front and rear
but panning to the rear left hard, nothing from the rear(rear of table) right side at all
and changing to this
PlaySound "bumper mono",0,1,0.00,0,0,0,1,-0.01
Which is only the smallest amount away from the center
Results in the sound, which is still panned dead center (0.00)
jumping to the right rear of the table, and also fully to the rear of the table, not a peep from the front of the table
In fact this
PlaySound "bumper mono",0,1,0.00,0,0,0,1,-0.001
Also results in a full swing to the rear of the table
So fading wise, basically there are 3 positions with no in between
REAR MIDDLE or FRONT
And as soon as the sound goes full REAR, it pans to the RIGHT REAR
And when it is in the MIDDLE, it pans to the LEFT REAR
and with a panning value of 0 the entire time
(We will call fade FRONT MIDDLE and REAR and pan LEFT CENTER and RIGHT)
Now, lets go to the other end of the table
There is no effective panning when you come to the front of the table
This
' PlaySound soundname, loopcount, volume, AudioPan, randompitch, pitch, useexisting, restart, AudioFade
If keycode = LeftFlipperKey Then
LeftFlipper.TimerEnabled = True 'This line is only for ninuzzu's flipper shadows!
LeftFlipper.RotateToEnd
PlaySound "fx_flipperup",0,1,-1.00,0,0,0,1,1.00
End If
If keycode = RightFlipperKey Then
RightFlipper.TimerEnabled = True 'This line is only for ninuzzu's flipper shadows!
RightFlipper.RotateToEnd
PlaySound "bumper mono",0,1,1.00,0,0,0,1,1.00
'PlaySoundAt "bumper mono", REAR
End If
Should result in one sound coming out hard panned right, the other hard panned left
but it does not, it kind of comes out in the CENTER, with maybe the very smallest of hint of being to one side or the other.
Now to have this test have the widest of meaning, it is done in a 5.1 setup
because this is what the typical desktop setup would have if it is not stereo, as well as a good number of cabs, especially mini cabs
where they have the backglass speakers for backglass and table rear and a pair of exciters for the table front
But the results are the same in 7.1, with some added weirdness
And this was used to certify that the audio setup is configured and functioning properly
5.1 audio test
I do not know what the deal is with the front of table (rear channels) panning, or not really panning i should say
I do suspect what some of the deal is though with the rear of table(front channels) panning strangely on their own when centered
and that is, that vpx is getting hung up on a center channel, which it should be ignoring
In 5.1 the only channels that should be valid for table audio are front left, front right, side left, side right (rear left and rear right in gamer terms)
In 7.1 the only channels that should be valid for table audio are side left, side right, rear left, rear right
NJK can hopefully shed some light on that
I am not sure what to suspect on the apparent lack of pan/fade gradients
set a flipper to playsoundatball
then roll a ball up and down in a track in the dead center of the table (A ramp works nicely)
you will see what i mean

PS, i did try with WAV and OGG to see if there was any difference, but there was not in this respect
Edited by wiesshund, 04 April 2021 - 08:31 PM.