pitch shit
This commit is contained in:
parent
a885e3d05a
commit
5cac487c0f
7 changed files with 15524 additions and 14 deletions
22
bun.lock
22
bun.lock
|
|
@ -5,27 +5,27 @@
|
||||||
"": {
|
"": {
|
||||||
"name": "monochrome",
|
"name": "monochrome",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ffmpeg/ffmpeg": "^0.12.10",
|
"@ffmpeg/ffmpeg": "^0.12.15",
|
||||||
"@ffmpeg/util": "^0.12.1",
|
"@ffmpeg/util": "^0.12.2",
|
||||||
"@neutralinojs/lib": "^6.5.0",
|
"@neutralinojs/lib": "^6.5.0",
|
||||||
"butterchurn": "^2.6.7",
|
"butterchurn": "^2.6.7",
|
||||||
"butterchurn-presets": "^2.4.7",
|
"butterchurn-presets": "^2.4.7",
|
||||||
"cookie-session": "^2.1.0",
|
"cookie-session": "^2.1.1",
|
||||||
"dashjs": "^5.1.1",
|
"dashjs": "^5.1.1",
|
||||||
"jose": "^6.0.11",
|
"jose": "^6.1.3",
|
||||||
"pocketbase": "^0.26.5",
|
"pocketbase": "^0.26.8",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@neutralinojs/neu": "^11.7.0",
|
"@neutralinojs/neu": "^11.7.0",
|
||||||
"eslint": "^9.39.2",
|
"eslint": "^9.39.3",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"globals": "^17.0.0",
|
"globals": "^17.3.0",
|
||||||
"htmlhint": "^1.8.0",
|
"htmlhint": "^1.9.1",
|
||||||
"prettier": "^3.7.4",
|
"prettier": "^3.8.1",
|
||||||
"stylelint": "^16.26.1",
|
"stylelint": "^16.26.1",
|
||||||
"stylelint-config-standard": "^39.0.1",
|
"stylelint-config-standard": "^39.0.1",
|
||||||
"stylelint-config-standard-scss": "^16.0.0",
|
"stylelint-config-standard-scss": "^16.0.0",
|
||||||
"vite": "^7.3.0",
|
"vite": "^7.3.1",
|
||||||
"vite-plugin-neutralino": "^1.0.3",
|
"vite-plugin-neutralino": "^1.0.3",
|
||||||
"vite-plugin-pwa": "^1.2.0",
|
"vite-plugin-pwa": "^1.2.0",
|
||||||
},
|
},
|
||||||
|
|
@ -722,7 +722,7 @@
|
||||||
|
|
||||||
"global-prefix": ["global-prefix@3.0.0", "", { "dependencies": { "ini": "^1.3.5", "kind-of": "^6.0.2", "which": "^1.3.1" } }, "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg=="],
|
"global-prefix": ["global-prefix@3.0.0", "", { "dependencies": { "ini": "^1.3.5", "kind-of": "^6.0.2", "which": "^1.3.1" } }, "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg=="],
|
||||||
|
|
||||||
"globals": ["globals@17.3.0", "", {}, "sha512-yMqGUQVVCkD4tqjOJf3TnrvaaHDMYp4VlUSObbkIiuCPe/ofdMBFIAcBbCSRFWOnos6qRiTVStDwqPLUclaxIw=="],
|
"globals": ["globals@17.4.0", "", {}, "sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw=="],
|
||||||
|
|
||||||
"globalthis": ["globalthis@1.0.4", "", { "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" } }, "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ=="],
|
"globalthis": ["globalthis@1.0.4", "", { "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" } }, "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ=="],
|
||||||
|
|
||||||
|
|
|
||||||
12
index.html
12
index.html
|
|
@ -4473,6 +4473,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Preserve Pitch Control -->
|
||||||
|
<div class="setting-item">
|
||||||
|
<div class="info">
|
||||||
|
<span class="label">Preserve Pitch</span>
|
||||||
|
<span class="description">Keep original pitch when changing speed</span>
|
||||||
|
</div>
|
||||||
|
<label class="toggle-switch">
|
||||||
|
<input type="checkbox" id="preserve-pitch-toggle" />
|
||||||
|
<span class="slider"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 16-Band Equalizer -->
|
<!-- 16-Band Equalizer -->
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
|
|
|
||||||
17
js/player.js
17
js/player.js
|
|
@ -136,17 +136,34 @@ export class Player {
|
||||||
|
|
||||||
applyAudioEffects() {
|
applyAudioEffects() {
|
||||||
const speed = audioEffectsSettings.getSpeed();
|
const speed = audioEffectsSettings.getSpeed();
|
||||||
|
|
||||||
|
if (this.dashInitialized && this.dashPlayer) {
|
||||||
|
if (this.dashPlayer.getPlaybackRate() !== speed) {
|
||||||
|
this.dashPlayer.setPlaybackRate(speed);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (this.audio.playbackRate !== speed) {
|
if (this.audio.playbackRate !== speed) {
|
||||||
this.audio.playbackRate = speed;
|
this.audio.playbackRate = speed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const preservePitch = audioEffectsSettings.isPreservePitchEnabled();
|
||||||
|
if (this.audio.preservesPitch !== preservePitch) {
|
||||||
|
this.audio.preservesPitch = preservePitch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setPlaybackSpeed(speed) {
|
setPlaybackSpeed(speed) {
|
||||||
const validSpeed = Math.max(0.01, Math.min(100, parseFloat(speed) || 1.0));
|
const validSpeed = Math.max(0.01, Math.min(100, parseFloat(speed) || 1.0));
|
||||||
audioEffectsSettings.setSpeed(validSpeed);
|
audioEffectsSettings.setSpeed(validSpeed);
|
||||||
this.applyAudioEffects();
|
this.applyAudioEffects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setPreservePitch(enabled) {
|
||||||
|
audioEffectsSettings.setPreservePitch(enabled);
|
||||||
|
this.applyAudioEffects();
|
||||||
|
}
|
||||||
|
|
||||||
loadQueueState() {
|
loadQueueState() {
|
||||||
const savedState = queueManager.getQueue();
|
const savedState = queueManager.getQueue();
|
||||||
if (savedState) {
|
if (savedState) {
|
||||||
|
|
|
||||||
|
|
@ -928,6 +928,18 @@ export function initializeSettings(scrobbler, player, api, ui) {
|
||||||
playbackSpeedInput.addEventListener('blur', handleInputChange);
|
playbackSpeedInput.addEventListener('blur', handleInputChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========================================
|
||||||
|
// Preserve Pitch Toggle
|
||||||
|
// ========================================
|
||||||
|
const preservePitchToggle = document.getElementById('preserve-pitch-toggle');
|
||||||
|
if (preservePitchToggle) {
|
||||||
|
preservePitchToggle.checked = audioEffectsSettings.isPreservePitchEnabled();
|
||||||
|
|
||||||
|
preservePitchToggle.addEventListener('change', (e) => {
|
||||||
|
player.setPreservePitch(e.target.checked);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// ========================================
|
// ========================================
|
||||||
// Parametric Equalizer Settings (3-32 bands with custom ranges)
|
// Parametric Equalizer Settings (3-32 bands with custom ranges)
|
||||||
// ========================================
|
// ========================================
|
||||||
|
|
|
||||||
|
|
@ -1319,6 +1319,7 @@ export const exponentialVolumeSettings = {
|
||||||
|
|
||||||
export const audioEffectsSettings = {
|
export const audioEffectsSettings = {
|
||||||
SPEED_KEY: 'audio-effects-speed',
|
SPEED_KEY: 'audio-effects-speed',
|
||||||
|
PITCH_PRESERVE_KEY: 'audio-effects-pitch-preserve',
|
||||||
|
|
||||||
// Playback speed (0.01 to 100, default 1.0)
|
// Playback speed (0.01 to 100, default 1.0)
|
||||||
getSpeed() {
|
getSpeed() {
|
||||||
|
|
@ -1334,6 +1335,20 @@ export const audioEffectsSettings = {
|
||||||
const validSpeed = Math.max(0.01, Math.min(100, parseFloat(speed) || 1.0));
|
const validSpeed = Math.max(0.01, Math.min(100, parseFloat(speed) || 1.0));
|
||||||
localStorage.setItem(this.SPEED_KEY, validSpeed.toString());
|
localStorage.setItem(this.SPEED_KEY, validSpeed.toString());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Preserve pitch when changing speed (default true)
|
||||||
|
isPreservePitchEnabled() {
|
||||||
|
try {
|
||||||
|
const val = localStorage.getItem(this.PITCH_PRESERVE_KEY);
|
||||||
|
return val === null ? true : val === 'true';
|
||||||
|
} catch {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
setPreservePitch(enabled) {
|
||||||
|
localStorage.setItem(this.PITCH_PRESERVE_KEY, enabled ? 'true' : 'false');
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const settingsUiState = {
|
export const settingsUiState = {
|
||||||
|
|
|
||||||
15454
package-lock.json
generated
Normal file
15454
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -32,7 +32,7 @@
|
||||||
"@neutralinojs/neu": "^11.7.0",
|
"@neutralinojs/neu": "^11.7.0",
|
||||||
"eslint": "^9.39.3",
|
"eslint": "^9.39.3",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"globals": "^17.3.0",
|
"globals": "^17.4.0",
|
||||||
"htmlhint": "^1.9.1",
|
"htmlhint": "^1.9.1",
|
||||||
"prettier": "^3.8.1",
|
"prettier": "^3.8.1",
|
||||||
"stylelint": "^16.26.1",
|
"stylelint": "^16.26.1",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue