> For the complete documentation index, see [llms.txt](https://fehdead.gitbook.io/npc-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/musictrans.md).

# npc.musictrans

```lua
npc.musictrans(track, frames, level)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x02C7`                          |
| arguments               | 3: Int, Int, Int                  |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 5675 calls in 527 of 1114 scripts |

## What it does

Changes a music track's volume over a number of frames.

## Arguments

### `track` (Int)

`-1` the track playing now (nothing happens when none plays).

### `frames` (Int)

How long the change takes; `0` at once.

### `level` (Int)

The volume, `0` silent to `127` full.

## Timing

Returns at once; the change runs on its own.

## In NPC Kit

Vanilla's most common pair: `(-1, 30, 32)` lowers the music before an "obtained" message and `(-1, 30, 127)` brings it back after (about 2,200 times each). Always bring it back: the level stays where the call left it.

## Used with

* [additemmes](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/additemmes.md), [moveblurcaptureonce](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/moveblurcaptureonce.md).

## Example

```lua
npc.musictrans(-1, 30, 32);
npc.additemmes(0x0000, 1);          -- Potion
npc.musictrans(-1, 30, 127);
```
