# Path: camp/core/chord.py
# class Chord(object):
# 
#     def __init__(self, notes=None, root=None, typ=None):
# 
#         """
#         Constructs a chord, in different ways:
# 
#         notes = [ note('C4'), note('E4'), note('G4') ]
# 	chord = Chord(notes=notes)
# 
#         OR:
# 
#         chord = Chord(root=note('C4'), type='major')
# 
# 	OR:
# 
# 	chord = Chord(root='C4', type='major')
#         """
# 
#         self.notes = []
# 
#         if notes and root:
#             raise Exception("notes= and root= are mutually exclusive")
#         if notes is None and root is None:
#             raise Exception("specify either notes= or root=")
#         if root and typ is None:
#             raise Exception("typ= is required when using root=")
#         if typ and typ not in CHORD_TYPES:
#             raise Exception("unknown chord type: %s, expecting one of: %s" % (typ, CHORD_TYPES))
#         if isinstance(root, str):
#             root = note(root)
# 
#         if notes is not None:
#             for x in notes:
#                 assert type(x) == Note
#             self.notes = notes
# 
#         else:
#             self.typ = typ
#             self.root = root
#             self.notes = self._chordify()
# 
#     def copy(self):
#         notes = [ n.copy() for n in self.notes ]
#         return Chord(notes=notes)
# 
#     def _chordify(self):
#         """
#         Internal method.
#         Once self.root is set to a note, and self.typ is a chord type, like 'major', return the notes in the chord.
#         """
#         offsets = CHORD_TYPES[self.typ]
#         notes = []
#         notes.append(self.root)
#         for offset in offsets:
#             notes.append(self.root.transpose(semitones=offset))
#         return notes
# 
#     def __repr__(self):
#         """
#         A chord prints like:
#         Chord<C4,E4,G4>
#         """
#         note_list = ",".join([ n.short_name() for n in sorted(self.notes) ])
#         return "Chord<%s>" % note_list
# 
#     def __eq__(self, other):
#         """
#         Chords are equal if they contain the same notes.
#         """
#         return sorted(self.notes) == sorted(other.notes)
# 
#     def transpose(self, steps=None, semitones=None, octaves=None):
#         """
# 	Transposing a chord is returns a new chord with all of the notes transposed.
# 	"""
#         notes = [ note.transpose(steps=steps, octaves=octaves, semitones=None) for note in self.notes ]
#         return Chord(notes=notes)
# 
#     def invert(self, amount=1, octaves=1):
#         """
#         Inverts a chord.
#         ex: chord("c4 major").invert() -> chord(["E4","G4","C5"])
#         """
#         new_chord = self.copy()
#         if amount >= 1:
#             new_chord.notes[0] = new_chord.notes[0].transpose(octaves=octaves)
#         if amount >= 2:
#             new_chord.notes[1] = new_chord.notes[1].transpose(octaves=octaves)
#         if amount >= 3:
#             new_chord.notes[2] = new_chord.notes[2].transpose(octaves=octaves)
#         return new_chord
# 
# Path: camp/core/scale.py
# def scale(input):
#     """
#     Shortcut: scale(['C major') -> Scale object
#     """
#     (root, typ) = input.split()
#     return Scale(root=note(root), typ=typ)


from camp.core.chord import Chord
from camp.core.scale import scale
        chord = Chord(root=base_note, typ=typ)
        if inversion != 0:
            chord = chord.invert(amount=inversion)
        return chord


    def note(self, sym):
        position = int(sym) - 1
        return self._note_buffer[position]

    def do(self, sym):
        """
        Generate a note from a symbol like '2', or a chord from a symbol like
        'ii' or 'II'.
        """
        try:
            int(sym)
        except ValueError:
            return self.chord(sym)
        return self.note(sym)

    def do_notes(self, sym):
        """
        Same as do() but always get back an array of notes.
        """
        if sym is None:
            return []
        note_or_chord = self.do(sym)
        if note_or_chord is None:
            return []

# Path: camp/core/chord.py
# class Chord(object):
# 
#     def __init__(self, notes=None, root=None, typ=None):
# 
#         """
#         Constructs a chord, in different ways:
# 
#         notes = [ note('C4'), note('E4'), note('G4') ]
# 	chord = Chord(notes=notes)
# 
#         OR:
# 
#         chord = Chord(root=note('C4'), type='major')
# 
# 	OR:
# 
# 	chord = Chord(root='C4', type='major')
#         """
# 
#         self.notes = []
# 
#         if notes and root:
#             raise Exception("notes= and root= are mutually exclusive")
#         if notes is None and root is None:
#             raise Exception("specify either notes= or root=")
#         if root and typ is None:
#             raise Exception("typ= is required when using root=")
#         if typ and typ not in CHORD_TYPES:
#             raise Exception("unknown chord type: %s, expecting one of: %s" % (typ, CHORD_TYPES))
#         if isinstance(root, str):
#             root = note(root)
# 
#         if notes is not None:
#             for x in notes:
#                 assert type(x) == Note
#             self.notes = notes
# 
#         else:
#             self.typ = typ
#             self.root = root
#             self.notes = self._chordify()
# 
#     def copy(self):
#         notes = [ n.copy() for n in self.notes ]
#         return Chord(notes=notes)
# 
#     def _chordify(self):
#         """
#         Internal method.
#         Once self.root is set to a note, and self.typ is a chord type, like 'major', return the notes in the chord.
#         """
#         offsets = CHORD_TYPES[self.typ]
#         notes = []
#         notes.append(self.root)
#         for offset in offsets:
#             notes.append(self.root.transpose(semitones=offset))
#         return notes
# 
#     def __repr__(self):
#         """
#         A chord prints like:
#         Chord<C4,E4,G4>
#         """
#         note_list = ",".join([ n.short_name() for n in sorted(self.notes) ])
#         return "Chord<%s>" % note_list
# 
#     def __eq__(self, other):
#         """
#         Chords are equal if they contain the same notes.
#         """
#         return sorted(self.notes) == sorted(other.notes)
# 
#     def transpose(self, steps=None, semitones=None, octaves=None):
#         """
# 	Transposing a chord is returns a new chord with all of the notes transposed.
# 	"""
#         notes = [ note.transpose(steps=steps, octaves=octaves, semitones=None) for note in self.notes ]
#         return Chord(notes=notes)
# 
#     def invert(self, amount=1, octaves=1):
#         """
#         Inverts a chord.
#         ex: chord("c4 major").invert() -> chord(["E4","G4","C5"])
#         """
#         new_chord = self.copy()
#         if amount >= 1:
#             new_chord.notes[0] = new_chord.notes[0].transpose(octaves=octaves)
#         if amount >= 2:
#             new_chord.notes[1] = new_chord.notes[1].transpose(octaves=octaves)
#         if amount >= 3:
#             new_chord.notes[2] = new_chord.notes[2].transpose(octaves=octaves)
#         return new_chord
# 
# Path: camp/core/scale.py
# def scale(input):
#     """
#     Shortcut: scale(['C major') -> Scale object
#     """
#     (root, typ) = input.split()
#     return Scale(root=note(root), typ=typ)


# Path: camp/notation/roman.py
from camp.core.chord import Chord
from camp.core.scale import scale

        chord = Chord(root=base_note, typ=typ)
        if inversion != 0:
            chord = chord.invert(amount=inversion)
        return chord


    def note(self, sym):
        position = int(sym) - 1
        return self._note_buffer[position]

    def do(self, sym):
        """
        Generate a note from a symbol like '2', or a chord from a symbol like
        'ii' or 'II'.
        """
        try:
            int(sym)
        except ValueError:
            return self.chord(sym)
        return self.note(sym)

    def do_notes(self, sym):
        """
        Same as do() but always get back an array of notes.
        """
        if sym is None:
            return []
        note_or_chord = self.do(sym)
        if note_or_chord is None:
            return []

        elif type(note_or_chord) == Chord: