AWS Builder Center
 Weekend Creative Agent Challenge: Nocturne FM

Weekend Creative Agent Challenge: Nocturne FM

An autonomous radio station on AWS. Every two hours EventBridge wakes a Lambda that writes a show, composes a score, narrates it with Polly and synthesizes the music sample-by-sample in pure Python — no FFmpeg, no NumPy. There is no Generate button. It broadcasts whether anyone is listening or not.

Last week's challenge was a creative app you open. This week the brief flipped: the best tool is the one you never have to open. So I stopped building things that wait for a prompt and built a radio station instead.
Nocturne FM broadcasts to nobody. Every few hours Amazon EventBridge wakes a Lambda that writes a short show, composes a piece of music to go underneath it, has Amazon Polly read the script aloud in a generative voice, synthesizes the music sample-by-sample in pure Python, mixes the two so the band ducks under the presenter, and publishes a finished WAV to Amazon S3. By the time you visit the site, there is an episode waiting that nobody asked for. There is no Generate button. There is nothing to click except Play.

Vision and what it does

Almost every creative agent I saw this weekend produces something you read. I wanted something you listen to, because audio is the one creative output that genuinely cannot be skimmed — you have to give it the time it takes, which is a strange and good thing to ask of an audience at 3 a.m.
Each episode runs to the same order, and that repetition is the point. A station is a format, not a stream of outputs:
  • Station ident — one line, never the same twice
  • The sky report — the real current weather over Karachi, turned into mood rather than forecast
  • The main piece — 110 to 150 words, rotating through vignette, letter to a stranger, field note, and late-night monologue
  • The request line — answers one word a listener pinned to the board
  • Sign-off — closes the hour and hints at the next
The request board is the part I care most about. Visitors can pin a single word —  monsoon ,  quay ,  overtime  — and it sits in DynamoDB until the next scheduled broadcast claims it. Your word does not trigger anything. You cannot make the station talk to you. It will get to you when it next goes on air, and that asymmetry is the whole idea: remix happens on the agent's clock, not the human's.
The station also has a memory. Every episode ends by writing a one-sentence note of self-criticism aimed at its next shift, and that note is fed back into the next prompt as something it is expected to have acted on. Amazon Comprehend then reads the sentiment of the station's own writing and stores the grade.
You can watch this work in the live archive, which is the part I did not expect. Episode 3 signed off with "next time, use more specific local street names and sharpen the concrete nouns" — and episode 4 came back titled Neon on the Lyari. Episode 4 then asked itself for "a single sustained interaction" instead of scene-setting, and episode 5 is two men sharing an orange at a dock gate:
A night watchman sits on a folded wooden crate beside the dock gate. His thermos sits between his boots, breathing a thin ribbon of steam into the dark. I sit on the curb three paces away and offer him an orange. He takes it without a word. He pulls a small pocketknife from his vest and peels the skin in one unbroken spiral. The citrus oil sprays into the muggy air, sharp and sudden like lightning in a closed room.
Nobody asked for that. It is on the site because a clock went off.

How I built it

Three decisions shaped the weekend, and one disaster.
The model does not make the audio — it writes a score. This is the part I am happiest with. Asking a model for music or for an image is slow, expensive and hard to keep free. Instead, one request returns both the spoken script and a small JSON score:
{"key":"G","mode":"aeolian","bpm":66,"progression":["i","VII","VI","VII"],
"texture":{"pad":"warm","percussion":"brush"},
"tape":{"hiss":0.34,"drive":0.28,"swell":0.55},"rain":0.22}
 music.py  then plays that score using nothing but  math ,  array  and  random : detuned pad swells built from a wavetable, a saturated sine bass, an inharmonic bell lead running through a dotted-eighth delay, brushed-noise percussion, a one-pole lowpass, tape flutter and soft-clip saturation. Because the words and the chords come from the same request, a rainy episode gets rainy harmony instead of a random loop stapled underneath.
It also means the entire project has zero third-party dependencies. No numpy, no ffmpeg, no sample packs. The deploy is a 27 KB zip — no SAM CLI, no Docker, no layers.
The sample rate was decided for me. Polly's generative engine only emits PCM at 8 kHz or 16 kHz, and everything in the episode has to share one rate. So the whole station is 16 kHz mono. Rather than fight the high-end rolloff, I tuned the band for it — which is why it sounds like an AM signal at 2 a.m. instead of a compromise.
Two Lambdas, not one. A heavy producer (1769 MB, 300 s) that only EventBridge can reach, and a light desk (256 MB) behind a Function URL. The public function can queue a request word but has no code path to start a broadcast. If the UI could generate on demand, nobody could tell whether the schedule was real.
And then Bedrock said no. I designed all of this around Amazon Bedrock Nova, wrote the  converse  call, and got:
ValidationException: Error 002: Access to Bedrock models is not allowed for this account
Every model. Every region. It is not IAM — the caller has AdministratorAccess — and it is not model access; it is an automated hold that AWS places on new accounts with little billing history, and only a support case lifts it. I lost an hour confirming that before I accepted it.
The fix was architectural rather than a workaround. The writer became a pluggable interface with three providers behind one function: Bedrock (still written, still there, one parameter away), an external API as the bridge, and an offline seeded writer. If every provider is dark, the station still goes to air on the offline writer, because an agent that throws at 3 a.m. is not an agent. That failure ended up making the design better than my original plan, in which a single  ValidationException  would have meant silence.
The smaller scars were the usual ones. Function URLs cap responses at 6 MB, so audio had to go to S3 rather than through the function. DynamoDB rejects Python floats, so the score and the waveform peaks are round-tripped through  Decimal . My first mix had the band louder than the presenter, which I only caught by measuring per-second RMS rather than trusting my ears at 2 a.m. on a laptop speaker.
The best bug was one the schedule would never have found. While seeding the archive I fired several broadcasts back to back, and got two episode threes. The episode number was a read-modify-write — read the counter, add one, write it back — which is perfectly safe when your broadcasts are two hours apart and completely wrong when two runs overlap. It became a DynamoDB atomic counter:
resp = table.update_item(
Key={"pk": STATE_PK, "sk": STATE_SK},
UpdateExpression="ADD seq :one",
ExpressionAttributeValues={":one": 1},
ReturnValues="UPDATED_NEW",
)
That also forced  put_state  to become an  UpdateItem  with  SET , because a  PutItem  would have cheerfully overwritten the counter it had just allocated.

AWS services used and architecture overview

EventBridge (rate) --> BroadcastFunction (Lambda, python3.12, arm64)
|-- Open-Meteo ......... weather, no API key
|-- DynamoDB ........... oldest request + last self-critique
|-- LLM ................ script + musical score as JSON
|-- music.py ........... score -> 16 kHz music bed
|-- Amazon Polly ....... generative voice -> PCM
|-- audio.py ........... envelope follower, duck, mix, WAV
|-- Amazon Comprehend .. grades its own writing
|-- Amazon S3 .......... publishes the episode
'-- DynamoDB ........... archive + note to its next shift
Listener --> Function URL --> StationFunction (Lambda) --> DynamoDB
Service
Role
Amazon EventBridge
The only thing that can put the station on air
AWS Lambda
Producer (heavy) and station desk (light)
Amazon Polly
Generative-engine voice, PCM at 16 kHz
Amazon Comprehend
Sentiment grade on the station's own writing
Amazon DynamoDB
Station state, episode archive, request board with 30-day TTL
Amazon S3
Public episode audio
Lambda Function URL
The desk, with no API Gateway
AWS CloudFormation
The whole stack via the SAM transform, deployed with the plain AWS CLI
Amazon CloudWatch
Proof the schedule fired with nobody watching
AWS IAM
Least privilege, scoped per function

What I learned

Always-on is a product decision, not an infrastructure checkbox. The moment I removed every way for a visitor to trigger a show, the design got clearer and the site got calmer. Hiding the trigger is what turns a generator into a station.
Constraints improved the art. Losing image models cost me nothing, and losing Bedrock forced a pluggable writer with real graceful degradation. Being pinned to 16 kHz gave the whole thing a voice. Every limitation this weekend pushed the work somewhere better than my first idea.
Ask a model for parameters, not for pixels. A model that emits a score instead of audio is faster, cheaper, deterministic enough to debug, and produces something that is genuinely mine rather than something the model already knew how to make.
Measure the mix. A twenty-line RMS profile told me immediately that my presenter was buried under her own band. I would never have heard it in time.
An autonomous agent needs retries more than a chatbot does. When a user gets a 503 they press the button again. Nobody is there to press anything at 3 a.m., so the one Gemini  503: high demand  I hit went straight to air as a fallback episode. Four attempts with backoff, and the offline writer underneath that, is the difference between a station and a cron job that sometimes works.

Link to app and repo

To check it is really always-on: note the episode number, leave a word on the request board, then come back after the next scheduled broadcast. There will be a new episode, and it will have answered your word without you ever pressing anything. Each episode is tagged with what woke it —  seed  for the handful I fired by hand to fill the archive before publishing,  eventbridge  for every one the station has made on its own since.
Nocturne FM keeps broadcasting after I submit this. That is the habit I wanted from the challenge — ship something that carries on when you walk away.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article