From 4c43814ac98960cf570a63985cf719968fa9b89f Mon Sep 17 00:00:00 2001 From: beweiche Date: Tue, 28 Jan 2020 14:35:03 +0100 Subject: [PATCH] fix #295 --- 200_zupfnoter.iml | 76 ++++++++----------- .../SRC_Zupfnoter/src/abc2svg_to_harpnotes.rb | 11 +-- 2 files changed, 38 insertions(+), 49 deletions(-) diff --git a/200_zupfnoter.iml b/200_zupfnoter.iml index e8e5e883..8719d51e 100644 --- a/200_zupfnoter.iml +++ b/200_zupfnoter.iml @@ -3,50 +3,38 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/30_sources/SRC_Zupfnoter/src/abc2svg_to_harpnotes.rb b/30_sources/SRC_Zupfnoter/src/abc2svg_to_harpnotes.rb index 230a5605..4c51fbea 100644 --- a/30_sources/SRC_Zupfnoter/src/abc2svg_to_harpnotes.rb +++ b/30_sources/SRC_Zupfnoter/src/abc2svg_to_harpnotes.rb @@ -334,8 +334,8 @@ def _transform_bar(voice_element, index, voice_index) # it shall not create a bar in harpnotes # but do not check this in context of variants # variant is stopped and not started nex - if ( (voice_element[:rbstop] == 2 and not voice_element[:rbstart] == 2)) - if type.include? ":" # false # @is_first_measure ## first measure after a meter statment cannot suppress bar + if ((voice_element[:rbstop] == 2 and not voice_element[:rbstart] == 2)) + if type.include? ":" # false # @is_first_measure ## first measure after a meter statment cannot suppress bar @next_note_marks[:measure] = false unless (voice_element[:time] - @measure_start_time) == @wmeasure end end @@ -484,7 +484,8 @@ def _transform_chordsymbol(entity, voice_id) match = name.match(/^([^!#\<\>]+)([^\@]+)?(\@(\-?[0-9\.]+),(\-?[0-9\.]+))?$/) if match - text = match[1] + text = match[1] + text = text.gsub("♯", "#").gsub("♭", "b") # todo: fix this if we have unicode support #295 position = $conf['defaults.notebound.chord.pos'] conf_key = "notebound.chord.#{voice_id}.#{entity.znid}.#{index}" result << Harpnotes::Music::Chordsymbol.new(entity, {style: 'large', pos: position, text: text}, conf_key) @@ -693,7 +694,7 @@ def _transform_key(voice_element) def _transform_lyrics(voice_element) if voice_element[:a_ly] result = voice_element[:a_ly].first - result = result[:t]&.gsub("\n", "-").gsub("_", "") if result + result = result[:t] &.gsub("\n", "-").gsub("_", "") if result else result = "" end @@ -943,7 +944,7 @@ def _pop_slur def _extract_chord_lines(voice_element) chords = voice_element[:a_gch] if chords - result = chords.select { |e| e[:type] == '^' ; true}.map { |e| e[:text] } + result = chords.select { |e| e[:type] == '^'; true }.map { |e| e[:text] } else result = [] end