# Simulation of rain sound

**URL:** <https://forum.csound.com/t/simulation-of-rain-sound/1285>\
**Category:** General\
**Created:** [July 26, 2023, 2:21am UTC](https://forum.csound.com/t/simulation-of-rain-sound/1285 "2023-07-26T02:21:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tux](https://forum.csound.com/letter_avatar_proxy/v4/letter/t/f4b2a3/32.png) [@tux](https://forum.csound.com/u/tux)\
**Post date:** [July 26, 2023, 2:21am UTC](https://forum.csound.com/t/simulation-of-rain-sound/1285/1 "2023-07-26T02:21:02Z")

</div>

Hello,  
has anyone written some good Csound code to realistically simulate the sound of rain?  
So far the simulations (not with Csound) that I’ve listened to are always too similar to simple white noise, not very realistic.  
Thank you,  
t.

---

<div class="post-metadata">

**Author:** ![dylan](https://forum.csound.com/user_avatar/forum.csound.com/dylan/32/424_2.png) [@dylan](https://forum.csound.com/u/dylan)\
**Post date:** [July 26, 2023, 10:58am UTC](https://forum.csound.com/t/simulation-of-rain-sound/1285/2 "2023-07-26T10:58:22Z")

</div>

Hi,

I don’t have any Csound code (new to Csound) but maybe these pure data patches will give you a starting point?

> **[ASPress - Designing Sound - Practical 15: Rain](http://aspress.co.uk/sd/practical15.html)**
>
> sound design book andy farnell game audio film television radio programming DSP sound effects music Pure Data Foley synthesis procedural audio behavioural audio virtual reality SFX physical modelling

I own the book and the author gets into the details about the shape of a droplet and how it impacts different surfaces.

Right now I have no idea how a pure data patch would translate to Csound, but my sense is that it would be a few instruments, reading and writing from global busses.

Hearing the pure data patches might provide some ideas about how to approximate the sound without attempting to mirror the patches.

---

<div class="post-metadata">

**Author:** ![rory](https://forum.csound.com/user_avatar/forum.csound.com/rory/32/7_2.png) [@rory](https://forum.csound.com/u/rory)\
**Post date:** [July 26, 2023, 5:26pm UTC](https://forum.csound.com/t/simulation-of-rain-sound/1285/3 "2023-07-26T17:26:54Z")

</div>

Iain McCurdy shared a simple weather instrument on the Cabbage forum some time back:

> **[Procedural instruments](https://forum.cabbageaudio.com/t/procedural-instruments/450/3)**
>
> Here’s another stormy weather sound effects generator. Maybe you can sync the thunder (lightning) to a lighting effect in a game - paying due attention to discrepancies between the speed of sound and the speed of light of course. It would also be...

And his Shower instrument could also be put to use as a rain maker.

> <https://github.com/rorywalsh/cabbage/blob/develop/Examples/FunAndGames/Shower.csd>

---

<div class="post-metadata">

**Author:** ![tux](https://forum.csound.com/letter_avatar_proxy/v4/letter/t/f4b2a3/32.png) [@tux](https://forum.csound.com/u/tux)\
**Post date:** [July 26, 2023, 5:58pm UTC](https://forum.csound.com/t/simulation-of-rain-sound/1285/4 "2023-07-26T17:58:05Z")

</div>

Very interesting, thank you.  
t.

---

<div class="post-metadata">

**Author:** ![boonier](https://forum.csound.com/user_avatar/forum.csound.com/boonier/32/426_2.png) [@boonier](https://forum.csound.com/u/boonier)\
**Post date:** [July 27, 2023, 9:50am UTC](https://forum.csound.com/t/simulation-of-rain-sound/1285/5 "2023-07-27T09:50:32Z")

</div>

Hi I think I had a go at rain stuff a while back and came up with this

```csound
gkdens1 init 3.2
gkdens2 init 2.0

instr RainyNess
	amixal = noise:a(1, 0) * (pinker:a() * gkdens1)
	amixbl = amixal * (pinker:a() * gkdens2)
	afinl clip amixbl, 0, 1
	
	amixar = noise:a(1, 0) * (pinker:a() * gkdens1)
	amixbr = amixar * (pinker:a() * gkdens2)
	afinr clip amixbr, 0, 1

	afinl *= 0.5
	afinr *= 0.5
	
	out afinl, afinr
endin
schedule("RainyNess", 0, -1)

```

Could be improved no doubt about that!
