Metadata-Version: 2.4
Name: duskfm
Version: 0.5.0
Summary: Endless, never-repeating music from lo-fi to synthwave, synthesized on the spot: no samples, nothing recorded.
Keywords: lofi,lo-fi,synthwave,chillwave,generative,music,focus,ambient,synthesizer
Author: Frank Lynam
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Multimedia :: Sound/Audio :: Sound Synthesis
Classifier: Topic :: Multimedia :: Sound/Audio :: Players
License-File: LICENSE
Requires-Dist: numpy>=1.22
Requires-Dist: scipy>=1.8
Requires-Dist: sounddevice>=0.4 ; extra == "sounddevice"
Project-URL: Homepage, https://github.com/frank-lynam/duskfm
Project-URL: Issues, https://github.com/frank-lynam/duskfm/issues
Provides-Extra: sounddevice

# duskfm

Endless music from lo-fi to synthwave, made on the spot: never the same twice, all day long.

Every sound is synthesized as it plays, mostly built from its overtones the way the real instrument sounds (no
tremolos, no sweeps on every note): a felt piano (the core of the lo-fi end), a mellow organ, a plucked-string guitar (fingerpicked or strummed),
a kalimba, a vibraphone, a glassy bell, a soft choir "ooh", pads, a polysynth, arpeggios, a synth lead, a fingered electric bass,
a drum kit made of sweeps and noise, tape wobble, vinyl dust and rain.

Each section draws its own band from where the style dial is: a lead for the tune (never the same two sections
running), something to play the chords, sometimes voices or an arpeggio. The weather and the record drift on their own
too: a rainy stretch comes and goes, the dust thickens and clears. The status line names who's playing. No samples and nothing recorded, so the package is a few files of Python.

```bash
pip install duskfm
duskfm                    # lo-fi
duskfm synthwave          # or: lofi, chillhop, chillwave, synthwave, nightdrive, ambient
```

## One dial from lo-fi to synthwave

`--style` runs from 0 (lo-fi) to 1 (synthwave), and everything blends along it:

| | lo-fi (0) | chillwave (0.5) | synthwave (1) |
|---|---|---|---|
| tempo | 72–84, swung | ~85–97 | 94–110, straight |
| harmony | jazzy 7ths and 9ths (ii–V–I) | dreamy maj9 and sus | minor: i–VI–III–VII |
| keys | felt piano, organ | felt piano, pads, a glassy bell | polysynth, arpeggios, a lead |
| drums | dusty boom-bap, lazy | soft kick, rim, shaker | punchy, 80s gated snare |
| texture | crackle, tape wobble, dark | haze, chorus | bright, wide, big reverb |
| band | felt piano, organ, guitar, kalimba | vibes, bell, guitar, voices | polysynth, arps, synth lead, electric guitar |

`--energy` runs from 0 (ambient: no drums, sparse) to 1 (driving). `--drift` lets both wander slowly on their own,
so a long session moves through moods. The presets are points on the two dials (`duskfm --help` lists them).

It composes as it goes, and changes gently: chord progressions voiced smoothly from one to the next, tempo
gliding rather than jumping, key changes to a near key led into by the bar before, newcomers fading in, melodies grown from short motifs and
varied each time, sections that thin out and build back, a new key and tempo every few minutes. `--seed` replays
a session you liked (the seed is shown when you quit).

## While it plays

| key | |
|---|---|
| ← → | style: toward lo-fi, toward synthwave |
| ↑ ↓ | energy |
| + − | volume |
| ] [ | boost (3 dB a press) |
| r | rain: off, light, heavy |
| d | drift on or off |
| n | on to the next section |
| 1–6 | the presets |
| space | pause |
| q | quit (it fades out) |

## Loud enough to drown out the room

- `--volume` (0–100) is the ordinary level.
- `--boost DB` (up to 18) is the maximizer behind it: the music is compressed and driven into a soft limiter, so it
  gets much louder without ever clipping. Your speakers' own limit still applies; this gets more out of it.
- `--rain` adds a soft rain bed shaped to the frequencies speech lives in. Lo-fi is mellow and dark, which is
  lovely and also poor at covering voices; a little rain covers chatter better than a lot more volume, and spares
  your ears. A whole day at high volume is hard on hearing: reach for the rain first.

## Playing it

On Linux it plays through `paplay` (PulseAudio, or PipeWire's pulse layer), `pw-cat` or `aplay`, whichever is
there: nothing else to install. Over remote desktop (xrdp), sound comes through when the session has xrdp's
PulseAudio or PipeWire module; if `paplay` works there, duskfm does. Elsewhere, `pip install "duskfm[sounddevice]"`
uses PortAudio.

No sound where you are? Make a file and play it anywhere:

```bash
duskfm chillwave --render 3h -o afternoon.wav
```

`--minutes 90` plays for a while and then fades out.

## Development

`python3 tests/test_duskfm.py`: every preset renders clean audio at a steady level, a seed replays exactly, nothing
loops, boost gets louder without clipping, and the player and command line work (no sound card needed). A GitHub
release `vX.Y.Z` matching `__version__` publishes to PyPI.

