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.4.0.tar.gz (21.2 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.4.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: semitone-0.4.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.10.19 Linux/6.14.0-1017-azure

File hashes

Hashes for semitone-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3c6aa0e5e36467cbedd32f07676015886459eb2b173cc36d0c3db24871c79499
MD5 e49ee52dccb91cb2e219f70852e04c2d
BLAKE2b-256 2ebc8c40d0884740b5c246b84cc343817c8e7a12b7ca62ed7c52882385829afe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: semitone-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.10.19 Linux/6.14.0-1017-azure

File hashes

Hashes for semitone-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac0e0c8e1b6d70c433bb0e2b124f0d21bc92ae97670669f1472e45e166f102a0
MD5 72d3b8bcf8911387cbe24552b80d2543
BLAKE2b-256 0f977cdd80ba382ef762118152b5869983de7286dfc75ff14321df19e7890c6a

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