Module Length

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Module Length

Post by Foz »

I don't suppose that GetModuleLength or something similar could be added for the next release?

I've checked the ModPlug dll and the function is there, but I can't access it through the PB framework - or I can't find it.
Tjomp
New User
New User
Posts: 2
Joined: Sat May 09, 2009 8:35 pm
Location: Norway

Post by Tjomp »

+1 on this request.

There are PB commands to get and set current position in the module, but no way to get the total length of the song. That makes the SetModulePosition command useless are there is no way to know what scope of input to give it.

Best regards
Tomas
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

If I remember correctly, soundtracks files don't have such information. Maybe in the newer formats (s3m for example), but I'm not sure. That's because modules have "looping" and "jump" functions, so a pattern can be repeated endlessly, and a song never end, so a song length information is useless. I have friends that are kind of specialists, I'll ask them.
Tjomp
New User
New User
Posts: 2
Joined: Sat May 09, 2009 8:35 pm
Location: Norway

Post by Tjomp »

You are indeed right about that. A songs length can not be dermined in Minutes or seconds due to loops and jumps. But I allways thought it was possible to read out information about how many patterns was defined in a module.

Please report back with what you find out. And thanks for replying.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

I'll ask when I'll see them. Here's the original mod. format : http://www.fileformat.info/format/mod/s ... 3/view.htm and the xm : http://www.fileformat.info/format/xm/corion.htm
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

djes wrote:If I remember correctly, soundtracks files don't have such information. Maybe in the newer formats (s3m for example), but I'm not sure. That's because modules have "looping" and "jump" functions, so a pattern can be repeated endlessly, and a song never end, so a song length information is useless. I have friends that are kind of specialists, I'll ask them.
You are right, i wrote a full module engine with PB and this took me a lot of time to find the better way to play wired tricks used by some sountrackers, it isn't perfect (still need allow full backward replay) but when you find how to handle them, then, calculating the song length is not that hard :)
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

I don't remember this old demo showing a great tune with a soundtracker patterns view, going an coming back as the "jump" options was used (and abused) by the composer :)
Post Reply