Library and tools for converting Noteworthy Composer (NWC) files to MusicXML format.
The library is split into two main components:
- Parser (
parser.js,nwctxt-parser.js,reader.js) - Parses NWC files into a structured format - Writer (
writer.js) - Converts parsed NWC data to MusicXML
This separation allows the parser to be reused independently for other purposes.
import { parseNWC } from './lib/nwc2xml/index.js';
const buffer = // ... read NWC file as Uint8Array
const nwcFile = parseNWC(buffer);
// nwcFile contains: version, title, author, staffs[], etc.import { convertNWCToMusicXML } from './lib/nwc2xml/index.js';
const buffer = // ... read NWC file as Uint8Array
const xml = convertNWCToMusicXML(buffer);import { parseNWC } from './lib/nwc-parser.js';
const nwcFile = parseNWC(buffer);
// Use parsed data for your own purposesConvert NWC files to MusicXML from the command line:
# Convert to XML (output defaults to input.xml)
bun bin/nwc2xml.js song.nwc
# Specify output file
bun bin/nwc2xml.js song.nwc output.xml
# Show help
bun bin/nwc2xml.js --helpOpen converter.html in a browser for a drag-and-drop interface to convert NWC files to MusicXML.
Features:
- Drag and drop NWC files
- View converted XML in browser
- Download converted XML file
- Staff properties and layout
- Notes, rests, and chords
- Time signatures and key signatures
- Clefs (treble, bass, alto, tenor)
- Dynamics and tempo markings
- Lyrics
- Articulations and ornaments
- Beaming and stems
Based on the nwc2xml converter https://github.com/mzealey/nwc2xml and code originally developed for this project.