From 5b6d4feaa64d581591b861599285ecbffcd0b7ba Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Sat, 1 Jun 2013 22:56:02 +0200 Subject: [PATCH] Fix ruby 2.0 incompatibilities --- Filters/VLMusicXMLType.reader | 3 +++ Filters/VLMusicXMLType.writer | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Filters/VLMusicXMLType.reader b/Filters/VLMusicXMLType.reader index d9f141b..70340cd 100755 --- a/Filters/VLMusicXMLType.reader +++ b/Filters/VLMusicXMLType.reader @@ -20,6 +20,7 @@ PITCH = { 'A' => 9, 'B' => 11 } +PITCH.default = 0 SYLL = { 'single' => 0, @@ -27,6 +28,7 @@ SYLL = { 'end' => 2, 'middle' => 3 } +SYLL.default = 0 CHORD = { # @@ -80,6 +82,7 @@ CHORD = { 'other' => VL::Unison, 'none' => 0 } +CHORD.default = 0 DEGREE = [ [VL::Unison, VL::Unison], diff --git a/Filters/VLMusicXMLType.writer b/Filters/VLMusicXMLType.writer index 882db26..612bfed 100755 --- a/Filters/VLMusicXMLType.writer +++ b/Filters/VLMusicXMLType.writer @@ -124,7 +124,7 @@ def _pitch(name, pitch, accidental, prefix="") oct = pitch/12 - 1 stp = (pitch%12)+2 step = STEPS[stp] - if step == 0x20 + if step == ' ' if $LAST_KEY > 0 step = STEPS[stp-1] accidental = 1 @@ -531,7 +531,7 @@ def _melody end type = ending['last'] ? "discontinue" : "stop" eEnding = REXML::Element.new('ending') - eEnding.add_attributes({'type', type, 'number', num}) + eEnding.add_attributes({'type' => type, 'number' => num}) if !ending['last'] && !eRepeat eRepeat = REXML::Element.new('repeat') eRepeat.add_attribute('direction', 'backward')