Skip to main content

from_nwc

Function from_nwc 

Source
pub fn from_nwc(bytes: &[u8]) -> Result<Stream>
Expand description

Reads a NoteWorthy Composer .nwc file’s bytes into a score, as music21’s converter.parse reads one: each staff and object written out as a line of the text format (nwc_lines) and those read by super::from_noteworthy’s reader.

The file must be uncompressed. A compressed one starts [NWZ] and a nul byte, and what follows is a zlib stream: inflate it first, as this crate unpacks nothing.

music21 calls this reader beta, and what it leaves out is left out here: lyrics, dynamics, flow marks and performance marks are read past and not written.

§Errors

A compressed file, a file that ends early, an object of a kind music21 does not know, a note or rest in a file older than music21 reads, or anything the text reader refuses.