Hydrogenaudio Forums

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: kode54 on 2008-10-08 06:13:14

Title: AdPlug
Post by: kode54 on 2008-10-08 06:13:14
Now available for foobar2000 0.9. [download (http://kode54.foobar2000.org/foo_input_adplug.zip)]

Currently, the only OPL emulation core available is the MAME OPL core, since this is the only one which is multi-instance safe. Ken Silverman's emulator will require some work for that.

Note that MID, MSC and S3M files need to be renamed to MIDA/MSCA/S3MA to work with this component, to prevent extension collisions.

Also, if you have foo_midi installed, you will need to update it to the latest version (dated October 7, 2008, or later) so it won't take over CMF files.
Title: AdPlug
Post by: alvaro84 on 2008-10-08 08:12:20
Man, you made my day
I've been waiting for this one for years. Now the only missing input component is a bass-based plugin which is small, fast and can use .sf2 instruments...
Title: AdPlug
Post by: Nahkranoth on 2008-10-08 08:19:03
Holy crap! Kode54, you're the man! I've waited for this for so long
Title: AdPlug
Post by: akispavlopoulos on 2008-10-08 14:14:12
what exactly is doing this component???
Title: AdPlug
Post by: kode54 on 2008-10-08 21:05:06
Update: ADL files shouldn't crash now, and CMF files should play correctly. Also, fixed database support.
Title: AdPlug
Post by: alvaro84 on 2008-10-09 07:08:13
what exactly is doing this component???


It's an input plugin for various AdLib sound formats. It emulates the OPL chip like the SID input emulates the SID chip (OK, not exactly, beacuse SID files need emulation of other C64 hardware components as well).
Title: AdPlug
Post by: akispavlopoulos on 2008-10-09 13:29:05
thanks! Any links toread and learn more about these OPL chip and SID etc?
Title: AdPlug
Post by: Slipstreem on 2008-10-09 14:49:12
Look HERE (http://en.wikipedia.org/wiki/Yamaha_YM3812) and HERE (http://en.wikipedia.org/wiki/MOS_Technology_SID).

Cheers, Slipstreem. 
Title: AdPlug
Post by: Suhamer on 2008-10-14 18:43:48
kode54, you are now officially my hero. Many thanks for this.
Title: AdPlug
Post by: Arthur on 2009-11-15 18:30:30
hi, Kode54. As always, great plugin, I've wanted this for foobar for a while. Hopefully this isn't a too hard of a feature to add, but, the ability to selectively disable formats played by the plugin. this would be good, for instance, in my case, where I want to use an alternate plugin to handle edlib d00/d01 files. Could this be added?

arfy
Title: AdPlug
Post by: romor on 2010-08-16 21:57:41
Are there plans for implementing stereo harmonic mode, introduced in AdPlug 2.2 (surroundopl.h)

Interested can sense the difference with AdPlug plugin for Winamp
Title: AdPlug
Post by: kode54 on 2010-08-18 01:30:24
I already have a recent version of AdPlug, but I didn't really look at that new feature when I updated.

I've added support for the surround effect, but it disables support for OPL3, although I don't think any formats use that yet.
Title: AdPlug
Post by: romor on 2010-08-18 09:12:50
Thanks kode54, I didn't expected so fast implementation

Sounds great and IMHO it was good idea to add such nice, tiny, mono to stereo, phaser-like effect for OPL emulator playback

It was also introduced in the latest (1.8.2) binary of the mentioned Winamp plugin (without source code as of now AFAIK) and qualified for particular emulators differently (perhaps because of mame patches, but I don't really know)
Title: AdPlug
Post by: Videogamer555 on 2010-11-10 05:15:34
I got the AdPlug plugin, but it comes with a "db" (database I assume) file. Where should I put that, and is it actually needed to play any of the music?
Title: AdPlug
Post by: kode54 on 2010-11-10 07:50:25
If you are using foobar2000 1.1 or newer, just use the built-in Install feature in the player. Open Preferences, which starts at the Components page the first time you use it after starting the player, then either click the Install button and locate the ZIP file, or drag the ZIP file onto the Preferences dialog.

If you are using an older version, just unpack the whole archive to the components folder, the db file should be in the same directory as the component.
Title: AdPlug
Post by: deus-ex on 2010-12-29 13:02:13
Adlib Tracker II has been open-sourced and released to the public, source code can be downloaded here: http://sourceforge.net/projects/at2-osp/files/ (http://sourceforge.net/projects/at2-osp/files/)

I imagine this could offer several opportunities to improve the current AdLib plugin, for example complete support for A2M modules and its compressed version A2T. Adlib Tracker II's replay quality is more accurate compared to AdPlug, you may wan't to try the Winmap input plugin port provided by Danyl for comparison: In_Adt2 v0.96.2 (http://ftp://ftp.modland.com/pub/software/players/Windows/Winamp/input%20plugins/In_AdLibTracker2%20Player%20v0.96.2%20(YMF262%20CVS%202009-01-01).rar)

Adlib Tracker II supports the following formats:
Title: AdPlug
Post by: mudlord on 2010-12-31 03:34:27
I looked at the code, since I was interested in making another input component...

Then I found out the code was all in Pascal, something which the FB2K SDK will most likely never support....
And porting all that Pascal/Delphi code to C?

Bah...>_>
Title: AdPlug
Post by: deus-ex on 2010-12-31 10:45:01
That's a pitty to hear. Maybe the source code of the Winamp plugin port can be of any help to support the task? It is included with the plugin and can be accessed via this link: http://home.versanet.de/~daniel-illgen/inadt2.zip (http://home.versanet.de/~daniel-illgen/inadt2.zip)
Title: AdPlug
Post by: mudlord on 2010-12-31 14:43:22
checked the code, just as bad...

All Delphi/Pascal with inline ASM.
Title: AdPlug
Post by: kode54 on 2011-01-01 09:04:38
It may be useful for anyone willing to add support for the relevant formats to AdPlug. Or "fix" the already supported formats that may be "broken." Although it would all be a matter of totally rewriting all of it.
Title: AdPlug
Post by: deus-ex on 2011-01-01 12:03:15
I understand that it's rather unlikely to happen due to the reasons you explained. Anyway, thank you both Kode54 and mudlord for taking a look at it.
Title: AdPlug
Post by: Vagabond on 2011-02-28 18:23:17
Anybody know anything about extracting AdLib music from games? Desiring to rip the music from an old platformer called Gateworld, but have no idea where to begin. Any hints?
Title: AdPlug
Post by: romor on 2011-02-28 18:55:35
There is no general tool for all possible formats.
I first try WinRipper: http://www.keygenmusic.net/?page=soft/soft&lang=en (http://www.keygenmusic.net/?page=soft/soft&lang=en) which is great for general module formats, but as you are asking about AdLib without specifying format maybe only way would be by hand

Not sure if emulators provide OPL capturing, but you can check that also

[edit] I found the game at HOTUD
There are 3 XMIDATA.GW_ packed files with XMI modules
WinRipper unpackes them fine, but foo_input_adplug (and/or foo_midi) can't play them
There seems to be tool for converting XMI to MIDI, but I stopped at this step
Title: AdPlug
Post by: deus-ex on 2011-02-28 22:07:35
Anybody know anything about extracting AdLib music from games? Desiring to rip the music from an old platformer called Gateworld, but have no idea where to begin. Any hints?

One could easily think of AdLib when listening to the music of GateWorld, but it is not, the game utilizes the XMI (eXtended MIDI) music format by RAD Game Tools.

Though you certainly won't be able to recreate the music with any modern player supporting the XMI format like you hear it in game. This is due to the format using individual configuration files (*.opl) which hold presets for the instruments which in turn affect the sound. When using a different .opl file than the one distributed with the game or none at all (thus forcing default presets) will result in completely different and most of the time off sounding music. To my knowledge none of the current players with XMI support do honor these .opl files, for example the MIDI plugin foo_midi for foobar2000 or XMP-MIDI.dll for XMPlay.
Title: AdPlug
Post by: kode54 on 2011-03-01 02:40:53
Supporting .opl files with XMI files sounds more like a job for AdPlug than any General MIDI supporting player.
Title: AdPlug
Post by: Vagabond on 2011-03-01 15:18:40
Thanks for the responses, everyone! I utilized the tools that romor pointed out, and did indeed successfully extract the music. I then played it with SSPlayer, a player designed for System Shock. However, deus-ex is right in that the timing and instrumentation was off. A more grunt-work approach may be necessary (recording with DOSBox manually). It would be great to access the music directly instead of doing methods like this.
Title: AdPlug
Post by: kode54 on 2011-03-01 19:41:02
The timing for the XMI files in foo_midi should be spot on now, the only problem would be that they're designed for Adlib playback with custom instrument sets.
Title: AdPlug
Post by: Vagabond on 2011-03-01 20:31:12
The timing for the XMI files in foo_midi should be spot on now, the only problem would be that they're designed for Adlib playback with custom instrument sets.


Ah, you're right; the timing is just fine. It is just the awkwardness of hearing banjos and telephone rings in placement of eerie synth!
Title: AdPlug
Post by: kheops on 2011-09-02 21:16:35
hi all

i'm using foo_midi 1.141
some xmi files i have make foobar crashes (for the game "lands of lore" for the older ones here )
the same files play pretty fine in winamp but using winamp isn't an option

i'm wondering if i could upload one file and give a link here (just 10kb) for kode54 to have a look

is this ok ?

take care
Title: AdPlug
Post by: kode54 on 2011-09-10 04:27:52
Upload at will.
Title: AdPlug
Post by: kheops on 2011-09-14 12:12:43
files are here kode54
http://www.hydrogenaudio.org/forums/index....showtopic=90789 (http://www.hydrogenaudio.org/forums/index.php?showtopic=90789)
thx for your time
Title: AdPlug
Post by: kode54 on 2011-09-17 04:16:22
AdPlug does not handle those files, and foo_midi does not crash on them. I have fixed it so that it will read them now, though.
Title: AdPlug
Post by: kheops on 2011-09-24 20:39:52
thanks for the fix, it seems "my" xmi are broken, i wasn't aware of that of course

take care
Title: AdPlug
Post by: kode54 on 2011-09-25 15:21:11
Not explicitly yours, but maybe the game's. The issue with several of these files seems to be that one of the main nested chunks lists a static number as its size instead of the actual size, and that the EVNT chunk for the main MIDI stream seems to be missing the zero byte after the FF/2F end of track meta event, even though it's included in the length field for that chunk. It's the latter problem which caused the actual parsing errors.
Title: AdPlug
Post by: kcowolf on 2012-02-03 07:52:55
If I have this foo_input_adplug.dll and foo_midi.dll (both latest versions), can I do anything to force the AdPlug component to handle .lds files instead of the MIDI component?
Title: AdPlug
Post by: kode54 on 2012-02-03 11:55:16
Rename them to .ldsa.
Title: AdPlug
Post by: kcowolf on 2012-02-04 02:37:39
Works great!  Thanks for the quick reply.
Title: AdPlug
Post by: kode54 on 2012-02-04 04:05:53
The same trick goes for .mid(a), .s3m(a), and .msc(a). Although, some day, I'll probably incorporate a passable (possibly tandem) AdLib emulation based MIDI driver into foo_midi, just for kicks. It will also support multiple loadable instrument banks, such as the widely used Fat Man set, featured in such games as Hocus Pocus, and included in the MSOPL driver. Or the Duke Nukem 3D patch kit. Or the Doom engine games, which had layered 2 operator instruments, and also had slight variations between different game franchises. I could probably adapt the MIDI driver from AdPlug to work with all of those, and also work under my own MIDI player loop.

My MIDI component utilizes MIDI parsers which turn various formats into basic multi-track MIDI sequence data in an internal format, with functions to turn that data either into a timestamped event stream, or a Standard MIDI File. All of the current player drivers, except for the disabled DXi player, use the event stream data. I just need a MIDI driver which is capable of accepting raw MIDI events, and rendering sample data between sets of events to simulate time passing. The only special case is the VSTi driver, which I moved out to its own process because some VST plug-ins are so crashtastic.
Title: AdPlug
Post by: Nahkranoth on 2012-02-04 08:36:49
The same trick goes for .mid(a), .s3m(a), and .msc(a). Although, some day, I'll probably incorporate a passable (possibly tandem) AdLib emulation based MIDI driver into foo_midi, just for kicks. It will also support multiple loadable instrument banks, such as the widely used Fat Man set, featured in such games as Hocus Pocus, and included in the MSOPL driver.


So one can listen to adlib version of Ultima Underworld's *.xmi and they will sound exactly like in the game? 


I knew that this day will come! 

Title: AdPlug
Post by: newbie!(*) on 2012-02-04 14:39:19
Thank you so much for this plugin!

I've always wanted to listen to music from the Xargon trilogy.

I realized that by renaming the music files (examples: SONG_1.XR3) to .cmf, this is possible.

The music is "exactly" what you hear in the game.

Great job! 
Title: AdPlug
Post by: cosmos816 on 2012-02-24 23:18:11
Any chance to play Westwood ADL files? The latest plugin version does not seem to support the extension while vanilla adplug/adplay do.

Perhaps it is simply disabled due to some known problems with format support in the library atm? Dune II files are a no-go in particular, which is a great disappointment.

P.S. Great plugin, thanks a lot!
Title: AdPlug
Post by: kode54 on 2012-02-25 17:04:20
Westwood ADL is disabled for that exact reason. I don't want to enable it until all supported files play without crashing.
Title: AdPlug
Post by: C_Gear on 2012-09-23 14:59:06
Excuse me, we are the authors of the RIX decoder part of AdPlug. Recently we have modified our code. A bug was fixed to make our rix simulation more close to its original sound. Would you please update your codebase with upstream cvs and give us a test build?
Thank you very much!
Title: AdPlug
Post by: kode54 on 2012-09-24 13:53:16
Done.
Title: AdPlug
Post by: C_Gear on 2013-02-07 04:02:55
Done.

Thank you very much! The rix simulation is closer to its original sound since V1.41. 
Title: AdPlug
Post by: TheAlmightyGuru on 2013-09-16 23:03:38
Love the AdPlug plugin for foobar2000, I've noticed that it seems to have a more accurate overall sound than the Winamp build. Thanks for making it available.

One thing that would be nice to see on the input configuration is the ability to loop a song X number of times and have a fade out of X seconds. I love converting old game music into FLAC for my MP3 player, but it's not easy to do when my only options are play once or play indefinitely.

A lot of chiptune player designers have added the play X loops and fade out options, (DUMB Module Decoder, Game Emu Player, Highly Experimental, etc.), so a lot of people appreciate when they're added.

Keep up the great work!
Title: AdPlug
Post by: kode54 on 2013-09-17 12:16:28
The current design of AdPlug doesn't really afford me the loop start offset or loop length. It only reports when a track has looped once, and doesn't report where it has looped to.
Title: AdPlug
Post by: TheAlmightyGuru on 2013-09-17 15:48:09
The current design of AdPlug doesn't really afford me the loop start offset or loop length. It only reports when a track has looped once, and doesn't report where it has looped to.


Okay, thanks for looking into it. And keep up the amazing work, you're a coding machine!
Title: AdPlug
Post by: Wormbo on 2014-03-28 18:51:20
Replay gain support would be nice. Would it be possible to add that?
Title: AdPlug
Post by: TheAlmightyGuru on 2014-06-02 19:14:13
I was recently listening to the Tyrian soundtrack (Loudness format, *.lds) and found that the music sounded pretty bad, so I played it in the old Winamp AdPlug, and it sounded accurate. After trial and error of disabling plugins, I found that the problem was with the MIDI plugin taking precedence and playing the music inaccurately. I came here and found your work-around, changed the file extensions to *.ldsa, and everything now sounds spot-on again. But this made me think, why do you even bother with having LDS format supported in the MIDI plugin when AdPlug plays the sound properly?

Anyway, thank you so much for porting this plugin and being an all-around awesome coder!
Title: AdPlug
Post by: kode54 on 2014-06-03 09:09:20
The MIDI plug-in plays them with their General MIDI instruments. It is likely to sound worse than the Adlib version if you don't use either BASSMIDI with an appropriate collection of SoundFonts, or a VST instrument with GM capability.
Title: AdPlug
Post by: Supermansaga on 2015-09-21 00:58:05
Thanks guys! I think the description page for http://www.foobar2000.org/components/view/foo_input_adplug (http://www.foobar2000.org/components/view/foo_input_adplug) should be much more clear though. I mean actually list out the file types supported by this plug-in, for example, the RIX files. I saw the following list here http://adplug.sourceforge.net/ (http://adplug.sourceforge.net/)

Supported formats:

AdPlug implements unique file replayers for each supported audio format in order to achieve the best possible replay quality. Players marked as "preliminary" aren't considered final by the author and may contain many replay issues, but are included for testing purposes anyway. As of now, the following formats are supported:

A2M: AdLib Tracker 2 by subz3ro
ADL: Westwood ADL File Format
AMD: AMUSIC Adlib Tracker by Elyssis
BAM: Bob's Adlib Music Format
CFF: BoomTracker 4.0 by CUD
CMF: Creative Music File Format by Creative Technology
D00: EdLib by Vibrants
DFM: Digital-FM by R.Verhaag
DMO: Twin TrackPlayer by TwinTeam
DRO: DOSBox Raw OPL Format
DTM: DeFy Adlib Tracker by DeFy
HSC: HSC Adlib Composer by Hannes Seifert, HSC-Tracker by Electronic Rats
HSP: HSC Packed by Number Six / Aegis Corp.
IMF: Apogee IMF File Format
KSM: Ken Silverman's Music Format
LAA: LucasArts AdLib Audio File Format by LucasArts
LDS: LOUDNESS Sound System
M: Origin AdLib Music Format
MAD: Mlat Adlib Tracker
MID: MIDI Audio File Format
MKJ: MKJamz by M \ K Productions (preliminary)
MSC: AdLib MSCplay
MTK: MPU-401 Trakker by SuBZeR0
RAD: Reality ADlib Tracker by Reality
RAW: RdosPlay RAW file format by RDOS
RIX: Softstar RIX OPL Music Format
ROL: AdLib Visual Composer by AdLib Inc.
S3M: Screamtracker 3 by Future Crew
SA2: Surprise! Adlib Tracker 2 by Surprise! Productions
SAT: Surprise! Adlib Tracker by Surprise! Productions
SCI: Sierra's AdLib Audio File Format
SNG: SNGPlay by BUGSY of OBSESSION
SNG: Faust Music Creator by FAUST
SNG: Adlib Tracker 1.0 by TJ
XAD: eXotic ADlib Format by Riven the Mage
XMS: XMS-Tracker by MaDoKaN/E.S.G
XSM: eXtra Simple Music by Davey W Taylor
Title: Re: AdPlug
Post by: deus-ex on 2018-01-20 12:40:44
Hi kode54,

can you please clarify what are the recent changes made to the AdPlug decoder (https://www.foobar2000.org/components/view/foo_input_adplug) plugin? I'm curious especially because of the huge size increase from v1.49 to 1.50.
Title: Re: AdPlug
Post by: EpicForever on 2018-01-20 20:29:58
The "changelog in 10 words"  question comes back...
Title: Re: AdPlug
Post by: kode54 on 2018-01-21 04:37:40
What's with this incessant need to read change logs? You mean you wouldn't just rather use the latest bleeding edge code without a worry in the world? Fine. I'll tell you. I updated to the latest 1.4 (2018) SDK, and updated the interfaces to support that. Nothing more. If you want to keep using the old version from before that, go right ahead.
Title: Re: AdPlug
Post by: deus-ex on 2018-01-21 05:54:41
If you re-read your own reply, maybe you will notice how underwhelming and narrow minded it is.
Title: Re: AdPlug
Post by: mudlord on 2018-01-21 06:08:38
If people really want logs, why not look at tagged git releases?
Title: Re: AdPlug
Post by: deus-ex on 2018-01-21 06:20:10
For one, most users are not software developers themselves and most probably would not know their way around that. Secondly, in order for this suggestion to work the official foo_input_adplug git (https://gitlab.kode54.net/kode54/foo_input_adplug) needs to be up to date to begin with. At the time of this writing the last update is from 11 month ago.
Title: Re: AdPlug
Post by: mudlord on 2018-01-21 07:11:17
Which means that adplug may have got updated.

Maybe.

Who needs to know?
Title: Re: AdPlug
Post by: EpicForever on 2018-01-21 09:50:48
@mudlord : I need.
And I also noticed that foo_input_adplug git does not list any change - I checked it before I posted yesterday.
And now I can say - @kode54 - thank you kindly for this important knowledge. Those still using v 1.3.16/17 will most likely stay with what they have, while I will bother myself to update it, as I use v 1.4 beta 3.  Here you have clear usage scenario for brief change log updates.
Title: Re: AdPlug
Post by: thecoreyburton on 2018-10-15 14:35:06
I use foobar2000 primarily for transcoding and I recently noticed that some files play back with high volume levels which results in clipping. Is there any way this can be avoided? Adjusting volume doesn't make a difference, and it doesn't seem to be an issue in the Winamp version of adplug (though I am aware they're two different situations).

For an example, try SONG_0.XR1 from Xargon (labelled "Welcome" over at VGMPF (http://www.vgmpf.com/Wiki/index.php?title=Xargon_(DOS)))
Title: Re: AdPlug
Post by: thecoreyburton on 2018-10-18 18:37:49
I'm sorry for the double post, but I don't see an obvious way to edit my previous reply. I thought I'd clarify, I'm using NukedOPL3 with surround enabled when I'm experiencing this issue.

I made a request for the Winamp version of adplug to include surround for NukedOPL3 and discussion of this particular problem came up. Malvineous outlined the cause and a potential solution for it on the page for that issue: https://github.com/adplug/winamp/issues/18
Title: Re: AdPlug
Post by: kode54 on 2018-10-19 03:55:33
It would be because I'm probably doubling the volume of the NukedOPL3, and an update to NukedOPL3 doubled the volume, negating that change. I do need to update the component.
Title: Re: AdPlug
Post by: thecoreyburton on 2018-10-22 17:43:51
Thank you for the response. That would make sense. SONG_0.XR1 (along with the rest of the files from Xargon) are particularly loud examples in contrast to other adlib tracks as well, so that could also be a contributing factor.

Title: Re: AdPlug
Post by: C_Gear on 2019-02-19 01:48:50
Excuse me:-) Recently, user configurable frequency offset for surroundopl was implemented in the adplug core. Would you please update your code base with upstream and add this parameter to the UI?
As mentioned in the issue of https://github.com/adplug/adplug/issues/70, a frequency offset of 128.0 is OK for most of the voices, but greater values like 384.0 makes certain kinds of voices sound normally, while the surroundopl effect is still acceptable.
Thanks so much!
Title: Re: AdPlug
Post by: C_Gear on 2020-07-26 02:31:29
Excuse me:-)

I just upgraded to version 1.53 and it's fantastic! But the "set_offset(double offset) {}"of AdPlug Core 2.3.3 doesn't seem to have a corresponding setting option added to configure page yet? It is required by certain AdLib instrument to sound correctly in surroundOPL mode.

Its default value is like this:
#define FREQ_OFFSET 128.0

But for a special instrument, the default value makes the sound of the right channel incorrect. A larger value like 384.0 works well.

Could I expect it in the next release? Thanks so much!
Title: Re: AdPlug
Post by: Sergey77 on 2020-08-08 15:43:50
@kode54, please add an option to disable the output of information to the console.
Thanks!
SimplePortal 1.0.0 RC1 © 2008-2020