Jump to content
IGNORED

How do I get music I made with RMT into my game?


Recommended Posts

I think I need a step by step explanation for this..

 

I found a lot of contradicting stuff on this topic, RMT itself has a lot of different versions, and the best explanation that I found was from 2004, so a bit long in the tooth and probably for a much older version than the most recent one.. :D

 

Thanks in advance for the help, mates!

  • Like 1
Link to comment
Share on other sites

Okay, maybe you guys can help me here a bit.

Like I wrote, my goal is that I want to get music I have created in RMT playing in my asm project.

If that's not a good idea, I would also not have a problem using any other cross tracker (cross meaning it's running on Windows or even better for me, Mac OS) that's around that might be less capable, but simpler and more efficient to integrate.

 

So, reading here that LZSS is (probably) the way to go plus @VinsCool's new RMT version can export that, I downloaded that new version.

 

Now, there are several export options.

1055099985_Screenshot2023-01-10092952.thumb.png.20aa95ef98d54197100874c35f67af92.png

Is the .lzss ending what I want?

 

And if it is, what kind of code do I need to initialize and get this playing in my game?

Is there a special LZSS player that I need to include as well?

 

Really no clue here after a decent amount of reading on this topic.

 

Thanks in advance for any help here!

 

add/edit: found a great explanation now: 

 

 

 

Edited by Steril707
  • Like 3
Link to comment
Share on other sites

22 minutes ago, Steril707 said:

Hmm, can get the example provided with the RMT tracker to play my music, but within my game project, it's only producing weirdo sounds.

Need to experiment more, it seems... 

Has POKEY been properly initialized / reset?

  • Like 1
Link to comment
Share on other sites

Well, okay, so i am aware the state of things I have gotten myself involved with are very messy, especially at the time of getting any usable data from my RMT fork.

Also please allow me to apologise for the badly formated reply, I am using my mobile phone, which makes it annoying for me since I cannot help much as a result.

 

I've been quite busy working on exporting data at the moment, specifically LZSS, in order to make the process much easier in the future, to not waste any more time and energy using 3rd party programs such as RMT2LZSS, and have the ability to integrate the data with more ease.

Unfortunately much of what I have been doing as of right now is incomplete, much in proof of concept state too, but I do have some additional progress going in here, if you are interested in the LZSS format.

 

If you want to get a functional music driver, LZSS is honestly that would be what I would recommend, assuming you have the patience to untangle what is obviously work in progress right there.

The more straightforward LZSS player by DMSC or rensoupp's unrolled version are focused to do only 1 thing, and to have any more freedom in the driver usage you are pretty much required to create all the additional routines needed for a decent music player purpose, which was essentially what I have been doing originally for my VUPlayer program, but that is another can of worm I will keep for another time.

 

Now the bad news is, if you want to use the Patch16 6502 Assembly RMT driver, it would work, for sure, but it is a big bloated mess, and that is something I take full responsibility for.

If you do end up making a tune in the newer RMT versions, you would also be extremely disappointed when you try to play the modules back in the RMT 1.28 driver, since a lot of the new "features" just broke a lot of things as a side effect.

Using the RMT 1.34 driver wouldn't be much use for getting optimal results since I've fucked too much with the routines to make it do things it was never designed to do in the first place.

But if you still wanted to give it a shot, there is something from few recent git versions from RMT where it is possible to export relocatable RMT assembly, basically a deconstructed .rmt module in code, which might be much easier to use, even with the objectively broken RMT driver code I hacked beyond recovery.

There is a bunch of unclear stuff in there, but thanks once again to Peter a lot of it had gotten comments to hopefully help making sense from it.

If it ends up being used, just make sure to keep any Tracker specific assembly conditions off, else the playback would be broken.

That was actually due to not knowing better at the time, but that will be fixed in the future, right after the LZSS data export improvements that have yet to be finished in the upcoming days/week/months.

The instructions for the 1.34 (Patch16) RMT driver are not that much different from using the version 1.28 driver, but there is a lot more RAM and CPU involved, unfortunately.

 

The last thing I figured was worth giving an honorable mention was my very own attempt at writing a music driver, which was created trying to address the things I was not entirely satisfied with the RMT driver, but this is not a good idea to try using it since it's not even close to being distributed and used for serious projects, it's all in the prototype stage but I thought maybe you would have been interested anyway, supposing that making music directly in ASM code is your thing, it does work, technically, but I definitely do not recommend messing with this one too much otherwise lol

 

If you need help using anything related to my RMT fork or just the data exported from it like LZSS exports, please let me know here or send me a message if you prefer.

If you can build RMT from git, you might be able to get much of your data exported already, the RMT 1.34 release is quite incomplete in that regard.

 

I hope I did not overload the thread with too many useless informations, I had been tagged in here so that's why I have taken the time to reply with a bit of context.

  • Like 1
Link to comment
Share on other sites

Hi,
without looking at the source is not possible to say it. Typical mistake on my side always was accidentally swapping the lo/hi when initializing the player.

A simple approach would be to just use the sample from the video and replace the RMT file.

https://github.com/peterdell/wudsn-ide-projects/tree/main/Atari800/Tutorial/Part 15 - Raster Music Tracker Modules

- Peter/JAC!

  • Like 3
Link to comment
Share on other sites

3 hours ago, VinsCool said:

I've been quite busy working on exporting data at the moment, specifically LZSS, in order to make the process much easier in the future, to not waste any more time and energy using 3rd party programs such as RMT2LZSS, and have the ability to integrate the data with more ease.

:roll: Thanks for the cheapshot... RMT2LZSS does exactly as the title says with a button click, and integrating it with the example source is just a matter of renaming the file and assembling the code

  • Sad 1
Link to comment
Share on other sites

6 hours ago, rensoup said:

:roll: Thanks for the cheapshot... RMT2LZSS does exactly as the title says with a button click, and integrating it with the example source is just a matter of renaming the file and assembling the code

There was nothing in my post that implied anything such as throwing a jab at you... Maybe I just poorly worded that part, sorry about that.

 

I said that related to the troubles going from rmt to rmt2lzss to export data, that was just troublesome on the long run, and resulted in sound that was not matching the sound of the tracker side, or required a lot of extra post production tweakings to get anything that was satisfying.

I'm honestly still kind of frustrated about the convoluted work around some tunes I made before, such as the prince of persia music, for example.

 

What I meant to say was that I have been working really hard to be able to get almost exactly the same results out of rmt directly, and possibly have much more as of recently, with the extensive research and experiments going for finding even better compression patterns with data, or the "chunk" based approach I have been testing out with some decent success as well.

Not later than yesterday actually I had been going on an experiment with a bruteforced test of optimisations where all possible 9 cases gave virtually identical sound, but could potentially save or waste more memory.

It only took some runs with several modules to fine out that indeed, a lot of the tunes are case by case, so might as well automate some of the more complicated stuff if that saves some extra bytes in the process.

 

Anyway, getting carried over with details that aren't much relevant to this thread, I agree that LZSS is great for being extremely convenient, and it is even more when it is then played back to sound 100% identical to what can be heard in the tracker itself just a few seconds earlier.

My point about not having to rely on a 3rd party program to achieve much of the same things, but even easier now, was really just about that.

 

Okay well, I also wanted to make my own version, but that's only because you challenged to try making my own if I dared to, because I recall you were annoyed by my incomprehensible responses 😛I'm sure you remember too.

I did not try to make it sound like a competition, in fact it's very much because of rmt2lzss that I learned how that stuff worked in the first place, of course I am thankful for your work with this tool.

 

 

 

 

  • Like 3
Link to comment
Share on other sites

6 hours ago, _The Doctor__ said:

I think he meant to say he wanted to avoid extra stuff and steps and be able to export directly to lzss maybe, I can't imagine it was meant as a slight or shot as such. Maybe poor word choices? I do things like that all the time

Yeah that's really what I meant to say.

Rmt can export lzss, sapr, and hopefully more as more work is done.

No tables involved, no custom instrument, just direct dump of the music driver, that itself is the remaining pandora's box to address, but rensoupp already knows about much of what I have in the back of my mind anyway, and I know he also has his own deluxe things in the making too, so there is no point having beef between each others, I mean, why be upset when there's 2 cakes baking? Lol

  • Like 2
Link to comment
Share on other sites

Hey guys,

first off thanks to all of you for giving hints and advice.

 

Tried a lot yesterday, but nothing seemed to work.

Then I started fresh, and did this:

 

* used the startup code (music.a65) that's within the rmt128.zip and assembled it. Worked!

* put my own rmt into it. Worked!

* transferred my game code into that file, and it started playing my music, but only a few seconds.

* I started commenting out code to see where the problem lies.

* found out, that I used a zero page address in my earliest code that copied chars to the screen I did for the game a few months ago. Changed that one. Now the whole music plays, and you can play the game! Very nice success.

 

Now off course I would like to have the whole shebang integrated into my startup code, but there seems to be a problem yet that I have not found. Well, today after work I will have another look at it.

 

Anyway, seems music will work with my game, one way or the other.

Edited by Steril707
  • Like 3
Link to comment
Share on other sites

18 hours ago, VinsCool said:

I said that related to the troubles going from rmt to rmt2lzss to export data, that was just troublesome on the long run, and resulted in sound that was not matching the sound of the tracker side, or required a lot of extra post production tweakings to get anything that was satisfying.

I'm honestly still kind of frustrated about the convoluted work around some tunes I made before, such as the prince of persia music, for example.

 

It's not about it being a competition... you're saying it's convoluted to convert a tune and its output can be inaccurate.
It converts a tune or more in a bunch of clicks and I spent a lot of time batch testing it against about 1000 RMT 1.28 tunes, and it's 100% accurate.
For PoP you used custom hacked extensions which it wasn't meant for and painful to use but for getting a 1.28 tune into a game/demo, it is convenient and accurate.

If for my use, there was any advantage in outputting straight from RMT, I would use that.

Edited by rensoup
  • Like 2
Link to comment
Share on other sites

14 minutes ago, rensoup said:

 

It's not about it being a competition... you're saying it's convoluted to convert a tune and its output can be inaccurate.
It converts a tune or more in a bunch of clicks and I spent a lot of time batch testing it against about 1000 RMT 1.28 tunes, and it's 100% accurate.
For PoP you used custom hacked extensions which it wasn't meant for and painful to use but for getting a 1.28 tune into a game/demo, it is convenient and accurate.

If for my use, there was any advantage in outputting straight from RMT, I would use that.

 

Yes, that's fair, I can agree with you there.

You have created the program specifically for that, and it does a fine job, I'm not arguing about that.

It came from a time where no one even dared to try hacking the RMT music driver in the first place, apart from the handful of hacks that pretty much just edited the tuning tables.

There was no chance for the program sources to become public either, so I am aware of the reasons for sticking to what was the de-facto standard for RMT conversions.

Having all the cool features for RMT2LZSS sort of spoiled it for me, it showed how much potential the music tracker lacked, and that frustrated me.

I apologise for the way I worded myself yesterday, it's pretty obvious that I get too ambitious with the things I try to do, after all.

 

Still, that doesn't change what I said earlier, it is now possible to record the registers directly from RMT.

I just think that is much easier when it's also guaranteed to hear exactly what is going to be recorded

That really was all I wished to have, and with a lot of work, I was able to make it happen.

I should also not forget the massive improvements Peter had contributed some time ago, without his help, I wouldn't have been where I am today.

Currently, I am juggling with ideas for additional improvements to the LZSS compression ratio, so I hope there will be something I may be able to contribute back.

 

By the way, Steril707, I apologise for going offtopic right now, I am glad to see you seem to have figured things out, in the meantime :) 

  • Like 3
Link to comment
Share on other sites

16 hours ago, JAC! said:

And in case you need to relocate the RMT modules to a different address, there is a macro in the MADS examples.
https://github.com/peterdell/wudsn-ide-projects/blob/main/Atari800/Tutorial/Part 15 - Raster Music Tracker Modules/Part15.asm

Relocatable code can be exported from RMT, or generated from a.rmt file.

https://github.com/CycoPH/rmt2atasm

The tool will produce .asm source code that you can relocate to wherever you want.

  • Like 1
  • Thanks 3
Link to comment
Share on other sites

  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...