Fix Sibelius/Dolet divisions and title

This commit is contained in:
Matthias Neeracher 2007-09-15 21:51:57 +00:00
parent 0658dada8e
commit 3bc7561152

View File

@ -111,7 +111,7 @@ class MusicXMLListener
when 'score-timewise' when 'score-timewise'
$stderr.puts "Can't read timewise MusicXML files yet" $stderr.puts "Can't read timewise MusicXML files yet"
exit 1 exit 1
when 'work-title' when 'work-title', 'movement-title'
@kind = 'textProp' @kind = 'textProp'
@key = 'title' @key = 'title'
when 'creator' when 'creator'
@ -277,6 +277,17 @@ class MusicXMLListener
return volta return volta
end end
def saneDivisions(props)
#
# Dolet for Sibelius is using something like 768 divisions per quarter
#
props.each do |prop|
if prop['divisions'] > 12
prop['divisions'] = 2 # Should do this a lot smarter
end
end
end
def tag_end(tag) def tag_end(tag)
# #
# Interesting text nodes have @kind set # Interesting text nodes have @kind set
@ -426,7 +437,7 @@ class MusicXMLListener
end end
end end
when 'part' when 'part'
OUTPUT['properties'] = @props unless @part == 'HARM' OUTPUT['properties'] = saneDivisions(@props) unless @part == 'HARM'
end end
end end
end end