Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Support for SC-55 FLAC soundtracks #245

Closed
chocolate-import opened this Issue Dec 8, 2013 · 39 comments

Comments

Projects
None yet
10 participants

The following bug was originally reported on Sourceforge by twipley, 2012-08-23 12:24:48:

http://www.doomworld.com/vb/showthread.php?postid=1099612\#post1099612

The intended method for listening to Doom music is through a Roland SC-55 (Sound Canvas) piece of hardware.

In modern times, it is burdensome for such a card to be carried in a system, so the best thing to do would be to import high-fidelity recordings of the music to disk. Once FLAC music that way is stored there, one is to remove the SC-55 device from the system, and to use the imported files as accurate music output for the game.

However, the current Chocolate-Doom engine does not, not even from the command line, provide for any means for this intended music to be played out as a replacement for the supported MIDI-music playback.

The issue lies in the variance between the fact that MIDI playback through mere software VSC-55 does not do justice to the original game, and the one that the philosophy of the project is to, in the long-run, achieve maintenance of the original Doom experience in modern times.

Comment by twipley, 2012-08-23 15:03:49:

Of course, there would have to be some definite structure assigned to file names.

http://www.doomworld.com/classicdoom/info/music.php -- the MIDI-files structure could be adopted, bringing the files down to such names as:

e1m1.flac
e2m3.flac
intro.flac
victor.flac

Comment by fraggle, 2012-08-23 15:22:56:

It's a nice idea, and probably not very difficult to implement, as SDL_mixer already supports a bunch of different music formats. I think there should be some debate about format, as using FLAC would seem to be unnecessary overkill. MP3 or Ogg Vorbis would make more sense to me.

There's a slight complication in that the external music file should only ever replace a specific internal MUS - ie. if you run with a PWAD that changes the music, it should use the changed music, not run with the wrong track in "high quality". As I see it, the best way to do this would be to use some kind of content mapping configuration file, eg.

f572d396fae9206628714fb2ce00f72e94f2258f = e1m1.mp3
ee9e51458f4642f48efe956962058245ee7127b1 = e1m2.mp3

In the example above, each line has be a SHA1 or MD5 checksum of the original LMP, and the filename of the file to replace it with.

Doing it this way has several advantages: for example, some PWADs use original Doom MIDIs, which would automatically get played in high quality if the lump is identical. Also, plutonia.wad uses several music tracks from the earlier games (also E4).

Comment by twipley, 2012-08-23 22:10:48:

Thanks for the informative post.

MP3 or Vorbis should be fine; and, I agree, less of an overkill.

Comment by twipley, 2013-11-28 14:10:16.601000:

I already have correctly named sound files published by this audio expert going by a name I'm not sure to remember; should I convert those to MP3, or to Vorbis? Because then I could share, so everyone has the same files and by downloading those files too it might facilitate some of your work on this.

twipley commented Dec 15, 2013

I also believe, if I'm not mistaken, that all the sounds already are playing the way they were intended to be; it is just the music that needs the big audio files lying besides, in addition to some specifically-coded source port (CD), for accurate reproduction of the intended (gaming) experience.

twipley commented Dec 16, 2013

Also (not to be taken as an argument, because I do not feel this is a debate), it is interesting to note that after having beaten the last boss (third episode), there are birds to be heard. The software (default) Roland rendering do not do justice to these birds (they often simply do not get recognized as such animals). LogicDeLuxe's recordings, conversely, show them to their full extent -- in this case, they are clearly recognized as birds by anyone sane.

kkaden commented Dec 25, 2013

There is another individual whose work I've been following for a while. MusicallyInspired(Brandon Blume) has recorded sc-55 soundtracks from many games, his work on Duke3d's music was included in the somewhat recent Megaton Edition. He just released his recording of Doom's soundtrack in mp3, ogg/vorbis, and flac, and included loop points in metadata that are read in the zdoom source ports to properly loop the music

twipley commented Dec 26, 2013

link: http://sc55.duke4.net/doom.php -- nice. interesting; thanks for sharing!

EDIT: I am going to post Roth vs Blume lossless-recording comparisons later on.

twipley commented Dec 26, 2013

Here -- kopasite.net/up/1/doom-rc-55-soundtrack.torrent -- is the comparison. In the Roth folder lie LogicDeLuxe's encodings, and in the Blume one, MusicallyInspired's encodings. I have removed duplicate files from the Blume folder (for example, d_inter, which was, other than the metadata, the same than d_e2m3), although I hope I have not screwed things up in doing so (for example, metadata loop points which could have been different between such files).

kkaden commented Dec 27, 2013

They're both pretty good recordings, Roth's seems to have more reverb and/or other effects in some songs than Blume's. I'm not really sure though, it will require more listening... gasp not more Doom music =P

I wonder if we're the only ones interested in this for Choc-Doom

Oh, one thing with Blume is that he's going to continue on with his recordings of id Tech(doom engine) games' music. Doom 2 is next and Final Doom: Plutonia, then moving onto Heretic/Hexen/etc...

Roth did the soundtracks for Doom and Doom 2 then stopped recording, as far as I know.

Owner

fragglet commented Dec 27, 2013

Hi - I'm sure they're both great recordings but I'd appreciate it'd you'd keep discussion relevant to the bug at hand. It would probably be best if you moved this discussion about your favorite soundtracks to somewhere more appropriate, like Doomworld.

twipley commented Dec 29, 2013

Just a little update. Alright bewaring about the off-topicness. The seeking of "authentic" soundtracks is now being discussed over at: http://www.doomworld.com/vb/doom-general/66795-seeking-intended-doom-sc-55-music/

EDIT: the music pack from http://sc55.duke4.net/doom.php has been encoded in all of FLAC, MP3, and OGG, "support metadata loop-point tags for seamless looping tracks," and seem to adequately represent the intended in-game music.

fragglet added a commit that referenced this issue Apr 6, 2014

music: First code for HQ music substitution.
This adds support for high quality music packs that replace Doom's
built-in MIDI music with digital recordings. In particular this allows
recordings of the Roland SC-55 to be used in Chocolate Doom. This is
the first essential step for bug #245.
Owner

fragglet commented Apr 6, 2014

Code is now in place to support this. You need a specially constructed config file. An example is found here:

https://soulsphere.org/random/doom1-music.cfg

If you're using a Unix system (including Mac OS) then place this config file and your .flac files in ~/.chocolate-doom/music and it should work automatically.

There are some extra hurdles still to overcome:

  • The version of SDL_mixer included with the Windows and Mac builds does not include library support for FLAC or MP3, which is needed to support this. It should just be a recompile but it will require some build changes.
  • So far we only have recordings for (some of) Doom 1's levels. I would really like to get some high quality recordings of the music for all the IWADs - including Heretic, Hexen and Strife.
Owner

fragglet commented May 2, 2014

For reference, the loop point metadata tags defined by zdoom are now supported, which means that Brandon Blume's SC55 recordings are now properly supported.

Hey, guys. I'm Brandon Blume, the one who made the SC-55 music packs (http://sc55.duke4.net/). I was wondering what I needed to do to test my newly released Doom II music pack with Chocolate Doom. I've been having some odd problems with ZDoom with the metadata loop tags and I wanted to ensure that it was specific to ZDoom. I understand there is a special config file I need to have. The one listed on this page I assume is for Doom 1 only (having the filenames of the Doom 1 tracks). Could I get or create a similar config file for Doom II if possible?

Owner

fragglet commented Oct 8, 2014

Hi @MusicallyInspired, I just realised that I never got back to you and answered your question.

I believe there are currently some problems with getting the FLAC/Ogg playback working on Windows, and I'm not sure anyone has got it to work yet. It works on Mac and Linux though, so if you have a Linux install on your machine you could possibly try using that for the time being.

You do indeed need a special configuration file to make this work. I have a repository here with configuration files for all the different games supported by Chocolate Doom:

https://github.com/chocolate-doom/music-packs

These configuration files should work, but I don't have FLAC recordings that I can use to test them yet - apart from your Doom 1 music recordings of course.

Thanks. I don't have a Linux install at the moment, but at least I can point people in the direction of this page for those config files if they have any questions.

Also, my Doom II music pack has been done for a while now, you can get it from the website. sc55.duke4.net

Owner

fragglet commented Oct 24, 2014

The Doom II music pack sounds really nice! Unfortunately for some reason the title screen doesn't seem to play. I'll have to investigate and find out why (it plays back fine in VLC, so it's not corrupted).

Owner

fragglet commented Oct 24, 2014

LOOP_START=0
LOOP_END=0

that might be something to do with it :/

That's because it doesn't loop. It should play normally if both values are zero. It does on everything else (EDuke32, ZDoom/GZDoom).

Owner

fragglet commented Oct 24, 2014

Yep, fair enough then. I'll change the behavior to match other ports.

fragglet added a commit that referenced this issue Oct 24, 2014

Ignore loop tags on non-looping substitute tracks.
If a substitute music track is played in a non-looping configuration
(eg. the title screen music), ignore loop tags in the file to be
consistent with other source ports. This fixes a bug that was discussed
on #245.

chungy added a commit to chungy/chocolate-doom that referenced this issue Apr 7, 2015

Ignore loop tags on non-looping substitute tracks.
If a substitute music track is played in a non-looping configuration
(eg. the title screen music), ignore loop tags in the file to be
consistent with other source ports. This fixes a bug that was discussed
on #245.

twipley commented Apr 30, 2015

Hey there! a few questions about this:

1a) are the d_bunny, d_inter, d_intro, and d_victor tracks looping or supposed to loop? what is the correct/intended behaviour?
1b) and if the intermission music is not supposed to loop, it is to be remembered d_e2m3 is supposed to (as far as i know).

  1. i am noticing a few holes there. https://github.com/chocolate-doom/music-packs/blob/master/doom1-music.cfg -- or rather, a few inconsistencies. blume, to take him as a reference, chooses d_e2m9 over d_e3m1 for the naming. here is a file list http://i.imgur.com/1qz9nlz.png -- should that be used as a standard?

  2. just as a footnote; not really a question: i have no checksum match for those doom1-music.cfg -- using either boosted or raw versions. it is getting me curious.

Owner

fragglet commented Apr 30, 2015

1a) I don't think these are supposed to loop, except d_inter.
1b) Shouldn't make a difference as although they're the same audible song they're different lumps in the WAD
2) Maybe. The music-packs files are (currently) just an example of some good configurations. They're not designed for use with any particular set of recorded music. As mentioned in this bug, there are a couple of different such recordings. I'd be happy to standardize on a particular naming scheme though.
3) I don't understand. What checksum?

twipley commented Apr 30, 2015

here are my tries at it:
http://kopasite.net/up/0/raw_doom1-music.cfg
http://kopasite.net/up/0/boosted_doom1-music.cfg

for these two (blume-encoded) packs:
http://sc55.duke4.net/flac/doom_sc55_flac.zip
http://sc55.duke4.net/flac/doom_sc55_flac_raw.zip

The file-naming system I am proposing is one that follows an alphanumeric logic: the second and later occurrences are simply left out both in the music folder and in the related cfg file, and it is always the first occurrence (e.g., d_e2m9 rather than e3m1) that is to be called by Chocolate Doom. This is the system Blume uses as the duplicates he tells, are unneeded because his are just copies of the same base files.

twipley commented Apr 30, 2015

I wonder if, in Windows, line endings should be set to "Windows" and the slashes in the cfg files be backwards (e.g., ) instead of forwards.

In any case, I'll stay tuned and will test those when compatibility with x86 XP systems or such is achieved. To not hesitate to drop a line here if you need beta testing on the indev master branch!

Owner

fragglet commented Apr 30, 2015

The file-naming system I am proposing is one that follows an alphanumeric logic: the second and later occurrences are simply left out both in the music folder and in the related cfg file, and it is always the first occurrence (e.g., d_e2m9 rather than e3m1) that is to be called by Chocolate Doom. This is the system Blume uses as the duplicates he tells, are unneeded because his are just copies of the same base files.

Sure, seems like a logical enough system.

I wonder if, in Windows, line endings should be set to "Windows" and the slashes in the cfg files be backwards (e.g., ) instead of forwards.

Better to use Unix format and forward slashes for portability.

twipley commented May 1, 2015

Ok nice, for reference that's what the above cfg files for music were set to.

Contributor

chungy commented May 1, 2015

  1. just as a footnote; not really a question: i have no checksum match for those doom1-music.cfg -- using either boosted or raw versions. it is getting me curious.

It looks like you're trying to match the SHA-1 of your FLAC files rather than the SHA-1 of the music lumps within the WAD. Use chocolate-doom -iwad doom.wad -dumpsubstconfig doom1-music.cfg (for example) to generate the initial file, then add in your file paths (with forward slashes) without modifying the SHA-1.

For what it's worth, I think the documentation needs to be better, it's nearly non-existent. I ran into the same roadblock the first time I tried to configure it.

twipley commented May 1, 2015

I really am having problems doing things under Linux, so I'll wait for the Windows implementation to test this out.

I hear some (#428) have already got it working under Windows, so it's a big hope for us under x86 XP (or such systems).

twipley commented May 1, 2015

here is another try at it (thanks chungy!):
http://kopasite.net/up/0/doom1-music.cfg

each lump should find its way to the appropriate flac file.

there are 23 flac files, plus this cfg file, to be put in the music folder.

feedback would be appreciated!

footnote:

Blume said somewhere he could generate the below files using his tools and expertise, but as plume states it (cf. http://www.doomworld.com/vb/post/1284152), audible differences seem just for three out of those five, and are quite trivial so publishing extra audio files for this might well not be worth the trouble.

36b14bf165b3fdd3958ee83e4929063f051ada2f = d_e3m5.flac
e77c3d42f2ea87f046074bd4e3ff1e535da1c653 = d_e3m6.flac
3d85ec9c10b5ea46556899cfba701a556e27ca34 = d_e3m7.flac
4d42e2ce1c1ff192500e7a08e72c85fe59741487 = d_e3m9.flac
b2e05b4e8dff8d76f8f4c3a724e7dbd365390536 = d_inter.flac

twipley commented May 7, 2015

The file I posted just above has been tested working. Just extract http://sc55.duke4.net/flac/doom_sc55_flac.zip in ./chocolate-doom/music together with http://kopasite.net/up/0/doom1-music.cfg and select "Native MIDI" as music device in the sound options of chocolate-doom-setup -- great audio!

It seems the music loading works on windows builds of Chocolate Doom 2.1.0 using the set of DLLs from Crispy Doom 2.3.

Standard things apply; set up the music .cfgs with correct paths, select Native MIDI for the music device.

(Edit: Works fine in XP.)

twipley commented May 25, 2015

Good to know!

plume said he got it working too, but IIUC, by going at the source: http://downloads.xiph.org/releases/flac/flac-1.3.1-win.zip

@jmtd jmtd added sfx music and removed sfx labels Sep 4, 2015

Danfun64 commented Apr 8, 2016

On my (Xubuntu 15.10 x86_64) system, when some flacs loop, this is a bit of studder for some reason.

Contributor

haleyjd commented Apr 8, 2016

SDL(2)_mixer sometimes have issues keeping the music buffer full because it doesn't read far enough ahead. I've had this problem on my own PC in Strife:VE, Noctropolis, and Turok EX, if something else is doing a lot of disk reads or using tons of CPU (typically this turns out to be Firefox and/or Flash).

twipley commented Apr 15, 2016

It would be much welcome to receive an official statement regarding this under Windows.

In other words, is an official way to make this work (under Windows) planned (to be programmed), or does the author (fraggle) endorse one method or the other from those which were posted (here) back in the end of may (2015)? Are both equivalent in operation and sufficient in value?

Owner

fragglet commented Apr 15, 2016

I'm not sure exactly what you want a statement on, but if the question is about when music packs will be officially supported on Windows, the answer is that the DLLs will be packaged with the 3.0 release (SDL2 port). See my email here from a few months ago:

https://groups.google.com/a/soulsphere.org/forum/#!topic/chocolate-doom-dev-list/tfr-FKhfBKU

twipley commented Apr 30, 2016

Thanks for the quick answer.

Would it be possible to know, will these be the same DLLs as the ones from the FLAC website or from the Crispy Doom project?

Owner

fragglet commented Jan 27, 2017

Late answer but we're building our DLLs from source. You can check out the sdl2-branch betas at http://latest.chocolate-doom.org which include them.

I'm closing this bug as I think it's now complete. Digital music packs will be in the 3.0 release.

@fragglet fragglet closed this Jan 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment