def ly_expression (self):
return {-1: '(',
0:'',
- 1:')'}[self.span_direction]
+ 1:')'}.get (self.span_direction, '')
class BeamEvent (SpanEvent):
def ly_expression (self):
return {-1: '[',
0:'',
- 1:']'}[self.span_direction]
+ 1:']'}.get (self.span_direction, '')
class ArpeggioEvent(Event):
def ly_expression (self):
def __init__ (self, type):
self.type = type
def hairpin_to_ly (self):
- val = ''
- tp = { 0: '\!', 1: '\<', -1: '\>' }.get (self.type)
- if tp:
- val += tp
- return val
+ return { 0: '\!', 1: '\<', -1: '\>' }.get (self.type, '')
def ly_expression (self):
return self.hairpin_to_ly ()
self.force_direction = None
def direction_mod (self):
- dirstr = { 1: '^', -1: '_', 0: '-' }.get (self.force_direction)
- if dirstr:
- return dirstr
- else:
- return ''
+ return { 1: '^', -1: '_', 0: '-' }.get (self.force_direction, '')
def ly_expression (self):
return '%s\\%s' % (self.direction_mod (), self.type)
}
def lisp_expression (self):
- (glyph, pos, c0) = self.clef_dict [self.type]
+ (glyph, pos, c0) = self.clef_dict.get (self.type)
clefsetting = """
(make-music 'SequentialMusic
'elements (list