> ## Documentation Index
> Fetch the complete documentation index at: https://chart-spec.enchor.us/llms.txt
> Use this file to discover all available pages before exploring further.

# MidiTokens

A `.mid` file read as tokens that cover every byte of it: the header chunk, every later chunk in file order, and
any bytes after the last chunk. Every offset indexes into `data`.

The header, the chunks and the trailing bytes tile the file in that order. An unedited file serializes back byte
for byte, and a changed track chunk can be re-encoded on its own while every other chunk is copied.

## Properties

| Property | Type | Description |
| - | - | - |
|  `chunks` | [`MidiChunk`](https://chart-spec.enchor.us/scan-chart/api/index/type-aliases/MidiChunk)\[] | The chunks after the header, in file order. |
|  `data` | `Uint8Array` | The file the tokens were read from. |
|  `header` | [`MidiHeaderChunk`](https://chart-spec.enchor.us/scan-chart/api/index/interfaces/MidiHeaderChunk) | - |
|  `trailingStart` | `number` | Offset of the bytes after the last chunk, which run to the end of `data`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.