Skip to main content

pylibresidfp

pybind11 binding of libresidfp (the reSIDfp SID emulator) with chip state save/restore, a deterministic output and a GIL-free render loop.

from pylibresidfp import SID

sid = SID(model="6581", clock_hz=985248.0, sampling_hz=44100.0, method="decimate", filter=True)
sid.write(24, 15); sid.read(27); sid.peek(27); sid.reset()
sid.cycle                      # absolute cycle count, starts at 0
sid.clock(cycles)              # np.int16 samples for those cycles
sid.run(writes, until)         # writes: (N, 3) ints or [(cycle, reg, value), ...], absolute cycles
sid.serve(writes, cycle, reg)  # run to `cycle`, then read(reg): the body of a NativeSid on_read
sid.voices()                   # per-voice envelope (LFSR, rate, counter, state, ...) and oscillator state
sid.trace(writes, until)       # run without audio: (cycle, voice, envelope, state) at each envelope change
sid.envelope_trace(v, writes, until, lfsr=None)  # one voice's envelope alone from a copy (its
                               # rate counter's LFSR set to lfsr if given): the chip is untouched
sid.envelope_phases(v, writes, until)  # envelope_trace for every rate-counter phase at once: Phases
                               # (pieces, events, count, states) with .trajectory(k), exact for each k
state = sid.save_state(); sid.restore_state(state)
twin = sid.copy()              # same parameters and state; SID is also picklable

run clocks to each write's cycle, writes it, then clocks to until. Write cycles must not precede sid.cycle or each other and must not exceed until; violations raise ValueError. serve discards the samples it produces (use run to keep audio).

trace clocks the oscillators and envelopes only (libresidfp's clockDigital), so a chip used for tracing no longer renders the same audio as one that was not. voices and trace read libresidfp's internals through patches/0002-probe-access.patch, which befriends a reSIDfp::Probe class. patches/0003-zero-state-padding.patch zeroes the saved state's struct padding, so save_state is reproducible byte for byte.

clock, run, serve, trace, envelope_trace, envelope_phases, save_state and restore_state release the GIL. Each instance has a busy flag: use from a second thread while a call is in progress raises RuntimeError. Distinct instances run in parallel.

Fed directly from vagrant_moses: sid.run(native_sid.drain_writes(), until).

Determinism

Two instances with the same parameters and writes produce identical samples, for both models and both methods. Upstream libresidfp dithers the filter's float-to-int conversion from a table indexed by a counter held in the process-wide filter-model singleton; patches/0001-deterministic-rounding.patch (applied at build time) replaces the dither with plain rounding. Other process-wide state is immutable after first use (filter and waveform tables). The static setters Filter6581::setFilterRange/setCaps are not exposed. The pinned libresidfp has no noiseLevel, so there is no noise_level option.

State is not portable across builds. sid.cycle is part of the saved state.

Build

git clone --recurse-submodules, then pip install .. Needs CMake >= 3.20, patch and a C++17 compiler. libresidfp is the submodule extern/libresidfp, pinned to a release tag; its version is read from the submodule's configure.ac, and .github/workflows/libresidfp.yml opens a PR when a newer release appears. The build copies its sources and applies patches/ to the copy. Tests: pip install -e .[dev], then pytest -n auto --cov=pylibresidfp. docker build . (build arg PYTHON_VERSION) runs the full lint and test suite.

GPL-2.0-or-later (see COPYING).

Metadata

Release files for pylibresidfp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylibresidfp 0.3.0
File Size Uploaded Provenance Actions
pylibresidfp-0.3.0.tar.gz 176.9 kB With provenance Details for pylibresidfp-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pylibresidfp 0.3.0
File Actions
pylibresidfp-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for pylibresidfp-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pylibresidfp-0.3.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for pylibresidfp-0.3.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pylibresidfp-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for pylibresidfp-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pylibresidfp-0.3.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for pylibresidfp-0.3.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pylibresidfp-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for pylibresidfp-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pylibresidfp-0.3.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for pylibresidfp-0.3.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Total release size: 1.2 MB

Release files / pylibresidfp-0.3.0.tar.gz

Download URL pylibresidfp-0.3.0.tar.gz
Size 176.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3ab103663924d66297803315f13fda4931a5687ca5955e5dfa049473314cf686
BLAKE2b-256 checksum
How to use checksums
61623b15cc0f4bf51747121aa23ed3f551aa7601aae63fbc8e0d07ee26038fe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pylibresidfp-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pylibresidfp-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 184.7 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2b65c2da6370bb6ea5ff7da762e28fa4ecaf17717a4aa35e2fb6aec543e4cae1
BLAKE2b-256 checksum
How to use checksums
d7560ff943c49d48bb8cf52996996d17361ba7bdb6a4a8acb1732f0b03a92b79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pylibresidfp-0.3.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pylibresidfp-0.3.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 168.0 kB
Tags CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
dae4ba447190612a274ee0913fa6de74719dd771ee8ad2e12a486a66d708a6cc
BLAKE2b-256 checksum
How to use checksums
0a3cf4f7334e19490ea04778cd56261d67e1c198ce6e586ad3df074912da7985
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pylibresidfp-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pylibresidfp-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 184.7 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6d32a8d68b5f7cf23516a63bd6dce220211e537fd9b41c8842c1dcc50a25b71a
BLAKE2b-256 checksum
How to use checksums
d31415788dbe45eed17dea65f91825985e3ab1415cee4487af2d537d9f9d7fe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pylibresidfp-0.3.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pylibresidfp-0.3.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 168.0 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
cd1ac86bc1e14816a656cb80aed1ffacfc64519771078867e68f640d2185b145
BLAKE2b-256 checksum
How to use checksums
6bc6ad29c06ecf9db1488de42e49579d6d8db963a74b7365904f515adee93ac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pylibresidfp-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pylibresidfp-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 182.8 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f08de0d73f66671601e52e3ed9a54d3271a8317749acd0caaa30fe366faac1fc
BLAKE2b-256 checksum
How to use checksums
5e96dcf927ad5f22f868ae0b49ba59ab60d86fbb5d0771433b0b36eb94c4bb91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pylibresidfp-0.3.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pylibresidfp-0.3.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 166.5 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
1407d911134346b4a04bd1832baa2989273f626ef70003661c03dfebf8c8481e
BLAKE2b-256 checksum
How to use checksums
4e6efe57355c4777d34542c0d23578d1e2a627640966fc010cb7b3a4e6a615eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for pylibresidfp 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for pylibresidfp-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page