diff --git a/src/i18n/resources/en.json b/src/i18n/resources/en.json index 29ca0629dd..f707d366b5 100644 --- a/src/i18n/resources/en.json +++ b/src/i18n/resources/en.json @@ -821,15 +821,48 @@ "name": "Visualizer" }, "equalizer": { - "description": "Adds an equalizer to the player", + "description": "Adds an equalizer to the player. Equalizer will start working from the next track", "name": "Equalizer", "menu": { "presets": { "label": "Presets", "list": { - "bass-booster": "Bass booster" + "flat": "Flat", + "acoustic": "Acoustic", + "bassBooster": "Bass Booster", + "bassReducer": "Bass Reducer", + "classical": "Classical", + "club": "Club", + "dance": "Dance", + "deep": "Deep", + "electronic": "Electronic", + "hipHop": "Hip Hop", + "jazz": "Jazz", + "latin": "Latin", + "live": "Live", + "loudness": "Loudness", + "lounge": "Lounge", + "metal": "Metal", + "piano": "Piano", + "pop": "Pop", + "reggae": "Reggae", + "rnb": "R&B", + "rock": "Rock", + "ska": "Ska", + "smallSpeakers": "Small Speakers", + "soft": "Soft", + "softRock": "Soft Rock", + "spokenWord": "Spoken Word", + "techno": "Techno", + "trebleBooster": "Treble Booster", + "trebleReducer": "Treble Reducer", + "vocalBooster": "Vocal Booster" } - } + }, + "edit-config": "Edit Custom Presets in config.json", + "edit-config-tooltip": "Open config.json where you can edit custom equalizer presets. Changes will take effect after restarting the app", + "reset-custom-presets": "Add/Reset Custom Presets", + "reset-custom-presets-tooltip": "This will Add/Replace existing custom profiles in the config.json file with default stubs. Changes will take effect after restarting the app" } } } diff --git a/src/plugins/equalizer/index.ts b/src/plugins/equalizer/index.ts index 7e137d9cd5..787b61888d 100644 --- a/src/plugins/equalizer/index.ts +++ b/src/plugins/equalizer/index.ts @@ -1,16 +1,48 @@ import { createPlugin } from '@/utils'; import { t } from '@/i18n'; -import { MenuContext } from '@/types/contexts'; -import { MenuTemplate } from '@/menu'; -import { defaultPresets, presetConfigs, Preset, FilterConfig } from './presets'; +import { Preset, defaultCustomPresets, defaultPresets } from './presets'; -export type EqualizerPluginConfig = { - enabled: boolean; - filters: FilterConfig[]; - presets: { [preset in Preset]: boolean }; -}; +import appConfig from '../../config'; -let appliedFilters: BiquadFilterNode[] = []; +let filters: BiquadFilterNode[] = []; + +let storedAudioSource: AudioNode; +let storedAudioContext: AudioContext; + +function clearFilters() { + filters.forEach((filter) => filter.disconnect()); + filters = []; + storedAudioSource.disconnect(); + storedAudioSource.connect(storedAudioContext.destination); +} + +function createFilters( + preset: Preset, + audioContext: AudioContext, +): BiquadFilterNode[] { + const filters = preset.filters.map((band) => { + const filter = audioContext.createBiquadFilter(); + filter.type = band.type || ('peaking' as BiquadFilterType); + filter.frequency.value = band.freq || 0; + filter.Q.value = band.Q || 1; + filter.gain.value = band.gain || 0; + return filter; + }); + return filters; +} + +function connectFilters( + filters: BiquadFilterNode[], + audioSource: AudioNode, + audioContext: AudioContext, +) { + let currentNode: AudioNode = audioSource; + for (const filter of filters) { + currentNode.connect(filter); + currentNode = filter; + } + currentNode.connect(audioContext.destination); +} export default createPlugin({ name: () => t('plugins.equalizer.name'), @@ -19,63 +51,110 @@ export default createPlugin({ addedVersion: '3.7.X', config: { enabled: false, - filters: [], - presets: { 'bass-booster': false }, - } as EqualizerPluginConfig, - menu: async ({ - getConfig, - setConfig, - }: MenuContext): Promise => { + selectedPreset: 'flat', // Default preset + customPresets: [] as Preset[], + }, + menu: async ({ getConfig, setConfig }) => { const config = await getConfig(); + const allPresetsD = config.customPresets.concat(defaultPresets); + + const checkedPreset = allPresetsD.some( + (preset) => preset.name === config.selectedPreset, + ) + ? config.selectedPreset + : 'flat'; + return [ { label: t('plugins.equalizer.menu.presets.label'), - type: 'submenu', - submenu: defaultPresets.map((preset) => ({ - label: t(`plugins.equalizer.menu.presets.list.${preset}`), + submenu: allPresetsD.map((preset) => ({ + restartNeeded: true, + label: config.customPresets.includes(preset) + ? preset.name + : t(`plugins.equalizer.menu.presets.list.${preset.name}`), type: 'radio', - checked: config.presets[preset], + checked: checkedPreset === preset.name, click() { - setConfig({ - presets: { ...config.presets, [preset]: !config.presets[preset] }, - }); + setConfig({ selectedPreset: preset.name }); }, })), }, + { + type: 'separator', + }, + { + label: t('plugins.equalizer.menu.reset-custom-presets'), + toolTip: t('plugins.equalizer.menu.reset-custom-presets-tooltip'), + click() { + setConfig({ customPresets: defaultCustomPresets }); + }, + }, + { + label: t('plugins.equalizer.menu.edit-config'), + toolTip: t('plugins.equalizer.menu.edit-config-tooltip'), + click() { + appConfig.edit(); + }, + }, ]; }, renderer: { - async start({ getConfig }) { - const config = await getConfig(); - - document.addEventListener( - 'ytmd:audio-can-play', - ({ detail: { audioSource, audioContext } }) => { - const filtersToApply = config.filters.concat( - defaultPresets - .filter((preset) => config.presets[preset]) - .map((preset) => presetConfigs[preset]), - ); - filtersToApply.forEach((filter) => { - const biquadFilter = audioContext.createBiquadFilter(); - biquadFilter.type = filter.type; - biquadFilter.frequency.value = filter.frequency; // filter frequency in Hz - biquadFilter.Q.value = filter.Q; - biquadFilter.gain.value = filter.gain; // filter gain in dB - - audioSource.connect(biquadFilter); - biquadFilter.connect(audioContext.destination); - - appliedFilters.push(biquadFilter); - }); - }, - { once: true, passive: true }, - ); + async start(context) { + const config = await context.getConfig(); + + const allPresets = config.customPresets.concat(defaultPresets); + + const specifiedPreset = + allPresets.find((preset) => preset.name === config.selectedPreset) || + allPresets.find((preset) => preset.name === 'flat'); + + if (!specifiedPreset) { + return; + } + + if (!storedAudioSource || !storedAudioContext) { + document.addEventListener( + 'ytmd:audio-can-play', + ({ detail: { audioSource, audioContext } }) => { + // Store audioSource and audioContext + storedAudioSource = audioSource; + storedAudioContext = audioContext; + + filters = createFilters(specifiedPreset, audioContext); + audioSource.disconnect(); + connectFilters(filters, audioSource, audioContext); + }, + { once: true, passive: true }, + ); + } else { + filters = createFilters(specifiedPreset, storedAudioContext); + storedAudioSource.disconnect(); + connectFilters(filters, storedAudioSource, storedAudioContext); + } + }, + onConfigChange(newConfig) { + if (!storedAudioSource || !storedAudioContext) { + return; + } + + clearFilters(); + + const allPresets = newConfig.customPresets.concat(defaultPresets); + const specifiedPreset = + allPresets.find((preset) => preset.name === newConfig.selectedPreset) || + allPresets.find((preset) => preset.name === 'flat'); + + if (!specifiedPreset) { + return; + } + + filters = createFilters(specifiedPreset, storedAudioContext); + storedAudioSource.disconnect(); + connectFilters(filters, storedAudioSource, storedAudioContext); }, stop() { - appliedFilters.forEach((filter) => filter.disconnect()); - appliedFilters = []; + clearFilters(); }, }, }); diff --git a/src/plugins/equalizer/presets.ts b/src/plugins/equalizer/presets.ts index 5e2afc46ea..be2c0392f6 100644 --- a/src/plugins/equalizer/presets.ts +++ b/src/plugins/equalizer/presets.ts @@ -1,18 +1,485 @@ -export const defaultPresets = ['bass-booster'] as const; -export type Preset = (typeof defaultPresets)[number]; +export interface Preset { + name: string; + filters: { freq: number; gain: number; Q: number; type: BiquadFilterType }[]; +} -export type FilterConfig = { - type: BiquadFilterType; - frequency: number; - Q: number; - gain: number; -}; +export const defaultCustomPresets: Preset[] = [ + { + name: 'Custom Preset 1', + filters: [ + { freq: 32, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 0.0, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'Custom Preset 2', + filters: [ + { freq: 32, gain: 0.0, Q: 1.0, type: 'lowshelf' }, + { freq: 64, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 0.0, Q: 1.0, type: 'peaking' }, + ], + }, +]; -export const presetConfigs: Record = { - 'bass-booster': { - type: 'lowshelf', - frequency: 80, - Q: 100, - gain: 12.0, - }, -}; +export const defaultPresets: Preset[] = [ + { + name: 'flat', + filters: [ + { freq: 32, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 0.0, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'acoustic', + filters: [ + { freq: 32, gain: 4.8, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 4.5, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 0.4, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 1.6, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 3.3, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 3.8, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 3.3, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 1.3, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'bassBooster', + filters: [ + { freq: 32, gain: 5.0, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 4.0, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 3.0, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 2.1, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 1.1, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: -0.4, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'bassReducer', + filters: [ + { freq: 32, gain: -6.2, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: -4.5, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -3.8, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -3.0, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -1.6, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: -0.4, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'classical', + filters: [ + { freq: 32, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -1.5, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: -3.7, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: -5.3, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'club', + filters: [ + { freq: 32, gain: 0.1, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 0.1, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 2.3, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 0.1, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 0.1, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 0.2, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'dance', + filters: [ + { freq: 32, gain: 6.8, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 5.3, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 4.0, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 2.0, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -3.1, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: -3.1, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 0.0, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'deep', + filters: [ + { freq: 32, gain: 4.5, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 3.0, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 1.3, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 0.4, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 2.3, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 1.1, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -2.8, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: -4.0, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: -5.0, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'electronic', + filters: [ + { freq: 32, gain: 4.0, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 0.9, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -0.6, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -2.6, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 0.4, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 0.9, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 4.3, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'hipHop', + filters: [ + { freq: 32, gain: 4.5, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 3.8, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 0.9, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 2.3, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -1.3, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -1.3, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 1.1, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -1.3, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 2.3, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'jazz', + filters: [ + { freq: 32, gain: 3.8, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 2.3, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 0.9, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: -0.6, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 1.1, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 3.5, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'latin', + filters: [ + { freq: 32, gain: 4.0, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 2.3, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -0.6, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -0.6, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 4.0, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'live', + filters: [ + { freq: 32, gain: -4.6, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: -2.9, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 3.1, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 3.7, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 3.7, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 1.3, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 0.4, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'loudness', + filters: [ + { freq: 32, gain: 5.2, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -0.6, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -0.6, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -2.6, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: -1.6, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -5.5, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 4.5, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 0.4, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'lounge', + filters: [ + { freq: 32, gain: -3.5, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -1.1, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 0.9, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 0.4, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'metal', + filters: [ + { freq: 32, gain: -0.3, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 2.9, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 2.7, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -0.7, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -2.7, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -3.1, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 0, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 3.1, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 5.7, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 2.9, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'piano', + filters: [ + { freq: 32, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 1.6, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -0.6, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 2.1, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 0.6, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 3.3, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 4.0, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 2.3, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 3.0, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'pop', + filters: [ + { freq: 32, gain: -2.4, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: -0.9, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 4.6, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 3.3, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 1.5, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: -0.9, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: -1.1, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'reggae', + filters: [ + { freq: 32, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 0.0, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -1.3, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -3.7, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -0.7, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 2.0, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 3.3, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 0.0, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'rnb', + filters: [ + { freq: 32, gain: 2.1, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 6.2, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 5.5, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 1.1, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -2.8, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 2.1, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 2.3, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 3.5, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'rock', + filters: [ + { freq: 32, gain: 5.9, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 4.8, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 1.5, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -4.6, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -1.1, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 5.5, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 6.6, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 7.0, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'ska', + filters: [ + { freq: 32, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: -3.0, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -2.8, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 5.5, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 6.0, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 6.5, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 6.0, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'smallSpeakers', + filters: [ + { freq: 32, gain: 4.8, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 3.0, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 0.4, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -0.6, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: -1.6, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -3.0, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: -4.0, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: -4.5, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'soft', + filters: [ + { freq: 32, gain: 3.0, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 0.9, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -0.9, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -1.8, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -1.1, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 2.8, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 5.2, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 6.0, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 6.5, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 7.2, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'softRock', + filters: [ + { freq: 32, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 1.3, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -2.8, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -3.5, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: -2.6, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 2.6, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'spokenWord', + filters: [ + { freq: 32, gain: -4.3, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: -1.1, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 0.1, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 3.0, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 4.3, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 4.8, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 3.8, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 1.8, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: -0.6, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'techno', + filters: [ + { freq: 32, gain: 4.8, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: 3.5, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: 0.1, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -3.5, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -3.0, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 0.1, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 4.8, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 6.0, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 6.0, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 5.7, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'trebleBooster', + filters: [ + { freq: 32, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 0.6, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 2.1, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 3.3, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: 3.8, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: 5.2, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'trebleReducer', + filters: [ + { freq: 32, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: -0.4, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: -1.6, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: -3.0, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: -4.0, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: -4.8, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: -5.5, Q: 1.0, type: 'peaking' }, + ], + }, + { + name: 'vocalBooster', + filters: [ + { freq: 32, gain: -2.1, Q: 1.0, type: 'peaking' }, + { freq: 64, gain: -3.3, Q: 1.0, type: 'peaking' }, + { freq: 125, gain: -3.3, Q: 1.0, type: 'peaking' }, + { freq: 250, gain: 0.9, Q: 1.0, type: 'peaking' }, + { freq: 500, gain: 3.3, Q: 1.0, type: 'peaking' }, + { freq: 1000, gain: 3.3, Q: 1.0, type: 'peaking' }, + { freq: 2000, gain: 2.6, Q: 1.0, type: 'peaking' }, + { freq: 4000, gain: 1, Q: 1.0, type: 'peaking' }, + { freq: 8000, gain: -0.3, Q: 1.0, type: 'peaking' }, + { freq: 16000, gain: -2.1, Q: 1.0, type: 'peaking' }, + ], + }, +];