Looking for some tunes for a mod

This is where you can post your Commander Keen related stories, artwork, or other stuff that is related to Commander Keen but otherwise doesn't belong in another forum.
User avatar
Malvineous
Shikadi Webmaster
Posts: 382
Joined: Wed Oct 31, 2007 21:48
Location: Brisbane, Australia
Contact:

Re: Looking for some tunes for a mod

Post by Malvineous »

Just out of curiosity, does this file I ran through gamemus work any differently?

I took the 2b version (after imfcrush) and converted it from IMF to IMF, which rewrites the whole file using full OPL commands so you won't ever cut off a file half way through a command. I also moved one of the tracks from the first OPL channel to the second, so it can be used with games that use the first OPL channel for sound effects.

It looks like I need to rethink the output though, because it's much more verbose with the frequency commands - the file increased in size by about 1 kB.

If this worked, you can download gamemus as part of Camoto and this is the command I used:

Code: Select all

gamemus -i -k 0=o1 bounder2b.imf -c imf-idsoftware-type0:bounder2-gamemus.imf
User avatar
Commander Spleen
Lord of the Foobs
Posts: 2384
Joined: Wed Oct 31, 2007 22:54
Location: Border Village
Contact:

Re: Looking for some tunes for a mod

Post by Commander Spleen »

That file didn't work either.

Trying gamemus using Wine (compiling on Linux still eludes me due to epic deps and weird errors--mainly relating to Boost I think).

You must be running a much newer version because -k, -i and 0=o1 aren't available and cutting them out causes errors.
Last edited by Commander Spleen on Sun Oct 01, 2017 2:22, edited 2 times in total.
User avatar
Commander Spleen
Lord of the Foobs
Posts: 2384
Joined: Wed Oct 31, 2007 22:54
Location: Border Village
Contact:

Re: Looking for some tunes for a mod

Post by Commander Spleen »

Ahh, hang on... it specifies in the TSRMus readme that it uses 560Hz Type 1, not Type 0. So presumably I converted them to Type 1 originally and converting them to Type 0 is making them incompatible. I'll go and run some imfcrush specifying Type 1 and see how it goes.

Edit: So imfcrush doesn't have a type parameter. Is it converting everything to Type 0 rather than preserving the type the IMF file already is?
User avatar
Commander Spleen
Lord of the Foobs
Posts: 2384
Joined: Wed Oct 31, 2007 22:54
Location: Border Village
Contact:

Re: Looking for some tunes for a mod

Post by Commander Spleen »

KeenWave to the rescue!

Seems to be looping seamlessly in-game. Now to work in some other tracks and see if the instrument glitches have been resolved.

Edit: Track interference appears to have been eliminated using dro2imf, imfcrush and keenwave. Progress can continue.

Btw, duk3: I wasn't able to compile a native Linux binary of imfcrush either; it's almost cross-platform, but there were some small details that make it only valid for Visual C++ and I couldn't find a workaround.
User avatar
Malvineous
Shikadi Webmaster
Posts: 382
Joined: Wed Oct 31, 2007 21:48
Location: Brisbane, Australia
Contact:

Re: Looking for some tunes for a mod

Post by Malvineous »

Commander Spleen wrote: Sun Oct 01, 2017 1:18 Trying gamemus using Wine (compiling on Linux still eludes me due to epic deps and weird errors--mainly relating to Boost I think).

You must be running a much newer version because -k, -i and 0=o1 aren't available and cutting them out causes errors.
Yeah it's unfortunate all the deps turned out to make it so difficult to work with. I'm working towards eliminating as many of them as I can (especially Boost, which has proven to be a constant headache.)

I did however fix the output issue so the IMF is now a few hundred bytes smaller than the original, and I also added two gamemus parameters to cut events off the start and ends of a song, so you can go straight from the DOSBox .dro to final IMF in one step. This only cuts note on/off events and leaves the rest, so you shouldn't get any weirdness with instruments or the like.

If your distro has a recent version of Boost you should be able to get away with compiling libgamecommon and then libgamemusic without any of the other libraries.
User avatar
Commander Spleen
Lord of the Foobs
Posts: 2384
Joined: Wed Oct 31, 2007 22:54
Location: Border Village
Contact:

Re: Looking for some tunes for a mod

Post by Commander Spleen »

Yeah, couldn't even get libgamecommon compiled. The error isn't too helpful. There's a variable in there for detecting the Boost test library which is actually coming up blank. Mint's version is 1.58 so just that bit under what Camoto is expecting.

It'll be something I'll try when installing Arch again, which should happen in the next few months.

Edit: I just ran ./configure again to copy the error and it completed and has compiled and installed.

Then again, I did just install the libboost-all-dev package earlier which must have brought in the required sub-libs. Guess I forgot to test it after that.

Ok, I think it's working. Had to copy libgamemus.so.2 from /usr/local/lib to /usr/lib. (Also had to modify the configure file to look for 1.58 instead of 1.59). I'll experiment with this later.
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 781
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: Looking for some tunes for a mod

Post by K1n9_Duk3 »

Commander Spleen wrote: Sun Oct 01, 2017 2:08So imfcrush doesn't have a type parameter. Is it converting everything to Type 0 rather than preserving the type the IMF file already is?
That's what the "/chunk" parameter is for. The so-called "Type 1" files are actually just improperly ripped chunks from the AudioT file. Every game that uses IMF songs that are not stored in an AudioT file uses plain IMF files (what some people call "Type 0"), that's why the IMF Crusher defaults to plain IMF. I would have expected the tools that play or import IMF files to detect the type automatically, but that doesn't seem to be the case with TSRMUSIC or wharever you are using.
Commander Spleen wrote: Sun Oct 01, 2017 2:36 Btw, duk3: I wasn't able to compile a native Linux binary of imfcrush either; it's almost cross-platform, but there were some small details that make it only valid for Visual C++ and I couldn't find a workaround.
I guess this must have something to do with the "fopen_s" calls, right? Visual C++ freaks out if you use the regular "fopen" function because of possible security issues. I could rewrite that if you want to give it another shot.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
User avatar
Malvineous
Shikadi Webmaster
Posts: 382
Joined: Wed Oct 31, 2007 21:48
Location: Brisbane, Australia
Contact:

Re: Looking for some tunes for a mod

Post by Malvineous »

Ah yes, you'll have to add /usr/local/lib into /etc/ ld.so.conf (then run ldconfig) to get your system to look in that folder, which is a good idea because that's where anything you compile yourself will go. Only your system package manager should be putting files into /usr/lib.

You'll definitely need any -dev packages when compiling too, good pick up, it's difficult to know what different distros call those things.

By way of doco, here are some tips:

List all the events in a song:

Code: Select all

gamemus file.dro -v | less
0/0: delay=0...
1/200: delay=200...
2/300: delay=100...
Here the 200/300 is the number of ticks since the start of the song. If you use --start-at=300 then the first two events will be dropped and event number 2 (starting at 300 ticks) will become the first event in the song. --stop-at works the same way, dropping all events after that time has been reached. You should specify --stop-at first on the command line, because once --start-at removes events it will of course throw off the end time.

If you want to listen to the song to see if you have cut it at the right moment, you can use --play:

Code: Select all

gamemus file.dro --loop 0 --stop-at 5000 --start-at 4000 --play
This will start playback 1000 ticks from the end of the song, so you don't have to sit through the whole thing to hear whether it ends properly. Once you have the ending correct leave --stop-at unchanged and lower --start-at until the song starts at the right spot.

Converting to IMF is as before, now as a type-1 IMF instead:

Code: Select all

# List channels used
gamemus file.dro -i
Track 0: OPL 0 [chan 0 @ chip 0] (inst: 9 12 18 22 27)
Track 1: OPL 1 [chan 1 @ chip 0] (inst: none)
Track 2: OPL 2 [chan 2 @ chip 0] (inst: 8 11 15 17 21 31 32)
...
# OPL 1 (o1) is not used, so move track 0 onto OPL channel 1 (-k track=new_channel)
gamemus file.dro -k 0=o1 -c imf-idsoftware-type1:out.imf
User avatar
Commander Spleen
Lord of the Foobs
Posts: 2384
Joined: Wed Oct 31, 2007 22:54
Location: Border Village
Contact:

Re: Looking for some tunes for a mod

Post by Commander Spleen »

Malvineous wrote:Malkovich Malkovich Malkovich
Nice, runs well so far. The extra start time boundary setting is very useful, though I'm finding it stops the song from looping.

I don't really need to worry about the 0th track for Vorticons use, but I'll keep that in mind to ensure compatibility later.
K1n9duk3 wrote:That's what the "/chunk" parameter is for.
Right, I'll try that out. That should eliminate one extra step using this method.
K1n9duk3 wrote:I guess this must have something to do with the "fopen_s" calls, right? Visual C++ freaks out if you use the regular "fopen" function because of possible security issues. I could rewrite that if you want to give it another shot.
These are the errors I get when trying to compile:

Code: Select all

imfcrush.cpp: In function ‘int IMF_WriteIMF(char*, UINT8*, UINT32, UINT8)’:
imfcrush.cpp:342:2: error: ‘errno_t’ was not declared in this scope
  errno_t fileerror = fopen_s(&out, filename, "wb");
  ^
imfcrush.cpp:343:7: error: ‘fileerror’ was not declared in this scope
  if (!fileerror)
       ^
imfcrush.cpp: In function ‘int IMF_LoadIMF(char*)’:
imfcrush.cpp:447:2: error: ‘errno_t’ was not declared in this scope
  errno_t fileerror = fopen_s(&in, filename, "rb");
  ^
imfcrush.cpp:448:7: error: ‘fileerror’ was not declared in this scope
  if (!fileerror)
       ^
imfcrush.cpp: At global scope:
imfcrush.cpp:479:33: error: ‘::main’ must return ‘int’
 void main(int argc, char* argv[])
                                 ^
imfcrush.cpp: In function ‘int main(int, char**)’:
imfcrush.cpp:509:45: error: ‘_stricmp’ was not declared in this scope
   #define IFARG(str) if(!_stricmp(arg, (str)))
                                             ^
imfcrush.cpp:514:4: note: in expansion of macro ‘IFARG’
    IFARG("/keepdummy")
    ^
imfcrush.cpp:532:6: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
      return;
      ^
imfcrush.cpp:539:7: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
       return;
       ^
imfcrush.cpp:545:7: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
       return;
       ^
imfcrush.cpp:552:6: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
      return;
      ^
imfcrush.cpp:560:7: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
       return;
       ^
imfcrush.cpp:566:5: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
     return;
     ^
imfcrush.cpp:585:6: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
      return;
      ^
imfcrush.cpp:590:6: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
      return;
      ^
User avatar
Malvineous
Shikadi Webmaster
Posts: 382
Joined: Wed Oct 31, 2007 21:48
Location: Brisbane, Australia
Contact:

Re: Looking for some tunes for a mod

Post by Malvineous »

Commander Spleen wrote: Sun Oct 01, 2017 7:02 Nice, runs well so far. The extra start time boundary setting is very useful, though I'm finding it stops the song from looping.
Oh I think I may have forgotten to shorten the overall song length after cropping events from the start. There's probably a bit of a delay before it loops. I just pushed a fix to git, if you do a "git pull && make" does that help?
Commander Spleen wrote: Sun Oct 01, 2017 7:02 These are the errors I get when trying to compile:
Those errors bring back terrible memories from when I tried to get the Camoto code compiling under Windows. Good luck @K1n9_Duk3, they're not difficult to fix just really annoying :-) I did it the dodgy way and used a bunch of #define statements!
User avatar
Commander Spleen
Lord of the Foobs
Posts: 2384
Joined: Wed Oct 31, 2007 22:54
Location: Border Village
Contact:

Re: Looking for some tunes for a mod

Post by Commander Spleen »

Malvineous wrote:I just pushed a fix to git, if you do a "git pull && make" does that help?
Yup, that fixed it. \o/
User avatar
Levellass
S-Triazine
Posts: 5265
Joined: Tue Sep 23, 2008 6:40

Re: Looking for some tunes for a mod

Post by Levellass »

Everyone in this thread:

8) So what you do is take a reverse Fourier transform of the initial eigenstate that you can then port across formats to your basic tracker module. Remember to use big-endian encoding to avoid bit rot when you incorporate parallax scrolling or otherwise your chiptune will only be compatible with 286 architecture, assuming you run through an emulator. If you have any problems dismantle your motherboard and polish the transistors.


Me:

:crazy Hmm, this tune doesn't sound as good as it did in MIDI. Guess I'll try using the other one.
What you really need, not what you think you ought to want.
User avatar
Malvineous
Shikadi Webmaster
Posts: 382
Joined: Wed Oct 31, 2007 21:48
Location: Brisbane, Australia
Contact:

Re: Looking for some tunes for a mod

Post by Malvineous »

Says the person who knows more assembly language than probably everyone here :P
Post Reply