hide ui and remove audio effects/monitoring
This commit is contained in:
parent
64af8d49d1
commit
6aba91b6ca
4 changed files with 39 additions and 15 deletions
|
@ -290,6 +290,7 @@
|
||||||
<!--<div class="move">move</div>-->
|
<!--<div class="move">move</div>-->
|
||||||
<!--</div>-->
|
<!--</div>-->
|
||||||
<button id="midi_open">midi</button>
|
<button id="midi_open">midi</button>
|
||||||
|
<button id="hide_ui">hide ui</button>
|
||||||
<button id="exporter_open">export</button>
|
<button id="exporter_open">export</button>
|
||||||
<button id="save_project" onclick="window.tp.downloadProject()">save project</button>
|
<button id="save_project" onclick="window.tp.downloadProject()">save project</button>
|
||||||
<button id="open_project" onclick="window.tp.uploadProject(true)">open project</button>
|
<button id="open_project" onclick="window.tp.uploadProject(true)">open project</button>
|
||||||
|
|
|
@ -621,12 +621,12 @@ const Audio = function(tp, record) {
|
||||||
analyser.smoothingTimeConstant = 0.85;
|
analyser.smoothingTimeConstant = 0.85;
|
||||||
window.analyser = analyser;
|
window.analyser = analyser;
|
||||||
|
|
||||||
const distortion = audioCtx.createWaveShaper();
|
//const distortion = audioCtx.createWaveShaper();
|
||||||
const gainNode = audioCtx.createGain();
|
//const gainNode = audioCtx.createGain();
|
||||||
const biquadFilter = audioCtx.createBiquadFilter();
|
//const biquadFilter = audioCtx.createBiquadFilter();
|
||||||
const convolver = audioCtx.createConvolver();
|
//const convolver = audioCtx.createConvolver();
|
||||||
|
|
||||||
const echoDelay = createEchoDelayEffect(audioCtx);
|
//const echoDelay = createEchoDelayEffect(audioCtx);
|
||||||
|
|
||||||
// Distortion curve for the waveshaper, thanks to Kevin Ennis
|
// Distortion curve for the waveshaper, thanks to Kevin Ennis
|
||||||
// http://stackoverflow.com/questions/22312841/waveshaper-node-in-webaudio-how-to-emulate-distortion
|
// http://stackoverflow.com/questions/22312841/waveshaper-node-in-webaudio-how-to-emulate-distortion
|
||||||
|
@ -663,7 +663,6 @@ const Audio = function(tp, record) {
|
||||||
audioData,
|
audioData,
|
||||||
function(buffer) {
|
function(buffer) {
|
||||||
soundSource = audioCtx.createBufferSource();
|
soundSource = audioCtx.createBufferSource();
|
||||||
convolver.buffer = buffer;
|
|
||||||
},
|
},
|
||||||
function(e) {
|
function(e) {
|
||||||
console.log("Audio::audioCtx.decodeAudioData", "Error with decoding audio data" + e.err);
|
console.log("Audio::audioCtx.decodeAudioData", "Error with decoding audio data" + e.err);
|
||||||
|
@ -692,12 +691,7 @@ const Audio = function(tp, record) {
|
||||||
.getUserMedia(constraints)
|
.getUserMedia(constraints)
|
||||||
.then(function(stream) {
|
.then(function(stream) {
|
||||||
source = audioCtx.createMediaStreamSource(stream);
|
source = audioCtx.createMediaStreamSource(stream);
|
||||||
source.connect(distortion);
|
source.connect(analyser);
|
||||||
distortion.connect(biquadFilter);
|
|
||||||
biquadFilter.connect(gainNode);
|
|
||||||
convolver.connect(gainNode);
|
|
||||||
echoDelay.placeBetween(gainNode, analyser);
|
|
||||||
analyser.connect(audioCtx.destination);
|
|
||||||
|
|
||||||
visualize();
|
visualize();
|
||||||
voiceChange();
|
voiceChange();
|
||||||
|
|
|
@ -151,6 +151,11 @@ const findInjectPanel = () => {
|
||||||
bottomButtonsContainer.classList.add("bottomButtonsContainer");
|
bottomButtonsContainer.classList.add("bottomButtonsContainer");
|
||||||
panel.append(bottomButtonsContainer);
|
panel.append(bottomButtonsContainer);
|
||||||
}
|
}
|
||||||
|
const hideuiButton = document.querySelector('#hide_ui');
|
||||||
|
if (hideuiButton !== null) {
|
||||||
|
bottomButtonsContainer.append(hideuiButton);
|
||||||
|
hideuiButton.classList.add("main_panel_button");
|
||||||
|
}
|
||||||
const exportButton = document.querySelector('#exporter_open');
|
const exportButton = document.querySelector('#exporter_open');
|
||||||
if (exportButton !== null) {
|
if (exportButton !== null) {
|
||||||
bottomButtonsContainer.append(exportButton);
|
bottomButtonsContainer.append(exportButton);
|
||||||
|
@ -531,6 +536,30 @@ window.renderFrames = exporter.renderFrames;
|
||||||
|
|
||||||
const layer_panel = document.querySelector('#layer_panel');
|
const layer_panel = document.querySelector('#layer_panel');
|
||||||
|
|
||||||
const initPanels = () => {
|
const ui = (show) => {
|
||||||
//makeDraggable(layer_panel);
|
if (show && tp.studio.ui.isHidden) {
|
||||||
|
tp.studio.ui.restore();
|
||||||
|
} else if (!show && !tp.studio.ui.isHidden) {
|
||||||
|
tp.studio.ui.hide();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUiKeypress = (e) => {
|
||||||
|
if (e.key.toLowerCase() === 'q') {
|
||||||
|
document.removeEventListener('keypress', handleUiKeypress);
|
||||||
|
ui(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const initPanels = () => {
|
||||||
|
let hideuiButton = document.querySelector('#hide_ui');
|
||||||
|
if (hideuiButton === null) {
|
||||||
|
hideuiButton = tp.getPanel().querySelector('#hide_ui');
|
||||||
|
}
|
||||||
|
if (hideuiButton !== null) {
|
||||||
|
hideuiButton.addEventListener('click', () => {
|
||||||
|
ui(false);
|
||||||
|
document.addEventListener('keypress', handleUiKeypress);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -97,7 +97,7 @@ const TheatrePlay = function(autoInit = false) {
|
||||||
if (typeof value === 'undefined') {
|
if (typeof value === 'undefined') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
return this.sheet.sequence.__experimental_getKeyframes(prop);
|
return this.sheet.sequence.__experimental_getKeyframes(prop);
|
||||||
};
|
};
|
||||||
// wtf, this function was being written in one go
|
// wtf, this function was being written in one go
|
||||||
|
|
Loading…
Reference in a new issue