Skip to main content

Geometric representations of tones and chords

Project description

Semitone

A Python package to compute frequencies, scales, and chords in different tuning systems, and to represent their relationships through geometry.

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 may be 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.6.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.6.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: semitone-0.6.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.20 Linux/6.14.0-1017-azure

File hashes

Hashes for semitone-0.6.0.tar.gz
Algorithm Hash digest
SHA256 02e5c5cb4afd6d77cac5108a3363d167c975baa73e399b8b8139b270e023a716
MD5 c65992e892527ab79473c5061e7d22e9
BLAKE2b-256 080c3ab12511b8f31da1876511555d4bd644e2c9a0690dc430797fa22a8bd086

See more details on using hashes here.

File details

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

File metadata

  • Download URL: semitone-0.6.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.20 Linux/6.14.0-1017-azure

File hashes

Hashes for semitone-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b15933f6b1b94e0b3d1f386a3ddec85ce1072076485c314be34d94f5e728e8be
MD5 a8a7f53c10fb91a729e5432550ccc293
BLAKE2b-256 0582f8ae187159f09b4388eb914bec6693b6419001e1633f01b6401c0f8f6071

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