Implement Autocorrelation
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -40,7 +40,7 @@ const createWindow = async () => {
|
||||
},
|
||||
});
|
||||
|
||||
mainWindow.removeMenu();
|
||||
// mainWindow.removeMenu();
|
||||
|
||||
mainWindow.loadURL(resolveHtmlPath('index.html'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user