XMLScore Holds XMLVoices for output to MusicXML files


Inherits from: Object


Holds XMLVoice objects. XMLScore can take multiple XMLVoice instances. Handles output of MusicXML files.


See also: XMLPart and XMLNote as well as MusicXMLOverview


Creation / Class Methods


*new

create a new instance of XMLScore

add (part)

Add an XMLPart object to an XMLScore. XMLPart instances can be added before any XMLNotes are added to the XMLPart, so you can set up your score structure before doing anything else.



output (pathname)

Output a MusicXML file based on the contents of an instance of XMLScore.

pathname - the path to write a MusicXML file to


Examples


// simple example

(

// create an XMLScore

z = XMLScore.new;

// add a voice to the XMLScore

z.add(y = XMLPart(meter: XMLMeter(4, 4), key: XMLKey.major(\Bf)));

// create a B-flat major scale in quarter notes

// uses XMLVoice's internal 'clock' to keep track of beats

[58, 60, 62, 63, 65, 67, 69, 70].do({arg keynum;

y.add(XMLNote(keynum, y.now, \e));

// advance the clock to the next beat.

y.incNextBeat;

});

// output the XMLScore

z.output("~/Desktop/test.xml".standardizePath);

);