Package eu.bandm.music.top
Class Cwn_to_musicXml
java.lang.Object
eu.bandm.music.top.Cwn_to_musicXml
Creates a simple musicXml output (according to "MusicXML 3.0 Partwise")
for one tscore:Part component of one
FIXME Still missing:
Score_cwn
object/s.
Usage: construct an instance and call convertVoices()
or sim.
FIXME Still missing:
- Header data
- Set/change Metrum
- Ties
- Cautionary accidental
- lower/upper text
- partial measures
- whole measure pause
- tuplets = open/close proportion
- intensity
-
Field Summary
Modifier and TypeFieldDescription(package private) static final List
<eu.bandm.music.small_musicXml.Element_dot[]> Local cache containing an arry of n prolongation dots at position nprotected static final eu.bandm.music.small_musicXml.Element_rest
Xml element representing a pauseprotected static final eu.bandm.music.small_musicXml.Element_rest
Xml element representing a "whole measure" pause(package private) static final eu.bandm.music.small_musicXml.Element_dot
Constant xml element representing a prolongation dot.Local cache of one metric splitter each (with its internal cache) per metric tree specifications.protected final MessageReceiver
<SimpleMessage<XMLDocumentIdentifier>> Target of all messages.static final XMLDocumentIdentifier
protected final MCover.CheckedParameters_approximate
Parameter collection controlling metric split approximation by binary division.protected final MTree.CheckedParameters
Parameter collection controlling metric split beams.protected final MCover.CheckedParameters_divide
Parameter collection controlling metric split approximation by synthesis of new divisions.protected final MSplitter.CheckedParameters
Parameter collection controlling metric split dotting, sibling merge, syncopes, etc.protected final Score_cwn
The Score_cwn (corresponding to a tscore PART), which is rendered to one(1) output "score-partwise" with one "part" for each voice.protected final String
Used for indicating the original data source when constructing IDs, etc.(package private) static final eu.bandm.music.small_musicXml.Element_note.Seq_2
Constant xml content, part of an xml "note" element representing an arriving tie.(package private) static final eu.bandm.music.small_musicXml.Element_note.Seq_2
Constant xml content, part of an xml "note" element representing both an arriving and an outgoing tie.(package private) static final eu.bandm.music.small_musicXml.Element_note.Seq_2
Constant xml content, part of an xml "note" element representing an outgoing tie.(package private) static final eu.bandm.music.small_musicXml.Element_tied
Constant xml element representing the graphic aspect if an incomung tie.(package private) static final eu.bandm.music.small_musicXml.Element_tied
Constant xml element representing the graphic aspect if an incomung and at the same time outgoing tie.(package private) static final eu.bandm.music.small_musicXml.Element_tied
Constant xml element representing the graphic aspect if an outgoing tie.(package private) static final String[]
The length of the basic note symbols, in words.static final int
Maximal octave in Midi encoding.static final int
Minimal octave in Midi encoding.static final int
The "small octave", numeric 0, is represented in MIDI encoding by three(3), and "middle c" by four(4). -
Constructor Summary
ConstructorDescriptionCwn_to_musicXml
(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String sourceName, Score_cwn score, MTree.CheckedParameters parameters_beams, MCover.CheckedParameters_approximate parameters_approximate, MCover.CheckedParameters_divide parameters_divide, MSplitter.CheckedParameters parameters_split) Only constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
convertOneVoice
(Vox voice, List<eu.bandm.music.small_musicXml.Element_part> music_results, List<eu.bandm.music.small_musicXml.Element_score_part> index_results) Generate a format for one certain tscore.Vox (possibly including metric info) in musicXml 3.0 "partwise" format.eu.bandm.music.small_musicXml.Element_score_partwise
Generate musicXml output for all voices in Score_cwn.eu.bandm.music.small_musicXml.Element_score_partwise
convertVoices
(List<Vox> voices) Generate musicXml output for a selection of Vox elements inscore
.protected static eu.bandm.music.small_musicXml.Element_dot[]
dots
(int dc) Return an array of "dc" prolongation dots.protected String
exponent2nodeType
(Event ev, int exp) Return the name of the basic note duration, as stored intypesByExponent_plus_3
, given by the exponent of 1/2.protected MSplitter
Get a metric splitter (with its internal cache) for the given metric tree specifications, or construct a new one.static void
Test application, translates input file "arg[0]" to musicXml output file "arg[1]".protected eu.bandm.music.small_musicXml.Element_beam
Make a beam element.protected eu.bandm.music.small_musicXml.Element_tuplet
makeTuplet
(Rational p, boolean start) Create one bracket element which stands for the start OR the stop of a bracket.void
toXml_metrumChange
(List<eu.bandm.music.small_musicXml.Element> formats, BigDecimal barnum) Generate the indication of a meter change and of partial measures.
-
Field Details
-
musicXML_dtd_docId
-
msg
Target of all messages. Must be of this type due to tscore.Event.get_location() -
score
The Score_cwn (corresponding to a tscore PART), which is rendered to one(1) output "score-partwise" with one "part" for each voice. -
sourceName
Used for indicating the original data source when constructing IDs, etc. -
parameters_beams
Parameter collection controlling metric split beams. Configuration parameter, set once when constructing. -
parameters_approximate
Parameter collection controlling metric split approximation by binary division. Iff == null, the binary division will not be applied. Configuration parameter, set once when constructing. -
parameters_divide
Parameter collection controlling metric split approximation by synthesis of new divisions. Iff == null, this method will not be applied. Configuration parameter, set once when constructing. -
parameters_split
Parameter collection controlling metric split dotting, sibling merge, syncopes, etc. Configuration parameter, set once when constructing. -
metricSplitters
Local cache of one metric splitter each (with its internal cache) per metric tree specifications. -
const_PAUSE
protected static final eu.bandm.music.small_musicXml.Element_rest const_PAUSEXml element representing a pause -
const_PAUSE_MEASURE
protected static final eu.bandm.music.small_musicXml.Element_rest const_PAUSE_MEASUREXml element representing a "whole measure" pause -
xml_octave_offset
public static final int xml_octave_offsetThe "small octave", numeric 0, is represented in MIDI encoding by three(3), and "middle c" by four(4). FIXME UNIFY with OctaveRegister ?!?- See Also:
-
xml_octave_min
public static final int xml_octave_minMinimal octave in Midi encoding.- See Also:
-
xml_octave_max
public static final int xml_octave_maxMaximal octave in Midi encoding.- See Also:
-
typesByExponent_plus_3
The length of the basic note symbols, in words. Indexing goes by the exponent of (1/2) minus three, so at position 0 there is 2^3 = maxima, and at position 3 there is 2^0, the whole note. -
element_dot
static final eu.bandm.music.small_musicXml.Element_dot element_dotConstant xml element representing a prolongation dot. -
cache_dots
Local cache containing an arry of n prolongation dots at position n -
tie_start
static final eu.bandm.music.small_musicXml.Element_note.Seq_2 tie_startConstant xml content, part of an xml "note" element representing an outgoing tie. -
tie_end
static final eu.bandm.music.small_musicXml.Element_note.Seq_2 tie_endConstant xml content, part of an xml "note" element representing an arriving tie. -
tie_middle
static final eu.bandm.music.small_musicXml.Element_note.Seq_2 tie_middleConstant xml content, part of an xml "note" element representing both an arriving and an outgoing tie. -
tied_start
static final eu.bandm.music.small_musicXml.Element_tied tied_startConstant xml element representing the graphic aspect if an outgoing tie. (The semantics are totally unclear and we have not found any specification yet.) -
tied_end
static final eu.bandm.music.small_musicXml.Element_tied tied_endConstant xml element representing the graphic aspect if an incomung tie. (The semantics are totally unclear and we have not found any specification yet.) -
tied_middle
static final eu.bandm.music.small_musicXml.Element_tied tied_middleConstant xml element representing the graphic aspect if an incomung and at the same time outgoing tie. (The semantics are totally unclear and we have not found any specification yet.)
-
-
Constructor Details
-
Cwn_to_musicXml
public Cwn_to_musicXml(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String sourceName, Score_cwn score, MTree.CheckedParameters parameters_beams, @Opt MCover.CheckedParameters_approximate parameters_approximate, @Opt MCover.CheckedParameters_divide parameters_divide, MSplitter.CheckedParameters parameters_split) Only constructor. Gets the final values of many configuration parameters and the score which shall be translated. Usage: construct an instance and then callconvertVoices()
or sim.
-
-
Method Details
-
getMetricSplitter
Get a metric splitter (with its internal cache) for the given metric tree specifications, or construct a new one. -
toXml_metrumChange
public void toXml_metrumChange(List<eu.bandm.music.small_musicXml.Element> formats, BigDecimal barnum) Generate the indication of a meter change and of partial measures.- Parameters:
formats
- where to append the resulting xml elements.barnum
- the number of the bar
-
exponent2nodeType
Return the name of the basic note duration, as stored intypesByExponent_plus_3
, given by the exponent of 1/2. So "0" gives a "whole note head" and "3" an Eighth. -
dots
protected static eu.bandm.music.small_musicXml.Element_dot[] dots(int dc) Return an array of "dc" prolongation dots. Use local cachecache_dots
, which means to re-use the Elements. -
makeTuplet
Create one bracket element which stands for the start OR the stop of a bracket. Set attributes so that both numbers (numerator and denominator) are shown. Normal bracket lines. (No semantic definition could be found. FIXME) -
makeBeam
Make a beam element. Every Element_note contains a "beam*" content particle. This is accumulated in "pending_beams" and finally added to the Element_note.- Parameters:
type
- the text contents of the result, can be "begin", "end", "continue", "forward-hook", "backward-hook". ("both-hook" seemingly not supported ?)index
- the value of "@number", which is the identifier (nesting level) for the group of related beam elements.
-
convertOneVoice
protected void convertOneVoice(Vox voice, List<eu.bandm.music.small_musicXml.Element_part> music_results, List<eu.bandm.music.small_musicXml.Element_score_part> index_results) Generate a format for one certain tscore.Vox (possibly including metric info) in musicXml 3.0 "partwise" format. The Vox must be part of the Score_cwnscore
. Assume all input data (semantic maps in Score_cwn) are valid. Esp. it requires ...- that the metric voice has a metric indication at the very first timepoint,
- that all voices start at the firstTopTp
- that the very first event in every voice carries CLEF selection
Generation strategy: generate ONE(1) Element_notation in any case, and insert close-tuple notations a posteriori.
-
convertVoices
Generate musicXml output for a selection of Vox elements inscore
. -
convertVoices
public eu.bandm.music.small_musicXml.Element_score_partwise convertVoices()Generate musicXml output for all voices in Score_cwn. -
main
Test application, translates input file "arg[0]" to musicXml output file "arg[1]".
-