algorithmic modeling for Rhino
Hello all,
I'm trying to create a guitar neck builder with sliders adjusting different details and am working on the fret ruler.
In this, and many other projects, I find myself needing to take the output of a group of components and feed it back through those components a certain number of times. I am a real noob at this (learning slowly but surely through projects and tutorials) so I may be missing something.
Basically I want to create a series of numbers but, rather than evenly incremented, I want them to be incremented based on the fret rule 2^(1/12). I can copy and paste, but that is obviously a bit cumbersome, and I wouldn't be able to change the number of frets based on a slider. Would using hoopsnake be the easiest way? (if I can figure it out)?
I've created the first three lines (nut and two frets) by c/p so that you can see what I'm going for.
Thanks for the help!
Tags:
I had no luck with your "fret rule 2^(1/12)" so searched for a source and found a different algorithm:
Calculating Fret Positions
http://www.liutaiomottola.com/formulae/fret.htm
Calculating the positions of the frets requires the simplest bit of math. The (really) historical technique is called the rule of 18, and it involves successively dividing the scale length minus the offset to the previous fret by 18. [...] The invention of the pocket calculator made it possible to make use of a more accurate constant, and so these days we conventionally calculate fret positions for equal temperament by successively dividing the scale length minus the offset to the previous fret by 17.817.
And from here: http://www.stewmac.com/How-To/Online_Resources/Learn_About_Guitar_a...
The "factor" for fret spacing is 17.817154.
So using Anemone to loop, I got this:
I must admit that it doesn't look quite right, and I'm not sure why...?
Hi Joseph, thanks for that. The proportions look right, but it's not quite there. The 12th fret should be half the length scale length from the starting point, (12.75 from the "nut" or starting point if scale length is 25.5)
I knew there was a factor. Back in the day they used 18/17. However, this is kind of like using 3.14 rather than pi. Though it would probably be close enough for practical application, since I have the ability, I'd rather use the actual math. I'm not very good at math, but my understanding is that the "twelfth root of two" (2^(1/12)) is derived because an octave of a note is double (or half) the frequency of another. There are 12 notes, 13 being the octave, so 12 steps between the octaves. So you need a number that multiplied by itself 12 times results in it's doubling, hence 2^1/12. Like I said, I'm not great at math, so I'm not sure if I explained or even understand that correctly!
Thanks for your help, I'm going to look into using anemone!
If you look at the values from the 'D1' output (flattened for readability), you can see that line 12 is exactly half of line 0:
So maybe it's an "off-by-one" issue? I'm not happy with this output... I would expect the frets to be distributed over a distance equal to "Scale Length", for one thing. But it's just far enough out of my realm that I'm not sure how to fix it?
Ricardo's solution looks promising, though, as a way to use your fret rule. Here is his function plugged into my Anemone loop:
Doesn't meet your criteria, though.
Just a little too today distracted to figure this out as well as I would like. Anemone is a GREAT tool, though maybe not necessary in this case?
Ahh ok, yes, now that I see those values and referencing them to the fret ruler they ARE the correct values from fret to fret. So, that data should be usable. The frets shouldn't span the entire scale length, but definitely more than they were.
Thanks again, I will play around with both solutions. Great way to learn and get more ideas.
Hi guys.
Have a look at this, maybe it is ok.
Double check, i don't understand the math behind it....
Cya.
Hey Riccardo, thanks for the help!
The lengths of the frets aren't quite right, but the math for their spacing is spot on. You even included the bridge (end of the scale)!
I should be able to tinker to get the fret lengths right. I want to be able to pick a point on the datum of the nut location and then use the nut width and width at 12th fret to draw straight lines between (and beyond the 12th) and then have the parallel frets meet at those unparalleled lines.
Getting the creation and spacing of the lines for the frets was the biggest thing though, and you've done that, so thanks. I just hope I am able to deconstruct and understand what you did.
Re: the math,
Here's my understanding, c/p from my response to Joseph above:
"I knew there was a factor. Back in the day they used 18/17. However, this is kind of like using 3.14 rather than pi. Though it would probably be close enough for practical application, since I have the ability, I'd rather use the actual math. I'm not very good at math, but my understanding is that the "twelfth root of two" (2^(1/12)) is derived because an octave of a note is double (or half) the frequency of another. There are 12 notes, 13 being the octave, so 12 steps between the octaves. So you need a number that multiplied by itself 12 times results in it's doubling, hence 2^1/12. Like I said, I'm not great at math, so I'm not sure if I explained or even understand that correctly!"
This thread was referenced on a later one:
Guitar Nut conundrum: equal spaces and equal centers question
http://www.grasshopper3d.com/forum/topics/guitar-nut-conundrum-equa...
so I want to update the relevant part of that thread here, the 'Frets' component:
It defers on the option of setting the 'Start (S)' of the internal 'Series' component to one instead of zero, creating a "fret zero" that is co-linear with the Nut.
© 2020 Created by Scott Davidson. Powered by