@webgamekit/strudel-flow 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ import type { StrudelFlowNode } from './types';
2
+ /** A cycle that plays no part. */
3
+ export declare const STRUDEL_FLOW_ARRANGE_SILENT = -1;
4
+ /**
5
+ * Whether a section of an arrange call plays nothing.
6
+ * @param pattern - a section's pattern code
7
+ * @returns true for `silence`, `~` or an empty pattern
8
+ */
9
+ export declare const isStrudelFlowArrangeSilent: (pattern: string) => boolean;
10
+ /**
11
+ * Reads the sections of an arrange call as a part for every cycle.
12
+ * @param sections - each section's cycle count and pattern code
13
+ * @returns the parts in order of first appearance, and for each cycle the part that plays
14
+ */
15
+ export declare const readStrudelFlowArrangeSequence: (sections: {
16
+ cycles: number;
17
+ pattern: string;
18
+ }[]) => {
19
+ parts: string[];
20
+ sequence: number[];
21
+ };
22
+ /**
23
+ * Joins runs of cycles that play the same part into sections.
24
+ * @param sequence - the part playing in each cycle
25
+ * @returns the fewest sections that play the same cycles
26
+ */
27
+ export declare const compressStrudelFlowArrange: (sequence: number[]) => {
28
+ cycles: number;
29
+ part: number;
30
+ }[];
31
+ /**
32
+ * Plays a part in a cycle, or stops it when it already plays there.
33
+ * @param sequence - the part playing in each cycle
34
+ * @param part - the part to switch
35
+ * @param cycle - the cycle to switch it in
36
+ * @returns the sequence with that cycle changed
37
+ */
38
+ export declare const toggleStrudelFlowArrangeCycle: (sequence: number[], part: number, cycle: number) => number[];
39
+ /**
40
+ * Gives an arrangement more or fewer cycles.
41
+ * @param sequence - the part playing in each cycle
42
+ * @param length - how many cycles it should span
43
+ * @returns the sequence cut at that length, or padded with silent cycles
44
+ */
45
+ export declare const resizeStrudelFlowArrange: (sequence: number[], length: number) => number[];
46
+ /**
47
+ * Writes an arrangement as an `arrange(...)` call.
48
+ * @param sequence - the part playing in each cycle
49
+ * @param partPatterns - the code of each part, in cable order
50
+ * @returns the call, or `silence` when no cycle plays a part that exists
51
+ */
52
+ export declare const writeStrudelFlowArrange: (sequence: number[], partPatterns: string[]) => string;
53
+ /**
54
+ * Puts the nodes feeding an arrangement in part order: top to bottom, then left to right.
55
+ * @param sources - the nodes cabled into the Arrange node
56
+ * @returns the same nodes, one per part
57
+ */
58
+ export declare const orderStrudelFlowArrangeParts: (sources: StrudelFlowNode[]) => StrudelFlowNode[];
package/dist/config.d.ts CHANGED
@@ -65,6 +65,14 @@ export declare const STRUDEL_FLOW_PAD_MODIFIER_OPTIONS: {
65
65
  label: string;
66
66
  }[];
67
67
  export declare const STRUDEL_FLOW_MAX_DRUM_ROWS = 8;
68
+ /** The most cycles one arrangement can span. */
69
+ export declare const STRUDEL_FLOW_MAX_ARRANGE_CYCLES = 128;
70
+ /** The most parts one arrangement can switch between. */
71
+ export declare const STRUDEL_FLOW_MAX_ARRANGE_PARTS = 64;
72
+ /** The Notes grid's resolution: two steps to a beat is an eighth note. */
73
+ export declare const STRUDEL_FLOW_NOTE_GRID_STEPS_PER_BEAT = 2;
74
+ /** The most bars the Notes grid can hold. */
75
+ export declare const STRUDEL_FLOW_MAX_NOTE_GRID_BARS = 128;
68
76
  export declare const STRUDEL_FLOW_DEFAULT_BEATS_STEPS = 16;
69
77
  /** The starter beat: four on the floor, a backbeat snare and eighth-note hats. */
70
78
  export declare const STRUDEL_FLOW_DRUM_ROWS: {
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export { default as StrudelFlowNode } from './components/StrudelFlowNode.vue';
28
28
  export { default as StrudelFlowPadControls } from './components/controls/StrudelFlowPadControls.vue';
29
29
  export { default as StrudelFlowBeatsControls } from './components/controls/StrudelFlowBeatsControls.vue';
30
30
  export { default as StrudelFlowChordsControls } from './components/controls/StrudelFlowChordsControls.vue';
31
+ export { default as StrudelFlowArrangeControls } from './components/controls/StrudelFlowArrangeControls.vue';
31
32
  export { default as StrudelFlowCodeControls } from './components/controls/StrudelFlowCodeControls.vue';
32
33
  export { default as StrudelFlowDelayControls } from './components/controls/StrudelFlowDelayControls.vue';
33
34
  export { default as StrudelFlowFilterControls } from './components/controls/StrudelFlowFilterControls.vue';