Lemmings Forums

NeoLemmix => NeoLemmix Main => Topic started by: namida on January 24, 2016, 01:44:14 PM

Title: Music files by name
Post by: namida on January 24, 2016, 01:44:14 PM
Okay, this is a feature that's been requested plenty of times in the past - and I finally got around to properly implementing it!

This of course requires support from all three angles - the editor, the player, and the Flexi Toolkit. Since firstly, this feature hasn't been thoroughly tested yet, and secondly, there's other things I want to do before an update; I can't release a stable update with these features yet, but I've uploaded an experimental version that has these features.

The player is the same as always - load content in it, it should play. Please report (in this topic, or in the usual place, but make it clear you're reporting an issue with the experimental release!) if:
- You configure something that according to these instructions should work, but doesn't
- Any older packs suddenly have issues with their music when played in this version, that they did not have when playing in V1.37n / V1.38n / V1.38n-B
In particular, there may be problems in packs that mostly rely on specifying music for every level, rather than using any rotation at all.

The editor is not much changed. The only change is that the music file name is now editable for NeoLemmix levels (previously it was only editable for SuperLemmini levels). You can enter a filename here - don't put any extension; it will first try to load an OGG, then if one isn't found, an IT. Note that you now must outright specify a special music for gimmick / frenzy levels; it's no longer automatic. (Older NXPs will still play special music on those levels, but new ones or individual LVL files will not.)
Note that only the EXE of the editor has been uploaded. Get the data files from the latest stable release.
I doubt there's any problems with this in the editor, but if you do encounter any, let me know.

The Flexi Toolkit has the most visible changes. The music and music pack lists are no longer "Track 1", "Track 2" etc, but just have actual filenames. You can put whatever OGG / IT files you like in there (note: if importing an old pack, you might need to manually re-add music pack files, and possibly remove them from the default music list). The "Edit Track Rotation" button allows you to specify a custom track order - and yes, you can have the same track more than once in your order!
Chances are there's bugs to hell and back with this part of it, so if any pop up, be sure to report them.
Note: You might notice the "Add Default Graphic Set" button is gone; that's because you don't need to include default graphic sets anymore (you only need to include custom ones). Actually, the same applies to default musics too, but I haven't got around to removing that button yet.

Note that a music filename, when specified for a level, cannot exceed 16 characters (excluding the extension). For those that are just used in the normal rotation, they can be as long as you like.
In both cases, they cannot (again, excluding extension) start or end with a space; but they can have a space in the middle.

Please do NOT use any of these experimental versions to create for-release content! They're for testing purposes only! If you do decide to release content based on test versions, then it later breaks, I will not make a special effort to get it working again! Always use stable versions for intended-for-release content!
(It's probably okay to use this editor version, though. But I make no guarantees. For the others, at this point it's probably safe to use them for working on projects, but wait for a stable one before any actual release.)


If you have any questions about how to work this, please reply in this topic. Only post on the bugs subforum if you find a bug with them (or have a suggestion on how to improve it).
Title: Re: Music files by name
Post by: namida on January 25, 2016, 02:20:40 AM
Known or suspected bugs:

Note: This is only for bugs specifically relating to the new features; not bugs that have existed for a while and just not yet been fixed in these versions.
"Suspected" means that I'm pretty sure the bug will occur based on the code, but haven't actually tested to see if it does.

Player
- (Suspected) If a level doesn't outright specify the music, and the pack has no tracks in its rotation list, the game will probably crash. (It might just play no music instead.)
>> Tested. It doesn't crash, it just doesn't play any music (this is probably the best behaviour to have in such a case).

Editor
(None)

Toolkit
- Still need to remove "Add Default Music" button
- Still need to make sure error checker doesn't report missing musics when default ones are used
Title: Re: Music files by name
Post by: namida on January 25, 2016, 02:26:30 AM
I uploaded a newer copy of the Flexi Toolkit that fixes some major bugs in the first experimental version, as well as allowing editing the track rotation in the toolkit itself (rather than having to use an external tool). :)

I still wouldn't recommend using it to build for-release NXPs, but at this point, it's probably safe to use it for working on projects and getting ready for the next update (if you intend to update your NXPs, or if you're working on a new project - I will stress that, as always, you do not need to update your NXPs if you aren't interested in using the new features; old ones will continue to work fine!).
Title: Re: Music files by name
Post by: Wafflem on January 25, 2016, 04:51:48 AM
This is excellent! :thumbsup:

This will make things more convenient for people.

I've tested some of my levels (not part of DynaLems) by music name, and the levels work just fine! :thumbsup: I haven't texted the Flexi Toolkit yet though.

However, seems that there is a character limit. For example, I have a music named AcornONMLSuperLem.it. I type this exact lettering, as shown in the first picture. However, when I open it in the level, I get the error and it becomes "acornonmlsuperle", without the m at the end. Is the character limit intended?
Title: Re: Music files by name
Post by: namida on January 25, 2016, 04:54:28 AM
Yes; it's just a result of how the music name is actually stored in the LVL file (LVL files have actually been storing them for a long time now; I just never got around to doing the rest of the work needed until now). The limit is 16 characters; this does not include the extension.

This limit will be a thing of the past once I implement a text-based level format, but that might be a while away yet.

There's no length limit (within reason) on names in the standard rotation; only those specified on a per-level basis.
Title: Re: Music files by name
Post by: namida on January 25, 2016, 04:57:37 PM
Alright so, aside from fixing a few annoying bugs in the Flexi Toolkit - not major ones, pretty much all of them just relate to the Check Issues giving false positives (and less often, false negatives) in relation to music files - it seems that this is mostly ready to go.

One thing I am thinking - similar to how default musics don't need to be provided, there should also probably be a way to have global music packs. If a user prefers the DOS versions of ONML musics over the Amiga ones, they shouldn't have to create a seperate copy of the music pack for every pack that uses ONML music.
EDIT: Okay, done that. I didn't upload a new experimental version for it, though.
Title: Re: Music files by name
Post by: alexis9000 on November 19, 2016, 02:50:52 PM
didn't knew the music files here were PNG files. Seems like I'll have to convert again :\
Title: Re: Music files by name
Post by: Nepster on November 19, 2016, 02:55:28 PM
NO! Music cannot be stored in .png files.
You can use .ogg (recommended), .mod (if you have them), .mp3 and some other file formats.
Title: Re: Music files by name
Post by: alexis9000 on November 19, 2016, 03:09:48 PM
I have a file that it's not working (some .it file) when I play my level instead of playing my .it file, it plays "Can-Can" and I don't want that, I want it to play the new song (I already put the song in Flexi ToolKit, already tried to write the name of the file in NeoLemmix Editor, but nothing). Then I thought maybe I had to modify some "music.txt" file, but then I looked inside it "how am I supposed to modify such a thing if no one tells me to modify it?" so that's why I am so confused, lol.
Title: Re: Music files by name
Post by: IchoTolot on November 19, 2016, 03:19:45 PM
I have a file that it's not working (some .it file) when I play my level instead of playing my .it file, it plays "Can-Can" and I don't want that, I want it to play the new song (I already put the song in Flexi ToolKit, already tried to write the name of the file in NeoLemmix Editor, but nothing). Then I thought maybe I had to modify some "music.txt" file, but then I looked inside it "how am I supposed to modify such a thing if no one tells me to modify it?" so that's why I am so confused, lol.

can we have the .it file?

It needs to be in the toolkit + the level must have set it as it's track. Also the filename CAN be too long. I would recommend getting the pack to work first -- then care about the music.
Title: Re: Music files by name
Post by: Nepster on November 19, 2016, 03:23:36 PM
One thing you might want to check: In the editor the music file has to be entered without the file extension, i.e. "myMusic" instead of "myMusic.it".
Title: Re: Music files by name
Post by: alexis9000 on November 19, 2016, 03:34:08 PM
One thing you might want to check: In the editor the music file has to be entered without the file extension, i.e. "myMusic" instead of "myMusic.it".

Thanks, but it still won't work that way. I've put the file for you attached. Gotta go now, I'll be back later.

Somehow I'm also not being able to put the file in this forum, so I've put it on sendspace for you, here it is --> https://www.sendspace.com/file/9t4q1a
Title: Re: Music files by name
Post by: IchoTolot on November 19, 2016, 03:56:19 PM
One thing you might want to check: In the editor the music file has to be entered without the file extension, i.e. "myMusic" instead of "myMusic.it".

Thanks, but it still won't work that way. I've put the file for you attached. Gotta go now, I'll be back later.

Somehow I'm also not being able to put the file in this forum, so I've put it on sendspace for you, here it is --> https://www.sendspace.com/file/9t4q1a

A 45 MB ".it" file :lem-mindblown:

Normally these are hardly 100 KB

Even as a MP3/OGG this file size is huge for a ~ 5 min song! I think somehow your conversion is wrong, even if I can play the song. Also try remane it ahrix01, the "_" could cause problems.

My recommendation would still be: Get the levels + pack to work and then try to put in the right music as I still sense that the main problem is located there.

EDIT:

After downloading your file and creating a test level in the cavelem style (attached): I got your music to work! (without the _ in the name)

To load the level in the NeoLemmix Player put the track in the music folder (leaving out the "_" in the file name). Test playing in the editor with a testplayer: Make a music folder for the test player and put the file in there. Be sure that you have the tileset!
Try to load my level in the editor to see how I put in the music track in the level properties window!

Also there is no way the file needs to be 45MB  try to turn the size down :P
Title: Re: Music files by name
Post by: IchoTolot on November 19, 2016, 04:09:40 PM
Afterthought: We assume that your .it file is actually an uncompressed wavefile! That would explain the size of it!  Try to convert the original (I assume) wavefile properly to an OGG file using a music editor like Audacity.
Title: Re: Music files by name
Post by: Dullstar on November 20, 2016, 06:13:39 AM
I think the samples in .its may be partially compressed based on a test, but I'm not sure (it could also be setting related).  I opened the .it file in OpenMPT and converted it to a .wav using the default settings. The resulting file was 105 MB. I tried saving the sample (not a typo - singular sample) from the .it as well and got a smaller size of 23.7 MB.

I'm not entirely sure what's going on there, but whatever.

Anyway, the main point is that the file is indeed a .it that contains two notes - a C-5 in 2 channels (one left panned, one right panned, resulting in center panning), of one sample consisting of the entire song. This is consistent with what happens if you go into OpenMPT and go to File->Open->(Some Sort of Wave File).

An .ogg of this song should be about 5 MB. I did a conversion. I won't upload it here, though, because it's not mine.

To convert to ogg:
http://www.audacityteam.org/
Using this program, (Audacity), open the file (I believe you'll need to use the File->Import function rather than File->Open if I recall correctly). Then, once it's been loaded just hit Export, set the file format to .ogg, and you're good to go!

Mod/it/xm/etc. files tend not to be very large; often (usually?) much less than 1 MB. If it's large that means it probably wasn't an appropriate use of the format.
Title: Re: Music files by name
Post by: alexis9000 on November 20, 2016, 10:25:56 AM
Unfortunatelly...and after making (or at least trying) what you've been telling to me, it seems that it still won't work...somehow I got a feeling that I'm forgetting something, but I don't know what.
Title: Re: Music files by name
Post by: IchoTolot on November 20, 2016, 10:52:58 AM
Unfortunatelly...and after making (or at least trying) what you've been telling to me, it seems that it still won't work...somehow I got a feeling that I'm forgetting something, but I don't know what.

As I said your file (even it beeing too large) is alright. I get my test levels to play it. I still assume there is some elementary wrong in your process here. Either using a wrong program or doing sth elementary wrong in the level creation process.

I highly recommend: Make your level from scratch using the latest release of the NeoLemmix editor. After that upload it here so we can check if it's alright. At last add the music track.

I/We need to see your exact progress here, as this is the first time I saw a level not loading because it wanted "levelpack1.dat", "levelpack2.dat".... (did you maybe try to remane tilesets?)

This might be a great help for you: https://www.youtube.com/watch?v=53dMYMF2LgM
As namida is live creating a level in the editor here!
Title: Re: Music files by name
Post by: namida on November 20, 2016, 11:07:10 AM
For the music:

In an NXP file

(http://www.neolemmix.com/old/flexitutorial/tutorial4.png)

When building your NXP, make sure the music is in the *LEFT* dialog box here. You can add it using the "Add" button. (Don't worry about the box on the right for now, that's for more-advanced situations.)



If playing as a single level
Create a "music" folder in the same folder as NeoLemmix.exe (if it doesn't already exist), and place the music file in there.



If you still can't get it to work, please come on the #NeoLemmix IRC channel (http://www.lemmingsforums.net/index.php?topic=2515.0) sometime and hopefully someone who can help you is online. (I'm online at the moment, not sure how long I'll be on for.) It may be easier to solve this via chatroom communication than forum posts.
Title: Re: Music files by name
Post by: namida on November 20, 2016, 11:23:58 AM
Awesome! :)

Now - as others have mentioned - it sounds like your music file should be in OGG format, not IT format.

Generally, the only format that should be converted to IT is MIDI. Most other formats either don't convert well to IT, or are already compatible without any conversion (MOD, XM, etc). All other formats should be converted to OGG (in fact, NeoLemmix supports WAV and MP3 as-is, they're just not recommended; converting them to OGG is better).
Title: Re: Music files by name
Post by: ccexplore on November 21, 2016, 09:04:56 PM
All other formats should be converted to OGG (in fact, NeoLemmix supports WAV and MP3 as-is, they're just not recommended; converting them to OGG is better).

I'm fine with recommending OGG as the format to use, but I don't know I'd necessarily make a blanket recommendation for converting MP3s to OGG if MP3 is already supported.  Basically all conversions to OGG or MP3 are lossy, meaning the audio is slightly degraded in the process in order to reduce the amount of data required.  For WAV, it is still generally a good idea as the slight (potentially imperceptible to most people, depending on the quality of the original) degradation of quality from the conversion is greatly outweighed by the massive reduction in file size, particularly for lengthy audio such as background music.  For MP3 to OGG, the reduction in size will likely be much smaller, so the tradeoff is not quite so one-sided.  I would at least say that you should directly try to find an OGG version (as it may have gone directly from raw/loseless audio to OGG) instead of converting from an MP3 version you found (which implies going from raw/loseless to MP3 and then to OGG, so the audio got degraded two times).