# Nokia Composer
Remember punching in ringtones on a Nokia 3310? One note at a time, staring at that tiny green screen, trying to get the Star Wars theme right before the bus arrived?
This project brings that back - a Nokia Composer ringtone player running on an ATtiny85 with a 128x64 OLED and a piezo buzzer. Two buttons, seven tunes, and the same square-wave sound that defined an era of mobile phones.
## What it does
Press a button to pick a tune. Press the other to play it. The OLED shows the tune name while you browse and the current note during playback, along with a pitch bar and scrolling note history.
The tunes are stored as Nokia Composer notation strings - the same format people used to share ringtones via SMS in the late 90s:
```
16e2 16d2 8#f 8#g 16#c2 16b 8d 8e 16b 16a 8#c 8e 2a 2-
```
That's the Nokia Tune. If you recognize it from the notation alone, you probably also had a Snake high score worth bragging about.
## Tunes included
| # | Tune | BPM |
|---|------|-----|
| 1 | Nokia Tune | 120 |
| 2 | Harry Potter | 125 |
| 3 | Imperial March | 112 |
| 4 | Mission Impossible | 100 |
| 5 | Nacht | 125 |
| 6 | Star Wars | 100 |
| 7 | Airtel | 140 |
Adding your own is straightforward - drop a PROGMEM string in Nokia notation and set the BPM.
## Hardware
- ATtiny85 microcontroller
- SSD1306 128x64 OLED (I2C, address 0x3C)
- Piezo buzzer
- Two pushbuttons (active-low with internal pull-ups)
### Wiring
| ATtiny85 | Connected to |
|----------|-------------|
| PB0 | OLED SDA |
| PB2 | OLED SCL |
| PB4 | Buzzer |
| PB1 | "Next" button (to GND) |
| PB3 | "Play" button (to GND) |
## How it works
The sketch parses Nokia notation on the fly from PROGMEM - no intermediate data structures, no RAM copies. Each note token gets decoded into a frequency (from a 12-entry chromatic table with octave bit-shifting) and a duration (calculated from BPM). The buzzer toggles at the target frequency using direct port manipulation, matching the square wave output of the original Nokia handsets.
Timing follows the original Nokia Composer implementation: 70% tone, 30% silence per note. That gap between notes is what gives Nokia ringtones their staccato character. Display updates happen during the silent portion so they don't mess with the rhythm.
The whole thing fits in about 59% of the ATtiny85's 8 KB flash, with 21% RAM usage. There's room for plenty more tunes.
## Built with
[ssd1306xled](https://tejashwikalptaru.github.io/ssd1306xled/) - a lightweight OLED driver for ATtiny85 and other memory-constrained AVR microcontrollers. Custom I2C bit-banging, no framebuffer, no Wire library dependency.
## Author
[Tejashwi Kalp Taru](https://tejashwi.io)