Merge pull request #270 from maikirakiwi/main

deez nutz
This commit is contained in:
cryptofyre 2022-01-30 19:41:31 -06:00 committed by GitHub
commit 514d8e7726
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 9 deletions

View file

@ -98,6 +98,7 @@
"term.time.second": "秒", "term.time.second": "秒",
"term.fullscreenView": "全画面表示", "term.fullscreenView": "全画面表示",
"term.defaultView": "ウィンドウ表示", "term.defaultView": "ウィンドウ表示",
"term.audioSettings": "オーディオ設定",
"term.spacializedAudioSetting": "オーディオ空間化設定", "term.spacializedAudioSetting": "オーディオ空間化設定",
"term.clearAll": "消去", "term.clearAll": "消去",
"term.recentStations": "最近の再生", "term.recentStations": "最近の再生",

View file

@ -98,6 +98,7 @@
"term.time.second": "秒", "term.time.second": "秒",
"term.fullscreenView": "全屏", "term.fullscreenView": "全屏",
"term.defaultView": "默认", "term.defaultView": "默认",
"term.audioSettings": "音频设置",
"term.spacializedAudioSetting": "音频空间化设置", "term.spacializedAudioSetting": "音频空间化设置",
"term.clearAll": "清空", "term.clearAll": "清空",
"term.recentStations": "最近播放的频道", "term.recentStations": "最近播放的频道",

View file

@ -98,6 +98,7 @@
"term.time.second": "秒", "term.time.second": "秒",
"term.fullscreenView": "全螢幕顯示", "term.fullscreenView": "全螢幕顯示",
"term.defaultView": "預設顯示", "term.defaultView": "預設顯示",
"term.audioSettings": "音訊設定",
"term.spacializedAudioSetting": "音頻空間化設置", "term.spacializedAudioSetting": "音頻空間化設置",
"term.clearAll": "清空", "term.clearAll": "清空",
"term.recentStations": "最近收聽的廣播", "term.recentStations": "最近收聽的廣播",

View file

@ -62,8 +62,15 @@ export class ConfigStore {
'Q' : [1,1,1,1,1,1,1,1,1,1], 'Q' : [1,1,1,1,1,1,1,1,1,1],
'preamp' : 0, 'preamp' : 0,
'mix' : 1, 'mix' : 1,
'vibrantBass' : 0,
'presets': [], 'presets': [],
'userGenerated': false 'userGenerated': false
},
"vibrantBass": { // Hard coded into the app. Don't include any of this config into exporting presets in store.ts
'multiplier': 0,
'frequencies': [17.182, 42.169, 53.763, 112.69, 119.65, 264.59, 336.57, 400.65, 505.48, 612.7, 838.7, 1155.3, 1175.6, 3406.8, 5158.6, 5968.1, 6999.9, 7468.6, 8862.9, 9666, 10109],
'Q': [2.5, 0.388, 5, 5, 2.5, 7.071, 14.14, 10, 7.071, 14.14, 8.409, 0.372, 7.071, 10, 16.82, 7.071, 28.28, 20, 8.409, 40, 40],
'gain': [-0.34, 2.49, 0.23, -0.49, 0.23, -0.12, 0.32, -0.29, 0.33, 0.19, -0.18, -1.27, -0.11, 0.25, -0.18, -0.53, 0.34, 1.32, 1.78, 0.41, -0.28]
} }
}, },
"visual": { "visual": {

View file

@ -7,6 +7,7 @@ var CiderAudio = {
spatialInput: null, spatialInput: null,
audioBands : null, audioBands : null,
preampNode : null, preampNode : null,
vibrantbassNode: null,
}, },
init: function (cb = function () { }) { init: function (cb = function () { }) {
//AudioOutputs.fInit = true; //AudioOutputs.fInit = true;
@ -28,6 +29,7 @@ var CiderAudio = {
try{ CiderAudio.audioNodes.spatialNode.disconnect();} catch(e){} try{ CiderAudio.audioNodes.spatialNode.disconnect();} catch(e){}
try{ try{
CiderAudio.audioNodes.preampNode.disconnect(); CiderAudio.audioNodes.preampNode.disconnect();
CiderAudio.audioNodes.vibrantbassNode.disconnect();
CiderAudio.audioNodes.audioBands[0].disconnect(); CiderAudio.audioNodes.audioBands[0].disconnect();
CiderAudio.audioNodes.audioBands[9].disconnect(); CiderAudio.audioNodes.audioBands[9].disconnect();
} catch(e){} } catch(e){}
@ -104,7 +106,10 @@ var CiderAudio = {
let BANDS = app.cfg.audio.equalizer.frequencies; let BANDS = app.cfg.audio.equalizer.frequencies;
let GAIN = app.cfg.audio.equalizer.gain; let GAIN = app.cfg.audio.equalizer.gain;
let Q = app.cfg.audio.equalizer.Q; let Q = app.cfg.audio.equalizer.Q;
CiderAudio.audioNodes.audioBands = []; let VIBRANTBASSBANDS = app.cfg.audio.vibrantBass.frequencies;
let VIBRANTBASSGAIN = app.cfg.audio.vibrantBass.gain;
let VIBRANTBASSQ = app.cfg.audio.vibrantBass.Q;
CiderAudio.audioNodes.audioBands = []; CiderAudio.audioNodes.vibrantbassNode = [];
for (i = 0; i < BANDS.length; i++) { for (i = 0; i < BANDS.length; i++) {
CiderAudio.audioNodes.audioBands[i] = CiderAudio.context.createBiquadFilter(); CiderAudio.audioNodes.audioBands[i] = CiderAudio.context.createBiquadFilter();
@ -119,6 +124,14 @@ var CiderAudio = {
CiderAudio.audioNodes.preampNode.frequency.value = 0; // allow all CiderAudio.audioNodes.preampNode.frequency.value = 0; // allow all
CiderAudio.audioNodes.preampNode.gain.value = app.cfg.audio.equalizer.preamp; CiderAudio.audioNodes.preampNode.gain.value = app.cfg.audio.equalizer.preamp;
for (i = 0; i < VIBRANTBASSBANDS.length; i++) {
CiderAudio.audioNodes.vibrantbassNode[i] = CiderAudio.context.createBiquadFilter();
CiderAudio.audioNodes.vibrantbassNode[i].type = 'peaking'; // 'peaking';
CiderAudio.audioNodes.vibrantbassNode[i].frequency.value = VIBRANTBASSBANDS[i];
CiderAudio.audioNodes.vibrantbassNode[i].Q.value = VIBRANTBASSQ[i];
CiderAudio.audioNodes.vibrantbassNode[i].gain.value = VIBRANTBASSGAIN[i] * app.cfg.audio.vibrantBass.multiplier;
}
if (app.cfg.audio.spatial) { if (app.cfg.audio.spatial) {
try{ try{
CiderAudio.audioNodes.spatialNode.output.disconnect(CiderAudio.context.destination); } catch(e){} CiderAudio.audioNodes.spatialNode.output.disconnect(CiderAudio.context.destination); } catch(e){}
@ -129,7 +142,12 @@ var CiderAudio = {
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.preampNode); CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.preampNode);
} }
CiderAudio.audioNodes.preampNode.connect(CiderAudio.audioNodes.audioBands[0]); CiderAudio.audioNodes.preampNode.connect(CiderAudio.audioNodes.vibrantbassNode[0]);
for (i = 1; i < VIBRANTBASSBANDS.length; i ++) {
CiderAudio.audioNodes.vibrantbassNode[i-1].connect(CiderAudio.audioNodes.vibrantbassNode[i]);
}
CiderAudio.audioNodes.vibrantbassNode[VIBRANTBASSBANDS.length-1].connect(CiderAudio.audioNodes.audioBands[0]);
for (i = 1; i < BANDS.length; i ++) { for (i = 1; i < BANDS.length; i ++) {
CiderAudio.audioNodes.audioBands[i-1].connect(CiderAudio.audioNodes.audioBands[i]); CiderAudio.audioNodes.audioBands[i-1].connect(CiderAudio.audioNodes.audioBands[i]);

View file

@ -19,9 +19,9 @@
<!-- BANDS = [60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000]; --> <!-- BANDS = [60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000]; -->
<div class="inputs-container"> <div class="inputs-container">
<div class="input-container mini"> <div class="input-container mini">
{{$root.cfg.audio.equalizer.smoothbass}} {{$root.cfg.audio.equalizer.vibrantBass}}
<input tabindex="0" type="range" class="eq-slider mini" orient="vertical" min="-10" max="10" step="1" v-model="$root.cfg.audio.equalizer.smoothbass" @change="changeSmoothBass()"> <input tabindex="0" type="range" class="eq-slider mini" orient="vertical" min="-20" max="20" step="1" v-model="$root.cfg.audio.equalizer.vibrantBass" @change="changeVibrantBass()">
Smooth Bass Vibrant Bass
</div> </div>
<div class="input-container mini"> <div class="input-container mini">
<input tabindex="0" type="number" class="eq-freq" orient="vertical" min="-12" max="12" step="0.1" v-model="$root.cfg.audio.equalizer.preamp" @change="changePreamp()"> <input tabindex="0" type="number" class="eq-freq" orient="vertical" min="-12" max="12" step="0.1" v-model="$root.cfg.audio.equalizer.preamp" @change="changePreamp()">
@ -130,9 +130,21 @@
this.Q = [] this.Q = []
this.preamp = 0 this.preamp = 0
this.mix = 1 this.mix = 1
this.vibrantBass = 0
this.userGenerated = true this.userGenerated = true
}, },
defaultPresets: [{ defaultPresets: [
{
'preset': 'default',
'name': 'Default',
'frequencies': [32, 63, 125, 250, 500, 1000, 2000, 4000, 8000, 16000],
'gain': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
'Q': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
'preamp': 0,
'mix': 1,
'vibrantBass': 0,
'userGenerated': false
},{
'preset': 'warmth', 'preset': 'warmth',
'name': 'Warmth', 'name': 'Warmth',
'frequencies': [32, 75, 125, 197, 500, 1000, 2000, 3040, 8000, 16000], 'frequencies': [32, 75, 125, 197, 500, 1000, 2000, 3040, 8000, 16000],
@ -140,6 +152,7 @@
'Q': [1, 0.7, 1, 1.5, 1, 1, 1, 2, 1, 1], 'Q': [1, 0.7, 1, 1.5, 1, 1, 1, 2, 1, 1],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}, { }, {
'preset': 'boostBrightness', 'preset': 'boostBrightness',
@ -149,6 +162,7 @@
'Q': [1, 1, 1, 1, 0.6, 1, 1, 1, 1, 0.1], 'Q': [1, 1, 1, 1, 0.6, 1, 1, 1, 1, 0.1],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}, { }, {
'preset': 'acoustic', 'preset': 'acoustic',
@ -158,6 +172,7 @@
'Q': [1, 0.2, 1, 2.0, 1.4, 1, 1, 1, 0.1, 1], 'Q': [1, 0.2, 1, 2.0, 1.4, 1, 1, 1, 0.1, 1],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}, { }, {
'preset': 'clearVocal', 'preset': 'clearVocal',
@ -167,6 +182,7 @@
'Q': [0.3, 1, 1, 1, 2.0, 1, 0.7, 1, 1, 0.8], 'Q': [0.3, 1, 1, 1, 2.0, 1, 0.7, 1, 1, 0.8],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}, { }, {
'preset': 'instrumentClarity', 'preset': 'instrumentClarity',
@ -176,6 +192,7 @@
'Q': [0.5, 1, 2, 1, 1, 1, 1, 1.5, 0.1, 1], 'Q': [0.5, 1, 2, 1, 1, 1, 1, 1.5, 0.1, 1],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}, { }, {
'preset': 'reduceHarshness', 'preset': 'reduceHarshness',
@ -185,6 +202,7 @@
'Q': [1, 1, 1, 1, 1, 2, 1, 1, 1, 1], 'Q': [1, 1, 1, 1, 1, 2, 1, 1, 1, 1],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}, { }, {
'preset': 'smileyFace', 'preset': 'smileyFace',
@ -194,16 +212,18 @@
'Q': [0.1, 1, 1, 1, 1, 0.6, 1, 1, 1, 0.2], 'Q': [0.1, 1, 1, 1, 1, 0.6, 1, 1, 1, 0.2],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}, },
{ {
'preset': 'bassBoostCrystal', 'preset': 'bassBoostGentle',
'name': 'Crystal Bass Boost', 'name': 'Gentle Bass Boost',
'frequencies': [45.53,88.06,116.18,161.3,247.05,295.6,365.79,495.13,716.85,960.76], 'frequencies': [45.53,88.06,116.18,161.3,247.05,295.6,365.79,495.13,716.85,960.76],
'gain': [-0.36,4.07,-1.3,1.92,0.77,-0.53,-1.33,0.44,0.46,-0.5], 'gain': [-0.36,4.07,-1.3,1.92,0.77,-0.53,-1.33,0.44,0.46,-0.5],
'Q': [1.768,0.625,5,8.409,10,16.82,5.946,7.071,20,10], 'Q': [1.768,0.625,5,8.409,10,16.82,5.946,7.071,20,10],
'preamp': -2, 'preamp': -2,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}, },
{ {
@ -214,6 +234,7 @@
'Q': [1.4, 1.4, 1.4, 1.4, 1.4, 1, 1, 1, 1, 1], 'Q': [1.4, 1.4, 1.4, 1.4, 1.4, 1, 1, 1, 1, 1],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}, { }, {
'preset': 'bassBoostClassic', 'preset': 'bassBoostClassic',
@ -223,6 +244,7 @@
'Q': [0.7, 0.7, 0.7, 0.7, 0.7, 1, 1, 1, 1, 1], 'Q': [0.7, 0.7, 0.7, 0.7, 0.7, 1, 1, 1, 1, 1],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
'userGenerated': false 'userGenerated': false
}] }]
} }
@ -307,6 +329,12 @@
close() { close() {
app.resetState() app.resetState()
}, },
changeVibrantBass() {
app.cfg.audio.vibrantBass.multiplier = app.cfg.audio.equalizer.vibrantBass / 10
for (var i = 0; i < 21; i++) {
CiderAudio.audioNodes.vibrantbassNode[i].gain.value = app.cfg.audio.vibrantBass.gain[i] * (app.cfg.audio.equalizer.vibrantBass / 10);
}
},
changePreamp() { changePreamp() {
CiderAudio.audioNodes.preampNode.gain.value = app.cfg.audio.equalizer.preamp; CiderAudio.audioNodes.preampNode.gain.value = app.cfg.audio.equalizer.preamp;
}, },
@ -331,6 +359,7 @@
'Q': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 'Q': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
'preamp': 0, 'preamp': 0,
'mix': 1, 'mix': 1,
'vibrantBass': 0,
}) })
if (app.cfg.audio.equalizer.userGenerated) { if (app.cfg.audio.equalizer.userGenerated) {
this.saveSelectedPreset() this.saveSelectedPreset()
@ -348,6 +377,7 @@
newPreset.Q = eqSettings.Q newPreset.Q = eqSettings.Q
newPreset.preamp = eqSettings.preamp newPreset.preamp = eqSettings.preamp
newPreset.mix = eqSettings.mix newPreset.mix = eqSettings.mix
newPreset.vibrantBass = eqSettings.vibrantBass
app.cfg.audio.equalizer.presets.push(newPreset) app.cfg.audio.equalizer.presets.push(newPreset)
notyf.success("Added Preset") notyf.success("Added Preset")
self.changePreset(newPreset.preset) self.changePreset(newPreset.preset)
@ -365,11 +395,13 @@
preset.Q = app.cfg.audio.equalizer.Q preset.Q = app.cfg.audio.equalizer.Q
preset.preamp = app.cfg.audio.equalizer.preamp preset.preamp = app.cfg.audio.equalizer.preamp
preset.mix = app.cfg.audio.equalizer.mix preset.mix = app.cfg.audio.equalizer.mix
preset.vibrantBass = app.cfg.audio.equalizer.vibrantBass
notyf.success("Saved Preset") notyf.success("Saved Preset")
}, },
applyPreset(preset) { applyPreset(preset) {
Object.assign(this.$root.cfg.audio.equalizer, preset) Object.assign(this.$root.cfg.audio.equalizer, preset)
this.changePreamp() this.changePreamp()
this.changeVibrantBass()
for (var i = 0; i < 10; i++) { for (var i = 0; i < 10; i++) {
this.changeGain(i) this.changeGain(i)
this.changeFreq(i) this.changeFreq(i)

View file

@ -305,7 +305,7 @@
"icon": "./assets/feather/heart.svg", "icon": "./assets/feather/heart.svg",
"id": "unlove", "id": "unlove",
"active": true, "active": true,
"name": this.app.getLz('action.unload'), "name": this.app.getLz('action.unlove'),
"hidden": true, "hidden": true,
"action": function () { "action": function () {
app.unlove(self.item) app.unlove(self.item)