Added: 1 year ago
From: Bisqwit
Views: 900
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (14)

Sign In or Sign Up now to post a comment!
  • amazing

  • Hi, I make also my own S3M player it work on a PIC32 microcontroller (vid Gg9AeQXbcFM)

    Pascal

  • Is there an easy way to get the song length in seconds from an s3m (and mod/it/xm) file?

  • @blenderpanzi I presume you are looking for such an application. Find a mod player that can output the audio into stdout (or into a raw wavefile); play the mod/s3m/xm, and then measure the produced file length, and divide it by number of bytes per second.

    For example if the produced output is 123000000 bytes, and the wavedata is 48000 Hz 16-bit stereo, the song was 123000000/48000/2/2 = 640.625 seconds long. 640.625 seconds translates to 10 minutes and 40.625 seconds.

  • @Bisqwit No I want to implement taglib support for mod/s3m/it/xm. Currently I support only a few audio properties, the title tag, the comment tag (which is derived from the sample/instrument names) and a trackerName tag (only writable for xm). I'm missing the song length (in seconds). Adding a dependency to a mod player lib is no option because the point of taglib is not to need such dependencies. See github dot com slash panzi slash taglib.

  • @blenderpanzi Ah. Well, there is really no simple way, because the song is really a program of a sorts. You have to scan the patterns row by row, keeping track of tempo changes and following any requests to jump to a different row / different pattern or different order, until you are directed back to an exact combination of row+order that you have visited before, and measure what was the combined duration of the rows you just scanned according to the tempo that was active at that time.

  • @blenderpanzi: Examples of things that can thwart calculations: Changing tempo/speed in the middle of a pattern. The same pattern being played twice, at different tempo. Jumps into the middle of a pattern. Jumps out from the middle of a pattern to another pattern. In-pattern loops. Row repeats: a row is played N times before moving to the next row. In short, finding the length requires good understanding of each file format, and the meaning of pattern commands. Many mod players get it wrong.

  • @Bisqwit Ah. Well then I simply don't support the length property.

  • cool I wrote backwards.s3m haven't heard that one in a while :)

  • @bpaterson Ah nice to meet you Brett :)

  • Satellite One was not featured in Second Reality!

    Pretty awesome though, I've always thought about writing a MOD player so I don't have to use much bigger OGG or MP3s when producing music for my games (and to be generally awesome).

  • Hey, neat stuff, but the link with the source doesn't work. I really wanted to have a look at the code :(

  • Works for me... What are the symptoms for you it not working?

    Just in case it is because of some previously-unallocated IPv4 address range becoming available and you being a "victim" of that, I opened the firewall again a bit. Try again...

  • @Bisqwit: It wasn't able to connect, but it works now! Thanks so much! Looking forward to reading the code.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more