Skip to content

Commit d723a2d

Browse files
committedOct 7, 2021
ABC settings: Added 'Separate defaults per voice' checkbox to Voices tab
- ABC settings: Added 'Separate defaults per voice' checkbox to Voices tab - ABC assist supports %%barnumbers
1 parent b8c2b19 commit d723a2d

File tree

4 files changed

+115
-105
lines changed

4 files changed

+115
-105
lines changed
 

‎CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -586,3 +586,5 @@ different panes. Tie/untie option added for notes. Broken rhythm
586586
- Open most recent file on startup [mist]
587587
- 10% faster syntax highlighting
588588
- Find in files: selecting tune focused wrong tune sometimes
589+
- ABC settings: Added 'Separate defaults per voice' checkbox to Voices tab
590+
- ABC assist supports %%barnumbers (better to use %%measurenb instead)

‎abc_tune.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
field_pattern = r'[A-Za-z\+]:'
1212
meter_pattern = r'M:\s*(?:(\d+)/(\d+)|(C\|?))'
1313
unitlength_pattern = r'^L:\s*(\d+)/(\d+)'
14-
voice_pattern = r'(?m)(?:^V:\s*(?P<name>\w+).*$\n|\[V:\s*(?P<inlinename>\w+)[^\]]*\])'
14+
voice_pattern = r'(?m)(?:^V:\s*(?P<voice_id>\w+).*$|\[V:\s*(?P<inline_voice_id>\w+)[^\]]*\])'
1515
comment_pattern = r'(?m)(?<!\\)%.*$'
1616
empty_line_pattern = r'(?m)^\s*$'
1717

@@ -142,7 +142,7 @@ def determine_abc_structure(self, abc_code):
142142
self.note_line_indices = note_line_indices
143143

144144
def get_voice_ids(self):
145-
return [m.group('name') or m.group('inlinename') for m in voice_re.finditer('\n'.join(self.tune_header))]
145+
return [m.group('voice_id') or m.group('inline_voice_id') for m in voice_re.finditer('\n'.join(self.tune_header))]
146146

147147
def get_abc_per_voice(self):
148148
if self.__abc_per_voice is None:
@@ -152,7 +152,7 @@ def get_abc_per_voice(self):
152152
last_voice_id = ''
153153
start_index = 0
154154
for m in voice_re.finditer(abc_body):
155-
voice_id = m.group('name') or m.group('inlinename')
155+
voice_id = m.group('voice_id') or m.group('inline_voice_id')
156156
abc = abc_body[start_index:m.start()]
157157
voices[last_voice_id] += abc
158158
start_index = m.end()

0 commit comments

Comments
 (0)
Please sign in to comment.