Commit graph

13 commits

Author SHA1 Message Date
Profpatsch
9c1e3687fe feat(users/Profpatsch/lyric): add tapping & improve silence warning
Add a tapping command that does not quantize the timestamps.

For the silence warning, we make it BPM-dependent (defaulting to
120BPM as everywhere else), meaning for slower songs we give a higher
possible time difference before we display a warning.

Change-Id: Idefc44166639b23c2105a1a810ac22ed84457225
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12563
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2024-10-05 13:49:38 +00:00
Profpatsch
92ad57febe fix(users/Profpatsch/lyric): create new lyric file if not exists
That was the original intention, but I didn’t understand that lua
would fail with "r+" if the file does not exist (and "w+" truncates
the file, so you have to try "r+" and then fall back to "w+" which
will create the file as well.)

Change-Id: Ib238f0b73ab403ceeaf035d053a14eba718d1b48
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12562
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2024-10-05 13:49:38 +00:00
Profpatsch
cf68a34b0d feat(users/Profpatsch/lyric/ext): add lrc upload & ms offset
This adds support for uploading the lyrics part of an .lrc file to
lrclib, see https://lrclib.net/docs

I pretty much only used ChatGPT to translate the rust “proof of work”
challenge to nodejs and it worked first try lol.

Before uploading the lyrics, I construct a webview with a preview of
what is going to be uploaded, and then only upload when that is
accepted. Pretty sweet.

Also adds two commands for increasing/decreasing the current timestamp
by 100ms and starting playback from 2 seconds before that, very handy
for fine-tuning lines.

Change-Id: Ia6adfe26d0c21c62554c8f8c55e97e2caec95d1e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12561
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2024-10-05 13:49:38 +00:00
Profpatsch
ad711b15a0 chore(users/Profpatsch/lyric): add typescript linting rules
Change-Id: I9ab0336450519648f7a8edeec94bd64b78e2f05b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12554
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2024-10-05 13:49:38 +00:00
Profpatsch
102c9b30a7 feat(users/Profpatsch/lyric/ext): add bpm on quantization
If the bpm header already exists, overwrite it with the new value.
Also use an existing header as suggestion.

Change-Id: If6431e8056504db437c31313d885b5ba0d0e55d5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12553
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2024-10-05 13:49:38 +00:00
Profpatsch
c014e39dfd feat(users/Profpatsch/lyric): add .lrc header for new files
Insert the length and stuff into the .lrc file headers.

Change-Id: Id2565c95c516208f1e46b79d5b8da50f3d6bee62
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12552
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2024-10-05 13:49:38 +00:00
Profpatsch
686b141767 feat(users/Profpatsch/lyric/ext): add bpm quantization
It’s a bit crappy and really depends on the input field opening
quickly again (which it often doesn’t really do…), but it was the
easiest way I figured how to do it haha.

Aligning to eigth notes is pretty much the easiest way to sync
everything up after tapping in the timestamps (for most songs).

Change-Id: Ibbb072f62b6ee17d983e81b6c1554bc3516fa636
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12551
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2024-10-05 13:49:38 +00:00
Profpatsch
48d021de15 feat(users/Profpatsch/lyric/ext): add lyric shifting
Change-Id: I1b52e2a295ae81d5d9bf488b1e584dda4d5aac9b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12550
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2024-10-05 13:49:38 +00:00
Profpatsch
fa18fea20e refactor(users/Profpatsch/lyric/ext): use document directly
Change-Id: I6869743727d3b16b74c498b4cd60b33c3ed3997d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12549
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2024-10-05 13:49:38 +00:00
Profpatsch
02713e054f refactor(users/Profpatsch/lyric/ext): move command into fn
Change-Id: I2d38455cdf881e03a390d129f9cee3f9eeca485d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12548
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2024-10-05 13:49:38 +00:00
Profpatsch
9bec21ea1c feat(users/Profpatsch/lyric): add vscode extension & helpers
* tap-bpm: simple CLI program that accepts key inputs and averages a
BPM value

* lyric-timing-mpv-script: If you press Ctrl+l, mpv attaches the
  current timestamp to a .lrc file named after the song.
  This is for manually timing missing songs for uploading them to
  https://lrclib.net/

* extension: vscode extension for `.lrc` files, currently with the
  following features:

    1. A “jump to LRC position” command which reads an .lrc timestamp
    from the current line and expects mpv to listen on
    `~/tmp/mpv-socket` (via `--input-ipc-server`), and will seek to
    the exact timestamp (down to the ms) in the currently playing
    song.

    2. Some initial linting warnings

      - A lint that warns if the difference to the next timestamp is
      more than 10s (which usually means there’s an instrumental and
      the previous line is stuck)

      - A lint that checks that timestamps are monotonically
      increasing

Change-Id: I32a4ac0e2c5bbe3d94e45ffcf647f81bc7c08aa0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12537
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2024-10-05 13:49:38 +00:00
Profpatsch
970dcaa04f fix(users/Profpatsch/lyrics): remove special chars from search
Leaving out any symbol characters improves the search accuracy.

Change-Id: I00c993d4099bb8e9701783b53afc9423f1b2f674
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12480
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2024-10-05 13:49:38 +00:00
Profpatsch
ffdcb3bb5e feat(users/Profpatsch/lyrics): integrate into an mpv extension
Slop it together! The mpv script is entirely generated by ChatGPT.

Whoooooooooo

Change-Id: Ic284d142c2f1fd6d407af6b3571db0e815604051
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12478
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2024-10-05 13:49:38 +00:00