Jump to content



Tutorial info Visit support topic

  • Added on: Dec 22 2013 10:50 AM
  • Date Updated: Jan 18 2014 09:58 PM
  • Views: 9781
 


* * * * *
1 Ratings

Adding Ball rolling sound to VPin tables

based on rascal's sound and ball movement demo I created a sound routine with improved features that can easily be implemented into existing tables.

Posted by mfuegemann on Dec 22 2013 10:50 AM
Hi,
 
The ball sound routine You find here is based on rascals original idea. I improved the math side and added some new thoughts. The ball assignment
 is now done by a trigger, so You can easily apply this to any table even if You do not want to temper with the ball creation routines.
 
 You receive the following sound functionality:
 - correct ball velocity will be used (speed vector)
 - ball sound panning according to the ball position on the playfield
 - different sound if ball is on a ramp
 - wire ramp sound
 - drop sound when ball hits the playfield
 - no sound if the ball is in the air
 
 You just need to place the following triggers on an existing table
 - Ball-assignment        --> everywhere a ball can be created (plunger lane, VUKs, holes)
 - Sound deactivation   --> everywhere a ball is destroyed (drain, holes, VUKs) - this can be implemented to the existing procedures as well
 - Ramp enter               --> at the start of every ramp
 - Ramp end                 --> at the end of every ramp the ball will drop off
 - Wire ramp start         --> at the start of every wire ramp
 - Wire ramp end          --> at the point where a wire ramp feeds to a normal ramp. If the ball drops to the playfield, add "Ramp end" 
 
If You enable sound panning (set SoundPanning=1), the ball sound will be played according to the ball position on the playfield. For this set the constant TableWidth to the "Table Width" property of the table.
PanningFactor allows You to tune the degree of ball sound panning. If set to 1 only one speaker is playing if the ball is at the respective edge of the table, a factor of 0 will do no panning at all.
 
The only drawback at the moment is multiball recognition, as only one ball is monitored. So it is possible that the active soundball drains first, muting the rolling sound until the next ball passes an assignment trigger.
The sound files used in this table have been taken from the design resource section of vpforums.org and the "roll1.wav" from rascals demo table.
 
Regards
Michael

Downloadable Tutorial link (Version 1.1):
http://www.vpforums....s&showfile=8805
 
I added a StopAllSounds to Drain_Hit and every trigger destroying a ball to avoid looping ball sounds after the sound trigger was deactivated.
Thanks to Ringorian who found this bug!