Arrumando botões de volume e pan, criação de novos compassos.
This commit is contained in:
1 parent
e776a830c8
commit
e10621da17
8 files changed
+411
-291
No files matched your search
@@ -1,12 +1,16 @@
|
||||
// js/utils.js
|
||||
|
||||
export function getTotalSteps() {
|
||||
const barsInput = document.getElementById("bars-input");
|
||||
const compassoAInput = document.getElementById("compasso-a-input");
|
||||
const compassoBInput = document.getElementById("compasso-b-input");
|
||||
|
||||
const numberOfBars = parseInt(barsInput.value, 10) || 1;
|
||||
const beatsPerBar = parseInt(compassoAInput.value, 10) || 4;
|
||||
const noteValue = parseInt(compassoBInput.value, 10) || 4;
|
||||
const subdivisions = Math.round(16 / noteValue);
|
||||
return beatsPerBar * subdivisions;
|
||||
|
||||
return numberOfBars * beatsPerBar * subdivisions;
|
||||
}
|
||||
|
||||
export function enforceNumericInput(event) {
|
||||
@@ -24,4 +28,4 @@ export function adjustValue(inputElement, step) {
|
||||
|
||||
// Dispara um evento 'input' para que outros listeners (como o que redesenha o sequenciador) sejam acionados.
|
||||
inputElement.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user