Implement Autocorrelation

This commit is contained in:
2021-11-12 05:44:37 +01:00
parent abb0476a17
commit 41b54f6209
16 changed files with 833 additions and 17 deletions

View File

@@ -6,11 +6,15 @@ import { TestPattern } from '../patterns/test';
import rust, { BeatTrackerHandle, MovingHeadState, OutputHandle } from 'rust_native_module';
import { ChaserPattern } from '../patterns/chaser';
type AppState = {
export type AppState = {
patterns: { [key: string]: PatternOutput },
selectedPattern: string | null,
beatProgress: number | null,
graphData: {
bassFiltered: Array<number>,
autoCorrelated: Array<number>,
} | null,
};
class Backend {
@@ -61,8 +65,13 @@ class Backend {
patterns: {},
selectedPattern: null,
beatProgress: null,
graphData: null,
}
ipcMain.on('pattern-select', async (_, arg) => {
this.state.selectedPattern = arg;
});
let time: Time = {
absolute: 0,
beatRelative: this.state.beatProgress,
@@ -93,6 +102,8 @@ class Backend {
this.state.beatProgress = null;
}
this.state.graphData = this.beatTracker.getGraphPoints();
let date = new Date();
let time: Time = {
absolute: date.getTime() / 1000,

View File

@@ -40,7 +40,7 @@ const createWindow = async () => {
},
});
mainWindow.removeMenu();
// mainWindow.removeMenu();
mainWindow.loadURL(resolveHtmlPath('index.html'));