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.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b03e0baaa82a406a9d7576d0e41ddf1a8dade4cd38271d941ade8dc5d30dd8ac |
|
MD5 | 2a8310f95e0a04f86f72833568694350 |
|
BLAKE2b-256 | 73d574dc0a2ec7cce32722f46e1a4c41a5a694a4ef521a405261da99df08efdf |
Hashes for loristrck-1.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52e1fa2ebc08782d80103a74c29153370896b5432bce329f3692bf2062a6ee4c |
|
MD5 | 9a5c8244782eb9f31b68ada012cb3ac4 |
|
BLAKE2b-256 | 1ff47c260ca30417bc03ae87b6488b980466c2fe05a483284d5d7399a8e1ef94 |
Hashes for loristrck-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc4188e7fb493276528c9e5be4983aff74e4f5bf9b322adefda723569ac51f95 |
|
MD5 | 71e737ad3e493cd2c38e9fcd2e3220a4 |
|
BLAKE2b-256 | e0bf0404277ff10438f417ff1061e257f4a56d2660c81f47d054a98196643605 |
Hashes for loristrck-1.4.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56b4090fea934fd395fc43a7fbfbf8e937fdd7c001eb280c378c9bd65168a83d |
|
MD5 | 7eb4a3876494ba745cdd1a66a631c4ff |
|
BLAKE2b-256 | 0176927bbd00e339baf2018acaa321fcd819cae6218a37e37ec2efc63e3cec91 |
Hashes for loristrck-1.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 185f672568319553874b9eedf19b250817e93ed55063ca1c53e0b5202c2611fc |
|
MD5 | d57e8682d173405d5729bf7b325d5328 |
|
BLAKE2b-256 | 02cc41f7ee8299ad3b0b7552c2c83acc692206b1cc00a2c6102d9db1302ea56d |
Hashes for loristrck-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e31a5a781b172b6d2d1dd1c74ec1b9c0296efbcc128f8e1acb89e3b7fe032793 |
|
MD5 | a1096c7f24940575ee6982440ec47ee3 |
|
BLAKE2b-256 | a36c34ba3edfef0a8292274a36e377ad09316e0d08160200628cf4950abd31f5 |
Hashes for loristrck-1.4.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a75e8c61296da4dae226cfadc41e8a5c25684c8017619f87b4a9fa7668eea1 |
|
MD5 | f85e02ff04ae2aad26cea9295227af4f |
|
BLAKE2b-256 | 3a99574fefe2a462dcb91934eb04aa8c69730073ca7c19054be8b5e6fa415a67 |
Hashes for loristrck-1.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45452c176cde40fff75c6aac395f1bcef0148041aa52c4d248f5879e6bd80416 |
|
MD5 | 15a70cafc8c209b3f7bb4a347bb3ebbb |
|
BLAKE2b-256 | 2c0e003dd3eb318207d8f77a543d2544b9bce93851a524241b542079d9087cc0 |
Hashes for loristrck-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d973b51741596854c17c1caa5399b4b77b0a563d3f97fbbbf823c724d9fe3bf |
|
MD5 | 3b2bc2994e6c9557dbfc2d273f5f1840 |
|
BLAKE2b-256 | 556b42fe13f8490e45981df64c9481a6e4000798a7519357eb016ec8a0e119a9 |