---
name: "midi_pos"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/midi_pos"
---

# midi\_pos(3alleg)

Stores the current position in the MIDI file. Allegro game programming library.

## NAME

midi\_pos - Stores the current position in the MIDI file. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**extern volatile long midi\_pos;**

## DESCRIPTION

Stores the current position (beat number) in the MIDI file, or contains  a negative number if no music is currently playing. Useful for  synchronising animations with the music, and for checking whether a MIDI  file has finished playing.

## SEE ALSO

[**play\_midi**(3alleg)](/play_midi/3alleg.md), [**midi\_msg\_callback**(3alleg)](/midi_msg_callback/3alleg.md), [**exmidi**(3alleg)](/exmidi/3alleg.md)
