Intuitive sound synthesis in python.
Project description
Intuitive sound synthesis in python.
Installation
pip install pynthlib
Or directly from this repo:
git clone https://github.com/MatejBevec/pynth
pip install ./pynthlib
Usage
Below are some usage examples.
For more info, feel free to read DESCRIPTION.pdf and check out examples.py.
Please note that this project is in a prototype stage and is not optimized in terms of performance and reliability and is missing many planned features.
Overtones
from pynth import *
out = 0.5 * Sin(200)
for i in range(5):
out += 0.1 * Sin(100*i)
drawgraph(out)
showsound(out, t2=0.1)
out.play(5*SR)
Vocal remover
sample, sr = librosa.load("file.wav", mono=False)
l = Wave(sample[0, :])
r = Wave(sample[1, :])
SR = sr
out = 0.5 * (0.5*l - 0.5*r)
out += 0.5 * MovingAvg(0.5*l + 0.5*r, M=50)
Procedural wind
noise = WhiteNoise()
cutmod = Unipol(.5*Sin(1/3) + .5*Sin(1/5)) * 0.1
resmod = Unipol((.5*Sin(1) + .5*Sin(.8)) >> 0.3)
resmod = resmod * 0.4 + 0.1
out = Scope(Lowpass(noise, cutmod, resmod))
Karplus-Strong string emulator
noise = Wave(np.random.rand(4000)-0.5)
delay = Delay(None, delay=0.005)
add = noise + delay
delay.ins["a"] = 0.95 * MovingAvg(add, M=10)
out = add
frozen = Wave(add.eval(2*SR))
User input, envelopes and scopes
import keyboard
control = Input()
env = Envelope(Scope(control), (2000, 0, 0, 8000))
out = Scope(env)
out = Scope(out * Saw(100))
val = 0
def loop(t):
if keyboard.is_pressed(’l’):
control.set(1)
else:
control.set(0)
out.play(30*SR, live=True, callback=loop)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynthlib-0.0.2.tar.gz.
File metadata
- Download URL: pynthlib-0.0.2.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76c58000623aafcff99199c62700122215a52073d8a2617f4ea2c73e9528319f
|
|
| MD5 |
2bb29ec502414b177bcbea3ca0abde44
|
|
| BLAKE2b-256 |
938e0b3beadc3902f63fd82b0631cfa67e100e78f3ac57ebadbf6951c81555ba
|
File details
Details for the file pynthlib-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pynthlib-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3415359e5123ccc3b933867aeccf8430a955d59bfbc6c3a66a24ffe1d7197412
|
|
| MD5 |
84a9c8f63d4607528ccdbc7fcad4f35d
|
|
| BLAKE2b-256 |
6ea9a976c8be05ff8436bccfffc961aa995951a1006f7f09a7d3452d13ec0d02
|