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.3.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3a344f03c7d412726b555f0529d40ca0bcfcb7f7704ed8e3eb73be637cca637 |
|
MD5 | f4cc01b590c08d623de1c11e257f538a |
|
BLAKE2b-256 | e279241f842655b79cdd8a1001bc55b68fd083eb83e08521d6e20246da231d5c |
Hashes for loristrck-1.3.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28f58d904311e78971173465923767e9dc3dd8ca10c233f4f4d9585f5f82f420 |
|
MD5 | 6279c67ce2f7d378f4b7e9741b1053db |
|
BLAKE2b-256 | 34461d3dcb747222a3136bd76d8279b51666a812cd1d97f2e5a9317079285b53 |
Hashes for loristrck-1.3.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c031bb7196690ff91e78d7f25635ecdbda07459250e58db9f61791bdd3ea078 |
|
MD5 | ff5a79ea1df9831db02e5a9572a5686d |
|
BLAKE2b-256 | db0c54d86c7b10d309d390e665e5891fb70eb24e04d0ff37f668da5c69ebb1cb |
Hashes for loristrck-1.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2320342bdc6c57b2a9093743d75f3b1a7ea8836060d3d3225031d15cd68d44e8 |
|
MD5 | 3113c63fc9e5d1b3d28051b0978bab76 |
|
BLAKE2b-256 | 62bdbe989645a4235169beb75ae02ebb495d740aa62eb98557c4c801c3168131 |
Hashes for loristrck-1.3.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 127f2c84aa3c866b0a830b5210d6c78191e94c2596c43a7a859af70503ec4ac0 |
|
MD5 | 07855cce5c997d9f05ed9f6d468b5b32 |
|
BLAKE2b-256 | 7eef494da78a02f7683f119e02c5b7116b1113351d167597f8892d6a63af0b9d |
Hashes for loristrck-1.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d9ea801ba15aabc78b69e9f56b32e5cafe4a0df5eb5a61ca00f70056d8fa108 |
|
MD5 | 5b7439b241f397810696d346cd9e6722 |
|
BLAKE2b-256 | 075c14174abe938633cd10588f8181d4b0b44a053ab417f1d37d537696ee9b3d |