Are you an LLM? You can read better optimized documentation at /developers/docs/embed/api/parts.md for this page in Markdown format
Parts & Instruments
Manage individual parts, instruments, and their audio settings
Methods
getPartVolume()
Get the volume of a specific part
Retrieves the current volume level for a specific instrument part in the score.
typescript
getPartVolume(parameters: { partUuid: string; }): Promise<number>Parameters:
parameters.partUuid-string
Returns: Promise<number>
Throws:
Error- If the part UUID is invalid or volume cannot be retrieved
Example:
typescript
const embed = new Embed('container', config);
const partVolume = await embed.getPartVolume({ partUuid: '00000000-0000-0000-0000-000000000001' });
console.log(partVolume);See also:
setPartVolume()- Set the volume for a partgetParts()- Get all parts information
setPartVolume()
Set the volume of a specific part
Sets the volume level for a specific instrument part in the score. Part volumes are independent but affected by the master volume.
typescript
setPartVolume(parameters: { partUuid: string; volume: number; }): Promise<void>Parameters:
parameters.partUuid-stringparameters.volume-number
Returns: Promise<void>
Throws:
Error- If the part UUID or volume value is invalid
Examples:
typescript
// Set violin part to 75% volume
const parts = await embed.getParts();
await embed.setPartVolume({
partUuid: parts[0].uuid,
volume: 75
});See also:
getPartVolume()- Get the volume for a partmutePart()- Mute a part
mutePart()
Mute a specific part
Mutes the audio output for a specific instrument part. The part's volume setting is preserved and can be restored using unmutePart().
typescript
mutePart(parameters: { partUuid: string; }): Promise<void>Parameters:
parameters.partUuid-string
Returns: Promise<void>
Throws:
Error- If the part UUID is invalid or muting fails
Example:
typescript
const embed = new Embed('container', config);
await embed.mutePart({ partUuid: '00000000-0000-0000-0000-000000000001' });See also:
unmutePart()- Unmute a partsetPartVolume()- Set part volume to 0 (alternative)
unmutePart()
Unmute a specific part
Restores the audio output for a previously muted part. The part returns to its previous volume level before it was muted.
typescript
unmutePart(parameters: { partUuid: string; }): Promise<void>Parameters:
parameters.partUuid-string
Returns: Promise<void>
Throws:
Error- If the part UUID is invalid or unmuting fails
Example:
typescript
const embed = new Embed('container', config);
await embed.unmutePart({ partUuid: '00000000-0000-0000-0000-000000000001' });See also:
mutePart()- Mute a part
setPartSoloMode()
Enable solo mode for a part
Enables solo mode for a specific part, which mutes all other parts while keeping the selected part audible. Multiple parts can be in solo mode simultaneously.
typescript
setPartSoloMode(parameters: { partUuid: string; }): Promise<void>Parameters:
parameters.partUuid-string
Returns: Promise<void>
Throws:
Error- If the part UUID is invalid or solo mode cannot be set
Examples:
typescript
// Solo the violin part
const parts = await embed.getParts();
const violinPart = parts.find(p => p.instrument === 'violin');
await embed.setPartSoloMode({ partUuid: violinPart.uuid });See also:
unsetPartSoloMode()- Disable solo modegetPartSoloMode()- Check solo mode status
unsetPartSoloMode()
Disable solo mode for a part
Disables solo mode for a specific part. If this was the only part in solo mode, all parts return to their normal volume/mute states. If other parts remain in solo mode, this part will be muted.
typescript
unsetPartSoloMode(parameters: { partUuid: string; }): Promise<void>Parameters:
parameters.partUuid-string
Returns: Promise<void>
Throws:
Error- If the part UUID is invalid or solo mode cannot be unset
Example:
typescript
const embed = new Embed('container', config);
await embed.unsetPartSoloMode({ partUuid: '00000000-0000-0000-0000-000000000001' });See also:
setPartSoloMode()- Enable solo modegetPartSoloMode()- Check solo mode status
getPartSoloMode()
Get the solo mode status of a part
Checks whether a specific part is currently in solo mode.
typescript
getPartSoloMode(parameters: { partUuid: string; }): Promise<boolean>Parameters:
parameters.partUuid-string
Returns: Promise<boolean>
Throws:
Error- If the part UUID is invalid
Example:
typescript
const embed = new Embed('container', config);
const partSoloMode = await embed.getPartSoloMode({ partUuid: '00000000-0000-0000-0000-000000000001' });
console.log(partSoloMode);See also:
setPartSoloMode()- Enable solo modeunsetPartSoloMode()- Disable solo mode
getPartReverb()
Get the reverb level of a part
Retrieves the current reverb (reverberation) effect level for a specific instrument part. Reverb adds spatial depth and ambience to the sound.
typescript
getPartReverb(parameters: { partUuid: string; }): Promise<number>Parameters:
parameters.partUuid-string
Returns: Promise<number>
Throws:
Error- If the part UUID is invalid or reverb cannot be retrieved
Example:
typescript
const embed = new Embed('container', config);
const partReverb = await embed.getPartReverb({ partUuid: '00000000-0000-0000-0000-000000000001' });
console.log(partReverb);See also:
setPartReverb()- Set the reverb level
setPartReverb()
Set the reverb level of a part
Sets the reverb (reverberation) effect level for a specific instrument part. Higher values create more spacious, ambient sound.
typescript
setPartReverb(parameters: { partUuid: string; reverberation: number; }): Promise<void>Parameters:
parameters.partUuid-stringparameters.reverberation-number
Returns: Promise<void>
Throws:
Error- If the part UUID or reverb value is invalid
Examples:
typescript
// Add subtle reverb to piano
await embed.setPartReverb({
partUuid: pianoPart.uuid,
reverberation: 30
});See also:
getPartReverb()- Get the current reverb level
getParts()
Get information about all parts
Retrieves detailed information about all instrument parts in the score, including their names, instruments, and unique identifiers.
typescript
getParts(): Promise<PartConfiguration[]>Returns: Promise<PartConfiguration[]>
Throws:
Error- If no score is loaded or parts cannot be retrieved
Examples:
typescript
// Get all parts
const parts = await embed.getParts();
parts.forEach(part => {
console.log(`${part.name}: ${part.uuid}`);
});See also:
getDisplayedParts()- Get currently visible partssetDisplayedParts()- Choose which parts to display
getDisplayedParts()
Get the currently displayed parts
Retrieves information about which parts are currently visible in the score. Some parts may be hidden for focused practice or simplified viewing.
typescript
getDisplayedParts(): Promise<PartConfiguration[]>Returns: Promise<PartConfiguration[]>
Throws:
Error- If displayed parts cannot be retrieved
Example:
typescript
const embed = new Embed('container', config);
const displayedParts = await embed.getDisplayedParts();
console.log(displayedParts);See also:
getParts()- Get all parts in the scoresetDisplayedParts()- Change which parts are visible
setDisplayedParts()
Set which parts to display
Controls which instrument parts are visible in the score. Parts can be identified by their UUID, index, name, or abbreviation. Hidden parts are not displayed but still play during playback unless muted.
typescript
setDisplayedParts(parts: string[]): Promise<void>Parameters:
parts-string[]
Returns: Promise<void>
Throws:
Error- If part identifiers are invalid
Examples:
typescript
// Show only violin and piano parts by UUID
const parts = await embed.getParts();
const violin = parts.find(p => p.instrument === 'violin');
const piano = parts.find(p => p.instrument === 'piano');
await embed.setDisplayedParts([violin.uuid, piano.uuid]);typescript
// Show parts by index
await embed.setDisplayedParts(['0', '2', '3']);See also:
getParts()- Get all available partsgetDisplayedParts()- Check which parts are visible