"When things are calm an artist should be a bloody nuisance, and when things are difficult an artist should be a rock." Composer and Reid Professor Nigel Osborne is emphatic.

In the establishment, but not of it, you might say.

I'm at Edinburgh University to interview Scotland's most eminent music professor about his retirement this summer from the prestigious Reid Chair of Music, after 22 years at the heart of this venerable institution. But the meeting takes place over a glass of wine near to, rather than inside, his Music Department. As he puts it, "I'm bound to get trapped by something if anyone finds me in there."

A towering personality, with a hint of Byron about him, Osborne is a character who has been keeping the music establishment on its toes since his education in the radical circles of Warsaw in the late 1960s. Colourful anecdotes fall out in conversation with him quite incidentally; the time he conducted the Berlin Philharmonic inside a German prison, for example, or the time he ended up in bankruptcy court because he was working under siege in Sarajevo as a humanitarian volunteer. Other footnotes on him might include the fact he speaks at least eight languages, plays countless musical instruments, is a sophisticated neuroscientist and a technological inventor.

Professor of composition for now nearly a quarter of a century at Edinburgh, Osborne remains belligerent as a creative artist. At the moment he is working on his new opera Naciketa, which will premiere in Mumbai in 2013. "I've been rejected recently by a number of British opera houses for different projects," he explains firmly, "so now I can give them two fingers and say my next opera opens in Mumbai. Quote me, two fingers."

How, I ask, has an artist of such fiery integrity and political passion survived for 22 years in an environment of university rules, procedures and protocols?

Osborne agrees it is a fundamental contradiction which he has had to balance. "Real creative music is rock and roll; it's beyond any establishment. If it's doing its job properly it is very independent, very questioning, and touches its forlock to no-one. That's our role. Clearly there is a tension between that and being in a university."

It isn't very comfortable, he says, but it is necessary, and the pay-off is great. "And I think the universities would be in poor shape if they didn't have people trying to have a creative life within them."

But whatever his struggles, his legacy to the university is immense. Besides his composing, Osborne's pioneering work in the area of community music has put Edinburgh on the map as a world leader in this field, a position it retains under the direction of Dee Isaacs. When forced to add it up, he estimates he has probably worked with hundreds of thousands of people through community music. As bashful as he might be about it, that impact didn't go unnoticed, and he was awarded an MBE in 2003.

Former students such as Dr Katie Overy, of the Institute for Music in Human and Social Development, describe Osborne as an "inspirational and unforgettable" teacher. The IMHSD, which they founded together, is now at the forefront of research into neuroscience in music. In bringing science and interdisciplinary research into the music department, Overy points out that Osborne was characteristically "ahead of the times, never behind them".

When asked if he feels proud of these enormous legacies to the university, he is astonishingly modest. Some important things that he "had the privilege to move along at an early stage – they have already turned into other people's legacies, the best kind of legacy to have. That's other people's heritage now".

But he becomes animated with perceivable pride and excitement when conversation returns to composition at the university. He describes the department there as "a thoroughly creative milieu", where all kinds of work are welcome. "The whole world is there – from ex-punk rockers through to alga-rhythmic composition. People talk about ivory towers, but I think Simon Cowell is the ivory tower, and our department is the real world. Come along and see – the whole of musical life is there. I'm proud of that for sure. I know in years to come that what we have experienced in the past few years in Edinburgh will be regarded as something special."

As our interview concludes, he is still talking animatedly about great composers he brought to Edinburgh, the likes of Lutoslawski, Takemitsu, and Denisov. There's also a story about the time he premiered Messiaen's final work in Edinburgh's Botanic Gardens.

Unlike many illustrious contemporary composers, Osborne is a man who knows how to get things done, often pretty fast. He is no cliché of a dreamy otherworldy professor. His success working with children traumatised by war in Bosnia could hardly have materialised otherwise, he points out. Working in situations such as those he experienced in Sarajevo, "you have to be very real world". With limited time to repair a lot of damage, "rather than compromise or give up, you have to work fast".

That's a skill he has turned to the advantage of his Edinburgh students. Osborne has the clout and energy to organise a showcase for his composition students at Kings Place, in London, for example, and get it broadcast on BBC Radio 3, as he did recently. The value of such support to a young artist can't be measured.

No exaggeration then, to say that his retirement from the university leaves very big shoes to fill. Pragmatic to the last, Osborne has chosen to retire a year earlier than he could have, specifically because he feels at this point in time, "there is a very real chance of me being replaced". He doesn't want to talk down the university's financial prospects: it's in better shape than most, he says. But despite that, quite evidently he was concerned that if he waited any longer to retire, circumstances might have changed and funding priorities be altered.

So the eyes of the international musical establishment are turned on the university expectantly, to see that they deliver. At the moment, although Dr Raymond MacDonald, music psychologist, has been appointed to a new chair of music, the prestigious Reid Chair remains vacant.

Does Osborne sees himself as a nuisance or a rock, retiring while the going is still good for his department? I suspect his trick is to be both at the same time. Forcing the university to ensure his succession now is a typically generous gesture of solidarity to musicians of the future.