https://github.com/pasqualemainolfi/wt
Wave Terrain Synthesis using Perlin Noise
https://github.com/pasqualemainolfi/wt
Last synced: 2 months ago
JSON representation
Wave Terrain Synthesis using Perlin Noise
- Host: GitHub
- URL: https://github.com/pasqualemainolfi/wt
- Owner: PasqualeMainolfi
- License: other
- Created: 2023-10-26T23:00:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-26T23:09:28.000Z (over 1 year ago)
- Last Synced: 2023-10-27T00:26:06.330Z (over 1 year ago)
- Language: Python
- Size: 609 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WT WAVE TERRAIN SYNTHESIS USING PERLIN NOISE

WT is a powerful tool (in python) for generating and manipulating sounds through wave terrain synthesis, where surfaces are shaped using Perlin noise.
>*terrain generation*
```python
from terrain import Terrainterrain = Terrain(size=(WIDTH, HEIGHT), xy_incr=(0.01, 0.01))
```>*generate envelope*
```python
from envelopes import EnvelopeTypes, Envelopeenvelope = Envelope(
envelope_type=EnvelopeTypes.ADSR,
dur=ENVELOPE_DUR,
sr=SR,
atk=0.001,
decay=0,
release=ENVELOPE_DUR - 0.001,
sustain_amp=1.0,
initial_amp=0.0001,
end_amp=0.0001,
mode="exp")
envelope.show_env()
```>*generate orbit and add envelope to orbit*
```python
from orbits import OrbitTypes, Orbitorbit = Orbit(orbit_type=OrbitTypes.SPIRAL, center=(0.5, 0.5))
orbit.envelope = envelopeorbit.show_orbit(period=1 / SR)
```>*wave terrain synthesis*
```python
from wave_terrain import WaveTerrainSynthesiswt = WaveTerrainSynthesis(sr=SR)
wt.terrain = terrain
wt.orbit = orbit
```>*generate sample by sample*
```python
y = np.zeros(SAMPLE_DUR, dtype=np.float64)
for i in range(SAMPLE_DUR):
sample = wt.get_sample(freqs=(FREQX, FREQY), haptic_freq=HAPTIC_FREQ, max_r=0.707)
y[i] = sample
# master envelope
y *= np.hanning(SAMPLE_DUR)
```