I have attempted to create a new Inkscape extension that I have named "Fretty Scalarino". The purpose of my extension is to generate easily printable fretboard scale marking templates. These are used when someone is building a guitar, specifically when they are making the fretboard. The precise placement of frets relative to the guitar nut and bridge is necessary if you want your instrument to be in tune.
Since this is my first programming project of any kind -- outside of excel formulas -- I would greatly appreciate feedback on my code and project organization. I tried to learn some Python by reading through the 'Learn X in Y minutes' for Python 3:
For the most part I am able to achieve the most basic aspects of the functionality I was trying to create, but I'm sure that my inexperience with programming in general and Python specifically has lead to some ugliness.
I am aware of at least two extensions which already exist with similar functionality:
Both of the existing extensions are vastly superior to mine in every way. However, the templates they generate are difficult to print, either requiring a large format printer, or trusting adobe acrobat to accurately tile the print onto several sheets of normal sized printer paper which I find to be nearly impossible.
The point of my extension is to print the template onto a single piece of paper, which is then cut out and taped together. The fretbaord template is broken up into
overlapping columns, and to be honest figuring out an algorithm to do this reliably took me several days. There is an open source website that does exactly what I was trying to do:
Unfortunately I found that I was unable to understand that code, as it combines Typescript and React in a way that is opaque to me.
I also don't understand Git at all, but for the purposes of sharing my code it seems like a Github account makes the most sense, so I have gone ahead and created a repository here:
I would love it if people could take a look at what I have done and let me know if I am way off track. I hope to continure to refine this extenion and eventually share it with the Inkscape community once I am certain it is accurately creating mathematically sound templates.
I usually use Paths instead of Lines, it's just easier to build a long path 'd' string ( not musical string ! ) than make multiple lines if you want something more complex.
I think the consideration should be how you are going to build the shapes. Will they be boxes, or overlayed. So fret boxes on top of a fretboard box etc.
I guess I used inkex.Line because it kind of made sense to draw a simple line wherever a fret need to be placed. When you are referring to paths with a 'd' string, do you mean what is being described here?:
I have attempted to create a new Inkscape extension that I have named "Fretty Scalarino". The purpose of my extension is to generate easily printable fretboard scale marking templates. These are used when someone is building a guitar, specifically when they are making the fretboard. The precise placement of frets relative to the guitar nut and bridge is necessary if you want your instrument to be in tune.
Since this is my first programming project of any kind -- outside of excel formulas -- I would greatly appreciate feedback on my code and project organization. I tried to learn some Python by reading through the 'Learn X in Y minutes' for Python 3:
https://learnxinyminutes.com/docs/python/
I also read through the following Inkscape extension tutorials:
https://inkscape.gitlab.io/extensions/documentation/tutorial/index.html
https://inkscapetutorial.org/pages/extension.html
I used to following page to understand the math behind fret placement:
https://www.liutaiomottola.com/formulae/fret.htm#12th2calcAll
For the most part I am able to achieve the most basic aspects of the functionality I was trying to create, but I'm sure that my inexperience with programming in general and Python specifically has lead to some ugliness.
I am aware of at least two extensions which already exist with similar functionality:
https://github.com/Neon22/inkscape_fret_ruler
and
https://github.com/ducksdoquack/fretboard
Both of the existing extensions are vastly superior to mine in every way. However, the templates they generate are difficult to print, either requiring a large format printer, or trusting adobe acrobat to accurately tile the print onto several sheets of normal sized printer paper which I find to be nearly impossible.
The point of my extension is to print the template onto a single piece of paper, which is then cut out and taped together. The fretbaord template is broken up into
overlapping columns, and to be honest figuring out an algorithm to do this reliably took me several days. There is an open source website that does exactly what I was trying to do:
https://fretboard-template.netlify.app/
https://github.com/brian-c/fretboard-template-generator
Unfortunately I found that I was unable to understand that code, as it combines Typescript and React in a way that is opaque to me.
I also don't understand Git at all, but for the purposes of sharing my code it seems like a Github account makes the most sense, so I have gone ahead and created a repository here:
https://github.com/beep-beep-morales/fretty_scalarino
I would love it if people could take a look at what I have done and let me know if I am way off track. I hope to continure to refine this extenion and eventually share it with the Inkscape community once I am certain it is accurately creating mathematically sound templates.
Looks like a good start !
I tested it and it works fine.
I usually use Paths instead of Lines, it's just easier to build a long path 'd' string ( not musical string ! ) than make multiple lines if you want something more complex.
I think the consideration should be how you are going to build the shapes. Will they be boxes, or overlayed. So fret boxes on top of a fretboard box etc.
Thank you for taking a look!
I guess I used inkex.Line because it kind of made sense to draw a simple line wherever a fret need to be placed. When you are referring to paths with a 'd' string, do you mean what is being described here?:
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#path_commands
and here?:
https://www.w3schools.com/graphics/svg_path.asp
I can see how that would be a much better way to draw complex shapes, and will definitely keep that in mind as I develop this extension.