Closed Ozzyboshi closed 5 months ago
What LSP mode are you using? getpos is only supported in "standard" mode ( ie no "insane" nor new "micro" mode ). Did you double check the you're using "-getpos" command when building the data? ( and use the right .lsmusic file ). If it persists, could you send the .mod file so I can have a look?
this is how i use lsp, dont know if it's the correct way
https://github.com/Ozzyboshi/tunnel/blob/6055c3e4eac49ab1db4dbfa60d704d12d9f43ea8/tunnel.s#L343
the modfile is this https://github.com/Ozzyboshi/tunnel/blob/lsp/music/ozzyvirgil3.mod
yes i used -getpos when launching lspconvert, i remember this resulted in 4 extra bytes inside lsmusic file or something similar.
I saw you added the micro mode, i will try also this since it's meant to be a 4k prod, if you can help with compression i would be very grateful
but your mod file has only 1 position in the sequence. So yeah getpos will always returns 0. If you add a second position in the mod sequence you'll get 0 then 1 then 0 again when music loop. ( get pos returns the position in the current mod sequence )
i think my issue is a similar, so i add to this thread. i expected something else from this function, i.e. the play position as a combination of the current pattern(or sequence) and the row in that pattern (0..63). kplayer and the player return it like that and i use that for my timing. can haz, please?
ok , let's start to define what is a position in the sequence, for me is the row of the pattern. this piece of data would be helpful in case you want to sync your demo to the music. For what I understand this is not what getpos reports, right? Is it the pattern number? Anyway, in order to sync I added this instruction to the replayer:
https://github.com/Ozzyboshi/tunnel/blob/6055c3e4eac49ab1db4dbfa60d704d12d9f43ea8/lsp.s#L180
this will write a bit at a particular mem location whenever the sample start playing, according to the channel in use. It's up to my demo to reset the bit after it has been used.
In simple case scenarios it works, at least, it's fine for me.
it's not the pattern "id". It's the position in the music sequence, that could go only from 0 to 127 in MOD format. You can't sync within a pattern ( would bloat music data file ). If you want to fine-sync at a specific point you could also keep a music frame counter updated on your side. ( each time you call LSP_Tick you incrmeent a frame counter ). And have a hardcoded list of counter where you want to sync
thx for your suggestion, i think this issue can be closed then
I call jsr LSP_MusicGetPos once per frame (not inside ad interrupt), I would expect the lower word of d0 to report some number after jsr is done but I always get 0.
Of course when converting I added -getpos at the end of the command as argument and I see the following message after conversion : GetPos enabled (0 bytes)
This is how I am launching the player
Am I doing something wrong?