%global _empty_manifest_terminate_build 0 Name: python-pyresidfp Version: 0.6.7 Release: 1 Summary: Emulates the SID sound-chip License: GNU General Public License v2 or later (GPLv2+) URL: https://github.com/pyresidfp/pyresidfp Source0: https://mirrors.nju.edu.cn/pypi/web/packages/64/4e/09b901d1ef4f7eee2478dc15ca2de861d2f84875a9469b0e4bbe1f397342/pyresidfp-0.6.7.tar.gz %description # pyresidfp Emulates the SID sound-chip in software. The C++ emulation code was copied over from [libsidplayfp](https://github.com/libsidplayfp/libsidplayfp). ## How to install Requirements: - compiler for ISO C++11 - Python 3 and header files ### From PyPI Install the latest version using ```commandline python -m pip install pyresidfp ``` ### From cloned git repository Build from source and install using ```commandline python -m pip install . ``` ## Example For the example, [NumPy](http://www.numpy.org/) and [soundcard](https://github.com/bastibe/SoundCard) python packages are required. The example is ported from the section *Sample Sound Program*, [Commodore 64 User's Guide](https://archive.org/embed/Commodore_64_Users_Guide_1982_Commodore), page 80: ```python 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) ``` ## Credits We 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 %package -n python3-pyresidfp Summary: Emulates the SID sound-chip Provides: python-pyresidfp BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip BuildRequires: python3-cffi BuildRequires: gcc BuildRequires: gdb %description -n python3-pyresidfp # pyresidfp Emulates the SID sound-chip in software. The C++ emulation code was copied over from [libsidplayfp](https://github.com/libsidplayfp/libsidplayfp). ## How to install Requirements: - compiler for ISO C++11 - Python 3 and header files ### From PyPI Install the latest version using ```commandline python -m pip install pyresidfp ``` ### From cloned git repository Build from source and install using ```commandline python -m pip install . ``` ## Example For the example, [NumPy](http://www.numpy.org/) and [soundcard](https://github.com/bastibe/SoundCard) python packages are required. The example is ported from the section *Sample Sound Program*, [Commodore 64 User's Guide](https://archive.org/embed/Commodore_64_Users_Guide_1982_Commodore), page 80: ```python 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) ``` ## Credits We 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 %package help Summary: Development documents and examples for pyresidfp Provides: python3-pyresidfp-doc %description help # pyresidfp Emulates the SID sound-chip in software. The C++ emulation code was copied over from [libsidplayfp](https://github.com/libsidplayfp/libsidplayfp). ## How to install Requirements: - compiler for ISO C++11 - Python 3 and header files ### From PyPI Install the latest version using ```commandline python -m pip install pyresidfp ``` ### From cloned git repository Build from source and install using ```commandline python -m pip install . ``` ## Example For the example, [NumPy](http://www.numpy.org/) and [soundcard](https://github.com/bastibe/SoundCard) python packages are required. The example is ported from the section *Sample Sound Program*, [Commodore 64 User's Guide](https://archive.org/embed/Commodore_64_Users_Guide_1982_Commodore), page 80: ```python 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) ``` ## Credits We 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 %prep %autosetup -n pyresidfp-0.6.7 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-pyresidfp -f filelist.lst %dir %{python3_sitearch}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue May 30 2023 Python_Bot - 0.6.7-1 - Package Spec generated