Back

#scale

2 APIs with this tag

Music Theory API

Music-theory maths as an API, computed locally and deterministically over the twelve-tone chromatic scale. The interval endpoint gives the number of semitones and the interval name between two notes — C to G is seven semitones, a perfect fifth. The transpose endpoint shifts one or more notes up or down by a number of semitones, so C E G transposed up seven becomes G B D and a negative value transposes down. The chord endpoint returns the notes of a chord from a root and a type — major, minor, diminished, augmented, the sevenths (major7, minor7, dominant7, diminished7, half-diminished7), sixths, suspended, add9, ninth and power chords — so C major is C E G and C7 is C E G B♭. The scale endpoint returns the notes of a scale from a root and a mode — the major and three minor scales, the seven church modes, the major and minor pentatonics, blues, whole-tone and chromatic — so C major is C D E F G A B and A natural-minor is A B C D E F G. Notes use C, C#, D♭ … B, and accidental=flat spells with flats. Everything is computed locally and deterministically, so it is instant and private. Ideal for music-education, ear-training, songwriting, DAW-plugin, notation and instrument app developers, chord-and-scale tools, and practice software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. This is pitch-class theory; for the actual frequency of a note use a music-note API.

api.oanor.com/musictheory-api

Range Remap API

Map numbers between ranges. The scale endpoint linearly maps a value from an input range [in_min, in_max] onto an output range [out_min, out_max] — the classic map() you reach for with sensor readings, sliders and knobs, gauges and progress bars, and data-visualisation axes. It also returns the 0–1 position t, so with the default 0–1 output range it normalizes a value, and with a 0–1 input range it interpolates (lerp); output ranges may be reversed (out_min greater than out_max) to invert direction, and an optional clamp keeps the result inside the output range instead of extrapolating. The clamp endpoint constrains a value to a minimum and maximum and can additionally snap it to the nearest step. Everything is exact local maths, instant and deterministic. Ideal for IoT and embedded (Arduino-style map), audio and DSP, graphics and game development, dashboards and charts, and UI controls. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This maps scalar values — for interpolating vectors use a vector API and for animation easing curves use an easing API.

api.oanor.com/remap-api