Package: maestro-music
maestro-climaestro-cliis a command-line tool to play songs (or any audio, really) in the terminal.Check out theDiscord server!Featurescross-platform!add songs directly from YouTube, YouTube Music, or Spotify!audio visualization directly in the terminal!Discord integration!Mac integration (Touch Bar, Now Playing center, headphone controls)!clips!shuffle! (along with precise control over the behavior of shuffling when repeating)filter bytags!InstallationMake sure you have Python 3 andpipinstalled.First, runpip install maestro-musicNOTE:pip install maestroandpip install maestro-cliwill NOT work, they are totally unrelated PyPI packages.Now, if you want to be able to directly download songs from YouTube or Spotify, you'll need to installFFmpeg. You can also download the songs yourself and pass the path to the downloaded file tomaestro add.Installing FFmpegEASIEST:conda install -c conda-forge ffmpegBut if you don't want to getconda, here are the instructions for each platform:macOSRequiresHomebrew:brew install ffmpegWindowsJust check out theFFmpeg websiteand download the latest version of the Windows build. Make sure to add thebinfolder to your PATH.Here are some instructions:https://www.geeksforgeeks.org/how-to-install-ffmpeg-on-windows/Linuxhttps://www.tecmint.com/install-ffmpeg-in-linux/Known Installation IssuesIf you have any issues, before trying the below fixes, make sure you have the latest version ofpipinstalled:pip install --upgrade pipAlso, if you haveconda, see if running the following fixes your issue before trying anything below:conda install libsndfile ffmpeg cffimaestro-cliusesjust_playbackto play sound, which uses a C library calledminiaudio. Unfortunately, the creators did not provide wheels, so installation ofjust_playbackand thereforemaestro-cliusually fails if there's any (compatibility or otherwise) problems with your C/C++ compiler. Here are platforms where there are known issues:Apple SiliconThere's a problem with the flag-march=nativefor older versions of theclangcompiler. I manually removed this from thejust_playbackcode and built an Apple Silicon-compatible version. Just check out thedependency_builds/folder in this repo, and look for the wheel that saysarm64. Download it, then runpip install PATH_TO_DOWNLOADED_ARM64_WHEELandnowpip install maestro-musicshould work.WindowsIf you get this error on a 64-bit Windowserror: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/find and download thewin_amd64wheel ofjust_playbackindependency_builds, then runpip install PATH_TO_DOWNLOADED_WIN64_WHEELandnowpip install maestro-musicshould work. Another option (especially if you're on a 32-bit Windows) is to just get Visual C++ Build Tools.LinuxIf you have issues (especially if you getIllegal instruction (core dumped)when runningmaestro play, even after installing succesfully), try:upgrading pip:pip install --upgrade pipuninstallingjust_playback:pip uninstall just_playbackreinstallingjust_playbackwith the--no-binaryflag:pip install just_playback --no-binary just_playback --force-reinstall --upgradeAlso check this out:https://github.com/cheofusi/just_playback/issues/21... and good luck 💀.If all else fails ...You could uninstall and reinstall.pip uninstall maestro-musicand also remove the~/.maestro-filesfolder.WARNING: this will delete all your songs! You should probably back up your~/.maestro-files/songs/folder first.PlatformsTested heavily on macOS Monterey, lightly on Windows and Linux.maestro-cliwas coded to be cross-platform, but if there are any problems, please open an issue (or PR if you know how to fix it!). You can also join theDiscord serverand ask for help there.Supports.mp3,.wav,.flac, and.ogg(Ogg Vorbis).UsageRunmaestro -hto get a list of commands. Runmaestro <some command> -hto get comprehensive help for that command—the below is just an overview.maestro-cliuses the concept of a positive integersong IDto uniquely refer to each song.Also, playlists don't exist—maestro-cliusestags. For example, let's say you want to be able to listen to all your Jon Bellion songs together. Instead of adding them all to a playlist, runmaestro tag <song IDs for each Jon Bellion song> -t jon-bellion. Thenmaestro play jon-bellion. If songshas tagt, then you can think of songsas belonging to the playlist defined by tagt.maestro-clialso tracks your listen time—total and by year. You can see this withmaestro listand/ormaestro entry. For example, to see your top 10 listened songs (by average number of times listened; note that this is NOT the number of times the song was played but rather the total listen time for that song divided by the duration), runmaestro list -s times_listened -T 10 -y cur—replace 'cur' with e.g. '2020' to get the listen times for 2020 instead.maestro addAdd a song (can be a folder of songs too!) given a file path.Pass the-Yor--youtubeflag to download from a YouTube or YouTube Music URL instead of a file path. This requires installingFFmpeg. Passing a YouTube MusicsongURL (not "Video") is recommended, as passing "Video"s (i.e. just normal YouTube videos) can sometimes mess up the artist/album data.Pass the-Sor--spotifyflag to download from a Spotify URL instead of a file path. This also requires installing FFmpeg.Pass the-Por--playlistflag to download an entire YT playlist from a song URL with a playlist component, e.g.https://www.youtube.com/watch?v=V1Z586zoeeE&list=PLfSdF_HSSu55q-5p-maISZyr19erpZsTo. The-pflag is unnecessary if the URL points directly to a playlist, e.g.https://www.youtube.com/playlist?list=PLfSdF_HSSu55q-5p-maISZyr19erpZsTo.By default,maestro addcopies the file to its internal database (~/.maestro-files), but you can pass the-Mor--moveflag to move the file instead.maestro clipEver been listening to music, and you're skipping every song because you keep getting bored of them? You like the songs, you're just not in the mood to listen to all of them entirely.Introducing clips, something I've always wished the big companies like Spotify, YT Music would do. Usemaestro clip ID START ENDto define a clip for any song with a start and end timestamp (or use the clip editor for fine-grained control withmaestro clip ID), thenmaestro play -cto play in "clip mode" (can also be toggled while playing a normal mode session with theckey)—this will play the clips for each song (or the entire song if there's no clip). Now you can listen to only the best parts of your music!maestro entryList details for a specific song.maestro listList songs (or tags) and details. Usemaestro list -hto see full options (e.g. sort, list only songs with a certain tag, etc.).maestro playPlay songs. Usemaestro play -hto see full options. Has lots of features:pass tag(s) as arguments to play songs with any of those tag(s) (or songs with all of those tag(s) if you pass the-Mor--match-allflag)shuffle playlist with the-sor `--shuffle option (shuffle once, shuffle everytime the playlist repeats, or shuffle everytime the playlist repeats except the first)play songs in reverse order with the-Ror--reverseflagloop playlist with the-Lor--loopflagshow an audio visualization with the-Vor--visualizeflagworks with headphone buttons (and the Touch Bar and Siri!) on Mac using the Now Playing Center!works with Discord status! (pass the-Dor--discordflag)While playing:like a song and want to play it on loop? clicklwhile playing to replay it once, and click it one more time to replay it infinitely (click it a third time to stop replaying it)seek with left/right arrow keysvolume up/down with[and]remove selected song (not necessarily the currently playing song) from current playlist withbackspace/deletescroll with mouse or up/down arrow keys to scroll the selected songcto toggle clip modevto toggle visualization modedto toggle Discord statusmto muterto replay a songato add a song by ID to the end of the playlistito insert a song by ID after the currently playing songborpto go back to the previous songsornto go to the next songspace to pause/playeto end after the current songqto end immediately (don't just close the window orCTRL-c, this messes up the accuracy of the listen time statistics)maestro pushPush a song to the top (or bottom) of your song list. Useful, for example, if you usually play the most recently added songs first (maestro play -R)—you can usemaestro pushto push a song to the top of your list so it's the first song to play.maestro recommend(experimental)Recommend songs similar to a song title (specified directly or by ID) using YouTube Music. Equivalent to searching for the title of the song on YouTube Music, clicking on the first "Song" result, and then looking at the "Up Next" section.maestro removeRemove a song (or tag).maestro renameRename a song (or tag).maestro searchSearch for songs (or tags) by name.maestro tagAdd tags to a song, e.g.maestro tag -t harry-styles 87(adds the tag 'harry-styles' to the song with ID 87).maestro unclipRemove a clip from a song, e.g.maestro unclip 87(removes the clip from the song with ID 87).maestro untagRemove tags from a song, e.g.maestro untag -t harry-styles 87(removes the tag 'harry-styles' from the song with ID 87).ThanksBig thanks to the creators ofjust_playback, no doubt the best Python module for playing sound!