1 | import { Loop, LoopOptions } from "./Loop.js";
|
2 | import { PatternName } from "./PatternGenerator.js";
|
3 | import { ToneEventCallback } from "./ToneEvent.js";
|
4 | import { Seconds } from "../core/type/Units.js";
|
5 | export interface PatternOptions<ValueType> extends LoopOptions {
|
6 | pattern: PatternName;
|
7 | values: ValueType[];
|
8 | callback: (time: Seconds, value?: ValueType) => void;
|
9 | }
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare class Pattern<ValueType> extends Loop<PatternOptions<ValueType>> {
|
20 | readonly name: string;
|
21 | |
22 |
|
23 |
|
24 | private _pattern;
|
25 | |
26 |
|
27 |
|
28 | private _index?;
|
29 | |
30 |
|
31 |
|
32 | private _value?;
|
33 | |
34 |
|
35 |
|
36 | private _type;
|
37 | |
38 |
|
39 |
|
40 | private _values;
|
41 | |
42 |
|
43 |
|
44 | callback: (time: Seconds, value?: ValueType) => void;
|
45 | |
46 |
|
47 |
|
48 |
|
49 |
|
50 | constructor(callback?: ToneEventCallback<ValueType>, values?: ValueType[], pattern?: PatternName);
|
51 | constructor(options?: Partial<PatternOptions<ValueType>>);
|
52 | static getDefaults(): PatternOptions<any>;
|
53 | /**
|
54 | * Internal function called when the notes should be called
|
55 | */
|
56 | protected _tick(time: Seconds): void;
|
57 | /**
|
58 | * The array of events.
|
59 | */
|
60 | get values(): ValueType[];
|
61 | set values(val: ValueType[]);
|
62 | /**
|
63 | * The current value of the pattern.
|
64 | */
|
65 | get value(): ValueType | undefined;
|
66 | /**
|
67 | * The current index of the pattern.
|
68 | */
|
69 | get index(): number | undefined;
|
70 | /**
|
71 | * The pattern type.
|
72 | */
|
73 | get pattern(): PatternName;
|
74 | set pattern(pattern: PatternName);
|
75 | }
|