# Velocity

## Introduction

Velocity helps determine which clip should be played in a given scenario. The concept originates from the MIDI keyboards in music production world. These devices capture the [velocity ](https://youtu.be/EjCPiVFwZfQ?si=N5moA_od9JvAOCz-)(the force with which a note is played) and use it to trigger different audio samples based on this value. This feature was designed in a similar way.

## How To Use?

Set the [PlayMode](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/..#playmode) to **Velocity** and set the value for each clip from low to high. These values will then be used as the bottom of a certain velocity range. Say if you have 2 clips set as 0 and 50, when the given velocity is 30, the first clip will be played, and if the given velocity is 60, the second clip will be played.

To give a velocity, simplicity just add [.SetVelocity(velocity)](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#public-methods) to the [method chain](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation#the-method-chaining-design).

```csharp
BroAudio.Play(_hit).SetVelocity(60);
```

{% embed url="<https://youtu.be/MnK2cHQMA64?si=SABBsPxwuB-via_z>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/velocity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
