From 3bc7561152b9fc34e08f6f62abd63908ae50c1f9 Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Sat, 15 Sep 2007 21:51:57 +0000 Subject: [PATCH] Fix Sibelius/Dolet divisions and title --- Filters/VLMusicXMLType.reader | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Filters/VLMusicXMLType.reader b/Filters/VLMusicXMLType.reader index db95d74..2a56620 100755 --- a/Filters/VLMusicXMLType.reader +++ b/Filters/VLMusicXMLType.reader @@ -111,7 +111,7 @@ class MusicXMLListener when 'score-timewise' $stderr.puts "Can't read timewise MusicXML files yet" exit 1 - when 'work-title' + when 'work-title', 'movement-title' @kind = 'textProp' @key = 'title' when 'creator' @@ -277,6 +277,17 @@ class MusicXMLListener return volta 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) # # Interesting text nodes have @kind set @@ -426,7 +437,7 @@ class MusicXMLListener end end when 'part' - OUTPUT['properties'] = @props unless @part == 'HARM' + OUTPUT['properties'] = saneDivisions(@props) unless @part == 'HARM' end end end