PMD – Poor Man’s DOF (Sound Driven Tactile Feedback)

I have been developing my ‘Poor Man’s DOF‘ system for some time and I’m now, with the kind permission of table authors, making adjusted scripts available via download.

These scripts contain small mods that effect volume and balance of individual table elements.  PMD is very good at creating realistic mechanical sound with directional aspects that reflect the table elements involved.  So, the plunger sound appears to come from the plunger…. the ball bouncing between the slings can be tracked with your ears, not just the eyes… that kind of thing.

The evolution of PMD can be tracked here in the Aussie Arcade Forum

I will be bringing the key elements of that thread over to this blog, but for now, with the PMD script mods becoming available for download, I would like to share the very basics of the volume and balance mods, so that PMD users can fine tune the scripts for their own cabs if need be.

1: The Volume Multiplier

Here you can see the PMD Mod highlighted in Green and compare that with the original code shown below.

Vol(ActiveBall) sets the volume based on the active ball’s speed. Higher ball speed will give a louder sound (in this case a ‘rubber hit’), lower the speed and the ball will become quieter as it hits the rubbers.  This is very effective at creating realism.  Now Vol(ActiveBall) could be replaced with a solid number ie 1, but then the rubber hit would be full volume regardless of how fast the ball hit. This would not be so realistic.

But what if we want to adjust the volume ie make the rubber hits louder, but still have the change with ball speed for realism?  This where we employ the use of the ‘Volume Multiplier‘ as seen above.

Think of the volume multiplier seen here as 1.6 times the volume  (*2  would be two times the volume, *3  three times. etc). Note: I don’t believe the volume multiplier is truly liner in it’s effect. But for the most part this simple guide, while not accurate, is good enough as you adjust and test volume mods.

But what if the rubber bumps are already too loud?  Simple… we use a “Partial Multiplier”.  These are used in exactly the same manner as above, but the number used become a decimal. ie *0.5 or *0.05

 

2: Static Volume and Balance adjustment

When adjusting sound volumes and balance, the easy way is the recognise the sound you wish to adjust is to…. Open Sound Manager in the VP editor. Find the sound by playing them.  Copy the name of that sound. Open the script and search for that name.

Where you see the that sound name preceded by the “PlaySound” command, you can adjust the volume and balance.

If you look at the green highlighted areas in the image above, you will see that I have added a series of numbers that do not exist in the original code.  The order of these numbers in important, as the order determines to what the adjustment is being made.  In this case, we are interested in the 2nd number (Volume) and the 3rd (Balance).

Volume (Second Number): Just as with the Partial multiplier in sample 1, we can adjust the volume either up or down.

A setting of 1 is the volume of the sound untouched (as seen in the sample above).  Adding a decimal (ie 1.5 for excample) will start adding volume, but the use of whole numbers (ie 2 or 3) will give larger jumps in volume.  There is a limit however and this seems to max out at 3. Using numbers beyond that doesn’t seem to add any additional volume.

Balance (Third Number): This is very simple.

A value of 0 means that sound will come from bother Left and Right speakers equally.

A value of 1 and the sound will come from the Right speaker only.  A value of -1 and the sound will come from the Left speaker only.

Now it is rare that we would want the sound to come fully from either the left or the right speakers, as this would actually make the sound appear to come from OFF the playfield.  So a partial balance setting is required. In the case for the Left Flipper sub shown above, I have used – .4 to make the sound appear to come from the flipper itself.

If this was the Right Flipper sub, then we would simply use a positive .4

Applying the this procedure to other table elements… The L/R slings are further out, so values of +/- .6 push the sound further out to match.  The Plunger is way to the right, so a value of .8 is effective.  Note: So even with a table element as far right as the Plunger, we dont use a value of 1, as we still want a little sound from the left to keep things realistic.

The following image is another another example. This time an adjustment to a basic PlaySound sub. (These will often be seen as multiple lines in the script)

“Drain” has been reduced in volume. (.5) – Please Note that no balance adjustment was required, so the 3rd number in the series was not used at all. It could have been added as 0 but this only becomes necessary when a 4th number (pitch) is required. (But this is for another post)

“Popper_ball” has the volume unchanged (1), but the balanced has been pushed to favour the right speaker (.7)

 

3: Ball Rolling Sounds

While we can use a Multiplier or Partial Multiplier directly on the PlaySound sub for the rolling ball sound, adjusting the overall routine is quick, easy and very effective.

Most tables will arrive with the original code using a value of 2000 (as seen in this sample).  Reducing that number will increase volume.

Experiment with the number and see what works for any particular table. Some tables required higher numbers ie 1000, others smaller like this one. Some tables are happy at the original 2000.  The volume adjustment required will depend on the volume of the original sound file used.

Ok well that will get us started for now.  I will add other code samples and sound duplication mods as this blog develops.  Plus I’m more than happy to help with any questions you may have.

Cheers, Rusty

 


UPDATE: (originally posted in the comments, but I feel it will be seen more here)

Here’s a little advance mod for those interested. This is not something that I can put in my Script mods, as it involves some changes to the table file itself.

The Aim:
Increase bumper sound & rear balance by having the sound come from both the PMD sound device and the regular backbox sound device. This is especially useful for those running only front positioned/single amp PMD.

The Method:

*Backup Existing Table First!!!

1: Export your favourite bumper sound from the table using VPX’s Sound Manager.
2: Rename the sound file. (adding a PMD suffix will do nicely, so ‘Bumper_PMD’ for this example)
3: Import the newly created sound using VPX’s Sound Manager and “toggle” it to BG.
4: Save table, close and reopen for new sound import to take effect.
5: Create a new collection “Bumpers” using VPX’s Collections Manager
6: Edit the collection and add the Bumpers to the collection (usually Bumper1, Bumper2, Bumper3 or similar).
7: Ensure that the collection is enabled to fire an event. (look for the checkbox)
8: Add the following line of code to the script where you see other _IDX calls.

Sub Bumpers_Hit (idx)
PlaySound “Bumper_PMD”, 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
End Sub

You should now have a bumper sound coming from your regular speakers as well as the PMD exciters.

* A trick I like to use when working with collections like this (especially for adding rubber bumps), is to make the sub routine call the “knocker” sound for testing. Some sounds are hard to hear along side the PMD or background sounds, but there is no mistaking when the knocker fires. Once you are happy that it’s firing when it should, simply change the sub to call the regular sound.

** Don’t forget that you can add the PMD Mods to the sub routine too if need be. So in this example we will increase volume (*2) and force a fixed right balance (.6)

Sub Bumpers_Hit (idx)
PlaySound “Bumper_PMD”, 0, Vol(ActiveBall)*2, .6, 0, Pitch(ActiveBall), 0, 0
End Sub

*** A fixed volume (2) could also be applied in place of the original variable “ActiveBall” volume associated with the active ball speed…

Sub Bumpers_Hit (idx)
PlaySound “Bumper_PMD”, 0, 2, .6, 0, Pitch(ActiveBall), 0, 0
End Sub

 


 

UPDATE: I mentioned above that a Multiplier or Partial Multiplier could also be used on the Rolling Function.  It doesn’t have as greater effect as the above Function Vol(Ball), but it can be handy for fine adjustment.

Look for this in the Rolling Sounds Routine….

‘ play the rolling sound for each ball
For b = 0 to UBound(BOT)
If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
rolling(b) = True
PlaySound(“fx_ballrolling” & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
Else

and then add a multiplier to increase volume(in this sample I have used *2)…

‘ play the rolling sound for each ball
For b = 0 to UBound(BOT)
If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
rolling(b) = True
PlaySound(“fx_ballrolling” & b), -1, Vol(BOT(b) )*2, Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
Else

or add a partial multiplier to decrease volume (in this sample I have use *.08)…

‘ play the rolling sound for each ball
For b = 0 to UBound(BOT)
If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
rolling(b) = True
PlaySound(“fx_ballrolling” & b), -1, Vol(BOT(b) )*.08, Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
Else

** The thing to remember with multipliers is that they run out of reduction effect at 0.0 (obviously) but seem to max out at 3.

 


 

UPDATE: I just came across an issue in wrd’s Dr Dude, where a single “dummy” sound call (for wire ramp ball drops) was being made from two separate sub routines with timers…

Sub LWireEnd_Hit()  & Sub RWireEnd_Hit()

The timer code didn’t allow for the regular volume/balance adjustments to be included, so they had to be placed on the “dummy” sound call.  

But how do to we create both a left and a right balance (for the left and right ramp ball drops) from just a single call?

I’m glad you asked….

After some bwain crunching moments, I realised I was trying to do things the hard way and that it was as simple as creating an additional “dummy call”.   So I duplicated the dummy sound call and renamed it BallHitSound2. This meant there was now one for each wire ramp’s timer sound routine to reference and each of these could carry it’s own unique volume and balance settings.

The modified code is in Red and original code is in italics for easy view…

‘*****************************************
‘ JimmyFingers VP10 Sound Routines
‘*****************************************

‘***Metal ramp sounds
‘ PMD Mod by RustyCardores: Volume increased & balance added – Additional Sub included for LWireEnd_Hit below
Sub BallHitSound(dummy):PlaySound “fx_balldrop”,0,2,.6:End Sub
‘ Sub BallHitSound(dummy):PlaySound “fx_balldrop”:End Sub
Sub BallHitSound2(dummy):PlaySound “fx_balldrop”,0,2,-.6:End Sub

‘ PMD Mod by RustyCardores: Balance added
Sub MetalSound(dummy):PlaySound “fx_metalrolling”, 0, 1 :End Sub
Sub LWireStart_Hit():PlaySound “fx_metalrolling”, 0, 1, -.7 : StopSound “fx_vuk_exit2”: End Sub
Sub RWireStart_Hit():PlaySound “fx_metalrolling”, 0, 1, .7 :End Sub
Sub RWireStart1_Hit():PlaySound “fx_metalrolling”, 0, 1, .7 :End Sub
Sub Ramp_drop_Hit(): Playsound “fx_metalhit2”,0,1,.5 :End Sub

‘Sub MetalSound(dummy):PlaySound “fx_metalrolling”:End Sub
‘Sub LWireStart_Hit():PlaySound “fx_metalrolling”: StopSound “fx_vuk_exit2”: End Sub
‘Sub RWireStart_Hit():PlaySound “fx_metalrolling”:End Sub
‘Sub RWireStart1_Hit():PlaySound “fx_metalrolling”:End Sub
‘Sub Ramp_drop_Hit(): Playsound “fx_metalhit2” :End Sub

Sub LWireEnd_Hit()
‘ PMD Mod by RustyCardores: Call changed to additional sub added above.
vpmTimer.AddTimer 150, “BallHitSound2
‘ vpmTimer.AddTimer 150, “BallHitSound”
StopSound “fx_metalrolling”
End Sub

Sub RWireEnd_Hit()
vpmTimer.AddTimer 150, “BallHitSound”
StopSound “fx_metalrolling”
End Sub

Sub RWireEnd1_Hit()
vpmTimer.AddTimer 150, “MetalSound”
StopSound “fx_vuk_exit2”
End Sub

Sub LRampEnd_Hit()
vpmTimer.AddTimer 150, “BallHitSound”
End Sub


 

UPDATE:  I’m seeking to discover all of the PlaySound codes to maximise the potential of PMD.

I found this in the CommandReference.txt file in the VP folder.

PlaySound(string, int loopcount, float volume, float pan, float randompitch, int pitch, bool usesame, bool restart)

Now obviously I understand the ones that I have been using to date, but if anyone can help fill in the following ?? it would be greatly appreciated…..

string: “soundname”

int loopcound: 0 = No loop, -1 = Continuous loop. I guess then that 2-9 etc would be a defined number of loops??

float volume:  OK I use this a bit and have found that I use volumes as low as .05 and as high as 3 (it seems to max at 3)

float pan: Again I use this a bit.  0 = even balanced sound, -1 is full left, 1 is full right and +/- decimals can be used for partial balance.

float random pitch: 0 = constant pitch and 1 = random?? 

int pitch: I assume a starting pitch. But what numbers? 0-1 with decimals effective?? What about negatives??

boolusename: I have NFI??

bool restart: I have NFI??

 

This from Arsey at Aussie Arcade Forums…. (I think the pitch setting may be of use for PMD at times, as some sounds can be too “tinny” through exciters)

randompitch
Applies a random variance to the pitch of the sound

– range is from 0.0 (no randomisation) to 1.0 (vary between half speed and double speed)

Seems the change log is undecided whether this parameter changes pitch or speed! Possibly it changes both, I dont know

pitch
Applies a fixed variance to the pitch of the sound

– use a negative number to lower the pitch
– use a positive number to raise the pitch

Suspect this parameter is measured in Hz – with the specified number being added to or subtracted from the frequency profile of the sound – so lower integers may not make a significant difference to the pitch

usesame
Indicates whether the settings provided in the call to PlaySound should be applied to sounds already playing from a previous call

– set to 1 (true) to apply the new settings to sounds already playing
– set to 0 (false) to allow existing sounds to play to finish with their original settings

restart
Indicates whether the sounds already playing should be restarted with the new settings

– only valid when usesame is set to 1
– set to 1 (true) to restart existing sounds with the new settings
– set to 0 (false) to immediately apply the new settings to current sounds and use them until the sound finishes

 

UPDATE: Setting Overall Volumes.

**** PLEASE NOTE: The volume sliders that I refer to here are in the TABLE’S OPTIONS and not the VPX Preferences available from the top menu bar. 

 

In my PMD scripts I suggest that a table’s mechanical sounds Volume Level should be set to 50 (as a starting point) in the tables’ options.

The reason for this, is that we have full volume adjustment in the PMD amps and the reduction (as a baseline starting point for all tables) is easily adjusted for.  But we want to leave our PMD amps set and NOT be adjusting them to compensate for louder or more quiet tables as we play.

So by using 50 as the starting point in the tables themselves, we have room to either increase or decrease the mechanical volume on a table by table basis.  If we left the tables at 100 as the default, then we would only be able make our tables quieter (unless you have one of Spinal Tap’s amps of course. lol) but 50 allows us to go both ways.

OK, so what about the “Music” volume slider?

Well, the music volume is generally considered a totally separate entity from PMD, but I see no reason why we cant apply the same logic as the above.

Reducing all of our tables music volume to 50 (and simply running our audio amps a little louder to compensate), would allow us the luxury of increasing the volume of those individual tables that are quieter than the rest.

So I will leave it up to you if that is what you want to do, but…..

For some reason the Music volume slider does not work for everyone.  A number of people have reported to me that it makes no difference. So here are a couple of things you can try….

  • Once you adjust the music volume slider in the table editor, Save the table, Close VPX, Re-open and Test.

Did that work? If yes, AWESOME!  If not, then try this…

  • Hit F12 and enter a negative number (0 to -32) where asked.
  • Save the setting
  • Hit F3 to reset the table.

You should now have reduced music volume on the table, without having effected the mechanicals.

** Now there are of course the regular “coin door” and “7/8/9” methods to adjust ROM volume.  Feel free to use this too if that is what you would prefer. 


 

Comments

  1. randr

    This is great! lots of information here. Hope its ok i also added to category “tutorials”

    Users who have LIKED this comment:

    • avatar
    1. RustyCardores Post author

      I mentioned that they could also use a multiplier for the rolling ball.

      EDIT: I have now added this reply to the OP, as the code gets stripped here in my comment.

  2. RustyCardores Post author

    EDIT: I have now moved this tip to within the original post, as I feel it may become lost in the comments here.
    ________________________________________

    Here’s a little advance mod for those interested. This is not something that I can put in my Script mods, as it involves some changes to the table file itself.

    The Aim:
    Increase bumper sound & rear balance by having the sound come from both the PMD sound device and the regular backbox sound device. This is especially useful for those running only front positioned/single amp PMD.

    The Method:

    *Backup Existing Table First!!!

    1: Export your favourite bumper sound from the table using VPX’s Sound Manager.
    2: Rename the sound file. (adding a PMD suffix will do nicely, so ‘Bumper_PMD’ for this example)
    3: Import the newly created sound using VPX’s Sound Manager and “toggle” it to BG.
    4: Save table, close and reopen for new sound import to take effect.
    5: Create a new collection “Bumpers” using VPX’s Collections Manager
    6: Edit the collection and add the Bumpers to the collection (usually Bumper1, Bumper2, Bumper3 or similar).
    7: Ensure that the collection is enabled to fire an event. (look for the checkbox)
    8: Add the following line of code to the script where you see other _IDX calls.

    Sub Bumpers_Hit (idx)
    PlaySound “Bumper_PMD”, 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
    End Sub

    You should now have a bumper sound coming from your regular speakers as well as the PMD exciters.

    * A trick I like to use when working with collections like this (especially for adding rubber bumps), is to make the sub routine call the “knocker” sound for testing. Some sounds are hard to hear along side the PMD or background sounds, but there is no mistaking when the knocker fires. Once you are happy that it’s firing when it should, simply change the sub to call the regular sound.

    ** Don’t forget that you can add the PMD Mods to the sub routine too if need be. So in this example we will increase volume (*2) and force a fixed right balance (.6)

    Sub Bumpers_Hit (idx)
    PlaySound “Bumper_PMD”, 0, Vol(ActiveBall)*2, .6, 0, Pitch(ActiveBall), 0, 0
    End Sub

    *** A fixed volume (2) could also be applied in place of the original variable “ActiveBall” volume associated with the active ball speed…

    Sub Bumpers_Hit (idx)
    PlaySound “Bumper_PMD”, 0, 2, .6, 0, Pitch(ActiveBall), 0, 0
    End Sub

  3. randr

    You know what!
    If someone would do a Table scripting tutorial explaining some of the basic things for building a table i could see it being a very popular Blog/tutorial! These are so easy on the eyes to read and the comments are great to ask questions.