Skip to main content

Geometric representations of tones and chords

Project description

Semitone

A Python package to represent tones, scales, and chords geometrically.

Published at pypi.org/project/semitone.

Quick Start

For full demos, see the notebooks in demos/.

Install with pip:

pip install semitone

Analyze scales:

import semitone as st

scale = st.Major("C")

# Compute frequencies
print(scale)
print(scale.extend(octaves_below=0, octaves_above=2))

# Visualize as a logarithmic spiral
fig = st.SpiralPlot.draw((scale,))
fig.show()

# Visualize equal- vs just-tempered scales together
scale_harm = st.HarmonicOctave("C", max_multiplier=19)
fig = st.SpiralPlot.draw((scale, scale_harm))
fig.show()

Music and Geometry

Each tone is represented as a point on a logarithmic spiral, with its radius scaling with wavelength (higher tones closer to the center), and its angle scaling with its progress around the full octave (semitone raises in pitch are 30 deg clockwise rotations).

For example, three octaves of the equal-tempered chromatic scale in C:

log spiral chromatic C

And a just-tempered scale using the first 19 harmonics compressed to a single octave in C (redundant tones of the same pitch class are eliminated):

log spiral harmonic-19 C

Contributing

For contributing guidelines, see CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semitone-0.2.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

semitone-0.2.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file semitone-0.2.0.tar.gz.

File metadata

  • Download URL: semitone-0.2.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.10.6 Linux/6.8.0-106-generic

File hashes

Hashes for semitone-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3f0819aa7b91fe1aeaacd0604ee4ee43535c534cadff04fa3ab34397f751677c
MD5 58032b7da3c4169cedb5633191eda5b0
BLAKE2b-256 2f3fc7e14dc6ce844ecfcf3995929f69816ea75ebd0fda713ff24cf07c28d234

See more details on using hashes here.

File details

Details for the file semitone-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: semitone-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.10.6 Linux/6.8.0-106-generic

File hashes

Hashes for semitone-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2331a5bcbfd6df8b9c2ec3ef9bf0d93ad43ea1d0cedf63898c617ff68c447bd
MD5 2398f91cdc25ac810ed43376482dda06
BLAKE2b-256 a722af610a8d34cd4f1a49a5e2ca4fb126450c0dbe7cbbd833c31d29371b38d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page