-
Notifications
You must be signed in to change notification settings - Fork 1
/
te_examples.py
90 lines (78 loc) · 3.02 KB
/
te_examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import numpy as np
import te_common as te
import te_temperament_measures as te_tm
import te_equal as te_et
import te_lattice as te_lat
# Important: a single monzo should be entered as a vector; a monzo list should be entered as composed by column vectors
# Norm
# parameters:
# wtype: weight method. "tenney", "equilateral" and "wilson"/"benedetti"
# wamount: weight scaling factor
# skew: skew of the space
# order: optimization order
# Temperament
# parameters:
# subgroup: specifies a custom ji subgroup
# methods:
# tune: gives the tuning
# parameters:
# norm: norm profile of the tuning space. see above
# inharmonic: for subgroup temps, treats the basis as if they were primes
# constraint: constrains this subgroup to pure
# destretch: destretches this ratio to pure
# temperament_measures: gives the temperament measures
# parameters:
# ntype: averaging normalizer. "breed", "smith", "dirichlet", or "none"
# norm: norm profile for the tuning space. see above
# error_scale: scales the error
# badness_scale: scales the badness
# comma_basis: gives the comma basis
temp = te_tm.Temperament ([
[1, 0, 2, -1],
[0, 5, 1, 12]
]) # septimal magic
temp.tune (norm = te.Norm (skew = 1), constraint = te.Subgroup ("2")) # cwe aka ke tuning
temp.temperament_measures (ntype = "smith", badness_scale = 1) # te temperament measures
temp.wedgie ()
temp.comma_basis ()
# et_construct
# parameters:
# subgroup: custom ji subgroup
temp = te_et.et_construct (["14c", "17c"], te.Subgroup ([2, 3, 5, 7])) # squares
temp.temperament_measures (ntype = "smith", badness_scale = 1)
temp = te_et.et_construct (["b4", "b13"], te.Subgroup ([3, 5, 7])) # bps
temp.temperament_measures (ntype = "smith", badness_scale = 1)
# comma_construct
# parameters:
# subgroup: custom ji subgroup
temp = te_et.comma_construct (te.Subgroup ([
"126/125",
"245/243"
]).basis_matrix) # septimal sensi
temp.temperament_measures (ntype = "smith", badness_scale = 1)
# et_sequence
# parameters:
# subgroup: custom ji subgroup
# ntype: averaging normalizer. "breed", "smith", "dirichlet", or "none"
# norm: norm profile for the tuning space. see above
# inharmonic: for subgroup temps, treats the basis as if they were primes
# cond: "error", "badness", or "logflat badness"
# threshold: temperaments failing this will not be shown
# prog: if true, threshold will be updated
# pv: if true, only patent vals will be considered
# search_range: upper bound where to stop searching
temp = te_tm.Temperament ([
[1, 0, -4, -13],
[0, 1, 4, 10]
]) # septimal meantone
te_et.et_sequence (temp.comma_basis (show = False), cond = "error", search_range = 300)
# find_complexity_spectrum
# parameters:
# norm: norm profile for the tuning space. see above
# oe: octave equivalence
temp = te_lat.TemperamentLattice ([
[1, 2, 0, 0, 1, 2],
[0, 6, 0, -7, -2, 9],
[0, 0, 1, 1, 1, 1]
]) # tridecimal history
temp.find_complexity_spectrum (te_lat.odd_limit_monzos_gen (15), oe = True)