Initial commit

This commit is contained in:
AG
2025-12-20 16:32:05 +02:00
commit f430c2b757
31 changed files with 4797 additions and 0 deletions

24
defaultState.js Normal file
View File

@@ -0,0 +1,24 @@
const INITIAL_STEPS = 16;
const INITIAL_TEMPO = 76;
const INSTRUMENTS_LENGTH = 5;
const createEmptyGrid = (steps) => {
return Array.from({ length: INSTRUMENTS_LENGTH }, () => Array(steps).fill(false));
};
const createEmptyBassLine = (steps) => {
return Array.from({ length: steps }, () => []);
}
const defaultState = {
grid: createEmptyGrid(INITIAL_STEPS),
bassLine: createEmptyBassLine(INITIAL_STEPS),
tempo: INITIAL_TEMPO,
steps: INITIAL_STEPS,
mutes: Array(INSTRUMENTS_LENGTH).fill(false),
drumVolume: 1,
bassVolume: 0.4,
isPlaying: false
};
module.exports = { defaultState };