InstrumentComposite
interface InstrumentComposite extends Instrument {
uuid: string
label: string
enabled: boolean
minimized: boolean
audioUnit: InstrumentAudioUnit
icon: string
key: 'InstrumentComposite'
layers: readonly InstrumentCompositeLayer[]
remove(): void
addLayer<K extends 'Vaporisateur' | 'Playfield' | 'Nano' | 'Soundfont' | 'Neon' | 'Tubular' | 'Cubed' | 'Apparat' | 'InstrumentComposite'>(key: K, props?: DeepPartial<LayerInstruments[K]>, layer?: Partial<Pick<InstrumentCompositeLayer, 'pan' | 'gain' | 'mute' | 'solo' | 'minimized'>>): InstrumentCompositeLayer & { instrument: LayerInstruments[K] }
}Plays several instruments at once from the same notes, each in its own layer
- See:
Hierarchy
InstrumentInstrumentComposite
Properties
uuid: string
readonly
Inherited from uuid
Unique id
label: string
Inherited from label
Custom label
enabled: boolean
Inherited from enabled
Enable or bypass the device
minimized: boolean
Inherited from minimized
Collapse the device editor in the studio
audioUnit: InstrumentAudioUnit
readonly
Inherited from audioUnit
The audio unit this instrument belongs to
icon: string
Inherited from icon
Icon name (see IconSymbol)
key: 'InstrumentComposite'
readonly
Overrides key
Always "InstrumentComposite"
layers: readonly InstrumentCompositeLayer[]
readonly
All layers ordered by index
Methods
remove(): void
Inherited from remove
Removes the whole audio unit. Use InstrumentAudioUnit.setInstrument to swap the instrument. An instrument inside an InstrumentCompositeLayer removes that layer instead
Returns
void
addLayer<
K extends 'Vaporisateur' | 'Playfield' | 'Nano' | 'Soundfont' | 'Neon' | 'Tubular' | 'Cubed' | 'Apparat' | 'InstrumentComposite',
>(
key: K,
props?: DeepPartial<LayerInstruments[K]>,
layer?: Partial<Pick<InstrumentCompositeLayer, 'pan' | 'gain' | 'mute' | 'solo' | 'minimized'>>,
): InstrumentCompositeLayer & { instrument: LayerInstruments[K] }
Add a layer playing the given instrument
Type Parameters
Kextends"Vaporisateur" | "Playfield" | "Nano" | "Soundfont" | "Neon" | "Tubular" | "Cubed" | "Apparat" | "InstrumentComposite"
Parameters
key(K) — Instrument type (everything except Tape and MIDIOutput)props(DeepPartial<LayerInstruments[K]>, optional) — Instrument settingslayer(Partial<Pick<InstrumentCompositeLayer, "pan" | "gain" | "mute" | "solo" | "minimized">>, optional) — Layer settings
Returns
Example
CODE
const stack = project.addInstrumentUnit("InstrumentComposite", {label: "Stack"}).instrument
stack.addLayer("Vaporisateur", {label: "Pad"}).addAudioEffect("Reverb")
stack.addLayer("Nano", undefined, {gain: -6, pan: -0.5})