adplug / adplay-unix Goto Github PK
View Code? Open in Web Editor NEWAdPlug's UNIX console-based frontend
License: GNU General Public License v2.0
AdPlug's UNIX console-based frontend
License: GNU General Public License v2.0
AdPlug - A free AdLib sound player library Copyright (C) 1999 - 2017 Simon Peter, et al. Website: http://adplug.github.io/ Description: ------------ AdPlug is a free, multi-platform, hardware independent AdLib sound player library, mainly written in C++. AdPlug plays sound data, originally created for the AdLib (OPL2/3) audio board, on top of an OPL2/3 emulator or by using the real hardware. No OPL2/3 chips are required for playback. Supported platforms: -------------------- AdPlug currently is tested to compile and run well on the following platforms and compilers: Platform Operating System Compiler -------- ---------------- -------- IA32 - x86 Windows XP MinGW 3.4 # not tested at the moment MS-DOS 6.22 DJGPP 2.0.5 / GCC 12.2.0 MS-DOS 6.22 DJGPP 2.0.5 / GCC 4.8.5 Linux 2.6 GCC 4.1 # not tested at the moment x86_64 Linux GCC 4.8 Linux GCC 11.3.0 Linux CLANG 10.0.1 MACOS GCC 14.0.0 MACOS CLANG 14.0.0 This list only incorporates platforms on which this release of AdPlug has been tested successfully. This and/or earlier versions of AdPlug may and did run on a variety of other platforms as well. It just means they haven't been explicitly tested for this release. The library builds as dynamic and/or static link library, depending on the facilities provided by the host OS. These are autodetected. Prerequisites: -------------- AdPlug depends upon the following libraries: Library: Version: -------- -------- libbinio >= 1.4 libbinio can be obtained from http://adplug.github.io/libbinio/. Installation: ------------- Please refer to the INSTALL file for installation instructions. Linux/OSX git: -------------- If you checked out from git, please first run: autoreconf --install to generate the build cruft and get the configure script. Oh, and did I mention you need recent versions of autoconf, automake and libtool? Windows git: ------------ If you checked out from git, you will need to copy src\version.h.in to src\version.h and replace @VERSION@ with a proper version number. A Visual Studio 2015 solution you can open and build is located in contrib\vs2015\vs2015.sln. Debugging AdPlug: ----------------- If you feel you have to debug AdPlug, you can compile it with debug logging support. This is disabled by default. To enable it, you have to define the DEBUG preprocessor macro. This is done by passing the '--enable-debug' commandline option to the 'configure' script to enable debugging. AdPlug logs to stderr by default. The output can be redirected anytime to a user specified logfile. This is done by using the 'CAdPlug::debug_output' method of the 'CAdPlug' class. If you have changed a format and the tests now fail (run "make check"), once you have confirmed the output is correct, there will be a *.test file in the test/ folder. Rename this from .test to .ref to have it used as the new reference data. The emulator license issue: --------------------------- AdPlug now uses WoodyOPL, the LGPL-licenced OPL emulator from the DOSBox team. Previously, AdPlug used MAME's fmopl OPL2 emulator. While this distribution includes an old LGPL'd version of the emulator, which was developed by Tatsuyuki Satoh alone, who relicensed this version under the LGPL, there is a patch available in the `mame` branch of the GitHub repository that replaces the old version by the latest version from the MAME source distribution. The new version features improved emulation quality, but is licensed under the MAME license, which restricts commercial redistribution. The same goes for the OPL3 emulator, which requires the new version of the OPL2 emulator to build. Later versions of MAME are released under the GPL, so this patch could be updated to use that instead, however this is probably not necessary given the high quality of the WoodyOPL emulator. - Simon Peter <[email protected]>
is it possible to do midi output? Either file→file or file→synth or both?
Looking at the adplay-unix source reveals that nowhere is the CRealopl class used, which means (as far as I know) that adplay-unix doesn't actually support using a real OPL chip.
Is this on purpose? Would you be interested in a pull request to include this?
I really miss that, when playing 3000 songs, it's not fun to press ctrl-c and run adplay again:
https://github.com/alexmyczko/modplug-tools has a readme with some nice interactive keyboard control (at the bottom), would it be possible to implement that into adplug? Or should i link against adplug and support adplug formats with modplug123?
libao-1.2.2-alt5.x86_64
Core was generated by `adplay --output=ao 1.xm'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f8f86487d61 in ?? () from /lib64/libc.so.6
(gdb) bt
#0 0x00007f8f86487d61 in ?? () from /lib64/libc.so.6
#1 0x00007f8f86775432 in _sanitize_matrix (maxchannels=2, matrix=0x2 <error: Cannot access memory at address 0x2>, device=device@entry=0x563cdfd34570) at audio_out.c:634
#2 0x00007f8f86777701 in _open_device (driver_id=<optimized out>, format=0x7fff4b8275a0, options=0x0, file=<optimized out>) at audio_out.c:991
#3 0x0000563cdebe6791 in AOPlayer::AOPlayer(Copl*, char const*, unsigned char, int, int, unsigned long) () at ao.cc:48
#4 0x0000563cdebe4d37 in main () at adplay.cc:527
#5 0x00007f8f8634de2d in __libc_start_main () from /lib64/libc.so.6
#6 0x0000563cdebe5b2a in _start () at ../sysdeps/x86_64/start.S:120
Making all in src
/usr/bin/make all-am
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o output.o output.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o alsa.o alsa.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o disk.o disk.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o ao.o ao.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
adplay.cc:115:1: error: narrowing conversion of '4294967295' from 'unsigned int' to 'int' inside { } [-Wnarrowing]
};
^
make[2]: *** [Makefile:497: adplay.o] Error 1
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o adplay.o adplay.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
make[1]: *** [Makefile:351: all] Error 2
make: *** [Makefile:404: all-recursive] Error 1
erro: Status de saída de /var/tmp/rpm-tmp.YWr9Yj inválido (%build)
Status de saída de /var/tmp/rpm-tmp.YWr9Yj inválido (%build)
Erros na construção do RPM:
Could not execute local: rpmbuild --define '_sourcedir /home/filiperosset/rpmbuild/my/failed/adplay' --define '_specdir /home/filiperosset/rpmbuild/my/failed/adplay' --define '_builddir /home/filiperosset/rpmbuild/my/failed/adplay' --define '_srcrpmdir /home/filiperosset/rpmbuild/my/failed/adplay' --define '_rpmdir /home/filiperosset/rpmbuild/my/failed/adplay' --define 'dist .fc29' --define 'fedora 29' --eval '%undefine rhel' --define 'fc29 1' -ba /home/filiperosset/rpmbuild/my/failed/adplay/adplay.spec | tee .build-1.8-1.fc29.log
[filiperosset@raw adplay]$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.0.1 20180410 (Red Hat 8.0.1-0.21) (GCC)
It's been about four years since the most recent release, and commits since then have fixed some build errors - such as building on macOS, and on more recent GCC compilers. Would you be up for cutting a new release so they're available in a stable version?
adplay.cc:28:10: fatal error: adplug/wemuopl.h: No such file or directory
#include <adplug/wemuopl.h>
this file doesn't yet exist in that old version.
This is a minor bug.
Hi there,
I'm having an issue compiling it on my Mac.
make
Making all in src
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
g++ -DHAVE_CONFIG_H -I. -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DADPLUG_DATA_DIR="/usr/local/com/adplug" -I/usr/local/include -g -O2 -MT adplay.o -MD -MP -MF .deps/adplay.Tpo -c -o adplay.o adplay.cc
adplay.cc:196:14: error: use of undeclared identifier 'no_argument'
{"8bit", no_argument, NULL, '8'}, // 8-bit replay
^
adplay.cc:197:15: error: use of undeclared identifier 'no_argument'
{"16bit", no_argument, NULL, '1'}, // 16-bit replay
^
adplay.cc:198:14: error: use of undeclared identifier 'required_argument'
{"freq", required_argument, NULL, 'f'}, // set frequency
^
Repeated dozens of times.
Any idea on how to overcome these?
Cheers
Hi.
It's possible to compile a console application with mingw32, though you need some manual config
diff --git a/Makefile.am b/Makefile.am
index dd9a7fc..66ea5e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,3 +3,5 @@ SUBDIRS = src doc
EXTRA_DIST = adplay.spec adplay.qpg
AUTOMAKE_OPTIONS = dist-bzip2
+
+ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index 565acb2..cdb8938 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,8 @@ AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CXXCPP
+AC_CONFIG_MACRO_DIRS([m4])
+
# Nothing works without these libraries...
AC_CHECK_LIB(stdc++,main,,AC_MSG_ERROR([libstdc++ not installed]))
PKG_CHECK_MODULES([adplug], [adplug >= 2.0],,[
Only after that the command autoreconf --install
finished successfully
After that I was able to execute ./configure --prefix=/mingw CXXFLAGS=-fpermissive
. But before configuring it's better to fix SDL (below)
SDL config problem. By default sdl-config
script forces your application to be a windows app, not console, and it intercepts output to sderr and stdout and redirects it into files.
I've found if you edit sdl-config the configure will fail (sdl won't be found) so I had to edit the resulting Makefile in the following way: removed -Dmain=SDL_main
and -lSDLmain
and changed -mwindows
into -mconsole
Another important thing: insert #undef main
in the adplug.cc right before the main().
sdl.h header problem.
As noted in another issue, windows fs is not case-sensitive, so #include <SDL.h>
and #include "sdl.h"
are misinterpreted as 'include local sdl.h` by the compiler. To overcome this, better rename ./src/sdl.h into ./src/sdlx.h and change all #includes accordingly
Strange typecast is needed in adplug.cc:
diff --git a/src/adplay.cc b/src/adplay.cc
index d93d16f..2973ca0 100644
--- a/src/adplay.cc
+++ b/src/adplay.cc
@@ -239,7 +239,7 @@ static int decode_switches(int argc, char **argv)
{NULL, 0, NULL, 0} // end of options
};
- while ((c = getopt_long(argc, argv, "8f:b:d:irms:ol:hVe:O:D:qv",
+ while ((c = getopt_long(argc, (char* const** (*)())argv, "8f:b:d:irms:ol:hVe:O:D:qv",
long_options, (int *)0)) != EOF) {
switch (c) {
case '8': cfg.bits = 8; break;
After all above the make will succeed and the resulting adplay.exe will show output in the console
Could you please tag the releases. This would make it easier for packagers to move from the SF tarball to GH. Thanks.
The --once
option is important yet incomplete. Cutting song this way isn't good-sounding.
The good way to do it:
N
timesM
seconds after thatO
seconds after (2) with fade from 100% vol to 0% volShouldn't be complicated to code but can result in the great tool to make (wave) demos out of source adlib files.
This commit 7c2735d
Makes the configure check fail on my Gentoo system (haven't tried on any other system). However, if I remove it, adplay complies fine and I can use the complied binary without any problems.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.