
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
rhythm-math
Advanced tools
Rhythm mathematics for the browser and web audio — tempo, polyrhythm, groove, syncopation, and meter
Rhythm mathematics for the browser and web audio — tempo, polyrhythm, groove, syncopation, and meter.
npm install rhythm-math
Tempo — { bpm: number }Polyrhythm — { rates: number[] }Groove — { velocities: number[], offsets: number[] }Meter — { numerator: number, denominator: number }bpmToMs(bpm) → milliseconds per beatmsToBpm(ms) → BPMtempoCurve(start, end, steps, curve) → number[] where curve is "linear", "exponential", or "logarithmic"polyrhythmCycleLength(rates) → LCM of ratespolyrhythmPattern(rates) → binary arrays per voicepolyrhythmDensity(rates) → average hit densityswingFactor(grid, amount) → swung grid positionsgrooveVelocity(pattern, accents?) → MIDI velocities (0–127)microtiming(offsets, humanize) → humanized offsetssyncopationScore(pattern, meterNumerator) → Longuet-Higgins/Lee scoreoffbeatDensity(pattern, meterNumerator) → fraction of off-beat hitsrhythmicEntropy(pattern) → Shannon entropy of interval distributionisSimple(meter), isCompound(meter), isOdd(meter) → booleanbeatCount(meter) → main beats per measuresubdivision(meter) → subdivisions per beatdownbeats(measures, meter) → downbeat positionstimeSignatureChanges(meters, repeats?) → expanded meter sequenceMIT
FAQs
Rhythm mathematics for the browser and web audio — tempo, polyrhythm, groove, syncopation, and meter
We found that rhythm-math demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.