midi_seek(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ midi_seek(3) ✨

okay bestie, welcome to the Allegro manual β€” this one's midi_seek, and it's giving skip-to-my-lou energy for your MIDI files πŸŽ€


🌸 NAME 🌸

midi_seek β€” seeks to the given midi_pos in the current MIDI file. Part of the Allegro game programming library, iykyk πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

int midi_seek(int target);

⭐ DESCRIPTION ⭐

so basically? this function seeks to the given midi_pos in the current MIDI file. that's the whole vibe. ✨

but here's the lil detail that matters: if the target is earlier in the file than the current midi_pos, it seeks from the beginning πŸŒ€. otherwise (target is later, or wherever), it seeks from the current position. no cap, that's literally how it works β€” no rewinding from the middle, she goes all the way back to the top.


πŸ’– RETURN VALUE πŸ’–

okay so the return value is doing a lot of talking here, so let's break it down fr fr:

  • 0 β€” slay! it successfully seeked to the requested position. we love to see it 🫢
  • 1 β€” it stopped playing, and midi_pos is set to the negative length of the MIDI file. and bestie, that's actually a hack β€” you can use this function to figure out the length of a MIDI file πŸ‘‘ iconic behaviour honestly.
  • 2 β€” the MIDI file looped back to the start πŸ”. it went around again, main character energy.

🌈 SEE ALSO 🌈


and that's the whole page, bestie!! πŸŽ€ this lil cutie is from Allegro version 4.4.3 β€” go forth and seek responsibly, mwah πŸ’–πŸ’…βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from