Emulates the SID sound-chip
Project description
pyresidfp
Emulates the SID sound-chip in software. The C++ emulation code was copied over from libsidplayfp.
How to install
Requirements:
- compiler for ISO C++11
- Python 3 and header files
From PyPI
Install the latest version using
python -m pip install pyresidfp
From cloned git repository
Build from source using
python -m build
and install using
python -m pip install dist/pyresidfp-*.whl
Example
For the example, NumPy and soundcard python packages are required. The example is ported from the section Sample Sound Program, Commodore 64 User's Guide, page 80:
from datetime import timedelta
import numpy as np
import soundcard as sc
from pyresidfp import SoundInterfaceDevice, Voice, ControlBits, Tone
# program SID
sid = SoundInterfaceDevice()
sid.Filter_Mode_Vol = 15 # Maximum volume
sid.attack_decay(Voice.ONE, 190) # 800 ms attack, 15 s decay
sid.sustain_release(Voice.ONE, 248) # sustain peak, 300 ms release
sid.tone(Voice.ONE, Tone.C4)
sid.control(Voice.ONE, ControlBits.TRIANGLE | ControlBits.GATE)
# sample attack phase
attack_phase = timedelta(seconds=0.32)
raw_samples = sid.clock(attack_phase)
# reprogram SID for release phase and sample
release_phase = timedelta(seconds=0.3)
sid.control(Voice.ONE, ControlBits.TRIANGLE)
raw_samples.extend(sid.clock(release_phase))
# convert audio format and play
samples = np.array(raw_samples, dtype=np.float32) / 2.0**15
spkr = sc.default_speaker()
spkr.play(data=samples, samplerate=int(sid.sampling_frequency), channels=1)
Thanks
I like to thank all contributors of libsidplayfp
, especially:
- Dag Lem: Designed and programmed complete emulation engine.
- Antti S. Lankila: Distortion simulation and calculation of combined waveforms
- Ken Händel: source code conversion to Java
- Leandro Nini: port to c++, merge with reSID 1.0
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
pyresidfp-0.3.tar.gz
(77.0 kB
view hashes)
Built Distributions
Close
Hashes for pyresidfp-0.3-pp37-pypy37_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd39fa3baa9306671151126b0d4ecb6a6df198bf828903973e4831ceabde7a50 |
|
MD5 | f4a9d76c6eddeb3712a6ff4249431e99 |
|
BLAKE2b-256 | ef3c624ebebea00164485f2f2f63ad2cc2dd35eae64640a311f552518a0b2789 |
Close
Hashes for pyresidfp-0.3-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a2961270908d15af31e71cb123dfa267305b57372a4e557c3883ffff6bfd9b1 |
|
MD5 | 7aa3e0bed431674f1cc2644318b23afd |
|
BLAKE2b-256 | 2ce20e5e64602f0e67434e5d1428d9a1cce604feb80798e747600571d2c73412 |
Close
Hashes for pyresidfp-0.3-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e8bdf39a8077f8d029f84ff467eca38606609f11344b69abe251e63f314821f |
|
MD5 | d04386b7432336126d8251e4f07a8ec1 |
|
BLAKE2b-256 | 201f911c8442609fc7ff8c76e886db88ed68c958b878b2cc25ce6bbf2179123d |
Close
Hashes for pyresidfp-0.3-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c887f457c76a695767a2bbe9d47971a689999f596c983c95a405209485de4ffa |
|
MD5 | a23f5d1c1c286a056b2270f8f19c9a5e |
|
BLAKE2b-256 | bdb1b67bd9037d1b9afd014e73ea79a34cfe6b1c94ee9a7bf0b8fd7ff9f18687 |
Close
Hashes for pyresidfp-0.3-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 201e8d883b4fe9bc0a96b1856f6baa8212dbd529f30e16854fcea9a7a1a5fb35 |
|
MD5 | bbb76c7e34190f5c5a59e81368b4f917 |
|
BLAKE2b-256 | 733304bd25a8a433e9b80c62d24fad3f2c50be829319792eb4612bde51fb8ea0 |
Close
Hashes for pyresidfp-0.3-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da113b04df76518a06f2073b49db21dc7253d1f73be22598163fe66431638009 |
|
MD5 | 833dfcae383a7229c7a4d60910932001 |
|
BLAKE2b-256 | b7f1ed97709ac5e74124602dd25728c6f7f7a9e039dd9e2e6c0fa1ed8158b062 |