Metadata-Version: 2.4
Name: omnipython-audioinstruments
Version: 0.5.4.dev0
Summary: Playable synthesizers, organs and electric pianos built on a virtual rack, on audiodsp, for CPython and MicroPython
Author: Brad Barnett
License: MIT
Keywords: instruments,synthesizer,eurorack,audio,dsp,micropython,midi
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Multimedia :: Sound/Audio :: Sound Synthesis
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: Implementation :: MicroPython
Classifier: Programming Language :: Python :: Implementation :: CPython
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20
Requires-Dist: omnipython-audiodsp>=0.6.13
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-xdist; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

![One note through a patch of oscillator, filter and amplifier, rendered by the rack](docs/images/note.png)

OmniPython's audioinstruments is a set of playable synthesizers, organs and electric pianos, each one a patch of modules on a virtual rack, rendered a block at a time on [audiodsp](https://github.com/PyDevices/audiodsp), on CPython and on MicroPython-compatible firmware.

## Install

You need Python 3.12 or later, numpy and audiodsp:

```sh
uv venv --seed --python 3.12 .venv
uv pip install --python .venv/bin/python omnipython-audiodsp numpy
git clone https://github.com/PyDevices/audioinstruments && cd audioinstruments
```

## Try it

```python
import audiocore
import audioinstruments

inst = audioinstruments.create("poly106", 48000)
print(inst.macro_labels[:4])
inst.note_on(60, 100)
for n in range(6):
    inst.fill()
    result, data = audiocore.get_buffer(inst.output, False, 0)
    samples = memoryview(bytes(data)).cast("h")
    print(n, max(abs(s) for s in samples))
inst.deinit()
```

Run it with `PYTHONPATH=lib .venv/bin/python example.py`. It plays middle C on the Poly106 and prints its first four knobs, then the loudest sample of each buffer as the note sounds:

```
('vcf_freq', 'vcf_res', 'vcf_env', 'env_attack')
0 3673
1 5483
2 4779
3 4561
4 4411
5 4233
```

[Docs](docs/index.md) · [Examples](examples/) · [Roadmap](ROADMAP.md)

OmniPython is made by [PyDevices](https://pydevices.com).
