chrismaltby / gb-studio

A quick and easy to use drag and drop retro game creator for your favourite handheld video game system
https://www.gbstudio.dev
MIT License
8.56k stars 471 forks source link

[Request] LSDJ compatibility. #30

Closed CastleTiles closed 2 months ago

CastleTiles commented 5 years ago

Is there any way you can add or implement LSDJ .sav files for soundtracks?

thomasmaclean commented 5 years ago

While the file format is understood, there isn't really an open-source player for the lsdsng format other than the one embedded in the LSDJ ROM (which is very much closed-source). As such, I don't think something like this would be possible (although I'd love it if it was). Although mod format isn't nearly as powerful, it does allow you to get the basics down.

clsource commented 5 years ago

I think this could be implemented by using VGM as requested in #44

Steps 1 - Load sav file in Little Sound DJ 2 - Create a VGM file by using a similar method as described here

https://project2612.org/tutorial/02-logging.htm

This is just a theory but would be nice to have.

0x1DEA commented 5 years ago

This library also exists https://github.com/stijnfrishert/liblsdj

clsource commented 5 years ago

@SeeBeyondMusic the problem with that lib is that only works as a export-import tool. You can easily manipulate sav files but cannot reproduce those in a stand alone game. Another approach is using that lib and somehow convert the lsdsng file to gbt. In that case you could use that.

Pigu-A commented 5 years ago

VGM logs (which liblsdj is basically generating) would run the ROM space out really fast though. Which is the only reason why I don't like this method.

cyberic99 commented 5 years ago

@SeeBeyondMusic the problem with that lib is that only works as a export-import tool. You can easily manipulate sav files but cannot reproduce those in a stand alone game. Another approach is using that lib and somehow convert the lsdsng file to gbt. In that case you could use that.

A way to get register dumps would be: https://github.com/jkotlinski/lsdpack

But as @Pigu-A says, it could use a lot of ROM space

Maybe it could be possible to implement a kind of compression

In addition, LSDj song can be very CPU-extensive, leaving only a few CPU cycles for the main application...

jkotlinski commented 3 years ago

Hi! To add some facts to the discussion.

Pigu-A commented 3 years ago

I have inspected lsdpack's code and noticed that it already used a simple kind of compression. So I'm fine with that enough as a register log solution. Although I can think of a better compression scheme that doesn't take that much CPU time. Maybe I'll write up a format proposal and contribute there.

jkotlinski commented 3 years ago

Suggestions would be gladly accepted!

On Mon, 23 Nov 2020 at 16:55, Pigu-A notifications@github.com wrote:

I have inspected lsdpack's code and noticed that it already used a simple kind of compression. So I'm fine with that enough as a register log solution. Although I can think of a better compression scheme that doesn't take that much CPU time. Maybe I'll write up a format proposal and contribute there.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chrismaltby/gb-studio/issues/30#issuecomment-732249136, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAY34OYT74M7SEV6ZIMTILTSRKAWNANCNFSM4HHSSGEA .

PixelShift-gb commented 3 years ago

I emailed them and they said you can export music using this link

"There is a tool for extracting LSDj music so that it can be used in music discs or games. You can get it at https://github.com/jkotlinski/lsdpack

All the best Johan http://www.littlesounddj.com "

jkotlinski commented 3 years ago

Is there anyone who would be interested in integrating this? I am wondering what I can do to help from my side.

jkotlinski commented 3 years ago

lsdpack has now been updated to generate .gbs files. I hope this in some way can help GB Studio integration.

https://github.com/jkotlinski/lsdpack

RichardULZ commented 3 years ago

.gbs files are of no help, the Game boy soundsystem format is often even harder to integrate into a game!

The gbstudio engine rewrite (look for the gbvm repository) is being designed to allow more external data, specifically hUGETracker. toxa has figured out how to pack and link hUGE's rgbds code with the gbdk engines, and data for the game compile will be more human readable, so adding music data not from gbstudio will be a little easier.

The lsdpack driver above requires firing 360 times per second! The new hUGE is being configured with the interupt timer, to run main code every 64hz, but also at 256hz, for potential wave channel sample playback (wave samples use a full 16kb bank in 4 seconds btw).

So, whenever the engine rewrite and importantly editor overhaul to support this new engine is near, lsdpack would be closer to a possibility, but still has its own hurdles.

jkotlinski commented 3 years ago

Hi Richard! Thanks for your reply!

I am not sure if there was a question, but since you seem interested in the matter, I can expand on how often the lsdpack driver needs to be called (I should update the README with this info)

Cheers /J

On Sun, 7 Feb 2021 at 01:20, Richard Ziegler notifications@github.com wrote:

.gbs files are of no help, the Game boy soundsystem format is often even harder to integrate into a game!

The gbstudio engine rewrite (look for the gbvm repository) is being designed to allow more external data, specifically hUGETracker. toxa has figured out how to pack and link hUGE's rgbds code with the gbdk engines, and data for the game compile will be more human readable, so adding data not from gbstudio will be a little easier.

The lsdpack driver above requires firing 360 times per second! The new hUGE is being configured with the interupt timer, to run main code every 64hz, but also at 256hz, for potential wave channel sample playback (wave samples use a full 16kb bank in 4 seconds btw).

So, whenever the engine rewrite and importantly editor overhaul to support this new engine is near, lsdpack would be closer to a possibility, but still has its own hurdles.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chrismaltby/gb-studio/issues/30#issuecomment-774565088, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAY34OZ6DJ6MOTVP6RWFALTS5XMENANCNFSM4HHSSGEA .

RichardULZ commented 3 years ago

Neat, @untoxa is the one integrating hUGEtracker for the next version, They just mentioned on the discord they'd considered the idea of "pluggable music drivers", though, and would love help writing wrappers. They might be able to teach you the secrets of Rgbds to Gbdk linking.

jkotlinski commented 3 years ago

@untoxa is this correct? can the secrets be taught?

untoxa commented 3 years ago

What secrets?

jkotlinski commented 3 years ago

RichardULZ commented 7 days ago

Neat, @untoxa is the one integrating hUGEtracker for the next version, They just mentioned on the discord they'd considered the idea of "pluggable music drivers", though, and would love help writing wrappers. They might be able to teach you the secrets of Rgbds to Gbdk linking.

untoxa commented 3 years ago

Linking rgbds objects? Readme on the front page of this repo: https://github.com/untoxa/hUGEBuild

but that is hardly needed for that lsdj player which code is very primitive, you can simply rewrite it.

thomasmaclean commented 2 months ago

@chrismaltby Wait... was this actually completed? I was cruising through the commit history and I didn't see any code changes that looked like they were related to this. Is this more of a won't fix?

chrismaltby commented 2 months ago

Sorry yes, was trying to clean up the 100s of old issues. I mean't to set this one as not planned :-)

thomasmaclean commented 2 months ago

Thanks for the clarification!