How to corelate sounds with physics?

Get help using Construct 2

Post » Wed Feb 05, 2014 12:03 pm

For example:

You have 5 falling boxes,
and you want to add some wood sound on collision
between them,
but 5 x wood sound x each collision = terrible cacophony :)
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Wed Feb 05, 2014 4:32 pm

You want to have as much variation of the sound as possible, maybe 10-20 subtly different wood sounds and have the code choose a sound from the group.

Also you can add subtle pitch variation each time one of the sounds is triggered.

Something like on collision, play choose("wood1,wood2...) at object. Then on the same event add a playback rate of maybe random(-0.5,0.5)
B
43
S
13
G
8
Posts: 612
Reputation: 7,372

Post » Wed Feb 05, 2014 4:50 pm

@CrudeMik

Thanks for reply, especially playback rate idea

anyway: even if one box fall on another box - there is no just "1" collision, because usually it fall and box do "totter" (be shaky) = generates 2-3 collisions.
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Thu Feb 06, 2014 10:30 am

@szymek

Maybe try limiting it by measuring force. Catch the velocity of the box before impact and tell it to trigger the sound only if the force is strong enough to justify it.

You could even do something clever like modulating the playback volume based on the speed of the object, so a strong collision plays back at 0db and a soft one could be -10db.

Or even better combine variable playback volumes with different samples so you have woodHit_hard and woodHit_soft variants.CrudeMik2014-02-06 10:33:58
B
43
S
13
G
8
Posts: 612
Reputation: 7,372

Post » Thu Feb 06, 2014 11:44 am

@CrudeMik

thanks for all ideas,
especially measuring force and making sounds dependable on it :)
B
18
S
6
G
1
Posts: 783
Reputation: 4,187


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests