nada नाद
music player

nada

नाद · “sound”

A keyboard-driven music player for your files and YouTube, with synced lyrics, autoplay and downloads.

v0.1.1 latest2 releases6 decisions recordedMIT license

nāda's Home: the lyrics of the playing song fill the left, scrolling with it; the right shows the cover, the singers, views, release date and what plays next

Nāda (नाद) is Sanskrit for "sound": in Indian music theory, the primordial sound every note comes from.

nāda is a music player for people who live on the keyboard. Songs on your disk and music from YouTube share one queue. Play a song and, like YouTube, nāda lines up what comes next; reorder or remove anything with vim keys. Lyrics scroll along with the song. If you like a YouTube song, D saves it to your music folder, with its tags, cover and lyrics, while it keeps playing. It runs on MPD, so your library, queue and playback carry on with the window closed.

#Features

The queue: played songs dimmed, the playing one highlighted, then your songs, then autoplay; each with its views and age The queue with the lyrics on the right (L)

Searching YouTube: results with thumbnails, channel, views and length The mini player: cover, title, the current lyric line, controls

#Install

#Requirements

# Arch
sudo pacman -S --needed python-gobject gtk4 mpd yt-dlp ffmpeg python-mutagen gtk4-layer-shell ttf-jetbrains-mono-nerd
systemctl --user enable --now mpd

MPD needs a music_directory and an audio output; the Arch wiki has a five-line config. nāda finds MPD the way every MPD client does: MPD_HOST / MPD_PORT, else MPD's socket in $XDG_RUNTIME_DIR/mpd/socket, else localhost:6600.

#nāda

git clone https://github.com/Theyashsawarkar/nada ~/.local/share/nada
ln -s ~/.local/share/nada/bin/nada ~/.local/bin/nada
nada            # opens the player (it starts itself the first time)

Update with git -C ~/.local/share/nada pull && nada quit.

#Usage

nada                       open the player, or close it if it's open
nada show | hide | mini    the full player, hidden, the mini player
nada tab <name>            open on a tab: home queue library youtube playlists downloads
nada add [--next|--play] <YouTube URL | file | search words>
nada ctl toggle|play|pause|stop|next|prev
nada ctl seek +10 | seek -10 | seek 1:30
nada ctl vol +5 | vol -5 | vol 40
nada status [--json]       what's playing
nada waybar                JSON for a waybar module
nada daemon | quit         start / stop the player (MPD keeps playing)

The player is one resident process; nada only sends it a D-Bus message, so it opens at once. ctl, status and waybar talk to MPD directly and work even when the player isn't running. Closing the window (q, Esc) only hides it: the music, autoplay and downloads carry on.

#Keys

The footer always shows the keys for where you are; ? shows them all. Counts work like vim: 5j, 3., 2dd.

KeyAction
0Switch to Home (the lyrics)
1 2 3 4 5Switch to the queue, library, YouTube, playlists, downloads
j / kMove down / up a song (counts work: 5j)
gg / GJump to the top / bottom (12G: to the 12th)
Ctrl+d / Ctrl+uScroll half a page down / up
EnterPlay the selected song
SpaceToggle play / pause
. / ,Seek forward / back 10 seconds (3. = 30 s)
> / <Play next / previous song
= / -Raise / lower volume
mToggle mute
sToggle shuffle
rCycle repeat (off, all, this song)
MToggle autoplay (more like this after your songs)
VSelect several songs (visual mode)
uRestore the last change (undo)
Ctrl+rRestore an undone change (redo)
/Search (the list; YouTube on 3; your library on 2)
n / NJump to the next / previous search match
:Run a command (:w name, :sleep 30m, :yt query…)
?Show all keys
zSwitch to the mini player
q / EscClose the window (the music keeps playing)

Queue (1)

KeyAction
ddRemove the song from the queue (V: the selection)
yyCopy the song (yank)
p / PPaste removed or copied songs below / above
J / KMove the song down / up
AMove the song to play next
DSave the YouTube song to your music folder (download)
LShow the lyrics on the right
zzJump to the song that's playing

Library (2), YouTube (3), Downloads (5)

KeyAction
h / lMove between the columns
TabSwitch between artists, albums, genres and folders
a / AAdd to the end of the queue / to play next
DSave the result to your music folder (download)
rRestart a failed download
ddDelete the saved file (asks first)

Mini player (z)

KeyAction
SpaceToggle play / pause
. / ,Seek forward / back 10 seconds
> / <Play next / previous song
z / EnterSwitch back to the full player
q / EscClose the mini player (the music keeps playing)

#Commands

Typed after :, like vim.

CommandDoes
:w <name>Save the queue as a playlist (YouTube songs included)
:e <name>Replace the queue with a playlist (:e alone opens Playlists)
:yt <search>Play the top YouTube result, and its mix after it
:play <search>Play a song from your library (falls back to YouTube)
:add <url or search>Add to the end of the queue
:seek 1:30 · :seek +30Jump to a time, or by an amount
:vol 40 · :vol +10Set or change the volume
:sleep 30m · :sleep offFade out and pause after a while
:lyrics <search>Pick the lyrics by hand (remembered for the song)
:autoplay on · offSame as M
:dlDownload the playing song
:clearEmpty the queue (u brings it back)
:q · :qaHide the window · quit the player

#Configuration

Everything is optional, in ~/.config/nada/config.toml:

[nada]
autoplay = true          # line up more songs after yours (M toggles it, and it's remembered)
download_dir = "YouTube" # inside MPD's music directory
format = "opus"          # opus (no re-encoding) | mp3 | m4a
seek_step = 10           # seconds for , and .
volume_step = 5
notify = true            # a notification when the song changes (while the window is hidden)
opacity = 0.62           # window background: 1 is solid, lower shows the blur behind it
music_dir = ""           # default: MPD's music_directory

~/.config/nada/style.css is loaded last, to restyle anything (the default look is Catppuccin Mocha with a mauve accent: see nada/style.css).

#Desktop integration

sway (the same works with any compositor's key bindings):

exec nada daemon
bindsym $mod+Shift+m exec nada                       # open / hide
bindsym $mod+Mod1+space exec nada ctl toggle          # without opening anything
bindsym $mod+Mod1+period exec nada ctl next
bindsym $mod+Mod1+comma exec nada ctl prev
for_window [app_id="^dev\.vayu\.Nada$"] floating enable, resize set 1180 720, move position center

Media keys going through playerctl work as they are: nāda speaks MPRIS. On SwayFX, blur enable, corner_radius 20 in that for_window rule gives the window its glass look; the mini player is a layer-shell surface named nada (layer_effects "nada" { blur enable; corner_radius 18; }).

waybar, a module that shows what's playing (and disappears when nothing is):

"custom/nada": {
  "exec": "nada waybar",
  "return-type": "json",
  "on-click": "nada ctl toggle",
  "on-click-middle": "nada ctl next",
  "on-click-right": "nada",
  "on-scroll-up": "nada ctl seek +10",
  "on-scroll-down": "nada ctl seek -10"
}

Its class is play, pause or stopped, to style each state.

From other tools: nada add --play <url> plays a YouTube link with its mix after it; raga, the YouTube search panel, uses exactly that.

#How it works

 raga, keys, waybar ──► nada (bin/nada: D-Bus) ──► the player process ──► MPD ──► speakers
                                                    │
                                                    ├─ yt-dlp: search, mixes, stream links, downloads
                                                    ├─ LRCLIB: lyrics
                                                    └─ MPRIS: media keys, phone, playerctl

#Troubleshooting

#Contributing

Bug reports, ideas and pull requests are welcome: see CONTRIBUTING.md for the development setup and the rules the code follows, and CHANGELOG.md for what changed in each release. Please report security issues privately (SECURITY.md).

nāda is part of Vayu, a keyboard-driven Wayland desktop, and works on its own on any desktop with MPD.

#License

MIT