Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

mgsc-js npm version

mgsc-js is a JavaScript version of MGSC (MML to MGS compiler for MGSDRV) build with Emscripten

Repository: mgsc-js GitHub

Install as Command-Line Tool

$ npm install -g mgsc-js

How to Use Command

$ mgsc-js [options] source

where the source is MGSC's MML source text.

Options

$ mgsc-js
Usage: mgsc [options] source
[options]
  -o, --output FILE   : Specify the output filename.
  -e, --encode ENCODE : Specify the input file encoding [default:AUTO].
                        Available encodings: UTF16, UTF16BE, UTF16LE, 
                        JIS, UTF8, EUCJP, SJIS
  -t                  : Show track memory usage.
  -h, --help          : Show this help.

Install and Use as Library

Install the mgsc-js as a node_module.

$ npm install --save mgsc-js

Then,

const FS = require('fs');
const MGSC = require('mgsc-js');

MGSC.initialize().then(() => {
  const result = MGSC.compile('#opll_mode 0\n#tempo 120\n9 v13@0o4cdefgab>c\n');    
  if (!result.success) {
    console.log(result.errorInfo.message + ' in ' + result.errorInfo.lineNumber);
    console.log('>> ' + result.errorInfo.lineText + '\n');
    process.exit(1);
  }

  FS.writeFileSync('result.mgs', new Buffer(result.mgs), "binary");
});

How to build Project

emscripten >=1.39.20 and cmake are required.

$ emcc -v # confirm emcc is on path and version >= 1.39.20
...
$ git clone --recursive https://github.com/digital-sound-antiques/mgsc-js.git
$ cd mgsc-js
$ npm install
$ npm run build 
$ npm run jsdoc # for document

API Document

http://digital-sound-antiques.github.io/mgsc-js/

About

MML to MGS compiler Javascript.

Resources

Stars

Watchers

Forks

Packages

No packages published