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.2.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b34a157e898076cf461d703c56cd9091f3f5bdd0e44bf42a2de5c207410ba41f |
|
MD5 | 24bb516836d8690698aea63f7131b1b5 |
|
BLAKE2b-256 | ad290437638d7c4fd3387b1b056f14e80eddbfef69bce4d62534b9e81ee83bd8 |
Hashes for loristrck-1.2.3-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c533cb675aa52e672152444f5a8ca0722e6d6c6c9036df3f7a432fa0a4e0f7b4 |
|
MD5 | b093897e1e4d097a509befd91da36105 |
|
BLAKE2b-256 | a609bfbe6e1d59bc89cf60eb74ec19f529c1a77a9b557c9e5bf4618b6edf5b96 |
Hashes for loristrck-1.2.3-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fdc55937eb1b2a2f46e195d0337d8efd418183f5cab8775bf830dce8a215c2d |
|
MD5 | 61ed5b97306a9876cd60c3ca6c28aa17 |
|
BLAKE2b-256 | ac7f773dd5eee766e25e67a182a5975dcee474ddf9bd94ab62630d7024af76ed |
Hashes for loristrck-1.2.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11ae6c2bd3275ec2f65d795857fef12f8ea3618400ff839de35d46126431ed63 |
|
MD5 | 928cfa7aab7b2c6b64f4eeb13b501496 |
|
BLAKE2b-256 | 049c2982bc341fb787d6524c24f7e77798b4ee1149fda1f1b7992255eee340dc |
Hashes for loristrck-1.2.3-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01244f37bbfc56ec658fced7af40f32c4427b27f2c9fb712316ff21e35099955 |
|
MD5 | 99821ff40d3445683286f567ac7f1330 |
|
BLAKE2b-256 | dcbc0e00a38ee6b28e20779b3cebbd11fb5010973c8a04fe60bc80bac86077f4 |
Hashes for loristrck-1.2.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13c8fd99c4047b91b56cda6b4a7076aa15e1ac901dbdd8771903446074bbebf4 |
|
MD5 | ba57d50aa658de6a3dca7a6a3564176c |
|
BLAKE2b-256 | e5c2628f52f0f2c6b5ee2eb528473439748c570d5a3f6b5fabdffe5bbdf003b1 |