forked from CryHavoc/dottes
Update abc2xml to latest - Python3 friendly.
This commit is contained in:
parent
c325095406
commit
5334e003f5
|
@ -1,261 +0,0 @@
|
||||||
Version 58
|
|
||||||
- grammer for I:score instruction replaces ad hoc parsing.
|
|
||||||
- voice merging, part grouping and grand staffs are derived by transformation of the parse tree of I:score.
|
|
||||||
- also move clef redefinitions after [I:staff +/-n].
|
|
||||||
- avoid a false beam break when [I:staff +/-n] is used within a beamed note group.
|
|
||||||
- absolute ABC staff numbers in [I:staff n] are mapped to MusicXML grand staff numbers (when possible).
|
|
||||||
- added translation of the [+-^_]15 octave clefs.
|
|
||||||
- no default channel/panning/volume in <midi-instrument> elements.
|
|
||||||
|
|
||||||
Version 57
|
|
||||||
- grand staff implemented.
|
|
||||||
- in an [I:score] instruction recognize a braced voice group as a grand staff when the opening brace is followed by an asterix ('{*' no space allowed).
|
|
||||||
- also recognize a normal braced voice group as a grand staff when precisely one of the braced voices has a name.
|
|
||||||
- the name of a staff or part is taken from the first of its voices (in ABC source order) for which a name is defined.
|
|
||||||
- within a grand staff notes and directions preceded by [I:staff +/-n] are moved n staffs upwards or downwards.
|
|
||||||
- accept voice ids with a leading asterix in I:score instructions (for the time being the asterix is discarded, however)
|
|
||||||
|
|
||||||
Version 56
|
|
||||||
- the <grace/> element should come before the <chord/> element in a note. (previously caused syntax warning with FinaleNotepad)
|
|
||||||
- translates the _8, ^8 variants of the clefs in addition to the +8, -8. Also translates octave= argument of V: and K:
|
|
||||||
- part names are left empty when not explicitly given using V:id name="<part name>" (previously id was used in that case)
|
|
||||||
- transpose= was only honoured when a typed clef= definition was present, now is works in any V: or K: field.
|
|
||||||
- a tempo definition in the ABC header (Q:) is treated as an inline tempo ([Q:]) for the first voice.
|
|
||||||
- repeated occurrences of [I:MIDI] in a voice are translated into a MusicXML instrument changes for that voice.
|
|
||||||
Neither Finale nor Musescore recognize the relevant MusicXML elements (<sound/midi-instrument> and <note/instrument> yet.
|
|
||||||
- new cue=on/off attribute for K: and V: definitions, to mark sections of cue notes in a voice.
|
|
||||||
Neither Finale nor Musescore handle cue size for directions, yet (<level size="cue">).
|
|
||||||
- normally whole measure rests are discarded when merging staffs. Use option -r to keep these rests in the merged results.
|
|
||||||
|
|
||||||
Version 55
|
|
||||||
- replaced info message text: "leeg" with "empty voice", when skipping an empty voice.
|
|
||||||
- avoided exception when ABC voice has only one measure containing only a volta number
|
|
||||||
- do not output an xml-backup element when it has zero duration
|
|
||||||
|
|
||||||
Version 54
|
|
||||||
- allow gracenotes within chords
|
|
||||||
- discard unbalanced chord brackets (caused a syntax error previously)
|
|
||||||
- chords containing only rests caused an exception
|
|
||||||
- ABC-code like: B2 1 caused an exception, now interpreted as: B2/1
|
|
||||||
|
|
||||||
Version 53
|
|
||||||
- tie to a chord with a single note caused an exception.
|
|
||||||
- a first line with a single measure and only a left bar line caused a syntax error.
|
|
||||||
- a first line with a single measure with only chords and no bar lines caused a syntax error.
|
|
||||||
- option -z or --mxl writes an additional compressed xml file with extention .mxl
|
|
||||||
- better treatment of barlines with spaces interspersed.
|
|
||||||
- dot after note right before barline caused syntax error (now only warning and skip)
|
|
||||||
|
|
||||||
Version 52
|
|
||||||
- accept and translate chords in a grace sequence (caused an exception previously)
|
|
||||||
- corrected bug when parsing %%score without space between voice number and left bracket, like %%staves 1(2 3)
|
|
||||||
|
|
||||||
Version 51
|
|
||||||
- treat abc file without any X: as a single tune and prepend X:1
|
|
||||||
- recognize alto4 as alternative notation for tenor clef
|
|
||||||
|
|
||||||
Version 50
|
|
||||||
- corrected translation of the clef octave change notation (i.e. +8, -8 suffix)
|
|
||||||
|
|
||||||
Version 49
|
|
||||||
- ties between different pitches are converted to slurs (previously the tie in 'A-B A' would extend
|
|
||||||
to the second A, now there will be a slur between A and B).
|
|
||||||
- do not add accidentals to tied notes even when present in ABC code.
|
|
||||||
- use consistent voice numbering in XML when merging ABC-voices with overlays.
|
|
||||||
|
|
||||||
Version 48
|
|
||||||
- M: field with more than one slash caused an exception.
|
|
||||||
- limit shortest note durations to 1/64
|
|
||||||
- skip redundant closing slurs (caused exception previously)
|
|
||||||
- check instrument id when generating MIDI elements (caused exception when errors in %%score)
|
|
||||||
- issue warning message when illegal user defined characters are used (X,Y,Z,x,y,z)
|
|
||||||
- use correct xml-syntax for credit elements (was wrong in version 47)
|
|
||||||
- translate explicit alterations for non traditional keys
|
|
||||||
(non traditional key signatures not supported by MuseScore, but note alterations are correct)
|
|
||||||
- skip more illegal symbols in stead of issuing parse error
|
|
||||||
|
|
||||||
Version 47
|
|
||||||
- translate middle=<pitch> in clefs
|
|
||||||
- translate transpose=<semitones> in clefs (also %%MIDI transpose is recognised)
|
|
||||||
- translate subname= in V: fields (name= was already translated)
|
|
||||||
- translate "%%MIDI program" and "%%MIDI channel" (multiple instruments per staff supported)
|
|
||||||
- an abc file with multiple tunes can be converted to a set of musicxml files.
|
|
||||||
- new command line option "-m SKIP NUM" to set the range of tunes to be converted for large abc files.
|
|
||||||
- leading dot was skipped when parsing a float in page format settings (.5in -> 5in)
|
|
||||||
- accept [r:] syntax for remarks (caused syntax error previously)
|
|
||||||
- relax syntax for user defined symbols (allowed character set was needlessly restricted)
|
|
||||||
- all abc meta-info fields are translated to credit tags (with type)
|
|
||||||
|
|
||||||
Version 46
|
|
||||||
- warn when unit length is a single integer and assume L:1/8 (caused exception previously)
|
|
||||||
- translate tune with only header fields (caused exception previously)
|
|
||||||
- translate tunes where first voice definition appears in the middle of the body (caused exception previously)
|
|
||||||
- skip illegal characters in chords and issue warning (caused syntax error previously)
|
|
||||||
- skip illegal U: field in body and issue warning (caused syntax error previously)
|
|
||||||
- more illegal characters between elements are skipped but with less specific warnings.
|
|
||||||
- line endings with only <cr> were not handled properly
|
|
||||||
- add check for text without any abc code in it (caused exception previously)
|
|
||||||
- conversion of pObj to string caused exception when it contained non latin-1 characters (e.g. in warning messages)
|
|
||||||
|
|
||||||
Version 45
|
|
||||||
- ignore old style continuation when next line is w:
|
|
||||||
- replace illegal durations by the nearest smaller legal one (caused exception previously)
|
|
||||||
- when multiple stave mappings keep only first one and issue warning
|
|
||||||
- accept start of next tune (X:) when not preceeded by an empty line (caused syntax error previously)
|
|
||||||
- warn when unit length is no fraction of integers and assume L:1/8 (caused exception previously)
|
|
||||||
- raise meaningful exception when the tune is empty (e.g. empty line after K:)
|
|
||||||
- broken rhythm involving a rest was not translated
|
|
||||||
|
|
||||||
Version 44
|
|
||||||
- translate volta brackets with quoted text (in addition to numbers and number ranges)
|
|
||||||
- when error in M: field assume 4/4. (caused exception previously)
|
|
||||||
- allow voice names with underscore
|
|
||||||
- bug in parsing %%score when no space between two stave groups, like: (v1 v2)(v3 v4)
|
|
||||||
- corrected merging of voices of unequal length (caused exception previously)
|
|
||||||
- user defined symbols with '()<>.' chars were not accepted
|
|
||||||
- when p was a user defined symbol also !p! was erroneously seen as used defined
|
|
||||||
- skip random text before tune starts (caused syntax error previously)
|
|
||||||
|
|
||||||
Version 43
|
|
||||||
- more non standard bar lines recognized (e.g. :])
|
|
||||||
- accept X: fields when the tune number is followed by non-numeric chars.
|
|
||||||
- allow complex meter (M:2+2+3/8)
|
|
||||||
- warn for illegal L: fields (like L:1/6) and use 1/8 instead
|
|
||||||
- accept and skip E: field
|
|
||||||
- wedge close was not recognized when written with old '+' notation (bug was in fixSlurs)
|
|
||||||
- remove * and ** at end of line (probably old notation for right adjustment)
|
|
||||||
- accept and ignore a Q:-field with only text
|
|
||||||
- replace "Expected end of text at .." message from parser by "Syntax error at .."
|
|
||||||
|
|
||||||
Version 42
|
|
||||||
- translate tempo from Q: field
|
|
||||||
- translate -8 in key or voice field (temporary fix)
|
|
||||||
- accept empty text annotations
|
|
||||||
- in addition to !<(! also accept !crescendo(! and the same for diminuendo
|
|
||||||
- ignore line continuation after information field
|
|
||||||
- in lyrics treat isolated tildes as note skips
|
|
||||||
- encode parse error message in utf-8 and when that fails in latin-1
|
|
||||||
- limit length of misplaced symbol message to 80 chars
|
|
||||||
- put text between K: and first V: into the header (was skipped previously)
|
|
||||||
- bug in %%score when no spaces around '|'-character
|
|
||||||
- added "o" as alternative for dim ("Edim7" = "Eo7")
|
|
||||||
- in chord symbols "+" and "-" were not always translated correctly
|
|
||||||
- tuple abbreviation (n:: and (n::m were not translated correctly
|
|
||||||
- dotted barlines translated (: .|)
|
|
||||||
|
|
||||||
Version 41
|
|
||||||
- translate (multi-)measure rests: Z, X
|
|
||||||
- discard misplaced broken symbols (no more exceptions)
|
|
||||||
- discard misplaced octave suffices (warning, no parse error)
|
|
||||||
- discard misplaced header fields (warning, no parse error after K:)
|
|
||||||
- show location of misplaced symbols
|
|
||||||
- only parse header if it is not empty (-> better error messages)
|
|
||||||
- accept score/stave-directives and page formatting also in body
|
|
||||||
|
|
||||||
Version 40
|
|
||||||
- when reading a file with multiple tunes only translate the first one
|
|
||||||
- command line option added for scale, page size and margins
|
|
||||||
- all %% directives are changed into I: fields
|
|
||||||
- translate scale, page size and margins from ABC directives, but command line overrides
|
|
||||||
|
|
||||||
Version 39
|
|
||||||
- accept and discard rests in chords
|
|
||||||
- accept and discard accidentals before rests
|
|
||||||
- spacer is treated as a normal note but discarded
|
|
||||||
- accept chords with only one note
|
|
||||||
- invisible rests (x) are translated as invisible in xml too.
|
|
||||||
|
|
||||||
Version 38
|
|
||||||
- also recognise ma and mi in chord symbols (e.g. Cma7, Cmi7)
|
|
||||||
- replace tildes in lyrics by spaces
|
|
||||||
- accept syllabi starting with a tilde
|
|
||||||
- accept space after V: 1
|
|
||||||
|
|
||||||
Version 37
|
|
||||||
- accidental elements are written whenever an explicit accidentals are present in ABC (for finale, mscore does not need them)
|
|
||||||
- tuplet notation elements are written to mark begin and end of tuplet (for finale, mscore doet not need them)
|
|
||||||
- normal-type elements are written when tuplets are irregular
|
|
||||||
- issue understandable message when metre is not recognized
|
|
||||||
- take (compound) metre into account when translating tuplet shorthands (as described in ABC 2.1)
|
|
||||||
- do not add beaming-elements into rest-elements (still break beam when long rest in beamgroup).
|
|
||||||
|
|
||||||
Version 36
|
|
||||||
- volta-stop elements were somtimes (recognised at and) put into a left-bar element, which
|
|
||||||
is not valid MusicXML. These elements are now put into the right-bar of the previous measure.
|
|
||||||
- accept volta's without barline: "abc [1 def" is read as: "abc |[1 def"
|
|
||||||
- accept volta's after redundant left barline: "abc |\n|[1 def" is read as "abc |\n[1 def"
|
|
||||||
- changed document order of repeat and ending elements (MusicXML order requirement)
|
|
||||||
- xml output to stdout is also encoded in utf-8 (was erroneously done in latin-1)
|
|
||||||
- prevent finale detecting the string "xml" in the <software>-tag (finale quirk)
|
|
||||||
- only issue a <supports>-tag when abc code really uses explicit linebreaks
|
|
||||||
|
|
||||||
Version 35
|
|
||||||
- recognise and translate (nested) braces and brackets in both %%staves and %%score
|
|
||||||
- translate more keys (maj, min, mix, dor, phr, lyd, loc and none)
|
|
||||||
- recognise and skip [I:...] in body
|
|
||||||
- invisible bar lines translated
|
|
||||||
- silently skip slur end when there is no corresponding slur begin
|
|
||||||
- also accept user defined symbols delimited by +
|
|
||||||
- limit length of syntax error message (in a way compatible with pyparsing internal administration)
|
|
||||||
- add <identification/encoding/supports> tag, because Finale seems to expect it.
|
|
||||||
|
|
||||||
Version 34
|
|
||||||
- removed copy() from 2 parse expressions because it did not appear to work on Linux
|
|
||||||
- recognize, warn and skip misplaced accidentals and ties
|
|
||||||
- bug in old style continuation when there was nothing left to continue with.
|
|
||||||
- limit syntax error output to 80 chars, with error in the middle.
|
|
||||||
|
|
||||||
Version 33
|
|
||||||
- added !coda!, !segno!, !fine!, !dacoda!, !dalsegno! etc.
|
|
||||||
- move coda and segno when just before a barline to next measure
|
|
||||||
- added several ornaments and articulations.
|
|
||||||
- recognize (and skip) '<' and '>' position markers for text expressions
|
|
||||||
- fall back to text expression for unrecognized chord symbols.
|
|
||||||
- recognize (and skip) alternative chord symbols between brackets
|
|
||||||
- interpret expressions like "ABC" as text expression and not as misspelled chord symbol.
|
|
||||||
- beam detection improved (grammar)
|
|
||||||
|
|
||||||
Version 32
|
|
||||||
- grammar for both linebreaks ! and $ without ambiguities!
|
|
||||||
- remove commandline option for linebreak (also I:linebreak not needed anymore)
|
|
||||||
- accept both + and ! for deco's
|
|
||||||
- accept (and skip) empty fields
|
|
||||||
- accept ']' in all header fields
|
|
||||||
- strip leading and trailing spaces from header fields (T: title -> T:title)
|
|
||||||
- also translate inline fields before a left barline
|
|
||||||
- recognise volta after forward repeat
|
|
||||||
- translate dashes to comma's in volta ([1-3 -> [1,3)
|
|
||||||
- recognise slurs after broken rhythm symbols i.e. replace (ab>>)c -> (ab)>>c
|
|
||||||
- skip P: fields
|
|
||||||
- allow lines with a single measure without barline
|
|
||||||
- combine ~-syllabi (multiple syllabi under one note)
|
|
||||||
- skip W: lyrics because no musicXML equivalent
|
|
||||||
- translate longa and breve
|
|
||||||
|
|
||||||
Version 31
|
|
||||||
- bug in treatment of double-repeat when it is at the end of a voice-lyrics block
|
|
||||||
- added <DOCTYPE> declaration because Finale seems to need it.
|
|
||||||
- added identification/encoding element so people can see what software made the file
|
|
||||||
|
|
||||||
Version 30
|
|
||||||
- voice overlays
|
|
||||||
- merging voices rewritten: lyrics renumbering, measurewise merging
|
|
||||||
- linebreak after left-bar is output directly (i.e. not postponed to the next measure)
|
|
||||||
|
|
||||||
Version 29
|
|
||||||
- implementation of beaming
|
|
||||||
- insert line breaks at start of next measure
|
|
||||||
- keep only one line break per measure when mapping multiple voices
|
|
||||||
- renumber slurs when clash occurs during voice mapping
|
|
||||||
- syntax error message is encoded in latin-1
|
|
||||||
- bug in recognition of presence of open tie
|
|
||||||
|
|
||||||
Version 28
|
|
||||||
- all chord symbols were erroneously recognized as text annotations (wrong syntax priority)
|
|
||||||
- Recognize (and skip) redundant left side bars
|
|
||||||
- don't stumble on a double repeat (::) when it occurs at the and of a voice/lyrics block
|
|
||||||
- better error message when header fields appear after the first K:
|
|
||||||
- output of non latin-1 strings on stderr uses repr()
|
|
||||||
|
|
||||||
Version 27
|
|
||||||
- Initial release
|
|
|
@ -1,76 +0,0 @@
|
||||||
---- abc2xml ----
|
|
||||||
|
|
||||||
abc2xml is a command line utility that translates ABC notation into MusicXML.
|
|
||||||
|
|
||||||
In principle all elements from ABC are translated, but some translations are only partially
|
|
||||||
implemented. Translated are:
|
|
||||||
- multiple lyric lines per voice
|
|
||||||
- mapping voices to staves, brackets and braces (%%score or %%staves)
|
|
||||||
- voice overlays (only single &-overlays, no multiple &&-overlays yet)
|
|
||||||
- dynamics, slurs, several decorations (ties between different voices are not possible in MusicXML
|
|
||||||
and are changed to slurs when present in ABC. Also (illegal) ties between different pitches are converted
|
|
||||||
to slurs. In both cases a warning message is issued)
|
|
||||||
- grace notes, tuplets
|
|
||||||
- keys (maj, min, mix, dor, phr, lyd, loc and none), meter, tempo
|
|
||||||
- clefs (only most common clef names, tranposition= and middle= are supported)
|
|
||||||
- jazz chord symbols and text annotations
|
|
||||||
- beaming. Only one beam per abc-beam group is translated at the moment, which is
|
|
||||||
sufficient for MuseScore. In musicXML every beam should be explicitly notated, so a 32th
|
|
||||||
note should start 3 beams.
|
|
||||||
- scale, page size and page margins are recognized as either %% or I: directive. The scale value is
|
|
||||||
the distance between two stafflines in millimeters. The other values are also in millimeters unless
|
|
||||||
they are followed by a unit (cm,in,pt).
|
|
||||||
- %%MIDI program and %%MIDI channel (or I:MIDI ..) are translated when used in a current voice
|
|
||||||
(i.e. after a V: definition). The instrument of a voice cannot be changed in the middle of a tune.
|
|
||||||
If one does so, only the last %%MIDI will be used for the whole voice. (and the earlier settings are
|
|
||||||
discarded). %%MIDI transpose is translated and has the same effect as transpose= in the clef, i.e.
|
|
||||||
only play back is transposed, not notation. In %%MIDI program=num, the number should be between 0
|
|
||||||
and 127. Also in %%MIDI channel=num, the number is starts from zero. The midi translation supports
|
|
||||||
mapping multiple voices whith different instruments to one stave. (i.e. the resulting xml part will
|
|
||||||
have multiple instruments). This feature, though present in MusicXML is not supported by MuseScore,
|
|
||||||
nor by Finale Notepad. These programs only allow one instrument per stave.
|
|
||||||
- multiple tunes within one abc file can be converted to a set of xml files, one file per tune.
|
|
||||||
|
|
||||||
In conjunction with xml2abc the translation from xml -> abc -> xml works for all examples
|
|
||||||
in the set from MakeMusic. The translated examples produce reasonable score when typeset with MuseScore.
|
|
||||||
|
|
||||||
---- Usage: ----
|
|
||||||
|
|
||||||
When you have Python installed:
|
|
||||||
> python abc2xml.py [-h] [-m SKIP NUM] [-o DIR] [-p PFMT] [-z MODE] file1 [file2 ...]
|
|
||||||
|
|
||||||
When you use the Win32 executable:
|
|
||||||
> abc2xml.exe [-h] [-m SKIP NUM] [-o DIR] [-p PFMT] [-z MODE] file1 [file2 ...]
|
|
||||||
|
|
||||||
Translates all .abc files in the file list to MusicXML. Output goes to stdout unless the -o option
|
|
||||||
is given. Wildcards in file names are expanded.
|
|
||||||
Option -h prints help message with explanation of the options
|
|
||||||
Option -m skip num skips skip tunes and then reads at most num tunes.
|
|
||||||
Can be used when abc files contain multiple tunes (tune books) to select only a subset of the tunes.
|
|
||||||
The default skips nothing (skip=0) and reads 1 tune (num=1).
|
|
||||||
Option -o dir translates every .abc file to a separate .xml file with the same name
|
|
||||||
into directory dir. For example, -o. puts all xml files into the same directory where
|
|
||||||
the input files reside.
|
|
||||||
Option -p fmt sets the page format of the ouput. fmt should be a string with 7 float
|
|
||||||
values sepatated by comma's without any spaces. The values are: space, page-height, -width, and
|
|
||||||
page margin left, -right, -top, -bottom. space defines the scale of the whole score and equals the
|
|
||||||
distance between two staff lines in mm. When the -p option is omitted the values default to A4 with
|
|
||||||
10mm margins and space=1.764. All commandline values are in millimeters.
|
|
||||||
Option -z mode or --mxl mode writes compressed xml files with extention .mxl.
|
|
||||||
If mode is a or add both .xml and .mxl files will be written. If mode is r or replace only .mxl
|
|
||||||
files are written.
|
|
||||||
|
|
||||||
---- Download ----
|
|
||||||
|
|
||||||
The python script: abc2xml.py-58.zip
|
|
||||||
http://wim.vree.org/svgParse/abc2xml.py-58.zip
|
|
||||||
|
|
||||||
Stand alone win32 executable: abc2xml.exe-58.zip
|
|
||||||
http://wim.vree.org/svgParse/abc2xml.exe-58.zip
|
|
||||||
|
|
||||||
---- ABC Syntax ----
|
|
||||||
|
|
||||||
ABC is recognized by a high level parser that reads the ABC syntax in a notation close to (E)BNF.
|
|
||||||
The drawback of this approach is that many dialects of ABC will cause sytax errors.
|
|
||||||
In addition, the high level parser implementation in pure python (pyparsing.py) is slow.
|
|
||||||
The pyparsing library is included (as a single python file) in abc2xml.py-58.zip
|
|
1310
abc2xml/abc2xml.py
1310
abc2xml/abc2xml.py
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue