Initial commit
This commit is contained in:
24
defaultState.js
Normal file
24
defaultState.js
Normal 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 };
|
||||
Reference in New Issue
Block a user