Now that the sub-Scene of the Dog & Bird is complete, when do you want to hear it play? Currently it plays when the Scene is first played and is never heard again. You could set the Bird & Dog Object’s Start Delay and Loop properties so that it plays later and potentially repeats every so often. Another option would be to configure the Scene so that it can be triggered by the end-user when the Scene is played in the deployed Space. Spatial offers Event based features just for this circumstance.
Understanding Active Status
To understand how event based triggering works, it’s important to first understand how an Object or soundset’s active status impacts playback. It may feel like an Object plays based on its Start Delay relative to when a Scene is initially played. This is not actually the case. Object’s play at a time based on their Start Delay relative to when the Object is activated. To understand this, you’ll experiment with manually deactivating and activating Objects after you initiate Scene playback.
- Solo the Dog & Bird and play the Scene for a short time then stop.
You heard the dog bark, followed by the rustling bird that then chirps twice as it flies into the distance. Once that occurs, you won’t hear it again unless you set looping properties for it to repeat. You’ll play the Scene again, but you’ll first deactivate the Dog & Bird Object.
In the Inspector if you see a meter next to an Object or Soundset, it’s active. Hovering over the meter will reveal a switch to the right side that will deactivate it.
- In the Inspector Deactivate the Dog & Bird and play the Scene.
You no longer hear the Dog & Bird and you can confirm that the Object is deactivated as its meter is no longer visible.
- Now Play the Scene and after the Scene plays for a few seconds, reactivate the Dog & Bird Object, then without stopping Scene playback, deactivate and reactivate the Object several more times, leaving it deactivated when you stop the Scene.
Notice how the Dog & Bird subScene plays from the beginning of that Object's timeline each time it’s reactivated. This is extremely important to understand and is further evidence that the timeline display has little to do with what you’ll hear.
In the next exercise, you’re going to set an Event that will be used to activate the Dog & Bird Object, so that it then plays from the beginning. In order to activate an Object we need to make sure that it is deactivated beforehand. One problem can be that if we’ve played the Object earlier, that playback requires the Object is active, and it will remain active indefinitely, unless you instruct the Object to automatically deactivate once it is done playing.
- In the Inspector, click the Deactivate on complete checkbox.
Notice the section in the General settings of your property inspector called Tags.
Sometimes when you’re playing the Scene, you may not realize that an Object is deactivated.
This is especially the case in Scenes with numerous Objects, making it more difficult to see the entirety of Objects in the Inspector. To assist with this, Spatial features an easy to use system to tag Objects with keywords, or to use certain Object conditions such as if an Object is active or inactive.
- Below the inspector click the Tags button.
You see several buttons allowing you to quickly search Objects based on various conditions.
- Click the Inactive button.
You see that the Scene Root and Dog and Bird Objects are listed.
- Click the Dog and Bird Object and it is automatically selected.
You can also create custom tags. It can be useful to find all of the Objects that rely on events to trigger their playback. Since you’ll be configuring this for the Dog & Bird Object in the next exercise, go ahead and add an Event tag to this Object.
- In the Dog and Bird Inspector’s Tag area, click into the empty field, enter Event and press Return.
An Event tag is added to the Dog & Bird Object and you’ll see that there is now an Event button in the Tag area below the Inspector.
Configuring an Input Event
Now that you understand how Object activation triggers an Object to play, you can now configure the input that will initiate the activation of Dog & Bird Object. This is achieved by setting up something called an Input Event. Input Events serve as a receptor of information from outside of Spatial. It’s possible for information coming from things like light or motion sensors to act on an Object within Spatial. The process of how you tie-in outside world input into Spatial is beyond the scope of this course, but it’s easy to implement and test event based playback within Spatial Studio. Beyond that, you can also easily create a way for the end-user of your Scene to manually trigger Event based playback using the Spatial Control app.
- At the top of the Objects List, click the Input Events tab.
This column is used to display any currently configured Events used for event based playback. To get started, you need to add a new Input Event. The name you choose will be displayed in the end-user’s Spatial Control app, so take that into consideration when naming.
- At the top of the Input Event List, click the [+] symbol to create a new Input Event, select it, and then in the Inspector rename it Dog Barking at Bird.
Note: You see the Input Source field, but there’s nothing to select. This is used once you configure your Space with external data inputs or sensors.
Below you see the Target field. This is where you identify which Object you want to impact. When making this selection, you’ll see something that presents itself like a menu, but it’s really a reflection of the hierarchy in the Object List.
- Right-click the Target that says Scene Root and change it to say Dog and Bird.
You can select the parent Object without following the hierarchy all the way down the line.
Now you need to define what property of the Dog & Bird Object you want to affect. Options include muting, volume, position and more. In your case you want to activate the Object.
- Right-click the Property and select Active.
Now you need to indicate a value for the Activate property. In this case a value of 0 represents deactivating, and a value of 1 is used to activate the Object.
NOTE: Value entry syntax varies depending on the Property you are targeting.
For this Event to be activated from within the Spatial Control app, you just need to select the Show in Control App checkbox.
- Click the Show in Control App.
Now you’re ready to test your Input Event. This is done using the Manually Trigger I/O button just to the right of the counter in the upper timeline. Clicking this cube shaped button will emulate the triggering of whichever event is selected in the Input Events List.
- Play the Scene and after some time passes, click the Manually Trigger I/O button.
You hear that as soon as you click the Manually Trigger I/O button, you hear the dog bark, followed by the bird flying into the distance.
TIP: Once an input event is configured, it can be triggered from other input events, making it easy to have a single trigger apply to multiple actions.