Armstrong, who wrote the soundtrack score for Baz Luhrmann's Moulin Rouge!, is one of five Scots composers whom the Scottish Opera has commissioned to generate public interest in opera.
The librettos and scores must be completed by November, and the 15-minute works will be performed in Edinburgh and Glasgow in February 2008.
Scottish Opera is expected to invite at least one librettist and composer to extend their work into a full three-hour production, according to the Edinburgh newspaper The Scotsman.
Rankin, who is about to publish his final novel about Inspector Rebus, is reportedly not giving any hints as to what his opera will be about. The Times of London, however, says he can write about any subject he chooses. The paper quotes him as saying, "Having lived inside [Rebus's] head for six to nine months, I need to exorcise him, so I do other things: stories from a female point of view."
Alex Reedijk, general director of Scottish Opera, told The Times, "What we want isn't just a fine piece of music but something that makes the leap into being a fine piece of opera. As well as a strong narrative and characters that an audience can engage with, there ought to be a moment of theatre, a little frisson or surprise."