Machine elves (also known as fractal elves, self-transforming machine elves) is a term coined by the ethnobotanist, writer and philosopher Terence McKenna to describe the entities that he claims one becomes aware of after having taken tryptamine based psychedelic drugs, especially DMT.
There are numerous references of such encounters that could be found in many cultures ranging from shamanic traditions of Native Americans to indigenous Australians, to African tribes, to the modern day "Urban Shamanism" like Santeria and Vodou and the "new breed"- a term that Timothy Leary used to describe the rising generation of urban shamans, who would, he claimed, augment the spiritual awareness of the modern world.
There's a whole bunch of entities waiting on the other side, saying "How wonderful that you're here! You come so rarely! We're so delighted to see you!"
They're like jewelled self-dribbling basketballs and there are many of them and they come pounding toward you and they will stop in front of you and vibrate, but then they do a very disconcerting thing, which is they jump into your body and then they jump back out again and the whole thing is going on in a high-speed mode where you're being presented with thousands of details per second and you can't get a hold on [them ...] and these things are saying "Don't give in to astonishment", which is exactly what you want to do. You want to go nuts with how crazy this is, and they say "Don't do that. Pay attention to what we're doing".
What they're doing is making objects with their voices, singing structures into existence. They offer things to you, saying "Look at this! Look at this!" and as your attention goes towards these objects you realise that what you're being shown is impossible. It's not simply intricate, beautiful and hard to manufacture, it's impossible to make these things. The nearest analogy would be the Fabergé eggs, but these things are like the toys that are scattered around the nursery inside a U.F.O., celestial toys, and the toys themselves appear to be somehow alive and can sing other objects into existence, so what's happening is this proliferation of elf gifts, which are moving around singing, and they are saying "Do what we are doing" and they are very insistent, and they say "Do it! Do it! Do it!" and you feel like a bubble inside your body beginning to move up toward your mouth, and when it comes out it isn't sound, it's vision. You discover that you can pump "stuff" out of your mouth by singing, and they're urging you to do this. They say "That's it! That's it! Keep doing it!".
We're now at minute 4.5 [of the trip] and you speak in a kind of glossolalia. There is a spontaneous outpouring of syntax unaccompanied by what is normally called "meaning". After a minute or so of this the whole thing begins to collapse in on itself and they begin to physically move away from you. Usually their final shot is that they wave goodbye and say "Deja vu! Deja vu!".
James Kent has put forth a scientific and more "down-to-Earth" explanation for machine elves. It can be found here: Kent postulates that the DMT landscape is simply the disrupting or "editing" our processing of visual information and causing a chaotic interpretation of it inspired by hyperactive phosphene activity. The brain may fill in the blanks and since we all have an affinity for anthropomorphic things, a humanoid entity may appear out of all this chaos. Our "imaginal workplace" will take the center stage in brain activity, allowing internal data to be interpreted as external stimuli.
When reflecting upon his mescaline experiences Aldous Huxley suggested that there was something, which he called Mind at Large, which was filtered by the ordinary functioning of the human brain to produce ordinary experience. One may view the human body and the human nervous system as a cybernetic system for constructing a stable representation of a world of enduring objects which are able to interact in ways that we are familiar with from our ordinary experience. This is analogous to a computer's production of a stable video display -- for even a simple blinking cursor requires complicated coordination of underlying physical processes to make it happen. In a sense we are (or at least may be thought of as) biological computers whose typical output is the world of everyday reality (as we experience it). When our biocomputational processes are modified by strange chemicals we have the opportunity to view the reality underlying ordinary experience in an entirely new way.
The webcomic Overcompensating has referenced Machine Elves as being the secret to mastering all of reality. The Goats webcomic mentions that Machine Elves were created by God and are responsible for implementing the work of the Infinite Monkeys, because He was very drunk at the time.
The Machine Elves are mentioned in issue #2 of the comic book series The Invincible Iron Man by the character Sal, when talking about DMT and other psychedelic drugs: "You know something like sixty percent of people have the same hallucinations on DMT? Terence McKenne, rest his soul, called them 'self-transforming machine elves.' Little bouncing technological artifacts that spoke a basic machine code that, no matter what language, you could understand. He thought he'd accessed the afterlife. I think it's the operating system of the human body...perhaps we're supposed to hack them. Perhaps we're supposed to change our own bodies."