diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 250a19b46..5cb98ea81 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -598,6 +598,7 @@ def transpose_verse(verse_text, transepose_value, notation): else: return transposed_lyrics + def transpose_chord(chord, transpose_value, notation): """ Transpose chord according to the notation used. @@ -611,18 +612,18 @@ def transpose_chord(chord, transpose_value, notation): # See https://en.wikipedia.org/wiki/Musical_note#12-tone_chromatic_scale notes_sharp_notation = {} notes_flat_notation = {} - notes_sharp_notation['german'] = ['C','C#','D','D#','E','F','F#','G','G#','A','A#','H'] - notes_flat_notation['german'] = ['C','Db','D','Eb','Fb','F','Gb','G','Ab','A','B','H'] - notes_sharp_notation['english'] = ['C','C#','D','D#','E','F','F#','G','G#','A','A#','B'] - notes_flat_notation['english'] = ['C','Db','D','Eb','Fb','F','Gb','G','Ab','A','Bb','B'] - notes_sharp_notation['neo-latin'] = ['Do','Do#','Re','Re#','Mi','Fa','Fa#','Sol','Sol#','La','La#','Si'] - notes_flat_notation['neo-latin'] = ['Do','Reb','Re','Mib','Fab','Fa','Solb','Sol','Lab','La','Sib','Si'] + notes_sharp_notation['german'] = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'H'] + notes_flat_notation['german'] = ['C', 'Db', 'D', 'Eb', 'Fb', 'F', 'Gb', 'G', 'Ab', 'A', 'B', 'H'] + notes_sharp_notation['english'] = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B'] + notes_flat_notation['english'] = ['C', 'Db', 'D', 'Eb', 'Fb', 'F', 'Gb', 'G', 'Ab', 'A', 'Bb', 'B'] + notes_sharp_notation['neo-latin'] = ['Do', 'Do#', 'Re', 'Re#', 'Mi', 'Fa', 'Fa#', 'Sol', 'Sol#', 'La', 'La#', 'Si'] + notes_flat_notation['neo-latin'] = ['Do', 'Reb', 'Re', 'Mib', 'Fab', 'Fa', 'Solb', 'Sol', 'Lab', 'La', 'Sib', 'Si'] chord_split = chord.replace('♭', 'b').split('/[\/\(\)]/') transposed_chord = '' last_chord = '' notes_sharp = notes_sharp_notation[notation] notes_flat = notes_flat_notation[notation] - notes_preferred = ['b','#','#','#','#','#','#','#','#','#','#','#'] + notes_preferred = ['b', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#', '#'] for i in range(0, len(chord_split)): if i > 0: transposed_chord += '/' @@ -651,7 +652,8 @@ def transpose_chord(chord, transpose_value, notation): while notenumber < 0: notenumber += 12 if i == 0: - current_chord = notes_sharp[notenumber] if notes_preferred[notenumber] == '#' else notes_flat[notenumber] + current_chord = notes_sharp[notenumber] if notes_preferred[notenumber] == '#' else notes_flat[ + notenumber] last_chord = current_chord else: current_chord = notes_flat[notenumber] if last_chord not in notes_sharp else notes_sharp[notenumber] diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 76d555bda..f8e363258 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -111,11 +111,13 @@ class SongsTab(SettingsTab): 'info').format(symbol=SongStrings.CopyrightSymbol)) self.chords_group_box.setTitle(translate('SongsPlugin.SongsTab', 'Chords')) self.mainview_chords_check_box.setText(translate('SongsPlugin.SongsTab', 'Display chords in the main view')) - self.disable_chords_import_check_box.setText(translate('SongsPlugin.SongsTab', 'Ignore chords when importing songs')) + self.disable_chords_import_check_box.setText(translate('SongsPlugin.SongsTab', + 'Ignore chords when importing songs')) self.chord_notation_label.setText(translate('SongsPlugin.SongsTab', 'Chord notation to use:')) self.english_notation_radio_button.setText(translate('SongsPlugin.SongsTab', 'English') + ' (C-D-E-F-G-A-B)') self.german_notation_radio_button.setText(translate('SongsPlugin.SongsTab', 'German') + ' (C-D-E-F-G-A-H)') - self.neolatin_notation_radio_button.setText(translate('SongsPlugin.SongsTab', 'Neo-Latin') + ' (Do-Re-Mi-Fa-Sol-La-Si)') + self.neolatin_notation_radio_button.setText( + translate('SongsPlugin.SongsTab', 'Neo-Latin') + ' (Do-Re-Mi-Fa-Sol-La-Si)') def on_search_as_type_check_box_changed(self, check_state): self.song_search = (check_state == QtCore.Qt.Checked) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index e04ec0fe4..298960c7c 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -65,7 +65,7 @@ __default_settings__ = { 'songs/songselect username': '', 'songs/songselect password': '', 'songs/songselect searches': '', - 'songs/chord notation': 'english', # Can be english, german or neo-latin + 'songs/chord notation': 'english', # Can be english, german or neo-latin 'songs/mainview chords': False, 'songs/disable chords import': False, }