---
title: "State machines"
description: "Lesson 7.8 of Creator Terminal's lesson films (Going deeper): Make a button wait for a press, play one pulse, then return to idle."
canonical: "https://terminal.lottiefiles.com/state-machines/"
last_updated: 2026-10-27
---

# State machines

> Lesson 7.8 of Creator Terminal's lesson films (Going deeper): Make a button wait for a press, play one pulse, then return to idle.

- The film (1:41): https://terminal.lottiefiles.com/media/7.8-state-machines/894c485bff97/7.8-state-machines.mp4
- Vertical cut: https://terminal.lottiefiles.com/media/7.8-state-machines/94bbbb7c8492/7.8-state-machines-vertical.mp4
- Captions: https://terminal.lottiefiles.com/media/7.8-state-machines/0da7e3d38524/7.8-state-machines.vtt
- The page: https://terminal.lottiefiles.com/state-machines/

## In this lesson

### Motion alone (0:11)

Let's see what motion alone does. Press zero, then space. The circle swells without a press. The score has two markers, idle and pulse. Press space to pause, then zero to return.

### Make the states (0:26)

So we'll add rules to choose which stretch plays. Press Control-T to open the state machine. Click a state for each marker. Each card plays its named stretch. Idle is where this machine starts.

### Add the press (0:40)

With idle selected, let's make a press take it to pulse. Click plus rule. Type press button, an arrow, then pulse. Press return. The rule says a press on our button layer goes to pulse.

### Come back (0:54)

And we'll bring the pulse back to idle. Click pulse. In the rule panel, press return to add a rule. Type ends, an arrow, then idle. Press return again. When that stretch finishes, this rule takes us back.

### Try the button (1:09)

Now let's try our button as a player. Press zero, then space. The circle waits in idle. Click the circle. It swells once and settles. There it is. A press now triggers the motion.

### Motion and rules (1:23)

And What happened records the press, then the return to idle. That's the idea. The score describes the motion. The machine chooses when it plays.
