BROKEN DO NOT USE
This commit is contained in:
parent
4f883c78c3
commit
dae00d4501
3 changed files with 50 additions and 7 deletions
|
@ -62,8 +62,15 @@ export class ConfigStore {
|
|||
'Q' : [1,1,1,1,1,1,1,1,1,1],
|
||||
'preamp' : 0,
|
||||
'mix' : 1,
|
||||
'vibrantBass' : 0,
|
||||
'presets': [],
|
||||
'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": {
|
||||
|
|
|
@ -7,6 +7,7 @@ var CiderAudio = {
|
|||
spatialInput: null,
|
||||
audioBands : null,
|
||||
preampNode : null,
|
||||
vibrantbassNode: null,
|
||||
},
|
||||
init: function (cb = function () { }) {
|
||||
//AudioOutputs.fInit = true;
|
||||
|
@ -28,6 +29,7 @@ var CiderAudio = {
|
|||
try{ CiderAudio.audioNodes.spatialNode.disconnect();} catch(e){}
|
||||
try{
|
||||
CiderAudio.audioNodes.preampNode.disconnect();
|
||||
CiderAudio.audioNodes.vibrantbassNode.disconnect();
|
||||
CiderAudio.audioNodes.audioBands[0].disconnect();
|
||||
CiderAudio.audioNodes.audioBands[9].disconnect();
|
||||
} catch(e){}
|
||||
|
@ -104,7 +106,10 @@ var CiderAudio = {
|
|||
let BANDS = app.cfg.audio.equalizer.frequencies;
|
||||
let GAIN = app.cfg.audio.equalizer.gain;
|
||||
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++) {
|
||||
CiderAudio.audioNodes.audioBands[i] = CiderAudio.context.createBiquadFilter();
|
||||
|
@ -119,6 +124,14 @@ var CiderAudio = {
|
|||
CiderAudio.audioNodes.preampNode.frequency.value = 0; // allow all
|
||||
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) {
|
||||
try{
|
||||
CiderAudio.audioNodes.spatialNode.output.disconnect(CiderAudio.context.destination); } catch(e){}
|
||||
|
@ -129,7 +142,13 @@ var CiderAudio = {
|
|||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.preampNode);
|
||||
}
|
||||
|
||||
CiderAudio.audioNodes.preampNode.connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
CiderAudio.audioNodes.preampNode.connect(CiderAudio.audioNodes.vibrantbassNode[0]);
|
||||
CiderAudio.audioNodes.vibrantbassNode.connect(CiderAudio.audioNodes.audioBands[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 ++) {
|
||||
CiderAudio.audioNodes.audioBands[i-1].connect(CiderAudio.audioNodes.audioBands[i]);
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
<!-- BANDS = [60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000]; -->
|
||||
<div class="inputs-container">
|
||||
<div class="input-container mini">
|
||||
{{$root.cfg.audio.equalizer.smoothbass}}
|
||||
<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()">
|
||||
Smooth Bass
|
||||
{{$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.vibrantBass" @change="changeVibrantBass()">
|
||||
Vibrant Bass
|
||||
</div>
|
||||
<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()">
|
||||
|
@ -140,6 +140,7 @@
|
|||
'Q': [1, 0.7, 1, 1.5, 1, 1, 1, 2, 1, 1],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
}, {
|
||||
'preset': 'boostBrightness',
|
||||
|
@ -149,6 +150,7 @@
|
|||
'Q': [1, 1, 1, 1, 0.6, 1, 1, 1, 1, 0.1],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
}, {
|
||||
'preset': 'acoustic',
|
||||
|
@ -158,6 +160,7 @@
|
|||
'Q': [1, 0.2, 1, 2.0, 1.4, 1, 1, 1, 0.1, 1],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
}, {
|
||||
'preset': 'clearVocal',
|
||||
|
@ -167,6 +170,7 @@
|
|||
'Q': [0.3, 1, 1, 1, 2.0, 1, 0.7, 1, 1, 0.8],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
}, {
|
||||
'preset': 'instrumentClarity',
|
||||
|
@ -176,6 +180,7 @@
|
|||
'Q': [0.5, 1, 2, 1, 1, 1, 1, 1.5, 0.1, 1],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
}, {
|
||||
'preset': 'reduceHarshness',
|
||||
|
@ -185,6 +190,7 @@
|
|||
'Q': [1, 1, 1, 1, 1, 2, 1, 1, 1, 1],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
}, {
|
||||
'preset': 'smileyFace',
|
||||
|
@ -194,16 +200,18 @@
|
|||
'Q': [0.1, 1, 1, 1, 1, 0.6, 1, 1, 1, 0.2],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
},
|
||||
{
|
||||
'preset': 'bassBoostCrystal',
|
||||
'name': 'Crystal Bass Boost',
|
||||
'preset': 'bassBoostGentle',
|
||||
'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],
|
||||
'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],
|
||||
'preamp': -2,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
},
|
||||
{
|
||||
|
@ -214,6 +222,7 @@
|
|||
'Q': [1.4, 1.4, 1.4, 1.4, 1.4, 1, 1, 1, 1, 1],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
}, {
|
||||
'preset': 'bassBoostClassic',
|
||||
|
@ -223,6 +232,7 @@
|
|||
'Q': [0.7, 0.7, 0.7, 0.7, 0.7, 1, 1, 1, 1, 1],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
'userGenerated': false
|
||||
}]
|
||||
}
|
||||
|
@ -307,6 +317,9 @@
|
|||
close() {
|
||||
app.resetState()
|
||||
},
|
||||
changeVibrantBass() {
|
||||
app.cfg.audio.vibrantBass.multiplier = app.cfg.audio.equalizer.vibrantBass / 10
|
||||
},
|
||||
changePreamp() {
|
||||
CiderAudio.audioNodes.preampNode.gain.value = app.cfg.audio.equalizer.preamp;
|
||||
},
|
||||
|
@ -331,6 +344,7 @@
|
|||
'Q': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
'preamp': 0,
|
||||
'mix': 1,
|
||||
'vibrantBass': 0,
|
||||
})
|
||||
if (app.cfg.audio.equalizer.userGenerated) {
|
||||
this.saveSelectedPreset()
|
||||
|
@ -348,6 +362,7 @@
|
|||
newPreset.Q = eqSettings.Q
|
||||
newPreset.preamp = eqSettings.preamp
|
||||
newPreset.mix = eqSettings.mix
|
||||
newPreset.vibrantBass = eqSettings.vibrantBass
|
||||
app.cfg.audio.equalizer.presets.push(newPreset)
|
||||
notyf.success("Added Preset")
|
||||
self.changePreset(newPreset.preset)
|
||||
|
@ -365,11 +380,13 @@
|
|||
preset.Q = app.cfg.audio.equalizer.Q
|
||||
preset.preamp = app.cfg.audio.equalizer.preamp
|
||||
preset.mix = app.cfg.audio.equalizer.mix
|
||||
preset.vibrantBass = app.cfg.audio.equalizer.vibrantBass
|
||||
notyf.success("Saved Preset")
|
||||
},
|
||||
applyPreset(preset) {
|
||||
Object.assign(this.$root.cfg.audio.equalizer, preset)
|
||||
this.changePreamp()
|
||||
this.changeVibrantBass()
|
||||
for (var i = 0; i < 10; i++) {
|
||||
this.changeGain(i)
|
||||
this.changeFreq(i)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue