Giter Site home page Giter Site logo

malvineous / libgamemusic Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 4.0 1.04 MB

Library providing a standard mechanism for playing and converting music used in DOS games.

Home Page: http://www.shikadi.net/camoto/

License: GNU General Public License v3.0

Shell 0.02% C++ 90.67% Makefile 0.78% M4 5.73% HTML 1.09% CSS 0.13% JavaScript 1.58%

libgamemusic's People

Contributors

drmccoy avatar malvineous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libgamemusic's Issues

[cdfm] New format discoveries to implement

Note: These observations are based on the Amnesia and Zone 66 S3M conversions which I assume went through this tool, as well as reading through mus-cdfm-zone66.cpp.

Volume

Composer 670 / CDFM uses linear volume for both PCM and OPL instruments. S3M only uses linear volume for samples and uses the OPL's logarithmic volume for OPL instruments. Hence CDFM volume needs to be re-mapped for OPL instruments when converting to S3M.

The following table is from the CDFM source code (fmvoltbl in DFMPM.ASM), but the values are upside down to compensate for the fact OPL volume 0 equals S3M volume 64:

static const uint8 fmVolume[16] =
{
    0x08, 0x10, 0x18, 0x20, 0x28, 0x2C, 0x30, 0x34,
    0x36, 0x38, 0x3A, 0x3C, 0x3D, 0x3E, 0x3F, 0x40,
};

Note that there is a slightly different variant of the table in DFMPMA.ASM so it is not entirely clear which of the two tables has been used. Maybe an uncompressed disassembly of Amnesia/Zone66 would give some insight here.

PCM volume should probably be translated using the formula 4 * volume + 4 (yes, volume 0 is not completely silent).

More than 16 instruments

CDFM can address 32 PCM instruments and 32 OPL instruments.
The high bit of the instrument number is stored in the highest bit of the note/octave byte. This can be observed in DARE.C67 which has more than 16 samples.

Pattern breaks

The last issue can be observed in the first pattern of AMNESIA2.S3M: If pattern command 0x60 is found before the last row of the pattern, a pattern break should be inserted in the previous row.

[raw-rdos] Extra notes appearing in some files

$ ./gamemus /tmp/"LAME intro tune for Xerox of INC.raw" -c dro-dosbox-v2:out.dro
Opening /tmp/1.raw as type
File is definitely: Rdos raw OPL capture [raw-rdos]
decode-opl: Invalid OPL channel 15
...
decode-opl: Invalid OPL channel 9
Wrote out.dro as dro-dosbox-v2

When listening the resulting file it appears an extra note in the end of each phrase.

camoto/error.hpp No such file or directory

I've compiled and installed libgamecommon but when I attempt to make libgamemusic I have the error that camoto/error.hpp is missing. I also can't find it under this git repo. Can you help please?

Need a generic way of splitting a song into multiple patterns

It is currently not possible to convert an unpatterned song like MIDI, IMF or RAW into a patterned format like S3M.

Rather than simply start a new pattern when the end of the current one is reached, it would be nice to analyse the song and try to find repeating sections, so those can be used as the pattern boundaries. But a run-on pattern conversion might still be needed in case those patterns end up being larger than the format supports (S3M has a max of 64 ticks per pattern.)

This would also require reducing the tick speed and rewriting the song with fewer ticks, since formats like RAW typically run at hundreds of ticks per second, while S3M is usually less than 10 ticks per second. It might also require expanding the ticks as well, so that a pattern being written to S3M can be expanded to 64 ticks exactly.

[s3m-screamtracker] Implement Adlib instrument fine tuning value

$ ./gamemus /tmp/ADLIBSP.S3M -c dro-dosbox-v2:out.dro
Opening /tmp/ADLIBSP.S3M as type
File is definitely: ScreamTracker 3 Module [s3m-screamtracker]
S3M: Adlib instrument has c2spd of 8300
Error opening music file: S3M Adlib instrument has fine tuning value - these are unimplemented! Please report this problem.

[s3m-screamtracker] Conversion to S3M fails if there is no song title present

$ ./gamemus /tmp/"LAME intro tune for Xerox of INC.raw" -c s3m-screamtracker:out.s3m
Opening /tmp/1.raw as type
File is definitely: Rdos raw OPL capture [raw-rdos]
decode-opl: Invalid OPL channel 15
...
decode-opl: Invalid OPL channel 9
gamemus: Unexpected error - vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.