diff --git a/src/classes/Keyboard.js b/src/classes/Keyboard.js index 8ae7c11..8b7ca34 100644 --- a/src/classes/Keyboard.js +++ b/src/classes/Keyboard.js @@ -41,6 +41,9 @@ export class Keyboard { getFirstColorItem() { return this.childElements.find((childElement) => childElement instanceof Color); } + getColorItemByIndex(index) { + return this.getColorItems()[index]; + } addColorItem(props) { this.childElements.push(new Color(props, "group", this.hierarchyPath)); } diff --git a/src/classes/Modulators.js b/src/classes/Modulators.js index 09d6dac..22901db 100644 --- a/src/classes/Modulators.js +++ b/src/classes/Modulators.js @@ -36,6 +36,12 @@ export class Modulators { !!childElement?.init && childElement.init(decentSampler); }); } + getChildElements() { + return this.childElements; + } + getChildElementByIndex(index) { + return this.childElements[index]; + } getLfoItems() { return this.childElements?.filter((childElement) => childElement instanceof Lfo); }