midi_loop_start(3)

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

πŸ’– midi_loop_start(3) πŸ’–

ok so bestie, we're in the Allegro manual today and this is a page about two little global variables that live in the Allegro game programming library. They're called midi_loop_start and midi_loop_end, and together they're giving "loop start and end points" energy. no cap.


✨ NAME ✨

midi_loop_start, midi_loop_end β€” the loop start and end points, set by play_looped_midi(). Allegro game programming library. πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro.h>

extern long midi_loop_start;

extern long midi_loop_end;

like, that's it. two extern longs. they're just out there, existing, in the global namespace, living their best life. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

ok so these two are the loop start and end points, and they get set by the play_looped_midi() function. that's the whole vibe. 🌈

here's the tea though β€” you can safely alter them while the music is playing. yes bestie, live-editing, main character energy, we love that for you. BUT (and this is a big but) you gotta be sure they're always set to sensible values, meaning:

  • start < end

fr fr. keep it sensible. the moment you don't, that's not it. 😭

⚠️ and if you're changing both of them at the same time? make sure you alter them in the right order, because a MIDI interrupt could literally happen in between your two writes. not me getting jumpscared by an interrupt mid-assignment πŸ’€

also iconic: setting these values to -1 represents the start and end of the file respectively. so -1 = "beginning of file" for the start, and -1 = "end of file" for the end. yes, same number, different meaning, depending on which one you're writing. she contains multitudes. ✨


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie! this absolute banger of a manual page came to you from Allegro, version 4.4.3. go forth and loop responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from