c172p-team / c172p

A high detailed version of the Cessna 172P aircraft for FlightGear
GNU General Public License v2.0
80 stars 43 forks source link

Add screeching and skidding sounds to tires #1309

Closed wlbragg closed 4 years ago

wlbragg commented 4 years ago

I added skidding logic and visual effects to the tires awhile back. It would be nice to also add the sound effects. If one of our many audio artists could come up with a screeching on pavement and skidding on dirt sound, I would be more than happy to do the coding involved to apply it to the aircraft.

The current logic handles skidding of each individual left and right tire. So you potentially have one or two sound paths.

It isn't necessarily simple to add in the sound effect at this point, because there is now a lot of terrain logic that needs to be taken into account. On property needed will be the same property cuing the visual smoke. There will be at least one other that accounts for the ground surface.

I don't know if it would be possible to use a pitch change tied to ground hardness VS different audio files for different surfaces?

gilbertohasnofb commented 4 years ago

@wlbragg I will work on this as soon as I can. I am currently travelling but should be able to take a look at this in a week or two.

I don't know if it would be possible to use a pitch change tied to ground hardness VS different audio files for different surfaces?

I think that pitch only would not be able to make up the difference in sound between different surfaces. I would suggest using different audio files for each one of those. Do you need only asphalt and dirt or are there other types of surfaces, ice for instance? Can you give me a list of all of them?

wlbragg commented 4 years ago

@gilbertohasnofb I don't know for sure how detailed I can test for surfaces without causing overhead I don't want to cause. I may have to settle with a surface hardness condition VS type. But the main ones would be pavement/concrete dirt grass ice mud, thinking tundra/marsh?

gilbertohasnofb commented 4 years ago

@wlbragg I am thinking about this a bit more and I am not sure I understand the need for different sounds for different surfaces.

I tried to look for videos of cars screeching wheels in surfaces other than asphalt but I couldn't find anything.

wlbragg commented 4 years ago

Don't you need hard and grippy surfaces (pavement, concrete, asphalt, etc.) in order to have tires screeching at all

Yes.

very soft screech plus some gravel sound, both of which we already have in the project?

We have that sound?

I was mainly interested in asphalt/concrete screech so you could more easily tell when your wheels locked up without actually seeing them. You would have a totally different sound on dirt and actually it would happen easier because you have less friction so you would skid much easier. I don't think it would be a screech at all, more like a gravely dragging sound. Any other surface sound I don't think is necessary. If we could just get the two sounds I would be happy, asphalt/concrete screech and a gravel/dirt dragging sound.

gilbertohasnofb commented 4 years ago

@wlbragg Done, check the new branch Issue-1309. I added four new sounds:

Let me know if this works for you!

wlbragg commented 4 years ago

@gilbertohasnofb There is a "squeal" sound associated with a squeal.wav that we don't even have in the sound files.

<squeal>
            <name>squeal</name>
            <path>Sounds/squeal.wav</path>
            <condition>
                <and>
                    <or>
                        <property>gear/gear[0]/wow</property>
                        <property>gear/gear[1]/wow</property>
                        <property>gear/gear[2]/wow</property>
                    </or>
                    <less-than>
                        <property>velocities/vertical-speed-fps</property>
                        <value>-0.05</value>
                    </less-than>
                </and>
            </condition>
            <position>
                <x>1.0</x>
                <y>0.0</y>
                <z>-1.5</z>
            </position>
            <volume>
                <property>velocities/groundspeed-kt</property>
                <factor>0.01</factor>
                <max>1.0</max>
            </volume>
            <volume>
                <internal>dt_stop</internal>
                <factor>0.1</factor>
                <max>1.0</max>
            </volume>
            <volume>
                <property>/sim/model/c172p/sound/volume-boost-doors</property>
            </volume>
            <pitch>
                <property>velocities/groundspeed-kt</property>
                <factor>0.0025</factor>
                <offset>1.2</offset>
            </pitch>
            <reference-dist>2.5</reference-dist>
            <max-dist>200.0</max-dist>
        </squeal>

The Cessna337 has a Squeal.wav and it appears to be a short touchdown squeal. Any idea if that was removed intentionally?

wlbragg commented 4 years ago

Also, one of the sound files is not working.

Unsupported audio format: tracks: 1, bits/sample: 24
for: /mnt/GDrive/Aircraft/Development Aircraft/c172p/Sounds/tires-rolling-gravel.wav
wlbragg commented 4 years ago

@gilbertohasnofb I fixed the format on the sound files so no need for you to. I guess they have to be 16 bit VS 32 bit. I'm almost done. I think it works great.

wlbragg commented 4 years ago

@gilbertohasnofb Something else I noticed while working on this. When looking at the log while doing the sounds I noticed an error on loading the procedural lights activating bulb glow for the gear-ctrl for the amphibious.

   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_orange_large.xml"
   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_green.xml"
   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_green.xml"
   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_green.xml"
   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_green.xml"
   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_blue.xml"
   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_blue.xml"
   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_blue.xml"
   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_blue.xml"
   57.27 [ALRT]:input      Failed to load file: "Effects/interior/procedural_light_indicator_led_red.xml"

It's simply a path issue and I just added the entire path. I was surprised that this wasn't noticed by anyone before. I hope it's OK to add it to this issue VS making a new issue. In the file c172p/Models/Interior/Panel/Instruments/gear/gear-ctl.xml I changed

Effects/interior/procedural_light_indicator_led_...

to

Aircraft/c172p/Models/Effects/interior/procedural_light_indicator_led_...

This is ready for testing.

The only thing I would like to see eventually maybe is a looping dirt skid sound VS the one shot. But the one shot work OK regardless. Thank you for doing the sounds. The rolling pavement and dirt sound is really subtle, but under certain conditions it is noticeable, like landing without power.

Oh, I also added the squeal.wav file from the Cessna337 to our sound files, but i commented out the squeal code so it is still not activated. I think maybe it was removed originally because it isn't logically perfect. Anytime the property velocities/vertical-speed-fps hits -0.05 and WOW of any wheel you get the short squeal instead of only when you land. That happens sometimes when you bounce on rough terrain or traversing from one terrain to another. If you un-comment the code at lines 291-332 in c172-sound.xml you can test it yourself and decide if you think we should include it or not.

gilbertohasnofb commented 4 years ago

There is a "squeal" sound associated with a squeal.wav that we don't even have in the sound files.

There are sounds in FGDATA which are available to all aircrafts, and I think the squeal sound comes from there. I really think we already had that sound implemented, which was audible sometimes when landing, or am I imagining things?

I fixed the format on the sound files so no need for you to. I guess they have to be 16 bit VS 32 bit.

Great!

The only thing I would like to see eventually maybe is a looping dirt skid sound VS the one shot. But the one shot work OK regardless.

I will keep an eye out for a suitable sound source.

Thank you for doing the sounds. The rolling pavement and dirt sound is really subtle, but under certain conditions it is noticeable, like landing without power.

My pleasure! Just two ideas about this:

wlbragg commented 4 years ago

OK, hold off merging until I ping you again. I need to check the original squeal sound and see if it was picking up the sound file from fgdata, I never thought about that possibility.

wlbragg commented 4 years ago

@gilbertohasnofb you were right, it was using fgdata sound file so I put it back to original. Let me know what you think about the volume of the new pavement and dirt sounds VS the original "rumble" sound. Between the rumble and the engine sound they drowned out the new tire sounds. Do we need to adjust the volumes of these three competing sounds, tire, rumble, engine?