Jump to content

Photo

VGM Compression Tool


45 replies to this topic

#26 Dexter OFFLINE  

Dexter

    Moonsweeper

  • 271 posts
  • Location:Landgraaf, Netherlands / Übach-Palenberg, Deutschland

Posted Thu Jul 16, 2015 1:00 PM

Yes, I used it in SIMON. :thumbsup:



#27 Tursi OFFLINE  

Tursi

    Quadrunner

  • Topic Starter
  • 5,350 posts
  • HarmlessLion
  • Location:BUR

Posted Fri Jul 31, 2015 4:15 AM

Rasmus sent me an example of a tune that compressed poorly, and I found a couple more bugs thanks to it! So v102 was just posted:

Changed the default frequency lossy compression method to popularity (with scaling for musical notes). The decision of what the notes should become is still a little arbitrary, but it seems(?) to work. The old method is available with the argument -lossyslide
-There was a bug in the lossy slide code too that made it compare against the wrong values and be somewhat arbitrary in what it removed - fixed that.
-There was a bug in the user-defined noise tuning code so that when it needed to tune notes in channel three, it would leave the original note alone and tune it on the next frame instead.
-Improved the previous first-note hack to be a little more resilient, just in case

http://harmlesslion....oftware/vgmcomp

#28 TheMole ONLINE  

TheMole

    Dragonstomper

  • 807 posts
  • Location:Belgium

Posted Sat Sep 26, 2015 2:18 PM

Thanks for the continued improvements Tursi.

 

Having said that, I tried the latest version in a virtual machine running Windows 10 on my Mac (all I have, I retired my last Windows machine a year or so ago), but it doesn't seem to work:

  • First it prompts me that I need msvcr100.dll, which isn't installed on my win 10 instance (don't know if this is standard or not)
  • After downloading the dll, the application just errors out (generic error message, "application cannot be started" or somesuch).

Not sure if win 10 is supported or not, am I doing something wrong?



#29 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,943 posts
  • Location:Denmark

Posted Sat Sep 26, 2015 3:24 PM

Thanks for the continued improvements Tursi.

 

Having said that, I tried the latest version in a virtual machine running Windows 10 on my Mac (all I have, I retired my last Windows machine a year or so ago), but it doesn't seem to work:

  • First it prompts me that I need msvcr100.dll, which isn't installed on my win 10 instance (don't know if this is standard or not)
  • After downloading the dll, the application just errors out (generic error message, "application cannot be started" or somesuch).

Not sure if win 10 is supported or not, am I doing something wrong?

 

It works fine on my real Windows 10.



#30 Tursi OFFLINE  

Tursi

    Quadrunner

  • Topic Starter
  • 5,350 posts
  • HarmlessLion
  • Location:BUR

Posted Sat Sep 26, 2015 9:35 PM

Yeah, usually downloading a single DLL won't do the trick (and most of the DLL download sites are somewhat shady - I don't recommend) - there are two possibilities. You need to install the MSVC runtime (many packages do this for you, that's why not everyone need to), or I accidentally released the debug version and Rasmus can run it because he has MSVC installed. ;)

 

You can find the MSVC runtime installer here: http://www.microsoft...s.aspx?id=26999

 

The code is built for x86, so I think that's the one you'll need. (The page has multiple versions).

 

The generic error you mention can be caused by a lot of things, when it's not DLL dependency errors, it's manifest related, which was a pain that started up for me around Vista. So if installing that package doesn't work and you see it put the DLL in the system properly, let me know and I'll dig into the build process on my end.



#31 TheMole ONLINE  

TheMole

    Dragonstomper

  • 807 posts
  • Location:Belgium

Posted Sun Sep 27, 2015 3:59 AM

Yup, that did the trick. Thank you sir.



#32 TheMole ONLINE  

TheMole

    Dragonstomper

  • 807 posts
  • Location:Belgium

Posted Sun Oct 11, 2015 11:14 AM

Tursi, I believe I've found a small bug in the newest version of the compressor: when compressing multiple .vgm files into one .spf file, the resulting file becomes garbled after a second or two when played back. Reverting to the previous version I was using fixed the issue, but unfortunately I'm not sure which version this would exactly be since the program doesn't output a version number. The creation timestamp of the working vgmcomp.exe on my system is 5/5/2014, although that might not be trustworthy since it has been move from computer to computer a couple of times.

 

Let me know if you want the source files to test with, or if there's any other information that would help you chase the bug.

 

(PS: I'm using the -30hz command line option and nothing else, not sure if that makes a difference).



#33 Tursi OFFLINE  

Tursi

    Quadrunner

  • Topic Starter
  • 5,350 posts
  • HarmlessLion
  • Location:BUR

Posted Mon Oct 12, 2015 9:33 AM

I don't keep old versions of the software, best to download the latest and make sure that's the version the bug is happening in. Are you saying that /all/ the songs in the SPF file are corrupted when played back? At the beginning, the end, the middle? I do have source control so I can check for regressions in the code once we prove it.

 

The test files would be handy, I don't have much of a test bed. But I am using the compressor for multiple songs in Super Space Acer without any noted issues.

 

I don't think 30hz should be a problem but I haven't tested it very much. It's worth a look. :)



#34 TheMole ONLINE  

TheMole

    Dragonstomper

  • 807 posts
  • Location:Belgium

Posted Tue Oct 13, 2015 4:02 PM

I don't keep old versions of the software, best to download the latest and make sure that's the version the bug is happening in. Are you saying that /all/ the songs in the SPF file are corrupted when played back? At the beginning, the end, the middle? I do have source control so I can check for regressions in the code once we prove it.

 

The test files would be handy, I don't have much of a test bed. But I am using the compressor for multiple songs in Super Space Acer without any noted issues.

 

I don't think 30hz should be a problem but I haven't tested it very much. It's worth a look. :)

 

I can confirm that the problem exists with the newest version and not with the older version I have on my PC. Attached is an archive with the vgm's that trigger the issue for me, it also includes a binary of vgmcomp.exe that does work (in case you need to create a working version to analyze the difference). I basically create an spf file that contains a main theme song first (song 0) and then a bunch of sound effects. Both song 0 as well as the sound effects are impacted. The sound effects all sound mostly wrong (as in none of them sound completely right), and the song start glitching out after 1 or 2 seconds.

 

HTH

Attached Files



#35 Tursi OFFLINE  

Tursi

    Quadrunner

  • Topic Starter
  • 5,350 posts
  • HarmlessLion
  • Location:BUR

Posted Tue Oct 13, 2015 5:45 PM

Thanks, that was enough to help me home in on the problem. It was a memory corruption that only happened on multiple song banks, caused by a thinko on my part. I've pushed the fixed version, that should fix it up, at least it sounds better on my test! I also made the version number more prominent, you'd only see it before on the help screen.

 

V103: http://harmlesslion....oftware/vgmcomp



#36 Davvel OFFLINE  

Davvel

    Moonsweeper

  • 259 posts
  • Married
  • Location:Malta

Posted Fri Feb 26, 2016 6:26 PM

Tursi, do you happen to know of any kind of windows based software that outputs TI 99 Music play lists which I can use in GPL. Your VGM player is awesome but I cannot use it given that what I am writing will have to stay as pure GPL just for the sake of having a game 100% in GPL. Thanks. Hopefully by April I can launch my new game with some simple music or sound effects.



#37 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 4,170 posts
  • Location:Denmark

Posted Sat Feb 27, 2016 2:42 AM

Tursi, do you happen to know of any kind of windows based software that outputs TI 99 Music play lists which I can use in GPL. Your VGM player is awesome but I cannot use it given that what I am writing will have to stay as pure GPL just for the sake of having a game 100% in GPL. Thanks. Hopefully by April I can launch my new game with some simple music or sound effects.

 

Sound List Ripper should be able to provide you with loads of play lists. Yes, ISR based sound lists to use with GPL.

;)

 

ISR = Interrupt Service Routine



#38 Tursi OFFLINE  

Tursi

    Quadrunner

  • Topic Starter
  • 5,350 posts
  • HarmlessLion
  • Location:BUR

Posted Sat Feb 27, 2016 3:17 AM

ISR sound lists are played by assembly code, it just happens to be in the ROM. ;) You COULD write a GPL player for my tunes too. ;)

But if you can't find what you need from Sometime's suggestion, sound lists are a pretty simplistic format, I'm sure you can create your own. Beyond that, I have nothing. :)

#39 RXB OFFLINE  

RXB

    River Patroller

  • 3,406 posts
  • Location:Vancouver, Washington, USA

Posted Mon Mar 14, 2016 5:26 PM

ISR sound lists are played by assembly code, it just happens to be in the ROM. ;) You COULD write a GPL player for my tunes too. ;)

But if you can't find what you need from Sometime's suggestion, sound lists are a pretty simplistic format, I'm sure you can create your own. Beyond that, I have nothing. :)

GPL HOW 2 Series

 

http://atariage.com/...ment-resources/

 

Most of  the tools are there if you have a list to run.



#40 TheMole ONLINE  

TheMole

    Dragonstomper

  • 807 posts
  • Location:Belgium

Posted Fri Oct 5, 2018 6:55 AM

Could it be that the current version on github is broken with the latest version of gcc? Music plays fine, but sound effects are completely wrong. It might also be that my particular build environment does something the compiler or library doesn't like.

 

I've set up a 'minimal' test environment that shows the problem and pushed it to github: https://github.com/t...i/compiler-test



#41 TheMole ONLINE  

TheMole

    Dragonstomper

  • 807 posts
  • Location:Belgium

Posted Fri Oct 5, 2018 9:48 AM

Am I doing anything wrong here?:

unsigned char levelsounds[MAX_SOUNDLIST_SIZE];

int main(int argc, char *argv[])
{
	unsigned int    joyst_result;

	// set the interrupt routine
	VDP_INT_CTRL = VDP_INT_CTRL_DISABLE_ALL;
	VDP_INT_HOOK = stplaysfx;

	// Mute all playing stuff
	allstopsfx();
	MUTE_SOUND();

	// Load title music and sound effect into RAM
	rom_to_ram(RES_START(music_theme_1), RES_END(music_theme_1), (unsigned char*)levelsounds);

	// Play song
	stinitsfx(levelsounds, 0);

	// Print how many 'songs' we have in the loaded file?
	vdpchar(0x0000, 48 + stcount(levelsounds));

	while (1)
	{
		// wait for fire
		joyst_result = 0;
		while (!(joyst_result & JOYST_FIRE))
		{
			joyst_result = read_joyst(JOYST_1);

			// wait for vsync
			vdpwaitvint();
		}

		// Pressed fire, make noise!
		sfxinitsfx(levelsounds, 1, 0);
	}

	return 0;
}


Edited by TheMole, Fri Oct 5, 2018 9:49 AM.


#42 Tursi OFFLINE  

Tursi

    Quadrunner

  • Topic Starter
  • 5,350 posts
  • HarmlessLion
  • Location:BUR

Posted Sat Oct 6, 2018 7:32 PM

I have not had opportunity to build or run anything for a long time -- I'm trying to get spare time back. I can't say anything about the latest version of GCC as a result...

 

One suggestion - make sure you stop music and mute before you load the interrupt hook (it's okay if you know the hook is disabled, but it's cleaner not to worry about whether the interrupt might fire before you initialize the player).

 

I don't see anything wrong offhand, sorry for that. Do you have some older code that worked you can try to recompile?



#43 TheMole ONLINE  

TheMole

    Dragonstomper

  • 807 posts
  • Location:Belgium

Posted Sun Oct 7, 2018 6:32 AM

Well, I probably should have specified I'm using the 30hz version (I just renamed it to have the same function names as the regular one). I just tried it with the 60hz version and that one works fine (apart from of course playing back everything at twice the speed :) ). Any chance a bug snuck into the 30hz version? I'll try to dig in the code myself to see if there are any immediate differences that jump out at me as being the possible culprit when I get some time.

 

Also, in case it could be a clue, if I call stplaysfx30() directly instead of from the VDP hook, js99er complains about an odd PC address and the whole things simply doesn't work at all. It smells like an alignment issue to me.


Edited by TheMole, Sun Oct 7, 2018 6:33 AM.


#44 Tursi OFFLINE  

Tursi

    Quadrunner

  • Topic Starter
  • 5,350 posts
  • HarmlessLion
  • Location:BUR

Posted Sun Oct 7, 2018 3:28 PM

Odd PC addresses are completely wrong... did you try breakpointing at the vector address to see if it is odd? Having an odd PC stored in the registers can cause surprising breakages (and yet appear to almost work, since the PC itself is only 15 bits).

 

I don't use the 30Hz version myself, but calling directly without the VDP hook I do often enough. There could well be a bug in there... I haven't touched any of it for longer than I'd like and looking at your code the other day was like looking at a foreign moonscape.... ;) The only difference with the 30hz version is /supposed/ to be that it alternates the music and the sound effects on alternate calls, rather than doing them both. At worst you could re-split the 60hz version ;)



#45 TheMole ONLINE  

TheMole

    Dragonstomper

  • 807 posts
  • Location:Belgium

Posted Tue Oct 9, 2018 1:36 AM

Also, in case it could be a clue, if I call stplaysfx30() directly instead of from the VDP hook, js99er complains about an odd PC address and the whole things simply doesn't work at all. It smells like an alignment issue to me.

 

Ignore this, I forgot you have to reset the workspace back to 0x8300 manually if you call stplaysfx directly... added an lwpi 0x8300 and now it works for the 60hz version. I figure I'm just going to use that one and call it every other frame (I call it as part of the sprite flicker routine now, which also does different things on even and odd frames, so it's probably a bit faster than the 30hz version anyway :) ).



#46 Tursi OFFLINE  

Tursi

    Quadrunner

  • Topic Starter
  • 5,350 posts
  • HarmlessLion
  • Location:BUR

Posted Wed Oct 10, 2018 3:38 AM

Ah, excellent! And no problem, it's good to call this stuff out from time to time, helps me remember too ;)






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users