fix: convert master meter levels to dB scale for consistent metering
Previously, master meters received raw linear values (0-1) while track meters received dB-normalized values, causing inconsistent metering display. Now both master peak and RMS levels are converted using linearToDbScale() for accurate comparison between track and master levels. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -152,14 +152,15 @@ export function useMultiTrackPlayer(
|
|||||||
// Detect clipping (signal >= 1.0)
|
// Detect clipping (signal >= 1.0)
|
||||||
const isClipping = peak >= 1.0;
|
const isClipping = peak >= 1.0;
|
||||||
|
|
||||||
setMasterPeakLevel(peak);
|
// Convert to dB scale (same as track levels) for consistent metering
|
||||||
setMasterRmsLevel(rms);
|
setMasterPeakLevel(linearToDbScale(peak));
|
||||||
|
setMasterRmsLevel(linearToDbScale(rms));
|
||||||
if (isClipping) {
|
if (isClipping) {
|
||||||
setMasterIsClipping(true);
|
setMasterIsClipping(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
masterLevelMonitorFrameRef.current = requestAnimationFrame(monitorMasterLevels);
|
masterLevelMonitorFrameRef.current = requestAnimationFrame(monitorMasterLevels);
|
||||||
}, []);
|
}, [linearToDbScale]);
|
||||||
|
|
||||||
// Apply automation values during playback
|
// Apply automation values during playback
|
||||||
const applyAutomation = useCallback(() => {
|
const applyAutomation = useCallback(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user