# Path: note_seq/chords_encoder_decoder.py
# NOTES_PER_OCTAVE = constants.NOTES_PER_OCTAVE
# NO_CHORD = constants.NO_CHORD
# _PITCH_CLASS_MAPPING = ['C', 'C#', 'D', 'Eb', 'E', 'F',
#                         'F#', 'G', 'Ab', 'A', 'Bb', 'B']
# class ChordEncodingError(Exception):
# class MajorMinorChordOneHotEncoding(encoder_decoder.OneHotEncoding):
# class TriadChordOneHotEncoding(encoder_decoder.OneHotEncoding):
# class PitchChordsEncoderDecoder(encoder_decoder.EventSequenceEncoderDecoder):
#   def num_classes(self):
#   def default_event(self):
#   def encode_event(self, event):
#   def decode_event(self, index):
#   def num_classes(self):
#   def default_event(self):
#   def encode_event(self, event):
#   def decode_event(self, index):
#   def input_size(self):
#   def num_classes(self):
#   def default_event_label(self):
#   def events_to_input(self, events, position):
#   def events_to_label(self, events, position):
#   def class_index_to_event(self, class_index, events):
# 
# Path: note_seq/constants.py
# DEFAULT_QUARTERS_PER_MINUTE = 120.0
# DEFAULT_STEPS_PER_BAR = 16  # 4/4 music sampled at 4 steps per quarter note.
# DEFAULT_STEPS_PER_QUARTER = 4
# DEFAULT_STEPS_PER_SECOND = 100
# STANDARD_PPQ = 220
# NUM_SPECIAL_MELODY_EVENTS = 2
# MELODY_NOTE_OFF = -1
# MELODY_NO_EVENT = -2
# MIN_MELODY_EVENT = -2
# MAX_MELODY_EVENT = 127
# MIN_MIDI_PITCH = 0  # Inclusive.
# MAX_MIDI_PITCH = 127  # Inclusive.
# NUM_MIDI_PITCHES = MAX_MIDI_PITCH - MIN_MIDI_PITCH + 1
# NOTES_PER_OCTAVE = 12
# MIN_MIDI_VELOCITY = 1  # Inclusive.
# MAX_MIDI_VELOCITY = 127  # Inclusive.
# MIN_MIDI_PROGRAM = 0
# MAX_MIDI_PROGRAM = 127
# UNPITCHED_PROGRAMS = (
#     list(range(96, 104)) + list(range(112, 120)) + list(range(120, 128)))
# NO_CHORD = 'N.C.'
# MAJOR_SCALE = [0, 2, 4, 5, 7, 9, 11]
# NOTE_KEYS = [
#     [0, 1, 3, 5, 7, 8, 10],
#     [1, 2, 4, 6, 8, 9, 11],
#     [0, 2, 3, 5, 7, 9, 10],
#     [1, 3, 4, 6, 8, 10, 11],
#     [0, 2, 4, 5, 7, 9, 11],
#     [0, 1, 3, 5, 6, 8, 10],
#     [1, 2, 4, 6, 7, 9, 11],
#     [0, 2, 3, 5, 7, 8, 10],
#     [1, 3, 4, 6, 8, 9, 11],
#     [0, 2, 4, 5, 7, 9, 10],
#     [1, 3, 5, 6, 8, 10, 11],
#     [0, 2, 4, 6, 7, 9, 11]
# ]


from absl.testing import absltest
from note_seq import chords_encoder_decoder
from note_seq import constants

    # power chord
    with self.assertRaises(chords_encoder_decoder.ChordEncodingError):
      self.enc.encode_event('Bb5')

  def testDecodeNoChord(self):
    figure = self.enc.decode_event(0)
    self.assertEqual(NO_CHORD, figure)

  def testDecodeChord(self):
    # major chord
    figure = self.enc.decode_event(3)
    self.assertEqual('D', figure)

    # minor chord
    figure = self.enc.decode_event(17)
    self.assertEqual('Em', figure)

    # augmented chord
    figure = self.enc.decode_event(33)
    self.assertEqual('Abaug', figure)

    # diminished chord
    figure = self.enc.decode_event(42)
    self.assertEqual('Fdim', figure)


class PitchChordsEncoderDecoderTest(absltest.TestCase):

  def setUp(self):

# Path: note_seq/chords_encoder_decoder.py
# NOTES_PER_OCTAVE = constants.NOTES_PER_OCTAVE
# NO_CHORD = constants.NO_CHORD
# _PITCH_CLASS_MAPPING = ['C', 'C#', 'D', 'Eb', 'E', 'F',
#                         'F#', 'G', 'Ab', 'A', 'Bb', 'B']
# class ChordEncodingError(Exception):
# class MajorMinorChordOneHotEncoding(encoder_decoder.OneHotEncoding):
# class TriadChordOneHotEncoding(encoder_decoder.OneHotEncoding):
# class PitchChordsEncoderDecoder(encoder_decoder.EventSequenceEncoderDecoder):
#   def num_classes(self):
#   def default_event(self):
#   def encode_event(self, event):
#   def decode_event(self, index):
#   def num_classes(self):
#   def default_event(self):
#   def encode_event(self, event):
#   def decode_event(self, index):
#   def input_size(self):
#   def num_classes(self):
#   def default_event_label(self):
#   def events_to_input(self, events, position):
#   def events_to_label(self, events, position):
#   def class_index_to_event(self, class_index, events):
# 
# Path: note_seq/constants.py
# DEFAULT_QUARTERS_PER_MINUTE = 120.0
# DEFAULT_STEPS_PER_BAR = 16  # 4/4 music sampled at 4 steps per quarter note.
# DEFAULT_STEPS_PER_QUARTER = 4
# DEFAULT_STEPS_PER_SECOND = 100
# STANDARD_PPQ = 220
# NUM_SPECIAL_MELODY_EVENTS = 2
# MELODY_NOTE_OFF = -1
# MELODY_NO_EVENT = -2
# MIN_MELODY_EVENT = -2
# MAX_MELODY_EVENT = 127
# MIN_MIDI_PITCH = 0  # Inclusive.
# MAX_MIDI_PITCH = 127  # Inclusive.
# NUM_MIDI_PITCHES = MAX_MIDI_PITCH - MIN_MIDI_PITCH + 1
# NOTES_PER_OCTAVE = 12
# MIN_MIDI_VELOCITY = 1  # Inclusive.
# MAX_MIDI_VELOCITY = 127  # Inclusive.
# MIN_MIDI_PROGRAM = 0
# MAX_MIDI_PROGRAM = 127
# UNPITCHED_PROGRAMS = (
#     list(range(96, 104)) + list(range(112, 120)) + list(range(120, 128)))
# NO_CHORD = 'N.C.'
# MAJOR_SCALE = [0, 2, 4, 5, 7, 9, 11]
# NOTE_KEYS = [
#     [0, 1, 3, 5, 7, 8, 10],
#     [1, 2, 4, 6, 8, 9, 11],
#     [0, 2, 3, 5, 7, 9, 10],
#     [1, 3, 4, 6, 8, 10, 11],
#     [0, 2, 4, 5, 7, 9, 11],
#     [0, 1, 3, 5, 6, 8, 10],
#     [1, 2, 4, 6, 7, 9, 11],
#     [0, 2, 3, 5, 7, 8, 10],
#     [1, 3, 4, 6, 8, 9, 11],
#     [0, 2, 4, 5, 7, 9, 10],
#     [1, 3, 5, 6, 8, 10, 11],
#     [0, 2, 4, 6, 7, 9, 11]
# ]


# Path: note_seq/chords_encoder_decoder_test.py
from absl.testing import absltest
from note_seq import chords_encoder_decoder
from note_seq import constants


    # power chord
    with self.assertRaises(chords_encoder_decoder.ChordEncodingError):
      self.enc.encode_event('Bb5')

  def testDecodeNoChord(self):
    figure = self.enc.decode_event(0)
    self.assertEqual(NO_CHORD, figure)

  def testDecodeChord(self):
    # major chord
    figure = self.enc.decode_event(3)
    self.assertEqual('D', figure)

    # minor chord
    figure = self.enc.decode_event(17)
    self.assertEqual('Em', figure)

    # augmented chord
    figure = self.enc.decode_event(33)
    self.assertEqual('Abaug', figure)

    # diminished chord
    figure = self.enc.decode_event(42)
    self.assertEqual('Fdim', figure)


class PitchChordsEncoderDecoderTest(absltest.TestCase):

  def setUp(self):

    self.enc = chords_encoder_decoder.PitchChordsEncoderDecoder()