Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Modifying sounds of impacts

Archive: 3 posts


Hey guys,

What I'm trying to do is make an impact sound louder when the object is moving faster. So when it's moving slowly and hits something it only produces a small noise, but when it's moving quickly it makes a loud one. I've been playing around with speed sensors, impact sensors and even selectors but to no avail.

I originally thought this would be simple, and I set up an impact sensor wired to a one shot counter, which I then wired to it's own reset and the first port of an AND gate. I hooked up a speed sensor to the second port of the AND gate and then wired the AND gate to my sound. The sound is set to modify volume. This setup doesn't seem to work though. The problem seems to be that when the impact sensor is triggered, the speed sensor instantly becomes zero on the impact, meaning only a quiet or no noise is produced. Is there a way to 'remember' the speed sensor's value just before impact and use that to trigger the sound? Or am I barking up the wrong tree here?
2013-02-07 14:54:00

Author:
Mopkins
Posts: 123


Yes, there is a way to store the value moments before the impact. For this I would place a Direction Combiner, wire that into an Inverted NOT Gate or Node, then wire that into a Timer.
Set the Timer to 'Speed Scale', count to 0.1 and plug it back into the Combiners Negative Input.
If you've worked with Feedback Loops before, you've probably seen similar setups in the past.
Place the Node/InvertedNOTGate into a Microchip, by itself. You might want to scale the Microchips board down. Nothing else is to be placed in there.
Instead of the Microchip + Node, you might just be able to use an AND Gate, but when working with Feedback Loops I like to try and avoid any unnessecary signals entering the loop. Just on the off chance I forget I'm working with an analog somewhere.

Wire your Speed Sensor into your Combiners positive input. This will cause the Timers value to increase/descrease to match the value of the Speed Sensor.
The AND Gate/Node will allow you to stop the signal from changing when you need to do so.

Lastly, wire the Impact Sensor into your second AND Gate that goes into your Sound Object.
The Impact should also be wired into a Not Gate which disables the Node/AND Gate.

I did all this off the top of my head, but it should work.
2013-02-07 15:09:00

Author:
Ostler5000
Posts: 1017


I've think I've tried something very similar to this and it didn't work. I'll go try what you've written now to see if I missed anything.

*EDIT*
Still doesn't work. I think a feedback loop is the way to go though. I've just tried messing around with the maths of it all and managed to get it to work. I've inverted the speed sensor and subtracted 1% from the signal, then I've subtracted that value from 100%. I then put this signal into the feedback loop you explained in place of just the speed sensor and it seems to work. Not sure if I set up the original loop incorrectly and this extra logic is irrelevant, but at least it's working now. Thanks for the help!
2013-02-07 16:26:00

Author:
Mopkins
Posts: 123


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.