Code/Example Fleep Mechanical Sounds code to use with FP

Coding and examples for future Pinball and BAM

AnonTet

Pinball Master
Site Supporters
Joined
Jun 21, 2020
Messages
2,036
Solutions
1
Reaction score
1,194
Points
125
Favorite Pinball Machine
Indiana Jones
By now everyone should know about the awesome Fleep mechanical sounds used in some tables.

I've ported the code to get them into Future Pinball within the limits of my ability. Although stuff like sound paning is not working I believe it is already a nice improvement over the default static FP currently provides.

I also provide the sounds themselves. They're in the original .wav format and the ones in .ogg are as such because for some reason, music doesn't seem to be imported as .wav in FP (If you know FP does accept .wav as music, let me know so I can look on my side). In any case the .wav originals are also in there for you to use as you see fit.

Some sounds have multiple instances, like bumpers or ball on flippers hit so there will be some sound variations. On top of that, some sounds will also sound louder the harder the ball hit the object.

I'll leave it to you to fine tune to your table.

Instructions:

- Import the sounds into your table (no need to import all, just the ones you need)
- call the .vbs as external script or simply c&p paste it to your table script (probably the better option)
- replace your PlaySound lines with calls to provided Sub's in the script
- adjust sounds *factor variables to get louder / lower volumes. They're not fine tuned. They do work on my test table though




Note on ball hit flipper sounds (this one requires a little more work):
In the Sub OnPrehitFlipperSettings() add the bold lines as indicated below. Beware the 1st one might be already there or some other situation inside that Sub. I can help if you're in doubt.

Before the "End Sub" add this line:
If not FlipperExt.IsSolenoidOn and FlipperExt.Hit Then SoundBallOnFlipperHit()
End Sub

This has the problem of not hearing the rubber sound when the flipper is up. The solution is this (with caveats too):
If ((not FlipperExt.IsSolenoidOn and FlipperExt.Hit) or (FlipperExt.AngleDiff >= SwingAngle)) Then SoundBallOnFlipperHit()

This works if your table is using at least DFv2 (pre-FizX) otherwise you'll have to define "SwingAngle" variable and set it to the same angle you set for your flippers in FP GUI.






Disclaimer:
There's still a lot that can be done (I would like to try to integrate this with smoke's rolling ball sounds next for added pan effect) and there are certainly things I can still add quickly like some other routines in Fleep's original code for VPX.
It is not my intention to change the Sub names however so when I update this to something new should be as easy as replacing the script or just add the new code for newer stuff. But I'll let you all know if otherwise.
 

Attachments

  • FleepSoundsSupportCodeforFP.txt
    9.6 KB · Views: 60
  • FleepSounds.zip
    23.5 MB · Views: 94
Last edited:
New code for the sounds.
code for Metals and the apron
changed gate sound a bit
some cleanup. No new sounds.

I've edited my post above regarding ball on flipper hit sounds.

No need to reimport sounds or edit existing code.
 
1st post updated with the new code.

New Wall hit sounds
Changed gate sound code. This needs a tiny change on existing tables as it now accepts parameters to differentiate from "heavy" gates from "light" gates. Call it like. Not a big deal.

SoundGateHit "Heavy" (small piece of metal gates like at the end of plucnger lane)
SoundGateHit "Light" (the light are those wire gates)
 
Updated OP:
- fixed a problem that caused the rubber sound to be played when we we pressed the flipper button. Sounded bad...
 
By now everyone should know about the awesome Fleep mechanical sounds used in some tables.

Do you think you could explain it to me? The first references to it that I recall is it first started with VP.
 
Fleep is a VP contributor / content creator. There are two main aspects of Fleep sounds.

1) The actual recorded sounds.

Fleep records real mechanical sounds from many different pinball machines to a very high standard / quality. He records many different samples (up to 10 typically) for each one.

2) Code for the use of Fleep sound. There are different things involved with the code Fleep uses for his mechanical sounds. The main parts are:

- playing a random mechanical sound (from up to 10 sounds) for each mechanical event. So you could have 10 different sounds for the left flipper, 10 sounds for the top bumper, etc. They are all a little bit different so it makes for a much more dynamic sound experience on the table.

- controlling when a sound is played and how loud it is played based on ball velocity when it hits certain things, etc

- ball rolling based on 3d positional sounds based on the balls position on the playfield



I use Fleep mechanical sounds in PinEvent V2 as part of my newer V2 code for controlling FP sounds, PUP SSF sounds, and DOF. Mostly just the playing of a random mechanical sound for each event.

The ball rolling for FP sounds I use is still smoke's method.... and for PUP SSF ball rolling its controlled in full 3d space by PUP (not just left/right like FP's stereo output).

For (PUP SSF) my Pinevent code uses the position of the mechanical item on the playfield (so it plays the sound in a cabinet from the position it is located at within the 3d space of the front and rear exciters). I use WAV files in the pup-pack for PUP SSF, and OGG files for FP sounds.



For normal FP tables.... simply put... it sounds much better with Fleep's mechanical sounds. The extra code is a bonus if you choose to use it. :)
 
Last edited:
Fleep is a VP contributor / content creator. There are two main aspects of Fleep sounds.

1) The actual recorded sounds.

Fleep records real mechanical sounds from many different pinball machines to a very high standard / quality. He records many different samples (up to 10 typically) for each one.

2) Code for the use of Fleep sound. There are different things involved with the code Fleep uses for his mechanical sounds. The main parts are:

- playing a random mechanical sound (from up to 10 sounds) for each mechanical event. So you could have 10 different sounds for the left flipper, 10 sounds for the top bumper, etc. They are all a little bit different so it makes for a much more dynamic sound experience on the table.

- controlling when a sound is played and how loud it is played based on ball velocity when it hits certain things, etc

- ball rolling based on 3d positional sounds based on the balls position on the playfield



I use Fleep mechanical sounds in PinEvent V2 as part of my newer V2 code for controlling FP sounds, PUP SSF sounds, and DOF. Mostly just the playing of a random mechanical sound for each event.

The ball rolling for FP sounds I use is still smoke's method.... and for PUP SSF ball rolling its controlled in full 3d space by PUP.

For (PUP SSF) my Pinevent code uses the position of the mechanical item on the playfield (so it plays the sound in a cabinet from the position it is located at within the 3d space of the front and rear exciters). I use WAV files in the pup-pack for PUP SSF, and OGG files for FP sounds.



For normal FP tables.... simply put... it sounds much better with Fleep's mechanical sounds. The extra code is a bonus if you choose to use it. :)

Thanks for the explanation! I guess I should do more on VP but I haven't even played a table in years.
 
Thanks Terryred for the answer.

btw, for Rolling ball sounds I also use smoke's code.

I've added a new feature and now left and right hits are "placed" accordingly. It's a simple method but it is working.

Hopefully it'll only require to c&p the new code over the old one but it'll also requires to import more sound files :(

I'll post this new version... soon. It'll probably come with a new table too.

Meanwhile, get to mod tables with FizX and keep an eye on the Mega link JLou shared, especially the WIP folder ;)
 
Last edited:
I have found that both the right and left flipper down stroke sound (Flipper_Left_Down and Flipper_Right_Down_) play when the table starts up without hitting any keys. Not sure why. I couldn't determine what the sound was until I added debug code to everything and both sounds show as played before starting the game. Do you have any ideas why this happens?
 
Last edited:
Most likely the EndofGame or EndofBall Sub that forces the flipper solenoids to be off for normal gameplay, but it also gets called on table startup.
 
Most likely the EndofGame or EndofBall Sub that forces the flipper solenoids to be off for normal gameplay, but it also gets called on table startup.
I will look at that.
 
I had that fixed a long time ago now.

Use the code below and you should not have the double hit sound on the flippers

Sub OnPreHitFlipperSettings(FlipperExt)
' this is for sound. not reladted to FizX
If ((not FlipperExt.IsSolenoidOn and FlipperExt.Hit) or (FlipperExt.AngleDiff >= SwingAngle)) Then SoundBallOnFlipperHit()
End Sub
 
I thought the directions said to add this to the FizX sub:

If not FlipperExt.IsSolenoidOn and FlipperExt.Hit Then SoundBallOnFlipperHit()

I will change it to what you say.

...But I don't think that is the cause of the problem. I figured out a way to combine Terry's DOFLinx coding with Anon's sound coding and I think Terry is actually right. I found that
EndOfGame says:
LeftFlipper.SolenoidOff
DOFLinx_Left_Flipper_Off() 'DOFLinx - Left Flipper Off
RightFlipper.SolenoidOff
DOFLinx_Right_Flipper_Off() 'DOFLinx - Right Flipper Off


Then DOFLinx_Left_Flipper_Off() says

Sub DOFLinx_Left_Flipper_Off() 'DOFLinx - Left Flipper Off
SoundFlippers("LfDown")
End Sub


Then SoundFlippers("LfDown") says

Case "LfDown": FF_SoundVol DV_LF,0, "Flipper_Left_Down_" & Int(Rnd*7)+1 , SoundFactor

I think the fix would be to change the EndOfGame call to run a slightly different version of DOFLinx_Left_Flipper_Off() that does not play the sound. Easy fix.
 
I mentioned several times that the available code for fleep sounds is not the latest.

What I have posted is a fix is for the double ball on flipper hit that I have fixed a while ago. Actually, what I have is already out of date too, btw, or it'll be with fizx 2.0 (unless someone beats me to it and use fmod).

Regarding DOFLinx I have no clue so... yeah, go Terry :D
 
Thanks Terry. I managed to fix the problem with your help.

Thanks Anon. I added your newer code to Sub OnPreHitFlipperSettings(FlipperExt).
 
I thought I would provide some feedback on your code. I ended up making a small change to some of the code that increases volume with ball speed. See the 2 lines of code below. My difficulty on Avatar was the sound was sometimes too loud at high ball speed. I added the first line which acts as a limiter to the volume. On the second line, I changed one of the multiply functions to a plus. It makes it so you can adjust the range of the volume. The code to the left of the plus changes the volume. The code to the right of the plus has a constant volume. The max volume in the example to the left of the plus is 0.14 (1000/7000). So that makes the max constant volume possible to the right side of the plus that you can add is 0.86. Substituting a lower value for 7000 will result in a higher proportion of the sound that is controlled by ball speed and result in a higher range of volume. It will make it so the sound can go loader. That is the logic of it anyway.

If FinalSpeed > 1000 then FinalSpeed = 1000
SoundFactor = FormatNumber((FinalSpeed / 7000) + (MaxSoundLevel * FlipperRubberSoundFactor))
 
General chit-chat
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
  • Quote
  • xenonph @ xenonph:
    I sent you message with pic showing where to make visible adjustment.
    Quote
  • Chat Bot Mibs Chat Bot Mibs:
    Pinped has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    daleks12 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Stephen has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    docdoc has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Exnihilo_Mundus has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    angmarg52 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    tully619 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    smorndb has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Tech49 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Topsi Klaus has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Forsaken43 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    duduky72 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Gerge has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    nunolilo has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    DavidT2025 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Gary-7 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Thunderbird has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    alug has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    bluebird has left the room.
  • HZR @ HZR:
    It’s nice to go all see a place I can play actual machines!!!!
    Quote
  • Chat Bot Mibs Chat Bot Mibs:
    Sunrise74 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Rai has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    liebowa has left the room.
      Chat Bot Mibs Chat Bot Mibs: liebowa has left the room.
      Back
      Top