# Midi File

{% embed url="<https://youtu.be/LHKUI-TdYGI>" %}

Import single or multi-track MIDI files to drive audio-reactive behaviors.&#x20;

{% hint style="info" %}
MIDI files may be exported from any DAW (digital audio workstation) or audio software that supports MIDI files. Only binary files are supported.&#x20;
{% endhint %}

{% hint style="danger" %}
To import MIDI files into Unity, the file must be renamed with the extension ".bytes" (not .mid or .midi). This tells Unity to import the file as a binary asset, otherwise Midi File will be unable to read data from the file.
{% endhint %}

{% hint style="success" %}
To add a new instance, select from the main menu:

#### Tools > Timeflow > Add > Midi File

{% endhint %}

Midi File does not have any channels nor does it perform behaviors other than providing MIDI data to [Midi Tween](/timeflow/reference/behaviors/midi/midi-tween.md).

## Midi File Editor

Select the object to view its settings in the Inspector.

<figure><img src="/files/Nb0AlLXbSJQUagEwpvMB" alt=""><figcaption></figcaption></figure>

For common features, please see [Menu Bar](/timeflow/user-guide/timeflow-editor/menu-bar.md).

## Load Midi File

Drag and drop a MIDI file from the Project view into the field, then press the Load Midi File button to re-import the referenced file. This is a one-time setup though may be reloaded if any changes have been made to the file on disk.

## Timing

The timing is automatically imported from the MIDI file.&#x20;

{% hint style="info" %}
It is recommended to match the BPM of the file with the BPM set in Timeflow, however these parameters may be customized. If for example, the MIDI was exported at 110BPM it could be forced to remap to the Timeflow BPM or any entered.
{% endhint %}

### Time Scale

This scales the time of the MIDI file, making it faster or slower. Time Scale should have a value of 1 under normal conditions. However, this value can be changed for special purposes such as doubling or halving the tempo.

### Start Time

Shifts the starting time relative to Timeflow. In most cases this value should be 0, however this may be set to a specific time in seconds to align the MIDI file with an audio track starting at a later time.

## Note Adjustments

These controls have a global effect on how the notes from this Midi File are interpolated by [Midi Tween](/timeflow/reference/behaviors/midi/midi-tween.md).&#x20;

<figure><img src="/files/uA5TAqsHbDPHrODhrbsV" alt=""><figcaption></figcaption></figure>

### Min Attack / Release

Sets the minimum allowed value for any Midi Tween interpolating the notes from this file.&#x20;

{% hint style="success" %}
This can also be a quick way of setting attack and release values globally.
{% endhint %}

### Intensity

Scales the overall intensity of the note velocities. Use this to globally increase or decrease the intensity of Midi Tweens based on this file.&#x20;

## Tracks

Once imported, the contents of the MIDI midi file may be inspected. This is helpful to verify that the import succeeded and to verify that the note information appears correct.

<figure><img src="/files/Kz1N9ZNaFTxujgKOBsli" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
It is advised to not make changes directly to the values listed under Tracks, since it these values will be replaced on the subsequent import.
{% endhint %}


---

# 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://axongenesis.gitbook.io/timeflow/reference/behaviors/midi/midi-file.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.
