Skip to main content

SampleToNES

PyPI Python License

Overview

SampleToNES (sampletones) is a desktop tool for people writing music for the NES 2A03 sound chip, mainly in FamiTracker.

The core idea is to approximate an audio sample using only the chip's basic oscillators — two pulse channels, a triangle, and noise — without any DPCM samples.

A built-in sequencer lets you arrange the reconstructed samples into patterns and play them back inside the application, so you can experiment with the results before exporting the instruments into FamiTracker.

It supports:

  • loading common audio formats: WAV, MP3, FLAC, OGG, AIFF, and AU
  • a wide range of NES frequencies, from 15 Hz to 300 Hz, including the two most common standards:
    • NTSC (60 Hz)
    • PAL (50 Hz)
  • various sample rates, from 8000 Hz to 192,000 Hz
  • restricting the reconstruction to a chosen subset of oscillators:
    • pulse1
    • pulse2
    • triangle
    • noise
  • exporting reconstructed audio as FamiTracker .fti instruments or as .wav

Installation

Standalone bundle

The easiest way to use SampleToNES is to download the release package for your platform from the releases page, extract it, and run sampletones from inside the extracted folder. On Linux you may need chmod +x sampletones.

Requirements

From PyPI

The quickest way to get the sampletones command. Because SampleToNES is an application rather than a library, installing it into its own isolated environment is recommended:

uv tool install sampletones      # or: pipx install sampletones
sampletones                      # launch the GUI

A plain pip install sampletones into an active virtual environment works too.

To install with GPU support, request the gpu extra (see GPU acceleration):

uv tool install "sampletones[gpu]"

On Linux, audio playback and file dialogs rely on system libraries that cannot come from PyPI. Install them first:

sudo apt-get install libportaudio2 libasound2 python3-tk    # Debian/Ubuntu

Building the executable yourself

You only need Python 3.12.

Windows

  1. Install Python 3.12.
  2. Double-click install.bat. It builds bin\sampletones.exe.
  3. Double-click bin\sampletones.exe to start.

Linux

  1. Install the audio and file-dialog system packages: make system-deps (or run ./scripts/linux/build/dependencies.sh).
  2. Install Python 3.12, then run ./install.sh in a terminal. It builds a bin/sampletones executable.
  3. Run ./bin/sampletones to start.

Run from source

For development. Requires uv (and, on Linux, the system packages from the Linux steps above):

make setup      # create the environment and install the sampletones command
make run        # run the app

To update the global command after pulling new changes, re-run make setup (or uv tool install --force .).

GPU acceleration

SampleToNES can use an NVIDIA GPU (via CuPy and CUDA) to speed up instruction-library generation and reconstruction. make setup detects your NVIDIA driver and installs the matching CuPy build automatically:

make setup          # installs GPU support when a supported driver is present
make setup GPU=0    # forces the CPU (NumPy) backend

A current NVIDIA driver is all you need — the CUDA components ship with the CuPy build, on Linux and Windows alike. On macOS the app runs on the CPU.

Usage

Where your files are stored

Your configuration, instruction libraries (.ins), and reconstructions (.stn) live under your documents folder, in SampleToNES/:

  • Windows: C:\Users\<user>\Documents\SampleToNES
  • Linux: /home/<user>/Documents/SampleToNES
  • macOS: /Users/<user>/Documents/SampleToNES

Command line

You can run without the GUI to use a custom config, generate an instruction library, or reconstruct a file:

sampletones --config <config-path>                                      # run with a custom config
sampletones --generate --config <config-path>                           # generate an instruction library
sampletones <audio-path> --config <config-path> --output <output-path>  # reconstruct an audio file

Run sampletones --help for all options.

Documentation

Internals — the reconstruction algorithms, file formats, the Python API, and developer notes — live in docs/.

License

SampleToNES is released under the MIT License.

The bundled fonts are third-party works under their own licenses (SIL Open Font License 1.1 and the Bitstream Vera license) and are not covered by the MIT License.

The standalone bundles on the releases page additionally contain the Python runtime and every dependency, including several LGPL-licensed libraries. THIRD-PARTY-NOTICES.md lists everything they redistribute and what its license requires; the full license texts are in THIRD-PARTY-LICENSES.txt and ship inside each bundle.

Release files for sampletones 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 sampletones 0.3.0
File Size Uploaded
sampletones-0.3.0.tar.gz 3.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sampletones 0.3.0
File Interpreter ABI Platform
sampletones-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 MB

Release files / sampletones-0.3.0.tar.gz

Download URL sampletones-0.3.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
45d19621ff386ee9c6ade91b38c2902a811e781165ff5309460f1b7748532c0f
BLAKE2b-256 checksum
How to use checksums
f076d3258d64d4f6cbd97493fd843e20394e883a30c50e49e905ddcc979ecf63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Jul 31, 2026.

Transparency log

Release files / sampletones-0.3.0-py3-none-any.whl

Download URL sampletones-0.3.0-py3-none-any.whl
Size 2.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7454e08234cdba688de0e52f25418310d214d7832d8ff034a4d7bff958bd4f6d
BLAKE2b-256 checksum
How to use checksums
d45dc2740fff09bcaea536a06850b686946fe54ec8ad29abd6e9dec7b3b42d9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Jul 31, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

2 release files

This release

0.3.0 This release

2 release files

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