Nerdspace: Amiga Mod Files auf dem Arduino abspielen
Ich habe die KateÂgoÂrie »NerdÂspace« leiÂder lanÂge arg verÂnachÂläsÂsigt und werÂde verÂsuÂchen, das mal etwas zu verÂbesÂsern. Erfolg nicht garanÂtiert. ;) Zur ErinÂneÂrung: unter NerdÂspace werÂden DinÂge einÂsorÂtiert, die unter »PhanÂtasÂtik« nicht ganz pasÂsen, aber trotzÂdem interÂesÂsant sind, beiÂspielsÂweiÂse aus den BereiÂchen RasPi oder ArduiÂno, 3D-Druck oder »Hacks«.
HeuÂte: AbspieÂlen von AmiÂga Mods auf einem ArduiÂno. FĂĽr die UneinÂgeÂweihÂten: »Mods« nennt der AmiÂgiaÂner MusikÂstĂĽÂcke fĂĽr die SoundÂchips von AmiÂgas. Um die hat sich eine rege Retro-SzeÂne entÂwiÂckelt und man finÂdet hauÂfenÂweiÂse davon auf einÂschläÂgiÂgen WebÂseiÂten (ein BeiÂspiel: »Sound o´da lunaÂtic«).
JarkÂko LemÂpiaÂiÂnen hat einen ArduiÂno so proÂgramÂmiert und erweiÂtert, dass er dieÂse AmiÂga-Mods abspieÂlen kann (man muss die dafĂĽr allerÂdings konÂverÂtieÂren):
This weekend proÂject: TurÂned my 8‑bit resisÂtor DAC on ArduiÂno Uno to an AmiÂga MOD playÂer. Uno is based on 8‑bit AVR chip (ATMega328, 32KB flash, 2KB RAM) runÂning at 16MHz. The playÂer plays 4‑channel MOD files @ 20KHz (mono).
The DAC is just 16 carefulÂly selÂecÂted resisÂtors (2 resisÂtors in parÂalÂlel for each bit/​pin) with power-of-two resisÂtance values (startÂing at ~81.7Ohm for MSB). I had bunch of resisÂtors (~150) with difÂfeÂrent resisÂtances available, so I meaÂsuÂred them all with a mulÂtiÂmeÂter and wroÂte an appliÂcaÂtiÂon that found the best pair of resisÂtors for each pin. The accuÂraÂcy of the resisÂtors is important parÂtiÂcuÂlarÂly for higÂher bits for betÂter audio quaÂliÂty becauÂse only ~1% error in MSB makes LSB useÂlÂess and introÂduÂces noiÂse to the sound. I should have proÂbaÂbÂly used a bit higÂher resisÂtance for the MSB for betÂter quaÂliÂty (less error in the resisÂtance). Adding ~1mF capaÂciÂtor to low-pass filÂter the signal would proÂbaÂbÂly also improÂve the quaÂliÂty, but I didÂn’t have such a capaÂciÂtor available.
I wroÂte a MOD conÂverÂter softÂware which takes a MOD file as input and conÂverts and packs the music patÂtern data for the ArduiÂno playÂer to make it fit into the 32KB of flash memoÂry of Uno (incluÂding the playÂer code, which is currÂentÂly ~3.5KB). The chipÂtuÂne in the video is »Net SurÂfer« by JosSs, and it is ~13KB comÂpresÂsed. I don’t comÂpress the samÂple data, so it’s just raw 8‑bit PCM data like in MOD files.
WeiÂteÂre InforÂmaÂtioÂnen finÂdet man auf der GitÂhub-SeiÂte zu seiÂnem ProÂjekt.