Generated music: battle_music and moonlight_metal

sfx.music holds looping background music pieces, made from code like the
sound effects. There are two so far, both for distorted guitars, bass and
drums:

- battle_music: original heavy metal in D minor in the manner of Bach's
  D minor harpsichord concerto. A unison opening riff, arpeggios through
  a circle of fifths, a gallop over a held A, then the riff again. It
  loops every 24 seconds at 160 beats a minute.
- moonlight_metal: Beethoven's Moonlight Sonata sped up and made heavy,
  in C sharp minor. The sonata's triplet arpeggios and opening chords,
  with a new lead melody, a triplet gallop and double kick. It loops
  every 27 seconds at 140 beats a minute.

Each piece is its own module in sfx/music/pieces, named after its
function, and is loaded the first time a game asks for it. A game only
loads the pieces it plays, and a piece is added by adding its module,
with nothing to register. The instruments the pieces share are in
sfx/music/instruments.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Storm DragonandClaude Opus 5.5 committed 2026-11-28 20:33:35 -05:00
1 parent 00db02b236
commit d598818fb1
11 files changed
+581 -2

No files matched your search

+1
View File
@@ -28,6 +28,7 @@ The modules:
- ambience: loops such as bubbling, dripping and repeating patterns.
- alerts: live voices for warnings, falling screams, whistles and chattering.
- movement: a jump.
- music: looping background music pieces, each loaded only when a game asks for it.
Generated sounds need numpy and scipy. Nothing else in libstormgames imports
this package, so a game that does not use it does not need scipy.