Debian Codegraph @

src/python/Conversion/cps2mid.py

raw symbols SCIP
1 #import event sheet module
2 import qutesheet as q
3 from math import log10
4
5 # get all cells by row
6 cells = q.cells_selection_by_row()
7 new_data = []
8
9 for c in cells:
10 if type(c) != str and c > 0:
11 new_val = 69 + (12 * log10(c/440.0)/log10(2.0))
12 new_data.append(new_val)
13 else:
14 new_data.append(c)
15
16
17 # set output
18 q.set_cells_by_row(new_data)