wip audiolabs slider
This commit is contained in:
parent
13ffb07436
commit
34d9652fc8
5 changed files with 790 additions and 416 deletions
|
@ -1,11 +1,11 @@
|
|||
const CiderAudio = {
|
||||
context : null,
|
||||
source : null,
|
||||
audioNodes : {
|
||||
gainNode : null,
|
||||
spatialNode : null,
|
||||
context: null,
|
||||
source: null,
|
||||
audioNodes: {
|
||||
gainNode: null,
|
||||
spatialNode: null,
|
||||
spatialInput: null,
|
||||
audioBands : null,
|
||||
audioBands: null,
|
||||
vibrantbassNode: null,
|
||||
llpw: null,
|
||||
analogWarmth: null,
|
||||
|
@ -16,89 +16,99 @@ const CiderAudio = {
|
|||
init: function (cb = function () { }) {
|
||||
//AudioOutputs.fInit = true;
|
||||
let searchInt = setInterval(function () {
|
||||
if (document.getElementById("apple-music-player")) {
|
||||
//AudioOutputs.eqReady = true;
|
||||
document.getElementById("apple-music-player").crossOrigin = "anonymous";
|
||||
CiderAudio.connectContext(document.getElementById("apple-music-player"), 0);
|
||||
|
||||
cb();
|
||||
clearInterval(searchInt);
|
||||
}
|
||||
if (document.getElementById("apple-music-player")) {
|
||||
//AudioOutputs.eqReady = true;
|
||||
document.getElementById("apple-music-player").crossOrigin = "anonymous";
|
||||
CiderAudio.connectContext(document.getElementById("apple-music-player"), 0);
|
||||
|
||||
cb();
|
||||
clearInterval(searchInt);
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
off: function(){
|
||||
try{
|
||||
off: function () {
|
||||
try {
|
||||
CiderAudio.hierarchical_unloading();
|
||||
try{
|
||||
CiderAudio.audioNodes = {
|
||||
gainNode : null,
|
||||
spatialNode : null,
|
||||
spatialInput: null,
|
||||
audioBands : null,
|
||||
vibrantbassNode: null,
|
||||
llpw: null,
|
||||
analogWarmth: null
|
||||
}
|
||||
} catch (e) {}
|
||||
CiderAudio.source.connect(CiderAudio.context.destination);} catch(e){}
|
||||
try {
|
||||
CiderAudio.audioNodes = {
|
||||
gainNode: null,
|
||||
spatialNode: null,
|
||||
spatialInput: null,
|
||||
audioBands: null,
|
||||
vibrantbassNode: null,
|
||||
llpw: null,
|
||||
analogWarmth: null
|
||||
}
|
||||
} catch (e) { }
|
||||
CiderAudio.source.connect(CiderAudio.context.destination);
|
||||
} catch (e) { }
|
||||
},
|
||||
connectContext: function (mediaElem){
|
||||
if (!CiderAudio.context){
|
||||
CiderAudio.context = new (window.AudioContext || window.webkitAudioContext);
|
||||
connectContext: function (mediaElem) {
|
||||
if (!CiderAudio.context) {
|
||||
CiderAudio.context = new (window.AudioContext || window.webkitAudioContext);
|
||||
}
|
||||
if (!CiderAudio.source){
|
||||
CiderAudio.source = CiderAudio.context.createMediaElementSource(mediaElem);
|
||||
} else {try{CiderAudio.source.disconnect(CiderAudio.context.destination)}catch(e){}}
|
||||
if (!CiderAudio.source) {
|
||||
CiderAudio.source = CiderAudio.context.createMediaElementSource(mediaElem);
|
||||
} else { try { CiderAudio.source.disconnect(CiderAudio.context.destination) } catch (e) { } }
|
||||
CiderAudio.audioNodes.gainNode = CiderAudio.context.createGain()
|
||||
CiderAudio.source.connect(CiderAudio.audioNodes.gainNode);
|
||||
if(app.cfg.audio.normalization){
|
||||
if (app.cfg.audio.normalization) {
|
||||
CiderAudio.normalizerOn()
|
||||
}
|
||||
if (app.cfg.audio.spatial){
|
||||
if (app.cfg.audio.spatial) {
|
||||
CiderAudio.spatialOn()
|
||||
}
|
||||
}
|
||||
CiderAudio.hierarchical_loading();
|
||||
},
|
||||
normalizerOn: function (){
|
||||
normalizerOn: function () {
|
||||
},
|
||||
normalizerOff: function (){
|
||||
CiderAudio.audioNodes.gainNode.gain.setTargetAtTime(1, CiderAudio.context.currentTime+ 1, 0.5);
|
||||
normalizerOff: function () {
|
||||
CiderAudio.audioNodes.gainNode.gain.setTargetAtTime(1, CiderAudio.context.currentTime + 1, 0.5);
|
||||
},
|
||||
spatialProfiles: [
|
||||
{
|
||||
"id": "420signature",
|
||||
"file": './audio/impulses/CiderSpatial_v69.420_Audiophile.wav',
|
||||
"name": "Signature (Classic)",
|
||||
"description": "",
|
||||
},
|
||||
{
|
||||
"id": "420signature-B",
|
||||
"file": './audio/impulses/CiderSpatial_v69.420_Audiophile_B.wav',
|
||||
"name": "Signature (Focused)",
|
||||
"description": "",
|
||||
},
|
||||
{
|
||||
"id": "standard",
|
||||
"file": './audio/impulses/CiderSpatial_v69_Standard.wav',
|
||||
"name": "Minimal",
|
||||
"description": "",
|
||||
},
|
||||
{
|
||||
"id": "audiophile",
|
||||
"file": './audio/impulses/CiderSpatial_v69_Audiophile.wav'
|
||||
"file": './audio/impulses/CiderSpatial_v69_Audiophile.wav',
|
||||
"name": "Expansive",
|
||||
"description": "",
|
||||
}
|
||||
],
|
||||
spatialOn: function (){
|
||||
spatialOn: function () {
|
||||
CiderAudio.audioNodes.spatialNode = null;
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.spatialNode = CiderAudio.context.createConvolver();
|
||||
CiderAudio.audioNodes.spatialNode.normalize = false;
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.spatialNode = CiderAudio.context.createConvolver();
|
||||
CiderAudio.audioNodes.spatialNode.normalize = false;
|
||||
|
||||
let spatialProfile = CiderAudio.spatialProfiles.find(function (profile) {
|
||||
return profile.id === app.cfg.audio.maikiwiAudio.spatialProfile;
|
||||
});
|
||||
let spatialProfile = CiderAudio.spatialProfiles.find(function (profile) {
|
||||
return profile.id === app.cfg.audio.maikiwiAudio.spatialProfile;
|
||||
});
|
||||
|
||||
if (spatialProfile === undefined) {
|
||||
spatialProfile = CiderAudio.spatialProfiles[0];
|
||||
}
|
||||
fetch(spatialProfile.file).then(async (impulseData) => {
|
||||
let bufferedImpulse = await impulseData.arrayBuffer();
|
||||
CiderAudio.audioNodes.spatialNode.buffer = await CiderAudio.context.decodeAudioData(bufferedImpulse);
|
||||
});
|
||||
|
||||
if (spatialProfile === undefined) {
|
||||
spatialProfile = CiderAudio.spatialProfiles[0];
|
||||
}
|
||||
fetch(spatialProfile.file).then(async (impulseData) => {
|
||||
let bufferedImpulse = await impulseData.arrayBuffer();
|
||||
CiderAudio.audioNodes.spatialNode.buffer = await CiderAudio.context.decodeAudioData(bufferedImpulse);});
|
||||
|
||||
}
|
||||
else {
|
||||
CiderAudio.audioNodes.spatialNode = new ResonanceAudio(CiderAudio.context);
|
||||
|
@ -117,12 +127,13 @@ const CiderAudio = {
|
|||
up: 'acoustic-ceiling-tiles',
|
||||
};
|
||||
CiderAudio.audioNodes.spatialNode.setRoomProperties(roomDimensions, roomMaterials);
|
||||
CiderAudio.audioNodes.spatialInput = CiderAudio.audioNodes.spatialNode.createSource();}
|
||||
},
|
||||
spatialOff: function (){
|
||||
CiderAudio.audioNodes.spatialInput = CiderAudio.audioNodes.spatialNode.createSource();
|
||||
}
|
||||
},
|
||||
spatialOff: function () {
|
||||
CiderAudio.hierarchical_loading();
|
||||
},
|
||||
sendAudio: function (){
|
||||
sendAudio: function () {
|
||||
if (!CiderAudio.ccON) {
|
||||
CiderAudio.ccON = true
|
||||
let searchInt = setInterval(async function () {
|
||||
|
@ -241,61 +252,64 @@ const CiderAudio = {
|
|||
registerProcessor('recorder-worklet', RecorderWorkletProcessor);`
|
||||
let blob = new Blob([worklet], { type: 'application/javascript' });
|
||||
await CiderAudio.context.audioWorklet.addModule(URL.createObjectURL(blob))
|
||||
.then(() => {
|
||||
|
||||
const channels = 2;
|
||||
CiderAudio.audioNodes.recorderNode = new window.AudioWorkletNode(CiderAudio.context,
|
||||
'recorder-worklet',
|
||||
{ parameterData: { numberOfChannels: channels } });
|
||||
CiderAudio.audioNodes.recorderNode.port.onmessage = (e) => {
|
||||
const data = e.data;
|
||||
switch (data.eventType) {
|
||||
case "data":
|
||||
const audioData = data.audioBuffer;
|
||||
const bufferSize = data.bufferSize;
|
||||
if((audioData[0]).some(item => item !== 0) || (audioData[0]).some(item => item !== 0)){
|
||||
ipcRenderer.send('writeWAV', audioData[0], audioData[1], bufferSize);}
|
||||
break;
|
||||
case "stop":
|
||||
break;
|
||||
}
|
||||
}
|
||||
CiderAudio.audioNodes.recorderNode.parameters.get('isRecording').setValueAtTime(1, CiderAudio.context.currentTime);
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.recorderNode);
|
||||
.then(() => {
|
||||
|
||||
});
|
||||
const channels = 2;
|
||||
CiderAudio.audioNodes.recorderNode = new window.AudioWorkletNode(CiderAudio.context,
|
||||
'recorder-worklet',
|
||||
{ parameterData: { numberOfChannels: channels } });
|
||||
CiderAudio.audioNodes.recorderNode.port.onmessage = (e) => {
|
||||
const data = e.data;
|
||||
switch (data.eventType) {
|
||||
case "data":
|
||||
const audioData = data.audioBuffer;
|
||||
const bufferSize = data.bufferSize;
|
||||
if ((audioData[0]).some(item => item !== 0) || (audioData[0]).some(item => item !== 0)) {
|
||||
ipcRenderer.send('writeWAV', audioData[0], audioData[1], bufferSize);
|
||||
}
|
||||
break;
|
||||
case "stop":
|
||||
break;
|
||||
}
|
||||
}
|
||||
CiderAudio.audioNodes.recorderNode.parameters.get('isRecording').setValueAtTime(1, CiderAudio.context.currentTime);
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.recorderNode);
|
||||
|
||||
});
|
||||
clearInterval(searchInt);
|
||||
}
|
||||
}, 1000);
|
||||
} else {if (CiderAudio.audioNodes.recorderNode != null && CiderAudio.context != null) {
|
||||
CiderAudio.audioNodes.recorderNode.parameters.get('isRecording').setValueAtTime(1, CiderAudio.context.currentTime);
|
||||
// CiderAudio.audioNodes.recorderNode = null;
|
||||
// CiderAudio.ccON = false;
|
||||
}}
|
||||
|
||||
} else {
|
||||
if (CiderAudio.audioNodes.recorderNode != null && CiderAudio.context != null) {
|
||||
CiderAudio.audioNodes.recorderNode.parameters.get('isRecording').setValueAtTime(1, CiderAudio.context.currentTime);
|
||||
// CiderAudio.audioNodes.recorderNode = null;
|
||||
// CiderAudio.ccON = false;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
stopAudio(){
|
||||
stopAudio() {
|
||||
if (CiderAudio.audioNodes.recorderNode != null && CiderAudio.context != null) {
|
||||
CiderAudio.audioNodes.recorderNode.parameters.get('isRecording').setValueAtTime(0, CiderAudio.context.currentTime);
|
||||
// CiderAudio.audioNodes.recorderNode = null;
|
||||
// CiderAudio.ccON = false;
|
||||
}
|
||||
},
|
||||
analogWarmth_h2_3: function (status, hierarchy){
|
||||
analogWarmth_h2_3: function (status, hierarchy) {
|
||||
if (status === true) { // 23 Band Adjustment
|
||||
let WARMTH_FREQUENCIES = [10.513, 15.756, 224.01, 677.77, 1245.4, 2326.8, 2847.3, 4215.3, 11057, 12793, 16235, 16235, 17838, 18112, 18112, 19326, 19372, 19372, 20061, 20280, 20280, 20853, 22276];
|
||||
let WARMTH_GAIN = [-4.81, 0.74, 0.55, -0.84, -1.52, 0.84, 0.66, -0.29, 0.29, 0.94, 1.67, 1.62, -0.53, -0.81, -4.98, 1.43, 0.86, 1.13, -1.06, -0.95, -1.13, 1.78, -3.86];
|
||||
let WARMTH_Q = [0.442, 3.536, 2.102, 8.409, 0.625, 16.82, 5, 2.973, 3.536, 2.5, 2.5, 11.89, 0.625, 1.487, 1.153, 5, 5.453, 5, 2.973, 3.386, 3.386, 14.14, 8.409];
|
||||
CiderAudio.audioNodes.analogWarmth = []
|
||||
|
||||
switch (app.cfg.audio.maikiwiAudio.analogWarmth_value) {
|
||||
|
||||
switch (app.cfg.audio.maikiwiAudio.analogWarmth_value) {
|
||||
case "SMOOTH":
|
||||
for (let i = 0; i < WARMTH_FREQUENCIES.length; i++) {
|
||||
CiderAudio.audioNodes.analogWarmth[i] = CiderAudio.context.createBiquadFilter();
|
||||
CiderAudio.audioNodes.analogWarmth[i].type = 'peaking'; // 'peaking';
|
||||
CiderAudio.audioNodes.analogWarmth[i].frequency.value = WARMTH_FREQUENCIES[i];
|
||||
CiderAudio.audioNodes.analogWarmth[i].Q.value = WARMTH_Q[i];
|
||||
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.25;
|
||||
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.25;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -305,7 +319,7 @@ const CiderAudio = {
|
|||
CiderAudio.audioNodes.analogWarmth[i].type = 'peaking'; // 'peaking';
|
||||
CiderAudio.audioNodes.analogWarmth[i].frequency.value = WARMTH_FREQUENCIES[i];
|
||||
CiderAudio.audioNodes.analogWarmth[i].Q.value = WARMTH_Q[i];
|
||||
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.75;
|
||||
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.75;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -315,40 +329,43 @@ const CiderAudio = {
|
|||
CiderAudio.audioNodes.analogWarmth[i].type = 'peaking'; // 'peaking';
|
||||
CiderAudio.audioNodes.analogWarmth[i].frequency.value = WARMTH_FREQUENCIES[i];
|
||||
CiderAudio.audioNodes.analogWarmth[i].Q.value = WARMTH_Q[i];
|
||||
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.25;
|
||||
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.25;
|
||||
}
|
||||
app.cfg.audio.maikiwiAudio.analogWarmth_value = "SMOOTH";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
for (let i = 1; i < WARMTH_FREQUENCIES.length; i ++) {
|
||||
CiderAudio.audioNodes.analogWarmth[i-1].connect(CiderAudio.audioNodes.analogWarmth[i]);
|
||||
|
||||
|
||||
for (let i = 1; i < WARMTH_FREQUENCIES.length; i++) {
|
||||
CiderAudio.audioNodes.analogWarmth[i - 1].connect(CiderAudio.audioNodes.analogWarmth[i]);
|
||||
}
|
||||
|
||||
switch (hierarchy) {
|
||||
switch (hierarchy) {
|
||||
case 3:
|
||||
try{
|
||||
CiderAudio.audioNodes.analogWarmth[WARMTH_FREQUENCIES.length-1].connect(CiderAudio.audioNodes.llpw[0]);} catch(e){}
|
||||
try {
|
||||
CiderAudio.audioNodes.analogWarmth[WARMTH_FREQUENCIES.length - 1].connect(CiderAudio.audioNodes.llpw[0]);
|
||||
} catch (e) { }
|
||||
break;
|
||||
case 2:
|
||||
try{
|
||||
CiderAudio.audioNodes.analogWarmth[WARMTH_FREQUENCIES.length-1].connect(CiderAudio.audioNodes.vibrantbassNode[0]);} catch(e){}
|
||||
try {
|
||||
CiderAudio.audioNodes.analogWarmth[WARMTH_FREQUENCIES.length - 1].connect(CiderAudio.audioNodes.vibrantbassNode[0]);
|
||||
} catch (e) { }
|
||||
break;
|
||||
case 1:
|
||||
try{
|
||||
CiderAudio.audioNodes.analogWarmth[WARMTH_FREQUENCIES.length-1].connect(CiderAudio.audioNodes.audioBands[0]);} catch(e){}
|
||||
try {
|
||||
CiderAudio.audioNodes.analogWarmth[WARMTH_FREQUENCIES.length - 1].connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
} catch (e) { }
|
||||
break;
|
||||
case 0:
|
||||
try{CiderAudio.audioNodes.analogWarmth[WARMTH_FREQUENCIES.length-1].connect(CiderAudio.context.destination);} catch(e){}
|
||||
case 0:
|
||||
try { CiderAudio.audioNodes.analogWarmth[WARMTH_FREQUENCIES.length - 1].connect(CiderAudio.context.destination); } catch (e) { }
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
llpw_h2_2: function (status, hierarchy){
|
||||
if (status === true) {
|
||||
llpw_h2_2: function (status, hierarchy) {
|
||||
if (status === true) {
|
||||
let c_LLPW_Q = [1.250, 0.131, 10, 2.5, 2.293, 0.110, 14.14, 1.552, 28.28, 7.071, 2.847, 5, 0.625, 7.071, 3.856, 3.856, 20, 28.28, 20, 14.14, 2.102, 6.698, 3.536, 10];
|
||||
let c_LLPW_GAIN = [-0.11, 0.27, -0.8, 0.57, 1.84, -0.38, 0.47, -1.56, 0.83, 1.58, -1.79, -0.45, 0.48, 1.22, -1.58, -1.59, -2.03, 2.56, -2.2, -2.48, 4.75, 10.5, 1.43, 3.76];
|
||||
let c_LLPW_FREQUENCIES = [400.83, 5812.8, 8360, 10413, 10658, 12079, 12899, 13205, 14848, 15591, 15778, 15783, 16716, 16891, 17255, 17496, 18555, 18622, 19219, 19448, 19664, 21341, 21353, 22595];
|
||||
|
@ -356,26 +373,27 @@ const CiderAudio = {
|
|||
let LLPW_GAIN = [0.38, -1.81, -0.23, -0.51, 0.4, 0.84, 0.36, -0.34, 0.27, -1.2, -0.42, -0.67, 0.81, 1.31, -0.71, 0.68, -1.04, 0.79, -0.73, -1.33, 1.17, 0.57, 0.35, 6.33];
|
||||
let LLPW_FREQUENCIES = [16.452, 24.636, 37.134, 74.483, 159.54, 308.18, 670.21, 915.81, 1200.7, 2766.4, 2930.6, 4050.6, 4409.1, 5395.2, 5901.6, 6455.5, 7164.1, 7724.1, 8449, 10573, 12368, 14198, 17910, 18916];
|
||||
CiderAudio.audioNodes.llpw = []
|
||||
|
||||
switch (app.cfg.audio.maikiwiAudio.ciderPPE_value) {
|
||||
case "NATURAL":
|
||||
|
||||
switch (app.cfg.audio.maikiwiAudio.ciderPPE_value) {
|
||||
case "NATURAL":
|
||||
CiderAudio.audioNodes.llpw[0] = CiderAudio.context.createConvolver();
|
||||
CiderAudio.audioNodes.llpw[0].normalize = false;
|
||||
fetch('./audio/impulses/CAP_Natural.wav').then(async (impulseData) => {
|
||||
let bufferedImpulse = await impulseData.arrayBuffer();
|
||||
CiderAudio.audioNodes.llpw[0].buffer = await CiderAudio.context.decodeAudioData(bufferedImpulse);});
|
||||
let bufferedImpulse = await impulseData.arrayBuffer();
|
||||
CiderAudio.audioNodes.llpw[0].buffer = await CiderAudio.context.decodeAudioData(bufferedImpulse);
|
||||
});
|
||||
|
||||
switch (hierarchy) {
|
||||
case 2:
|
||||
try{CiderAudio.audioNodes.llpw[0].connect(CiderAudio.audioNodes.vibrantbassNode[0]);} catch(e){}
|
||||
switch (hierarchy) {
|
||||
case 2:
|
||||
try { CiderAudio.audioNodes.llpw[0].connect(CiderAudio.audioNodes.vibrantbassNode[0]); } catch (e) { }
|
||||
break;
|
||||
case 1:
|
||||
try{CiderAudio.audioNodes.llpw[0].connect(CiderAudio.audioNodes.audioBands[0]);} catch(e){}
|
||||
try { CiderAudio.audioNodes.llpw[0].connect(CiderAudio.audioNodes.audioBands[0]); } catch (e) { }
|
||||
break;
|
||||
case 0:
|
||||
try{CiderAudio.audioNodes.llpw[0].connect(CiderAudio.context.destination);} catch(e){}
|
||||
case 0:
|
||||
try { CiderAudio.audioNodes.llpw[0].connect(CiderAudio.context.destination); } catch (e) { }
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
console.debug("[Cider][Audio] CAP - Natural Mode");
|
||||
|
@ -387,23 +405,23 @@ const CiderAudio = {
|
|||
CiderAudio.audioNodes.llpw[i].type = 'peaking'; // 'peaking';
|
||||
CiderAudio.audioNodes.llpw[i].frequency.value = LLPW_FREQUENCIES[i];
|
||||
CiderAudio.audioNodes.llpw[i].Q.value = LLPW_Q[i];
|
||||
CiderAudio.audioNodes.llpw[i].gain.value = LLPW_GAIN[i];
|
||||
CiderAudio.audioNodes.llpw[i].gain.value = LLPW_GAIN[i];
|
||||
}
|
||||
for (let i = 1; i < LLPW_FREQUENCIES.length; i++) {
|
||||
CiderAudio.audioNodes.llpw[i - 1].connect(CiderAudio.audioNodes.llpw[i]);
|
||||
}
|
||||
for (let i = 1; i < LLPW_FREQUENCIES.length; i ++) {
|
||||
CiderAudio.audioNodes.llpw[i-1].connect(CiderAudio.audioNodes.llpw[i]);
|
||||
}
|
||||
|
||||
switch (hierarchy) {
|
||||
case 2:
|
||||
try{CiderAudio.audioNodes.llpw[LLPW_FREQUENCIES.length-1].connect(CiderAudio.audioNodes.vibrantbassNode[0]);} catch(e){}
|
||||
switch (hierarchy) {
|
||||
case 2:
|
||||
try { CiderAudio.audioNodes.llpw[LLPW_FREQUENCIES.length - 1].connect(CiderAudio.audioNodes.vibrantbassNode[0]); } catch (e) { }
|
||||
break;
|
||||
case 1:
|
||||
try{CiderAudio.audioNodes.llpw[LLPW_FREQUENCIES.length-1].connect(CiderAudio.audioNodes.audioBands[0]);} catch(e){}
|
||||
try { CiderAudio.audioNodes.llpw[LLPW_FREQUENCIES.length - 1].connect(CiderAudio.audioNodes.audioBands[0]); } catch (e) { }
|
||||
break;
|
||||
case 0:
|
||||
try{CiderAudio.audioNodes.llpw[LLPW_FREQUENCIES.length-1].connect(CiderAudio.context.destination);} catch(e){}
|
||||
case 0:
|
||||
try { CiderAudio.audioNodes.llpw[LLPW_FREQUENCIES.length - 1].connect(CiderAudio.context.destination); } catch (e) { }
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
console.debug("[Cider][Audio] CAP - Classic Mode");
|
||||
|
@ -415,61 +433,62 @@ const CiderAudio = {
|
|||
CiderAudio.audioNodes.llpw[i].type = 'peaking'; // 'peaking';
|
||||
CiderAudio.audioNodes.llpw[i].frequency.value = c_LLPW_FREQUENCIES[i];
|
||||
CiderAudio.audioNodes.llpw[i].Q.value = c_LLPW_Q[i];
|
||||
CiderAudio.audioNodes.llpw[i].gain.value = c_LLPW_GAIN[i];
|
||||
}
|
||||
for (let i = 1; i < c_LLPW_FREQUENCIES.length; i ++) {
|
||||
CiderAudio.audioNodes.llpw[i-1].connect(CiderAudio.audioNodes.llpw[i]);
|
||||
}
|
||||
CiderAudio.audioNodes.llpw[i].gain.value = c_LLPW_GAIN[i];
|
||||
}
|
||||
for (let i = 1; i < c_LLPW_FREQUENCIES.length; i++) {
|
||||
CiderAudio.audioNodes.llpw[i - 1].connect(CiderAudio.audioNodes.llpw[i]);
|
||||
}
|
||||
|
||||
switch (hierarchy) {
|
||||
case 2:
|
||||
try{CiderAudio.audioNodes.llpw[c_LLPW_FREQUENCIES.length-1].connect(CiderAudio.audioNodes.vibrantbassNode[0]);} catch(e){}
|
||||
switch (hierarchy) {
|
||||
case 2:
|
||||
try { CiderAudio.audioNodes.llpw[c_LLPW_FREQUENCIES.length - 1].connect(CiderAudio.audioNodes.vibrantbassNode[0]); } catch (e) { }
|
||||
break;
|
||||
case 1:
|
||||
try{CiderAudio.audioNodes.llpw[c_LLPW_FREQUENCIES.length-1].connect(CiderAudio.audioNodes.audioBands[0]);} catch(e){}
|
||||
try { CiderAudio.audioNodes.llpw[c_LLPW_FREQUENCIES.length - 1].connect(CiderAudio.audioNodes.audioBands[0]); } catch (e) { }
|
||||
break;
|
||||
case 0:
|
||||
try{CiderAudio.audioNodes.llpw[c_LLPW_FREQUENCIES.length-1].connect(CiderAudio.context.destination);} catch(e){}
|
||||
case 0:
|
||||
try { CiderAudio.audioNodes.llpw[c_LLPW_FREQUENCIES.length - 1].connect(CiderAudio.context.destination); } catch (e) { }
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
console.debug("[Cider][Audio] CAP - Clarity Mode");
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
CiderAudio.audioNodes.llpw[0] = CiderAudio.context.createConvolver();
|
||||
CiderAudio.audioNodes.llpw[0].normalize = false;
|
||||
fetch('./audio/impulses/CAP_Natural.wav').then(async (impulseData) => {
|
||||
let bufferedImpulse = await impulseData.arrayBuffer();
|
||||
CiderAudio.audioNodes.llpw[0].buffer = await CiderAudio.context.decodeAudioData(bufferedImpulse);});
|
||||
let bufferedImpulse = await impulseData.arrayBuffer();
|
||||
CiderAudio.audioNodes.llpw[0].buffer = await CiderAudio.context.decodeAudioData(bufferedImpulse);
|
||||
});
|
||||
|
||||
switch (hierarchy) {
|
||||
case 2:
|
||||
try{CiderAudio.audioNodes.llpw[0].connect(CiderAudio.audioNodes.vibrantbassNode[0]);} catch(e){}
|
||||
switch (hierarchy) {
|
||||
case 2:
|
||||
try { CiderAudio.audioNodes.llpw[0].connect(CiderAudio.audioNodes.vibrantbassNode[0]); } catch (e) { }
|
||||
break;
|
||||
case 1:
|
||||
try{CiderAudio.audioNodes.llpw[0].connect(CiderAudio.audioNodes.audioBands[0]);} catch(e){}
|
||||
try { CiderAudio.audioNodes.llpw[0].connect(CiderAudio.audioNodes.audioBands[0]); } catch (e) { }
|
||||
break;
|
||||
case 0:
|
||||
try{CiderAudio.audioNodes.llpw[0].connect(CiderAudio.context.destination);} catch(e){}
|
||||
case 0:
|
||||
try { CiderAudio.audioNodes.llpw[0].connect(CiderAudio.context.destination); } catch (e) { }
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
app.cfg.audio.maikiwiAudio.ciderPPE_value = "NATURAL";
|
||||
console.debug("[Cider][Audio] CAP - Natural Mode (Defaulted from broki config)");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
vibrantbass_h2_1: function (status, hierarchy){
|
||||
if (status === true) {
|
||||
vibrantbass_h2_1: function (status, hierarchy) {
|
||||
if (status === true) {
|
||||
let VIBRANTBASSBANDS = app.cfg.audio.maikiwiAudio.vibrantBass.frequencies;
|
||||
let VIBRANTBASSGAIN = app.cfg.audio.maikiwiAudio.vibrantBass.gain;
|
||||
let VIBRANTBASSQ = app.cfg.audio.maikiwiAudio.vibrantBass.Q;
|
||||
CiderAudio.audioNodes.vibrantbassNode = []
|
||||
|
||||
|
||||
for (let i = 0; i < VIBRANTBASSBANDS.length; i++) {
|
||||
CiderAudio.audioNodes.vibrantbassNode[i] = CiderAudio.context.createBiquadFilter();
|
||||
CiderAudio.audioNodes.vibrantbassNode[i].type = 'peaking'; // 'peaking';
|
||||
|
@ -478,58 +497,59 @@ const CiderAudio = {
|
|||
CiderAudio.audioNodes.vibrantbassNode[i].gain.value = VIBRANTBASSGAIN[i] * (app.cfg.audio.equalizer.vibrantBass / 10);
|
||||
}
|
||||
|
||||
for (let i = 1; i < VIBRANTBASSBANDS.length; i ++) {
|
||||
CiderAudio.audioNodes.vibrantbassNode[i-1].connect(CiderAudio.audioNodes.vibrantbassNode[i]);
|
||||
for (let i = 1; i < VIBRANTBASSBANDS.length; i++) {
|
||||
CiderAudio.audioNodes.vibrantbassNode[i - 1].connect(CiderAudio.audioNodes.vibrantbassNode[i]);
|
||||
}
|
||||
|
||||
switch (hierarchy) {
|
||||
case 0:
|
||||
try{
|
||||
CiderAudio.audioNodes.vibrantbassNode[0].connect(CiderAudio.context.destination);} catch(e){}
|
||||
switch (hierarchy) {
|
||||
case 0:
|
||||
try {
|
||||
CiderAudio.audioNodes.vibrantbassNode[0].connect(CiderAudio.context.destination);
|
||||
} catch (e) { }
|
||||
break;
|
||||
case 1:
|
||||
try{CiderAudio.audioNodes.vibrantbassNode[0].connect(CiderAudio.audioNodes.audioBands[0]);} catch(e){}
|
||||
try { CiderAudio.audioNodes.vibrantbassNode[0].connect(CiderAudio.audioNodes.audioBands[0]); } catch (e) { }
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
hierarchical_unloading: function (){
|
||||
try {CiderAudio.audioNodes.spatialNode.output.disconnect();} catch(e){}
|
||||
try {CiderAudio.audioNodes.spatialNode.disconnect();} catch(e){}
|
||||
try {CiderAudio.audioNodes.gainNode.disconnect();} catch(e){}
|
||||
try {for (var i of CiderAudio.audioNodes.analogWarmth){i.disconnect();} CiderAudio.audioNodes.analogWarmth = null} catch(e){}
|
||||
try {for (var i of CiderAudio.audioNodes.llpw){i.disconnect();} CiderAudio.audioNodes.llpw = null} catch(e){}
|
||||
try {for (var i of CiderAudio.audioNodes.vibrantbassNode){i.disconnect();} CiderAudio.audioNodes.vibrantbassNode = null} catch(e){}
|
||||
try {for (var i of CiderAudio.audioNodes.audioBands) {i.disconnect();} CiderAudio.audioNodes.audioBands = null} catch(e){}
|
||||
hierarchical_unloading: function () {
|
||||
try { CiderAudio.audioNodes.spatialNode.output.disconnect(); } catch (e) { }
|
||||
try { CiderAudio.audioNodes.spatialNode.disconnect(); } catch (e) { }
|
||||
try { CiderAudio.audioNodes.gainNode.disconnect(); } catch (e) { }
|
||||
try { for (var i of CiderAudio.audioNodes.analogWarmth) { i.disconnect(); } CiderAudio.audioNodes.analogWarmth = null } catch (e) { }
|
||||
try { for (var i of CiderAudio.audioNodes.llpw) { i.disconnect(); } CiderAudio.audioNodes.llpw = null } catch (e) { }
|
||||
try { for (var i of CiderAudio.audioNodes.vibrantbassNode) { i.disconnect(); } CiderAudio.audioNodes.vibrantbassNode = null } catch (e) { }
|
||||
try { for (var i of CiderAudio.audioNodes.audioBands) { i.disconnect(); } CiderAudio.audioNodes.audioBands = null } catch (e) { }
|
||||
|
||||
console.debug("[Cider][Audio] Finished hierarchical unloading");
|
||||
|
||||
|
||||
},
|
||||
hierarchical_loading: function (){
|
||||
hierarchical_loading: function () {
|
||||
CiderAudio.hierarchical_unloading();
|
||||
|
||||
|
||||
if (Math.max(...app.cfg.audio.equalizer.gain) != 0) {
|
||||
CiderAudio.equalizer(true, 0);
|
||||
|
||||
if (app.cfg.audio.equalizer.vibrantBass !== '0') {
|
||||
if (app.cfg.audio.equalizer.vibrantBass !== '0') {
|
||||
CiderAudio.vibrantbass_h2_1(true, 1);
|
||||
|
||||
|
||||
if (app.cfg.audio.maikiwiAudio.ciderPPE === true) { // Vibrant Bass, CAP
|
||||
CiderAudio.llpw_h2_2(true, 2);
|
||||
|
||||
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) { // Vibrant Bass, CAP, Analog Warmth
|
||||
CiderAudio.analogWarmth_h2_3(true, 3);
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) { // Vibrant Bass, CAP, Analog Warmth, Maikiwi Spatial
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.debug('[Cider][Audio] Equalizer, Vibrant Bass, CAP, Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else { // Vibrant Bass, CAP, Analog Warmth, Spatial
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.debug('[Cider][Audio] Equalizer, Vibrant Bass, CAP, Analog Warmth, Spatial')
|
||||
|
@ -543,7 +563,7 @@ const CiderAudio = {
|
|||
}
|
||||
else {
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
app.cfg.audio.normalization = true
|
||||
|
@ -563,17 +583,17 @@ const CiderAudio = {
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) {
|
||||
CiderAudio.analogWarmth_h2_3(true, 2);
|
||||
app.cfg.audio.normalization = true;
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.debug('[Cider][Audio] Equalizer, Vibrant Bass, Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.debug('[Cider][Audio] Equalizer, Vibrant Bass, Analog Warmth, Spatial')
|
||||
|
@ -586,8 +606,8 @@ const CiderAudio = {
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.vibrantbassNode[0]);
|
||||
|
@ -599,7 +619,7 @@ const CiderAudio = {
|
|||
console.debug('[Cider][Audio] Equalizer, Vibrant Bass, Spatial')
|
||||
}
|
||||
}
|
||||
else {
|
||||
else {
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.vibrantbassNode[0]);
|
||||
console.debug('[Cider][Audio] Equalizer, Vibrant Bass')
|
||||
|
@ -611,15 +631,15 @@ const CiderAudio = {
|
|||
else { // if (app.cfg.audio.maikiwiAudio.vibrantBass.multiplier) === 0
|
||||
if (app.cfg.audio.maikiwiAudio.ciderPPE === true) {
|
||||
CiderAudio.llpw_h2_2(true, 1);
|
||||
|
||||
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) {
|
||||
CiderAudio.analogWarmth_h2_3(true, 3);
|
||||
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
console.debug('[Cider][Audio] Equalizer, CAP, Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
|
@ -635,10 +655,10 @@ const CiderAudio = {
|
|||
}
|
||||
else {
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
console.debug('[Cider][Audio] Equalizer, CAP, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
|
@ -656,12 +676,12 @@ const CiderAudio = {
|
|||
else {
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) {
|
||||
CiderAudio.analogWarmth_h2_3(true, 1);
|
||||
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
console.debug('[Cider][Audio] Equalizer, Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
|
@ -677,10 +697,10 @@ const CiderAudio = {
|
|||
}
|
||||
else {
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
console.debug('[Cider][Audio] Equalizer, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
|
@ -690,7 +710,7 @@ const CiderAudio = {
|
|||
}
|
||||
}
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
console.debug('[Cider][Audio] Equalizer')
|
||||
}
|
||||
}
|
||||
|
@ -700,22 +720,22 @@ const CiderAudio = {
|
|||
else { //if (Math.max(...app.cfg.audio.equalizer.gain) == 0)
|
||||
if (app.cfg.audio.equalizer.vibrantBass !== '0') { // Vibrant Bass
|
||||
CiderAudio.vibrantbass_h2_1(true, 0)
|
||||
|
||||
|
||||
if (app.cfg.audio.maikiwiAudio.ciderPPE === true) { // Vibrant Bass, CAP
|
||||
CiderAudio.llpw_h2_2(true, 2);
|
||||
|
||||
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) { // Vibrant Bass, CAP, Analog Warmth
|
||||
CiderAudio.analogWarmth_h2_3(true, 3);
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) { // Vibrant Bass, CAP, Analog Warmth, Maikiwi Spatial
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.debug('[Cider][Audio] Vibrant Bass, CAP, Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else { // Vibrant Bass, CAP, Analog Warmth, Spatial
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.debug('[Cider][Audio] Vibrant Bass, CAP, Analog Warmth, Spatial')
|
||||
|
@ -729,7 +749,7 @@ const CiderAudio = {
|
|||
}
|
||||
else { // if (app.cfg.audio.maikiwiAudio.analogWarmth) !== true
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
app.cfg.audio.normalization = true
|
||||
|
@ -749,17 +769,17 @@ const CiderAudio = {
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) {
|
||||
CiderAudio.analogWarmth_h2_3(true, 2);
|
||||
app.cfg.audio.normalization = true;
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.debug('[Cider][Audio] Vibrant Bass, Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialInput.input);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
console.debug('[Cider][Audio] Vibrant Bass, Analog Warmth, Spatial')
|
||||
|
@ -772,8 +792,8 @@ const CiderAudio = {
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.vibrantbassNode[0]);
|
||||
|
@ -785,7 +805,7 @@ const CiderAudio = {
|
|||
console.debug('[Cider][Audio] Vibrant Bass, Spatial')
|
||||
}
|
||||
}
|
||||
else {
|
||||
else {
|
||||
app.cfg.audio.normalization = true;
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.vibrantbassNode[0]);
|
||||
console.debug('[Cider][Audio] Vibrant Bass')
|
||||
|
@ -795,17 +815,17 @@ const CiderAudio = {
|
|||
}
|
||||
// Vibrant Bass ends here
|
||||
else {
|
||||
if (app.cfg.audio.maikiwiAudio.ciderPPE === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.ciderPPE === true) {
|
||||
CiderAudio.llpw_h2_2(true, 0);
|
||||
|
||||
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) {
|
||||
CiderAudio.analogWarmth_h2_3(true, 3);
|
||||
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
console.debug('[Cider][Audio] CAP, Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
|
@ -821,10 +841,10 @@ const CiderAudio = {
|
|||
}
|
||||
else {
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.llpw[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
console.debug('[Cider][Audio] CAP, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
|
@ -842,12 +862,12 @@ const CiderAudio = {
|
|||
else {
|
||||
if (app.cfg.audio.maikiwiAudio.analogWarmth === true) {
|
||||
CiderAudio.analogWarmth_h2_3(true, 0);
|
||||
|
||||
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.analogWarmth[0]);
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
console.debug('[Cider][Audio] Analog Warmth, Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
|
@ -863,10 +883,10 @@ const CiderAudio = {
|
|||
}
|
||||
else {
|
||||
if (app.cfg.audio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
if (app.cfg.audio.maikiwiAudio.spatial === true) {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.spatialNode);
|
||||
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.context.destination);
|
||||
app.cfg.audio.normalization = true;
|
||||
app.cfg.audio.normalization = true;
|
||||
console.debug('[Cider][Audio] Maikiwi Spatial')
|
||||
}
|
||||
else {
|
||||
|
@ -876,7 +896,7 @@ const CiderAudio = {
|
|||
}
|
||||
}
|
||||
else {
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.context.destination);
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.context.destination);
|
||||
console.debug('[Cider][Audio] Literal Nothing')
|
||||
}
|
||||
}
|
||||
|
@ -884,16 +904,16 @@ const CiderAudio = {
|
|||
}
|
||||
}
|
||||
console.debug("[Cider][Audio] Finished hierarchical loading");
|
||||
|
||||
|
||||
},
|
||||
|
||||
equalizer: function (status, hierarchy){ // h1_1
|
||||
if (status === true) {
|
||||
equalizer: function (status, hierarchy) { // h1_1
|
||||
if (status === true) {
|
||||
let BANDS = app.cfg.audio.equalizer.frequencies;
|
||||
let GAIN = app.cfg.audio.equalizer.gain;
|
||||
let Q = app.cfg.audio.equalizer.Q;
|
||||
|
||||
CiderAudio.audioNodes.audioBands = [];
|
||||
CiderAudio.audioNodes.audioBands = [];
|
||||
for (let i = 0; i < BANDS.length; i++) {
|
||||
CiderAudio.audioNodes.audioBands[i] = CiderAudio.context.createBiquadFilter();
|
||||
CiderAudio.audioNodes.audioBands[i].type = 'peaking'; // 'peaking';
|
||||
|
@ -901,19 +921,20 @@ const CiderAudio = {
|
|||
CiderAudio.audioNodes.audioBands[i].Q.value = Q[i];
|
||||
CiderAudio.audioNodes.audioBands[i].gain.value = GAIN[i] * app.cfg.audio.equalizer.mix;
|
||||
}
|
||||
|
||||
for (let i = 1; i < BANDS.length; i ++) {
|
||||
CiderAudio.audioNodes.audioBands[i-1].connect(CiderAudio.audioNodes.audioBands[i]);
|
||||
}
|
||||
|
||||
switch (hierarchy) {
|
||||
case 0:
|
||||
try{
|
||||
CiderAudio.audioNodes.audioBands[BANDS.length-1].connect(CiderAudio.context.destination);} catch(e){}
|
||||
break;
|
||||
}
|
||||
|
||||
for (let i = 1; i < BANDS.length; i++) {
|
||||
CiderAudio.audioNodes.audioBands[i - 1].connect(CiderAudio.audioNodes.audioBands[i]);
|
||||
}
|
||||
|
||||
switch (hierarchy) {
|
||||
case 0:
|
||||
try {
|
||||
CiderAudio.audioNodes.audioBands[BANDS.length - 1].connect(CiderAudio.context.destination);
|
||||
} catch (e) { }
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
export {CiderAudio}
|
||||
export { CiderAudio }
|
Loading…
Add table
Add a link
Reference in a new issue