midi_time(3)
π midi_time(3) π
okay bestie, welcome to the Allegro manual β¨ this one's a tiny lil page about a big lil vibe: knowing when in the song you are, in actual seconds π
πΈ SYNOPSIS πΈ
#include <allegro.h>
extern volatile long midi_time;
β¨ DESCRIPTION β¨
so like. midi_time holds the position, in seconds, of the midi that's playing right now π
that's it, that's the whole girl.
and why do you care?? because if you wanna show your player where they are in the song in seconds β like a lil 1:37 / 3:12 situation β this is literally the variable you reach for π«Ά instead of, yk, trying to do math on beat numbers like some kind of feral gremlin π
it's declared extern volatile long, so it's just... sitting there, updating itself while the music goes πΆ you read it, you display it, you slay π
β οΈ heads up: it's volatile for a reason bestie β the midi thread is out here changing it whenever it wants, so don't go assuming it'll stay the same value between two reads. that's the whole point of the keyword, iykyk π
π SEE ALSO π
play_midi(3)β the one that actually starts the song π΅midi_pos(3)β same energy, but in beat number instead of seconds π₯get_midi_length(3)β so you can do the "of 3:12" part of the display π«exmidi(3)β the example, go look, it ate π₯
and that's the page, babe π¦ go forth and display timestamps like the main character you are β¨
π this was midi_time(3) from the Allegro manual, version 4.4.3 π mwah, love u, bye π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms