2.0.0 • Published 5 months ago

mgsc-js v2.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 months ago

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 >=3.0.0 and cmake >=3.0 are required.

$ emcc -v # confirm emcc is on path and version >= 3.0.0
...
$ 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/

2.0.0

5 months ago

1.3.0

1 year ago

2.0.0-beta.1

1 year ago

2.0.0-beta.0

1 year ago

1.2.0

2 years ago

1.2.0-alpha.0

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago