Last week, Jamie xx was providing the soundtrack to a gloriously orange-hued sunset over Worthy Farm, transforming even the most minimal of tracks from his debut album In Colour into thumping dancefloor bangers for the thousands gathered at The Park Stage. Less than a week later, he's sat two rows in front of me at Manchester Opera House ready to see two years hard work on a project quite far removed from the fields of Glastonbury come to fruition.

The Manchester International Festival has become renowned for its canny collaborations under the guidance of Alex Poots, who steps down as festival director after this year's event. 2013's festival, for example, saw an unusual meeting of minds in the form of a collaborative performance between Massive Attack and the Bafta-winning filmmaker Adam Curtis.

It's no surprise then that, for this year's festival, Poots has brought together an unlikely cast of characters including choreographer Wayne McGregor, visual artist Olafur Eliasson and Jamie xx to produce a ballet based around Jonathan Safran Foer's Tree of Codes.

Trying to interpret Foer's Tree of Codes across all three mediums (dance, music and art) is no mean feat. The book is a distillation of Polish avant-garde writer Bruno Schulz's 1934 short story collection The Street of Crocodiles, a story literally carved from the pages of Schulz's book by physically cutting out words and phrases to create something entirely new; part novella, part art piece.

As such, Tree of Codes uses Foer's book as more of a jumping off point to create a multi-layered kaleidoscopic world entirely their own, much as Foer did with Schulz's book, than the source of a straight adaptation. I'm reminded, in that sense, of Continuum, a project for Record Store Day 2015 that saw Jamie xx among others (Koreless, John Talabot and Four Tet) taking a short, performative silent film and creating an original score based on how they interpreted the film.

From Tree of Codes' opening, set in complete darkness with the dancers from Paris Opera Ballet and Company Wayne McGregor invisible but for a set of lights attached to their costume giving the sense of fireflies dancing at night or constellations shifting and changing in space, the 75 minute performance is otherworldly.

Most of this dreamlike mood is the work of Eliasson. As an artist, he's always been one to play around with space and our perceptions of it and the world around us. His Tate Modern installation, The Weather Project, cleverly used a variety of mirrors, all slightly offset, to turn a semi-circle of light into a floating Sun. Similarly, Riverbed transformed an entire wing of Denmark's Louisiana Museum of Modern Art into a rocky grey river, bringing the outside in.

Eliasson has utilised many of these techniques and ideas here to play with our perceptions of what is happening on stage. One spectacular sequence has dancers performing in front of a series of mirrors and distorting screens that give the illusion of pairs of shadows dancing alongside one another. It's a fitting visual metaphor for Foer's book, itself a distorted shadow of The Street of Crocodiles. Another sequence cleverly plays with our perceptions of what is really going on, using a window that gives the effect of anaglyph 3D glasses which slowly spins to reveal the truth of the colours and movements behind.

The cast of 15 move against this ever distorting backdrop with such skill and precision, tirelessly lifting with grace while also twitching with an animalistic ferocity. It's what you would naturally expect from a cast made up of two world-class companies. The only problem is that it all gets a little bit repetitive. Whilst technically impressive throughout, the dancers never faltering, there does reach a point where we've seen it before. The choreography often seems about to fully leap off the ground (both literally and figuratively) but never quite reaches those heights; unusual for a ballet inspired by a book that is all about flights of imagination.

Where Tree of Codes really shines, though, is in Jamie xx's score. Tree of Codes is perhaps the only ballet you'll ever go to where you'll see people bobbing their heads as though at a DJ set. The freedom here, as with Continuum, allows Jamie xx to really play around and just try anything and everything.

One minute, you'll find yourself watching a soloist dancing to a cinematic Ludovico Einaudi-style sombre piano piece, the next the stage will be filled with bodies writhing to skittering jazz rhythms or fiery garage beats. It feels like he finally has a chance to express all of his influences and just have a bit of fun with the creative freedom gifted to him. In Colour saw hints of that, but it's here, surprisingly, where it really shows. There's no word yet as to whether the score is being released, but I'll be buying it in an instant when it does.

Eliasson summed it up nicely when the performance was announced by saying, "Clearly Jamie's music can't live without movement and space. Clearly Wayne's choreography can't live without sound and space. Clearly my art can't live without sound and movement. Clearly creativity can change the world." It's a collaboration that, on the surface, seems an odd one but when you think about it and then finally witness it in action, it all seems to fit into place. It's not perfect but it is an exciting, magical and enthralling piece of work that dazzles more often than not. One well deserving of its standing ovation, especially for Jamie xx's score.