feat: add custom tempo/BPM converter with musical note units

Add comprehensive tempo conversion system supporting:
- BPM (beats per minute) as base unit
- Musical note durations: whole, half, quarter, eighth, sixteenth, thirty-second
- Dotted notes (1.5x duration): dotted-half, dotted-quarter, dotted-eighth, dotted-sixteenth
- Triplet notes (2/3 duration): quarter-triplet, eighth-triplet, sixteenth-triplet
- Time units: milliseconds, seconds, Hertz

Technical implementation:
- Created lib/tempo.ts with custom measure definition
- Extended lib/units.ts with tempo integration and reciprocal conversion logic
- Added tempo category color (orange #F97316) to globals.css
- Conversion formula: milliseconds per beat = 60000 / BPM
- Special handling for BPM ↔ time unit conversions using reciprocal relationship

The tempo converter integrates seamlessly with existing UX:
- Appears as "Tempo / BPM" category in category selector
- Supports all features: search, favorites, history, visual comparison, draggable bars
- Enables musicians to convert between BPM and note durations for tempo calculations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-08 11:53:50 +01:00
parent 296f78709b
commit 75f895284f
3 changed files with 169 additions and 1 deletions

View File

@@ -74,6 +74,7 @@
--color-category-reactive-power: oklch(74.5% 0.233 316.8);
--color-category-speed: oklch(72.4% 0.159 165.1);
--color-category-temperature: oklch(62.8% 0.257 29.2);
--color-category-tempo: oklch(70% 0.18 30);
--color-category-time: oklch(58.5% 0.238 293.1);
--color-category-voltage: oklch(75.5% 0.159 55.3);
--color-category-volume: oklch(64.8% 0.190 293.6);