NO-ONE could remember the last time a living human soul had ventured there. Certainly, it's been closed off to the public for more than 100 years - though few of the tourists and residents trundling past on their way to the Castle would even be aware of its existence.
Staff at the next door Camera Obscura use the bottom two floors of the long-neglected Ragged School, but admit no-one goes up to the top two floors.
So when Edinburgh medium Ewan Irvine, of Scottish Paranormal, and his team carried out a recce of the building recently in preparation for an event at this month's annual Ghost Fest, they weren't quite sure what to expect. But on a bright Saturday afternoon, with the happy chatter of Castle visitors clearly audible from the street outside and sunshine streaming through the cobweb-covered windows, it became clear that they were more likely to uncover health and safety issues than ghostly encounters.
"It was a bit dusty but really it was quite clean. And it was a lovely sunny afternoon," says Ryan O'Neill, founder of Scottish Paranormal. "But once you got upstairs it was quite strange, quite eerie."
The discovery of a Victorian doll's pram on the top floor only added to the atmosphere. And it wasn't long before the three mediums among the team of nine began to pick up on some ghostly vibrations in the main classroom and the upstairs dormitory.
Ewan says: "I picked up on some of the characters. There was a lady in her 50s who was a nurse there, who went by the name of Eaddie Watkins and we picked up on how stressed she was. And I picked up on a minister who used to visit once a week, and felt a woman who had been seen in the building with a brown dress."
Fellow medium Fiona Williamson felt a spirit called Andrew, a young man who used to be a chimney sweep, while feelings of being locked in cupboards were also noted. The surnames of Turner, McDonald, Galbraith and the dates of 1826 and 1709 also came to the mediums. And then fellow medium Heather Taylor began to feel a "negative energy" that wanted the group to leave the school.
The information gathered is being researched by Scottish Paranormal historical researcher, Rachel Atkinson. The Ragged School's founder, the charismatic preacher Thomas Guthrie, is remembered as one of the city's most noble characters - his monument with one of the ragged boys beside him faces the Castle from Princes Street Gardens.
The Brechin lad was little more than a child when he first came to Edinburgh to study at the university. As a 12-year-old, in 1815, alone in the city, he would have brushed shoulders with many slum-dwellers as he set out from his lodgings on the fringes of the Old Town. In 1837, after studying in Paris and working at his ministry in Arbirlot, in Angus, Guthrie returned to the city and its slums, taking up a position at old Greyfriars and frequently preaching at the Magdalene Chapel in the Cowgate. In his autobiography he noted how his wealthy parishioners were often seated next to beggars. And after joining the Free Kirk of Scotland, he gave sermons at what was the Free St John's Church.
Being surrounded by so much poverty - the Old Town was notorious for its slums in those days - the committed Christian could hardly have failed to be moved to act. While out walking in Holyrood Park, he sat down by St Anthony's Well and began chatting to some of the beggar boys.
Their conversation convinced him that what was needed was a free school - which included food. So the idea of a ragged school was born, where poverty-stricken scholars received their meals, basic education and some industrial training. He continued to pull juvenile beggars off the street and send them to the school with the words: "Not a sixpence, sir, not a penny, you go to the ragged school and say Dr Guthrie sent you."
Andrew Johnson, manager of the Camera Obscura, which owns the adjacent school, explains: "The Ragged School movement was to do with taking destitute children off the streets. Dr Guthrie published a booklet called the Plea for Ragged Schools in 1847 and he got public support for it.
"He raised about 2000 that year and he opened up the Ramsay Lane Ragged School - you can still see on the outside of the building a carved bible."
He continues: "The Ragged schools cleared the streets of juvenile beggars and it reduced the children in the city's prisons by 75 per cent. The constitution of the school was to reclaim the destitute, and give them the freedom to earn an honest living."
So on the surface it seems unlikely that the Electronic Voice Phenomena workshop which takes place on Wednesday May 16 at Camera Obscura, from 8pm, when investigators will use their scientific recording equipment in an attempt to capture spirit voices, will uncover anything in a place where so much hope and faith in the future was fostered.
But even Andrew, while paying tribute to Guthrie's achievements, admits there is something eerie about the empty sections of the building. He says: "I will be going along to see what goes on in the investigations at the Ragged School. Even here in the Camera Obscura building, we've had eerie things happen. One of our cleaners once saw a lady in a brown dress which really spooked her. In one room, a workman just wouldn't go into it. He just felt it was oppressive and scary.
"We've heard giggling children on our third floor too. And on the back stair, footsteps have been heard. In Camera Obscura we've had visitors who've just had to leave, and somebody has been seen a lot - a man in a grey coat. We didn't tell Ewan this beforehand, and he actually found the man, who is called George."
Ryan says: "On the footage we have, we have a breath which comes into the camcorder - it's right next to the microphone. It was eerie, especially as there were no investigators there at that time."
But even if nothing of the supernatural kind turns up, visitors can at least get a peak of a building which has been closed off to the public for generations.
According to Andrew of Camera Obscura, the public will get access to the first floor of the building which was the old classroom, still with original wood panels on the walls and original flooring - worth seeing as the building is due for a 20m revamp.
"The top floor was some kind of teacher's flat and although the internal walls have been knocked down we did find an old pram which was interesting, as it highlighted that there were families once living here," he adds.
Ewan says: "The public will be going in and, if there is something happening in there, they can experience it with us."
• The third annual Ghost Fest will take place from May 11-20. For more information on individual events visit www.edinburghghostfest.com. To join one of the Camera Obscura and Ragged School events telephone 0131-226 3709 for a range of times, dates and prices.
MAN WITH A VISION
RAGGED schools was the name given to 19th century charity schools which provided free education, food, clothing, and sometimes lodgings for destitute children.
The movement began with disabled shoemaker John Pounds from Portsmouth, but it was Edinburgh philanthropist Thomas Guthrie (1803-1873) who furthered the development and spread of these schools throughout the UK. The schools quickly appeared throughout Scotland.
As well as giving basic education, the ragged schools engaged in a wide variety of social welfare activities.
Dr Guthrie said in his Out of Harness literature: "At length our schools were opened with an attendance of two score boys and girls; and, as these were broken in, we increased the number.
"They all received three good meals; they came to school before breakfast, and left it after supper; they went through daily ablutions: they were trained so many hours to work, and led out so many to walk; they were taught to read, write, and cypher; they received religious instruction - reading, and being examined on the Bible."
Dr Guthrie died aged 70, and plaques to his memory are in St Columba's and Tolbooth St John's.