Skip to main content

A thin Python wrapper around the Sound Design Toolkit

Project description

PySDT: Python bindings for the Sound Design Toolkit

Thin Python bindings for the Sound Design Toolkit (SDT) library.

The bindings consist of two parts:

  • C++ wrapper classes (contained in src/wrappers/) encapsulate SDT's C API, especially the manual memory management
  • nanobind bindings (contained in src/pysdt.cpp) make the wrappers available in Python

Proper documentation for the Python library will be added at some point. Until then, the SDT documentation should be helpful as well, since the bindings follow the C API and module structure very closely. Getter/setter pairs are usually captured as Python @properties.

Features

Most of the SDT functionality is available in the bindings, except for

  • OSC support
  • JSON export/import
  • anything with a straightforward numpy equivalent, e.g. array means or FFT calculation

Installation

Packaged wheels are available for Linux and MacOS.

pip install pysdt

Alternatively, you can build the bindings yourself:

git clone git@github.com:dsuedholt/pysdt.git && cd pysdt
pip install .

Currently, a pre-built dynamic library for the respective platform is downloaded at build-time and packaged together with the Python bindings. This works but has some limitations, I haven't quite figured out how to make it work for Windows. In the future, I should probably move towards building the SDT from source.

Usage

By default, the global sampling rate is set to 0 Hz. It is important to set the global sampling rate explicitly at the start of your script. If you change the sampling rate later on, you may need to call update() on some objects; check the SDT documentation.

Here's a brief example of using the DCMotor class to generate one second of engine sound:

import pysdt
import numpy as np

sr = 44100

pysdt.common.set_sampling_rate(sr)

# buffer length of an internal comb filter is a constructor argument
motor = pysdt.dcmotor.DCMotor(1024)

# properties bind to getRpm / setRpm etc
motor.rpm = 3000
motor.load = 0.5

result = np.zeros(sr)
for i in range(sr):
    result[i] = motor.dsp()

# we have sound! can now process, play or save it, e.g:
import soundfile as sf
sf.write("engine.wav", result, sr)

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

pysdt-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distributions

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

pysdt-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (303.6 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

pysdt-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl (425.6 kB view details)

Uploaded CPython 3.12+macOS 11.0+ x86-64

pysdt-0.1.0-cp312-abi3-macosx_11_0_arm64.whl (416.9 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

pysdt-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (306.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pysdt-0.1.0-cp311-cp311-macosx_11_0_x86_64.whl (430.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pysdt-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (420.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pysdt-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (306.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pysdt-0.1.0-cp310-cp310-macosx_11_0_x86_64.whl (430.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

pysdt-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (420.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file pysdt-0.1.0.tar.gz.

File metadata

  • Download URL: pysdt-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pysdt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5ba77fcb1ee9e30debcbbd07911d459b3812f32eec9102ebb7f98ca7026041b0
MD5 cde2e4a66e70da953c047d22fe9eb1e9
BLAKE2b-256 a2a7a86b54acb93f693273f8affd9decdc109cb88abca6bb5126ce184bcca75e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0.tar.gz:

Publisher: publish.yml on dsuedholt/pysdt

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

File details

Details for the file pysdt-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysdt-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c0a07ffdd200f5a05a7c8ce7c3cd0fe55a87eae7f619c73bf715682949f3bb39
MD5 0c25a3071aee02728db0e9931f231d4c
BLAKE2b-256 697af26bfd6c55e413927a6a2dfc671ccd8da9ad4eefe0209331f0456f12f8a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on dsuedholt/pysdt

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

File details

Details for the file pysdt-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pysdt-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 ec359608248a112630986ffc56b95ad6b2de5c69192f83ecca8aac167748b2c7
MD5 44ff1806c62ea617d82a8cb32f291bcd
BLAKE2b-256 8338353f815a1dd6a285ac0e643d935402918e1b14a3d8acb31ea46f8c40e5ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl:

Publisher: publish.yml on dsuedholt/pysdt

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

File details

Details for the file pysdt-0.1.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pysdt-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1c6a005a0a6ca74ed860a9c2b9acc9947a0bbcff6d53e8d6882723dd23525af9
MD5 60f9b9ac3caf241b373be0feec3fc1d9
BLAKE2b-256 3b846d2314c55a78c1214409a7d49b19f0587dabc0dffe16bcc35d6b0c96680e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on dsuedholt/pysdt

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

File details

Details for the file pysdt-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysdt-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4fe9e19dfc99acb030071237337f0e453c8a411098637e4884c5d3a6fe9914c1
MD5 52ea4fa49520dd57a484be4d6b01d099
BLAKE2b-256 400d82a823397c0caf1d9c35829332194319d049e39cea73cb19cda4596fc841

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on dsuedholt/pysdt

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

File details

Details for the file pysdt-0.1.0-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pysdt-0.1.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 68d5caa2cd252b73de236da684f7d9a7db902164ed352f58f618017660cb54c9
MD5 349b22d9ef8925ec4c59c50060fcf0b1
BLAKE2b-256 c268acc3e4d14464640ebfa2cc858868addf7883e8a4cc00fd75c4438eaf60b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0-cp311-cp311-macosx_11_0_x86_64.whl:

Publisher: publish.yml on dsuedholt/pysdt

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

File details

Details for the file pysdt-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pysdt-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 95553ad260ef94489cbac5354b85e9e90d0d43fcdf271735560753078d2446d9
MD5 fc6722e59d3219cf6f3564d72f0ae115
BLAKE2b-256 5b96ff711aa09583da0fea38509139df4ee5902cbab8acbb42e076c17f6581f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on dsuedholt/pysdt

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

File details

Details for the file pysdt-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysdt-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 380dde29502252c06899dbda5c545c28cfbf89ce89697bff72e03642c1764432
MD5 8645d5620827865ac68948bc8351e226
BLAKE2b-256 f9700b547bc8a03b5a1599de5dda12f975b5db9625250cd331009ffe83df978c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on dsuedholt/pysdt

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

File details

Details for the file pysdt-0.1.0-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pysdt-0.1.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 2de09f8009bf4b921d6511c9508ca7c4c2a3c80bab3be211b4af4adbc6c3d5da
MD5 27b8a9f0a1e429ba01735a0f3dba872a
BLAKE2b-256 1b812cbbf0fbe3bb9a2d539d38cab4f67e68e58407c07bd9a3c8e1fa91810c91

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0-cp310-cp310-macosx_11_0_x86_64.whl:

Publisher: publish.yml on dsuedholt/pysdt

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

File details

Details for the file pysdt-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pysdt-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 36e8afa25c8ab3f0a40f6452e1a518c2df6dd9511d8221cd5ef41881c0fd4839
MD5 83537b476739557aa94da5606f5e241e
BLAKE2b-256 c5b2ed66242ab19c0dc734a9fb71dc04d2c48ad1b502a2a26a0ef074441bb811

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysdt-0.1.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish.yml on dsuedholt/pysdt

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