Convert note list to chord list

    :param list[str] notes: list of note arranged from lower note. ex) ["C", "Eb", "G"]
    :rtype: list[pychord.Chord]
    :return: list of chord
962505
def note_to_chord(notes):
    
    if not notes:
        raise ValueError("Please specify notes which consist a chord.")
    root = notes[0]
    root_and_positions = []
    for rotated_notes in get_all_rotated_notes(notes):
        rotated_root = rotated_notes[0]
        root_and_positions.append([rotated_root, notes_to_positions(rotated_notes, rotated_notes[0])])
    chords = []
    for temp_root, positions in root_and_positions:
        quality = find_quality(positions)
        if quality is None:
            continue
        if temp_root == root:
            chord = "{}{}".format(root, quality)
        else:
            chord = "{}{}/{}".format(temp_root, quality, root)
        chords.append(Chord(chord))
    return chords
753382
def get_note_names(self):
        
        res = []
        for n in self.notes:
            if n.name not in res:
                res.append(n.name)
        return res
1058065
function (chord) {
  var intervals = [];

  // Assume P1, M3. and P5
  intervals[1] = 'P';
  intervals[3] = 'M';
  intervals[5] = 'P';

  // Chords with m3
  if ((/^(m|dim|ø)/).test(chord)) {
    intervals[3] = 'm';  
  }
  // Chords with dim5
  if ((/(dim|ø|[-b]5)/).test(chord)) {
    intervals[5] = 'dim';  
  }
  // Chords with aug5
  if ((/^(aug|\+)/).test(chord) || (/[+#]5/).test(chord)) {
    intervals[5] = 'aug';  
  }
  // Chord with no 5th
  if ((/no5/).test(chord)) {
    intervals[5] = '';
  }
  // Chords with no 3rd
  else if ((/^[5n]/).test(chord) || (/no3/).test(chord)) {
    intervals[3] = '';
  }
  // Chords with m7
  if ((/(ø|7|9|11|13)/).test(chord)) {
    intervals[7] = 'm';  
  }
  // Chords with M7
  if ((/(M7|M9|M11|M13)/).test(chord)) {
    intervals[7] = 'M';
  }
  // Chords with dim7
  if ((/(dim7|dim9|dim11|dim13)/).test(chord)) {
    intervals[7] = 'dim';
  }
  // 6ths
  if ((/6/).test(chord)) {
    intervals[6] = 'M';
    intervals[7] = '';
  }
  // Suspended 2
  if ((/sus2/).test(chord)) {
    intervals[2] = 'M';
    intervals[3] = '';
  }
  // Suspended 4
  else if ((/sus/).test(chord)) {
    intervals[4] = 'P';
    intervals[3] = '';
  }
  // 9ths
  if ((/9/).test(chord)) {
    intervals[9] = 'M';  
  }
  if ((/[+#]9/).test(chord)) {
    intervals[9] = '';  
    intervals[10] = 'm'; // Store #9 as b10 to allow for b9#9
  }
  if ((/[-b]9/).test(chord)) {
    intervals[9] = 'm';  
  }
  if ((/add9/).test(chord)) {
    if (!(/7/).test(chord)) intervals[7] = '';
  }
  // 11ths
  if ((/[+#]11/).test(chord)) {
    intervals[11] = 'aug';  
  }
  else if ((/[-b]11/).test(chord)) {
    intervals[11] = 'dim';  
  }
  else if ((/add11/).test(chord) || (/\([^\)]*11[^\)]*\)/).test(chord)) {
    intervals[11] = 'P';
    if ((/add11/).test(chord) && !(/7|9/).test(chord)) {
      intervals[7] = '';
    }
  }
  else if ((/11/).test(chord)) {
    intervals[11] = 'P';
    intervals[9] = intervals[9] || 'M';  
  }
  // 13ths
  if ((/[-b]13/).test(chord)) {
    intervals[13] = 'm';  
  }
  else if ((/add13/).test(chord) || (/\([^\)]*13[^\)]*\)/).test(chord)) {
    intervals[13] = 'M';
    if ((/add13/).test(chord) && !(/7|9|11/).test(chord)) {
      intervals[7] = '';
    }
  }
  else if ((/13/).test(chord)) {
    intervals[13] = 'M';
    intervals[11] = intervals[11] || 'P';
    intervals[9] = intervals[9] || 'M';
  }
  // Exclude 9th or 11th
  if ((/no9/).test(chord)) {
    intervals[9] = '';
  }
  // Exclude 9th or 11th
  if ((/no11/).test(chord)) {
    intervals[11] = '';
  }

  return intervals;
}
1336808
public static Note getHighestNote(Note[] notes) {
	  Note highestNote = notes[0];
	  for (int i=1; i<notes.length; i++)
		  if (notes[i].isHigherThan(highestNote))
			  highestNote = notes[i];
	  return highestNote;
  }
741453
def reduce_accidentals(note):
    
    val = note_to_int(note[0])
    for token in note[1:]:
        if token == 'b':
            val -= 1
        elif token == '#':
            val += 1
        else:
            raise NoteFormatError("Unknown note format '%s'" % note)
    if val >= note_to_int(note[0]):
        return int_to_note(val%12)
    else:
        return int_to_note(val%12, 'b')
420959
def _private_notes(self, key, value):
    
    def _is_for_cds(value):
        normalized_c_values = [el.upper() for el in force_list(value.get('c'))]
        return 'CDS' in normalized_c_values

    def _is_for_hal(value):
        normalized_c_values = [el.upper() for el in force_list(value.get('c'))]
        return 'HAL' in normalized_c_values

    def _is_not_for_hal(value):
        normalized_c_values = [el.upper() for el in force_list(value.get('c'))]
        return 'NOT HAL' in normalized_c_values

    _private_notes = self.get('_private_notes', [])
    _export_to = self.get('_export_to', {})

    for value in force_list(value):
        if _is_for_cds(value):
            _export_to['CDS'] = True

        if _is_for_hal(value):
            _export_to['HAL'] = True
        elif _is_not_for_hal(value):
            _export_to['HAL'] = False

        source = force_single_element(value.get('9'))
        for _private_note in force_list(value.get('a')):
            _private_notes.append({
                'source': source,
                'value': _private_note,
            })

    self['_export_to'] = _export_to
    return _private_notes
1363699
def note_in_range(self, note):
        
        if type(note) == str:
            note = Note(note)
        if not hasattr(note, 'name'):
            raise UnexpectedObjectError("Unexpected object '%s'. "
                    "Expecting a mingus.containers.Note object" % note)
        if note >= self.range[0] and note <= self.range[1]:
            return True
        return False
928503
public Note[] toArray() {
	  if (m_notes.size()>0) {
		  Note[] notes = new Note[m_notes.size()];
		  return (Note[])m_notes.toArray(notes);
	  }
	  else
		  return null;
  }
372136
def convert_string_to_list(string_val):
    
    result_list = []

    list_string = string_val.split(',')
    for val in list_string:
        val = str(val.strip())
        val = val.replace("(", "")
        val = val.replace(")", "")
        val = val.replace("L", "")
        val = val.replace("[", "")
        val = val.replace("]", "")
        if val not in ("", "None"):
            result_list.append(int(val))

    return result_list
1145959
private String listToString(List<String> stringList){
		StringBuilder concat = new StringBuilder();
		for(String str:stringList){
			concat.append(str);
			concat.append(System.getProperty("line.separator"));
		}
		return concat.toString();
	}
332975
def transpose(self, interval, up=True):
        
        (old, o_octave) = (self.name, self.octave)
        self.name = intervals.from_shorthand(self.name, interval, up)
        if up:
            if self < Note(old, o_octave):
                self.octave += 1
        else:
            if self > Note(old, o_octave):
                self.octave -= 1
286508
def transpose(self, trans, scale="C"):
        
        if not isinstance(trans, int):
            raise TypeError("Expected integers, not {}".format(type(trans)))
        self._root = transpose_note(self._root, trans, scale)
        if self._on:
            self._on = transpose_note(self._on, trans, scale)
        self._reconfigure_chord()
132924
def add_note(self, note, octave=None, dynamics={}):
        
        if type(note) == str:
            if octave is not None:
                note = Note(note, octave, dynamics)
            elif len(self.notes) == 0:
                note = Note(note, 4, dynamics)
            else:
                if Note(note, self.notes[-1].octave) < self.notes[-1]:
                    note = Note(note, self.notes[-1].octave + 1, dynamics)
                else:
                    note = Note(note, self.notes[-1].octave, dynamics)
        if not hasattr(note, 'name'):
            raise UnexpectedObjectError("Object '%s' was not expected. "
                    "Expecting a mingus.containers.Note object." % note)
        if note not in self.notes:
            self.notes.append(note)
            self.notes.sort()
        return self.notes
317133
def notes_list
      options = create_params({})
      notes = self.class.get('/notes/list', options)['notes']['note']
      notes = [] if notes.nil?
      notes = [*notes]
      notes.map { |p| Note.new(Util.symbolize_keys(p)) }
    end
375708
def frets_to_NoteContainer(self, fingering):
        """"""

        res = []
        for (string, fret) in enumerate(fingering):
            if fret is not None:
                res.append(self.get_Note(string, fret))
        return NoteContainer(res)
470701
def list_notes(self, page=0, since=None):
        
        from highton.models.note import Note
        params = {'n': int(page) * self.NOTES_OFFSET}
        if since:
            params['since'] = since.strftime(self.COLLECTION_DATETIME)

        return fields.ListField(
            name=self.ENDPOINT,
            init_class=Note
        ).decode(
            self.element_from_string(
                self._get_request(
                    endpoint=self.ENDPOINT + '/' + str(self.id) + '/' + Note.ENDPOINT,
                    params=params
                ).text
            )
        )
647968
def fold_list(input_list, max_width=None):
    
    if not input_list:
        return ""
    if not isinstance(input_list[0], six.string_types):
        input_list = [str(item) for item in input_list]

    if max_width:
        mystr = ", ".join(input_list)
        return fold_string(mystr, max_width)

    return "\n".join(input_list)