Skip to main content

A wrapper around the partial-tracking library Loris

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

loristrck-1.6.3-cp312-cp312-win_amd64.whl (1.2 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

loristrck-1.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

loristrck-1.6.3-cp312-cp312-macosx_11_0_arm64.whl (624.1 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

loristrck-1.6.3-cp312-cp312-macosx_10_9_x86_64.whl (297.6 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

loristrck-1.6.3-cp311-cp311-win_amd64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

loristrck-1.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

loristrck-1.6.3-cp311-cp311-macosx_11_0_arm64.whl (622.7 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

loristrck-1.6.3-cp311-cp311-macosx_10_9_x86_64.whl (296.1 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

loristrck-1.6.3-cp310-cp310-win_amd64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

loristrck-1.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

loristrck-1.6.3-cp310-cp310-macosx_11_0_arm64.whl (622.6 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

loristrck-1.6.3-cp310-cp310-macosx_10_9_x86_64.whl (295.7 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

loristrck-1.6.3-cp39-cp39-win_amd64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

loristrck-1.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

loristrck-1.6.3-cp39-cp39-macosx_11_0_arm64.whl (623.1 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

loristrck-1.6.3-cp39-cp39-macosx_10_9_x86_64.whl (296.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page