Event Based Playback

 

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. 

  1. Solo the Dog & Bird and play the Scene for a short time then stop.

    7.27.png


    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. 

  2. In the Inspector Deactivate the Dog & Bird and play the Scene.

    7.28.png


    You no longer hear the Dog & Bird and you can confirm that the Object is deactivated as its meter is no longer visible.

  3. 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.

    7.29.png

    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.

  4. In the Inspector, click the Deactivate on complete checkbox.

    7.30.png

    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.

  5. Below the inspector click the Tags button.

    7.31.png


    You see several buttons allowing you to quickly search Objects based on various conditions.

  6. Click the Inactive button.

    7.32.png


    You see that the Scene Root and Dog and Bird Objects are listed.

  7. Click the Dog and Bird Object and it is automatically selected.

    7.33.png


    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.

  8. In the Dog and Bird Inspector’s Tag area, click into the empty field, enter Event and press Return.

    7.34.png


    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.

  1. At the top of the Objects List, click the Input Events tab.

    7.35.png


    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.

  2. 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.

    7.36.png

    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.

  3. 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.

    7.37.png


    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.

  4. Right-click the Property and select Active.

    7.38.png


    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.

  5. Click the Show in Control App.

    7.39.png


    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.

  6. Play the Scene and after some time passes, click the Manually Trigger I/O button.

    7.40.png

    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.

 

Previous                                                                                                                                                        Next

Was this article helpful?
0 out of 0 found this helpful