[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MusicXML import with 2 voices per staff get confused by crescendo spanne
From: |
Tobias Kretschmar |
Subject: |
MusicXML import with 2 voices per staff get confused by crescendo spanners |
Date: |
Sun, 8 Mar 2015 20:03:57 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
> I'm not top posting.
Given is a MusicXML file with 2 voices on one staff. Voice one contains
a crescendo spanner.
musicxml2ly.py will create a ly file with faulty skips (hidden rests) or
notes scrambled in chords.
The reason is in musicxml.py line 1309 a direction wedge is added to any
voice. This will lead to following voice elements:
Voice1:
1. Note1 half at when=0
2. Note2 half at when=1/2
3. Direction wedge crescendo at when=1/2
Voice2:
1. Direction wedge crescendo at when=1/2
2. Note1 quarter at when=0
3. Note2 quarter at when=1/2
Subsequently in musicxml2ly line 2122 voice_bilder.jumpto (n.when) is
called for any event in Voice1 which is ok and then in Voice2.
1. Direction wedge at when 1/2: will insert a skip 1/2
2. Note1 at when 0 will throw a warning about negative skip -1/2
3. Note2 at 1/2, ok
Solution: I assume, direction wedges have to be coupled to specific
voices?
Example musicxml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.0
Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise>
<part-list>
<score-part id="P1">
</score-part>
</part-list>
<part id="P1">
<measure number="1" width="146.59">
<attributes>
<divisions>2</divisions>
<key>
<fifths>-1</fifths>
</key>
<time symbol="cut">
<beats>2</beats>
<beat-type>2</beat-type>
</time>
<clef>
<sign>G</sign>
<line>2</line>
</clef>
</attributes>
<note default-x="12.00" default-y="-25.00">
<pitch>
<step>A</step>
<octave>4</octave>
</pitch>
<duration>4</duration>
<voice>1</voice>
<type>half</type>
<stem>up</stem>
</note>
<direction placement="below">
<direction-type>
<wedge type="crescendo" number="1"/>
</direction-type>
</direction>
<note default-x="70.94" default-y="-25.00">
<pitch>
<step>B</step>
<octave>4</octave>
</pitch>
<duration>4</duration>
<voice>1</voice>
<type>half</type>
<stem>up</stem>
</note>
<direction placement="below">
<direction-type>
<wedge type="stop" number="1"/>
</direction-type>
</direction>
<backup>
<duration>8</duration>
</backup>
<note default-x="12.00" default-y="-35.00">
<pitch>
<step>F</step>
<octave>4</octave>
</pitch>
<duration>4</duration>
<voice>2</voice>
<type>half</type>
<stem>down</stem>
</note>
<note default-x="70.94" default-y="-35.00">
<pitch>
<step>G</step>
<octave>4</octave>
</pitch>
<duration>4</duration>
<voice>2</voice>
<type>half</type>
<stem>down</stem>
</note>
</measure>
</part>
</score-partwise>
Output ly file:
\version "2.19.16"
% automatically converted by musicxml2ly from
C:/Users/Tobi/Documents/Visual Studio
2013/Projects/PythonApplication1/PythonApplication1/test.xml
%% additional definitions required by the score:
\language "deutsch"
\header {
}
PartPOneVoiceOne = \relative a' {
\transposition b \clef "treble" \key f \major \time 2/2 a2 h \< \!
}
PartPOneVoiceTwo = \relative f' {
\transposition b \clef "treble" \key f \major \time 2/2 s2 s \< f
\! g2
}
% The score definition
\score {
<<
\new Staff <<
\context Staff <<
\context Voice = "PartPOneVoiceOne" { \voiceOne
\PartPOneVoiceOne }
\context Voice = "PartPOneVoiceTwo" { \voiceTwo
\PartPOneVoiceTwo }
>>
>>
>>
\layout {}
\midi {}
}
Expected output:
\version "2.19.16"
% automatically converted by musicxml2ly from
C:/Users/Tobi/Documents/Visual Studio
2013/Projects/PythonApplication1/PythonApplication1/test.xml
%% additional definitions required by the score:
\language "deutsch"
\header {
}
PartPOneVoiceOne = \relative a' {
\transposition b \clef "treble" \key f \major \time 2/2 a2 h \< \!
}
PartPOneVoiceTwo = \relative f' {
\transposition b \clef "treble" \key f \major \time 2/2 f2 g
}
% The score definition
\score {
<<
\new Staff <<
\context Staff <<
\context Voice = "PartPOneVoiceOne" { \voiceOne
\PartPOneVoiceOne }
\context Voice = "PartPOneVoiceTwo" { \voiceTwo
\PartPOneVoiceTwo }
>>
>>
>>
\layout {}
\midi {}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- MusicXML import with 2 voices per staff get confused by crescendo spanners,
Tobias Kretschmar <=