Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 1.75 KB

File metadata and controls

70 lines (46 loc) · 1.75 KB

Audio to Midi Worker

Uses Basic-Pitch to convert audio to midi files.

Using doker

tbd

Running locally

Install conda/miniconda if you haven't already.

Using conda environment file

Install needed dependencies with the provided conda environment.yml file.

conda env create -f environment
conda activate tf-audio

Manually installing dependencies

Create and activate a new conda environment with python=3.10, see basic-pitch docs for supported python version.

conda create --name tf-audio python=3.10
conda activate tf-audio

Install basic-pitch and needed dependencies, tensorflow should be pulled automatically.

pip install basic-pitch minio prisma asyncio PySoundFile numpy

First start

Generating the prisma client

Generate prisma client, api-gateway should've been started by now and a db should exist:

prisma db pull
prisma generate

Then copy .env.template to .env and fill out the needed env vars with your secrets.

Start the worker with python worker.py, you will see whether any GPU is for accelerated computing is available and the model downloading from meta's public file registry.

Once thats done, the worker is ready process jobs.

Configuring basic-pitch

Check line 134 in processor.py to further configure the models input

predict_and_save(
    [file],
    "output",
    save_midi=True,
    sonify_midi=False,
    save_model_outputs=False,
    save_notes=False,
    midi_tempo=tempo,
)

For possible function parameters for the python api see basic-pitch docs.