---
description: Load midi tracks from an asset file
---

# 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](midi-tween).

## Midi File Editor

Select the object to view its settings in the Inspector.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FUymjh8KIsL4Spg9GEr5M%2Fimage.png?alt=media&#x26;token=30a0a631-51c3-47c9-84c4-82b03b62224f" alt=""><figcaption></figcaption></figure>

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

## 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](midi-tween).&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2F2lCuFYfe74mtjhVyJhUJ%2Fimage.png?alt=media&#x26;token=cf3be7c1-c7c0-4583-bbe0-94baa8eca415" 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="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FQm7usV5Yzu5qgCs3ku4Z%2Fimage.png?alt=media&#x26;token=151361da-1d38-41b8-9233-fa58d74a193c" 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 %}
