cimp plays audio files and M3U playlists from the command line with one running instance, controlled from anywhere else you open a shell.
cimp is an audio player written in QuickBASIC (QB64) with a small C helper for keyboard input and IPC. It draws a minimal two-line display: what's playing, and a progress bar underneath. Everything else happens through the keyboard or through a second terminal talking to the first.
I, one day in the past wanted to play a midi file on my linux machine, I couldn't without installing a player, none of the ones that came with the system could play a midi file.
I didn't want an editor, just a simple player, I could get a plugin for VLC, it didn't work very well. Then I remembered I can just make my own, and so I did. Here it is.
As the writing of code went along I thought to myself: "self, why only midi?, why not add more?", and to this day more has been added multiple times.
Download a prebuild binary or compile with QB64PE. stuff it where you keep your other binaries.
cimp [options] <file|playlist> [file2 ...]
One or more audio files or .m3u playlists - at least one is required to start a player.
| flag | does |
|---|---|
| -v, --volume <n> | Set initial volume, 0-100 (default 100) |
| -s, --shuffle | Shuffle the playlist on start |
| -r, --repeat [1] | Repeat all, or repeat one with -r 1 |
| -n, --nooutput | Run silently, with no display |
| -b, --soundbank <file> | Use a custom soundbank |
While cimp is already playing, running it again with any of these arguments sends an instruction to that running instance instead of opening a second player.
| command | does |
|---|---|
| --play / --pause / --stop | Control playback state |
| --next / --prev | Skip forward or back a track |
| --volume <n> | Adjust volume remotely, 0–100 |
| --shuffle | Reshuffle the current queue |
| --repeat / --repeat-1 | Repeat all, or repeat the current track |
| --add <file> | Append a file or playlist to the active queue |
| --playlist | Print the current queue back from the server |
| --soundbank <file> | Swap the soundbank used for MIDI files |
| --quit | Close the running player |
# from a second terminal
cimp --pause
cimp --volume 20
cimp --add extra_track.flac
| ↑ / ↓ | Volume up / down |
| ← / → | Seek 5s back / forward |
| space / c | Pause / resume |
| b | Next track |
| z | Previous track, or restart if past 2s |
| x | Restart current track |
| v | Stop playback |
| s | Reshuffle playlist |
| t | Toggle elapsed / remaining time |
| q / esc | Quit |
Decoding goes through QB64PE, so anything the compiler supports, cimp supports.
audio
soundbanks