Skip to main content

S-Coda

GitHub Release GitHub Actions Workflow Status Python Version

S-Coda is a typed Python library for deterministic symbolic-music processing. It provides immutable musical values, validated MIDI import and export, sequence transformations, bar splitting, canonical tokenisation, vocabulary fingerprints, and incremental decoding constraints for machine-learning workflows.

Installation

Install the current release from PyPI:

python -m pip install scoda

S-Coda supports Python 3.11 through 3.14 and has one core dependency, Mido.

Quick start

from scoda import Note, NotelikeConfig, NotelikeTokeniser, Sequence, save_midi

sequence = Sequence(
    notes=(Note(0, 24, 60, 96), Note(24, 48, 64, 88)),
    duration_ticks=96,
    ticks_per_quarter=24,
)
sequence = sequence.quantise_and_normalise((3, 6, 12, 24), (6, 12, 24))

tokeniser = NotelikeTokeniser(NotelikeConfig(note_values=(6, 12, 24), velocity_bins=127))
tokens = tokeniser.tokenise((sequence,))
token_ids = tokeniser.encode(tokens)
assert tokeniser.decode(token_ids) == tokens
assert tokeniser.detokenise(tokens) == (sequence,)

save_midi((sequence,), "output.mid")

Transformations return new values and never mutate their input. MIDI repairs are explicit diagnostics, token streams have a canonical grammar, and each vocabulary has a deterministic manifest and SHA-256 fingerprint.

Documentation

The complete guide and API reference are available at felixschoen.github.io/S-Coda. It covers:

  • immutable sequences and transformations;
  • MIDI repair, strict, and lossless import policies;
  • bar splitting and carried musical context;
  • token framing, metadata, manifests, and constrained decoding;
  • reproducible experiment persistence and release benchmarks.

Development and release commands are documented in the benchmark guide and the hosted documentation. The supported public API consists of names exported directly from scoda.

Citing

If you use S-Coda in research, please cite:

@inproceedings{Schoen.2023,
  author       = {Felix Sch{\"{o}}n and Hans Tompits},
  title        = {{PAUL-2:} An Upgraded Transformer-Based Redesign of the Algorithmic Composer {PAUL}},
  booktitle    = {22nd International Conference of the Italian Association for Artificial Intelligence ({AIxIA 2023})},
  series       = {Lecture Notes in Computer Science},
  volume       = {14318},
  pages        = {278--291},
  publisher    = {Springer},
  year         = {2023},
  doi          = {10.1007/978-3-031-47546-7\_19}
}

See CHANGELOG.md for release history.

Metadata

Release files for scoda 3.0.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 scoda 3.0.0
File Size Uploaded Provenance Actions
scoda-3.0.0.tar.gz 30.0 kB With provenance Details for scoda-3.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 59.9 kB

Release files / scoda-3.0.0.tar.gz

Download URL scoda-3.0.0.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e263b5845428a77ac5d3cb18d93347c3c722bcda73095bae119f70103f386938
BLAKE2b-256 checksum
How to use checksums
7504a361e19806f9463eab864cc74093e9ec7d76c83105e846af789921518c65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 / scoda-3.0.0-py3-none-any.whl

Download URL scoda-3.0.0-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b83d82920a6e9493f1a8284a1e3500e87e5ed9797fd30a3a07dc4cac1776a40b
BLAKE2b-256 checksum
How to use checksums
c4dbb3837c45201c4a341fb0c10bc0c80606424a6735e01a1d70a4f393255a55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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

Security for scoda 3.0.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scoda-3.0.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 Jul 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.

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files Full provenance

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