Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class Newline(Token):
pass
class Continuation(Token):
""" \\ at end of line """
pass
class GracenoteBrace(Token):
""" { {/ or } """
pass
class ChordBracket(Token):
""" [ or ] """
pass
class ChordSymbol(Token):
""" "Amaj" """
pass
class Annotation(Token):
""" "
den = den * 2
self._length = (num, den)
class Beam(Token):
pass
class Space(Token):
pass
class Slur(Token):
""" ( or ) """
pass
class Tie(Token):
""" - """
pass
class Newline(Token):
pass
class Continuation(Token):
""" \\ at end of line """
pass
class GracenoteBrace(Token):
""" { {/ or } """
pass
class ChordBracket(Token):
""" [ or ] """
""" [ or ] """
pass
class ChordSymbol(Token):
""" "Amaj" """
pass
class Annotation(Token):
""" "
class Tie(Token):
""" - """
pass
class Newline(Token):
pass
class Continuation(Token):
""" \\ at end of line """
pass
class GracenoteBrace(Token):
""" { {/ or } """
pass
class ChordBracket(Token):
""" [ or ] """
pass
class ChordSymbol(Token):
""" "Amaj" """
pass
class Annotation(Token):
""" "
pass
class Decoration(Token):
""" .~HLMOPSTuv """
pass
class Tuplet(Token):
""" (5 """
def __init__(self, num, **kwds):
Token.__init__(self, **kwds)
self.num = num
class BodyField(Token):
pass
class InlineField(Token):
pass
class Rest(Token):
def __init__(self, symbol, num, denom, **kwds):
# char==X or Z means length is in measures
Token.__init__(self, **kwds)
self.symbol = symbol
self.length = (num, denom)
class InfoContext(object):
"""Keeps track of current information fields
"""
def __init__(self, fields):
self._fields = fields
n_dots = len(dots)
num, den = self.length
if longer:
num = num * 2 + 1
den = den * 2
self._length = (num, den)
else:
den = den * 2
self._length = (num, den)
class Beam(Token):
pass
class Space(Token):
pass
class Slur(Token):
""" ( or ) """
pass
class Tie(Token):
""" - """
pass
class Newline(Token):
pass
class Continuation(Token):
""" \\ at end of line """
pass
num = num * 2 + 1
den = den * 2
self._length = (num, den)
else:
den = den * 2
self._length = (num, den)
class Beam(Token):
pass
class Space(Token):
pass
class Slur(Token):
""" ( or ) """
pass
class Tie(Token):
""" - """
pass
class Newline(Token):
pass
class Continuation(Token):
""" \\ at end of line """
pass
class GracenoteBrace(Token):
""" { {/ or } """
!longphrase! same, but extending 3/4 of the way down
"""
class Token(object):
def __init__(self, line, char, text):
self._line = line
self._char = char
self._text = text
def __repr__(self):
return "<%s \"%s\">" % (self.__class__.__name__, self._text)
class Note(Token):
def __init__(self, key, time, note, accidental, octave, num, denom, **kwds):
Token.__init__(self, **kwds)
self.key = key
self.time_sig = time
self.note = note
self.accidental = accidental
self.octave = octave
self._length = (num, denom)
@property
def pitch(self):
"""Chromatic note value taking into account key signature and transpositions.
"""
return Pitch(self)
@property
""" { {/ or } """
pass
class ChordBracket(Token):
""" [ or ] """
pass
class ChordSymbol(Token):
""" "Amaj" """
pass
class Annotation(Token):
""" "
""" .~HLMOPSTuv """
pass
class Tuplet(Token):
""" (5 """
def __init__(self, num, **kwds):
Token.__init__(self, **kwds)
self.num = num
class BodyField(Token):
pass
class InlineField(Token):
pass
class Rest(Token):
def __init__(self, symbol, num, denom, **kwds):
# char==X or Z means length is in measures
Token.__init__(self, **kwds)
self.symbol = symbol
self.length = (num, denom)
class InfoContext(object):
"""Keeps track of current information fields
"""
def __init__(self, fields):
self._fields = fields
def __getattr__(self, field):
return self._fields.get(field, None)