def get_simple_table_with_grades_and_notes_by(mom_scale, note_selected): list_of_grades = get_list_of_grades_by(mom_scale) result_notes = get_empty_dict_with_grades(list_of_grades) result_grade_names = get_empty_dict_with_grades(list_of_grades) result = get_empty_dict_with_grades(list_of_grades) for scale in enumerate(get_list_of_grades_by(mom_scale)): notes = get_notes_of( get_list_of_grades_by(mom_scale)[0], note_selected) for note in enumerate(get_notes_of(scale[1], notes[scale[0]])): result_notes[scale[1]].append(note[1]) result_grade_names[scale[1]].append( get_scale_names_according_to(scale[1], mom_scale)[note[0]]) result[scale[1]].append((result_grade_names[scale[1]])) result[scale[1]].append((result_notes[scale[1]])) return result
def debug_scale(scale): notes = [ 'C', 'C#', 'Db', 'D', 'D#', 'Eb', 'E', 'F', 'F#', 'Gb', 'G', 'G#', 'Ab', 'A', 'A#', 'Bb', 'B' ] result = {} for note in notes: result[scale + ' tone ' + note + ':'] = get_notes_of(scale, note) return display_debug(result)
def get_modal_interchange_data_by(mom_scale, note_selected): list_of_grades = get_list_of_grades_by(mom_scale) result_notes = get_empty_dict_with_grades(list_of_grades) result_grade_names = get_empty_dict_with_grades(list_of_grades) result = get_empty_dict_with_grades(list_of_grades) for scale in enumerate(get_list_of_grades_by(mom_scale)): for note in enumerate(get_notes_of(scale[1], note_selected)): result_notes[scale[1]].append(note[1]) result_grade_names[scale[1]].append( get_scale_names_according_to(scale[1], mom_scale)[note[0]]) result[scale[1]].append((result_grade_names[scale[1]])) result[scale[1]].append((result_notes[scale[1]])) return result
def get_data_by(note_selected, scale, deep): ''' Saco chords con get_chord_name(note, scale, type_of_chord): ''' list_of_notes = get_notes_of(scale, note_selected) json = parse_scales_json_to_python() for _scale in json: list_grades = get_list_of_grades_by(_scale) for _grade in list_grades: if (scale == _grade): _good_list = own_sort(list_grades, _grade) _result = [] for x in range(0, len(_good_list)): _result.append(get_chord_name(list_of_notes[x], _good_list[x], deep)) return _result
# -*- coding: utf-8 -*- from expects import * from scales import get_notes_of with description('Generating get_notes_of'): with context("escala hungara mayor"): with it("escala_hungara_mayor_primer_grado"): note = 'C' scale = 'escala_hungara_mayor_primer_grado' expect(get_notes_of(scale, note)).to( equal(["C", "D#", "E", "F#", "G", "A", "Bb"])) with it("escala_hungara_mayor_segundo_grado"): note = 'D#' scale = 'escala_hungara_mayor_segundo_grado' expect(get_notes_of(scale, note)).to( equal(["D#", "E", "F#", "G", "A", "Bb", "C"])) with it("escala_hungara_mayor_tercer_grado"): note = 'E' scale = 'escala_hungara_mayor_tercer_grado' expect(get_notes_of(scale, note)).to(
def get(self): note = self.get_argument('note') scalename = self.get_argument('scalename') chords = get_notes_of(scalename, note) self.set_header('Content-Type', 'application/json') self.write(json.dumps({'response': chords}))
# -*- coding: utf-8 -*- from expects import * from scales import get_notes_of with description('Generating get_notes_of'): with context('escala hexatonica de blues'): with it('escala_hexatonica_de_blues_primer_grado'): note = "C" scale = "escala_hexatonica_de_blues_primer_grado" expect(get_notes_of(scale, note)).to(equal(['C', 'D#', 'F', 'F#', 'G', 'A#'])) with it('escala_hexatonica_de_blues_primer_grado'): note = "B" scale = "escala_hexatonica_de_blues_primer_grado" expect(get_notes_of(scale, note)).to(equal(['B', 'D', 'E', 'F', 'Gb', 'A'])) with it('escala_hexatonica_de_blues_segundo_grado'): note = "D" scale = "escala_hexatonica_de_blues_segundo_grado" expect(get_notes_of(scale, note)).to(equal(['D', 'E', 'F', 'Gb', 'A', 'B'])) with it('escala_hexatonica_de_blues_tercer_grado'): note = "E"