Add comments field to repeats
This commit is contained in:
parent
5c462d545f
commit
9b47cfeb99
|
|
@ -35,6 +35,7 @@ describe("detectRepeats()", () => {
|
|||
{ type: "Interval", duration: new Seconds(120), intensity: { from: 1, to: 1 }, comments: [] },
|
||||
{ type: "Rest", duration: new Seconds(60), intensity: { from: 0.5, to: 0.5 }, comments: [] },
|
||||
],
|
||||
comments: [],
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
|
@ -63,6 +64,7 @@ describe("detectRepeats()", () => {
|
|||
{ type: "Interval", duration: new Seconds(60), intensity: { from: 1, to: 1 }, comments: [] },
|
||||
{ type: "Rest", duration: new Seconds(60), intensity: { from: 0.5, to: 0.5 }, comments: [] },
|
||||
],
|
||||
comments: [],
|
||||
},
|
||||
{ type: "Rest", duration: new Seconds(120), intensity: { from: 0.2, to: 0.2 }, comments: [] },
|
||||
{ type: "Cooldown", duration: new Seconds(60), intensity: { from: 1, to: 0.5 }, comments: [] },
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import { equals } from "ramda";
|
||||
import { Interval } from "./ast";
|
||||
import { Interval, Comment } from "./ast";
|
||||
|
||||
export type RepeatedInterval = {
|
||||
times: number;
|
||||
intervals: Interval[];
|
||||
comments: Comment[];
|
||||
};
|
||||
|
||||
const windowSize = 2;
|
||||
|
|
@ -45,6 +46,7 @@ export const detectRepeats = (intervals: Interval[]): (Interval | RepeatedInterv
|
|||
processed.push({
|
||||
times: repeats,
|
||||
intervals: reference,
|
||||
comments: [],
|
||||
});
|
||||
i += repeats * windowSize;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue