semvec/pypi-packages huggingface dataset:
synthax 0.2.2
SynthAX: A Fast Modular Synthesizer in JAX
Requires Python: >=3.9

# SynthAX: A Fast Modular Synthesizer in JAX ⚡️
[![Pyversions](https://img.shields.io/pypi/pyversions/synthax.svg?style=flat-square)](https://pypi.python.org/pypi/synthax)
[![PyPI version](https://badge.fury.io/py/synthax.svg)](https://badge.fury.io/py/synthax)
![PyPI - License](https://img.shields.io/pypi/l/synthax)
[![Paper](https://img.shields.io/badge/paper-AES.10680-red)](https://www.aes.org/e-lib/browse.cfm?elib=22261)

<h1 align="center">
  <a href="https://github.com/PapayaResearch/synthax/blob/main/media/logo.png">
    <img src="https://github.com/PapayaResearch/synthax/blob/main/media/logo.png?raw=true" width="400" /></a>
</h1>

Accelerating audio synthesis far beyond realtime speeds has a significant role to play in advancing intelligent audio production techniques. SynthAX is a fast virtual modular synthesizer written in JAX. At its peak, SynthAX generates audio over 90,000 times faster than realtime, and significantly faster than the state-of-the-art in accelerated sound synthesis. It leverages massive vectorization and high-throughput accelerators. You can get started here [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PapayaResearch/synthax/blob/main/examples/walkthrough.ipynb)

## Basic `synthax` API Usage

```python
import jax
from synthax.config import SynthConfig
from synthax.synth import ParametricSynth

# Instantiate config
config = SynthConfig(
    batch_size=16,
    sample_rate=44100,
    buffer_size_seconds=4.0
)

# Instantiate synthesizer
synth = ParametricSynth(
    config=config,
    sine=1,
    square_saw=1,
    fm_sine=1,
    fm_square_saw=0
)

# Initialize and run
key = jax.random.PRNGKey(42)
params = synth.init(key)
audio = jax.jit(synth.apply)(params)
```

## Installation

The latest `synthax` release can directly be installed from PyPI:

```
pip install synthax
```

If you want to get the most recent commit, please install directly from the repository:

```
pip install git+https://github.com/PapayaResearch/synthax.git@main
```

In order to use JAX on your accelerators, you can find more details in the [JAX documentation](https://github.com/google/jax#installation).

## Acknowledgements & Citing

If you use `synthax` in your research, please cite the following:

```bibtex
@conference{cherep2023synthax,
    title = {SynthAX: A Fast Modular Synthesizer in JAX},
    author = {Cherep, Manuel and Singh, Nikhil},
    booktitle = {Audio Engineering Society Convention 155},
    month = {May},
    year = {2023},
    url = {http://www.aes.org/e-lib/browse.cfm?elib=22261}
}
```

This project is based on [torchsynth](https://github.com/torchsynth/torchsynth). We acknowledge financial support by Fulbright Spain.
redis-cache-py 0.0.2
Redis Cache For Python
Requires Python: >=3.6

![example branch parameter](https://github.com/ptran1203/py-redis-cache/actions/workflows/run-unittest.yml/badge.svg)

# Redis cache for Python

- Simple python redis cache library, mostly used for [distributed caching](https://redis.com/glossary/distributed-caching), where applications is running on separated processes such as Gunicorn workers, K8s replicas, Cloud, ...
- **Asyncio Support for FastAPI, Starlette**

## Requirements

- Redis 5+
- Python 3.6+

## Installation

```bash
$ pip install redis-cache-py
```

## Simple usage

```python
from redis_cache_py import RedisCache

# init redis_cache instance and connection
# make sure you have redis running on `127.0.0.1:6379`
redis_cache = RedisCache(
    host="127.0.0.1",
    port=6379,
)

@redis_cache.cache(ttl=10)  # Expire after 10 seconds
def concate_list(a: list, b: list):
    print("This function is called")
    return a + b

result =  concate_list([1, 2, 3], [4, 5, 6])
print(result)
# This function is called
# [1, 2, 3, 4, 5, 6]

# Now result is cached, next time you call this function, result will returned
# from redis
result =  concate_list([1, 2, 3], [4, 5, 6])
print(result)
# [1, 2, 3, 4, 5, 6]
```

**Asynchronous with asyncio**

```python
import asyncio
from redis_cache_py.asyncio import AsyncRedisCache

# init redis_cache instance and connection
# Make sure you have redis running on `127.0.0.1:6379`
redis_cache = AsyncRedisCache(
    host="127.0.0.1",
    port=6379,
    verbose=1  # Turn on logging for demonstration, set to 0 for silent caching
)

@redis_cache.aio_cache(ttl=10)  # Expire after 10 seconds
async def concate_list(a: list, b: list):
    print("This function is called")
    return a + b

async def test_async_cache():
    result = await concate_list([1, 2, 3], [4, 5, 6])
    print(result)

    # Now the result is cached
    result2 = await concate_list([1, 2, 3], [4, 5, 6])

    print(result2)

loop = asyncio.get_event_loop()
loop.run_until_complete(test_async_cache())

# Output:
# This function is called
# [1, 2, 3, 4, 5, 6]
# [1, 2, 3, 4, 5, 6]
```

## Advanced usage

for further examples and use cases please visit [examples](examples)

## Testing

**NOTE**: Please make sure you have redis running on `127.0.0.1:6379` to run test.

```bash
$ python3 -m unittest discover tests
```