Member-only story
Python Radio 4: Sending Music
Or at least ringtones…
In the previous project:
we used the PWM feature of the ESP8266 to send a 1,000 Hertz tone over the air to form the dots and dashes of Morse code.
That was as high a frequency as our little ESP8266 can manage with the PWM feature (unlike its big brother, the ESP32 which can manage up to 40 megahertz).
But we can send tones of a lower pitch if we like. This allows us to play the kind of music we used to hear on early computer games and phones.
There is a format that phones used to use for storing their ringtones. It is called the Ring Tone Text Transfer Language, or RTTTL. Dave Hylands wrote a parser for this language for MicroPython, which you can see here.
Ringtones contain notes that are higher than 1,000 Hertz, but we can shift them two octaves down easily by dividing the frequency by 4. The program to send them over the air using the same simple FS1000A and XY-MK-5V circuits that we used when sending Morse looks like this:
from rtttl import RTTTL
from…

![[1991] I tried using a shortwave radio again after 30 years. I wasn’t expecting this …](https://miro.medium.com/v2/resize:fit:1358/format:webp/1*jN-w1o1fNujm8t0UognI9A.jpeg)






