Skip to main content

Sound analysis/synthesis tools for music applications

Project description

sms-tools

Sound analysis/synthesis tools for music applications written in python.

The package includes the following sound analysis/synthesis models:

  • dftModel.py: models based on the Discrete Fourier Transform
  • stft.py: models based on the Short-Time Fourier Transform
  • sineModel.py: models based on a Sinusoidal Model
  • harmonicModel.py: models based on a Harmonic Model
  • stochasticModel.py: models based on a Stochastic Model
  • sprModel.py: models based on a Sinusoidal plus Residual Model
  • spsModel.py: models based on a Sinusoidal plus Stochastic Model
  • hprModel.py: models based on a Harmonic plus Residual Model
  • hpsModel.py: models based on a Harmonic plus Stochastic Model

Installation

Install using pip:

pip install sms-tools

When installing via pip, the Cython extension is built automatically if a compatible compiler and Python environment are available. This provides significant speedups for core routines.

pip install sms-tools

If you are developing locally or want to ensure the Cython extension is built, you can run:

pip install sms-tools
python setup.py build_ext --inplace

If you encounter issues with the Cython extension, ensure you have Cython, setuptools, and a C compiler installed. The extension is optional; sms-tools will fall back to pure-Python routines if unavailable.

You can verify which backend is active at runtime:

python - <<'PY'
from smstools.models import utilFunctions as UF
print("Using Cython backend:", UF.UF_C is not None)
print("Backend module:", getattr(UF.UF_C, "__file__", None))
PY

Binary packages are available for Linux, macOS (Intel & Apple Silicon) and Windows (64 bit) on all recent python versions.

For details about automatic Cython acceleration and fallback behavior, see the "Cython backend" section below.

To build and install the package locally you can use the python packaging tools:

pip install build
python -m build

Cython backend

sms-tools includes a compiled Cython extension for selected core routines. When available, it is used automatically for better performance. If it cannot be imported, sms-tools falls back to pure-Python implementations with the same public behavior (typically slower).

You can verify which backend is active at runtime:

python - <<'PY'
from smstools.models import utilFunctions as UF
print("Using Cython backend:", UF.UF_C is not None)
print("Backend module:", getattr(UF.UF_C, "__file__", None))
PY

Testing

To install test dependencies and run the test suite, use:

pip install .[test]
pytest

You can run a specific test file with:

pytest -v tests/test_cython_vs_python.py

This will execute all tests and print detailed output.

sms-tools-materials repository

There is a separate repository containing teaching materials, example notebooks, and exercises used in courses that use the sms-tools package. It includes Jupyter notebooks, audio examples, and practical guides to help students and researchers learn about sound analysis, synthesis, and transformation with sms-tools.

For more information and resources, see: https://github.com/MTG/sms-tools-materials

License

sms-tools is made available under the terms of the Affero GPL license (http://www.gnu.org/licenses/agpl-3.0.en.html).

Project details


Download files

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

Source Distribution

sms_tools-1.2.tar.gz (138.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sms_tools-1.2-cp313-cp313-win_amd64.whl (196.5 kB view details)

Uploaded CPython 3.13Windows x86-64

sms_tools-1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (358.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sms_tools-1.2-cp313-cp313-macosx_11_0_arm64.whl (193.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sms_tools-1.2-cp312-cp312-win_amd64.whl (195.7 kB view details)

Uploaded CPython 3.12Windows x86-64

sms_tools-1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (388.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sms_tools-1.2-cp312-cp312-macosx_11_0_arm64.whl (193.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sms_tools-1.2-cp312-cp312-macosx_10_9_universal2.whl (230.9 kB view details)

Uploaded CPython 3.12macOS 10.9+ universal2 (ARM64, x86-64)

sms_tools-1.2-cp311-cp311-win_amd64.whl (195.7 kB view details)

Uploaded CPython 3.11Windows x86-64

sms_tools-1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (350.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sms_tools-1.2-cp311-cp311-macosx_11_0_arm64.whl (193.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sms_tools-1.2-cp310-cp310-win_amd64.whl (195.8 kB view details)

Uploaded CPython 3.10Windows x86-64

sms_tools-1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (345.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sms_tools-1.2-cp310-cp310-macosx_11_0_arm64.whl (193.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sms_tools-1.2-cp39-cp39-win_amd64.whl (195.2 kB view details)

Uploaded CPython 3.9Windows x86-64

sms_tools-1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (344.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

sms_tools-1.2-cp39-cp39-macosx_11_0_arm64.whl (192.3 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file sms_tools-1.2.tar.gz.

File metadata

  • Download URL: sms_tools-1.2.tar.gz
  • Upload date:
  • Size: 138.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for sms_tools-1.2.tar.gz
Algorithm Hash digest
SHA256 dd775f0a514f7403fab3494c9b93874139f4ba0ff19c6a2489e9640c1145df2a
MD5 47c2e1056f58018d04215eb1c97d2f42
BLAKE2b-256 9bd9e96e48a21fb55b465f4d0306445b28be6d1c4a06fb188f941ba974a02036

See more details on using hashes here.

File details

Details for the file sms_tools-1.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: sms_tools-1.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 196.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sms_tools-1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2829862f67173e8fbbd4789a2e01d1f7c014d50e87116ac35b2d584ac59a802f
MD5 59892ab809c1290ba85a9da36eff7ec1
BLAKE2b-256 30f00cc049e7ae4d47102344ac62637dfd4869e5c7a1710f1851a84fbfcc4348

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp313-cp313-win_amd64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4124c94250ae13308b6cbd73e24a798474f277295a47bb2c668fb71b4c2ba8c8
MD5 a25cf0a6a6a4df4f495ec7e4c06974d3
BLAKE2b-256 528e2b14aa1ce2d52e15cff03eadfe343abaa0c2dccc026480ddd1650fc54580

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87a0cf42b05b8a5370149563fe56823040cdcd8b8db004a20a6240a9bda6c94f
MD5 252f6bcc406f68881be0a14eccbbeb5e
BLAKE2b-256 09353044cb3165975e763a2df915cf5e4b515b7c6ee9481f63861ed7a2470093

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: sms_tools-1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 195.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sms_tools-1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 988003ec95c229d7acde29ce287632d8dfb6bbe43a41c3069b3d449ec43f3c34
MD5 3f87a06e90886da4199e460a811ccddf
BLAKE2b-256 8af1e1f1ab71c701ed55c3ef79d5d950460fabf8ef9dc521825176dcf6e5f34b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp312-cp312-win_amd64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e2c42cdc9c2fbcef4fbc0243f0d1ab90f7f7f4852526705fb09e01b2d5fcfe13
MD5 93c39d14bf20c6d9e655ebc7a7e41858
BLAKE2b-256 181344ec0fad270bda9d064720b03b173e4fc39d5bfd0dbb8b1030e7a31f9633

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65a65d13b613beb53dc8e9e84684ff118ac53f65624520fe865daa5e36577d23
MD5 98205d45e95eceda8755c45f0a448594
BLAKE2b-256 b19399ab60946b8e43f8578a9ac8be82f96b949591593d1fc743d17ca3944367

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a7078859d642483b8397a6c4a248a13827db8356f1dc074cb45676eb7c92ff97
MD5 392898f652d386ebe69f5fb03972156e
BLAKE2b-256 2346b1bcd0ca0efefb9470072d43a25f14daba851999e557762fd86b2c9366e2

See more details on using hashes here.

File details

Details for the file sms_tools-1.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: sms_tools-1.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 195.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sms_tools-1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f9c4068106a5a5bbcff06d5ea576a3b7a81b4fe4b5ce99121060000652004822
MD5 74f21d9e5519a3abcbbfbdc3f21288eb
BLAKE2b-256 02a1a8110eb5684604fa291b5ad387f06bed281ea6c93bd57cd2d2efc3dfb924

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp311-cp311-win_amd64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b040cbd4bcbf9154f21e8994451abd2653f971ef73aa7e88e8230844c2711241
MD5 467f535000dfffa1591d41121679ddeb
BLAKE2b-256 4deb5e19385ce775f489021b72f44e79d72365b2762e7d658f5dd055f9ae3833

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e4be5bb708eae2d663453747b61688fb6124c8979fadff8b97c7f5840c7b54f3
MD5 bcdcdf5041225f31b5e9a91876eba91e
BLAKE2b-256 2a67a62380bd1ecff012b554a0302241dd430d522be1d0f890093e0126d9b375

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: sms_tools-1.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 195.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sms_tools-1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fcd25dafdda83ff86c5dca187f65d1e4d903ac0fb69f9105bc4b0febbfacdd12
MD5 25afaedcc3a6014729a5b024a4b65c69
BLAKE2b-256 dbc6f4f3a1e8f4a27ba8b0a12b6b13b2237eba34be5a65338d96e188fa1f1169

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp310-cp310-win_amd64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e03c42dc0b36bfb2f430d42b358c4a98d8111366772d1544bc2ff1b7256fcfd3
MD5 b0f26221a284d010a5c4da2289ca9f6d
BLAKE2b-256 9b9e46daed47798bc7051e767a3aedfb4110ac1f4c3a29ebd3b17a9e53490c45

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb1988f3f90e641aaa0d03ec0cbd276bed7cb415bc27f3c3c252d6ebcbfa5f91
MD5 010663f0d0cb7f11e985c414efd17b07
BLAKE2b-256 94e869e9913261789c217ac7424bc18a12a5854984382268b16b765b36366a69

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: sms_tools-1.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 195.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sms_tools-1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 499dba05a24f32209ca3c29a5947d0432ad832fe8edce251214e771aad4baf3c
MD5 3dd295dc2e6b9d2578f9d48167a076cf
BLAKE2b-256 11e7dc7df11cdc6a8147d879d3af2f2b88d361c931db639458b1bd572a93ae33

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp39-cp39-win_amd64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 062cbca89c14a631964df3ab4b9adfc60effdad470d0723fa4e1c8b31e3fb2e7
MD5 97a2514f2df334a5975d7bc152e6945a
BLAKE2b-256 18e7e429b8dcea5e97bc2ee2cb0bd3d5957a3ed5e0122db1ebe4bcc16d16661e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sms_tools-1.2-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sms_tools-1.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aff80732116ef07f4864e1b2df3139d799f1edc90ae16e1593dc66fdc4bcf452
MD5 15472127e4d8fd90a3dabf33803bb048
BLAKE2b-256 f0a2a4e9ade404a14bc977fd33c132ddecc89e8eacea4bc9b175efa3d04b9163

See more details on using hashes here.

Provenance

The following attestation bundles were made for sms_tools-1.2-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: build_wheels.yaml on MTG/sms-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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