News for hackers. Stuff that matters.
Re:Show HN: Generate guitar tablature using a constraint solver by anderskaseorg on Sunday March 08, 2020 @07:07PM (#22521314)
If you’re looking for a more practical algorithm: this problem can be formulated as a shortest path problem on the graph whose vertices are (n, fret, finger, string) tuples. A simple dynamic programming solution is to fill out a distance table whose entry distance[n, fret, finger, string] is the optimal cost of the prefix of the melody ending at note n, which can be computed as 0 if n = 1, or in terms of the entries for note n − 1 if n ≥ 2.
Re:Show HN: Generate guitar tablature using a constraint solver by senshu on Monday March 09, 2020 @03:44AM (#22523677)
I agree with that and I definitely will try.

As explained in the first comment, one of the motivations for the project was to learn constraint programming. The tablature generator could be a nice example to compare different paradigms and algorithms.

Re:Show HN: Generate guitar tablature using a constraint solver by texasbigdata on Sunday March 08, 2020 @11:04PM (#22522616)
How did you learn this. Math undergrad? Comp sci? Something else?
Re:Show HN: Generate guitar tablature using a constraint solver by charlus on Monday March 09, 2020 @08:33AM (#22524837)
This example is directly mentioned in MIT Introduction to Algorithms, I would recommend it - https://ocw.mit.edu/courses/electrical-engineering-and-compu...
Re:Show HN: Generate guitar tablature using a constraint solver by ves on Monday March 09, 2020 @02:31AM (#22523409)
You would definitely cover some graph and dynamic programming algorithms in a good introductory algorithms course.
Re:Show HN: Generate guitar tablature using a constraint solver by wwright on Monday March 09, 2020 @06:55AM (#22524379)
This is one of the only huge benefits of formal CS education — those basic algorithm and discrete math courses make some problems trivial.
Re:Show HN: Generate guitar tablature using a constraint solver by dgellow on Tuesday March 10, 2020 @01:40AM (#22533062)
Check out Coursera's algorithms specialization: https://www.coursera.org/specializations/algorithms