Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJoseph Greco
13,405 PointsI want to make a Capo-Chord Converter for Guitar.
I want to make an App where you can input a music chord and a capos fret placement on your guitar, then you will be shown how that chord is played at that capos location.
Heres a simple image of a table showing how to play chords with different capo placement,
However often times some chords are hard to find conversions for. Id like to make an in depth table of almost all capo-chord combinations then create an interface where users can access it easily.
Im thinking Javascript/jQuery would be my best bet but I'm overwhelmed on how to start. Should I create an HTML table in a separate document with all the data then access its specific columns and rows based upon what the user inputs? Any advice would help to send me into the right direction.
Thanks,
1 Answer
jag
18,266 PointsFetching data as a HTML Table won't do, it's something no one will do or has done that I've seen. You would need JSON.
I wouldn't really be able to say much about the converting function since I am not aware of how the capochord conversion works.
Every time you want to start a project you need to break down problems into small ones so you can tackle them.
My thoughts would be you will use objects, arrays, loops and inputs. jQuery will do where it takes the two values and returns the converted value.
If you want a full in-depth of all the conversions when a picture of a table would do but since you want to create something users can use then I'd suggest not focusing on a table but rather letting the user select / type a list of values and get a converted value back.
- Get user inputs
- Convert inputs
- Show converted values
As simple as it gets.
{
"Capo": {
"A":{
"NO_CAPO":"A",
"1-FRET":"Bb"
...
"7-FRET":"E"
}
"B":{},
...
"Key":{
"CAPO_POSITION":"CONVERSION"
}
}
}
Joseph Greco
13,405 PointsJoseph Greco
13,405 PointsThanks for responding, Jag.
I converted the chart into JSON data:
I ran it through a validator and everything checks out. Then I created a xhr request and parsed the response to log to my console. My next step will be writing the jQuery to capture a users input from two select menus once submit is clicked, then append the result into the output <div>.
Here is this HTML:
The jQuery:
I tested my chord and capo variables to display as alerts which worked. I know this code is incorrect but I'm a little stumped here. I still need to add the submit function as well. Any ideas?