A wrapper around the partial-tracking library Loris
Project description
LORISTRCK
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.
- C++ Library Dependencies:
- Additional Python Module Dependencies:
Cython
NumPy
pysndfile + libsndfile
sounddevice to be able to play samples (see loristrck_play)
- Optional dependencies:
csound (in order to play .mtx files, as generated by loristrck_pack)
Documentation
Installation
macOS
brew install fftw pip install loristrck
Linux
apt install libfftw3-dev libsndfile1-dev pip install loristrck
Windows
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
See also
sndtrck: https://github.com/gesellkammer/sndtrck
License
GPL
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for loristrck-1.4.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df4db6f4baa611fb0bc3239bf11333043e070454aaf302daeb0f3e50b6d1d19 |
|
MD5 | 08bb7d2934c35939c4db2fa9b29a705c |
|
BLAKE2b-256 | 27186ff6070d457c3a05db9a1f898ce53bc88e98c9eff4a42bd36ed523672cf3 |
Hashes for loristrck-1.4.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ee1e4e31bfb9afc36e1628eb49e1e49d383e64276ef20141c14f83961eac881 |
|
MD5 | ff1b7b4a493886f29e35ff4bf2a4eaf0 |
|
BLAKE2b-256 | eca24ffd6e7fb81dec0bd1f97ab36526c4bf092b9275f4b80d3338a215f0cd16 |
Hashes for loristrck-1.4.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ebbcdae4c6511e610082f6c2732b1e0b26ae4f3b8239c164b375687a5dfec20 |
|
MD5 | 9257273d1010c21894e7241f9386f6d7 |
|
BLAKE2b-256 | 896bfe6c8f5467e0d4df010dab192b876e82faf3499093707fe557427200c68d |
Hashes for loristrck-1.4.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52df3775e58bd2898a83d9f0a641fbf15fb6b54ee62b898ad7384ce5750378a4 |
|
MD5 | 32b10a902cad3e38bc0db738bdafae95 |
|
BLAKE2b-256 | 77d7663673f0c0bb9ab642a924194aaed2dc048939a151fd076c6075ef82c308 |
Hashes for loristrck-1.4.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfd433176218edd09700fa69761715d9eb5937c874d6ef69929943727f325394 |
|
MD5 | d5ef2d47eccb82a87eb0c74b3f4de0e9 |
|
BLAKE2b-256 | 0add1ce92cd9e15f9dfc42be79105c658edd94e41bd8b0fd24ba4540a032908e |
Hashes for loristrck-1.4.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e541fe93274b7c6d07f2d1522a746b5bfdf953dab07a77bfac7083c8976d3c1e |
|
MD5 | ccf702e7c9f2d323c3edecac1f824339 |
|
BLAKE2b-256 | 6ddeab565286603ede66ac077c8cdf9c66eb20c64fa51bc47fe79925938ca634 |