Add inverse fret number function
This commit is contained in:
parent
9f0f029301
commit
6f7935e42f
|
@ -1,3 +1,6 @@
|
||||||
Guitar_Scale_Length_mm = 648;
|
Guitar_Scale_Length_mm = 648;
|
||||||
|
ln2 = ln(2);
|
||||||
|
function log2(x) = ln(x)/ln2;
|
||||||
function fret_scale_length(n) = Guitar_Scale_Length_mm * 2^(-n/12);
|
function fret_scale_length(n) = Guitar_Scale_Length_mm * 2^(-n/12);
|
||||||
|
function mm_to_fret_number(mm) = -log2(mm/Guitar_Scale_Length_mm)*12;
|
||||||
function lerp(start, end, amount) = start + (end-start)*amount;
|
function lerp(start, end, amount) = start + (end-start)*amount;
|
||||||
|
|
Loading…
Reference in New Issue