-
Notifications
You must be signed in to change notification settings - Fork 59
Description
Thanks for the addition of this functionality, hopefully I haven't misunderstood something...
Currently in fretfind.html, working_area is calculated by taking the "string width at the nut" value and subtracting the sum of all the strings. Since "string width at the nut" is from center-to-center between the first and last string, I believe working_area needs to account for the half of each string outside of that distance.
Also, I'm probably missing something on why the offset calculation is using the total length and "string width at the nut"... couldn't the next_space just be used as is?
I updated the following method locally and it seems to match my spreadsheet calculations:
var computeOffsets = function(strings, gauges, actual_length, perp_width, spacingMode) {
var offsets = [0];
const corrected_gauges = spacingMode === 'proportional' ? gauges : new Array(strings).fill(0);
// If proportional, don't count the 1/2 of the first and last string outside of the working_area
const propOffset = spacingMode === 'proportional' ? ((gauges[0] + gauges[strings-1])/2) : 0;
const working_area = perp_width - (corrected_gauges.reduce((tot, cur) => tot + cur)) + propOffset;
const perp_gap = working_area / (strings - 1);
for (var i=1; i<strings-1; i++) {
half_adjacent_strings = (corrected_gauges[i-1] + corrected_gauges[i]) / 2.0;
next_space = perp_gap + half_adjacent_strings;
offsets.push(offsets[i-1] + next_space);
}
return offsets;
};
I haven't contributed to a public repo before, but if the above makes sense and you'd like me to get a branch prepared, I can do that. Thanks!