Exemplo n.º 1
0
def iterate(start, pattern, rType="list", octaves=True):
    """Iterates over a pattern starting at a given note"""
    start_key = note_to_key(start)
    ret = [start_key]
    for step in pattern:
        ret.append(ret[-1] + step)

    for i, item in enumerate(ret):
        ret[i] = key_to_note(ret[i], octaves)

    return bReturn(ret, rType)
Exemplo n.º 2
0
def iterate(start, pattern, rType="list", octaves=True):
    """Iterates over a pattern starting at a given note"""
    start_key = note_to_key(start)
    ret = [start_key]
    for step in pattern:
        ret.append(ret[-1] + step)

    for i, item in enumerate(ret):
        ret[i] = key_to_note(ret[i], octaves)

    return bReturn(ret, rType)
Exemplo n.º 3
0
 def test_key_to_note(self):
     key = 49
     self.assertEqual('A4', utility.key_to_note(key))
Exemplo n.º 4
0
def frequency_to_note(frequency):
    return key_to_note(frequency_to_key(frequency))