# Part 2: Dynamic Hi-Hats

In this section, you will use the second sequencer part, **P2**, to generate a dynamic hi-hat pattern on top of the kick and snare pattern from **P1**.

## Part Overviewâ€‹

For the **P2** sequencer part, we are going to configure a state machine according to the following diagram:

- Diagram
- Matrix

Closed hi-hat (loud) | Closed hi-hat (soft) | Open hi-hat | |
---|---|---|---|

Closed hi-hat(loud) | 80% | 20% | |

Closed hi-hat(soft) | 100% | ||

Open hi-hat | 90% | 10% |

*Hi-hats pattern*

This state machine will generate hi-hat notes on every **sixteenth note**, and alternate between them in a less predictable way, occasionally switching to open hi-hat instead of the closed one.

## Mixerâ€‹

For **P2**, keep the **Timing** at the default value of **1/16**. This will make the state machine transition on every sixteenth note.

### Part Activatorâ€‹

Notice that the **P2** mixer controls are grayed out. That's because **P2** is not activated. The **Part Activator** determines whether the corresponding part sends MIDI events to the output or not.

*Part Activator*

**P1** was already enabled by default when you loaded Flow. To enable **P2**, set its **Part Activator** to **On**.

### Levelâ€‹

Each part also has its own output **Level** parameter that affects the velocity of the notes. This allows you to balance each part between each other.

You can slightly reduce the level for **P2** to make it quieter than **P1**.

Your **P2** mixer section should look like this:

*P2 Mixer*

## Sequencerâ€‹

Next, open the floating plug-in window and select **P2** in the **Part Selector**.

For this sequencer part, we need three states: one for a **closed hi-hat**, one for a **soft closed hi-hat**, and one for an **open hi-hat**. Click on the **States Number** dropdown and select **3**.

Configure **P2** states as following:

**State 1**:**F#1**note (closed hi-hat) with higher velocity range;**State 2**:**F#1**note (closed hi-hat) with lower velocity range;**State 3**:**A#1**note (soft open hi-hat) with medium velocity range at your liking.

Now let's set up the **State Transition Matrix** according to the state machine diagram above. For this sequencer part, we want to configure a more dynamic and varied state transition rules: sometimes play a closed hi-hat followed by a soft closed hi-hat, sometimes play an open hi-hat instead of a closed one, sometimes repeat an open hi-hat.

To do this, we need to set different **probabilities** for different transitions:

- In the
**first row**of the**State Transition Matrix**, set the**second cell**to a higher value, and the**third cell**to a lower value. This means that the first state (closed hi-hat) is followed by the second one (soft closed hi-hat) with higher probability, or by the third one (open hi-hat) with lower probability; - In the
**second row**, set the**first cell**to any value, and leave the other cells empty. This means that the second state (soft closed hi-hat) is always followed by the first state (closed hi-hat); - In the
**third row**, set the**first cell**to a higher value, and the**third cell**to a lower value. This means that the third state (open hi-hat) can be followed by the first state (closed hi-hat), or it can be repeated with lower probability.

The value in each cell of the **State Transition Matrix** determines the probability of that transition, *relative to other cells in the same row*. The higher the value compared to others, the more likely the transition will occur.

If there is only one state transition configured, its value is irrelevant because no other transition is possible.

Your **P2** state machine configuration should look like this:

- State 1
- State 2
- State 3

*State 1 configuration*

*State 2 configuration*

*State 3 configuration*

## Resultâ€‹

Hit **Play** in Ableton Live to hear both sequencer parts playing together.

*Kick and snare pattern with hi-hats*

Notice that Flow will transition between **P2** states in a non-linear and probabilistic way, creating constantly varying hi-hat patterns.

You can adjust state transition rules as the pattern is playing, modify state configurations, or go to the mixer section and adjust the output levels to your liking.