<commit_before>
def create_note_map():
    middle_a = 440
    note_ratio = 2 ** (float(1) / float(12))
    
    #create the 'generic' names for each note. each note goes by multiple names, this structure keeps track of the different names
    note_sequence = [
        ('c',       'c-natural', 'b-sharp'),
        ('c-sharp', 'd-flat'),
        ('d',       'd-natural'),
        ('d-sharp', 'e-flat'),
        ('e',       'e-natural','f-flat'),
        ('f',       'f-natural','e-sharp'),
        ('f-sharp', 'g-flat'),
        ('g',       'g-natural'),
        ('g-sharp', 'a-flat'),
        ('a',       'a-natural'),
        ('a-sharp', 'b-flat'),
        ('b',       'b-natural', 'c-flat'),
        ]
    
    #compute the frequencies for each note
    note_map = {}
    for n in xrange(12*9):
        octave_num = n / 12
        note_num = n % 12
        
        for note_name in note_sequence[note_num]:
            #compute the frequency of this note relative to middle A (ie 440)
            note_map["%s-%d"%(note_name,octave_num)] = middle_a * (note_ratio ** (n - 57))
            
    return note_map <commit_msg>started progress on gey generation<commit_after>def create_note_map():
    middle_a = 440
    note_ratio = 2 ** (float(1) / float(12))
    
    #create the 'generic' names for each note. each note goes by multiple names, this structure keeps track of the different names
    note_sequence = [
        ('c',       'c-natural', 'b-sharp'),
        ('c-sharp', 'd-flat'),
        ('d',       'd-natural'),
        ('d-sharp', 'e-flat'),
        ('e',       'e-natural','f-flat'),
        ('f',       'f-natural','e-sharp'),
        ('f-sharp', 'g-flat'),
        ('g',       'g-natural'),
        ('g-sharp', 'a-flat'),
        ('a',       'a-natural'),
        ('a-sharp', 'b-flat'),
        ('b',       'b-natural', 'c-flat'),
        ]
    
    #compute the frequencies for each note
    note_map = {}
    for n in xrange(12*9):
        octave_num = n / 12
        note_num = n % 12
        
        for note_name in note_sequence[note_num]:
            #compute the frequency of this note relative to middle A (ie 440)
            note_map["%s-%d"%(note_name,octave_num)] = middle_a * (note_ratio ** (n - 57))
            
    return note_map 

def get_key(note_name, key_type):
    
    #first we need to find the index of this note
    note_index = 0
    
    #find this key's position on the circle of fifths
    #keys progress up and down from C using a circle of fifths. so the "base" key is at C, 
    #then we go up one perfect fifth to G, thne up one perfect fifth to D. this is equivalent to solving 
    #"note_index congruent to perfect_fith_interval * wheel_position (mod 12)" for wheel_position
    
    #the solution to that formula is simply "note_index * perfect_fifth_interval (mod 12)"
    wheel_position = (note_index * 7) % 12
    
    
    
{'fraction_non_alphanumeric': 0.1444906444906445, 'fraction_numerical': 0.01593901593901594, 'mean_word_length': 2.004162330905307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2570834', 'n_tokens_mistral': 972, 'n_tokens_neox': 911, 'n_words': 285}