music_xml 2.10.0 copy "music_xml: ^2.10.0" to clipboard
music_xml: ^2.10.0 copied to clipboard

A Dart package to parse and serialize MusicXML 4.0.

2.10.0 #

  • Add <text>, <syllabic> and <elision> as LyricText, LyricSyllabic and LyricElision, named after the existing LyricFont and LyricLanguage
  • Add the xsd:NMTOKEN data type
  • Add Lyric.number, the number attribute that tells the verses apart
  • Lyric follows the content model syllabic? text ((elision syllabic?)? text)*. One LyricItem covers one <text> with what the model allows in front of it, and it holds the LyricSyllabic, LyricText and LyricElision objects, so <text> attributes have somewhere to live; syllabic, text and elision still read as plain values
  • Lyric.items is grouped once, while the lyric is built, and holds the same element objects as children, so what is written out and what is read back say the same thing. It is unmodifiable, and editing children by hand does not update it; build a new Lyric to change one
  • A lyric read from a file is written back the way its author wrote it, even where it breaks the content model, because a file is data and not a mistake in code. A list handed to Lyric() in code is asserted instead, so the mistake shows up where it is made

Round-trip fixes #

  • <tie> is no longer dropped when a <note> is written back out #60
  • <note> children are written in the order the MusicXML content model requires; <accidental> came after <staff> and <beam> before <stem>, which made the output fail validation
  • <lyric> round-trips with its <syllabic>, <text> and <elision> children and its number and name attributes

API changes #

  • LyricItem(syllabic, text, elision) now takes its children as elements: LyricItem(LyricText('ry'), elisionElement: LyricElision('\u00a0'), syllabicElement: LyricSyllabic(Syllabic.end)). Reads such as lyric.items.first.text, .syllabic and .elision are unchanged.
  • Lyric(items, name) is now Lyric(items, lyricName: ...). Lyric.items is read-only; build a new Lyric to add or remove items.
  • Lyric.text and Lyric.syllabic are gone; read lyric.items.first.text and lyric.items.first.syllabic. Take care with text: Lyric now extends XmlElement, so lyric.text still compiles and returns the deprecated XmlNode.text, which is the text of every child joined together, not the first syllable.
  • Syllabic moved to the data types, next to the other MusicXML value types. It is still exported from music_xml.dart, so only a direct import of the old file needs a change.
  • Lyric.name is now Lyric.lyricName. Lyric extends XmlElement so that a note can write it back out, and XmlElement.name is already the tag name. This is the same naming LyricFont.lyricName and LyricLanguage.lyricName have always used. Replace lyric.name with lyric.lyricName.

2.9.0 #

  • Add standard <volume> and <pan> children to <midi-instrument>
  • Add percent and rotation-degrees data types
  • Keep namespaced custom attributes on <midi-instrument> for app-specific playback state such as mute and solo #58

2.8.0 #

  • <type> element on notes now round-trips via NoteType (keeps raw text for non-standard values); adds NoteTypeValue enum and symbol-size attribute #53
  • <accidental> now supports the cautionary and editorial yes/no attributes #52
  • Example app: migrate iOS to Swift Package Manager, fix widget test for MusicXML content, update deployment target #54
  • Bump xml to ^7.0.1; minimum Dart SDK is now 3.11.0

2.7.0 #

  • Support compressed .mxl files via MusicXmlDocument.parseMxl(List<int> bytes) #37
  • Locates root file via META-INF/container.xml; falls back to first .xml in the archive

2.6.0 #

New Features #

  • <notations> element with <tied>, <slur>, <tuplet>, <fermata>, <articulations>, <ornaments>, <dynamics>, <technical>, <accidental-mark>
  • Direct <note> children: <beam>, <stem>, <staff>, <accidental>, <rest>, <dot>, <voice>, <duration>
  • <tie> refactored to XmlElement with StartStopAttr and time-only attribute
  • Data type enums: BeamValue, StemValue, StartStopContinue, TiedType, FermataShape, UprightInverted
  • Shared element: <voice> (multi-parent: <note>, <direction>, <forward>)
  • Moved lyric.dart, tie.dart, grace.dart into note/ directory

Breaking Changes #

  • Note.voice changed from int to Voice? (use .content for the string value)
  • Note.isRest is now a getter (rest != null); Note.rest is a typed Rest? element
  • Tie.type changed from StartStop to StartStopAttr (use .startStop for the enum value)

2.5.0 #

  • <part-group> element with group-name, group-name-display, group-abbreviation, group-abbreviation-display, group-symbol, group-barline, group-time, footnote, level
  • PartList preserves interleaved order of <part-group> and <score-part> elements via items
  • Data type enums: GroupSymbolValue, GroupBarlineValue
  • Shared elements: <display-text>, <accidental-text>, <footnote>, <level>
  • Moved StartStop to data_types/ with StartStopAttr class

2.4.1 #

  • Complete element roundtripping audit — every XmlElement subclass now passes proper attributes: and children: to super.tag()
  • Typed attribute classes: DecimalAttr, IntAttr, YesNoAttr, ValignAttr, EnclosureShapeAttr, TextDirectionAttr, XmlSpaceAttr
  • Element fields store typed XmlAttribute objects directly for zero-conversion roundtripping
  • Parse methods use single-pass for/switch over attributes for O(n) instead of repeated getAttribute calls
  • Proper element classes for layout children: LeftMargin, RightMargin, TopMargin, BottomMargin, PageHeight, PageWidth, StaffDistance, SystemDistance, TopSystemDistance
  • Moved data types to data_types/: AccidentalValue, ClefSign
  • Fixed Supports.parse to read XML attributes instead of child elements
  • Added Local constants for common attribute names
  • Upgraded xml to 6.6.1, test to 1.31.0

2.4.0 #

  • <credit> element with credit-type, credit-words, credit-symbol, credit-image, link, bookmark
  • Sealed CreditContent class with Credit.image / Credit.content constructors
  • Data type enums: CreditTypeValue, XLinkActuate, XLinkShow, XLinkType, LeftCenterRight, Valign, ValignImage, TextDirection, EnclosureShape, XmlSpace
  • Bump SDK to >=3.2.0 for sealed classes

2.3.0 #

  • <defaults> element with scaling, concert-score, page-layout, system-layout, staff-layout, appearance, system-dividers, music-font, word-font, lyric-font, lyric-language
  • Data type enums: MarginType, LineWidthType, NoteSizeType, DistanceType, GlyphType, FontStyle, FontWeight, FontSize

2.2.0 #

2.1.0 #

2.0.0 #

New Features #

Breaking Changes #

  • MusicXmlDocument
    • document.scoreParts -> document.score.partList.scoreParts
    • document.parts -> document.score.parts
  • Measure
    • measure.clefSignature -> measure.attributesList.first.clefs
    • measure.timeSignature -> measure.attributesList.first.times
    • measure.keySignature -> measure.attributesList.first.keys
    • measure.barline (single) -> measure.barlines (list)
    • measure.number changed from int to Number (use .value)
  • Note
    • note.pitch (was MapEntry<String, int>) renamed to note.pitchMap
    • note.pitchTypeSafe renamed to note.pitch (now the typed Pitch object)
  • Renamed classes
    • KeySignature -> Key (mode is now a Mode object instead of String)
    • ClefSignature -> Clef (sign is now a Sign object with ClefSign enum)
    • TimeSignature -> Time
  • ScorePart
    • ScorePart.id changed from String to Id (use .value)
    • ScorePart.partName changed from String to PartName (use .content)
  • Tempo
    • timePosition removed (accessible via Sound parent)
  • MusicXMLParserState removed from public exports (internal implementation detail)

Bug Fixes #

  • Fix Attributes.parse times parameter shadowing preventing time signatures from flowing to _fixTimeSignature
  • Fix KeyAccidental.parse crash on unrecognized accidental values (now falls back to AccidentalValue.other)
  • Fix Grace.parse parsing makeTime attribute twice
  • Fix Tempo.qpm getter returning dynamic instead of double
  • Fix _repairEmptyMeasure being a no-op (body was commented out)
  • Fix floating-point comparison in _fixTimeSignature (now uses integer cross-multiplication)
  • Fix Transpose.parse being called twice in Attributes.parse
  • Remove duplicate pitch parsing in Note (consolidated into Pitch object)
  • Standardize factory constructors to .parse() (was inconsistent .parse() / .fromXml())
  • Rename chore.dart to chord.dart (typo)

1.3.0 #

1.2.2 #

  • fix: Xml documents with multiple score parts were not read anymore #13

1.2.1 #

  • fix: doubled ties #9
  • fix: parse part-name #9
  • fix: parse list part #10

1.2.0 #

  • Don't throw an exception when the lyric has no text
  • Read movement-title
  • Identify notes belonging to the same tied note by a shared id
  • Refactor ChordSymbol to prevent warnings
  • Add SimpleKind to get the basic form of a chord, i.e. major, minor, augmented, diminished, sus or other. With .kind.simple, the simple kind can be read out.
  • Add Note.pitchTypeSafe property to read out pitch information more easily.
  • Add Note.noteDurationTied to get the complied duration of a tied note.
  • Add additional note information Note.isNoteOn, isNoteOff, continuesOtherNote, isContinuedByOtherNote

1.1.0 #

  • Add lyric, tie, print (#3)

1.0.4 #

  • Public constructor

1.0.3 #

  • Upgrade dependencies

1.0.2 #

  • Refactor constructors with factory

1.0.1 #

  • Remove redundant dependencies

1.0.0 #

  • Support parse from xml string.
15
likes
160
points
256
downloads

Documentation

API reference

Publisher

verified publisherdemen.org

Weekly Downloads

A Dart package to parse and serialize MusicXML 4.0.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

archive, xml

More

Packages that depend on music_xml