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.3.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.3.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: semitone-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 1635ba1f90830e4d1fcc6b2b1e65664cad3f57523b0c0e2e86ba09160da8acce
MD5 2cd5bd5d05eac0c5eff83eb95e8cb04f
BLAKE2b-256 476ad9d42a5920cef1711d544e24d1c8fee75cb2b7e9f422e184c4ecc6b2557b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: semitone-0.3.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 336c936d362cb6bffb9b6c33cfc6fd0e417b8d6fd4bf6e3e720a7d3968b68847
MD5 5c78a5f4550aa79b7ccdae95e221f325
BLAKE2b-256 a2d4de1121f2782f798cde834294b913eb4aa4d09df871e80e0f36287056d4e8

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