Skip to main content

hyperscore

hyperscore is a structural music composition framework that models music as explicit, composable structure rather than notation or performance.

Time is represented uniformly using immutable time spans, pitch is handled as pitch-class structure independent of register, and rhythm is expressed as relative proportions that are resolved into concrete time only when needed. External formats such as MIDI are treated as lossy boundaries rather than as the source of truth.

hyperscore is designed for experimentation, analysis, and integration with algorithmic systems, rather than for score engraving or DAW-style workflows.


Minimal example

This minimal example demonstrates the core hyperscore workflow: selecting pitch material using theory objects, describing rhythm structurally, generating time-based events, and exporting the result to MIDI.

from hyperscore import CHORDS, Score, parse_rhythm
from hyperscore.core import NoteEvent, bpm_to_ms
from hyperscore.io import MidiExporter
from hyperscore.rhythm import rhythm_ast_to_timespans

# ----------------
# theory
# ----------------
chord = CHORDS["major7"]

pitches = [n for n in range(60, 72) if n % 12 in chord.intervals]
pitch_iter = iter(pitches)

# ----------------
# rhythm
# ----------------
ast = parse_rhythm("1*4")
total = int(bpm_to_ms(120, 1))
spans = rhythm_ast_to_timespans(ast, total=total)

# ----------------
# score
# ----------------
score = Score()

score.add_timespans(
    spans,
    factory=lambda span: NoteEvent(
        pitch=next(pitch_iter),
        velocity=100,
        span=span,
        channel=0,
    ),
)

# ----------------
# output
# ----------------
MidiExporter().export(score, "example.mid")

This example intentionally avoids musical interpretation and focuses on structural composition. Pitch, rhythm, and time are treated as independent layers that are combined explicitly.


What this example demonstrates

  • Rhythm is expressed as structure, not notation
  • Time is handled explicitly via immutable TimeSpan objects
  • Pitch and rhythm are independent layers
  • MIDI is treated as a lossy output format

For more advanced usage, see:

  • examples/
  • tests/test_smoke.py

Optional: ZippedNotes shortcut

For simple sequential note generation without explicit TimeSpan construction, hyperscore provides the ZippedNotes convenience API.

This approach is suitable for basic sketches or quick tests, but offers less control than TimeSpan-based workflows.

from hyperscore import Score
from hyperscore.core import NoteEvent

score = Score()

score.add(
    pitch=[60, 64, 67, 71],  # C major 7 chord tones
    velocity=[100],
    duration=[125],
    channel=[0],
    event_factory=lambda **kw: NoteEvent(
        pitch=kw["pitch"],
        velocity=kw["velocity"],
        span=kw["span"],
        channel=kw["channel"],
    ),
)

For complex timing, transformations, or algorithmic rhythm generation, prefer TimeSpan-based workflows using parse_rhythm, rhythm_ast_to_timespans, and TimeSpanPipeline.


Project status

  • Python >= 3.10
  • Typed (py.typed)
  • Experimental / research-oriented
  • API may evolve between minor versions

hyperscore favors clarity of structure and explicitness of time over completeness or stylistic prescription.

Metadata

Release files for hyperscore 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 hyperscore 0.3.0
File Size Uploaded Provenance Actions
hyperscore-0.3.0.tar.gz 18.0 kB Without provenance Details for hyperscore-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 42.1 kB

Release files / hyperscore-0.3.0.tar.gz

Download URL hyperscore-0.3.0.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
65294fc2ffd26e5e7b790d1460100cb22a2aac0ae1f17aae9e7cbf24cbf7674e
BLAKE2b-256 checksum
How to use checksums
3c8041ac8c29406c2329c2293417aeccf84d55fce3dc7fd2901c5d7e29ee57be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL hyperscore-0.3.0-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffe49e19d6300b36b24bf7121bb5b9190c64c32042e25eb12c1e2f98266294ea
BLAKE2b-256 checksum
How to use checksums
3683932d483ae28bc00785cf05091e82e13dce8f4083dba15d5766e883a4aca7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for hyperscore 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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