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

Uploaded Python 3

File details

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

File metadata

  • Download URL: semitone-0.5.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.5.0.tar.gz
Algorithm Hash digest
SHA256 23064e3aaebf62ca128200422984950a018b3e61b21c774d531591416009a19c
MD5 6bc412477b7641316aa0310f0654f510
BLAKE2b-256 8623f7faa0dd6991c0c07aa1a4e3bc32122068a6a0c2cd21b2ce0c275fb5867e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: semitone-0.5.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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f404e9ff3099098b54f487191fccbd4065e6de844e710718754a10ef8b7b234e
MD5 d68de77eab8eaa34b3ca6de53eaa76a4
BLAKE2b-256 b6881c4fe6169b86ac3ddf5a92a851659f16c5eec4d5ea1e8de5297704ad405e

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