Socket
Socket
Sign inDemoInstall

mgsc-js

Package Overview
Dependencies
27
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mgsc-js

MML to MGS compiler for MGSDRV


Version published
Maintainers
1
Install size
3.21 MB
Created

Readme

Source

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/

FAQs

Last updated on 03 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc