Projects/VLC Drill

When learning how to play a song by ear, it's useful have sections of it on repeat and/or slowed down. It can be fiddly to keep scrubbing back or to set up a loop for a certain passage, so I hacked together some tooling around VLC as a plugin for my text editor that helps. Here's a screenshot:

After 'annotating' the song (i.e. noting down when the verses, choruses, solos etc. starts), the section(s) of interest can then be visually selected and looped over with a few keystrokes. The annotation lives in a text file that can be edited and reloaded in the same session, and I've found that taking notes and controlling the song playback through one program pretty neat. At a pinch, it also comes in handy for ad-hoc YouTube playlists!

{
  "playlist": [{
    "title": "The Sound of Silence",
    "stream": "https://www.youtube.com/watch?v=qwc-PBgh8-w"
  }, {
    "title": "Fade to Black",
    "stream": "https://www.youtube.com/watch?v=1FH6NSPyj18"
  }, {
    "title": "November Rain",
    "stream": "https://www.youtube.com/watch?v=FhbeNEtkgDs"
  }]
}
Example of a valid annotation file

Implementation-wise, the plugin starts up a VLC telnet server, then netcats over VLC's RC commands to it. Writing Vimscript wasn't as daunting as anticipated; Steve Losh's excellent book and the source code of other plugins turned out to be great reference material for plugin organisation and language idioms.

The VLC plugin is hosted on GitHub. Feedback and contributions are welcome!