Giter VIP home page Giter VIP logo

agbplay's People

Contributors

drewler avatar easyaspi314 avatar ipatix avatar kurausukun avatar nicholatian avatar vaguerant avatar yopox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

agbplay's Issues

.JSON Playlists not working?

I compiled a newer version of agbplay because I had an older version. It's great and all, but the .JSON playlists don't seem to be working. Even when I use roms that have the same rom code as in the .JSON file it doesn't seem to work. I don't know if I did something incorrectly on my end that made it so that this feature isn't working, but I thought I'd just let you know.
Btw, I'm on Windows 10, if that helps at all.

Add option to specify path to agbplay.ini, and default it to a sane location

agbplay apparently always looks in the current working directory for its INI file, with no way for the user to command it otherwise. This makes it impossible to package for distros as I discovered: I put together an AUR PKGBUILD and this unfortunately halted my work.

My recommendation is to keep the current behaviour, but add a CLI option to specify it, and also make the program fall back to look in /usr/share/agbplay/ for the INI if it isn’t found in $PWD. This would be perfect for my PKGBUILD.

Search for multiple sound tables

In Mother 1+2, there are 2 separate sound tables present in the ROM, one for each game. Currently agbplay only detects the first table (Mother 2) and ignores the second one (Mother 1). By patching the SongTable::locateSongTable() to always return 0xf71c34 and it seems to play fine.

It also seems like that if I just let the original SongTable::locateSongTable() to search everything until the end it will eventually find the second table as well. So maybe just change it to return an array and have the song list use 2 indices (i.e. table index and song index) to represent a song would fix this.

This might also work with other multicart titles (given that more of them exist).

Correctly implement GS1/2 and Mario Golf Reverb

Just as a public todo:
GS2 Reverb: Current code is a "guessed" implementation and doesn't sound accurate.
GS1 Reverb: Tried to reimplement that by reading the assembly code. Doesn't seem to sound very good nor accurate.
Mario Golf: Assembly looks pretty similar to GS2 Reverb. Needs to be done some time too.

"Pa_OpenDefaultStream: Invalid sample rate"

i've compiled agbplay directly from github on my arch linux machine. it does run absolutely fine at first, but when i try running again, this message shown in the title appears on the white box at the bottom of the app.
when i hit the space key for playing the song, it just hangs on the first frame, and after that, any other input makes it freeze entirely, forcing me to kill it with ^c.
but not only that, i also get this on the console, it appears right when agbplay fires up, so i can only see it after closing agbplay:
https://pastebin.com/2vMj9Qap
it seems to be more related to alsa itself though, and i use pipewire. is it actually pipewire's fault? just a guess.

Building/running on Arch Linux does not specifically require ncurses5-compat-libs package

The current ncurses 6.3 library on Arch, which is backwards compatible, allowed agbplay to build and link without errors. The only compiler warnings generated are unrelated, from double-to-float truncation.

I was able to play songs from some supported games (i.e. Kirby and the Amazing Mirror, Kirby Nightmare in Dream Land) correctly, with the visualizers and UI working as intended, and all the inputs listed in README appear to work. There is no unusual or concerning output.

The ncurses5-compat-libs AUR package does not appear necessary to build nor run agbplay on Arch, so the official ncurses package might be a safer recommendation. Can anyone verify? I have not seen this in any open or closed issues, so apologies in advance if it's something already known.

Global rom instance

In cb7ddbd the rom was made a global. I have a particular use case, using this project as a library, which requires having multiple roms loaded and multiple sequences playing at once, would you accept a partial revert of this?

Would you also accept a PR which splits the project into two folders, core and gui?

Per-Game Reverb Buffers

It might be a good idea to allow the size of the working reverb buffer to be set per-game in the .ini rather than hard-coding it to 0x630.

Change instrument patch on selected track

Is it doable? I mostly want this for Golden Sun and The Lost Age, but I'm sure it could be useful in other games as well.

In GS2 especially there are a couple songs with "disabled" tracks, such as track 03 highlighted below (the most known case is one of the overworld themes missing a percussion track, this one is Lemuria)

GS2 - Lemuria

I ripped them in GbaMusRiper and assigned the midis in question the correct instruments, in this case it's "Choir Aahs" (patch 52, like track 02 in the pic), and you can hear the result here.

Side note, for some reason GS2 has terrible sounding percussion, like it was pitched down or something, while GS1 is working fine. Maybe it's just me, but not sure why.
Edit: I re-checked and GS1 also has this problem.

Add precompiled binaries

Hey @ipatix!
I find it pretty hard to compile the project because of all the library dependencies, which partly themselves depend on other projects to compile.
Would you mind adding precompiled binaries of 'agbplay' to the "Releases" section?
That way Windows users like me don't have to go through the struggle/confusion of installing all these huge amounts of libraries.
Thanks in advance. :)

Possible error in checksum calculation? Misdetects Sonic Advance (Japan) (En,Ja) (Rev 1) as having bad checksum.

I have a clean Sonic Advance (Japan) (En,Ja) (Rev 1).gba (No-Intro ROM naming) with md5sum 9e02f1c9f26f40905d43188b2bd2d98e, which matches No-Intro. When trying to open it with agbplay, I get the following error:

Loading ROM...
Loaded ROM successfully
ROM verification: Bad Header Checksum: 2D - expected 2E

For the sake of interest, I edited the checksum to 2E as agbplay wanted, and it happily opens the (now hacked, bad) ROM.

EDIT: Highly likely not related to the above, but subsong 0013 in Sonic Advance (with above ROM and hacked checksum 2E) also sounds really off-key and unpleasant.

FATAL ERROR on streaming thread: Nested track calls are not allowed

When playing songs found in romhacks such as Touhou Puppet Play Enhanced Reloaded (which has a lot of custom music I'd like to record), some tracks skip mid-way through with the error:
FATAL ERROR on streaming thread: Nested track calls are not allowed: 0x C0A02A
You can replicate this by loading this romhack (version 6.8A is fine) and then playing the Ending Credits track loaded in the playlist.

Add a --help switch

Was surprised to find this program doesn’t provide any sort of command-line --help.

Could you add this so people know how to address the binary and give it the things it needs? It looks like I’ll be poking at it until I figure out what works…

Export individual tracks

It would be wonderful if player had a feature to export each channel of the song to a separate wav file without mixing. I would love to use this tool to make some oscilloscope videos, like this, for GBA music.

MOTHER 3 Pitch bends are incorrect in some cases.

I haven't tested through alot of MOTHER 3's songs in this but I can't help but notice how broken "Battle With The Masked Man" sounds in this, namely the pitch bends with the sinewaves and other portions of the song do not sound correct at all.

I've supplied recordings to demonstrate and compare this behaviour, I'm not sure if these will show up in Github properly because they did something site-wide recently that made a good chunk of the website controls completely unresponsive...

Does this have anything to do with the mentioning of using sine waves rather than triangle waves for the modulators?

DKC3 Unable to find songtable

It seems agbplay is unable to automatically detect the songtable for Donkey Kong Country 3. Is there a way to manually specify an offset?

Incorrect Panning in Sonic Advance 2

As far as I can tell, Sonic Advance 2 uses a completely standard m4a implementation, but I could be wrong about that. Anyway, you can hear the issue if you load up the game and play song 28 (True Area 53). There are two squares that are supposed to be panned to the left and right (pan 34 and 94), but they are both played completely center-panned. Additionally, AGBPlay shows them as being +30 and -30, even though it does not play them as such.

Issues playing music

I don't know if I did something wrong or if the rom is incompatible but here's this. Game is pac-man collection btw

/home/susiterry/agbplay/agbplay /home/susiterry/agbplay/rom.gba  ✔
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Loading ROM...
Loading Config...
Reading Songtable
Unable to find songtable

Strange distortions in PCM tracks.

This is something I heard very rarely when using agbplay, but in a couple of songs in some games there would be this weird "warble" like distortion to some PCM tracks. One example is the VS mode theme (track 0000) in Minna no Soft Tetris Advance (right at the 1:08 mark). I also remember hearing it a couple of times in WarioWare Twisted too, I specifically remember the theme for the microgame "Dear John Letter" (track 0712) having heavy distortion, as well as Stumblebot (track 0788), yet a little more minor in the lead instrument . This issue was very rare but seemed important enough to be reported.

Unable to play music from Gem Smashers

Gem Smashers uses m4a/mp2k, and saptapper detects the sound table correctly and outputs a playable gsf set.
Through agbplay however, it doesn't play any of the music/sfx, and skims over the songs, likely detecting them as empty.
What could the issue be?

CGB Channel Fix

In CGBChannel.cpp, the following lines are inside CGBChannel::SetVol():

envPeak = clip<uint8_t>(0, uint8_t((note.velocity * vol) >> 10), 15);
envSustain = clip<uint8_t>(0, uint8_t((envPeak * env.sus + 15) >> 4), 15);

The second line should be:

envSustain = clip<uint8_t>(0, uint8_t((envPeak * env.sus + 16) >> 4), 15);

Assuming envPeak and env.sus were max value (0xF), this would not affect the upper limit. However, this fixes CGB instruments which have 0 sustain that are played at a low volume.

For example, Tiny Woods (song 125 in Pokemon Mystery Dungeon: Red Rescue Team) has a noise track which plays at volume 16. The noise itself has ADSR: {0, 5, 0, 0}. In agbplay, this track would play silently because of these two lines (envPeak would end up as 1, but envSustain would end up as 0), but in-game the track does produce sound. Changing the 15 to 16 in this line would fix this situation and set it to the correct level (envPeak 1, envSustain 1).

Compiling on Mac OS

Did someone manage to compile agbplay on Mac OS ?

I installed the following dependancies with Homebrew : boost, portaudio, ncurses, and libsndfile.

When I tried to compile, I got the following error :

[Compiling] obj/CGBChannel.o
[Compiling] obj/CGBPatterns.o
[Compiling] obj/ConfigManager.o
[Compiling] obj/ConsoleGUI.o
src/ConsoleGUI.cpp:57:26: error: invalid operands to binary expression ('agbplay::Color' and 'int')
        wattrset(winPtr, COLOR_PAIR(Color::WINDOW_FRAME) | A_REVERSE);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/curses.h:1005:23: note: expanded from macro 'COLOR_PAIR'
#define COLOR_PAIR(n)   NCURSES_BITS(n, 0)
                        ^~~~~~~~~~~~~~~~~~
/usr/include/curses.h:879:42: note: expanded from macro 'NCURSES_BITS'
#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT))
                                  ~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/memory:5278:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:3931:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os,
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/bitset:1091:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x);
^
src/ConsoleGUI.cpp:59:26: error: invalid operands to binary expression ('agbplay::Color' and 'int')
        wattrset(winPtr, COLOR_PAIR(Color::DEF_DEF) | A_REVERSE);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/curses.h:1005:23: note: expanded from macro 'COLOR_PAIR'
#define COLOR_PAIR(n)   NCURSES_BITS(n, 0)
                        ^~~~~~~~~~~~~~~~~~
/usr/include/curses.h:879:42: note: expanded from macro 'NCURSES_BITS'
#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT))
                                  ~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/memory:5278:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:3931:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os,
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/bitset:1091:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x);
^
2 errors generated.
make: *** [obj/ConsoleGUI.o] Error 1

I'm using Mac OS Sierra 10.13.5

Per-track mute in the player

It would be neat if you could press "m" when over a track and have it muted. Would help with transcribing songs and figuring out the meanings of individual voices.

(Pokemon FR/LG) Pitch Bend Issues

In some songs in FireRed LeafGreen, most notibaly the Trainer Battle theme (song 160), the pitch bends on the guitars will fail to pitch bend correctly compared against the MIDI being played on a soundfont.

On a normal load of the ROM, the pitch bends will end early and cause a blip of an extra note. It doesn't do this on shorter bends but for longer high pitched bends it's more noticeable.

Me and Kurausukun have found one workaround on modifying the MIDi file so the guitars are in seperate tracks.

It does not do this on the synth track that plays mostly the same notes or even track 4 on the guitars.

I tried this using a version of SAPPY 2006 and by setting the note limiter to 1, the bends played normally, no blips.

Pitch Bend Example.zip

Alias Free GB Channels

A very nice feature would be to have alias free waveform generation for the GB channels. This could probably increase the quality for GB heacy songs quite a bit. I personally don't know the math of the more complicated algorithms (at least for moment of writing this), so maybe someone knows a bit about that and could give me some hints ;)

Label Game Boy channels

If a track is using the native Game Boy channel for its instrument, it would be neat if the tracker could show e.g. "Ch1", "Ch2" etc. somewhere. Would make it easier to identify them and also color them accordingly when making visualization videos.

Reverb Buffers Not Being Read Correctly

Because I parsed for ints horribly, the reverb buffer gets set back to default if there are any letters in the hex number specified in the .ini file.

EDIT: This is now fixed in PR #26

Unreadable games

Currently, games such as Super Mario Advance 2, 3, 4 and Sword of Mana cannot be loaded. This is the same for other GBA music tools, is it technically possible to output each track like other games?

Strange Envelope Issue in Sonic Advance 3

In Chaos Angel Act 1 (song 44) in Sonic Advance 3, on actual hardware the square on track 10 has a low sustain value that continues playing for a bit, but in agbplay, the notes seem to decay to 0, giving them a very staccato sound; an example comparison can be found in this discord message. There also seem to be notes that get cut off or not played on hardware but do play in agbplay; not sure if this is related or not.

Lag and high memory usage when terminal window is too narrow

Just another todo. Sometimes when the terminal size is too narrow, agbplay will start to allocate ~4G memory and get really slow (especially if you don't have enough RAM!).

Not sure where it's caused. Theoretically too small terminal sizes should be clamped to a min size, but apparently doesn't work reliable.

Support for GSF rips?

GSF rips contain parts of the ROM that is responsible for playing the music and sound, along with tags for each music track/sound effect contained in "MiniGSF" files. It would be nice to support those for easy track finding, fine-tuned track order, etc. without hardcoding everything into the INI file (given that the they are from games that use sappy engine).

Option to loop song forever (without fade-out)

I would very much appreciate seamless infinite looping of a given track, given that the default (and only) behaviour is to play the looped part twice and fade out on the start of the third go-around…

On a related note, a button to loop a single track like what VLC has would be useful as well. Currently the only way to do that is to put it on its own playlist alone.

Envelope Issue in Pokémon Ruby/Sapphire/Emerald

The attack of some notes on PSG ch 1 & 2 in the Ending Theme from Pokémon Ruby/Sapphire/Emerald (song 455 on all three ROMs) are completely missing.

Issue originated in 00f4fe5 and has persisted since.

See attached zip for examples of mGBA output and agbplay output.
example.zip

Attempting to play any track freezes the program

So I installed the latest version of Cygwin and compiled agbplay through that terminal. Everything was going smoothly until I tried playing a track from Lufia: The Ruins of Lore.

Whenever agbplay attempted to load a track, nothing is heard and the terminal would freeze a few seconds afterwards.
Tried again with Golden Sun 1 and the exact same thing happened.

I think I have a good hint towards what's causing this. Upon startup, the gray text box at the bottom of the terminal reads "No supported API found, falling back to: OSS". Apparently, OSS doesn't want to work with either Cygwin or agbplay, but I have no idea what APIs are -- let alone which ones are compatible with agbplay.

Bad sounding instrument in Sonic Advance

In the Neo Green Hill Zone Act 2 theme in Sonic Advance (track 0013 in soundlist), it seems that channel 4 has a problem. The instrument doesn't sound like it should. I don't know at the moment if this problem is present in other tracks.

The attached archive contains the first 10 seconds of the emulated version (correct) and of agbplay (the one with a problem) of the music involved.
NGZ2.zip

Having trouble compiling

I'm trying to compile, but I get the following message:
[Compiling] obj/CGBChannel.o
make: g++: No such file or directory
make: *** [Makefile:48: obj/CGBChannel.o] Error 127

Tag Inheritance

[B24P]

So B24P is the Europe version of pmd-red. I've been working on the pmd-red decomp which is USA (B24E).

Is there any way to inherit one section to another? Currently, I just c/p the section under the header that agbplay created when I first ran it.

Not really a deal breaker. Just was curious, hah.

Implement track priorities and handling

CGB instruments may be dropped in favor of other ones. Currently always the latest one played replaces any previous ones, but this is not accurate to original behavior. To correctly drop notes, track priorities and track numbers have to be considered and this issue is a TODO reminder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.