u/Dangerous-Section567

Yamaha MA-3/MA-5 FM chip (SMAF ringtones): emulated from scratch in C++, no ROM dump
▲ 397 r/EmuDev+1 crossposts

Yamaha MA-3/MA-5 FM chip (SMAF ringtones): emulated from scratch in C++, no ROM dump

the ma-3 / ma-5 (ymu762 / ymu765) is the fm chip yamaha put in tons of early-2000s phones: nokia, sharp, samsung, panasonic. same family as the opl/opn chips behind adlib and the genesis, just smaller. it plays smaf ringtones (.mmf), and millions of these files are still floating around.

no datasheet ever came out. nothing public about how the synth actually works. so this got built purely from listening to real files and comparing.

a few things that turned out to matter:

early phones and later ones use two different formats for the same kind of song, with a different note offset. the only public reference gets that offset wrong by two octaves. copy it and every early tune plays too high.

the chip locks in each note's sound the moment it starts. some files change a channel's sound a few ticks late, while the note's already playing. handle that wrong and the start of the song sounds out of tune.

vibrato and how notes fade in and out aren't optional extras. skip them and it plays the right notes but sounds flat and dead.

some files also hide their drum sounds in a separate part of the file. miss that and the drums just don't play.

tested against a few hundred real ringtones. apache-2.0, c++, no dependencies, already running in an existing music player: FXChainPlayer.

repo: https://github.com/akustikrausch/yamaha-smaf-player

u/Dangerous-Section567 — 2 days ago