MIDI Player

By chad64 – Custom level – uploaded 23 Sep 2026 from Windows

Where to play?

Revision #4, updated 24 Sep 2026
PlayEdit 6 players liked this.
Issues trying to play levels? Troubleshoot issues playing levels

Play MIDI songs in Principia using synthesizers.
Convert midi files to a song string here.
Music(str) parses a song string (str) and returns a music object. Call music:play() every tick to advance playback (pause otherwise).

Properties (safe to read or set)

speed (default: 1) - Playback rate. 2 = double, 0.5 = half, negative = reverse.
volume (default: 1) - Loudness multiplier. 0 is silent.
loop (default: true) - Wraps to the start after the song ends plus loop_delay. If false, stops at the end.
loop_delay (default: 3) - Seconds of silence between loops.
transpose (default: 0) - Semitones added to every note. 12 = up an octave.
starting_frequency (default: 101) - First synthesizer's frequency channel. Each synth uses two channels (amplitude, frequency).
synthesizer_count (default: 1) - How many synthesizers are used; affects total frequency channels and max active notes.
decay_time (default: 1) - Seconds a note takes to fully decay. Keep above 0.
decay_curve (default: 3) - Shape of the volume decay. 1 is linear.
attack_time (default: 0) - Seconds to ramp up to full volume. 0 = instant.

Internal (read-only)

_duration - Song length in seconds, excluding loop_delay.
_elapsed - Current position in seconds (for progress bars).
_sheet - Parsed song: list of {delay, chord} entries.
_active_notes - Sounding notes as {age, pitch, slot}.
_n - Index of the next _sheet entry to play.
_t - Seconds since the last entry played.

Methods

music:play() - Advances one step (1/125 s at speed = 1).
music:seek(time) - Jumps playback to time seconds from the start of the song (0 restarts).

Downloads: 38 - Level ID: 1782

Comments

12 days ago potatogaming: thank you. i will see if it is
12 days ago chad64: @potatogaming probably. unless you use public domain music / make your own songs, midi versions of copyrighted music will still get you striked
12 days ago potatogaming: this is cool ! is the music copyrighted for youtube?