Show HN: YouTube Guitar Tab Parser (github.com)

2 points by neogenix ↗ HN
I created a simple CLI that turns a YouTube guitar-lesson video into a PDF of the guitar tab.

There are services that transcribe music from Youtube videos into tabs, but they never work well enough for me. Instead I'm taking a simpler approach. It downloads the video, samples frames, uses Claude vision to locate the tab region, crops every frame to that region, de-duplicates the crops by the bar number printed on each line of the score, and stitches the distinct tab lines vertically into a PDF.

I didn't test it on a lot of different Youtube videos yet, so problem will arise for sure.

41 comments

[ 3.7 ms ] story [ 31.7 ms ] thread
i've actually been looking for something like this for so long. all the online transcribers make me pay and i just wanna learn how play songs from a video. this is a great idea!
learn by ear! It's free and you don't need youtube!
This is very true. Tabs can help in niche cases where the precision really matters, but most tabs are not that good unless written by the original artist (rare).

If I had spent my first year learning the instrument properly, I wouldn't have wasted the next decade after that fumbling around so much.

This is absolutely true...but it takes a LOT of time. Fortunately, I first picked up a guitar when I was 13.

I can't imagine getting started with any instrument as an adult. Actually, I'm trying to improve my piano playing right now and it's nearly impossible.

I'm curious how it works for videos that contain moving tab (as in, the playhead stays in the center while the tab moves behind it). Seems like that sort of tab wouldn't work with this approach...?

Kudos from one of the Soundslice guys — we've been making web-based tab and sheet music stuff since 2012. :)

I don't have an answer, but wanted to say that I started using Soundslice about 9 months ago and I absolutely love it. It does exactly the part of transcribing that I want done for me and nothing more, which is basically none of it except the boring stuff.
Hey, great to hear! Thanks for taking the time to write that. :) Keep transcribing and playing music!
Care to sell me on it? How dose it compare to musescore?
For context, I'm not transcribing to distribute sheet music or anything, although I'm sure you could. I write down just enough when transcribing so I don't forget what I just figured out. I do it to practice my ear and learn songs.

That said, it's the fastest way to get a track into some player, define loop points easily, and then write down what I need to along with the player. I can jot down chords, lyrics, tabs of riffs, etc. I've tried tons of solutions over the years like sooperlooper, ableton live, reaper, winamp, youtube. this is by far the easiest, with just the right set of tools. It also doesn't do any of it automatically, so there's not even a temptation to skip practicing my ear.

I don't know how exactly Claude vision works but isn't just using good old computer vision much cheaper?
Almost all those people charge for the PDFs. They know the PDF is more useful, that's why the video is free.

I don't think your software is (or should be) illegal. But it's a form of theft, and incredibly unethical. These people worked very hard on these tabs and don't make much money. You (and kiaansaraiya and neogenix) should be ashamed of yourselves. You don't deserve your guitar if you steal tabs from working musicians.

"you don't deserve your guitar if you steal tabs from working musicians"

the same "working" musicians who didn't write the music they're making tabs for, didn't get any permission from the original artists, and in many cases aren't actually playing/tabbing the parts as originally written.

A "working" musician is someone who doesn't monetize someone else's work, regardless of how super hard it must be to write a PDF.

I'd say someone should take your guitar away but I'd bet money you're not doing anything groundbreaking with it anyway.

But then the solution is to just ignore these musicians.

But if you do find that they made something valuable that you can’t find elsewhere, then you should compensate them for that. Because yes, it is a lot of work.

The solution? Put in the work to learn how to play by ear, build chords from the tonic by identifying intervals and scale degrees. So when Youtube, on a whim, decides to DMCA all these "musicians" churning out tabs of popular songs, you wont be beholden to them.

But I know, its easier to just pull up a tab.

Are there technical hurdles around just programmatically generating a tab from any song or audio recording itself?

This is interesting and all but seems to use computer vision rather than audio processing?

Using computer vision to read the existing tab from the page would be more efficient and precise than trying to use audio processing to isolate individual notes from a single instrument in a potentially busy audio track. The existing tabs also nail down which string and fret is used for each note, which would be a difficult task for audio processing because there are multiple combinations of string and fret for any given note. For example, an open G can also be played on the 5th fret of the D string, or the 10th fret of the A string, or the 15th fret of the E string.
I understand but would assume it could be solved by chord/positional groupings or similar. Manual/human tab transcription need to infer positional assumptions anyway; some artists will play the same songs different ways too ala Bob Weir

> the existing tab from the page would be more efficient and precise

But what about songs that aren't made into a YT video?

As far as I know, there still isn’t a tool that can reliably produce usable transcriptions out of the box, although the results for solo piano can be reasonably good. A lack of high-quality labeled training data, especially for instruments other than piano, is probably part of the reason. But the problem is also more complicated than it might initially seem: you have to handle polyphony, overlapping harmonics, timing and articulation. And in the case of guitar tabs, it's even more complicated as one needs to determine what tuning is used (if not standard), which string and fret produced each note. Or separately rearrange the tab.
Reddit r/guitar gets a lot of questions about AI generated tabs that are unplayable (the fingering is just crazy).

You need to both work out the chords and also decide on fingerings a human could perform. Seems possible, but more then just audio processing

Give me a tool that scrapes tabs from Ultimate-Guitar and I'll be a happy camper :)
This is one i could get behind. I mean, all the tabs are crowdsourced anyway so why can you throw up the paywall only after all the tabs are made.

I only need the clean tab and transposing would be nice.

TerminalTabs anyone?

There are examples on github from the beforetimes (preai). I made my own little version with a basic ui in python a couple years ago. Works pretty good. Best to pull the powertab or guitar pro tab versions though and open in tuxguitar.

Here is what I was cribbing from with my own version. Seems they updated it since.

https://github.com/jabbey1/UGDownloader

But the tabs would be wrong (since they're invariably wrong in UG).
I was excited to use it, as I really wanted something like this, then I realized it needs AI/Claude (?)

That sounds like it can get quite costly. Probably there are ways to do it without AI, I would rather manually annotate the tab area with a visual editor.

How would you do this without SOME sort of vision/audio model? Are you saying just not an LLM?
Manually select a rectangle on a video frame, then do basic computer vision to detect notes, or even a simple image processing algorithm to find the lines and notes.
It would be nice to have a link to an example YT video to see what exactly the AI is trying to locate on the screen.
I learned this one:

https://m.youtube.com/watch?v=07N4VVSmYLU&list=RD07N4VVSmYLU...

…exactly the way you described. Pause, screenshot, adjust color/contrast, assemble in a pdf. Super annoying.

Learning music from recordings (video or just audio) would be so much easy if modern video and audio playback software would bring back the AB repeat function that used to be common on CD players, DVD players, LaserDisc players, and MP3 players.

Why the heck did this largely go away?

Check out Amazing SlowDowner. And AnyTune Pro. Plus lots of yt player websites that allow for looping.
VLC has it. And Youtube looper wrapper sites too.
So I'm a bass guitarist, and I've made some of these exact videos.

I link to a Patreon in my videos that lets you pay a membership to download the full tabs in PDFs.

Here I was thinking AI might soon replace my painstakingly slow tab transcription efforts altogether. But I never thought about someone just ripping it from the video...

Let me know if it works ;-)

https://www.youtube.com/watch?v=c2i-Lwoe2Ow

I’ve been working on a tool to help me discover chord inversions and find fingerings I can comfortably play. https://music.shademaps.com/
That kind of tool is indeed helpful. I wrote a kind of similar command line version that does a subset of what your's does in C around 1985 for my Mac, running in the terminal-like window my compiler's runtime provided for running command line programs.

Your's looks nicer :-)

Here's the output of mine for a C chord.

  C:  C E G
  <3>|-----|-----|-<5>-|-----|-----|-----|-----|-<1>-|-----|-----|-----|-<3>-|
     |-<1>-|-----|-----|-----|-<3>-|-----|-----|-<5>-|-----|-----|-----|-----|
  <5>|-----|-----|-----|-----|-<1>-|-----|-----|-----|-<3>-|-----|-----|-<5>-|
     |-----|-<3>-|-----|-----|-<5>-|-----|-----|-----|-----|-<1>-|-----|-----|
     |-----|-----|-<1>-|-----|-----|-----|-<3>-|-----|-----|-<5>-|-----|-----|
  <3>|-----|-----|-<5>-|-----|-----|-----|-----|-<1>-|-----|-----|-----|-<3>-|
and here it is if I toss in the narrow switch:

  C:  C E G
   3 |---|---|-5-|---|---|---|---|-1-|---|---|---|-3-|---|---|-5-|
     |-1-|---|---|---|-3-|---|---|-5-|---|---|---|---|-1-|---|---|
   5 |---|---|---|---|-1-|---|---|---|-3-|---|---|-5-|---|---|---|
     |---|-3-|---|---|-5-|---|---|---|---|-1-|---|---|---|-3-|---|
     |---|---|-1-|---|---|---|-3-|---|---|-5-|---|---|---|---|-1-|
   3 |---|---|-5-|---|---|---|---|-1-|---|---|---|-3-|---|---|-5-|
Here's the source [1], minimally updated to compile with current C compilers and to not depend on any quirks of the runtime of whatever C development system I was using on my Mac back then (Megamax C, I think).

I was pretty shaky on chord theory back then so not sure I'd trust it for fancy chords. I have no idea why the heck I made the D tuning flag tune both the 1st and 6th strings down to D. I'm 100% certain every piece of sheet music I had that called for for D tuning only wanted the 6th string tuned down.

[1] https://pastebin.com/HKyKWHip

I stopped playing guitar before youtube came out, so I only ever used tab books. Those official sources often contained mistakes (the transcriber was only human). Mistakes came in different flavours; some were mere typos, but others were correct note/s in the wrong neck position, and others were slightly worse: incorrect notes, or more frequently, omitted notes (common in genres like heavy metal where the same note may be played at high frequency).

I wonder if these AI tools can outperform humans at transcription.

This is an interesting tool and maybe it works for the songs you need, but for classical guitar songs where printed scores are generally available, I would rather just buy those from some reputable publisher (e.g. Zen-On or Doremi).

It has happened quite a few times where I compare tabs in youtube videos with printed scores, and the youtube version turned out to be unique arrangements. It's the same with PDFs on certain sites, especially those that accept user contributed content.

I would rather pay money to get printed scores than to find out later that I have been practicing the wrong thing.

Brings me back to learning guitar using a version of TabIt[1] that I hacked and then ultimately paid for. They had an incredible community where people uploaded tabs of your favorite songs. Then you could use TabIt to learn how to play.

1: https://www.tabit.net/

i love it

ai can't shred

ai will never get chicks

i will use YouTube Guitar Tab Parser to shred and get chicks