src/pipeline/step1parts.js
- import { Step } from "./step.js";
- export class Step1Parts extends Step {
-
- schema() {
- return SCHEMA;
- }
- }
- const SCHEMA = [
- {
- name: "parts",
- type: "stepper",
- label: "Number of Parts",
- tooltip: "Number of musical sections (e.g. A-B-A)",
- default: 1,
- min: 1,
- max: 5,
- },
- {
- name: "tempo",
- type: "int",
- label: "Tempo",
- tooltip: "Playback speed (MIDI BPM, always based on quarter notes)",
- default: 120,
- min: 30,
- max: 210,
- step: 1,
- format: (v) => `${v} <abbr title="Beats Per Minute">BPM</abbr>`,
- },
- {
- name: "part",
- type: "nested",
- label: "Part",
- tooltip: "Same label => copied part",
- firstColumn: {
- type: "select",
- key: "label",
- options: ["A", "B", "C", "D", "E"],
- },
- counter: "parts",
- defaults: ["A", "B", "A", "C", "A"].map((label) => ({
- label,
- bars: { B: 5, C: 6 }[label] ?? 4,
- numerator: 4,
- denominator: 4,
- })),
- template: [
- {
- name: "bars",
- type: "int",
- label: "Bars",
- tooltip: "Number of measures in this part",
- default: 4,
- min: 2,
- max: 16,
- },
- {
- name: "numerator",
- type: "int",
- label: "Beats/Bar",
- tooltip: "e.g. 3 (beats) in 3/4 time",
- default: 4,
- min: 1,
- max: 12,
- },
- {
- name: "denominator",
- type: "select",
- label: "Beat Value",
- tooltip: "e.g. 4 (quarter note) in 3/4 time",
- default: 4,
- options: [1, 2, 4, 8, 16, 32],
- labels: [
- "1 (whole note)",
- "2 (half note)",
- "4 (quarter note)",
- "8 (eighth note)",
- "16 (sixteenth note)",
- "32 (thirty-second note)",
- ],
- },
- ],
- },
- ];