The book I'm thinking of is set after the apocalypse has been caused by all technology suddenly stopping working and magic suddenly starting. The main character successfully experiments with magic and figures out how to work the stasis spell to keep spells in a can and eventually to program spells with prearranged spell-bits. There's a scene where a MP3 player is found in an area where science has been made to work. Can anyone help me find the name of this story?
This is Elegy Beach by Steven Boyett. It is a sequel to Arial by the same author, which was the book where science ceased to work and magic came into the world.
From the book's website:
Despite his father's objections Fred is working to discover the underlying order to the principles by which the world now works. Fred and his friend Yan Ramchandani experiment to learn the laws of magic—to become the New Scientists.
From a Boing-Boing review:
More specifically, Yan and Fred yearn to create "macros" for magic, software-like constructs that allow non-casters to make use of spells that have been bottled by a new kind of spell. These bottled enchantments could become a kind of renewable resource, a kind of technology.
Yan and Fred's partnership dissolves when it becomes apparent that Yan craves power for its own sake, and betrays Fred's trust. Enter Ariel, Pete's unicorn familiar who has not seen Pete in 25 years, and once again Pete is on the road, this time with Fred and Yan's father, the four of them set on stopping Yan before he unmakes the world.
There are plans for a third book, Avatar Burning, but Boyett has put it on hold while completing other books.