Skip to main content

Fun Jingles & Sound Design (fun-jingles.js)

Since 2026-08-11 the station can generate singing karaoke jingles and a 24-design sound-effects library from pure synthesis. fun-jingles.js is self-contained (requires only paths.js + imaging-engine).

1. Karaoke jingles (generateKaraokeJingle)

An Arabic "karaoke song" built from a TTS station phrase (ar-EG-SalmaNeural, rate +12%):

spoken hook → pitch-layered sung harmony stack (semis 0 / +3 / +5 / −2,
staggered by beat via pitchShift)
+ synthesized groove (makeBeatLoop: kick/hat/bass from aevalsrc)
+ riser intro + sub impact
→ amix → compressor → limiter → two-pass R128
  • Outputs media/jingles/JKL_<ts>_<bpm>.mp3 (~7.3–7.4 s, Break-tagged).
  • count now loops with bpm + 6/i so each run produces distinct files (e.g. 112 / 118 / 124 BPM).

2. Sound design FX (generateSoundDesign)

A 24-design library (SOUND_DESIGNS) into media/sfx/SFX_<NAME>_<n>.mp3: DEEP_BOOM, TOM, VINYL_SCRATCH, PHONE_RING, STATIC_BURST, AIR_HORN, RISER_LONG, BRIDGE, DOWNFALL, ALERT, SOFT_BEEP, GLITCH_STUTTER, HEARTBEAT, IMPACT_BIG, SIGNAL, BEAT_DROP, REVERSE_BOOM + more. On regenerate the old SFX_ files are archived to sounddesign_old_<ts>.

Critical ffmpeg gotchas (hard-learned)

  1. < breaks aevalsrc — this ffmpeg build rejects < inside aevalsrc expressions (silent Invalid argument, no useful log → designs just vanished). Use lt(a,b) everywhere.
  2. Ternary ?: also rejected — use if(...) instead.
    • Real bugs hit: makeBeatLoop kick/hat used < (beat synth failed) and VINYL_SCRATCH used both < and ?:.
  3. amix input count must match labeled inputs — the karaoke amix was declared inputs=5+layers but only 4+layers streams were labeled (riser/impact/beat/hook = 4) → Cannot find a matching stream for unlabeled input pad amix. Now uses the actual stream count.

CLI

node scripts/run-fun-jingles.js [--text "لوك لوك إف إم"] [--bpm 112] [--jingles N] [--fx N] [--no-archive]

Runs standalone (mirrors run-imaging.js); the karaoke jingles land in the jingles deck and sound designs in the sfx deck, both immediately schedulable.

Deployed live 2026-08-11: 3 karaoke jingles (112/118/124 BPM) + 24/24 sound designs → jingles deck 8, sfx deck 36.

See also