<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PHASE",
  "identifier" : "/documentation/PHASE/PHASESoundEventNodeDefinition",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PHASE"
    ],
    "preciseIdentifier" : "c:objc(cs)PHASESoundEventNodeDefinition"
  },
  "title" : "PHASESoundEventNodeDefinition"
}
-->

# PHASESoundEventNodeDefinition

A base class for sound event nodes that connect to form a node hierarchy.

```
class PHASESoundEventNodeDefinition
```

## Overview

This class defines the base functionality for an object that, depending on the derived class’s type, either plays audio or hands off the invocation to one or more other nodes.

### Configure a Sound Event Node to Play Audio

To play audio with this class, retrieve a sound-event node asset ([`PHASESoundEventNodeAsset`](/documentation/PHASE/PHASESoundEventNodeAsset)) that generates sound events by creating and registering one of the audio-providing node definitions in [Sound Event Nodes](/documentation/PHASE/sound-event-nodes). Call [`registerSoundEventAsset(rootNode:identifier:)`](/documentation/PHASE/PHASEAssetRegistry/registerSoundEventAsset(rootNode:identifier:)) and pass the node definition in the `rootNode` argument. Provide an `identifier` argument with a unique name that your app refers to later when generating a playable [`PHASESoundEvent`](/documentation/PHASE/PHASESoundEvent).

### Configure a Node Hiearchy that Reacts to Your App’s State

You can create a hierarchy of nodes that blends audio based on your app’s parameters, or plays the right audio based on your app’s state. To create the hierarchy, register one of the control nodes in [Sound Event Nodes](/documentation/PHASE/sound-event-nodes) by calling [`registerSoundEventAsset(rootNode:identifier:)`](/documentation/PHASE/PHASEAssetRegistry/registerSoundEventAsset(rootNode:identifier:)), passing in a unique [`identifier`](/documentation/PHASE/PHASEDefinition/identifier) you define for the subclass.

The particular configuration you choose for a node hierarchy instructs PHASE on which audio to play, when to play it, or whether to hand off an invocation to one or more child nodes ([`children`](/documentation/PHASE/PHASESoundEventNodeDefinition/children)).

For example, if you register and invoke a [`PHASESwitchNodeDefinition`](/documentation/PHASE/PHASESwitchNodeDefinition) that contains two child [`PHASESamplerNodeDefinition`](/documentation/PHASE/PHASESamplerNodeDefinition) objects, PHASE plays the audio of one of the child sampler nodes based on the current value of the switch node’s metaparameter. For more information, see [`metaParameters`](/documentation/PHASE/PHASESoundEvent/metaParameters).

## Topics

### Accessing Child Nodes

[`children`](/documentation/PHASE/PHASESoundEventNodeDefinition/children)

An array of child sound event nodes.

### Identifying a Definition

[`PHASEDefinition`](/documentation/PHASE/PHASEDefinition)

A base class that adds a name to framework definitions.

## Relationships

### Inherited By

[`PHASEContainerNodeDefinition`](/documentation/PHASE/PHASEContainerNodeDefinition)

[`PHASESwitchNodeDefinition`](/documentation/PHASE/PHASESwitchNodeDefinition)

[`PHASEBlendNodeDefinition`](/documentation/PHASE/PHASEBlendNodeDefinition)

[`PHASERandomNodeDefinition`](/documentation/PHASE/PHASERandomNodeDefinition)

[`PHASEGeneratorNodeDefinition`](/documentation/PHASE/PHASEGeneratorNodeDefinition)

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`PHASEDefinition`](/documentation/PHASE/PHASEDefinition)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)