GuitarModels/common.scad

7 lines
275 B
OpenSCAD
Raw Normal View History

2023-06-13 21:21:33 +09:30
Guitar_Scale_Length_mm = 648;
2024-04-01 17:56:22 +10:30
ln2 = ln(2);
function log2(x) = ln(x)/ln2;
2023-06-13 21:21:33 +09:30
function fret_scale_length(n) = Guitar_Scale_Length_mm * 2^(-n/12);
2024-04-01 17:56:22 +10:30
function mm_to_fret_number(mm) = -log2(mm/Guitar_Scale_Length_mm)*12;
2023-06-13 21:21:33 +09:30
function lerp(start, end, amount) = start + (end-start)*amount;