Skip to main content

background-music

Schedule music to play in the background. Cron for music.

Detects changes to the config file immeidately. Plays music with pygame. AI-generated and unreviewed - but I use it.

Motivation

Plan the music you want to play ahead of time so you actually listen to it. Idem vs ipse vs attention.

I don't like having to mess with my phone to play music because it a distraction machine. An alternative to algorithms.

I have this running on a raspberry pi 2 with a usb a dongle.

Alternatives and prior work

There is a tool called musicron focused on playing projects. I could not find the home page. cmus is a command line tool which has a playlist and a remote contro.

You could use spotify and just play music with algorithms or use your phone.

Installation

pipx install background-music

Usage

Write config ike so

9-10 file.wav
10-11 random:file2.wav,file3.wav
11-13 paylist.txt # work through the playlist
13-14 random:playlist.txt

Mon 18:30-18:40  monday.wav
Tue 18:30-18:40  tuesday.wav
Wed,Thu 18:30-18:40  mid-week.wav

Then run: bgmus config

continuing - keep on playing through a playlist or direction between different sessions continuing+random - keep on playing through a playlist then randomize until the session ends.

<<<<<<< HEAD

Remote control

It can be convenient to pause playback for a period of time, for example when taking a phone call. Or play another song. For these use cases a remote control is applied.

bgmus play song.wav plays a song bgmus pause 1h stops playing for an hour. I deliberately do not have an indefinite resume command bgmus resume resumes playing if there is a pause.

If you want to use and control multiple bgmus instances you can use --socket both on invocation and when using a remote control.

=======

origin/master

Hacking

I encouraage your to fork this and call it bgmusic-something. You can then tell me about this fork on github as a PR and I will loot your features :D and cite you.

About me

I make tools for reading and agency.

I also mess around with music and music technology and home automation in my spare time. If this sounds interesting you might like to check out r/musicaltreadmilldesk about my music desk.

Metadata

Release files for background-music 2.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for background-music 2.6.0
File Size Uploaded Provenance Actions
background_music-2.6.0.tar.gz 12.0 kB Without provenance Details for background_music-2.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for background-music 2.6.0
File Interpreter ABI Platform Actions
background_music-2.6.0-py3-none-any.whl Python 3 none any Details for background_music-2.6.0-py3-none-any.whl

Total release size: 23.2 kB

Release files / background_music-2.6.0.tar.gz

Download URL background_music-2.6.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c0b7abac404bd3fcb31ea43e4346420992e951595d1fd95809b019d4f88e345e
BLAKE2b-256 checksum
How to use checksums
ad47613d5230b6014a1570430b943c21164badabc3cb3d9aed77c87decf47836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / background_music-2.6.0-py3-none-any.whl

Download URL background_music-2.6.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52f31a6f1d2c52f0a7fb85da62f44a962d7fe8bc75587f8e2d031c8865e7c05f
BLAKE2b-256 checksum
How to use checksums
af8f1a760372f54b1000af66343ac3eb03f06c6116ee556ceeb4c561ecf264d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for background-music 2.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page