gesellkammer / loristrck

Partial tracking in python, based on Loris

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LORISTRCK

sh-downloads sh-month

loristrck is a wrapper for the C++ partial-tracking library Loris.

It is written in cython and targets python 3 (>= 3.8 at the moment). The source of the library is included as part of the project and does not need to be installed previously.

Documentation

https://loristrck.readthedocs.io


Installation

pip install loristrck

Install from source in Windows

You need to have Visual Studio installed

# From a Developer Powershell
python scripts/prepare_windows_build.py

# From a normal prompt
pip install .

Usage

import loristrck as lt

samples, sr = lt.sndreadmono("/path/to/sndfile.wav")
partials = lt.analyze(samples, sr, resolution=60)
# partials is a python list of numpy arrays
# select a subset of most significant partials
selected, noise = lt.select(partials, mindur=0.02, maxfreq=12000, minamp=-60, minbp=2)
# print each partial as data
for partial in selected:
    print(partial)
# plot selected partials
lt.plot_partials(selected)
# now resynthesize both parts separately 
lt.partials_render(selected, outfile="selected.wav")
lt.partials_render(noise, outfile="noise.wav")

Each partial will be a numpy array of shape = (numbreakpoints, 5) with the columns:

time, frequency, amplitude, phase, bandwidth

See the example scripts in bin for more complete examples

Author

Eduardo Moguillansky

eduardo dot moguillansky @ gmail dot com

License

GPL

About

Partial tracking in python, based on Loris

License:Other


Languages

Language:C 45.1%Language:C++ 20.7%Language:Shell 9.8%Language:Makefile 9.2%Language:SWIG 5.2%Language:HTML 4.8%Language:Python 2.0%Language:JavaScript 1.7%Language:Cython 0.6%Language:M4 0.6%Language:Csound Document 0.3%Language:CSS 0.2%